[
  {
    "path": ".clang-format",
    "content": "BasedOnStyle: Chromium\n"
  },
  {
    "path": ".flake8",
    "content": "[flake8]\n# E501: line too long\n# W504: line break after binary operator\nignore = E501,W504\nexclude = ./third_party ./out\n"
  },
  {
    "path": ".git-blame-ignore-revs",
    "content": "# This file contains a list of commits that are not likely what you\n# are looking for in a blame, such as mass reformatting or renaming.\n# You can set this file as a default ignore file for blame by running\n# the following command.\n#\n# $ git config blame.ignoreRevsFile .git-blame-ignore-revs\n\n# Clang-format codebase\ne59cf9369004a521814222afbc05ae6b59446cd5\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto\n*.c text\n*.h text\n*.js text\n*.l text\n*.md text\n*.py text\n*.rst text\n*.sh text\n*.txt text\n*.y text\ndocs/demo/primer.css binary\ndocs/demo/libwabt.js binary\ndocs/demo/third_party/codemirror/codemirror.css binary\ndocs/demo/third_party/codemirror/codemirror.js binary\n\n# Mark these tests as binary so git doesn't change the line endings:\ntest/parse/bad-crlf.txt binary\ntest/parse/bad-string-eof.txt binary\ntest/regress/regress-31.txt binary\ntest/regress/bad-annotation* binary\ntest/regress/unterminated-annotation* binary\n\n# Highlight tests like .wast files when displayed on GitHub.\ntest/**/*.txt linguist-language=WebAssembly\n\n# Mark test-files as \"vendored\". This tells GitHub to exclude them when it\n# calculates the repository's languages summary, and preserves the current\n# classification as a C++ project. See https://git.io/vr2pO\ntest/**/*.txt linguist-vendored\n"
  },
  {
    "path": ".github/actions/release-archive/action.yml",
    "content": "name: Upload release archive\ndescription: Bundles an archive of artifacts and uploads to a GitHub release. The artifacts must already have been built into the folder \"install\".\ninputs:\n  os:\n    description: The OS runner name being built, used in the archive name\n    required: true\n  upload_to_release:\n    description: Whether to upload the archives to the release\nruns:\n  using: composite\n  steps:\n    - name: archive\n      id: archive\n      shell: bash\n      run: |\n        OSNAME=$(echo ${{ inputs.os }} | sed 's/-latest//')\n        VERSION=${{ github.event.release.tag_name || github.sha }}\n        PKGNAME=\"wabt-$VERSION-$OSNAME\"\n        TARBALL=$PKGNAME.tar.gz\n        SHASUM=$PKGNAME.tar.gz.sha256\n        mv install wabt-$VERSION\n        tar -czf $TARBALL wabt-$VERSION\n        scripts/sha256sum.py $TARBALL > $SHASUM\n        echo \"tarball=$TARBALL\" >> $GITHUB_OUTPUT\n        echo \"shasum=$SHASUM\" >> $GITHUB_OUTPUT\n\n    - name: upload tarball to CI\n      uses: actions/upload-artifact@v4\n      with:\n        name: ${{ steps.archive.outputs.tarball }}\n        path: ./${{ steps.archive.outputs.tarball }}\n\n    - name: upload tarball to release\n      uses: svenstaro/upload-release-action@v2\n      if: ${{ inputs.upload_to_release }}\n      with:\n        file: ./${{ steps.archive.outputs.tarball }}\n        asset_name: ${{ steps.archive.outputs.tarball }}\n        tag: ${{ github.ref }}\n\n    - name: upload shasum\n      uses: svenstaro/upload-release-action@v2\n      if: ${{ inputs.upload_to_release }}\n      with:\n        file: ./${{ steps.archive.outputs.shasum }}\n        asset_name: ${{ steps.archive.outputs.shasum }}\n        tag: ${{ github.ref }}\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "content": "name: CI\n\non:\n  create:\n    tags:\n  push:\n    branches:\n      - main\n  pull_request:\n\njobs:\n  lint:\n    name: lint\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/setup-python@v1\n      with:\n        python-version: '3.x'\n    - uses: actions/checkout@v1\n    - name: install tools\n      run: |\n        pip3 install flake8==7.3.0\n        sudo apt-get install clang-format\n    - run: flake8\n    - run: ./scripts/clang-format-diff.sh\n      env:\n        GITHUB_EVENT_BEFORE: ${{ github.event.before }}\n  build:\n    name: build\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        os: [ubuntu-latest, macos-latest, windows-latest]\n    steps:\n    - uses: actions/setup-python@v5\n      with:\n        python-version: '3.x'\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n    - name: install ninja (linux)\n      run: sudo apt-get install ninja-build\n      if: matrix.os == 'ubuntu-latest'\n    - name: install ninja (osx)\n      run: brew install ninja\n      if: matrix.os == 'macos-latest'\n    - name: install ninja (win)\n      run: choco install ninja\n      if: matrix.os == 'windows-latest'\n    - name: mkdir\n      run: mkdir -p out\n    - name: tool versions\n      run: |\n        cmake --version\n        ninja --version\n    - name: cmake\n      run: cmake .. -G Ninja -DWERROR=ON -Werror=dev -DCMAKE_ERROR_DEPRECATED=OFF\n      working-directory: out\n      if: matrix.os != 'windows-latest'\n    - name: cmake (windows)\n      run: cmake .. -DWERROR=ON -Werror=dev -DCMAKE_ERROR_DEPRECATED=OFF\n      working-directory: out\n      if: matrix.os == 'windows-latest'\n    - name: build\n      run: cmake --build out\n    - name: check if generated files are up-to-date\n      run: python ./scripts/check_clean.py\n    - name: unittests\n      run: cmake --build out --target run-unittests\n    - name: c-api-tests\n      run: cmake --build out --target run-c-api-tests\n    - name: tests\n      run: cmake --build out --target run-tests\n  emscripten:\n    name: emscripten\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n    - name: build\n      run: |\n        docker run -di --name emscripten -v $(pwd):/src emscripten/emsdk:latest bash\n        docker exec emscripten emcc -v\n        docker exec emscripten emcmake cmake -B emscripten -DWERROR=ON\n        docker exec -w /src/emscripten emscripten make -j $(nproc)\n\n  wasi:\n    name: wasi\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          submodules: true\n      - name: build-tools\n        run: |\n          docker run -di --name wasi-sdk -v $(pwd):/src --workdir /src ghcr.io/webassembly/wasi-sdk:wasi-sdk-20 bash\n          docker exec wasi-sdk cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DBUILD_TESTS=0 -DBUILD_LIBWASM=0\n          docker exec wasi-sdk cmake --build out --config Release --target install\n      - uses: ./.github/actions/release-archive\n        with:\n          os: wasi\n\n  sanitize:\n    name: sanitize\n    runs-on: ubuntu-24.04\n    env:\n      USE_NINJA: \"1\"\n      CC: \"clang\"\n      WASM2C_CFLAGS: \"-march=x86-64-v2\" # currently required for SIMDe to pass some tests on x86-64\n    strategy:\n      matrix:\n        sanitizer: [asan, ubsan, fuzz]\n        type: [debug, release]\n    steps:\n    - uses: actions/setup-python@v1\n      with:\n        python-version: '3.x'\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n    - run: sudo apt-get install ninja-build\n    - name: workaround for ASLR+ASAN compatibility # See https://github.com/actions/runner/issues/3207\n      run: sudo sysctl -w vm.mmap_rnd_bits=28\n    - run: make clang-${{ matrix.type }}-${{ matrix.sanitizer }}\n    - if: ${{ matrix.sanitizer }} != fuzz\n      run: make test-clang-${{ matrix.type }}-${{ matrix.sanitizer }}\n  build-wasm2c-memchecked:\n    name: wasm2c-memchecked\n    runs-on: ubuntu-latest\n    env:\n      USE_NINJA: \"1\"\n      CC: \"clang\" # used by the wasm2c tests\n      WASM2C_CFLAGS: \"-march=x86-64-v2 -fsanitize=address -DWASM_RT_USE_MMAP=0\"\n    steps:\n    - uses: actions/setup-python@v1\n      with:\n        python-version: '3.x'\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n    - run: sudo apt-get install ninja-build\n    - name: workaround for ASLR+ASAN compatibility # See https://github.com/actions/runner/issues/3207\n      run: sudo sysctl -w vm.mmap_rnd_bits=28\n    - run: make clang-debug-asan\n    - run: make test-clang-debug-asan\n\n  build-min-cmake:\n    name: min-cmake\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n    - uses: actions/setup-python@v1\n      with:\n        python-version: '3.x'\n    - name: Install Ninja\n      run: sudo apt-get install ninja-build\n    - name: Detect minimum CMake version\n      run: >\n        awk 'match($0, /cmake_minimum_required\\(VERSION *([0-9]+\\.[0-9]+)\\)/, a)\n        { print \"WABT_CMAKE_VER=\" a[1]; exit; }' CMakeLists.txt | tee $GITHUB_ENV\n    - name: Install minimum CMake\n      run: |\n        python -m pip install -U setuptools wheel pip\n        python -m pip install \"cmake==${WABT_CMAKE_VER}.*\"\n        cmake --version\n\n    - name: configure (OpenSSL)\n      run: cmake -G Ninja -S . -B out -DCMAKE_BUILD_TYPE=Release\n    - name: build (OpenSSL)\n      run: cmake --build out\n    - name: install (OpenSSL)\n      run: cmake --install out --prefix install\n\n    - name: configure (PicoSHA2)\n      run: cmake -G Ninja -S . -B out-picosha -DCMAKE_BUILD_TYPE=Release -DUSE_INTERNAL_SHA256=ON\n    - name: build (PicoSHA2)\n      run: cmake --build out-picosha\n    - name: install (PicoSHA2)\n      run: cmake --install out-picosha --prefix install-picosha\n\n    - name: test CMake package (OpenSSL)\n      run: >\n        ctest --build-and-test scripts/example-project example-openssl\n        --build-generator Ninja\n        --build-options -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$PWD/install\n        --test-command ctest\n\n    - name: test CMake package (PicoSHA2)\n      run: >\n        ctest --build-and-test scripts/example-project example-picosha\n        --build-generator Ninja\n        --build-options -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$PWD/install-picosha\n        --test-command ctest\n\n    - name: unittests\n      run: cmake --build out --target run-unittests\n    - name: c-api-tests\n      run: cmake --build out --target run-c-api-tests\n    - name: tests\n      run: cmake --build out --target run-tests\n  build-rlbox:\n    name: rlbox\n    runs-on: ubuntu-latest\n    env:\n      USE_NINJA: \"1\"\n      WASM2C_CC: \"clang\"\n      WASM2C_CFLAGS: \"-DWASM_RT_USE_MMAP=1 -DWASM_RT_SKIP_SIGNAL_RECOVERY=1 -DWASM_RT_NONCONFORMING_UNCHECKED_STACK_EXHAUSTION=1 -DWASM2C_TEST_EMBEDDER_SIGNAL_HANDLING -DWASM_RT_ALLOW_SEGUE=1 -DWASM_RT_SEGUE_FREE_SEGMENT=1 -mfsgsbase -DWASM_RT_SANITY_CHECKS=1 -Wno-pass-failed\"\n    steps:\n    - uses: actions/setup-python@v1\n      with:\n        python-version: '3.x'\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n    - run: sudo apt-get install ninja-build\n    - run: make clang-debug\n    - name: tests (wasm2c tests excluding memory64)\n      run: ./test/run-tests.py wasm2c --exclude-dir memory64\n\n  build-cross:\n    runs-on: ubuntu-latest\n    # Temporatily disabled until we can get it fixed:\n    # https://github.com/WebAssembly/wabt/issues/2655\n    if: ${{ false }}\n    strategy:\n      fail-fast: false\n      matrix:\n        arch: [s390x]\n    services: # still faster on debian...\n      distcc:\n        image: debian:latest\n        options: --health-cmd distccmon-text --health-interval 5s --health-start-period 5m debian:latest bash -c \"apt-get update && apt-get install -y g++-s390x-linux-gnu distcc && distccd --daemon --no-detach\"\n        ports:\n          - 3632:3632\n    env:\n      QEMU_LD_PREFIX: /usr/${{matrix.arch}}-linux-gnu/\n    steps:\n    - uses: actions/setup-python@v1\n      with:\n        python-version: '3.x'\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n    - name: Set up QEMU\n      uses: docker/setup-qemu-action@v2\n      with:\n        platforms: ${{matrix.arch}}\n        image: \"tonistiigi/binfmt:master\"\n    - name: apt-get update\n      run: sudo apt-get update\n    - name: install ninja\n      run: sudo apt-get install ninja-build\n    - name: install the toolchain\n      run: sudo apt-get install g++-${{matrix.arch}}-linux-gnu\n    - name: install distcc\n      run: sudo apt-get install distcc\n    - name: mkdir distcc symlinks\n      run: sudo mkdir -p /opt/bin/distcc_symlinks\n    - name: distcc symlink\n      run: sudo ln -s /usr/bin/distcc /opt/bin/distcc_symlinks/${{matrix.arch}}-linux-gnu-gcc # only CC is needed\n    - name: cmake\n      run: cmake -S . -B out -G Ninja -DCMAKE_TOOLCHAIN_FILE=../scripts/TC-${{matrix.arch}}.cmake -DWERROR=OFF -Werror=dev -DCMAKE_ERROR_DEPRECATED=OFF\n    - name: build\n      run: cmake --build out\n    - name: check if generated files are up-to-date\n      run: python ./scripts/check_clean.py\n    - name: unittests\n      run: cmake --build out --target run-unittests\n    - name: tests\n      run: cmake --build out --target run-tests\n"
  },
  {
    "path": ".github/workflows/build_release.yml",
    "content": "name: Build Release\n\n# Trigger whenever a release is created\non:\n  release:\n    types:\n      - created\n\npermissions:\n  contents: write\n\njobs:\n  build:\n    name: build\n    runs-on: ${{ matrix.os }}\n    strategy:\n      fail-fast: false\n      matrix:\n        include:\n          - os: ubuntu-22.04\n            arch: x86_64\n            name: linux-x64\n          - os: ubuntu-22.04-arm\n            arch: aarch64\n            name: linux-arm64\n          - os: macos-14\n            arch: aarch64\n            name: macos-arm64\n          - os: windows-latest\n            arch: x86_64\n            name: windows-x64\n    defaults:\n      run:\n        shell: bash\n    steps:\n    - uses: actions/setup-python@v5\n      with:\n        python-version: '3.x'\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n\n    - name: install ninja (linux)\n      run: sudo apt-get install ninja-build\n      if: contains(matrix.os, 'ubuntu')\n\n    - name: install ninja (osx)\n      run: brew install ninja\n      if: matrix.os == 'macos-14'\n\n    - name: install ninja (win)\n      run: choco install ninja\n      if: matrix.os == 'windows-latest'\n\n    - name: mkdir\n      run: mkdir -p out\n\n    - name: cmake (unix)\n      run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install\n      if: matrix.os != 'windows-latest'\n\n    - name: cmake (win)\n      # -G \"Visual Studio 15 2017\"\n      run: cmake -S . -B out -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install\n      if: matrix.os == 'windows-latest'\n\n    - name: build\n      run: cmake --build out --config Release --target install\n\n    - name: strip\n      run: find bin/ -type f -perm -u=x -exec strip {} +\n      if: matrix.os != 'windows-latest'\n\n    - uses: ./.github/actions/release-archive\n      with:\n        os: ${{ matrix.name }}\n        upload_to_release: true\n\n  build-wasi:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n      with:\n        submodules: true\n\n    - name: built-tools\n      run: |\n        docker run -di --name wasi-sdk -v $(pwd):/src --workdir /src ghcr.io/webassembly/wasi-sdk:wasi-sdk-20 bash\n        docker exec wasi-sdk cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DBUILD_TESTS=0 -DBUILD_LIBWASM=0\n        docker exec wasi-sdk cmake --build out --config Release --target install\n\n    - uses: ./.github/actions/release-archive\n      with:\n        os: wasi\n        upload_to_release: true\n"
  },
  {
    "path": ".github/workflows/build_source_release.yml",
    "content": "name: Build Source Release\n\n# Trigger whenever a release is created\non:\n  release:\n    types:\n      - created\n\npermissions:\n  contents: write\n\njobs:\n  build:\n    name: build\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/setup-python@v1\n      with:\n        python-version: '3.x'\n\n    - uses: actions/checkout@v1\n      with:\n        submodules: true\n\n    - name: archive\n      id: archive\n      run: |\n        VERSION=${{ github.event.release.tag_name }}\n        PKGNAME=\"wabt-$VERSION\"\n        mkdir -p /tmp/$PKGNAME\n        mv * /tmp/$PKGNAME\n        mv /tmp/$PKGNAME .\n        TARBALL=$PKGNAME.tar.xz\n        SHASUM=$PKGNAME.tar.xz.sha256\n        tar cJf $TARBALL $PKGNAME\n        $PKGNAME/scripts/sha256sum.py $TARBALL > $SHASUM\n        echo \"::set-output name=tarball::$TARBALL\"\n        echo \"::set-output name=shasum::$SHASUM\"\n\n    - name: upload tarball\n      uses: svenstaro/upload-release-action@v2\n      with:\n        repo_token: ${{ secrets.GITHUB_TOKEN }}\n        file: ./${{ steps.archive.outputs.tarball }}\n        asset_name: ${{ steps.archive.outputs.tarball }}\n        tag: ${{ github.ref }}\n\n    - name: upload shasum\n      uses: svenstaro/upload-release-action@v2\n      with:\n        repo_token: ${{ secrets.GITHUB_TOKEN }}\n        file: ./${{ steps.archive.outputs.shasum }}\n        asset_name: ${{ steps.archive.outputs.shasum }}\n        tag: ${{ github.ref }}\n"
  },
  {
    "path": ".github/workflows/wabt-cifuzz.yml",
    "content": "name: CIFuzz\non: [pull_request]\njobs:\n  Fuzzing:\n    runs-on: ubuntu-latest\n    steps:\n    - name: Build Fuzzers\n      id: build\n      uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master\n      with:\n        oss-fuzz-project-name: 'wabt'\n    - name: Run Fuzzers\n      uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master\n      with:\n        oss-fuzz-project-name: 'wabt'\n        fuzz-seconds: 300\n    - name: Upload Crash\n      uses: actions/upload-artifact@v4\n      if: failure() && steps.build.outcome == 'success'\n      with:\n        name: artifacts\n        path: ./out/artifacts\n"
  },
  {
    "path": ".gitignore",
    "content": "/bin\n/build\n/out\n/fuzz-out\n/emscripten\n*.pyc\n.idea/\n.vscode/\n/cmake-build-debug/\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"third_party/testsuite\"]\n\tpath = third_party/testsuite\n\turl = https://github.com/WebAssembly/testsuite\n[submodule \"third_party/gtest\"]\n\tpath = third_party/gtest\n\turl = https://github.com/google/googletest\n[submodule \"third_party/ply\"]\n\tpath = third_party/ply\n\turl = https://github.com/dabeaz/ply\n[submodule \"third_party/wasm-c-api\"]\n\tpath = third_party/wasm-c-api\n\turl = https://github.com/WebAssembly/wasm-c-api\n[submodule \"third_party/uvwasi\"]\n\tpath = third_party/uvwasi\n\turl = https://github.com/nodejs/uvwasi\n[submodule \"third_party/picosha2\"]\n\tpath = third_party/picosha2\n\turl = https://github.com/okdshin/PicoSHA2\n[submodule \"third_party/simde\"]\n\tpath = third_party/simde\n\turl = https://github.com/simd-everywhere/simde\n"
  },
  {
    "path": ".style.yapf",
    "content": "[style]\nsplit_before_named_assigns = False\nbased_on_style = chromium\ncolumn_limit = 79\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ncmake_minimum_required(VERSION 3.16)\nproject(WABT LANGUAGES C CXX VERSION 1.0.40)\n\ninclude(GNUInstallDirs)\n\nset(CMAKE_CXX_STANDARD 17)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\n\nset(CMAKE_EXPORT_COMPILE_COMMANDS ON)\n\n# 10.13 doesn't support std::optional::value (becuase it depends on\n# std::bad_optional_acces).\n# See: https://github.com/WebAssembly/wabt/issues/2527\nset(CMAKE_OSX_DEPLOYMENT_TARGET \"10.14\" CACHE STRING \"Minimum OS X deployment version\")\n\n# Check if wabt is being used directly or via add_subdirectory, FetchContent, etc\nstring(COMPARE EQUAL \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_SOURCE_DIR}\" PROJECT_IS_TOP_LEVEL)\n\n# By default use the project version as the version string\nset(WABT_VERSION_STRING \"${PROJECT_VERSION}\")\n\n# For git users, attempt to generate a more useful version string\nif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)\n  find_package(Git)\n  if (Git_FOUND)\n    execute_process(\n      COMMAND \"${GIT_EXECUTABLE}\" -C \"${WABT_SOURCE_DIR}\" describe --tags\n      RESULT_VARIABLE GIT_VERSION_RESULT\n      ERROR_VARIABLE GIT_VERSION_ERROR\n      ERROR_STRIP_TRAILING_WHITESPACE\n      OUTPUT_VARIABLE GIT_VERSION\n      OUTPUT_STRIP_TRAILING_WHITESPACE\n    )\n    if (GIT_VERSION_RESULT EQUAL 0)\n      # If we're actually on the tag for this version, don't add the commit description\n      if (NOT GIT_VERSION STREQUAL \"${WABT_VERSION_STRING}\")\n        string(APPEND WABT_VERSION_STRING \" (git~${GIT_VERSION})\")\n      endif ()\n    elseif (PROJECT_IS_TOP_LEVEL)\n      message(NOTICE \"git: ${GIT_VERSION_ERROR}\\n  ** Did you forget to run `git fetch --tags`?\")\n    endif ()\n  endif ()\nendif ()\n\noption(BUILD_TESTS \"Build GTest-based tests\" ON)\noption(USE_SYSTEM_GTEST \"Use system GTest, instead of building\" OFF)\noption(BUILD_TOOLS \"Build wabt commandline tools\" ON)\noption(BUILD_FUZZ_TOOLS \"Build tools that can repro fuzz bugs\" OFF)\noption(BUILD_LIBWASM \"Build libwasm\" ON)\noption(USE_ASAN \"Use address sanitizer\" OFF)\noption(USE_MSAN \"Use memory sanitizer\" OFF)\noption(USE_LSAN \"Use leak sanitizer\" OFF)\noption(USE_UBSAN \"Use undefined behavior sanitizer\" OFF)\noption(CODE_COVERAGE \"Build with code coverage enabled\" OFF)\noption(WITH_EXCEPTIONS \"Build with exceptions enabled\" OFF)\noption(WERROR \"Build with warnings as errors\" OFF)\noption(WABT_INSTALL_RULES \"Include WABT's install() rules\" \"${PROJECT_IS_TOP_LEVEL}\")\n# WASI support is still a work in progress.\n# Only a handful of syscalls are supported at this point.\noption(WITH_WASI \"Build WASI support via uvwasi\" OFF)\noption(USE_INTERNAL_SHA256 \"Use internal PicoSHA2 for SHA-256 support instead of OpenSSL libcrypto\" OFF)\n\nif (MSVC)\n  set(COMPILER_IS_CLANG 0)\n  set(COMPILER_IS_GNU 0)\n  set(COMPILER_IS_MSVC 1)\nelseif (CMAKE_C_COMPILER_ID MATCHES \"Clang\")\n  set(COMPILER_IS_CLANG 1)\n  set(COMPILER_IS_GNU 0)\n  set(COMPILER_IS_MSVC 0)\nelseif (CMAKE_C_COMPILER_ID STREQUAL \"GNU\")\n  set(COMPILER_IS_CLANG 0)\n  set(COMPILER_IS_GNU 1)\n  set(COMPILER_IS_MSVC 0)\nelseif (CMAKE_SYSTEM_NAME STREQUAL \"Emscripten\")\n  set(COMPILER_IS_CLANG 1)\n  set(COMPILER_IS_GNU 0)\n  set(COMPILER_IS_MSVC 0)\nelse ()\n  set(COMPILER_IS_CLANG 0)\n  set(COMPILER_IS_GNU 0)\n  set(COMPILER_IS_MSVC 0)\nendif ()\n\ninclude(CheckIncludeFile)\ninclude(CheckSymbolExists)\n\ncheck_include_file(\"alloca.h\" HAVE_ALLOCA_H)\ncheck_include_file(\"unistd.h\" HAVE_UNISTD_H)\ncheck_include_file(\"setjmp.h\" HAVE_SETJMP_H)\ncheck_symbol_exists(snprintf \"stdio.h\" HAVE_SNPRINTF)\ncheck_symbol_exists(strcasecmp \"strings.h\" HAVE_STRCASECMP)\n\nif (NOT USE_INTERNAL_SHA256)\n  find_package(OpenSSL QUIET)\n  if (OpenSSL_FOUND)\n    set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})\n    check_include_file(\"openssl/sha.h\" HAVE_OPENSSL_SHA_H)\n    if (HAVE_OPENSSL_SHA_H)\n      find_package_message(OpenSSL \"Using OpenSSL libcrypto for SHA-256\" \"${HAVE_OPENSSL_SHA_H}\")\n    endif()\n  endif()\nendif()\n\nif (WIN32)\n  if(${CMAKE_GENERATOR_PLATFORM} MATCHES \"ARM64\")\n    # https://discourse.cmake.org/t/visual-studio-error-unable-to-deploy-local-file-c-x64-release-zero-check/2072\n    # Target ZERO_CHECK blocks remote debugger of ARM64 in Visual Studio\n    set(CMAKE_SUPPRESS_REGENERATION ON)\n  endif()\n  check_symbol_exists(ENABLE_VIRTUAL_TERMINAL_PROCESSING \"windows.h\" HAVE_WIN32_VT100)\nendif ()\n\ninclude(CheckTypeSize)\ncheck_type_size(ssize_t SSIZE_T)\ncheck_type_size(size_t SIZEOF_SIZE_T)\n\ninclude(TestBigEndian)  # Note: deprecated in CMake 3.20\ntest_big_endian(WABT_BIG_ENDIAN)\n\nif (CMAKE_BUILD_TYPE STREQUAL \"Debug\")\n  set(WABT_DEBUG 1)\nendif ()\n\nconfigure_file(src/config.h.in include/wabt/config.h @ONLY)\n\n\nif (COMPILER_IS_MSVC)\n  if (WERROR)\n    add_definitions(-WX)\n  endif ()\n\n  # disable warning C4018: signed/unsigned mismatch\n  # disable warning C4056, C4756: overflow in floating-point constant arithmetic\n  #   seems to not like float compare w/ HUGE_VALF; bug?\n  # disable warnings C4267 and C4244: conversion/truncation from larger to smaller type.\n  # disable warning C4800: implicit conversion from larger int to bool\n  add_definitions(-W3 -wd4018 -wd4056 -wd4756 -wd4267 -wd4244 -wd4800 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)\n\n  if (NOT WITH_EXCEPTIONS)\n    # disable exception use in C++ library\n    add_definitions(-D_HAS_EXCEPTIONS=0)\n  endif ()\n\n  # multi-core build.\n  add_definitions(\"/MP\")\n\nelse ()\n  if (WERROR)\n    add_definitions(-Werror)\n  endif ()\n\n  # disable -Wunused-parameter: this is really common when implementing\n  #   interfaces, etc.\n  # disable -Wpointer-arith: this is a GCC extension, and doesn't work in MSVC.\n  add_definitions(\n    -Wall -Wextra -Wno-unused-parameter -Wpointer-arith -Wuninitialized -Wimplicit-fallthrough\n  )\n\n  set(CMAKE_CXX_EXTENSIONS OFF)\n  set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -Wold-style-cast\")\n\n  if (NOT WITH_EXCEPTIONS)\n    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -fno-exceptions\")\n  endif ()\n\n  # Need to define __STDC_*_MACROS because C99 specifies that C++ shouldn't\n  # define format (e.g. PRIu64) or limit (e.g. UINT32_MAX) macros without the\n  # definition, and some libcs (e.g. glibc2.17 and earlier) follow that.\n  add_definitions(-D__STDC_LIMIT_MACROS=1 -D__STDC_FORMAT_MACROS=1)\n\n  if (MINGW OR CYGWIN)\n    # On MINGW, _POSIX_C_SOURCE is needed to ensure we use mingw printf\n    # instead of the VC runtime one.\n    add_definitions(-D_POSIX_C_SOURCE=200809L)\n  endif()\n\n  if (COMPILER_IS_GNU)\n    # disable -Wclobbered: it seems to be guessing incorrectly about a local\n    # variable being clobbered by longjmp.\n    add_definitions(-Wno-clobbered)\n  endif ()\n\n  # wasm doesn't allow for x87 floating point math\n  if (NOT EMSCRIPTEN)\n    check_symbol_exists(__i386__ \"\" TARGET_IS_X86_32)\n    check_symbol_exists(__SSE2_MATH__ \"\" HAVE_SSE2_MATH)\n\n    if (TARGET_IS_X86_32 AND NOT HAVE_SSE2_MATH)\n      if (COMPILER_IS_GNU OR COMPILER_IS_CLANG)\n        add_compile_options(-msse2 -mfpmath=sse)\n      else ()\n        message(\n          WARNING\n          \"Unknown compiler ${CMAKE_CXX_COMPILER_ID} appears to target x86-32 with x87 \"\n          \"math. If you want wasm2c to work in a spec-compliant way, please add flags to \"\n          \"use SSE2 math and set TARGET_IS_X86_32 and HAVE_SSE2_MATH appropriately at the \"\n          \"CMake command line.\"\n        )\n      endif ()\n    endif ()\n  endif ()\nendif ()\n\nset(USE_SANITIZER FALSE)\n\nfunction(sanitizer NAME FLAGS)\n  if (${NAME})\n    if (USE_SANITIZER)\n      message(FATAL_ERROR \"Only one sanitizer allowed\")\n    endif ()\n    set(USE_SANITIZER TRUE PARENT_SCOPE)\n    set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${FLAGS}\" PARENT_SCOPE)\n    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${FLAGS}\" PARENT_SCOPE)\n    set(WASM2C_CFLAGS \"${WASM2C_CFLAGS} ${FLAGS}\" PARENT_SCOPE)\n  endif ()\nendfunction()\nsanitizer(USE_ASAN \"-fsanitize=address\")\nsanitizer(USE_MSAN \"-fsanitize=memory\")\nsanitizer(USE_LSAN \"-fsanitize=leak\")\n\nif (USE_UBSAN)\n  # -fno-sanitize-recover was deprecated, see if we are compiling with a newer\n  # clang that requires -fno-sanitize-recover=all.\n  set(UBSAN_BLACKLIST ${WABT_SOURCE_DIR}/ubsan.blacklist)\n  include(CheckCXXCompilerFlag)\n  check_cxx_compiler_flag(\"-fsanitize=undefined -fno-sanitize-recover -Wall -Werror\" HAS_UBSAN_RECOVER_BARE)\n  if (HAS_UBSAN_RECOVER_BARE)\n    sanitizer(USE_UBSAN \"-fsanitize=undefined -fno-sanitize-recover -fsanitize-blacklist=${UBSAN_BLACKLIST}\")\n  endif ()\n  check_cxx_compiler_flag(\"-fsanitize=undefined -fno-sanitize-recover=all -Wall -Werror\" HAS_UBSAN_RECOVER_ALL)\n  # If we already setup UBSAN recover bare, setting it up again here will be an error.\n  if (NOT USE_SANITIZER AND HAS_UBSAN_RECOVER_ALL)\n    sanitizer(USE_UBSAN \"-fsanitize=undefined -fno-sanitize-recover=all -fsanitize-blacklist=${UBSAN_BLACKLIST}\")\n  endif ()\n  if (NOT USE_SANITIZER)\n    message(FATAL_ERROR \"UBSAN is not supported\")\n  endif ()\nendif ()\n\nset(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${WABT_SOURCE_DIR}/cmake)\n\n# CWriter code templates\nset(TEMPLATE_CMAKE ${WABT_SOURCE_DIR}/scripts/gen-wasm2c-templates.cmake)\n\nadd_custom_command(\n  OUTPUT gen-wasm2c-prebuilt\n\n  COMMAND ${CMAKE_COMMAND} -D out=\"${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_header_top.cc\" -D in=\"${WABT_SOURCE_DIR}/src/template/wasm2c.top.h\" -D symbol=\"s_header_top\" -P ${TEMPLATE_CMAKE}\n  COMMAND ${CMAKE_COMMAND} -D out=\"${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_header_bottom.cc\" -D in=\"${WABT_SOURCE_DIR}/src/template/wasm2c.bottom.h\" -D symbol=\"s_header_bottom\" -P ${TEMPLATE_CMAKE}\n  COMMAND ${CMAKE_COMMAND} -D out=\"${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_source_includes.cc\" -D in=\"${WABT_SOURCE_DIR}/src/template/wasm2c.includes.c\" -D symbol=\"s_source_includes\" -P ${TEMPLATE_CMAKE}\n  COMMAND ${CMAKE_COMMAND} -D out=\"${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_source_declarations.cc\" -D in=\"${WABT_SOURCE_DIR}/src/template/wasm2c.declarations.c\" -D symbol=\"s_source_declarations\" -P ${TEMPLATE_CMAKE}\n  COMMAND ${CMAKE_COMMAND} -D out=\"${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_simd_source_declarations.cc\" -D in=\"${WABT_SOURCE_DIR}/src/template/wasm2c_simd.declarations.c\" -D symbol=\"s_simd_source_declarations\" -P ${TEMPLATE_CMAKE}\n  COMMAND ${CMAKE_COMMAND} -D out=\"${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_atomicops_source_declarations.cc\" -D in=\"${WABT_SOURCE_DIR}/src/template/wasm2c_atomicops.declarations.c\" -D symbol=\"s_atomicops_source_declarations\" -P ${TEMPLATE_CMAKE}\n  COMMAND ${CMAKE_COMMAND} -E touch gen-wasm2c-prebuilt\n\n  DEPENDS ${WABT_SOURCE_DIR}/src/template/wasm2c.top.h\n  ${WABT_SOURCE_DIR}/src/template/wasm2c.bottom.h\n  ${WABT_SOURCE_DIR}/src/template/wasm2c.includes.c\n  ${WABT_SOURCE_DIR}/src/template/wasm2c.declarations.c\n  ${WABT_SOURCE_DIR}/src/template/wasm2c_simd.declarations.c\n  ${WABT_SOURCE_DIR}/src/template/wasm2c_atomicops.declarations.c\n)\n\nadd_custom_target(gen-wasm2c-prebuilt-target DEPENDS gen-wasm2c-prebuilt)\n\nset(CWRITER_TEMPLATE_SRC ${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_header_top.cc\n                         ${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_header_bottom.cc\n                         ${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_source_includes.cc\n                         ${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_source_declarations.cc\n                         ${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_simd_source_declarations.cc\n                         ${WABT_SOURCE_DIR}/src/prebuilt/wasm2c_atomicops_source_declarations.cc)\n\nadd_custom_target(everything)\n\nset(WABT_LIBRARY_CC\n  src/apply-names.cc\n  src/binary-reader-ir.cc\n  src/binary-reader-logging.cc\n  src/binary-reader.cc\n  src/binary-writer-spec.cc\n  src/binary-writer.cc\n  src/binary.cc\n  src/binding-hash.cc\n  src/color.cc\n  src/common.cc\n  src/config.cc\n  src/config.h.in\n  src/decompiler.cc\n  src/error-formatter.cc\n  src/expr-visitor.cc\n  src/feature.cc\n  src/filenames.cc\n  src/generate-names.cc\n  src/ir-util.cc\n  src/ir.cc\n  src/leb128.cc\n  src/lexer-source-line-finder.cc\n  src/lexer-source.cc\n  src/literal.cc\n  src/opcode-code-table.c\n  src/opcode.cc\n  src/option-parser.cc\n  src/resolve-names.cc\n  src/sha256.cc\n  src/shared-validator.cc\n  src/stream.cc\n  src/token.cc\n  src/tracing.cc\n  src/type-checker.cc\n  src/utf8.cc\n  src/validator.cc\n  src/wast-lexer.cc\n  src/wast-parser.cc\n  src/wat-writer.cc\n  src/c-writer.cc\n  ${CWRITER_TEMPLATE_SRC}\n\n  # TODO(binji): Move this into its own library?\n  src/interp/binary-reader-interp.cc\n  src/interp/interp.cc\n  src/interp/interp-util.cc\n  src/interp/istream.cc\n)\n\nset(WABT_LIBRARY_H\n  ${WABT_BINARY_DIR}/include/wabt/config.h\n\n  include/wabt/apply-names.h\n  include/wabt/binary-reader-ir.h\n  include/wabt/binary-reader-logging.h\n  include/wabt/binary-reader.h\n  include/wabt/binary-writer-spec.h\n  include/wabt/binary-writer.h\n  include/wabt/binary.h\n  include/wabt/binding-hash.h\n  include/wabt/color.h\n  include/wabt/common.h\n  include/wabt/decompiler-ast.h\n  include/wabt/decompiler-ls.h\n  include/wabt/decompiler-naming.h\n  include/wabt/decompiler.h\n  include/wabt/error-formatter.h\n  include/wabt/expr-visitor.h\n  include/wabt/feature.h\n  include/wabt/filenames.h\n  include/wabt/generate-names.h\n  include/wabt/ir-util.h\n  include/wabt/ir.h\n  include/wabt/leb128.h\n  include/wabt/lexer-source-line-finder.h\n  include/wabt/lexer-source.h\n  include/wabt/literal.h\n  include/wabt/opcode-code-table.h\n  include/wabt/opcode.h\n  include/wabt/option-parser.h\n  include/wabt/resolve-names.h\n  include/wabt/sha256.h\n  include/wabt/shared-validator.h\n  include/wabt/stream.h\n  include/wabt/string-util.h\n  include/wabt/token.h\n  include/wabt/tracing.h\n  include/wabt/type-checker.h\n  include/wabt/type.h\n  include/wabt/utf8.h\n  include/wabt/validator.h\n  include/wabt/wast-lexer.h\n  include/wabt/wast-parser.h\n  include/wabt/wat-writer.h\n\n  # TODO(binji): Move this into its own library?\n  include/wabt/interp/binary-reader-interp.h\n  include/wabt/interp/interp-inl.h\n  include/wabt/interp/interp-math.h\n  include/wabt/interp/interp-util.h\n  include/wabt/interp/interp.h\n  include/wabt/interp/istream.h\n)\n\nset(WABT_LIBRARY_SRC ${WABT_LIBRARY_CC} ${WABT_LIBRARY_H})\n\nadd_library(wabt STATIC ${WABT_LIBRARY_SRC})\nadd_dependencies(wabt gen-wasm2c-prebuilt-target)\nadd_library(wabt::wabt ALIAS wabt)\n\nif (HAVE_OPENSSL_SHA_H)\n  target_link_libraries(wabt OpenSSL::Crypto)\nelse()\n  include_directories(\"${WABT_SOURCE_DIR}/third_party/picosha2\")\nendif()\n\ntarget_compile_features(wabt PUBLIC cxx_std_17)\ntarget_include_directories(\n  wabt\n  PUBLIC\n  \"$<BUILD_INTERFACE:${WABT_SOURCE_DIR}/include>\"\n  \"$<BUILD_INTERFACE:${WABT_BINARY_DIR}/include>\"\n)\n\nif (WABT_INSTALL_RULES)\n  install(\n    TARGETS wabt EXPORT wabt-targets\n    COMPONENT wabt-development\n    INCLUDES DESTINATION \"${CMAKE_INSTALL_INCLUDEDIR}\"\n  )\n  install(\n    DIRECTORY \"${WABT_SOURCE_DIR}/include/\" \"${WABT_BINARY_DIR}/include/\"\n    DESTINATION \"${CMAKE_INSTALL_INCLUDEDIR}\"\n    COMPONENT wabt-development\n  )\nendif ()\n\nif (HAVE_SETJMP_H)\n  set(WASM_RT_FILES \"wasm2c/wasm-rt-impl.h\" \"wasm2c/wasm-rt-impl.c\" \"wasm2c/wasm-rt-exceptions-impl.c\" \"wasm2c/wasm-rt-mem-impl.c\" \"wasm2c/wasm-rt-impl-tableops.inc\" \"wasm2c/wasm-rt-mem-impl-helper.inc\")\n\n  add_library(wasm-rt-impl STATIC ${WASM_RT_FILES})\n  target_link_libraries(wasm-rt-impl ${CMAKE_THREAD_LIBS_INIT})\n  add_library(wabt::wasm-rt-impl ALIAS wasm-rt-impl)\n  if (WABT_BIG_ENDIAN)\n    target_compile_definitions(wasm-rt-impl PUBLIC WABT_BIG_ENDIAN=1)\n  endif ()\n\n  if (WABT_INSTALL_RULES)\n    install(\n      TARGETS wasm-rt-impl\n      EXPORT wabt-targets\n      COMPONENT wabt-development\n      INCLUDES DESTINATION \"${CMAKE_INSTALL_INCLUDEDIR}\"\n    )\n    install(\n      FILES \"wasm2c/wasm-rt.h\" \"wasm2c/wasm-rt-exceptions.h\"\n      TYPE INCLUDE\n      COMPONENT wabt-development\n    )\n    install(\n      FILES ${WASM_RT_FILES}\n      DESTINATION \"${CMAKE_INSTALL_DATADIR}/wabt/wasm2c\"\n      COMPONENT wabt-development\n    )\n  endif ()\nendif ()\n\nif (BUILD_FUZZ_TOOLS)\n  set(FUZZ_FLAGS \"-fsanitize=fuzzer,address\")\n  add_library(wabt-fuzz STATIC ${WABT_LIBRARY_SRC})\n  target_link_libraries(wabt-fuzz PUBLIC wabt)\n  set_target_properties(wabt-fuzz\n    PROPERTIES\n    COMPILE_FLAGS \"${FUZZ_FLAGS}\"\n  )\nendif ()\n\n# libwasm, which implenents the wasm C API\nif (BUILD_LIBWASM)\n  add_library(wasm SHARED ${WABT_LIBRARY_SRC} src/interp/interp-wasm-c-api.cc)\n  target_link_libraries(wasm PUBLIC wabt)\n  target_include_directories(wasm PUBLIC third_party/wasm-c-api/include)\n  if (COMPILER_IS_MSVC)\n    target_compile_definitions(wasm PRIVATE \"WASM_API_EXTERN=__declspec(dllexport)\")\n  else ()\n    target_compile_options(wasm PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-old-style-cast>)\n    target_compile_definitions(wasm PRIVATE \"WASM_API_EXTERN=__attribute__((visibility(\\\"default\\\")))\")\n  endif ()\n  set_target_properties(wasm PROPERTIES CXX_VISIBILITY_PRESET hidden)\nendif ()\n\nif (CODE_COVERAGE)\n  add_definitions(\"-fprofile-arcs -ftest-coverage\")\n  if (COMPILER_IS_CLANG)\n    set(CMAKE_EXE_LINKER_FLAGS \"--coverage\")\n  else ()\n    link_libraries(gcov)\n  endif ()\nendif ()\n\ninclude(CMakeParseArguments)\nfunction(wabt_executable)\n  cmake_parse_arguments(EXE \"WITH_LIBM;FUZZ;INSTALL\" \"NAME\" \"SOURCES;LIBS\" ${ARGN})\n\n  # Always link libwabt.\n  if (EXE_FUZZ)\n    set(EXE_LIBS \"${EXE_LIBS};wabt-fuzz\")\n    set(EXTRA_LINK_FLAGS \"${FUZZ_FLAGS}\")\n  else ()\n    set(EXE_LIBS \"${EXE_LIBS};wabt\")\n  endif ()\n\n  # Optionally link libm.\n  if (EXE_WITH_LIBM AND (COMPILER_IS_CLANG OR COMPILER_IS_GNU))\n    set(EXE_LIBS \"${EXE_LIBS};m\")\n  endif ()\n\n  add_executable(${EXE_NAME} ${EXE_SOURCES})\n  add_dependencies(everything ${EXE_NAME})\n  target_link_libraries(${EXE_NAME} ${EXE_LIBS})\n\n  if (EMSCRIPTEN)\n    set(EXTRA_LINK_FLAGS\n      \"${EXTRA_LINK_FLAGS} -sNODERAWFS -Oz -sALLOW_MEMORY_GROWTH\"\n    )\n  endif ()\n\n  set_target_properties(${EXE_NAME}\n    PROPERTIES\n    LINK_FLAGS \"${EXTRA_LINK_FLAGS}\"\n  )\n\n  if (EXE_INSTALL)\n    list(APPEND WABT_EXECUTABLES ${EXE_NAME})\n    set(WABT_EXECUTABLES ${WABT_EXECUTABLES} PARENT_SCOPE)\n\n    add_custom_target(${EXE_NAME}-copy-to-bin ALL\n      COMMAND ${CMAKE_COMMAND} -E make_directory ${WABT_SOURCE_DIR}/bin\n      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${EXE_NAME}> ${WABT_SOURCE_DIR}/bin\n      DEPENDS ${EXE_NAME}\n    )\n  endif ()\nendfunction()\n\nif (BUILD_TOOLS)\n  # wat2wasm\n  wabt_executable(\n    NAME wat2wasm\n    SOURCES src/tools/wat2wasm.cc\n    INSTALL\n  )\n\n  # wast2json\n  wabt_executable(\n    NAME wast2json\n    SOURCES src/tools/wast2json.cc\n    INSTALL\n  )\n\n  # wasm2wat\n  wabt_executable(\n    NAME wasm2wat\n    SOURCES src/tools/wasm2wat.cc\n    INSTALL\n  )\n\n  # wasm2c\n  wabt_executable(\n    NAME wasm2c\n    SOURCES src/tools/wasm2c.cc\n    INSTALL\n  )\n\n  # wasm-stats\n  wabt_executable(\n    NAME wasm-stats\n    SOURCES src/tools/wasm-stats.cc src/binary-reader-stats.cc\n    INSTALL\n  )\n\n  # wasm-objdump\n  wabt_executable(\n    NAME wasm-objdump\n    SOURCES src/tools/wasm-objdump.cc src/binary-reader-objdump.cc\n    INSTALL\n  )\n\n  if(WITH_WASI)\n    # uvwasi uses the deprecated FetchContent_Populate function, disable it to avoid build error\n    set(CMAKE_POLICY_DEFAULT_CMP0169_BACK ${CMAKE_POLICY_DEFAULT_CMP0169})\n    set(CMAKE_POLICY_DEFAULT_CMP0169 OLD)\n    add_subdirectory(\"third_party/uvwasi\" EXCLUDE_FROM_ALL)\n    set(CMAKE_POLICY_DEFAULT_CMP0169 ${CMAKE_POLICY_DEFAULT_CMP0169_BACK})\n    include_directories(third_party/uvwasi/include)\n    add_definitions(-DWITH_WASI)\n    set(INTERP_LIBS uvwasi_a)\n    set(EXTRA_INTERP_SRC src/interp/interp-wasi.cc)\n\n    if (COMPILER_IS_GNU)\n      target_compile_options(uv_a PRIVATE \"-Wno-sign-compare\")\n    elseif (COMPILER_IS_CLANG)\n      target_compile_options(uv_a PRIVATE \"-Wno-implicit-fallthrough\")\n    endif()\n  endif()\n\n  # wasm-interp\n\n  wabt_executable(\n    NAME wasm-interp\n    SOURCES src/tools/wasm-interp.cc ${EXTRA_INTERP_SRC}\n    LIBS ${INTERP_LIBS}\n    WITH_LIBM\n    INSTALL\n  )\n\n  # spectest-interp\n  wabt_executable(\n    NAME spectest-interp\n    SOURCES src/tools/spectest-interp.cc\n    WITH_LIBM\n    INSTALL\n  )\n\n  # wat-desugar\n  wabt_executable(\n    NAME wat-desugar\n    SOURCES src/tools/wat-desugar.cc\n    INSTALL\n  )\n\n  # wasm-validate\n  wabt_executable(\n    NAME wasm-validate\n    SOURCES src/tools/wasm-validate.cc\n    INSTALL\n  )\n\n  # wasm-strip\n  wabt_executable(\n    NAME wasm-strip\n    SOURCES src/tools/wasm-strip.cc\n    INSTALL\n  )\n\n  # wasm-decompile\n  wabt_executable(\n    NAME wasm-decompile\n    SOURCES src/tools/wasm-decompile.cc\n    INSTALL\n  )\n\n  if(BUILD_FUZZ_TOOLS)\n    # wasm2wat-fuzz\n    wabt_executable(\n      NAME wasm2wat-fuzz\n      SOURCES src/tools/wasm2wat-fuzz.cc\n      FUZZ\n      INSTALL\n    )\n  endif ()\nendif ()\n\nif (BUILD_TESTS)\n  if (CMAKE_BUILD_TYPE STREQUAL \"Debug\")\n    set(WASM2C_CFLAGS \"${WASM2C_CFLAGS} -g -O0\")\n  endif ()\n\n  if (WABT_BIG_ENDIAN)\n    set(WASM2C_CFLAGS \"${WASM2C_CFLAGS} -DWABT_BIG_ENDIAN=1\")\n  endif ()\n\n  if (NOT \"${CMAKE_OSX_SYSROOT}\" STREQUAL \"\")\n    set(WASM2C_CFLAGS \"${WASM2C_CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}\")\n  endif ()\n\n  if (DEFINED ENV{WASM2C_CFLAGS})\n    set(WASM2C_CFLAGS \"${WASM2C_CFLAGS} $ENV{WASM2C_CFLAGS}\")\n  endif ()\n\n  set(THREADS_PREFER_PTHREAD_FLAG ON)\n  find_package(Threads REQUIRED)\n\n  # Python 3.5 is the version shipped in Ubuntu Xenial\n  find_package(Python3 3.5 REQUIRED COMPONENTS Interpreter)\n\n  if (NOT USE_SYSTEM_GTEST)\n    if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gtest/googletest)\n      message(FATAL_ERROR \"Can't find third_party/gtest. Run git submodule update --init, or disable with CMake -DBUILD_TESTS=OFF.\")\n    endif ()\n\n    include_directories(\n      third_party/gtest/googletest\n      third_party/gtest/googletest/include\n    )\n\n    # gtest\n    add_library(gtest STATIC\n      third_party/gtest/googletest/src/gtest-all.cc\n    )\n\n    add_library(gtest_main STATIC\n      third_party/gtest/googletest/src/gtest_main.cc\n    )\n\n    if (COMPILER_IS_GNU)\n      target_compile_options(gtest PRIVATE \"-Wno-maybe-uninitialized\")\n    endif ()\n  endif ()\n\n  # hexfloat-test\n  set(HEXFLOAT_TEST_SRCS\n    src/literal.cc\n    src/test-hexfloat.cc\n  )\n  wabt_executable(\n    NAME hexfloat_test\n    SOURCES ${HEXFLOAT_TEST_SRCS}\n    LIBS gtest_main gtest ${CMAKE_THREAD_LIBS_INIT}\n  )\n\n  # wabt-unittests\n  set(UNITTESTS_SRCS\n    src/test-binary-reader.cc\n    src/test-interp.cc\n    src/test-intrusive-list.cc\n    src/test-literal.cc\n    src/test-option-parser.cc\n    src/test-filenames.cc\n    src/test-utf8.cc\n    src/test-wast-parser.cc\n  )\n  wabt_executable(\n    NAME wabt-unittests\n    SOURCES ${UNITTESTS_SRCS}\n    LIBS gtest_main gtest ${CMAKE_THREAD_LIBS_INIT}\n  )\n\n  # test running\n  set(RUN_TESTS_PY ${WABT_SOURCE_DIR}/test/run-tests.py)\n\n  add_custom_target(run-tests\n    COMMAND ${CMAKE_COMMAND} -E env WASM2C_CC=${CMAKE_C_COMPILER} WASM2C_CFLAGS=${WASM2C_CFLAGS} ${Python3_EXECUTABLE} ${RUN_TESTS_PY} --bindir $<TARGET_FILE_DIR:wat2wasm>\n    DEPENDS ${WABT_EXECUTABLES}\n    WORKING_DIRECTORY ${WABT_SOURCE_DIR}\n    USES_TERMINAL\n  )\n\n  add_custom_target(run-unittests\n    COMMAND $<TARGET_FILE:wabt-unittests>\n    DEPENDS wabt-unittests\n    WORKING_DIRECTORY ${WABT_SOURCE_DIR}\n    USES_TERMINAL\n  )\n\n  add_custom_target(run-c-api-tests\n    COMMAND ${Python3_EXECUTABLE} ${WABT_SOURCE_DIR}/test/run-c-api-examples.py --bindir $<TARGET_FILE_DIR:wat2wasm>\n    WORKING_DIRECTORY ${WABT_SOURCE_DIR}\n    USES_TERMINAL\n  )\n\n  add_custom_target(check DEPENDS run-unittests run-tests run-c-api-tests)\n\n  function(c_api_example NAME)\n    set(EXENAME wasm-c-api-${NAME})\n    add_executable(${EXENAME} third_party/wasm-c-api/example/${NAME}.c)\n    if (COMPILER_IS_MSVC)\n      set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS \"-wd4311\")\n    else ()\n      set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS \"-std=gnu11 -Wno-pointer-to-int-cast\")\n    endif ()\n\n    target_link_libraries(${EXENAME} wasm Threads::Threads)\n    add_custom_target(${EXENAME}-copy-to-bin ALL\n      COMMAND ${CMAKE_COMMAND} -E make_directory ${WABT_SOURCE_DIR}/bin\n      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${EXENAME}> ${WABT_SOURCE_DIR}/bin/\n      COMMAND ${CMAKE_COMMAND} -E copy ${WABT_SOURCE_DIR}/third_party/wasm-c-api/example/${NAME}.wasm $<TARGET_FILE_DIR:${EXENAME}>/\n      COMMAND ${CMAKE_COMMAND} -E copy ${WABT_SOURCE_DIR}/third_party/wasm-c-api/example/${NAME}.wasm ${WABT_SOURCE_DIR}/bin/\n      DEPENDS ${EXENAME}\n    )\n    add_dependencies(run-c-api-tests ${EXENAME})\n  endfunction()\n\n  c_api_example(callback)\n  c_api_example(finalize)\n  c_api_example(global)\n  c_api_example(hello)\n  c_api_example(hostref)\n  c_api_example(multi)\n  c_api_example(memory)\n  c_api_example(reflect)\n  c_api_example(serialize)\n  c_api_example(start)\n  c_api_example(table)\n  c_api_example(trap)\n  if (CMAKE_USE_PTHREADS_INIT)\n    c_api_example(threads)\n  endif ()\nendif ()\n\n# install\nif (WABT_INSTALL_RULES AND (BUILD_TOOLS OR BUILD_TESTS))\n  install(\n    TARGETS ${WABT_EXECUTABLES}\n    COMPONENT wabt-runtime\n  )\n  if (UNIX)\n    install(\n      DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/man/\"\n      DESTINATION ${CMAKE_INSTALL_MANDIR}/man1\n      COMPONENT wabt-documentation\n      FILES_MATCHING PATTERN \"*.1\"\n    )\n  endif ()\nendif ()\n\nif (EMSCRIPTEN)\n  # flags for all emscripten builds\n\n  # exceptions are never needed\n  set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -fno-exceptions\")\n\n  # wabt.js\n\n  # just dump everything into one binary so we can reference it from JavaScript\n  add_definitions(-Wno-warn-absolute-paths)\n  add_executable(libwabtjs src/emscripten-helpers.cc)\n  add_dependencies(everything libwabtjs)\n  target_link_libraries(libwabtjs wabt)\n  set_target_properties(libwabtjs PROPERTIES OUTPUT_NAME libwabt)\n\n  set(WABT_POST_JS ${WABT_SOURCE_DIR}/src/wabt.post.js)\n  set(EMSCRIPTEN_EXPORTS ${WABT_SOURCE_DIR}/src/emscripten-exports.txt)\n\n  set(LIBWABT_LINK_FLAGS\n    --post-js ${WABT_POST_JS}\n    -sEXPORTED_FUNCTIONS=@${EMSCRIPTEN_EXPORTS}\n    -sALLOW_TABLE_GROWTH\n    -sALLOW_MEMORY_GROWTH\n    -sEXPORT_ES6\n    -sEXPORT_NAME=WabtModule\n    -sEXPORTED_RUNTIME_METHODS=stringToNewUTF8,lengthBytesUTF8\n    -Oz\n  )\n  string(REPLACE \";\" \" \" LIBWABT_LINK_FLAGS_STR \"${LIBWABT_LINK_FLAGS}\")\n\n  set_target_properties(libwabtjs\n    PROPERTIES\n    LINK_FLAGS \"${LIBWABT_LINK_FLAGS_STR}\"\n    LINK_DEPENDS \"${WABT_POST_JS};${EMSCRIPTEN_EXPORTS}\"\n  )\nendif ()\n\n# Create find_package configuration files\nif (WABT_INSTALL_RULES)\n  include(CMakePackageConfigHelpers)\n\n  set(WABT_INSTALL_CMAKEDIR \"${CMAKE_INSTALL_LIBDIR}/cmake/wabt\"\n      CACHE STRING \"Path to wabt CMake files\")\n\n  install(\n    EXPORT wabt-targets\n    DESTINATION \"${WABT_INSTALL_CMAKEDIR}\"\n    NAMESPACE wabt::\n    FILE wabt-targets.cmake\n    COMPONENT wabt-development\n  )\n\n  configure_package_config_file(\n    scripts/wabt-config.cmake.in\n    wabt-config.cmake\n    INSTALL_DESTINATION \"${WABT_INSTALL_CMAKEDIR}\"\n    NO_SET_AND_CHECK_MACRO\n  )\n\n  write_basic_package_version_file(\n    wabt-config-version.cmake COMPATIBILITY ExactVersion\n  )\n\n  install(\n    FILES\n    \"${CMAKE_CURRENT_BINARY_DIR}/wabt-config.cmake\"\n    \"${CMAKE_CURRENT_BINARY_DIR}/wabt-config-version.cmake\"\n    DESTINATION \"${WABT_INSTALL_CMAKEDIR}\"\n    COMPONENT wabt-development\n  )\nendif ()\n"
  },
  {
    "path": "Contributing.md",
    "content": "# Contributing to WebAssembly\n\nInterested in participating? Please follow\n[the same contributing guidelines as the design repository][].\n\n  [the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/master/Contributing.md\n\nAlso, please be sure to read [the README.md](README.md) for this repository.\n"
  },
  {
    "path": "LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "Makefile",
    "content": "#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n.SUFFIXES:\n\nMAKEFILE_NAME := $(lastword $(MAKEFILE_LIST))\nROOT_DIR := $(dir $(abspath $(MAKEFILE_NAME)))\n\nUSE_NINJA ?= 1\nCMAKE_CMD ?= cmake\n\nDEFAULT_SUFFIX = clang-debug\n\nCOMPILERS := GCC GCC_I686 CLANG CLANG_I686 EMCC\nBUILD_TYPES := DEBUG RELEASE\nSANITIZERS := ASAN MSAN LSAN UBSAN FUZZ\nCONFIGS := NORMAL $(SANITIZERS) COV NO_TESTS\n\n# directory names\nGCC_DIR := gcc/\nGCC_I686_DIR := gcc-i686/\nCLANG_DIR := clang/\nCLANG_I686_DIR := clang-i686/\nEMCC_DIR := emscripten/\nDEBUG_DIR := Debug/\nRELEASE_DIR := Release/\nNORMAL_DIR :=\nASAN_DIR := asan/\nMSAN_DIR := msan/\nLSAN_DIR := lsan/\nUBSAN_DIR := ubsan/\nFUZZ_DIR := fuzz/\nCOV_DIR := cov/\nNO_TESTS_DIR := no-tests/\n\n# CMake flags\nGCC_FLAG := -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++\nGCC_I686_FLAG := -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ \\\n\t-DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32\nCLANG_FLAG := -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++\nCLANG_I686_FLAG := -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \\\n\t-DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32\nDEBUG_FLAG := -DCMAKE_BUILD_TYPE=Debug\nRELEASE_FLAG := -DCMAKE_BUILD_TYPE=Release\nNORMAL_FLAG :=\nASAN_FLAG := -DUSE_ASAN=ON\nMSAN_FLAG := -DUSE_MSAN=ON\nLSAN_FLAG := -DUSE_LSAN=ON\nUBSAN_FLAG := -DUSE_UBSAN=ON\nFUZZ_FLAG := -DBUILD_FUZZ_TOOLS=ON\nCOV_FLAG := -DCODE_COVERAGE=ON\nNO_TESTS_FLAG := -DBUILD_TESTS=OFF\n\n# make target prefixes\nGCC_PREFIX := gcc\nGCC_I686_PREFIX := gcc-i686\nCLANG_PREFIX := clang\nCLANG_I686_PREFIX := clang-i686\nEMCC_PREFIX := emscripten\nDEBUG_PREFIX := -debug\nRELEASE_PREFIX := -release\nNORMAL_PREFIX :=\nASAN_PREFIX := -asan\nMSAN_PREFIX := -msan\nLSAN_PREFIX := -lsan\nUBSAN_PREFIX := -ubsan\nFUZZ_PREFIX := -fuzz\nCOV_PREFIX := -cov\nNO_TESTS_PREFIX := -no-tests\n\nifeq ($(USE_NINJA),1)\nBUILD_CMD := ninja\nBUILD_FILE := build.ninja\nGENERATOR := Ninja\nelse\nBUILD_CMD := +$(MAKE) --no-print-directory\nBUILD_FILE := Makefile\nGENERATOR := \"Unix Makefiles\"\nendif\n\nCMAKE_DIR = out/$($(1)_DIR)$($(2)_DIR)$($(3)_DIR)\nBUILD_TARGET = $($(1)_PREFIX)$($(2)_PREFIX)$($(3)_PREFIX)\nINSTALL_TARGET = install-$($(1)_PREFIX)$($(2)_PREFIX)$($(3)_PREFIX)\nTEST_TARGET = test-$($(1)_PREFIX)$($(2)_PREFIX)$($(3)_PREFIX)\n\ndefine CMAKE\n$(call CMAKE_DIR,$(1),$(2),$(3)):\n\tmkdir -p $(call CMAKE_DIR,$(1),$(2),$(3))\n\n$(call CMAKE_DIR,$(1),$(2),$(3))$$(BUILD_FILE): | $(call CMAKE_DIR,$(1),$(2),$(3))\n\tcd $(call CMAKE_DIR,$(1),$(2),$(3)) && \\\n\t$$(if $$(filter EMCC,$(1)),emcmake ,)$$(CMAKE_CMD) -G $$(GENERATOR) $$(ROOT_DIR) $$($(1)_FLAG) $$($(2)_FLAG) $$($(3)_FLAG)\nendef\n\ndefine BUILD\n.PHONY: $(call BUILD_TARGET,$(1),$(2),$(3))\n$(call BUILD_TARGET,$(1),$(2),$(3)): $(call CMAKE_DIR,$(1),$(2),$(3))$$(BUILD_FILE)\n\t$$(BUILD_CMD) -C $(call CMAKE_DIR,$(1),$(2),$(3)) all\nendef\n\ndefine INSTALL\n.PHONY: $(call INSTALL_TARGET,$(1),$(2),$(3))\n$(call INSTALL_TARGET,$(1),$(2),$(3)): $(call CMAKE_DIR,$(1),$(2),$(3))$$(BUILD_FILE)\n\t$$(BUILD_CMD) -C $(call CMAKE_DIR,$(1),$(2),$(3)) install\nendef\n\ndefine TEST\n.PHONY: $(call TEST_TARGET,$(1),$(2),$(3))\n$(call TEST_TARGET,$(1),$(2),$(3)): $(call CMAKE_DIR,$(1),$(2),$(3))$$(BUILD_FILE)\n\t$$(BUILD_CMD) -C $(call CMAKE_DIR,$(1),$(2),$(3)) check\ntest-everything: $(CALL TEST_TARGET,$(1),$(2),$(3))\nendef\n\n.PHONY: all install test\nall: $(DEFAULT_SUFFIX)\ninstall: install-$(DEFAULT_SUFFIX)\ntest: test-$(DEFAULT_SUFFIX)\n\n.PHONY: clean\nclean:\n\trm -rf out\n\n.PHONY: test-everything\ntest-everything:\n\n.PHONY: update-gperf\nupdate-gperf: src/prebuilt/lexer-keywords.cc\n\nsrc/prebuilt/lexer-keywords.cc: src/lexer-keywords.txt\n\tgperf -m 50 -L C++ -N InWordSet -E -t -c --output-file=$@ $<\n\n.PHONY: update-wasm2c-fac\nupdate-wasm2c-fac:\n\tmake -C wasm2c/examples/fac\n\n.PHONY: demo\ndemo: emscripten-release\n\tcp out/emscripten/Release/libwabt.js docs/demo\n\tcp out/emscripten/Release/libwabt.wasm docs/demo\n\n# running CMake\n$(foreach CONFIG,$(CONFIGS), \\\n\t$(foreach COMPILER,$(COMPILERS), \\\n\t\t$(foreach BUILD_TYPE,$(BUILD_TYPES), \\\n\t\t\t$(eval $(call CMAKE,$(COMPILER),$(BUILD_TYPE),$(CONFIG))))))\n\n# building\n$(foreach CONFIG,$(CONFIGS), \\\n\t$(foreach COMPILER,$(COMPILERS), \\\n\t\t$(foreach BUILD_TYPE,$(BUILD_TYPES), \\\n\t\t\t$(eval $(call BUILD,$(COMPILER),$(BUILD_TYPE),$(CONFIG))))))\n\n# installing\n$(foreach CONFIG,$(CONFIGS), \\\n\t$(foreach COMPILER,$(COMPILERS), \\\n\t\t$(foreach BUILD_TYPE,$(BUILD_TYPES), \\\n\t\t\t$(eval $(call INSTALL,$(COMPILER),$(BUILD_TYPE),$(CONFIG))))))\n\n# test running\n$(foreach CONFIG,$(CONFIGS), \\\n\t$(foreach COMPILER,$(COMPILERS), \\\n\t\t$(foreach BUILD_TYPE,$(BUILD_TYPES), \\\n\t\t\t$(eval $(call TEST,$(COMPILER),$(BUILD_TYPE),$(CONFIG))))))\n"
  },
  {
    "path": "README.md",
    "content": "[![Github CI Status](https://github.com/WebAssembly/wabt/workflows/CI/badge.svg)](https://github.com/WebAssembly/wabt/actions/workflows/build.yml)\n\n# WABT: The WebAssembly Binary Toolkit\n\nWABT (we pronounce it \"wabbit\") is a suite of tools for WebAssembly, including:\n\n - [**wat2wasm**](https://webassembly.github.io/wabt/doc/wat2wasm.1.html): translate from [WebAssembly text format](https://webassembly.github.io/spec/core/text/index.html) to the [WebAssembly binary format](https://webassembly.github.io/spec/core/binary/index.html)\n - [**wasm2wat**](https://webassembly.github.io/wabt/doc/wasm2wat.1.html): the inverse of wat2wasm, translate from the binary format back to the text format (also known as a .wat)\n - [**wasm-objdump**](https://webassembly.github.io/wabt/doc/wasm-objdump.1.html): print information about a wasm binary. Similiar to objdump.\n - [**wasm-interp**](https://webassembly.github.io/wabt/doc/wasm-interp.1.html): decode and run a WebAssembly binary file using a stack-based interpreter\n - [**wasm-decompile**](https://webassembly.github.io/wabt/doc/wasm-decompile.1.html): decompile a wasm binary into readable C-like syntax.\n - [**wat-desugar**](https://webassembly.github.io/wabt/doc/wat-desugar.1.html): parse .wat text form as supported by the spec interpreter (s-expressions, flat syntax, or mixed) and print \"canonical\" flat format\n - [**wasm2c**](https://webassembly.github.io/wabt/doc/wasm2c.1.html): convert a WebAssembly binary file to a C source and header\n - [**wasm-strip**](https://webassembly.github.io/wabt/doc/wasm-strip.1.html): remove sections of a WebAssembly binary file\n - [**wasm-validate**](https://webassembly.github.io/wabt/doc/wasm-validate.1.html): validate a file in the WebAssembly binary format\n - [**wast2json**](https://webassembly.github.io/wabt/doc/wast2json.1.html): convert a file in the wasm spec test format to a JSON file and associated wasm binary files\n - [**wasm-stats**](https://webassembly.github.io/wabt/doc/wasm-stats.1.html): output stats for a module\n - [**spectest-interp**](https://webassembly.github.io/wabt/doc/spectest-interp.1.html): read a Spectest JSON file, and run its tests in the interpreter\n\nThese tools are intended for use in (or for development of) toolchains or other\nsystems that want to manipulate WebAssembly files. Unlike the WebAssembly spec\ninterpreter (which is written to be as simple, declarative and \"speccy\" as\npossible), they are written in C/C++ and designed for easier integration into\nother systems. Unlike [Binaryen](https://github.com/WebAssembly/binaryen) these\ntools do not aim to provide an optimization platform or a higher-level compiler\ntarget; instead they aim for full fidelity and compliance with the spec (e.g.\n1:1 round-trips with no changes to instructions).\n\n## Online Demos\n\nWabt has been compiled to JavaScript via emscripten. Some of the functionality is available in the following demos:\n\n- [index](https://webassembly.github.io/wabt/demo/)\n- [wat2wasm](https://webassembly.github.io/wabt/demo/wat2wasm/)\n- [wasm2wat](https://webassembly.github.io/wabt/demo/wasm2wat/)\n\n## Supported Proposals\n\n* Proposal: Name and link to the WebAssembly proposal repo\n* flag: Flag to pass to the tool to enable/disable support for the feature\n* default: Whether the feature is enabled by default\n* binary: Whether wabt can read/write the binary format\n* text: Whether wabt can read/write the text format\n* validate: Whether wabt can validate the syntax\n* interpret: Whether wabt can execute these operations in `wasm-interp` or `spectest-interp`\n* wasm2c: Whether wasm2c supports these operations\n\n| Proposal   | flag | default | binary | text | validate | interpret | wasm2c |\n| --------------------- | --------------------------- | - | - | - | - | - | - |\n| [exception handling][]| `--enable-exceptions`       |   | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [mutable globals][]   | `--disable-mutable-globals` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [nontrapping float-to-int conversions][] | `--disable-saturating-float-to-int` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [sign extension][]    | `--disable-sign-extension`  | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [simd][]              | `--disable-simd`            | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [threads][]           | `--enable-threads`          |   | ✓ | ✓ | ✓ | ✓ |   |\n| [multi-value][]       | `--disable-multi-value`     | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [tail-call][]         | `--enable-tail-call`        |   | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [bulk memory][]       | `--disable-bulk-memory`     | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [reference types][]   | `--disable-reference-types` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [annotations][]       | `--enable-annotations`      |   |   | ✓ |   |   |   |\n| [memory64][]          | `--enable-memory64`         |   | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [multi-memory][]      | `--enable-multi-memory`     |   | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [extended-const][]    | `--enable-extended-const`   |   | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [relaxed-simd][]      | `--enable-relaxed-simd`     |   | ✓ | ✓ | ✓ | ✓ |   |\n| [custom-page-sizes][] | `--enable-custom-page-sizes`|   | ✓ | ✓ | ✓ | ✓ | ✓ |\n| [compact-imports][]   | `--enable-compact-imports`  |   | ✓ |   | ✓ |   |   |\n| [function-references][] | `--enable-function-references` |   | ✓ | ✓ | ✓ | ✓ |   |\n| [wide-arithmetic][]   | `--enable-wide-arithmetic`  |   | ✓ | ✓ | ✓ |   |   |\n\n[exception handling]: https://github.com/WebAssembly/exception-handling\n[mutable globals]: https://github.com/WebAssembly/mutable-global\n[nontrapping float-to-int conversions]: https://github.com/WebAssembly/nontrapping-float-to-int-conversions\n[sign extension]: https://github.com/WebAssembly/sign-extension-ops\n[simd]: https://github.com/WebAssembly/simd\n[threads]: https://github.com/WebAssembly/threads\n[multi-value]: https://github.com/WebAssembly/multi-value\n[tail-call]: https://github.com/WebAssembly/tail-call\n[bulk memory]: https://github.com/WebAssembly/bulk-memory-operations\n[reference types]: https://github.com/WebAssembly/reference-types\n[annotations]: https://github.com/WebAssembly/annotations\n[memory64]: https://github.com/WebAssembly/memory64\n[multi-memory]: https://github.com/WebAssembly/multi-memory\n[extended-const]: https://github.com/WebAssembly/extended-const\n[relaxed-simd]: https://github.com/WebAssembly/relaxed-simd\n[custom-page-sizes]: https://github.com/WebAssembly/custom-page-sizes\n[function-references]: https://github.com/WebAssembly/function-references\n[compact-imports]: https://github.com/WebAssembly/compact-import-section\n[wide-arithmetic]: https://github.com/WebAssembly/wide-arithmetic\n\n## Cloning\n\nClone as normal, but don't forget to get the submodules as well:\n\n```console\n$ git clone --recursive https://github.com/WebAssembly/wabt\n$ cd wabt\n$ git submodule update --init\n```\n\nThis will fetch the testsuite and gtest repos, which are needed for some tests.\n\n## Building using CMake directly (Linux and macOS)\n\nYou'll need [CMake](https://cmake.org). You can then run CMake, the normal way:\n\n```console\n$ mkdir build\n$ cd build\n$ cmake ..\n$ cmake --build .\n```\n\nThis will produce build files using CMake's default build generator. Read the\nCMake documentation for more information.\n\n**NOTE**: You must create a separate directory for the build artifacts (e.g.\n`build` above).  Running `cmake` from the repo root directory will not work\nsince the build produces an executable called `wasm2c` which conflicts with the\n`wasm2c` directory.\n\n## Building using the top-level `Makefile` (Linux and macOS)\n\n**NOTE**: Under the hood, this uses `make` to run CMake, which then calls\n`ninja` to perform that actual build.  On some systems (typically macOS), this\ndoesn't build properly. If you see these errors, you can build using CMake\ndirectly as described above.\n\nYou'll need [CMake](https://cmake.org) and [Ninja](https://ninja-build.org). If\nyou just run `make`, it will run CMake for you, and put the result in\n`out/clang/Debug/` by default:\n\n> Note: If you are on macOS, you will need to use CMake version 3.2 or higher\n\n```console\n$ make\n```\n\nThis will build the default version of the tools: a debug build using the Clang\ncompiler.\n\nThere are many make targets available for other configurations as well. They\nare generated from every combination of a compiler, build type and\nconfiguration.\n\n - compilers: `gcc`, `clang`, `gcc-i686`, `emscripten`\n - build types: `debug`, `release`\n - configurations: empty, `asan`, `msan`, `lsan`, `ubsan`, `fuzz`, `no-tests`\n\nThey are combined with dashes, for example:\n\n```console\n$ make clang-debug\n$ make gcc-i686-release\n$ make clang-debug-lsan\n$ make gcc-debug-no-tests\n```\n\n## Building (Windows)\n\nYou'll need [CMake](https://cmake.org). You'll also need\n[Visual Studio](https://www.visualstudio.com/) (2015 or newer) or\n[MinGW](https://www.mingw-w64.org/).\n\n_Note: Visual Studio 2017 and later come with CMake (and the Ninja build system)\nout of the box, and should be on your PATH if you open a Developer Command prompt.\nSee <https://aka.ms/cmake> for more details._\n\nYou can run CMake from the command prompt, or use the CMake GUI tool. See\n[Running CMake](https://cmake.org/runningcmake/) for more information.\n\nWhen running from the commandline, create a new directory for the build\nartifacts, then run cmake from this directory:\n\n```console\n> cd [build dir]\n> cmake [wabt project root] -DCMAKE_BUILD_TYPE=[config] -DCMAKE_INSTALL_PREFIX=[install directory] -G [generator]\n```\n\nThe `[config]` parameter should be a CMake build type, typically `DEBUG` or `RELEASE`.\n\nThe `[generator]` parameter should be the type of project you want to generate,\nfor example `\"Visual Studio 14 2015\"`. You can see the list of available\ngenerators by running `cmake --help`.\n\nTo build the project, you can use Visual Studio, or you can tell CMake to do it:\n\n```console\n> cmake --build [wabt project root] --config [config] --target install\n```\n\nThis will build and install to the installation directory you provided above.\n\nSo, for example, if you want to build the debug configuration on Visual Studio 2015:\n\n```console\n> mkdir build\n> cd build\n> cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=..\\ -G \"Visual Studio 14 2015\"\n> cmake --build . --config DEBUG --target install\n```\n\n## Adding new keywords to the lexer\n\nIf you want to add new keywords, you'll need to install\n[gperf](https://www.gnu.org/software/gperf/). Before you upload your PR, please\nrun `make update-gperf` to update the prebuilt C++ sources in `src/prebuilt/`.\n\n## Running wat2wasm\n\nSome examples:\n\n```sh\n# parse test.wat and write to .wasm binary file with the same name\n$ bin/wat2wasm test.wat\n\n# parse test.wat and write to binary file test.wasm\n$ bin/wat2wasm test.wat -o test.wasm\n\n# parse spec-test.wast, and write verbose output to stdout (including the\n# meaning of every byte)\n$ bin/wat2wasm spec-test.wast -v\n```\n\nYou can use `--help` to get additional help:\n\n```console\n$ bin/wat2wasm --help\n```\n\nOr try the [online demo](https://webassembly.github.io/wabt/demo/wat2wasm/).\n\n## Running wasm2wat\n\nSome examples:\n\n```sh\n# parse binary file test.wasm and write text file test.wat\n$ bin/wasm2wat test.wasm -o test.wat\n\n# parse test.wasm and write test.wat\n$ bin/wasm2wat test.wasm -o test.wat\n```\n\nYou can use `--help` to get additional help:\n\n```console\n$ bin/wasm2wat --help\n```\n\nOr try the [online demo](https://webassembly.github.io/wabt/demo/wasm2wat/).\n\n## Running wasm-interp\n\nSome examples:\n\n```sh\n# parse binary file test.wasm, and type-check it\n$ bin/wasm-interp test.wasm\n\n# parse test.wasm and run all its exported functions\n$ bin/wasm-interp test.wasm --run-all-exports\n\n# parse test.wasm, run the exported functions and trace the output\n$ bin/wasm-interp test.wasm --run-all-exports --trace\n\n# parse test.json and run the spec tests\n$ bin/wasm-interp test.json --spec\n\n# parse test.wasm and run all its exported functions, setting the value stack\n# size to 100 elements\n$ bin/wasm-interp test.wasm -V 100 --run-all-exports\n```\n\nYou can use `--help` to get additional help:\n\n```console\n$ bin/wasm-interp --help\n```\n\n## Running wast2json\n\nSee [wast2json.md](docs/wast2json.md).\n\n## Running wasm-decompile\n\nFor example:\n\n```sh\n# parse binary file test.wasm and write text file test.dcmp\n$ bin/wasm-decompile test.wasm -o test.dcmp\n```\n\nYou can use `--help` to get additional help:\n\n```console\n$ bin/wasm-decompile --help\n```\n\nSee [decompiler.md](docs/decompiler.md) for more information on the language\nbeing generated.\n\n## Running wasm2c\n\nSee [wasm2c.md](wasm2c/README.md)\n\n## Running the test suite\n\nSee [test/README.md](test/README.md).\n\n## Sanitizers\n\nTo build with the [LLVM sanitizers](https://github.com/google/sanitizers),\nappend the sanitizer name to the target:\n\n```console\n$ make clang-debug-asan\n$ make clang-debug-msan\n$ make clang-debug-lsan\n$ make clang-debug-ubsan\n```\n\nThere are configurations for the Address Sanitizer (ASAN), Memory Sanitizer\n(MSAN), Leak Sanitizer (LSAN) and Undefined Behavior Sanitizer (UBSAN). You can\nread about the behaviors of the sanitizers in the link above, but essentially\nthe Address Sanitizer finds invalid memory accesses (use after free, access\nout-of-bounds, etc.), Memory Sanitizer finds uses of uninitialized memory,\nthe Leak Sanitizer finds memory leaks, and the Undefined Behavior Sanitizer\nfinds undefined behavior (surprise!).\n\nTypically, you'll just want to run all the tests for a given sanitizer:\n\n```console\n$ make test-asan\n```\n\nYou can also run the tests for a release build:\n\n```console\n$ make test-clang-release-asan\n...\n```\n\nThe GitHub actions bots run all of these tests (and more). Before you land a change,\nyou should run them too. One easy way is to use the `test-everything` target:\n\n```console\n$ make test-everything\n```\n\n## Fuzzing\n\nTo build using the [LLVM fuzzer support](https://llvm.org/docs/LibFuzzer.html),\nappend `fuzz` to the target:\n\n```console\n$ make clang-debug-fuzz\n```\n\nThis will produce a `wasm2wat_fuzz` binary. It can be used to fuzz the binary\nreader, as well as reproduce fuzzer errors found by\n[oss-fuzz](https://github.com/google/oss-fuzz/tree/master/projects/wabt).\n\n```console\n$ out/clang/Debug/fuzz/wasm2wat_fuzz ...\n```\n\nSee the [libFuzzer documentation](https://llvm.org/docs/LibFuzzer.html) for\nmore information about how to use this tool.\n\n## Installing prebuilt binaries\n\nWabt is available on many platforms as prepackaged binaries. For example, if\nyou use Homebrew you can use:\n```sh\nbrew install wabt\n```\n\nAnd you use an apt-based linux distribution you can use:\n```sh\nsudo apt install wabt\n```\n\nYou can also download prebuilt binaries for many platforms directly from the\ngithub releases page.\n"
  },
  {
    "path": "SECURITY.md",
    "content": "# Security Policy\n\nWABT is maintained by volunteers on a reasonable-effort basis. If you\nhave discovered a security vulnerability, please open a GitHub issue\nto report it. In the future, we may move to a system of private\nreporting of security issues. Please submit your report by filling out\n[this form](https://github.com/WebAssembly/wabt/issues/new).\n\nPlease provide the following information in your report:\n\n- A description of the vulnerability and its impact\n- How to reproduce the issue\n- Which WABT tools or library functions are affected\n- Which WebAssembly features (`--enable` flags) must be enabled\n"
  },
  {
    "path": "docs/decompiler.md",
    "content": "# wasm-decompile\n\nDecompiles binary wasm modules into a text format that is significantly\nmore compact and familiar (for users of C-style languages).\n\nExample:\n\n`bin/wasm-decompile test.wasm -o test.dcmp`\n\n## Goals.\n\nThis tool is aimed at users that want to be able to \"read\" large volumes\nof Wasm code such as language, runtime and tool developers, or any programmers\nthat may not have the source code of the generated wasm available, or are\ntrying to understand what the generated code does.\n\nThe syntax has been designed to be as light-weight and as readable as possible,\nwhile still allowing one to see the underlying Wasm constructs clearly.\n\n## Non-goals.\n\nBe a programming language.\n\nThough compiling this output code back into a wasm module is possible,\nsuch functionality is currently not provided. The format is very low-level,\nmuch like Wasm itself, so even though it looks more high level than the .wat\nformat, it wouldn't be any more suitable for general purpose programming.\n\n## Language guide.\n\nThis section shows some aspects of the language in terms of how they map to\nWasm and/or how they might differ from a typical C-like language. It does\nnot try to define the actual semantics of Wasm, the reader is expected to\nalready be mostly familiar with that.\n\n### Naming.\n\nwasm-decompile, much like wasm2wat, derives names from the name section\n(preferrably), or linker symbols (if available), or import/export (if not\navailable in the other 2). For things that have no\nnames, names are generated starting from `a`, `b`, `c` and so forth.\n\nIn addition, prefixes are used for things that are not arguments/locals:\n`f_` for functions, `g_` for globals, etc.\n\nExisting names may be generated \"demangled\" C++ function signatures, which\nin the case of functions using STL types may end up several hundred characters\nlong. Besides removing characters not typically part of an identifier, the\ndecompiler also strips common keywords/types from these in an effort to\nreduce their size.\n\nLinker symbols are typically only available in wasm .o files, though if useful\nfor naming can be retained in fully linked wasm modules using the\n`--emit-reloc` flag to `wasm.ld`. This gives you names for most functions\neven when `--strip-debug` was used.\n\n### Top level declarations.\n\nTop level items may be preceded with `import` or `export`.\n\nMemory is declared like `memory m(initial: 1, max: 0);`\n\nGlobals: `global my_glob:int;`\n\nData: `data d_a(offset: 0) = \"Hello, World!\";`\n\nFunctions (see below for instructions that may appear between `{}`):\n`function f(a:int, b:int):int { return a + b; }`\n\n### Statements and expressions.\n\nAn expression is generated for any sequence of Wasm instructions that\nleave exactly 1 value on the stack.\n\nFor instructions that leave no value values on the stack, a statement is\ngenerated, which is an expression that sits on its own line in the context\nof a control-flow block, or the function itself. A statement may also be\ngenerated for expressions that return a value through control flow, such\nas a branch instruction.\n\nInstructions that leave multiple values on the stack, or otherwise do stack\noperations that break the \"expression order\", instead force the values to be\nwritten to temporary variables (named `t1`, `t2` etc) which the subsequent\ninstructions can then operate upon (this does not happen with MVP-only code).\n\n### Declaration of arguments and locals.\n\nArguments are defined in the function signature, as shown above.\n\nLocals are defined upon first use: `var my_local:int = 1;`\n\n### Types.\n\nThe decompiler uses `int` and `long` for 32-bit and 64-bit integers, and\n`float` and `double` for 32-bit and 64-bit floating point numbers.\n\nBesides these, there are the types `byte` and `ubyte` (8-bit), `short` and\n`ushort` (16-bit), and `uint`, which are used exclusively with certain\nload/store operations.\n\n### Loads and stores.\n\nThese tend to be the hardest to \"read\" in Wasm code, as they've lost all\ncontext of the data structures and types the language that Wasm was compiled\nfrom was operating upon.\n\nwasm-decompile has a few features to try and make these more readable.\n\nThe basic form looks like an array indexing operation, so `o[2]:int` says: read\nelement 2 from `o` when seen as an array of ints. This thus accesses 4 bytes\nat byte-offset 8.\n\n`o` is just declared as an `int`, since there is no such thing as a pointer\ntype in Wasm. But wasm-decompile tries to derive them. For example, if the\ncode is doing `o[0]:int = o[1]:int + o[2]:int`, then wasm-decompile assumes\n`o` points to a struct with 3 ints, and may instead compile this to:\n\n    var o:{ a:int, b:int, c:int };\n    o.a = o.b + o.c\n\nThe `{}` type is a nameless struct declaration (named ones tbd) that hints the\nreader at what kind of memory layout `o` is accessing. This seems more\ninformative than just uncorrelated indices all over the code.\n\nSadly, optimized output from a compiler like LLVM often reworks memory accesses\nin such crazy ways that this \"struct detection\" fails, for example it falls\nback to indexing operations when there are holes or overlaps in the memory\nlayout, or types are mixed, etc. This happens even more so when locals such\nas `o` are being re-used for unrelated things in memory.\n\nFor accesses that are not contiguous, but at least of the same type, the\ndecompiler will change the pointer type from `o:int` to e.g. `o:float_ptr` (and\nsimilarly, it will omit the type from the actual access, `o[2]` instead\nof `o[2]:int`).\n\nAdditionally, wasm-decompile tried to clean up typical indexing operations.\nFor example, when accessing any array of 32-bit elements, generated Wasm\ncode often looks like `(base + (index << 2))[0]:int`, since Wasm has no\nbuilt-in way to scale the index by the type of thing being loaded.\nwasm-decompile then transforms this into just `base[index]:int`, since the\nscaling of anything between the `[]` by the type size is already implied.\n\n### Control flow.\n\nWasm's if-then maps fairly directly to a C-like `if (c) { 1; } else { 2; }`.\nUnlike most languages, these if-thens can also be expressions, as shown in\nthis example (wasm-decompile does not currently use the `?:` ternary).\n\nWasm's loop becomes a `loop L { ...; continue L; }` structure. The\ninclusion of a label means nested loops can continue any of them.\n\nWasm's blocks are little more than a label for forward jumps, and cause\nexcessive amounts of nesting in other text formats such as .wat, so here\nthey are reduced to what they naturally are: a label. This label uses `{}`\nfor denoting a block only when used as an expression, so typically does not\nindent, and thus doesn't cause endless nesting:\n\n    if (c) goto L;\n    ...\n    label L:\n\n### Operator precedence.\n\nwasm-decompile uses the following operator precedence to reduce the amount of\n`()` needed in expressions, from high (needs no `()`) to low (always needs\n`()` when nested):\n\n* `()`, `a`, `1`, `a()`\n* `[]`\n* `if () {} else {}`\n* `*`, `/`, `%`\n* `+`, `-`\n* `<<`, `>>`\n* `==`, `!=`, `<`, `>`, `>=`, `<=`\n* `&`, `|`\n* `min`, `max`\n* `=`\n\nOnly `+` and `*` are associative, i.e. can have multiple of them in sequence\nwithout additional `()`.\n"
  },
  {
    "path": "docs/demo/custom.css",
    "content": "html {\n  font-size: 80%;\n  line-height: 1.3;\n}\n\n* {\n  box-sizing: border-box;\n}\n\nbody {\n  font-family: sans-serif;\n  font-size: 1rem;\n  line-height: 1.3125rem;\n  margin: 0;\n}\n\nh1 {\n  font-size: 2.375rem;\n  line-height: 2.625rem;\n  margin-top: 1.3125rem;\n  margin-bottom: 1.3125rem;\n}\n\nh2 {\n  font-size: 1.75rem;\n  line-height: 2.625rem;\n  margin-top: 1.3125rem;\n  margin-bottom: 1.3125rem;\n}\n\nh3 {\n  font-size: 1.3125rem;\n  line-height: 1.3125rem;\n  margin-top: 1.3125rem;\n  margin-bottom: 0rem;\n}\n\nh4 {\n  font-size: 1rem;\n  line-height: 1.3125rem;\n  margin-top: 1.3125rem;\n  margin-bottom: 0rem;\n}\n\nh5 {\n  font-size: 1rem;\n  line-height: 1.3125rem;\n  margin-top: 1.3125rem;\n  margin-bottom: 0rem;\n}\n\np, ul {\n  padding-left: 0;\n  margin-top: 0rem;\n  margin-bottom: 1.3125rem;\n}\n\nul ul, ol ol, ul ol, ol ul {\n  margin-top: 0rem;\n  margin-bottom: 0rem;\n}\n\npre {\n  margin: 0;\n}\n\n.right {\n  float: right;\n  white-space: nowrap;\n}\n\n.hidden {\n  display: none;\n}\n\n#split-grid {\n  position: absolute;\n  height: 100%;\n  left: 0;\n  right: 0;\n  top: 0;\n}\n\n.CodeMirror, .cm-editor, .output {\n  position: absolute;\n  height: calc(100% - 2.625rem);\n  top: 2.625rem;\n  left: 0;\n  right: 0;\n}\n\n.output {\n  padding: 0.3125rem;\n  overflow: auto;\n}\n\n.toolbar {\n  position: absolute;\n  top: 0;\n  right: 0;\n  left: 0;\n  color: #555;\n  background-color: #eee;\n  z-index: 9;\n  height: 2.625rem;\n  line-height: 2rem;\n  padding: 0.3125rem 0.3125rem 0;\n  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);\n}\n\n.split-horizontal, .gutter-horizontal {\n  height: 100%;\n  float: left;\n}\n\n.gutter-horizontal {\n  cursor: ew-resize;\n  background-image: url('assets/vertical.png');\n}\n\n.gutter-vertical {\n  cursor: ns-resize;\n  background-image: url('assets/horizontal.png');\n}\n\n.gutter {\n  touch-action: none;\n  user-select: none;\n  background-color: #ddd;\n  background-repeat: no-repeat;\n  background-position: 50%;\n  z-index: 0;\n}\n\n.split {\n  position: relative;\n  overflow: hidden;\n}\n\n\nbody {\n  display: flex;\n  min-height: 100vh;\n  flex-direction: column;\n}\n\nmain {\n  flex: 1;\n  position: relative;\n}\n\nheader {\n  padding: 0 1em;\n  z-index: 10;\n  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);\n}\n\nul {\n  margin: 1em;\n  list-style: none;\n}\n\n#features {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px 16px;\n  margin-top: 0.5rem;\n  margin-bottom: 1rem;\n}\n\n.feature-item {\n  display: flex;\n  align-items: center;\n  gap: 4px;\n}\n"
  },
  {
    "path": "docs/demo/index.html",
    "content": "<!--\n Copyright 2017 WebAssembly Community Group participants\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes\">\n  <title>wabt demos</title>\n  <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\">\n  <link href=\"custom.css\" rel=\"stylesheet\">\n</head>\n<body>\n  <header>\n    <h1>wabt demos</h1>\n  </header>\n  <main>\n    <ul>\n      <li>\n        <a href=\"wat2wasm/index.html\">wat2wasm demo</a>\n        <p>\n          Example showing converting text to binary.\n        </p>\n      </li>\n      <li>\n        <a href=\"wasm2wat/index.html\">wasm2wat demo</a>\n        <p>\n          Example showing converting binary to text.\n        </p>\n      </li>\n    </ul>\n  </main>\n</body>\n</html>\n"
  },
  {
    "path": "docs/demo/libwabt.js",
    "content": "async function WabtModule(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!=\"renderer\";if(ENVIRONMENT_IS_NODE){const{createRequire}=await import(\"node:module\");var require=createRequire(import.meta.url)}var arguments_=[];var thisProgram=\"./this.program\";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName=import.meta.url;var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require(\"node:fs\");if(_scriptName.startsWith(\"file:\")){scriptDirectory=require(\"node:path\").dirname(require(\"node:url\").fileURLToPath(_scriptName))+\"/\"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:\"utf8\");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\\\/g,\"/\")}arguments_=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(\".\",_scriptName).href}catch{}{if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:\"same-origin\"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+\" : \"+response.url)}}}else{}var out=console.log.bind(console);var err=console.error.bind(console);var wasmBinary;var ABORT=false;var isFileURI=filename=>filename.startsWith(\"file://\");var readyPromiseResolve,readyPromiseReject;var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;var HEAP64,HEAPU64;var runtimeInitialized=false;function updateMemoryViews(){var b=wasmMemory.buffer;HEAP8=new Int8Array(b);HEAP16=new Int16Array(b);HEAPU8=new Uint8Array(b);HEAPU16=new Uint16Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF32=new Float32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b);HEAPU64=new BigUint64Array(b)}function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;wasmExports[\"h\"]()}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(onPostRuns)}function abort(what){Module[\"onAbort\"]?.(what);what=\"Aborted(\"+what+\")\";err(what);ABORT=true;what+=\". Build with -sASSERTIONS for more info.\";var e=new WebAssembly.RuntimeError(what);readyPromiseReject?.(e);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module[\"locateFile\"]){return locateFile(\"libwabt.wasm\")}return new URL(\"libwabt.wasm\",import.meta.url).href}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw\"both async and sync fetching of the wasm failed\"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:\"same-origin\"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err(\"falling back to ArrayBuffer instantiation\")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){var imports={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;assignWasmExports(wasmExports);updateMemoryViews();return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result[\"instance\"])}var info=getWasmImports();if(Module[\"instantiateWasm\"]){return new Promise((resolve,reject)=>{Module[\"instantiateWasm\"](info,(inst,mod)=>{resolve(receiveInstance(inst,mod))})})}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name=\"ExitStatus\";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPostRuns=[];var addOnPostRun=cb=>onPostRuns.push(cb);var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var noExitRuntime=true;var __abort_js=()=>abort(\"\");var getHeapMax=()=>2147483648;var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};var _emscripten_resize_heap=requestedSize=>{var oldSize=HEAPU8.length;requestedSize>>>=0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false};var ENV={};var getExecutableName=()=>thisProgram||\"./this.program\";var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(globalThis.navigator?.language??\"C\").replace(\"-\",\"_\")+\".UTF-8\";var env={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.codePointAt(i);if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;i++}}heap[outIdx]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);var _environ_get=(__environ,environ_buf)=>{var bufSize=0;var envp=0;for(var string of getEnvStrings()){var ptr=environ_buf+bufSize;HEAPU32[__environ+envp>>2]=ptr;bufSize+=stringToUTF8(string,ptr,Infinity)+1;envp+=4}return 0};var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};var _environ_sizes_get=(penviron_count,penviron_buf_size)=>{var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;for(var string of strings){bufSize+=lengthBytesUTF8(string)+1}HEAPU32[penviron_buf_size>>2]=bufSize;return 0};var _fd_close=fd=>52;var UTF8Decoder=new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>{if(!ptr)return\"\";var end=findStringEnd(HEAPU8,ptr,maxBytesToRead,ignoreNul);return UTF8Decoder.decode(HEAPU8.subarray(ptr,end))};var printCharBuffers=[null,[],[]];var UTF8ArrayToString=(heapOrArray,idx=0,maxBytesToRead,ignoreNul)=>{var endPtr=findStringEnd(heapOrArray,idx,maxBytesToRead,ignoreNul);return UTF8Decoder.decode(heapOrArray.buffer?heapOrArray.subarray(idx,endPtr):new Uint8Array(heapOrArray.slice(idx,endPtr)))};var printChar=(stream,curr)=>{var buffer=printCharBuffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer));buffer.length=0}else{buffer.push(curr)}};var _fd_write=(fd,iov,iovcnt,pnum)=>{var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0};var stringToNewUTF8=str=>{var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8(str,ret,size);return ret};{if(Module[\"noExitRuntime\"])noExitRuntime=Module[\"noExitRuntime\"];if(Module[\"print\"])out=Module[\"print\"];if(Module[\"printErr\"])err=Module[\"printErr\"];if(Module[\"wasmBinary\"])wasmBinary=Module[\"wasmBinary\"];if(Module[\"arguments\"])arguments_=Module[\"arguments\"];if(Module[\"thisProgram\"])thisProgram=Module[\"thisProgram\"];if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].shift()()}}}Module[\"lengthBytesUTF8\"]=lengthBytesUTF8;Module[\"stringToNewUTF8\"]=stringToNewUTF8;var _wabt_new_features,_wabt_destroy_features,_wabt_exceptions_enabled,_wabt_set_exceptions_enabled,_wabt_mutable_globals_enabled,_wabt_set_mutable_globals_enabled,_wabt_sat_float_to_int_enabled,_wabt_set_sat_float_to_int_enabled,_wabt_sign_extension_enabled,_wabt_set_sign_extension_enabled,_wabt_simd_enabled,_wabt_set_simd_enabled,_wabt_threads_enabled,_wabt_set_threads_enabled,_wabt_function_references_enabled,_wabt_set_function_references_enabled,_wabt_multi_value_enabled,_wabt_set_multi_value_enabled,_wabt_tail_call_enabled,_wabt_set_tail_call_enabled,_wabt_bulk_memory_enabled,_wabt_set_bulk_memory_enabled,_wabt_reference_types_enabled,_wabt_set_reference_types_enabled,_wabt_annotations_enabled,_wabt_set_annotations_enabled,_wabt_code_metadata_enabled,_wabt_set_code_metadata_enabled,_wabt_gc_enabled,_wabt_set_gc_enabled,_wabt_memory64_enabled,_wabt_set_memory64_enabled,_wabt_multi_memory_enabled,_wabt_set_multi_memory_enabled,_wabt_extended_const_enabled,_wabt_set_extended_const_enabled,_wabt_relaxed_simd_enabled,_wabt_set_relaxed_simd_enabled,_wabt_custom_page_sizes_enabled,_wabt_set_custom_page_sizes_enabled,_wabt_compact_imports_enabled,_wabt_set_compact_imports_enabled,_wabt_wide_arithmetic_enabled,_wabt_set_wide_arithmetic_enabled,_wabt_new_wast_buffer_lexer,_wabt_parse_wat,_wabt_parse_wast,_wabt_read_binary,_wabt_validate_module,_wabt_validate_script,_wabt_write_binary_spec_script,_wabt_apply_names_module,_wabt_generate_names_module,_wabt_write_binary_module,_wabt_write_text_module,_wabt_destroy_module,_wabt_destroy_wast_lexer,_wabt_new_errors,_wabt_format_text_errors,_wabt_format_binary_errors,_wabt_destroy_errors,_wabt_parse_wat_result_get_result,_wabt_parse_wat_result_release_module,_wabt_destroy_parse_wat_result,_wabt_parse_wast_result_get_result,_wabt_parse_wast_result_release_module,_wabt_read_binary_result_get_result,_wabt_read_binary_result_release_module,_wabt_destroy_read_binary_result,_wabt_write_module_result_get_result,_wabt_write_module_result_release_output_buffer,_wabt_write_module_result_release_log_output_buffer,_wabt_destroy_write_module_result,_wabt_output_buffer_get_data,_wabt_output_buffer_get_size,_wabt_destroy_output_buffer,_free,_malloc,memory,__indirect_function_table,wasmMemory;function assignWasmExports(wasmExports){_wabt_new_features=Module[\"_wabt_new_features\"]=wasmExports[\"i\"];_wabt_destroy_features=Module[\"_wabt_destroy_features\"]=wasmExports[\"j\"];_wabt_exceptions_enabled=Module[\"_wabt_exceptions_enabled\"]=wasmExports[\"k\"];_wabt_set_exceptions_enabled=Module[\"_wabt_set_exceptions_enabled\"]=wasmExports[\"l\"];_wabt_mutable_globals_enabled=Module[\"_wabt_mutable_globals_enabled\"]=wasmExports[\"m\"];_wabt_set_mutable_globals_enabled=Module[\"_wabt_set_mutable_globals_enabled\"]=wasmExports[\"n\"];_wabt_sat_float_to_int_enabled=Module[\"_wabt_sat_float_to_int_enabled\"]=wasmExports[\"o\"];_wabt_set_sat_float_to_int_enabled=Module[\"_wabt_set_sat_float_to_int_enabled\"]=wasmExports[\"p\"];_wabt_sign_extension_enabled=Module[\"_wabt_sign_extension_enabled\"]=wasmExports[\"q\"];_wabt_set_sign_extension_enabled=Module[\"_wabt_set_sign_extension_enabled\"]=wasmExports[\"r\"];_wabt_simd_enabled=Module[\"_wabt_simd_enabled\"]=wasmExports[\"s\"];_wabt_set_simd_enabled=Module[\"_wabt_set_simd_enabled\"]=wasmExports[\"t\"];_wabt_threads_enabled=Module[\"_wabt_threads_enabled\"]=wasmExports[\"u\"];_wabt_set_threads_enabled=Module[\"_wabt_set_threads_enabled\"]=wasmExports[\"v\"];_wabt_function_references_enabled=Module[\"_wabt_function_references_enabled\"]=wasmExports[\"w\"];_wabt_set_function_references_enabled=Module[\"_wabt_set_function_references_enabled\"]=wasmExports[\"x\"];_wabt_multi_value_enabled=Module[\"_wabt_multi_value_enabled\"]=wasmExports[\"y\"];_wabt_set_multi_value_enabled=Module[\"_wabt_set_multi_value_enabled\"]=wasmExports[\"z\"];_wabt_tail_call_enabled=Module[\"_wabt_tail_call_enabled\"]=wasmExports[\"A\"];_wabt_set_tail_call_enabled=Module[\"_wabt_set_tail_call_enabled\"]=wasmExports[\"B\"];_wabt_bulk_memory_enabled=Module[\"_wabt_bulk_memory_enabled\"]=wasmExports[\"C\"];_wabt_set_bulk_memory_enabled=Module[\"_wabt_set_bulk_memory_enabled\"]=wasmExports[\"D\"];_wabt_reference_types_enabled=Module[\"_wabt_reference_types_enabled\"]=wasmExports[\"E\"];_wabt_set_reference_types_enabled=Module[\"_wabt_set_reference_types_enabled\"]=wasmExports[\"F\"];_wabt_annotations_enabled=Module[\"_wabt_annotations_enabled\"]=wasmExports[\"G\"];_wabt_set_annotations_enabled=Module[\"_wabt_set_annotations_enabled\"]=wasmExports[\"H\"];_wabt_code_metadata_enabled=Module[\"_wabt_code_metadata_enabled\"]=wasmExports[\"I\"];_wabt_set_code_metadata_enabled=Module[\"_wabt_set_code_metadata_enabled\"]=wasmExports[\"J\"];_wabt_gc_enabled=Module[\"_wabt_gc_enabled\"]=wasmExports[\"K\"];_wabt_set_gc_enabled=Module[\"_wabt_set_gc_enabled\"]=wasmExports[\"L\"];_wabt_memory64_enabled=Module[\"_wabt_memory64_enabled\"]=wasmExports[\"M\"];_wabt_set_memory64_enabled=Module[\"_wabt_set_memory64_enabled\"]=wasmExports[\"N\"];_wabt_multi_memory_enabled=Module[\"_wabt_multi_memory_enabled\"]=wasmExports[\"O\"];_wabt_set_multi_memory_enabled=Module[\"_wabt_set_multi_memory_enabled\"]=wasmExports[\"P\"];_wabt_extended_const_enabled=Module[\"_wabt_extended_const_enabled\"]=wasmExports[\"Q\"];_wabt_set_extended_const_enabled=Module[\"_wabt_set_extended_const_enabled\"]=wasmExports[\"R\"];_wabt_relaxed_simd_enabled=Module[\"_wabt_relaxed_simd_enabled\"]=wasmExports[\"S\"];_wabt_set_relaxed_simd_enabled=Module[\"_wabt_set_relaxed_simd_enabled\"]=wasmExports[\"T\"];_wabt_custom_page_sizes_enabled=Module[\"_wabt_custom_page_sizes_enabled\"]=wasmExports[\"U\"];_wabt_set_custom_page_sizes_enabled=Module[\"_wabt_set_custom_page_sizes_enabled\"]=wasmExports[\"V\"];_wabt_compact_imports_enabled=Module[\"_wabt_compact_imports_enabled\"]=wasmExports[\"W\"];_wabt_set_compact_imports_enabled=Module[\"_wabt_set_compact_imports_enabled\"]=wasmExports[\"X\"];_wabt_wide_arithmetic_enabled=Module[\"_wabt_wide_arithmetic_enabled\"]=wasmExports[\"Y\"];_wabt_set_wide_arithmetic_enabled=Module[\"_wabt_set_wide_arithmetic_enabled\"]=wasmExports[\"Z\"];_wabt_new_wast_buffer_lexer=Module[\"_wabt_new_wast_buffer_lexer\"]=wasmExports[\"_\"];_wabt_parse_wat=Module[\"_wabt_parse_wat\"]=wasmExports[\"$\"];_wabt_parse_wast=Module[\"_wabt_parse_wast\"]=wasmExports[\"aa\"];_wabt_read_binary=Module[\"_wabt_read_binary\"]=wasmExports[\"ba\"];_wabt_validate_module=Module[\"_wabt_validate_module\"]=wasmExports[\"ca\"];_wabt_validate_script=Module[\"_wabt_validate_script\"]=wasmExports[\"da\"];_wabt_write_binary_spec_script=Module[\"_wabt_write_binary_spec_script\"]=wasmExports[\"ea\"];_wabt_apply_names_module=Module[\"_wabt_apply_names_module\"]=wasmExports[\"fa\"];_wabt_generate_names_module=Module[\"_wabt_generate_names_module\"]=wasmExports[\"ga\"];_wabt_write_binary_module=Module[\"_wabt_write_binary_module\"]=wasmExports[\"ha\"];_wabt_write_text_module=Module[\"_wabt_write_text_module\"]=wasmExports[\"ia\"];_wabt_destroy_module=Module[\"_wabt_destroy_module\"]=wasmExports[\"ja\"];_wabt_destroy_wast_lexer=Module[\"_wabt_destroy_wast_lexer\"]=wasmExports[\"ka\"];_wabt_new_errors=Module[\"_wabt_new_errors\"]=wasmExports[\"la\"];_wabt_format_text_errors=Module[\"_wabt_format_text_errors\"]=wasmExports[\"ma\"];_wabt_format_binary_errors=Module[\"_wabt_format_binary_errors\"]=wasmExports[\"na\"];_wabt_destroy_errors=Module[\"_wabt_destroy_errors\"]=wasmExports[\"oa\"];_wabt_parse_wat_result_get_result=Module[\"_wabt_parse_wat_result_get_result\"]=wasmExports[\"pa\"];_wabt_parse_wat_result_release_module=Module[\"_wabt_parse_wat_result_release_module\"]=wasmExports[\"qa\"];_wabt_destroy_parse_wat_result=Module[\"_wabt_destroy_parse_wat_result\"]=wasmExports[\"ra\"];_wabt_parse_wast_result_get_result=Module[\"_wabt_parse_wast_result_get_result\"]=wasmExports[\"sa\"];_wabt_parse_wast_result_release_module=Module[\"_wabt_parse_wast_result_release_module\"]=wasmExports[\"ta\"];_wabt_read_binary_result_get_result=Module[\"_wabt_read_binary_result_get_result\"]=wasmExports[\"ua\"];_wabt_read_binary_result_release_module=Module[\"_wabt_read_binary_result_release_module\"]=wasmExports[\"va\"];_wabt_destroy_read_binary_result=Module[\"_wabt_destroy_read_binary_result\"]=wasmExports[\"wa\"];_wabt_write_module_result_get_result=Module[\"_wabt_write_module_result_get_result\"]=wasmExports[\"xa\"];_wabt_write_module_result_release_output_buffer=Module[\"_wabt_write_module_result_release_output_buffer\"]=wasmExports[\"ya\"];_wabt_write_module_result_release_log_output_buffer=Module[\"_wabt_write_module_result_release_log_output_buffer\"]=wasmExports[\"za\"];_wabt_destroy_write_module_result=Module[\"_wabt_destroy_write_module_result\"]=wasmExports[\"Aa\"];_wabt_output_buffer_get_data=Module[\"_wabt_output_buffer_get_data\"]=wasmExports[\"Ba\"];_wabt_output_buffer_get_size=Module[\"_wabt_output_buffer_get_size\"]=wasmExports[\"Ca\"];_wabt_destroy_output_buffer=Module[\"_wabt_destroy_output_buffer\"]=wasmExports[\"Da\"];_free=Module[\"_free\"]=wasmExports[\"Ea\"];_malloc=Module[\"_malloc\"]=wasmExports[\"Fa\"];memory=wasmMemory=wasmExports[\"g\"];__indirect_function_table=wasmExports[\"__indirect_function_table\"]}var wasmImports={f:__abort_js,b:_emscripten_resize_heap,c:_environ_get,d:_environ_sizes_get,e:_fd_close,a:_fd_write};function run(){preRun();function doRun(){Module[\"calledRun\"]=true;if(ABORT)return;initRuntime();readyPromiseResolve?.(Module);Module[\"onRuntimeInitialized\"]?.();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(()=>{setTimeout(()=>Module[\"setStatus\"](\"\"),1);doRun()},1)}else{doRun()}}var wasmExports;wasmExports=await (createWasm());run();const WABT_OK=0;const FEATURES=Object.freeze({exceptions:false,mutable_globals:true,sat_float_to_int:true,sign_extension:true,simd:true,threads:false,function_references:false,multi_value:true,tail_call:false,bulk_memory:true,reference_types:true,annotations:false,code_metadata:false,gc:false,memory64:false,multi_memory:false,extended_const:false,relaxed_simd:false,custom_page_sizes:false,compact_imports:false,wide_arithmetic:false});function malloc(size){const addr=Module._malloc(size);if(addr==0){throw new Error(\"out of memory\")}return addr}function allocateBuffer(buf){let addr;let size;if(buf instanceof ArrayBuffer){size=buf.byteLength;addr=malloc(size);new Uint8Array(HEAPU8.buffer,addr,size).set(new Uint8Array(buf))}else if(ArrayBuffer.isView(buf)){size=buf.byteLength;addr=malloc(size);new Uint8Array(HEAPU8.buffer,addr,size).set(new Uint8Array(buf.buffer,buf.byteOffset,buf.byteLength))}else if(typeof buf==\"string\"){addr=stringToNewUTF8(buf);size=lengthBytesUTF8(buf)}else{throw new Error(\"unknown buffer type: \"+buf)}return{addr,size}}class Features{constructor(obj={}){this.addr=Module._wabt_new_features();for(const[f,v]of Object.entries(FEATURES)){this[f]=obj[f]??v}}destroy(){Module._wabt_destroy_features(this.addr)}}Object.keys(FEATURES).forEach(function(feature){Object.defineProperty(Features.prototype,feature,{enumerable:true,get:function(){return Module[\"_wabt_\"+feature+\"_enabled\"](this.addr)},set:function(newValue){Module[\"_wabt_set_\"+feature+\"_enabled\"](this.addr,newValue|0)}})});class Lexer{constructor(filename,buffer,errors){this.filename=stringToNewUTF8(filename);this.bufferObj=allocateBuffer(buffer);this.addr=Module._wabt_new_wast_buffer_lexer(this.filename,this.bufferObj.addr,this.bufferObj.size,errors.addr)}destroy(){Module._wabt_destroy_wast_lexer(this.addr);Module._free(this.bufferObj.addr);Module._free(this.filename)}}class OutputBuffer{constructor(addr){this.addr=addr}toTypedArray(){if(!this.addr){return null}const addr=Module._wabt_output_buffer_get_data(this.addr);const size=Module._wabt_output_buffer_get_size(this.addr);const buffer=new Uint8Array(size);buffer.set(new Uint8Array(HEAPU8.buffer,addr,size));return buffer}toString(){if(!this.addr){return\"\"}const addr=Module._wabt_output_buffer_get_data(this.addr);const size=Module._wabt_output_buffer_get_size(this.addr);return UTF8ToString(addr,size)}destroy(){Module._wabt_destroy_output_buffer(this.addr)}}class Errors{constructor(kind){this.kind=kind;this.addr=Module._wabt_new_errors()}format(lexer=null){let buffer;switch(this.kind){case\"text\":buffer=new OutputBuffer(Module._wabt_format_text_errors(this.addr,lexer.addr));break;case\"binary\":buffer=new OutputBuffer(Module._wabt_format_binary_errors(this.addr));break;default:throw new Error(`Invalid Errors kind: ${this.kind}`)}const message=buffer.toString();buffer.destroy();return message}destroy(){Module._wabt_destroy_errors(this.addr)}}function parseWat(filename,buffer,options){let errors=new Errors(\"text\");let lexer=new Lexer(filename,buffer,errors);const features=new Features(options||{});let parseResult_addr;try{parseResult_addr=Module._wabt_parse_wat(lexer.addr,features.addr,errors.addr);const result=Module._wabt_parse_wat_result_get_result(parseResult_addr);if(result!==WABT_OK){throw new Error(\"parseWat failed:\\n\"+errors.format(lexer))}const module_addr=Module._wabt_parse_wat_result_release_module(parseResult_addr);const wasmModule=new WasmModule(module_addr,errors,lexer);errors=null;lexer=null;return wasmModule}finally{Module._wabt_destroy_parse_wat_result(parseResult_addr);features.destroy();if(errors){errors.destroy()}if(lexer){lexer.destroy()}}}function readWasm(buffer,options={}){const bufferObj=allocateBuffer(buffer);let errors=new Errors(\"binary\");const readDebugNames=options.readDebugNames??false;const check=options.check??true;const features=new Features(options);let readBinaryResult_addr;try{readBinaryResult_addr=Module._wabt_read_binary(bufferObj.addr,bufferObj.size,readDebugNames,features.addr,errors.addr);const result=Module._wabt_read_binary_result_get_result(readBinaryResult_addr);if(check&&result!==WABT_OK){throw new Error(\"readWasm failed:\\n\"+errors.format())}const module_addr=Module._wabt_read_binary_result_release_module(readBinaryResult_addr);const wasmModule=new WasmModule(module_addr,errors);errors=null;return wasmModule}finally{Module._wabt_destroy_read_binary_result(readBinaryResult_addr);features.destroy();if(errors){errors.destroy()}Module._free(bufferObj.addr)}}class WasmModule{constructor(module_addr,errors,lexer=null){this.module_addr=module_addr;this.errors=errors;this.lexer=lexer}validate(options){const features=new Features(options||{});try{const result=Module._wabt_validate_module(this.module_addr,features.addr,this.errors.addr);if(result!==WABT_OK){throw new Error(\"validate failed:\\n\"+this.errors.format(this.lexer))}}finally{features.destroy()}}generateNames(){const result=Module._wabt_generate_names_module(this.module_addr);if(result!==WABT_OK){throw new Error(\"generateNames failed.\")}}applyNames(){const result=Module._wabt_apply_names_module(this.module_addr);if(result!==WABT_OK){throw new Error(\"applyNames failed.\")}}toText(options={}){const foldExprs=options.foldExprs??false;const inlineExport=options.inlineExport??false;const writeModuleResult_addr=Module._wabt_write_text_module(this.module_addr,foldExprs,inlineExport);const result=Module._wabt_write_module_result_get_result(writeModuleResult_addr);let outputBuffer;try{if(result!==WABT_OK){throw new Error(\"toText failed.\")}outputBuffer=new OutputBuffer(Module._wabt_write_module_result_release_output_buffer(writeModuleResult_addr));return outputBuffer.toString()}finally{if(outputBuffer){outputBuffer.destroy()}Module._wabt_destroy_write_module_result(writeModuleResult_addr)}}toBinary(options={}){const log=options.log??false;const canonicalize_lebs=options.canonicalize_lebs??true;const relocatable=options.relocatable??false;const write_debug_names=options.write_debug_names??false;const writeModuleResult_addr=Module._wabt_write_binary_module(this.module_addr,log,canonicalize_lebs,relocatable,write_debug_names);const result=Module._wabt_write_module_result_get_result(writeModuleResult_addr);let binaryOutputBuffer;let logOutputBuffer;try{if(result!==WABT_OK){throw new Error(\"toBinary failed.\")}binaryOutputBuffer=new OutputBuffer(Module._wabt_write_module_result_release_output_buffer(writeModuleResult_addr));logOutputBuffer=new OutputBuffer(Module._wabt_write_module_result_release_log_output_buffer(writeModuleResult_addr));return{buffer:binaryOutputBuffer.toTypedArray(),log:logOutputBuffer.toString()}}finally{if(binaryOutputBuffer){binaryOutputBuffer.destroy()}if(logOutputBuffer){logOutputBuffer.destroy()}Module._wabt_destroy_write_module_result(writeModuleResult_addr)}}destroy(){Module._wabt_destroy_module(this.module_addr);if(this.errors){this.errors.destroy()}if(this.lexer){this.lexer.destroy()}}}Module[\"parseWat\"]=parseWat;Module[\"readWasm\"]=readWasm;Module[\"FEATURES\"]=FEATURES;if(runtimeInitialized){moduleRtn=Module}else{moduleRtn=new Promise((resolve,reject)=>{readyPromiseResolve=resolve;readyPromiseReject=reject})}\n;return moduleRtn}export default WabtModule;\n"
  },
  {
    "path": "docs/demo/share.js",
    "content": "/*\n * Copyright 2026 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getLocalStorageFeatures() {\n  try {\n    return JSON.parse(localStorage && localStorage.getItem('features')) || {};\n  } catch (e) {\n    console.log(e);\n    return {};\n  }\n}\n\nexport function saveLocalStorageFeatures(features) {\n  if (localStorage) {\n    localStorage.setItem('features', JSON.stringify(features));\n  }\n}\n\nexport function renderFeatures(wabt, features, onChange) {\n  const featuresEl = document.getElementById('features');\n  const featuresList =\n      Object.entries(wabt.FEATURES).sort(([a], [b]) => a.localeCompare(b));\n  for (const [f, v] of featuresList) {\n    const featureEl = document.createElement('input');\n    featureEl.type = 'checkbox';\n    featureEl.id = f;\n    const isChecked = !!(features[f] !== undefined ? features[f] : v);\n    featureEl.checked = isChecked;\n    features[f] = isChecked;\n    featureEl.addEventListener('change', event => {\n      features[event.target.id] = event.target.checked;\n      if (onChange) {\n        onChange();\n      }\n    });\n    const labelEl = document.createElement('label');\n    labelEl.htmlFor = f;\n    labelEl.textContent = f.replace(/_/g, ' ');\n    const itemEl = document.createElement('div');\n    itemEl.className = 'feature-item';\n    itemEl.appendChild(featureEl);\n    itemEl.appendChild(labelEl);\n    featuresEl.appendChild(itemEl);\n  }\n}\n"
  },
  {
    "path": "docs/demo/third_party/.gitignore",
    "content": "node_modules\n"
  },
  {
    "path": "docs/demo/third_party/README.md",
    "content": "# WABT Demo Third-Party Dependencies\n\nThis directory contains the build configuration for third-party dependencies\nused by the WABT web demos (located in `docs/demo`).\n\nCurrently, this is used to generate a single ES Module bundle for **CodeMirror\n6**, which is required because CodeMirror 6 consists of many highly-scoped NPM\npackages that are difficult to load individually via CDNs in a browser without\ninstance-duplication issues.\n\n## Building the Third-Party Bundle\n\nThe demo applications (`wasm2wat/index.html` and `wat2wasm/index.html`) expect\nto find a compiled bundle at `docs/demo/third_party.bundle.js`.\n\nTo regenerate this bundle:\n\n1. Ensure you have [Node.js and npm](https://nodejs.org/) installed.\n2. From this directory (`docs/demo/third_party`), execute:\n\n```bash\nnpm install\nnpm run build\n```\n\nThe `build` script uses `esbuild` to analyze `index.js`, tree-shake the used\nmodules (like `EditorView`, `wast` syntax highlighting, and `javascript`\nsupport), and output the final ES Module bundle as `../third_party.bundle.js`.\n\n## Adding or Updating Dependencies\n\n1. If you need to expose new CodeMirror features to the demo apps, add the\n   relevant `export` statement to `index.js`.\n2. To update versions of CodeMirror, run `npm update` or manually adjust\n   `package.json` and run `npm install`.\n3. Commit both the updated `package.json`/`package-lock.json` and the built\n   `../third_party.bundle.js`.\n"
  },
  {
    "path": "docs/demo/third_party/index.js",
    "content": "/*\n * Copyright 2026 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport {javascript} from '@codemirror/lang-javascript';\nexport {StreamLanguage} from '@codemirror/language';\nexport {wast} from '@codemirror/legacy-modes/mode/wast';\nexport {EditorState} from '@codemirror/state';\nexport {basicSetup, EditorView} from 'codemirror';\nexport {default as Split} from 'split.js';\n"
  },
  {
    "path": "docs/demo/third_party/package.json",
    "content": "{\n  \"name\": \"third_party\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"build\": \"esbuild index.js --bundle --format=esm --minify --sourcemap --outfile=../third_party.bundle.js\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"type\": \"commonjs\",\n  \"dependencies\": {\n    \"@codemirror/commands\": \"^6.10.3\",\n    \"@codemirror/lang-javascript\": \"^6.2.5\",\n    \"@codemirror/language\": \"^6.12.2\",\n    \"@codemirror/legacy-modes\": \"^6.5.2\",\n    \"@codemirror/state\": \"^6.6.0\",\n    \"@codemirror/view\": \"^6.40.0\",\n    \"codemirror\": \"^6.0.2\",\n    \"esbuild\": \"^0.27.4\",\n    \"split.js\": \"^1.6.5\"\n  }\n}\n"
  },
  {
    "path": "docs/demo/third_party.bundle.js",
    "content": "var cp=0,Ui=class{constructor(e,t){this.from=e,this.to=t}},z=class{constructor(e={}){this.id=cp++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error(\"This node type doesn't define a deserialize function\")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError(\"Can't add per-node props to node types\");return typeof e!=\"function\"&&(e=pe.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}};z.closedBy=new z({deserialize:n=>n.split(\" \")});z.openedBy=new z({deserialize:n=>n.split(\" \")});z.group=new z({deserialize:n=>n.split(\" \")});z.isolate=new z({deserialize:n=>{if(n&&n!=\"rtl\"&&n!=\"ltr\"&&n!=\"auto\")throw new RangeError(\"Invalid value for isolate: \"+n);return n||\"auto\"}});z.contextHash=new z({perNode:!0});z.lookAhead=new z({perNode:!0});z.mounted=new z({perNode:!0});var Nt=class{constructor(e,t,i,s=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=s}static get(e){return e&&e.props&&e.props[z.mounted.id]}},fp=Object.create(null),pe=class n{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):fp,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new n(e.name||\"\",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError(\"Can't store a per-node prop on a node type\");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==\"string\"){if(this.name==e)return!0;let t=this.prop(z.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(\" \"))t[s]=e[i];return i=>{for(let s=i.prop(z.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}};pe.none=new pe(\"\",Object.create(null),0,8);var xi=class n{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError(\"Node type ids should correspond to array positions when creating a node set\")}extend(...e){let t=[];for(let i of this.types){let s=null;for(let r of e){let o=r(i);if(o){s||(s=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in s&&(l=a.combine(s[a.id],l)),s[a.id]=l}}t.push(s?new pe(i.name,s,i.id,i.flags):i)}return new n(t)}},Un=new WeakMap,th=new WeakMap,J;(function(n){n[n.ExcludeBuffers=1]=\"ExcludeBuffers\",n[n.IncludeAnonymous=2]=\"IncludeAnonymous\",n[n.IgnoreMounts=4]=\"IgnoreMounts\",n[n.IgnoreOverlays=8]=\"IgnoreOverlays\",n[n.EnterBracketed=16]=\"EnterBracketed\"})(J||(J={}));var U=class n{constructor(e,t,i,s,r){if(this.type=e,this.children=t,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o==\"number\"?o:o.id]=l}}toString(){let e=Nt.get(this);if(e&&!e.overlay)return e.tree.toString();let t=\"\";for(let i of this.children){let s=i.toString();s&&(t&&(t+=\",\"),t+=s)}return this.type.name?(/\\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?\"(\"+t+\")\":\"\"):t}cursor(e=0){return new Hi(this.topNode,e)}cursorAt(e,t=0,i=0){let s=Un.get(this)||this.topNode,r=new Hi(s);return r.moveTo(e,t),Un.set(this,r._tree),r}get topNode(){return new Ne(this,0,0,null)}resolve(e,t=0){let i=Fi(Un.get(this)||this.topNode,e,t,!1);return Un.set(this,i),i}resolveInner(e,t=0){let i=Fi(th.get(this)||this.topNode,e,t,!0);return th.set(this,i),i}resolveStack(e,t=0){return up(this,e,t)}iterate(e){let{enter:t,leave:i,from:s=0,to:r=this.length}=e,o=e.mode||0,l=(o&J.IncludeAnonymous)>0;for(let a=this.cursor(o|J.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ur(pe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new n(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new n(pe.none,t,i,s)))}static build(e){return dp(e)}};U.empty=new U(pe.none,[],[],0);var Ir=class n{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new n(this.buffer,this.index)}},Zt=class n{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return pe.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(\",\")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],s=this.set.types[t],r=s.name;if(/\\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),e+=4,i==e)return r;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return r+\"(\"+o.join(\",\")+\")\"}findChild(e,t,i,s,r){let{buffer:o}=this,l=-1;for(let a=e;a!=t&&!(sh(r,s,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l<t;){r[a++]=s[l++],r[a++]=s[l++]-i;let h=r[a++]=s[l++]-i;r[a++]=s[l++]-e,o=Math.max(o,h)}return new n(r,o,this.set)}};function sh(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Fi(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!i&&n instanceof Ne&&n.index<0?null:n.parent;if(!o)return n;n=o}let r=i?0:J.IgnoreOverlays;if(i)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof Ne&&o.index<0&&((s=l.enter(e,t,r))===null||s===void 0?void 0:s.from)!=o.from&&(n=l);for(;;){let o=n.enter(e,t,r);if(!o)return n;n=o}}var Hn=class{cursor(e=0){return new Hi(this,e)}getChild(e,t=null,i=null){let s=ih(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return ih(this,e,t,i)}resolve(e,t=0){return Fi(this,e,t,!1)}resolveInner(e,t=0){return Fi(this,e,t,!0)}matchContext(e){return qr(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let s=t.lastChild;if(!s||s.to!=t.to)break;s.type.isError&&s.from==s.to?(i=t,t=s.prevSibling):t=s}return i}get node(){return this}get next(){return this.parent}},Ne=class n extends Hn{constructor(e,t,i,s){super(),this._tree=e,this.from=t,this.index=i,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,s,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=t>0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from,u;if(!(!(r&J.EnterBracketed&&c instanceof U&&(u=Nt.get(c))&&!u.overlay&&u.bracketed&&i>=f&&i<=f+c.length)&&!sh(s,i,f,f+c.length))){if(c instanceof Zt){if(r&J.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,i-f,s);if(d>-1)return new Gt(new Vr(o,c,e,f),null,d)}else if(r&J.IncludeAnonymous||!c.type.isAnonymous||Gr(c)){let d;if(!(r&J.IgnoreMounts)&&(d=Nt.get(c))&&!d.overlay)return new n(d.tree,f,e,o);let p=new n(c,f,e,o);return r&J.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,i,s,r)}}}if(r&J.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let s;if(!(i&J.IgnoreOverlays)&&(s=Nt.get(this._tree))&&s.overlay){let r=e-this.from,o=i&J.EnterBracketed&&s.bracketed;for(let{from:l,to:a}of s.overlay)if((t>0||o?l<=r:l<r)&&(t<0||o?a>=r:a>r))return new n(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function ih(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function qr(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}var Vr=class{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}},Gt=class n extends Hn{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new n(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&J.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new n(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new n(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new n(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function rh(n){if(!n.length)return null;let e=0,t=n[0];for(let r=1;r<n.length;r++){let o=n[r];(o.from>t.from||o.to<t.to)&&(t=o,e=r)}let i=t instanceof Ne&&t.index<0?null:t.parent,s=n.slice();return i?s[e]=i:s.splice(e,1),new jr(s,t)}var jr=class{constructor(e,t){this.heads=e,this.node=t}get next(){return rh(this.heads)}};function up(n,e,t){let i=n.resolveInner(e,t),s=null;for(let r=i instanceof Ne?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(s||(s=[i])).push(o.resolve(e,t)),r=o}else{let o=Nt.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new Ne(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(Fi(l,e,t,!1))}}return s?rh(s):i}var Hi=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~J.EnterBracketed,e instanceof Ne)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Ne?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&J.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&J.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&J.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(s.buffer.buffer[r+3]<this.index)return!1;({index:t,parent:i}=s)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&J.IncludeAnonymous||l instanceof Zt||!l.type.isAnonymous||Gr(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let s=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s<this.stack.length;s++)t=new Gt(this.buffer,t,this.stack[s]);return this.bufferNode=new Gt(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&t&&t(this),s=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,s=!0}}}matchContext(e){if(!this.buffer)return qr(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let s=e.length-1,r=this.stack.length-1;s>=0;r--){if(r<0)return qr(this._tree,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}};function Gr(n){return n.children.some(e=>e instanceof Zt||!e.type.isAnonymous||Gr(e))}function dp(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=1024,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Ir(t,t.length):t,a=i.types,h=0,c=0;function f(w,v,Q,D,W,G){let{id:_,start:X,end:Y,size:q}=l,j=c,fe=h;if(q<0)if(l.next(),q==-1){let Ve=r[_];Q.push(Ve),D.push(X-w);return}else if(q==-3){h=_;return}else if(q==-4){c=_;return}else throw new RangeError(`Unrecognized record size: ${q}`);let ye=a[_],qe,oe,Te=X-w;if(Y-X<=s&&(oe=m(l.pos-v,W))){let Ve=new Uint16Array(oe.size-oe.skip),Ce=l.pos-oe.size,je=Ve.length;for(;l.pos>Ce;)je=g(oe.start,Ve,je);qe=new Zt(Ve,Y-oe.start,i),Te=oe.start-w}else{let Ve=l.pos-q;l.next();let Ce=[],je=[],ke=_>=o?_:-1,bt=0,yi=Y;for(;l.pos>Ve;)ke>=0&&l.id==ke&&l.size>=0?(l.end<=yi-s&&(p(Ce,je,X,bt,l.end,yi,ke,j,fe),bt=Ce.length,yi=l.end),l.next()):G>2500?u(X,Ve,Ce,je):f(X,Ve,Ce,je,ke,G+1);if(ke>=0&&bt>0&&bt<Ce.length&&p(Ce,je,X,bt,X,yi,ke,j,fe),Ce.reverse(),je.reverse(),ke>-1&&bt>0){let jn=d(ye,fe);qe=Ur(ye,Ce,je,0,Ce.length,0,Y-X,jn,jn)}else qe=O(ye,Ce,je,Y-X,j-Y,fe)}Q.push(qe),D.push(Te)}function u(w,v,Q,D){let W=[],G=0,_=-1;for(;l.pos>v;){let{id:X,start:Y,end:q,size:j}=l;if(j>4)l.next();else{if(_>-1&&Y<_)break;_<0&&(_=q-s),W.push(X,Y,q),G++,l.next()}}if(G){let X=new Uint16Array(G*4),Y=W[W.length-2];for(let q=W.length-3,j=0;q>=0;q-=3)X[j++]=W[q],X[j++]=W[q+1]-Y,X[j++]=W[q+2]-Y,X[j++]=j;Q.push(new Zt(X,W[2]-Y,i)),D.push(Y-w)}}function d(w,v){return(Q,D,W)=>{let G=0,_=Q.length-1,X,Y;if(_>=0&&(X=Q[_])instanceof U){if(!_&&X.type==w&&X.length==W)return X;(Y=X.prop(z.lookAhead))&&(G=D[_]+X.length+Y)}return O(w,Q,D,W,G,v)}}function p(w,v,Q,D,W,G,_,X,Y){let q=[],j=[];for(;w.length>D;)q.push(w.pop()),j.push(v.pop()+Q-W);w.push(O(i.types[_],q,j,G-W,X-G,Y)),v.push(W-Q)}function O(w,v,Q,D,W,G,_){if(G){let X=[z.contextHash,G];_=_?[X].concat(_):[X]}if(W>25){let X=[z.lookAhead,W];_=_?[X].concat(_):[X]}return new U(w,v,Q,D,_)}function m(w,v){let Q=l.fork(),D=0,W=0,G=0,_=Q.end-s,X={size:0,start:0,skip:0};e:for(let Y=Q.pos-w;Q.pos>Y;){let q=Q.size;if(Q.id==v&&q>=0){X.size=D,X.start=W,X.skip=G,G+=4,D+=4,Q.next();continue}let j=Q.pos-q;if(q<0||j<Y||Q.start<_)break;let fe=Q.id>=o?4:0,ye=Q.start;for(Q.next();Q.pos>j;){if(Q.size<0)if(Q.size==-3||Q.size==-4)fe+=4;else break e;else Q.id>=o&&(fe+=4);Q.next()}W=ye,D+=q,G+=fe}return(v<0||D==w)&&(X.size=D,X.start=W,X.skip=G),X.size>4?X:void 0}function g(w,v,Q){let{id:D,start:W,end:G,size:_}=l;if(l.next(),_>=0&&D<o){let X=Q;if(_>4){let Y=l.pos-(_-4);for(;l.pos>Y;)Q=g(w,v,Q)}v[--Q]=X,v[--Q]=G-w,v[--Q]=W-w,v[--Q]=D}else _==-3?h=D:_==-4&&(c=D);return Q}let S=[],b=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,S,b,-1,0);let A=(e=n.length)!==null&&e!==void 0?e:S.length?b[0]+S[0].length:0;return new U(a[n.topID],S.reverse(),b.reverse(),A)}var nh=new WeakMap;function Fn(n,e){if(!n.isAnonymous||e instanceof Zt||e.type!=n)return 1;let t=nh.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof U)){t=1;break}t+=Fn(n,i)}nh.set(e,t)}return t}function Ur(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p<s;p++)h+=Fn(n,e[p]);let c=Math.ceil(h*1.5/8),f=[],u=[];function d(p,O,m,g,S){for(let b=m;b<g;){let A=b,w=O[b],v=Fn(n,p[b]);for(b++;b<g;b++){let Q=Fn(n,p[b]);if(v+Q>=c)break;v+=Q}if(b==A+1){if(v>c){let Q=p[A];d(Q.children,Q.positions,0,Q.children.length,O[A]+S);continue}f.push(p[A])}else{let Q=O[b-1]+p[b-1].length-w;f.push(Ur(n,p,O,A,b,w,Q,null,a))}u.push(w+S-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}var Kn=class{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Gt?this.setBuffer(e.context.buffer,e.index,t):e instanceof Ne&&this.map.set(e.tree,t)}get(e){return e instanceof Gt?this.getBuffer(e.context.buffer,e.index):e instanceof Ne?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},Ut=class n{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new n(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l<t.length?t[l]:null,f=c?c.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new n(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=r<e.length?e[r++]:null}if(!c)break;a=c.toA,h=c.toA-c.toB}return s}},Ft=class{startParse(e,t,i){return typeof e==\"string\"&&(e=new Nr(e)),i=i?i.length?i.map(s=>new Ui(s.from,s.to)):[new Ui(0,0)]:[new Ui(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}},Nr=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};var sx=new z({perNode:!0});var Kr=class n{constructor(e,t,i,s,r,o,l,a,h,c=0,f){this.p=e,this.stack=t,this.state=i,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?\"!\"+this.score:\"\"}`}static start(e,t,i=0){let s=e.parser.context;return new n(e,[],t,i,i,0,[],0,s?new Jn(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,s=e&65535,{parser:r}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=r.dynamicPrecedence(s);if(l&&(this.score+=l),i==0){this.pushState(r.getGoto(this.state,s,!0),this.reducePos),s<r.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(s,this.reducePos);return}let a=this.stack.length-(i-1)*3-(e&262144?6:0),h=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-h;c>=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=c));let f=a?this.stack[a-1]:0,u=this.bufferBase+this.buffer.length-f;if(s<r.minRepeatTerm||e&131072){let d=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,h,d,u+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=r.getGoto(d,s,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(s,h)}storeNode(e,t,i,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==i)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=i;return}}}if(!r||this.pos==i)this.buffer.push(e,t,i,s);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=s}}shift(e,t,i,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let r=e,{parser:o}=this.p;this.pos=s;let l=o.stateFlag(r,1);!l&&(s>i||t<=o.maxNode)&&(this.reducePos=s),this.pushState(r,l?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,s,4)}else this.pos=s,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,s,4)}apply(e,t,i,s){e&65536?this.reduce(e):this.shift(e,t,i,s)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new n(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Jr(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;r<t.length;r+=2)(o=t[r+1])!=this.state&&this.p.parser.hasAction(o,e)&&s.push(t[r],o);if(this.stack.length<120)for(let r=0;s.length<8&&r<t.length;r+=2){let o=t[r+1];s.some((l,a)=>a&1&&l==o)||s.push(t[r],o)}t=s}let i=[];for(let s=0;s<t.length&&i.length<4;s+=2){let r=t[s+1];if(r==this.state)continue;let o=this.split();o.pushState(r,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[s],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let i=t>>19,s=t&65535,r=this.stack.length-i*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,r+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Jn(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Jn=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Jr=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}},eo=class n{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new n(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new n(this.stack,this.pos,this.index)}};function Ki(n,e=Uint16Array){if(typeof n!=\"string\")return n;let t=null;for(let i=0,s=0;i<n.length;){let r=0;for(;;){let o=n.charCodeAt(i++),l=!1;if(o==126){r=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}t?t[s++]=r:t=new e(r)}return t}var bi=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},oh=new bi,to=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=\"\",this.chunkOff=0,this.chunk2=\"\",this.chunk2Pos=0,this.next=-1,this.token=oh,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,s=this.rangeIndex,r=this.pos+e;for(;r<i.from;){if(!s)return null;let o=this.ranges[--s];r-=i.from-o.to,i=o}for(;t<0?r>i.to:r>=i.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-i.to,i=o}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,s;if(t>=0&&t<this.chunk.length)i=this.pos+e,s=this.chunk.charCodeAt(t);else{let r=this.resolveOffset(e,1);if(r==null)return-1;if(i=r,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),s=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),s}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError(\"Token end out of bounds\");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=\"\",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=oh,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=\"\",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i=\"\";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(i+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return i}},At=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;fh(this.data,e,t,this.id,i.data,i.tokenPrecTable)}};At.prototype.contextual=At.prototype.fallback=At.prototype.extend=!1;var Si=class{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e==\"string\"?Ki(e):e}token(e,t){let i=e.pos,s=0;for(;;){let r=e.next<0,o=e.resolveOffset(1,1);if(fh(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(r||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(i,e.token),e.acceptToken(this.elseToken,s))}};Si.prototype.contextual=At.prototype.fallback=At.prototype.extend=!1;var Mt=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function fh(n,e,t,i,s,r){let o=0,l=1<<i,{dialect:a}=t.p.parser;e:for(;(l&n[o])!=0;){let h=n[o+1];for(let d=o+3;d<h;d+=2)if((n[d+1]&l)>0){let p=n[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||Op(p,e.token.value,s,r))){e.acceptToken(p);break}}let c=e.next,f=0,u=n[o+2];if(e.next<0&&u>f&&n[h+u*3-3]==65535){o=n[h+u*3-1];continue e}for(;f<u;){let d=f+u>>1,p=h+d+(d<<1),O=n[p],m=n[p+1]||65536;if(c<O)u=d;else if(c>=m)f=d+1;else{o=n[p+2],e.advance();continue e}}break}}function lh(n,e,t){for(let i=e,s;(s=n[i])!=65535;i++)if(s==t)return i-e;return-1}function Op(n,e,t,i){let s=lh(t,i,e);return s<0||lh(t,i,n)<s}var Ee=typeof process<\"u\"&&process.env&&/\\bparse\\b/.test(process.env.LOG),Fr=null;function ah(n,e,t){let i=n.cursor(J.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}var io=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?ah(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?ah(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],s=this.index[t];if(s==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=i.children[s],o=this.start[t]+i.positions[s];if(o>e)return this.nextStart=o,null;if(r instanceof U){if(o==e){if(o<this.safeFrom)return null;let l=o+r.length;if(l<=this.safeTo){let a=r.prop(z.lookAhead);if(!a||l+a<this.fragment.to)return r}}this.index[t]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}},no=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new bi)}getActions(e){let t=0,i=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;h<r.length;h++){if((1<<h&o)==0)continue;let c=r[h],f=this.tokens[h];if(!(i&&!c.fallback)&&((c.contextual||f.start!=e.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,c,e),f.mask=o,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!c.extend&&(i=f,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new bi,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new bi,{pos:i,p:s}=e;return t.start=i,t.end=Math.min(i+1,s.stream.end),t.value=i==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,i){let s=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(s,e),i),e.value>-1){let{parser:r}=i.p;for(let o=0;o<r.specialized.length;o++)if(r.specialized[o]==e.value){let l=r.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,i,s){for(let r=0;r<s;r+=3)if(this.actions[r]==e)return s;return this.actions[s++]=e,this.actions[s++]=t,this.actions[s++]=i,s}addActions(e,t,i,s){let{state:r}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let h=o.stateSlot(r,a?2:1);;h+=3){if(l[h]==65535)if(l[h+1]==1)h=St(l,h+2);else{s==0&&l[h+1]==2&&(s=this.putAction(St(l,h+2),t,i,s));break}l[h]==t&&(s=this.putAction(St(l,h+1),t,i,s))}return s}},so=class{constructor(e,t,i,s){this.parser=e,this.input=t,this.ranges=s,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new to(t,s),this.tokens=new no(e,this.stream),this.topTerm=e.top[1];let{from:r}=s[0];this.stacks=[Kr.start(this,e.top[0],r)],this.fragments=i.length&&this.stream.end-r>e.bufferLength*4?new io(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>t)i.push(l);else{if(this.advanceStack(l,i,e))continue;{s||(s=[],r=[]),s.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!i.length){let o=s&&mp(s);if(o)return Ee&&console.log(\"Finish with \"+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ee&&s&&console.log(\"Stuck with token \"+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):\"none\")),new SyntaxError(\"No parse at \"+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,i);if(o)return Ee&&console.log(\"Force-finish \"+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let h=i[a];if(l.sameState(h)||l.buffer.length>500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError(\"Can't move stoppedAt forward\");this.stoppedAt=e}advanceStack(e,t,i){let s=e.pos,{parser:r}=this,o=Ee?this.stackID(e)+\" -> \":\"\";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(s);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?r.getGoto(e.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop(z.contextHash)||0)==c))return e.useNode(f,u),Ee&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(f.type.id)})`),!0;if(!(f instanceof U)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof U&&f.positions[0]==0)f=d;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ee&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;h<a.length;){let c=a[h++],f=a[h++],u=a[h++],d=h==a.length||!i,p=d?e:e.split(),O=this.tokens.mainToken;if(p.apply(c,f,O?O.start:p.pos,u),Ee&&console.log(o+this.stackID(p)+` (via ${(c&65536)==0?\"shift\":`reduce of ${r.getName(c&65535)}`} for ${r.getName(f)} @ ${s}${p==e?\"\":\", split\"})`),d)return!0;p.pos>s?t.push(p):i.push(p)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return hh(e,t),!0}}runRecovery(e,t,i){let s=null,r=!1;for(let o=0;o<e.length;o++){let l=e[o],a=t[o<<1],h=t[(o<<1)+1],c=Ee?this.stackID(l)+\" -> \":\"\";if(l.deadEnd&&(r||(r=!0,l.restart(),Ee&&console.log(c+this.stackID(l)+\" (restarted)\"),this.advanceFully(l,i))))continue;let f=l.split(),u=c;for(let d=0;d<10&&f.forceReduce()&&(Ee&&console.log(u+this.stackID(f)+\" (via force-reduce)\"),!this.advanceFully(f,i));d++)Ee&&(u=this.stackID(f)+\" -> \");for(let d of l.recoverByInsert(a))Ee&&console.log(c+this.stackID(d)+\" (via recover-insert)\"),this.advanceFully(d,i);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),Ee&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),hh(l,i)):(!s||s.score<f.score)&&(s=f)}return s}stackToTree(e){return e.close(),U.build({buffer:eo.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Fr||(Fr=new WeakMap)).get(e);return t||Fr.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function hh(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}var ro=class{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}},Hr=n=>n,es=class{constructor(e){this.start=e.start,this.shift=e.shift||Hr,this.reduce=e.reduce||Hr,this.reuse=e.reuse||Hr,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},ts=class n extends Ft{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(\" \");this.minRepeatTerm=t.length;for(let l=0;l<e.repeatNodeCount;l++)t.push(\"\");let i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),s=[];for(let l=0;l<t.length;l++)s.push([]);function r(l,a,h){s[l].push([a,a.deserialize(String(h))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a==\"string\"&&(a=z[a]);for(let h=1;h<l.length;){let c=l[h++];if(c>=0)r(c,a,l[h++]);else{let f=l[h+-c];for(let u=-c;u>0;u--)r(l[h++],a,f);h++}}}this.nodeSet=new xi(t.map((l,a)=>pe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:s[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=Ki(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(ch),this.states=Ki(e.states,Uint32Array),this.data=Ki(e.stateData),this.goto=Ki(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l==\"number\"?new At(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let s=new so(this,e,t,i);for(let r of this.wrappers)s=r(s,e,t,i);return s}getGoto(e,t,i=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],l=o&1,a=s[r++];if(l&&i)return a;for(let h=r+(o>>1);r<h;r++)if(s[r]==e)return a;if(l)return-1}}hasAction(e,t){let i=this.data;for(let s=0;s<2;s++)for(let r=this.stateSlot(e,s?2:1),o;;r+=3){if((o=i[r])==65535)if(i[r+1]==1)o=i[r=St(i,r+2)];else{if(i[r+1]==2)return St(i,r+2);break}if(o==t||o==0)return St(i,r+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),s=i?t(i):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=St(this.data,r+2);else break;s=t(St(this.data,r+1))}return s}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=St(this.data,i+2);else break;if((this.data[i+2]&1)==0){let s=this.data[i+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[i],s)}}return t}configure(e){let t=Object.assign(Object.create(n.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let s=e.tokenizers.find(r=>r.from==i);return s?s.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,s)=>{let r=e.specializers.find(l=>l.from==i.external);if(!r)return i;let o=Object.assign(Object.assign({},i),{external:r.to});return t.specializers[s]=ch(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let r of e.split(\" \")){let o=t.indexOf(r);o>=0&&(i[o]=!0)}let s=null;for(let r=0;r<t.length;r++)if(!i[r])for(let o=this.dialects[t[r]],l;(l=this.data[o++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[l]=1;return new ro(e,i,s)}static deserialize(e){return new n(e)}};function St(n,e){return n[e]|n[e+1]<<16}function mp(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function ch(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}var gp=0,nt=class n{constructor(e,t,i,s){this.name=e,this.set=t,this.base=i,this.modified=s,this.id=gp++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e==\"string\"?e:\"?\";if(e instanceof n&&(t=e),t?.base)throw new Error(\"Can not derive from a modified tag\");let s=new n(i,[],null,[]);if(s.set.push(s),t)for(let r of t.set)s.set.push(r);return s}static defineModifier(e){let t=new rs(e);return i=>i.modified.indexOf(t)>-1?i:rs.get(i.base||i,i.modified.concat(t).sort((s,r)=>s.id-r.id))}},yp=0,rs=class n{constructor(e){this.name=e,this.instances=[],this.id=yp++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&xp(t,l.modified));if(i)return i;let s=[],r=new nt(e.name,s,e,t);for(let l of t)l.instances.push(r);let o=bp(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(n.get(l,a));return r}};function xp(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function bp(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,s=e.length;i<s;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function os(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(\" \"))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l==\"...\"&&f>0&&f+3==s.length){o=1;break}let u=/^\"(?:[^\"\\\\]|\\\\.)*?\"|[^\\/!]+/.exec(l);if(!u)throw new RangeError(\"Invalid path: \"+s);if(r.push(u[0]==\"*\"?\"\":u[0][0]=='\"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d==\"!\"){o=0;break}if(d!=\"/\")throw new RangeError(\"Invalid path: \"+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError(\"Invalid path: \"+s);let c=new Kt(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return ph.add(e)}var ph=new z({combine(n,e){let t,i,s;for(;n||e;){if(!n||e&&n.depth>=e.depth?(s=e,e=e.next):(s=n,n=n.next),t&&t.mode==s.mode&&!s.context&&!t.context)continue;let r=new Kt(s.tags,s.mode,s.context);t?t.next=r:i=r,t=r}return i}}),Kt=class{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Kt.empty=new Kt([],2,null);function ho(n,e){let t=Object.create(null);for(let r of n)if(!Array.isArray(r.tag))t[r.tag.id]=r.class;else for(let o of r.tag)t[o.id]=r.class;let{scope:i,all:s=null}=e||{};return{style:r=>{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+\" \"+h:h;break}}return o},scope:i}}function Sp(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+\" \"+s:s)}return t}function Oh(n,e,t,i=0,s=n.length){let r=new lo(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,\"\",r.highlighters),r.flush(s)}var lo=class{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=\"\"}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=wp(e)||Kt.empty,f=Sp(r,c.tags);if(f&&(h&&(h+=\" \"),h+=f,c.mode==1&&(s+=(s?\" \":\"\")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(z.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),O=e.firstChild();for(let m=0,g=l;;m++){let S=m<u.overlay.length?u.overlay[m]:null,b=S?S.from+l:a,A=Math.max(t,g),w=Math.min(i,b);if(A<w&&O)for(;e.from<w&&(this.highlightRange(e,A,w,s,r),this.startSpan(Math.min(w,e.to),h),!(e.to>=b||!e.nextSibling())););if(!S||b>i)break;g=S.to+l,g>t&&(this.highlightRange(d.cursor(),Math.max(t,S.from+l),Math.min(i,g),\"\",p),this.startSpan(Math.min(i,g),h))}O&&e.parent()}else if(e.firstChild()){u&&(s=\"\");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}};function wp(n){let e=n.type.prop(ph);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}var $=nt.define,is=$(),Rt=$(),uh=$(Rt),dh=$(Rt),Xt=$(),ns=$(Xt),oo=$(Xt),gt=$(),Ht=$(gt),Ot=$(),mt=$(),ao=$(),Ji=$(ao),ss=$(),y={comment:is,lineComment:$(is),blockComment:$(is),docComment:$(is),name:Rt,variableName:$(Rt),typeName:uh,tagName:$(uh),propertyName:dh,attributeName:$(dh),className:$(Rt),labelName:$(Rt),namespace:$(Rt),macroName:$(Rt),literal:Xt,string:ns,docString:$(ns),character:$(ns),attributeValue:$(ns),number:oo,integer:$(oo),float:$(oo),bool:$(Xt),regexp:$(Xt),escape:$(Xt),color:$(Xt),url:$(Xt),keyword:Ot,self:$(Ot),null:$(Ot),atom:$(Ot),unit:$(Ot),modifier:$(Ot),operatorKeyword:$(Ot),controlKeyword:$(Ot),definitionKeyword:$(Ot),moduleKeyword:$(Ot),operator:mt,derefOperator:$(mt),arithmeticOperator:$(mt),logicOperator:$(mt),bitwiseOperator:$(mt),compareOperator:$(mt),updateOperator:$(mt),definitionOperator:$(mt),typeOperator:$(mt),controlOperator:$(mt),punctuation:ao,separator:$(ao),bracket:Ji,angleBracket:$(Ji),squareBracket:$(Ji),paren:$(Ji),brace:$(Ji),content:gt,heading:Ht,heading1:$(Ht),heading2:$(Ht),heading3:$(Ht),heading4:$(Ht),heading5:$(Ht),heading6:$(Ht),contentSeparator:$(gt),list:$(gt),quote:$(gt),emphasis:$(gt),strong:$(gt),link:$(gt),monospace:$(gt),strikethrough:$(gt),inserted:$(),deleted:$(),changed:$(),invalid:$(),meta:ss,documentMeta:$(ss),annotation:$(ss),processingInstruction:$(ss),definition:nt.defineModifier(\"definition\"),constant:nt.defineModifier(\"constant\"),function:nt.defineModifier(\"function\"),standard:nt.defineModifier(\"standard\"),local:nt.defineModifier(\"local\"),special:nt.defineModifier(\"special\")};for(let n in y){let e=y[n];e instanceof nt&&(e.name=n)}var hx=ho([{tag:y.link,class:\"tok-link\"},{tag:y.heading,class:\"tok-heading\"},{tag:y.emphasis,class:\"tok-emphasis\"},{tag:y.strong,class:\"tok-strong\"},{tag:y.keyword,class:\"tok-keyword\"},{tag:y.atom,class:\"tok-atom\"},{tag:y.bool,class:\"tok-bool\"},{tag:y.url,class:\"tok-url\"},{tag:y.labelName,class:\"tok-labelName\"},{tag:y.inserted,class:\"tok-inserted\"},{tag:y.deleted,class:\"tok-deleted\"},{tag:y.literal,class:\"tok-literal\"},{tag:y.string,class:\"tok-string\"},{tag:y.number,class:\"tok-number\"},{tag:[y.regexp,y.escape,y.special(y.string)],class:\"tok-string2\"},{tag:y.variableName,class:\"tok-variableName\"},{tag:y.local(y.variableName),class:\"tok-variableName tok-local\"},{tag:y.definition(y.variableName),class:\"tok-variableName tok-definition\"},{tag:y.special(y.variableName),class:\"tok-variableName2\"},{tag:y.definition(y.propertyName),class:\"tok-propertyName tok-definition\"},{tag:y.typeName,class:\"tok-typeName\"},{tag:y.namespace,class:\"tok-namespace\"},{tag:y.className,class:\"tok-className\"},{tag:y.macroName,class:\"tok-macroName\"},{tag:y.propertyName,class:\"tok-propertyName\"},{tag:y.operator,class:\"tok-operator\"},{tag:y.comment,class:\"tok-comment\"},{tag:y.meta,class:\"tok-meta\"},{tag:y.invalid,class:\"tok-invalid\"},{tag:y.punctuation,class:\"tok-punctuation\"}]);var kp=316,Qp=317,mh=1,vp=2,$p=3,Pp=4,Tp=318,Cp=320,Zp=321,Ap=5,Mp=6,Rp=0,fo=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],gh=125,Xp=59,uo=47,Lp=42,Ep=43,Dp=45,zp=60,_p=44,Wp=63,Bp=46,Yp=91,Ip=new es({start:!1,shift(n,e){return e==Ap||e==Mp||e==Cp?n:e==Zp},strict:!1}),qp=new Mt((n,e)=>{let{next:t}=n;(t==gh||t==-1||e.context)&&n.acceptToken(Tp)},{contextual:!0,fallback:!0}),Vp=new Mt((n,e)=>{let{next:t}=n,i;fo.indexOf(t)>-1||t==uo&&((i=n.peek(1))==uo||i==Lp)||t!=gh&&t!=Xp&&t!=-1&&!e.context&&n.acceptToken(kp)},{contextual:!0}),jp=new Mt((n,e)=>{n.next==Yp&&!e.context&&n.acceptToken(Qp)},{contextual:!0}),Np=new Mt((n,e)=>{let{next:t}=n;if(t==Ep||t==Dp){if(n.advance(),t==n.next){n.advance();let i=!e.context&&e.canShift(mh);n.acceptToken(i?mh:vp)}}else t==Wp&&n.peek(1)==Bp&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken($p))},{contextual:!0});function co(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}var Gp=new Mt((n,e)=>{if(n.next!=zp||!e.dialectEnabled(Rp)||(n.advance(),n.next==uo))return;let t=0;for(;fo.indexOf(n.next)>-1;)n.advance(),t++;if(co(n.next,!0)){for(n.advance(),t++;co(n.next,!1);)n.advance(),t++;for(;fo.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==_p)return;for(let i=0;;i++){if(i==7){if(!co(n.next,!0))return;break}if(n.next!=\"extends\".charCodeAt(i))break;n.advance(),t++}}n.acceptToken(Pp,-t)}),Up=os({\"get set async static\":y.modifier,\"for while do if else switch try catch finally return throw break continue default case defer\":y.controlKeyword,\"in of await yield void typeof delete instanceof as satisfies\":y.operatorKeyword,\"let var const using function class extends\":y.definitionKeyword,\"import export from\":y.moduleKeyword,\"with debugger new\":y.keyword,TemplateString:y.special(y.string),super:y.atom,BooleanLiteral:y.bool,this:y.self,null:y.null,Star:y.modifier,VariableName:y.variableName,\"CallExpression/VariableName TaggedTemplateExpression/VariableName\":y.function(y.variableName),VariableDefinition:y.definition(y.variableName),Label:y.labelName,PropertyName:y.propertyName,PrivatePropertyName:y.special(y.propertyName),\"CallExpression/MemberExpression/PropertyName\":y.function(y.propertyName),\"FunctionDeclaration/VariableDefinition\":y.function(y.definition(y.variableName)),\"ClassDeclaration/VariableDefinition\":y.definition(y.className),\"NewExpression/VariableName\":y.className,PropertyDefinition:y.definition(y.propertyName),PrivatePropertyDefinition:y.definition(y.special(y.propertyName)),UpdateOp:y.updateOperator,\"LineComment Hashbang\":y.lineComment,BlockComment:y.blockComment,Number:y.number,String:y.string,Escape:y.escape,ArithOp:y.arithmeticOperator,LogicOp:y.logicOperator,BitOp:y.bitwiseOperator,CompareOp:y.compareOperator,RegExp:y.regexp,Equals:y.definitionOperator,Arrow:y.function(y.punctuation),\": Spread\":y.punctuation,\"( )\":y.paren,\"[ ]\":y.squareBracket,\"{ }\":y.brace,\"InterpolationStart InterpolationEnd\":y.special(y.brace),\".\":y.derefOperator,\", ;\":y.separator,\"@\":y.meta,TypeName:y.typeName,TypeDefinition:y.definition(y.typeName),\"type enum interface implements namespace module declare\":y.definitionKeyword,\"abstract global Privacy readonly override\":y.modifier,\"is keyof unique infer asserts\":y.operatorKeyword,JSXAttributeValue:y.attributeValue,JSXText:y.content,\"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag\":y.angleBracket,\"JSXIdentifier JSXNameSpacedName\":y.tagName,\"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName\":y.attributeName,\"JSXBuiltin/JSXIdentifier\":y.standard(y.tagName)}),Fp={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Hp={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Kp={__proto__:null,\"<\":193},yh=ts.deserialize({version:14,states:\"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]\",stateData:\"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~\",goto:\"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_\",nodeNames:\"\\u26A0 ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem\",maxTerm:380,context:Ip,nodeProps:[[\"isolate\",-8,5,6,14,37,39,51,53,55,\"\"],[\"group\",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,\"Statement\",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,\"Expression\",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,\"Type\",-3,88,103,109,\"ClassItem\"],[\"openedBy\",23,\"<\",38,\"InterpolationStart\",56,\"[\",60,\"{\",73,\"(\",160,\"JSXStartCloseTag\"],[\"closedBy\",-2,24,168,\">\",40,\"InterpolationEnd\",50,\"]\",61,\"}\",74,\")\",165,\"JSXEndTag\"]],propSources:[Up],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:\"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!k!Lf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!S0,v$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr\",tokenizers:[Vp,jp,Np,Gp,2,3,4,5,6,7,8,9,10,11,12,13,14,qp,new Si(\"$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~\",141,340),new Si(\"j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~\",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:n=>Fp[n]||-1},{term:343,get:n=>Hp[n]||-1},{term:95,get:n=>Kp[n]||-1}],tokenPrec:15201});var Oo=[],wh=[];(()=>{let n=\"lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o\".split(\",\").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?wh:Oo).push(t=t+n[e])})();function Jp(n){if(n<768)return!1;for(let e=0,t=Oo.length;;){let i=e+t>>1;if(n<Oo[i])t=i;else if(n>=wh[i])e=i+1;else return!0;if(e==t)return!1}}function xh(n){return n>=127462&&n<=127487}var bh=8205;function kh(n,e,t=!0,i=!0){return(t?Qh:eO)(n,e,i)}function Qh(n,e,t){if(e==n.length)return e;e&&vh(n.charCodeAt(e))&&$h(n.charCodeAt(e-1))&&e--;let i=po(n,e);for(e+=Sh(i);e<n.length;){let s=po(n,e);if(i==bh||s==bh||t&&Jp(s))e+=Sh(s),i=s;else if(xh(s)){let r=0,o=e-2;for(;o>=0&&xh(po(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function eO(n,e,t){for(;e>0;){let i=Qh(n,e-2,t);if(i<e)return i;e--}return 0}function po(n,e){let t=n.charCodeAt(e);if(!$h(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return vh(i)?(t-55296<<10)+(i-56320)+65536:t}function vh(n){return n>=56320&&n<57344}function $h(n){return n>=55296&&n<56320}function Sh(n){return n<65536?1:2}var B=class n{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=$i(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),ki.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=$i(this,e,t);let i=[];return this.decompose(e,t,i,0),ki.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ti(this),r=new ti(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ti(this,e)}iterRange(e,t=this.length){return new fs(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new us(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError(\"A document must have at least one line\");return e.length==1&&!e[0]?n.empty:e.length<=32?new De(e):ki.from(De.split(e,[]))}},De=class n extends B{constructor(e,t=tO(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new go(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new n(Ph(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=cs(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new n(l,o.length+r.length));else{let a=l.length>>1;i.push(new n(l.slice(0,a)),new n(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof n))return super.replace(e,t,i);[e,t]=$i(this,e,t);let s=cs(this.text,cs(i.text,Ph(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new n(s,r):ki.from(n.split(s,[]),r)}sliceString(e,t=this.length,i=`\n`){[e,t]=$i(this,e,t);let s=\"\";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new n(i,s)),i=[],s=-1);return s>-1&&t.push(new n(i,s)),t}},ki=class n extends B{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=$i(this,e,t),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[s]=a,new n(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`\n`){[e,t]=$i(this,e,t);let s=\"\";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof n))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new De(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof n)for(let O of d.children)f(O);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof De&&a&&(p=c[c.length-1])instanceof De&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new De(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:n.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new n(l,t)}};B.empty=new De([\"\"],0);function tO(n){let e=-1;for(let t of n)e+=t.length+1;return e}function cs(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function Ph(n,e,t){return cs(n,[\"\"],e,t)}var ti=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=\"\",this.nodes=[e],this.offsets=[t>0?1:(e instanceof De?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof De?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value=\"\",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`\n`,this;e--}else if(s instanceof De){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof De?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},fs=class{constructor(e,t,i){this.value=\"\",this.done=!1,this.cursor=new ti(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=\"\",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=\"\"}},us=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=\"\",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value=\"\",this.afterBreak=!1):t?(this.done=!0,this.value=\"\"):i?this.afterBreak?this.value=\"\":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<\"u\"&&(B.prototype[Symbol.iterator]=function(){return this.iter()},ti.prototype[Symbol.iterator]=fs.prototype[Symbol.iterator]=us.prototype[Symbol.iterator]=function(){return this});var go=class{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}};function $i(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function re(n,e,t=!0,i=!0){return kh(n,e,t,i)}function iO(n){return n>=56320&&n<57344}function nO(n){return n>=55296&&n<56320}function Oe(n,e){let t=n.charCodeAt(e);if(!nO(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return iO(i)?(t-55296<<10)+(i-56320)+65536:t}function on(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function _e(n){return n<65536?1:2}var yo=/\\r\\n?|\\n/,ce=(function(n){return n[n.Simple=0]=\"Simple\",n[n.TrackDel=1]=\"TrackDel\",n[n.TrackBefore=2]=\"TrackBefore\",n[n.TrackAfter=3]=\"TrackAfter\",n})(ce||(ce={})),wt=class n{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){xo(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new n(e)}composeDesc(e){return this.empty?e:e.empty?this:Mh(this,e)}mapDesc(e,t=!1){return e.empty?this:bo(this,e,t)}mapPos(e,t=-1,i=ce.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(i!=ce.Simple&&h>=e&&(i==ce.TrackDel&&s<e&&h>e||i==ce.TrackBefore&&s<e||i==ce.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?\"cover\":!0;s=l}return!1}toString(){let e=\"\";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?\" \":\"\")+i+(s>=0?\":\"+s:\"\")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!=\"number\"))throw new RangeError(\"Invalid JSON representation of ChangeDesc\");return new n(e)}static create(e){return new n(e)}},Qe=class n extends wt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError(\"Applying change set to a document with the wrong length\");return xo(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return bo(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(B.empty);i.push(o?e.slice(r,r+o):B.empty)}r+=o}return new n(t,i)}compose(e){return this.empty?e:e.empty?this:Mh(this,e,!0)}map(e,t=!1){return e.empty?this:bo(this,e,t,!0)}iterChanges(e,t=!1){xo(this,e,t)}get desc(){return wt.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new ii(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let c=Math.min(r.len,a-l);xe(s,c,-1);let f=r.ins==-1?-1:r.off==0?r.ins:0;xe(t,c,f),f>0&&Lt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l<h;){if(r.done)break e;let c=Math.min(r.len,h-l);xe(t,c,-1),xe(s,c,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(c),l+=c}}return{changes:new n(t,i),filtered:wt.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],s=this.sections[t+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;o<t&&xe(s,t-o,-1);let f=new n(s,r);l=l?l.compose(f.map(l)):f,s=[],r=[],o=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof n){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:u=f,insert:d}=c;if(f>u||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d==\"string\"?B.of(d.split(i||yo)):d:B.empty,O=p.length;if(f==u&&O==0)return;f<o&&a(),f>o&&xe(s,f-o,-1),xe(s,u-f,O),Lt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new n(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError(\"Invalid JSON representation of ChangeSet\");let t=[],i=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r==\"number\")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!=\"number\"||r.some((o,l)=>l&&typeof o!=\"string\"))throw new RangeError(\"Invalid JSON representation of ChangeSet\");if(r.length==1)t.push(r[0],0);else{for(;i.length<s;)i.push(B.empty);i[s]=B.of(r.slice(1)),t.push(r[0],i[s].length)}}}return new n(t,i)}static createSet(e,t){return new n(e,t)}};function xe(n,e,t,i=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:s>=0&&e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function Lt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(B.empty);n.push(t)}}function xo(n,e,t){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let h=s,c=r,f=B.empty;for(;h+=l,c+=a,a&&i&&(f=f.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function bo(n,e,t,i=!1){let s=[],r=i?[]:null,o=new ii(n),l=new ii(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error(\"Mismatched change set lengths\");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);xe(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(xe(s,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(xe(s,0,o.ins),r&&Lt(r,s,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;xe(s,h,a<o.i?o.ins:0),r&&a<o.i&&Lt(r,s,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return r?Qe.createSet(s,r):wt.create(s);throw new Error(\"Mismatched change set lengths\")}}}function Mh(n,e,t=!1){let i=[],s=t?[]:null,r=new ii(n),o=new ii(e);for(let l=!1;;){if(r.done&&o.done)return s?Qe.createSet(i,s):wt.create(i);if(r.ins==0)xe(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)xe(i,0,o.ins,l),s&&Lt(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error(\"Mismatched change set lengths\");{let a=Math.min(r.len2,o.len),h=i.length;if(r.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;xe(i,a,c,l),s&&c&&Lt(s,i,o.text)}else o.ins==-1?(xe(i,r.off?0:r.len,a,l),s&&Lt(s,i,r.textBit(a))):(xe(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&Lt(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}var ii=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?B.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?B.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},wi=class n{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new n(i,s,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return x.range(e,t,void 0,void 0,i);let s=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return x.range(this.anchor,s,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=\"number\"||typeof e.head!=\"number\")throw new RangeError(\"Invalid JSON representation for SelectionRange\");return x.range(e.anchor,e.head)}static create(e,t,i){return new n(e,t,i)}},x=class n{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:n.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new n([this.main],0)}addRange(e,t=!0){return n.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,n.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!=\"number\"||e.main>=e.ranges.length)throw new RangeError(\"Invalid JSON representation for EditorSelection\");return new n(e.ranges.map(t=>wi.fromJSON(t)),e.main)}static single(e,t=e){return new n([n.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError(\"A selection needs at least one range\");for(let i=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=i:r.from<i)return n.normalized(e.slice(),t);i=r.to}return new n(e,t)}static cursor(e,t=0,i,s){return wi.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(s??16777215)<<6)}static range(e,t,i,s,r){let o=(i??16777215)<<6|(s==null?7:Math.min(6,s));return!r&&e!=t&&(r=t<e?1:-1),t<e?wi.create(t,e,48|o):wi.create(e,t,(r?r<0?8:16:0)|o)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=t&&t--,e.splice(--s,2,r.anchor>r.head?n.range(a,l):n.range(l,a))}}return new n(e,t)}};function Rh(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError(\"Selection points outside of document\")}var Zo=0,P=class n{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Zo++,this.default=e([]),this.extensions=typeof r==\"function\"?r(this):r}get reader(){return this}static define(e={}){return new n(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Ao),!!e.static,e.enables)}of(e){return new Qi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error(\"Can't compute a static facet\");return new Qi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error(\"Can't compute a static facet\");return new Qi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}};function Ao(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}var Qi=class{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Zo++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f==\"doc\"?a=!0:f==\"selection\"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||So(f,c)){let d=i(f);if(l?!Th(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let O=ms(u,p);if(this.dependencies.every(m=>m instanceof P?u.facet(m)===f.facet(m):m instanceof ne?u.field(m,!1)==f.field(m,!1):!0)||(l?Th(d=i(f),O,s):s(d=i(f),O)))return f.values[o]=O,0}else d=i(f);return f.values[o]=d,1}}}};function Th(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function So(n,e){let t=!1;for(let i of e)tn(n,i)&1&&(t=!0);return t}function sO(n,e,t){let i=t.map(a=>n[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let f=ms(a,i[c]);if(s[c]==2)for(let u of f)h.push(u);else h.push(f)}return e.combine(h)}return{create(a){for(let h of i)tn(a,h);return a.values[o]=l(a),1},update(a,h){if(!So(a,r))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=So(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&Ao(t,f))return a.values[o]=u,0;let d=l(a);return e.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}var ls=P.define({static:!0}),ne=class n{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new n(Zo++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ls).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>{let r=i.facet(ls),o=s.facet(ls),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,ls.of({field:this,create:e})]}get extension(){return this}},Jt={lowest:4,low:3,default:2,high:1,highest:0};function en(n){return e=>new ds(e,n)}var Ue={highest:en(Jt.highest),high:en(Jt.high),default:en(Jt.default),low:en(Jt.low),lowest:en(Jt.lowest)},ds=class{constructor(e,t){this.inner=e,this.prec=t}},ps=class n{of(e){return new nn(this,e)}reconfigure(e){return n.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},nn=class{constructor(e,t){this.compartment=e,this.inner=t}},Os=class n{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of rO(e,t,o))u instanceof ne?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i?.config.facets;for(let u in r){let d=r[u],p=d[0].facet,O=c&&c[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,Ao(O,d))a.push(i.facet(p));else{let m=p.combine(d.map(g=>g.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=h.length<<1,h.push(g=>m.dynamicSlot(g)));l[p.id]=h.length<<1,h.push(m=>sO(m,p,d))}}let f=h.map(u=>u(l));return new n(e,o,f,l,a,r)}};function rO(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof nn&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof nn){if(t.has(o.compartment))throw new RangeError(\"Duplicate use of compartment in extensions\");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof ds)r(o.inner,o.prec);else if(o instanceof ne)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Qi)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Jt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,Jt.default),i.reduce((o,l)=>o.concat(l))}function tn(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error(\"Cyclic dependency between fields and/or facets\");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function ms(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}var Xh=P.define(),wo=P.define({combine:n=>n.some(e=>e),static:!0}),Lh=P.define({combine:n=>n.length?n[0]:void 0,static:!0}),Eh=P.define(),Dh=P.define(),zh=P.define(),_h=P.define({combine:n=>n.length?n[0]:!1}),Ze=class{constructor(e,t){this.type=e,this.value=t}static define(){return new ko}},ko=class{of(e){return new Ze(this,e)}},Qo=class{constructor(e){this.map=e}of(e){return new E(this,e)}},E=class n{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new n(this.type,t)}is(e){return this.type==e}static define(e={}){return new Qo(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}};E.reconfigure=E.define();E.appendConfig=E.define();var ae=class n{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Rh(i,t.newLength),r.some(l=>l.type==n.time)||(this.annotations=r.concat(n.time.of(Date.now())))}static create(e,t,i,s,r,o){return new n(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(n.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]==\".\"))}};ae.time=Ze.define();ae.userEvent=Ze.define();ae.addToHistory=Ze.define();ae.remote=Ze.define();function oO(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==e.length||e[s]>=n[i]))r=n[i++],o=n[i++];else if(s<e.length)r=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Wh(n,e,t){var i;let s,r,o;return t?(s=e.changes,r=Qe.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:E.mapEffects(n.effects,s).concat(E.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function vo(n,e,t){let i=e.selection,s=vi(e.annotations);return e.userEvent&&(s=s.concat(ae.userEvent.of(e.userEvent))),{changes:e.changes instanceof Qe?e.changes:Qe.of(e.changes||[],t,n.facet(Lh)),selection:i&&(i instanceof x?i:x.single(i.anchor,i.head)),effects:vi(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function Bh(n,e,t){let i=vo(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=Wh(i,vo(n,e[r],o?i.changes.newLength:n.doc.length),o)}let s=ae.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return aO(t?lO(s):s)}function lO(n){let e=n.startState,t=!0;for(let s of e.facet(Eh)){let r=s(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:oO(t,r))}if(t!==!0){let s,r;if(t===!1)r=n.changes.invertedDesc,s=Qe.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=ae.create(e,s,n.selection&&n.selection.map(r),E.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=e.facet(Dh);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof ae?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ae?n=r[0]:n=Bh(e,vi(r),!1)}return n}function aO(n){let e=n.startState,t=e.facet(zh),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Wh(i,vo(e,r,n.changes.newLength),!0))}return i==n?n:ae.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}var hO=[];function vi(n){return n==null?hO:Array.isArray(n)?n:[n]}var F=(function(n){return n[n.Word=0]=\"Word\",n[n.Space=1]=\"Space\",n[n.Other=2]=\"Other\",n})(F||(F={})),cO=/[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/,$o;try{$o=new RegExp(\"[\\\\p{Alphabetic}\\\\p{Number}_]\",\"u\")}catch{}function fO(n){if($o)return $o.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\\w/.test(t)||t>\"\\x80\"&&(t.toUpperCase()!=t.toLowerCase()||cO.test(t)))return!0}return!1}function uO(n){return e=>{if(!/\\S/.test(e))return F.Space;if(fO(e))return F.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return F.Word;return F.Other}}var H=class n{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)tn(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError(\"Field is not present in this state\");return}return tn(this,i),ms(this,i)}update(...e){return Bh(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let l of e.effects)l.is(ps.reconfigure)?(t&&(s=new Map,t.compartments.forEach((a,h)=>s.set(h,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(E.reconfigure)?(t=null,i=l.value):l.is(E.appendConfig)&&(t=null,i=vi(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=Os.resolve(i,s,this),r=new n(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(wo)?e.newSelection:e.newSelection.asSingle();new n(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e==\"string\"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:x.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=vi(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(s);for(let u=0;u<l;u++)r[u]=r[u].map(c);let f=s.mapDesc(h,!0);r.push(a.range.map(f)),s=s.compose(c),o=E.mapEffects(o,c).concat(E.mapEffects(vi(a.effects),f))}return{changes:s,selection:x.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Qe?e:Qe.of(e,this.doc.length,this.facet(n.lineSeparator))}toText(e){return B.of(e.split(this.facet(n.lineSeparator)||yo))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(tn(this,t),ms(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof ne&&this.config.address[s.id]!=null&&(t[i]=s.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!=\"string\")throw new RangeError(\"Invalid JSON representation for EditorState\");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return n.create({doc:e.doc,selection:x.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Os.resolve(e.extensions||[],new Map),i=e.doc instanceof B?e.doc:B.of((e.doc||\"\").split(t.staticFacet(n.lineSeparator)||yo)),s=e.selection?e.selection instanceof x?e.selection:x.single(e.selection.anchor,e.selection.head):x.single(0);return Rh(s,i.length),t.staticFacet(wo)||(s=s.asSingle()),new n(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(n.tabSize)}get lineBreak(){return this.facet(n.lineSeparator)||`\n`}get readOnly(){return this.facet(_h)}phrase(e,...t){for(let i of this.facet(n.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\\$(\\$|\\d*)/g,(i,s)=>{if(s==\"$\")return\"$\";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(Xh))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){let t=this.languageDataAt(\"wordChars\",e);return uO(t.length?t[0]:\"\")}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=re(t,o,!1);if(r(t.slice(a,o))!=F.Word)break;o=a}for(;l<s;){let a=re(t,l);if(r(t.slice(l,a))!=F.Word)break;l=a}return o==l?null:x.range(o+i,l+i)}};H.allowMultipleSelections=wo;H.tabSize=P.define({combine:n=>n.length?n[0]:4});H.lineSeparator=Lh;H.readOnly=_h;H.phrases=P.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});H.languageData=Xh;H.changeFilter=Eh;H.transactionFilter=Dh;H.transactionExtender=zh;ps.reconfigure=E.define();function be(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error(\"Config merge conflict for field \"+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}var Ge=class{eq(e){return this==e}range(e,t=e){return sn.create(e,t,this)}};Ge.prototype.startSide=Ge.prototype.endSide=0;Ge.prototype.point=!1;Ge.prototype.mapMode=ce.TrackDel;function Mo(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}var sn=class n{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new n(e,t,i)}};function Po(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}var To=class n{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let h=this.value[a],c=this.from[a]+e,f=this.to[a]+e,u,d;if(c==f){let p=t.mapPos(c,h.startSide,h.mapMode);if(p==null||(u=d=p,h.startSide!=h.endSide&&(d=t.mapPos(c,h.endSide),d<u)))continue}else if(u=t.mapPos(c,h.startSide),d=t.mapPos(f,h.endSide),u>d||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new n(s,r,i,l):null,pos:o}}},I=class n{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new n(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Po)),this.isEmpty)return t.length?n.of(t):this;let l=new gs(this,null,-1).goto(0),a=0,h=[],c=new ze;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||h.push(sn.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!h.length?n.empty:this.nextLayer.update({add:h,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],h=e.touchesRange(l,l+a.length);if(h===!1)s=Math.max(s,a.maxPoint),t.push(a),i.push(e.mapPos(l));else if(h===!0){let{mapped:c,pos:f}=a.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new n(i,t,r||n.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return rn.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return rn.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Ch(o,l,i),h=new ei(o,a,r),c=new ei(l,a,r);i.iterGaps((f,u,d)=>Zh(h,f,c,u,d,s)),i.empty&&i.length==0&&Zh(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=999999999);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Ch(r,o),a=new ei(r,l,0).goto(i),h=new ei(o,l,0).goto(i);for(;;){if(a.to!=h.to||!Co(a.active,h.active)||a.point&&(!h.point||!Mo(a.point,h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new ei(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFrom<t?c.length+1:o.point.startSide<0?c.length:Math.min(c.length,a);s.point(l,h,o.point,c,f,o.pointRank),a=Math.min(o.openEnd(h),c.length)}else h>l&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new ze;for(let s of e instanceof sn?[e]:t?dO(e):e)i.add(s.from,s.to,s.value);return i.finish()}static join(e){if(!e.length)return n.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let s=e[i];s!=n.empty;s=s.nextLayer)t=new n(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}};I.empty=new I([],[],null,-1);function dO(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(Po(e,i)>0)return n.slice().sort(Po);e=i}return n}I.empty.nextLayer=I.empty;var ze=class n{finishChunk(e){this.chunks.push(new To(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new n)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error(\"Ranges must be added sorted by `from` position and `startSide`\");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(I.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=I.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function Ch(n,e,t){let i=new Map;for(let r of n)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&i.set(r.chunk[o],r.chunkPos[o]);let s=new Set;for(let r of e)for(let o=0;o<r.chunk.length;o++){let l=i.get(r.chunk[o]);l!=null&&(t?t.mapPos(l):l)==r.chunkPos[o]&&!t?.touchesRange(l,l+r.chunk[o].length)&&s.add(r.chunk[o])}return s}var gs=class{constructor(e,t,i,s=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},rn=class n{constructor(e){this.heap=e}static from(e,t=null,i=-1){let s=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&s.push(new gs(o,t,i,r));return s.length==1?s[0]:new n(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)mo(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)mo(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),mo(this.heap,0)}}};function mo(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1<n.length&&s.compare(n[i+1])>=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}var ei=class{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=rn.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){as(this.active,e),as(this.activeTo,e),as(this.activeRank,e),this.minActive=Ah(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||s-this.activeTo[t])>0;)t++;hs(this.active,t,i),hs(this.activeTo,t,s),hs(this.activeRank,t,r),e&&hs(e,t,this.cursor.from),this.minActive=Ah(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&as(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let s=i.length-1;s>=0&&i[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}};function Zh(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e,h=!!r.boundChange;for(let c=!1;;){let f=n.to+a-t.to,u=f||n.endSide-t.endSide,d=u<0?n.to+a:t.to,p=Math.min(d,o);if(n.point||t.point?(n.point&&t.point&&Mo(n.point,t.point)&&Co(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,p,n.point,t.point),c=!1):(c&&r.boundChange(l),p>l&&!Co(n.active,t.active)&&r.compareRange(l,p,n.active,t.active),h&&p<o&&(f||n.openEnd(d)!=t.openEnd(d))&&(c=!0)),d>o)break;l=d,u<=0&&n.next(),u>=0&&t.next()}}function Co(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!Mo(n[t],e[t]))return!1;return!0}function as(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function hs(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function Ah(n,e){let t=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||n[s].endSide-n[t].endSide)<0&&(t=s,i=e[s]);return t}function kt(n,e,t=n.length){let i=0;for(let s=0;s<t&&s<n.length;)n.charCodeAt(s)==9?(i+=e-i%e,s++):(i++,s=re(n,s));return i}function ys(n,e,t,i){for(let s=0,r=0;;){if(r>=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=re(n,s)}return i===!0?-1:n.length}var Yh=typeof Symbol>\"u\"?\"__\\u037C\":Symbol.for(\"\\u037C\"),Ro=typeof Symbol>\"u\"?\"__styleSet\"+Math.floor(Math.random()*1e8):Symbol(\"styleSet\"),Ih=typeof globalThis<\"u\"?globalThis:typeof window<\"u\"?window:{},Fe=class{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\\s*/)}function r(o,l,a,h){let c=[],f=/^@(\\w+)\\b/.exec(o[0]),u=f&&f[1]==\"keyframes\";if(f&&l==null)return a.push(o[0]+\";\");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\\s*/).map(O=>o.map(m=>O.replace(/&/,m))).reduce((O,m)=>O.concat(m)),p,a);else if(p&&typeof p==\"object\"){if(!f)throw new RangeError(\"The value of a property (\"+d+\") should be a primitive value.\");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,\"\").replace(/[A-Z]/g,O=>\"-\"+O.toLowerCase())+\": \"+p+\";\")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(\", \")+\" {\"+c.join(\" \")+\"}\")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(`\n`)}static newName(){let e=Ih[Yh]||1;return Ih[Yh]=e+1,\"\\u037C\"+e.toString(36)}static mount(e,t,i){let s=e[Ro],r=i&&i.nonce;s?r&&s.setNonce(r):s=new Xo(e,r),s.mount(Array.isArray(t)?t:[t],e)}},qh=new Map,Xo=class{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=qh.get(i);if(r)return e[Ro]=r;this.sheet=new s.CSSStyleSheet,qh.set(i,this)}else this.styleTag=i.createElement(\"style\"),t&&this.styleTag.setAttribute(\"nonce\",t);this.modules=[],e[Ro]=this}mount(e,t){let i=this.sheet,s=0,r=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let h=0;h<l.rules.length;h++)i.insertRule(l.rules[h],s++)}else{for(;r<a;)s+=this.modules[r++].rules.length;s+=l.rules.length,r++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o=\"\";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`\n`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(\"nonce\")!=e&&this.styleTag.setAttribute(\"nonce\",e)}};var Qt={8:\"Backspace\",9:\"Tab\",10:\"Enter\",12:\"NumLock\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",44:\"PrintScreen\",45:\"Insert\",46:\"Delete\",59:\";\",61:\"=\",91:\"Meta\",92:\"Meta\",106:\"*\",107:\"+\",108:\",\",109:\"-\",110:\".\",111:\"/\",144:\"NumLock\",145:\"ScrollLock\",160:\"Shift\",161:\"Shift\",162:\"Control\",163:\"Control\",164:\"Alt\",165:\"Alt\",173:\"-\",186:\";\",187:\"=\",188:\",\",189:\"-\",190:\".\",191:\"/\",192:\"`\",219:\"[\",220:\"\\\\\",221:\"]\",222:\"'\"},Pi={48:\")\",49:\"!\",50:\"@\",51:\"#\",52:\"$\",53:\"%\",54:\"^\",55:\"&\",56:\"*\",57:\"(\",59:\":\",61:\"+\",173:\"_\",186:\":\",187:\"+\",188:\"<\",189:\"_\",190:\">\",191:\"?\",192:\"~\",219:\"{\",220:\"|\",221:\"}\",222:'\"'},pO=typeof navigator<\"u\"&&/Mac/.test(navigator.platform),OO=typeof navigator<\"u\"&&/MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);for(he=0;he<10;he++)Qt[48+he]=Qt[96+he]=String(he);var he;for(he=1;he<=24;he++)Qt[he+111]=\"F\"+he;var he;for(he=65;he<=90;he++)Qt[he]=String.fromCharCode(he+32),Pi[he]=String.fromCharCode(he);var he;for(xs in Qt)Pi.hasOwnProperty(xs)||(Pi[xs]=Qt[xs]);var xs;function Vh(n){var e=pO&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||OO&&n.shiftKey&&n.key&&n.key.length==1||n.key==\"Unidentified\",t=!e&&n.key||(n.shiftKey?Pi:Qt)[n.keyCode]||n.key||\"Unidentified\";return t==\"Esc\"&&(t=\"Escape\"),t==\"Del\"&&(t=\"Delete\"),t==\"Left\"&&(t=\"ArrowLeft\"),t==\"Up\"&&(t=\"ArrowUp\"),t==\"Right\"&&(t=\"ArrowRight\"),t==\"Down\"&&(t=\"ArrowDown\"),t}function V(){var n=arguments[0];typeof n==\"string\"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t==\"object\"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s==\"string\"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;e<arguments.length;e++)jh(n,arguments[e]);return n}function jh(n,e){if(typeof e==\"string\")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)jh(n,e[t]);else throw new RangeError(\"Unsupported child node: \"+e)}var ve=typeof navigator<\"u\"?navigator:{userAgent:\"\",vendor:\"\",platform:\"\"},qo=typeof document<\"u\"?document:{documentElement:{style:{}}},Vo=/Edge\\/(\\d+)/.exec(ve.userAgent),Ac=/MSIE \\d/.test(ve.userAgent),jo=/Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(ve.userAgent),Ks=!!(Ac||jo||Vo),Nh=!Ks&&/gecko\\/(\\d+)/i.test(ve.userAgent),Lo=!Ks&&/Chrome\\/(\\d+)/.exec(ve.userAgent),Gh=\"webkitFontSmoothing\"in qo.documentElement.style,No=!Ks&&/Apple Computer/.test(ve.vendor),Uh=No&&(/Mobile\\/\\w+/.test(ve.userAgent)||ve.maxTouchPoints>2),Z={mac:Uh||/Mac/.test(ve.platform),windows:/Win/.test(ve.platform),linux:/Linux|X11/.test(ve.platform),ie:Ks,ie_version:Ac?qo.documentMode||6:jo?+jo[1]:Vo?+Vo[1]:0,gecko:Nh,gecko_version:Nh?+(/Firefox\\/(\\d+)/.exec(ve.userAgent)||[0,0])[1]:0,chrome:!!Lo,chrome_version:Lo?+Lo[1]:0,ios:Uh,android:/Android\\b/.test(ve.userAgent),webkit:Gh,webkit_version:Gh?+(/\\bAppleWebKit\\/(\\d+)/.exec(ve.userAgent)||[0,0])[1]:0,safari:No,safari_version:No?+(/\\bVersion\\/(\\d+(\\.\\d+)?)/.exec(ve.userAgent)||[0,0])[1]:0,tabSize:qo.documentElement.style.tabSize!=null?\"tab-size\":\"-moz-tab-size\"};function _l(n,e){for(let t in n)t==\"class\"&&e.class?e.class+=\" \"+n.class:t==\"style\"&&e.style?e.style+=\";\"+n.style:e[t]=n[t];return e}var Xs=Object.create(null);function Wl(n,e,t){if(n==e)return!0;n||(n=Xs),e||(e=Xs);let i=Object.keys(n),s=Object.keys(e);if(i.length-(t&&i.indexOf(t)>-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function mO(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t==\"style\"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function Fh(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s==\"style\"?n.style.cssText=\"\":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s==\"style\"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function gO(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}var $e=class{eq(e){return!1}updateDOM(e,t,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},ge=(function(n){return n[n.Text=0]=\"Text\",n[n.WidgetBefore=1]=\"WidgetBefore\",n[n.WidgetAfter=2]=\"WidgetAfter\",n[n.WidgetRange=3]=\"WidgetRange\",n})(ge||(ge={})),R=class extends Ge{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new xn(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new oi(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Mc(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new oi(e,i,s,t,e.widget||null,!0)}static line(e){return new bn(e)}static set(e,t=!1){return I.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};R.none=I.empty;var xn=class n extends R{constructor(e){let{start:t,end:i}=Mc(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||\"span\",this.attrs=e.class&&e.attributes?_l(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Xs}eq(e){return this==e||e instanceof n&&this.tagName==e.tagName&&Wl(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError(\"Mark decorations may not be empty\");return super.range(e,t)}};xn.prototype.point=!1;var bn=class n extends R{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof n&&this.spec.class==e.spec.class&&Wl(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError(\"Line decoration ranges must be zero-length\");return super.range(e,t)}};bn.prototype.mapMode=ce.TrackBefore;bn.prototype.point=!0;var oi=class n extends R{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?ce.TrackBefore:ce.TrackAfter:ce.TrackDel}get type(){return this.startSide!=this.endSide?ge.WidgetRange:this.startSide<=0?ge.WidgetBefore:ge.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof n&&yO(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError(\"Invalid range for replacement decoration\");if(!this.isReplace&&t!=e)throw new RangeError(\"Widget decorations can only have zero-length ranges\");return super.range(e,t)}};oi.prototype.point=!0;function Mc(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function yO(n,e){return n==e||!!(n&&e&&n.compare(e))}function Ri(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}var Ls=class n extends Ge{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof n&&this.tagName==e.tagName&&Wl(this.attributes,e.attributes)}static create(e){return new n(e.tagName,e.attributes||Xs)}static set(e,t=!1){return I.of(e,t)}};Ls.prototype.startSide=Ls.prototype.endSide=-1;function Sn(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Go(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function cn(n,e){if(!e.anchorNode)return!1;try{return Go(n,e.anchorNode)}catch{return!1}}function Cs(n){return n.nodeType==3?wn(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function fn(n,e,t,i){return t?Hh(n,e,t,i,-1)||Hh(n,e,t,i,1):!1}function zt(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Es(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\\d|SECTION|PRE)$/.test(n.nodeName)}function Hh(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:Pt(n))){if(n.nodeName==\"DIV\")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=zt(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable==\"false\")return!1;e=s<0?Pt(n):0}else return!1}}function Pt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ds(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function xO(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Rc(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function bO(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,O=1;if(d)u=xO(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let S=c.getBoundingClientRect();({scaleX:p,scaleY:O}=Rc(c,S)),u={left:S.left,right:S.left+c.clientWidth*p,top:S.top,bottom:S.top+c.clientHeight*O}}let m=0,g=0;if(s==\"nearest\")e.top<u.top?(g=e.top-(u.top+o),t>0&&e.bottom>u.bottom+g&&(g=e.bottom-u.bottom+o)):e.bottom>u.bottom&&(g=e.bottom-u.bottom+o,t<0&&e.top-g<u.top&&(g=e.top-(u.top+o)));else{let S=e.bottom-e.top,b=u.bottom-u.top;g=(s==\"center\"&&S<=b?e.top+S/2-b/2:s==\"start\"||s==\"center\"&&t<0?e.top-o:e.bottom-b+o)-u.top}if(i==\"nearest\"?e.left<u.left?(m=e.left-(u.left+r),t>0&&e.right>u.right+m&&(m=e.right-u.right+r)):e.right>u.right&&(m=e.right-u.right+r,t<0&&e.left<u.left+m&&(m=e.left-(u.left+r))):m=(i==\"center\"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i==\"start\"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,m||g)if(d)h.scrollBy(m,g);else{let S=0,b=0;if(g){let A=c.scrollTop;c.scrollTop+=g/O,b=(c.scrollTop-A)*O}if(m){let A=c.scrollLeft;c.scrollLeft+=m/p,S=(c.scrollLeft-A)*p}e={left:e.left-S,top:e.top-b,right:e.right-S,bottom:e.bottom-b},S&&Math.abs(S-m)<1&&(i=\"nearest\"),b&&Math.abs(b-g)<1&&(s=\"nearest\")}if(d)break;(e.top<u.top||e.bottom>u.bottom||e.left<u.left||e.right>u.right)&&(e={left:Math.max(e.left,u.left),right:Math.min(e.right,u.right),top:Math.max(e.top,u.top),bottom:Math.min(e.bottom,u.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function Xc(n,e=!0){let t=n.ownerDocument,i=null,s=null;for(let r=n.parentNode;r&&!(r==t.body||(!e||i)&&s);)if(r.nodeType==1)!s&&r.scrollHeight>r.clientHeight&&(s=r),e&&!i&&r.scrollWidth>r.clientWidth&&(i=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:i,y:s}}var Uo=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Pt(t):0),i,Math.min(e.focusOffset,i?Pt(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}},ni=null;Z.safari&&Z.safari_version>=26&&(ni=!1);function Lc(n){if(n.setActive)return n.setActive();if(ni)return n.focus(ni);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(ni==null?{get preventScroll(){return ni={preventScroll:!0},!0}}:void 0),!ni){ni=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}var Kh;function wn(n,e,t=e){let i=Kh||(Kh=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Xi(n,e,t,i){let s={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=i);let r=new KeyboardEvent(\"keydown\",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent(\"keyup\",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function SO(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function wO(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,Pt(t));;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable==\"false\"?i--:(t=s,i=Pt(t))}else{if(t==n)return!0;i=zt(t),t=t.parentNode}}function Ec(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function Dc(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable==\"false\")return null;t=t.childNodes[i-1],i=Pt(t)}else if(t.parentNode&&!Es(t))i=zt(t),t=t.parentNode;else return null}}function zc(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable==\"false\")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!Es(t))i=zt(t)+1,t=t.parentNode;else return null}}var xt=class n{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new n(e.parentNode,zt(e),t)}static after(e,t){return new n(e.parentNode,zt(e)+1,t)}},N=(function(n){return n[n.LTR=0]=\"LTR\",n[n.RTL=1]=\"RTL\",n})(N||(N={})),li=N.LTR,Bl=N.RTL;function _c(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}var kO=_c(\"88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008\"),QO=_c(\"4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333\"),Fo=Object.create(null),yt=[];for(let n of[\"()\",\"[]\",\"{}\"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Fo[e]=t,Fo[t]=-e}function Wc(n){return n<=247?kO[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?QO[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}var vO=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\ufb50-\\ufdff]/,Je=class{get dir(){return this.level%2?Bl:li}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,s){let r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError(\"Index out of range\");return r}};function Bc(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],s=e[t];if(i.from!=s.from||i.to!=s.to||i.direction!=s.direction||!Bc(i.inner,s.inner))return!1}return!0}var K=[];function $O(n,e,t,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:e,l=r<i.length?i[r].from:t,a=r?256:s;for(let h=o,c=a,f=a;h<l;h++){let u=Wc(n.charCodeAt(h));u==512?u=c:u==8&&f==4&&(u=16),K[h]=u==4?2:u,u&7&&(f=u),c=u}for(let h=o,c=a,f=a;h<l;h++){let u=K[h];if(u==128)h<l-1&&c==K[h+1]&&c&24?u=K[h]=c:K[h]=256;else if(u==64){let d=h+1;for(;d<l&&K[d]==64;)d++;let p=h&&c==8||d<t&&K[d]==8?f==1?1:8:256;for(let O=h;O<d;O++)K[O]=p;h=d-1}else u==8&&f==1&&(K[h]=1);c=u,u&7&&(f=u)}}}function PO(n,e,t,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let h=o?i[o-1].to:e,c=o<i.length?i[o].from:t;for(let f=h,u,d,p;f<c;f++)if(d=Fo[u=n.charCodeAt(f)])if(d<0){for(let O=l-3;O>=0;O-=3)if(yt[O+1]==-d){let m=yt[O+2],g=m&2?s:m&4?m&1?r:s:0;g&&(K[f]=K[yt[O]]=g),l=O;break}}else{if(yt.length==189)break;yt[l++]=f,yt[l++]=u,yt[l++]=a}else if((p=K[f])==2||p==1){let O=p==s;a=O?0:1;for(let m=l-3;m>=0;m-=3){let g=yt[m+2];if(g&2)break;if(O)yt[m+2]|=2;else{if(g&4)break;yt[m+2]|=4}}}}}function TO(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=s<t.length?t[s].from:e;for(let a=o;a<l;){let h=K[a];if(h==256){let c=a+1;for(;;)if(c==l){if(s==t.length)break;c=t[s++].to,l=s<t.length?t[s].from:e}else if(K[c]==256)c++;else break;let f=r==1,u=(c<e?K[c]:i)==1,d=f==u?f?1:2:i;for(let p=c,O=s,m=O?t[O-1].to:n;p>a;)p==m&&(p=t[--O].from,m=O?t[O-1].to:n),K[--p]=d;a=c}else r=h,a++}}}function Ho(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,h=0;a<t;){let c=!0,f=!1;if(h==r.length||a<r[h].from){let O=K[a];O!=l&&(c=!1,f=O==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h<r.length&&p==r[h].from){if(f)break e;let O=r[h];if(!c)for(let m=O.to,g=h+1;;){if(m==t)break e;if(g<r.length&&r[g].from==m)m=r[g++].to;else{if(K[m]==l)break e;break}}if(h++,u)u.push(O);else{O.from>a&&o.push(new Je(a,O.from,d));let m=O.direction==li!=!(d%2);Ko(n,m?i+1:i,s,O.inner,O.from,O.to,o),a=O.to}p=O.to}else{if(p==t||(c?K[p]!=l:K[p]==l))break;p++}u?Ho(n,a,p,i+1,s,u,o):a<p&&o.push(new Je(a,p,d)),a=p}else for(let a=t,h=r.length;a>e;){let c=!0,f=!1;if(!h||a>r[h-1].to){let O=K[a-1];O!=l&&(c=!1,f=O==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let O=r[--h];if(!c)for(let m=O.from,g=h;;){if(m==e)break e;if(g&&r[g-1].to==m)m=r[--g].from;else{if(K[m-1]==l)break e;break}}if(u)u.push(O);else{O.to<a&&o.push(new Je(O.to,a,d));let m=O.direction==li!=!(d%2);Ko(n,m?i+1:i,s,O.inner,O.from,O.to,o),a=O.from}p=O.from}else{if(p==e||(c?K[p-1]!=l:K[p-1]==l))break;p--}u?Ho(n,p,a,i+1,s,u,o):p<a&&o.push(new Je(p,a,d)),a=p}}function Ko(n,e,t,i,s,r,o){let l=e%2?2:1;$O(n,s,r,i,l),PO(n,s,r,i,l),TO(s,r,i,l),Ho(n,s,r,e,t,i,o)}function CO(n,e,t){if(!n)return[new Je(0,0,e==Bl?1:0)];if(e==li&&!t.length&&!vO.test(n))return Yc(n.length);if(t.length)for(;n.length>K.length;)K[K.length]=256;let i=[],s=e==li?0:1;return Ko(n,s,s,t,0,n.length,i),i}function Yc(n){return[new Je(0,n,0)]}var Ic=\"\";function ZO(n,e,t,i,s){var r;let o=i.head-n.from,l=Je.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],h=a.side(s,t);if(o==h){let u=l+=s?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!s,t),h=a.side(s,t)}let c=re(n.text,o,a.forward(s,t));(c<a.from||c>a.to)&&(c=h),Ic=n.text.slice(Math.min(o,c),Math.max(o,c));let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return f&&c==h&&f.level+(s?0:1)<a.level?x.cursor(f.side(!s,t)+n.from,f.forward(s,t)?1:-1,f.level):x.cursor(c+n.from,a.forward(s,t)?-1:1,a.level)}function AO(n,e,t){for(let i=e;i<t;i++){let s=Wc(n.charCodeAt(i));if(s==1)return li;if(s==2||s==4)return Bl}return li}var qc=P.define(),Vc=P.define(),jc=P.define(),Nc=P.define(),Jo=P.define(),Gc=P.define(),Uc=P.define(),Yl=P.define(),Il=P.define(),Fc=P.define({combine:n=>n.some(e=>e)}),Hc=P.define({combine:n=>n.some(e=>e)}),Kc=P.define(),un=class n{constructor(e,t=\"nearest\",i=\"nearest\",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new n(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new n(x.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},bs=E.define({map:(n,e)=>n.map(e)}),Jc=E.define();function me(n,e,t){let i=n.facet(Nc);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+\":\",e):console.error(e))}var vt=P.define({combine:n=>n.length?n[0]:!0}),MO=0,Ci=P.define({combine(n){return n.filter((e,t)=>{for(let i=0;i<t;i++)if(n[i].plugin==e.plugin)return!1;return!0})}}),ie=class n{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.baseExtensions=r(this),this.extension=this.baseExtensions.concat(Ci.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Ci.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new n(MO++,e,i,s,l=>{let a=[];return o&&a.push(Js.of(h=>{let c=h.plugin(l);return c?o(c):R.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return n.define((i,s)=>new e(i,s),t)}},dn=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(me(t.state,i,\"CodeMirror plugin crashed\"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){me(e.state,t,\"CodeMirror plugin crashed\"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){me(e.state,i,\"CodeMirror plugin crashed\")}}deactivate(){this.spec=this.value=null}},ef=P.define(),ql=P.define(),Js=P.define(),tf=P.define(),Vl=P.define(),kn=P.define(),nf=P.define();function Jh(n,e){let t=n.state.facet(nf);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(n):r),s=[];return I.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let h=r-e.from,c=o-e.from,f=s;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=AO(e.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let O={from:h,to:c,direction:d,inner:[]};f.push(O),f=O.inner}}}}),s}var sf=P.define();function jl(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(sf)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}var ln=P.define(),rt=class n{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new n(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toA<i.fromA)break;i=i.join(s),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let s=0,r=0,o=0;;){let l=s<e.length?e[s].fromB:1e9,a=r<t.length?t[r]:1e9,h=Math.min(l,a);if(h==1e9)break;let c=h+o,f=h,u=c;for(;;)if(r<t.length&&t[r]<=f){let d=t[r+1];r+=2,f=Math.max(f,d);for(let p=s;p<e.length&&e[p].fromB<=f;p++)o=e[p].toA-e[p].toB;u=Math.max(u,d+o)}else if(s<e.length&&e[s].fromB<=f){let d=e[s++];f=Math.max(f,d.toB),u=Math.max(u,d.toA),o=d.toA-d.toB}else break;i.push(new n(c,u,h,f))}return i}},zs=class n{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Qe.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new rt(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new n(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},RO=[],te=class{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return RO}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&mO(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:\"\")+(this.breakAfter?\"#\":\"\")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let s of this.children){if(s==e)return i;i+=s.length+s.breakAfter}throw new RangeError(\"Invalid child in posBefore\")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=zt(this.dom),s=this.length?e>0:t>0;return new xt(this.parent.dom,i+(s?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Ei)return e;return null}static get(e){return e.cmTile}},Li=class extends te{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,s,r=e?.node==t?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,s=i?i.nextSibling:t.firstChild,r&&s!=l.dom&&(r.written=!0),l.dom.parentNode==t)for(;s&&s!=l.dom;)s=ec(s);else t.insertBefore(l.dom,s);i=l.dom}for(s=i?i.nextSibling:t.firstChild,r&&s&&(r.written=!0);s;)s=ec(s);this.length=o}};function ec(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}var Ei=class extends Li{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=te.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,s=0,r=0;;)if(s==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&r++,s=t.pop()}else{let o=i.children[s++];if(o instanceof $t)t.push(s),i=o,s=0;else{let l=r+o.length,a=e(o,r);if(a!==void 0)return a;r=l+o.breakAfter}}}resolveBlock(e,t){let i,s=-1,r,o=-1;if(this.blockTiles((l,a)=>{let h=a+l.length;if(e>=a&&e<=h){if(l.isWidget()&&t>=-1&&t<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(a<e||e==h&&(t<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,s=e-a),(h>e||e==a&&(t>1?l.length:l.covers(-1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,o=e-a)}}),!i&&!r)throw new Error(\"No tile at position \"+e);return i&&t<0||!r?{tile:i,offset:s}:{tile:r,offset:o}}},$t=class n extends Li{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new n(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}},Di=class n extends Li{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let s=new n(t||document.createElement(\"div\"),e);return(!t||!i)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,t,i){let s=null,r=-1,o=null,l=-1;function a(c,f){for(let u=0,d=0;u<c.children.length&&d<=f;u++){let p=c.children[u],O=d+p.length;O>=f&&(p.isComposite()?a(p,f-d):(!o||o.isHidden&&(t>0||i&&LO(o,p)))&&(O>f||p.flags&32)?(o=p,l=f-d):(d<f||p.flags&16&&!p.isHidden)&&(s=p,r=f-d)),d=O}}a(this,e);let h=(t<0?s:o)||s||o;return h?{tile:h,offset:h==s?r:l}:null}coordsIn(e,t){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t):XO(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:s,offset:r}=i;if(this.dom.contains(s.dom))return s.isText()?new xt(s.dom,Math.min(s.dom.nodeValue.length,r)):s.domPosFor(r,s.flags&16?1:s.flags&32?-1:t);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new xt(a.dom,0);a==i.tile&&(l=!0)}}return new xt(this.dom,0)}};function XO(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Cs(e);return t[t.length-1]||null}function LO(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.top<t.bottom}var Ae=class n extends Li{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new n(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}},si=class n extends te{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let i=this.dom.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?Z.chrome||Z.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=wn(this.dom,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return Z.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Ds(a,o<0):a||null}static of(e,t){let i=new n(t||document.createTextNode(e),e);return t||(i.flags|=2),i}},ai=class n extends te{constructor(e,t,i,s){super(e,t,s),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let s=this.widget.coordsAt(this.dom,e,t);if(s)return s;if(i)return Ds(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let r=this.dom.getClientRects(),o=null;if(!r.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?r.length-1:0;o=r[a],!(e>0?a==0:a==r.length-1||o.top<o.bottom);a+=l?-1:1);return Ds(o,!l)}}get overrideDOMText(){if(!this.length)return B.empty;let{root:e}=this;if(!e)return B.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,i,s,r){return r||(r=e.toDOM(t),e.editable||(r.contentEditable=\"false\")),new n(r,i,e,s)}},zi=class extends te{constructor(e){let t=document.createElement(\"img\");t.className=\"cm-widgetBuffer\",t.setAttribute(\"aria-hidden\",\"true\"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return B.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},el=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:s,index:r,beforeBreak:o,parents:l}=this;for(;e||t>0;)if(s.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(r==s.children.length){if(!e&&!l.length)break;i&&i.leave(s),o=!!s.breakAfter,{tile:s,index:r}=l.pop(),r++}else{let a=s.children[r],h=a.breakAfter;(t>0?a.length<=e:a.length<e)&&(!i||i.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!h,r++,e-=a.length):(l.push({tile:s,index:r}),s=a,r=0,i&&a.isComposite()&&i.enter(a))}else if(r==s.length)o=!!s.breakAfter,{tile:s,index:r}=l.pop(),r++;else if(e){let a=Math.min(e,s.length-r);i&&i.skip(s,r,r+a),e-=a,r+=a}else break;return this.tile=s,this.index=r,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},tl=class{constructor(e,t,i,s){this.from=e,this.to=t,this.wrapper=i,this.rank=s}},il=class{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,s){var r;this.flushBuffer();let o=this.ensureMarks(t,i),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new si(l.dom,l.text+e);a.parent=o}else o.append(s||si.of(e,(r=this.cache.find(si))===null||r===void 0?void 0:r.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?Eo(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let s=i;for(let l=t.marks.length-1;l>=0;l--){let a=t.marks[l],h=s.lastChild;if(h instanceof Ae&&h.mark.eq(a.mark))h.dom!=a.dom&&h.setDOM(Eo(a.dom)),s=h;else{if(this.cache.reused.get(a)){let f=te.get(a.dom);f&&f.setDOM(Eo(a.dom))}let c=Ae.of(a.mark,a.dom);s.append(c),s=c}this.cache.reused.set(a,2)}let r=te.get(e.text);r&&this.cache.reused.set(r,2);let o=new si(e.text,e.text.nodeValue);o.flags|=8,s.append(o)}addInlineWidget(e,t,i){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let r=this.ensureMarks(t,i);!s&&!(e.flags&16)&&r.append(this.getBuffer(1)),r.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=rf);let s=Di.start(e,t||((i=this.cache.find(Di))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=s)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let s=this.curLine;for(let r=e.length-1;r>=0;r--){let o=e[r],l;if(t>0&&(l=s.lastChild)&&l instanceof Ae&&l.mark.eq(o))s=l,t--;else{let a=Ae.of(o,(i=this.cache.find(Ae,h=>h.mark.eq(o)))===null||i===void 0?void 0:i.dom);s.append(a),s=a,t=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!tc(this.curLine,!1)||e.dom.nodeName!=\"BR\"&&e.isWidget()&&!(Z.ios&&tc(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Do,0,32)||new ai(Do.toDOM(),0,Do,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new tl(e.from,e.to,e.value,e.rank),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-t.rank||this.wrappers[i-1].to-t.to)<0;)i--;this.wrappers.splice(i,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let s=t.lastChild;if(i.from<this.pos&&s instanceof $t&&s.wrapper.eq(i.wrapper))t=s;else{let r=$t.of(i.wrapper,(e=this.cache.find($t,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(r),t=r}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(zi,void 0,1);return i&&(i.flags=t),i||new zi(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},nl=class{constructor(e){this.skipCount=0,this.text=\"\",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=\"\",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:s,lineBreak:r,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error(\"Ran out of text content when drawing inline views\");this.text=s;let l=this.textOff=Math.min(e,s.length);return r?null:s.slice(0,l)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}},_s=[ai,Di,si,Ae,zi,$t,Ei];for(let n=0;n<_s.length;n++)_s[n].bucket=n;var sl=class{constructor(e){this.view=e,this.buckets=_s.map(()=>[]),this.index=_s.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let s=e.bucket,r=this.buckets[s],o=this.index[s];for(let l=r.length-1;l>=0;l--){let a=(l+o)%r.length,h=r[a];if((!t||t(h))&&!this.reused.has(h))return r.splice(a,1),a<o&&this.index[s]--,this.reused.set(h,i),h}return null}findWidget(e,t,i){let s=this.buckets[0];if(s.length)for(let r=0,o=0;;r++){if(r==s.length){if(o)return null;o=1,r=0}let l=s[r];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return s.splice(r,1),r<this.index[0]&&this.index[0]--,l.widget==e&&l.length==t&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new ai(l.dom,t,e,l.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},rl=class{constructor(e,t,i,s,r){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new sl(e),this.text=new nl(e.state.doc),this.builder=new il(this.cache,new Ei(e,e.contentDOM),I.iter(i)),this.cache.reused.set(t,2),this.old=new el(t),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let s=0,r=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>s){let h=a-s;this.preserve(h,!o,!l),s=a,r+=h}if(!l)break;t&&l.fromA<=t.range.fromA&&l.toA>=t.range.toA?(this.forward(l.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(r,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,l.toA),this.emit(t.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(r,l.toB)),r=l.toB,s=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let s=zO(this.old),r=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let h=a>0||l<o.length?ai.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,s,r),r=s.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,s,r,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),s,r)),r=s.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof zi)this.cache.add(o);else if(o instanceof Ae)this.builder.ensureLine(null),this.builder.addMark(o,s,r),this.cache.reused.set(o,1),r=s.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ae&&s.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?s.length&&(s.length=r=0):o instanceof Ae&&(s.shift(),r=Math.min(r,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,s=this.builder,r=0,o=I.spans(this.decorations,e,t,{point:(l,a,h,c,f,u)=>{if(h instanceof oi){if(this.disallowBlockEffectsFor[u]){if(h.block)throw new RangeError(\"Block decorations may not be specified via plugins\");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError(\"Decorations that replace line breaks may not be specified via plugins\")}if(r=c.length,f>c.length)s.continueWidget(a-l);else{let d=h.widget||(h.block?_t.block:_t.inline),p=EO(h),O=this.cache.findWidget(d,a-l,p)||ai.of(d,this.view,a-l,p);h.block?(h.startSide>0&&s.addLineStartIfNotCovered(i),s.addBlockWidget(O)):(s.ensureLine(i),s.addInlineWidget(O,c,f))}i=null}else i=DO(i,h);a>l&&this.text.skip(a-l)},span:(l,a,h,c)=>{for(let f=l;f<a;){let u=this.text.next(Math.min(512,a-f));u==null?(s.addLineStartIfNotCovered(i),s.addBreak(),f++):(s.ensureLine(i),s.addText(u,h,f==l?c:h.length),f+=u.length),i=null}}});s.addLineStartIfNotCovered(i),this.openWidget=o>r,this.openMarks=o}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let s=e.parentNode;;s=s.parentNode){let r=te.get(s);if(s==this.view.contentDOM)break;r instanceof Ae?t.push(r):r?.isLine()?i=r:r instanceof $t||(s.nodeName==\"DIV\"&&!i&&s!=this.view.contentDOM?i=new Di(s,rf):i||t.push(Ae.of(new xn({tagName:s.nodeName.toLowerCase(),attributes:gO(s)}),s)))}return{line:i,marks:t}}};function tc(n,e){let t=i=>{for(let s of i.children)if((e?s.isText():s.length)||t(s))return!0;return!1};return t(n)}function EO(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}var rf={class:\"cm-line\"};function DO(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:\"cm-line\"}),t&&_l(t,n),i&&(n.class+=\" \"+i)),n}function zO(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof Ae&&e.push(i.mark)}return e}function Eo(n){let e=te.get(n);return e&&e.setDOM(n.cloneNode()),n}var _t=class extends $e{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};_t.inline=new _t(\"span\");_t.block=new _t(\"div\");var Do=new class extends $e{toDOM(){return document.createElement(\"br\")}get isHidden(){return!0}get editable(){return!0}},Ws=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=R.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Ei(e,e.contentDOM),this.updateInner([new rt(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:f})=>f<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!jO(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?WO(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:f}=this.hasComposition;i=new rt(c,f,e.changes.mapPos(c,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Z.ie||Z.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=IO(o,this.decorations,e.changes);a.length&&(i=rt.extendWithRanges(i,a));let h=qO(l,this.blockWrappers,e.changes);return h.length&&(i=rt.extendWithRanges(i,h)),r&&!i.some(c=>c.fromA<=r.range.fromA&&c.toA>=r.range.toA)&&(i=r.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let o=this.tile,l=new rl(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&te.get(t.text)&&l.cache.reused.set(te.get(t.text),2),this.tile=l.run(e,t),ol(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+\"px\",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+\"px\":\"\";let r=Z.chrome||Z.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||i.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=\"\"});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let r of this.tile.children)r.isWidget()&&r.widget instanceof pn&&s.push(r.dom);i.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(Jc)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,s=this.view.root.activeElement,r=s==i,o=!r&&!(this.view.state.facet(vt)||i.tabIndex>-1)&&cn(i,this.view.observer.selectionRange)&&!(s&&i.contains(s));if(!(r||t||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,h,c;if(a.empty?c=h=this.inlineDOMNearPos(a.anchor,a.assoc||1):(c=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),h=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),Z.gecko&&a.empty&&!this.hasComposition&&_O(h)){let u=document.createTextNode(\"\");this.view.observer.ignore(()=>h.node.insertBefore(u,h.node.childNodes[h.offset]||null)),h=c=new xt(u,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!fn(h.node,h.offset,f.anchorNode,f.anchorOffset)||!fn(c.node,c.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{Z.android&&Z.chrome&&i.contains(f.focusNode)&&VO(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let u=Sn(this.view.root);if(u)if(a.empty){if(Z.gecko){let d=BO(h.node,h.offset);if(d&&d!=3){let p=(d==1?Dc:zc)(h.node,h.offset);p&&(h=new xt(p.node,p.offset))}}u.collapse(h.node,h.offset),a.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=a.bidiLevel)}else if(u.extend){u.collapse(h.node,h.offset);try{u.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([h,c]=[c,h]),d.setEnd(c.node,c.offset),d.setStart(h.node,h.offset),u.removeAllRanges(),u.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(h,c)),this.impreciseAnchor=h.precise?null:new xt(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new xt(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&fn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Sn(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(c.node,c.offset),i.modify(\"move\",t.assoc<0?\"forward\":\"backward\",\"lineboundary\"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let s=i.posAtStart;if(i.isComposite()){let r;if(e==i.dom)r=i.dom.childNodes[t];else{let o=Pt(e)==0?0:t==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?r=e:r=e.nextSibling}if(r==i.dom.firstChild)return s;for(;r&&!te.get(r);)r=r.nextSibling;if(!r)return s+i.length;for(let o=0,l=s;;o++){let a=i.children[o];if(a.dom==r)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?s+t:s+(t?i.length:0):s}domAtPos(e,t){let{tile:i,offset:s}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(s,t)}inlineDOMNearPos(e,t){let i,s=-1,r=!1,o,l=-1,a=!1;return this.tile.blockTiles((h,c)=>{if(h.isWidget()){if(h.flags&32&&c>=e)return!0;h.flags&16&&(r=!0)}else{let f=c+h.length;if(c<=e&&(i=h,s=e-c,r=f<e),f>=e&&!o&&(o=h,l=e-c,a=c>e),c>e&&o)return!0}}),!i&&!o?this.domAtPos(e,t):(r&&o?i=null:a&&i&&(o=null),i&&t<0||!o?i.domIn(s,t):o.domIn(l,t))}coordsAt(e,t){let{tile:i,offset:s}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof pn?null:i.coordsInWidget(s,t,!0):i.coordsIn(s,t)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function s(r,o){if(r.isComposite())for(let l of r.children){if(l.length>=o){let a=s(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(r.isText()&&o<r.length){let l=re(r.text,o);if(l==o)return null;let a=wn(r.dom,o,l).getClientRects();for(let h=0;h<a.length;h++){let c=a[h];if(h==a.length-1||c.top<c.bottom&&c.left<c.right)return c}}return null}return s(t,i)}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==N.LTR,h=0,c=(f,u,d)=>{for(let p=0;p<f.children.length&&!(u>s);p++){let O=f.children[p],m=u+O.length,g=O.dom.getBoundingClientRect(),{height:S}=g;if(d&&!p&&(h+=g.top-d.top),O instanceof $t)m>i&&c(O,u,g);else if(u>=i&&(h>0&&t.push(-h),t.push(S+h),h=0,o)){let b=O.dom.lastChild,A=b?Cs(b):[];if(A.length){let w=A[A.length-1],v=a?w.right-g.left:g.right-w.left;v>l&&(l=v,this.minWidth=r,this.minWidthFrom=u,this.minWidthTo=m)}}d&&p==f.children.length-1&&(h+=d.bottom-g.bottom),u=m+O.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==\"rtl\"?N.RTL:N.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let c=Cs(h.dom);if(c.length!=1)return;l+=c[0].width,a=c[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let t=document.createElement(\"div\"),i,s,r;return t.className=\"cm-line\",t.style.width=\"99999px\",t.style.position=\"absolute\",t.textContent=\"abc def ghi jkl mno pqr stu\",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=Cs(t.firstChild)[0];i=t.getBoundingClientRect().height,s=o&&o.width?o.width/27:7,r=o&&o.height?o.height:i,t.remove()}),{lineHeight:i,charWidth:s,textHeight:r}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.view.state.doc.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(R.replace({widget:new pn(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return R.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Js).map(r=>(this.dynamicDecorationMap[e++]=typeof r==\"function\")?r(this.view):r),i=!1,s=this.view.state.facet(Vl).map((r,o)=>{let l=typeof r==\"function\";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=i,t.push(I.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(tf).map(r=>typeof r==\"function\"?r(this.view):r)}scrollIntoView(e){var t;if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(Kc))try{if(c(this.view,e.range,e))return!0}catch(f){me(this.view.state,f,\"scroll handler\")}let{range:i}=e,s=this.coordsAt(i.head,(t=i.assoc)!==null&&t!==void 0?t:i.empty?0:i.head>i.anchor?-1:1),r;if(!s)return;!i.empty&&(r=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(s={left:Math.min(s.left,r.left),top:Math.min(s.top,r.top),right:Math.max(s.right,r.right),bottom:Math.max(s.bottom,r.bottom)});let o=jl(this.view),l={left:s.left-o.left,top:s.top-o.top,right:s.right+o.right,bottom:s.bottom+o.bottom},{offsetWidth:a,offsetHeight:h}=this.view.scrollDOM;if(bO(this.view.scrollDOM,l,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==N.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(s.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||s.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(i.head,1);c&&c.dom.scrollIntoView({block:\"nearest\"})}}lineHasWidget(e){let t=i=>i.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){ol(this.tile)}};function ol(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)ol(i,e)}}function _O(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable==\"false\")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable==\"false\")}function of(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=Dc(t.focusNode,t.focusOffset),s=zc(t.focusNode,t.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=te.get(s.node);if(!l||l.isText()&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=te.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function WO(n,e,t){let i=of(n,t);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\\n\\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new rt(a.mapPos(r),a.mapPos(o),r,o),text:s}}function BO(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable==\"false\"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable==\"false\"?2:0)}var YO=class{constructor(){this.changes=[]}compareRange(e,t){Ri(e,t,this.changes)}comparePoint(e,t){Ri(e,t,this.changes)}boundChange(e){Ri(e,e,this.changes)}};function IO(n,e,t){let i=new YO;return I.compare(n,e,t,i),i.changes}var ll=class{constructor(){this.changes=[]}compareRange(e,t){Ri(e,t,this.changes)}comparePoint(){}boundChange(e){Ri(e,e,this.changes)}};function qO(n,e,t){let i=new ll;return I.compare(n,e,t,i),i.changes}function VO(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable==\"false\")return!0;return!1}function jO(n,e){let t=!1;return e&&n.iterChangedRanges((i,s)=>{i<e.to&&s>e.from&&(t=!0)}),t}var pn=class extends $e{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(\"div\");return e.className=\"cm-gap\",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+\"px\",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function NO(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return x.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=re(s.text,r,!1):l=re(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let h=re(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;l<s.length;){let h=re(s.text,l);if(i(s.text.slice(l,h))!=a)break;l=h}return x.range(o+s.from,l+s.from)}function GO(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+ys(o,r,n.state.tabSize)}function al(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let s;for(let r of i.type){if(r.from>e)break;if(!(r.to<e)){if(r.from<e&&r.to>e)return r;(!s||r.type==ge.Text&&(s.type!=r.type||(t<0?r.from<e:r.to>e)))&&(s=r)}}return s||i}return i}function UO(n,e,t,i){let s=al(n,e.head,e.assoc||-1),r=!i||s.type!=ge.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==N.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return x.cursor(a,t?-1:1)}return x.cursor(t?s.to:s.from,t?-1:1)}function ic(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=ZO(s,r,o,l,t),c=Ic;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=`\n`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=n.visualLineSide(s,!t)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function FO(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==F.Space&&(s=o),s==o}}function HO(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return x.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let p=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-p.from))),l=(r<0?p.top:p.bottom)+c}let f=a.left+o,u=n.viewState.heightOracle.textHeight>>1,d=i??u;for(let p=0;;p+=u){let O=l+(d+p)*r,m=hl(n,{x:f,y:O},!1,r);if(t?O>a.bottom:O<a.top)return x.cursor(m.pos,m.assoc);let g=n.coordsAtPos(m.pos,m.assoc),S=g?(g.top+g.bottom)/2:0;if(!g||(t?S>l:S<l))return x.cursor(m.pos,m.assoc,void 0,o)}}function On(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function lf(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let s=e.ranges[i],r=null;if(s.empty){let o=On(n,s.from,0);o!=s.from&&(r=x.cursor(o,-1))}else{let o=On(n,s.from,-1),l=On(n,s.to,1);(o!=s.from||l!=s.to)&&(r=x.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(t||(t=e.ranges.slice()),t[i]=r)}return t?x.create(t,e.mainIndex):e}function zo(n,e,t){let i=On(n.state.facet(kn).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:x.cursor(i,i<t.from?1:-1)}var Ke=class{constructor(e,t){this.pos=e,this.assoc=t}};function hl(n,e,t,i){let s=n.contentDOM.getBoundingClientRect(),r=s.top+n.viewState.paddingTop,{x:o,y:l}=e,a=l-r,h;for(;;){if(a<0)return new Ke(0,1);if(a>n.viewState.docHeight)return new Ke(n.state.doc.length,-1);if(h=n.elementAtHeight(a),i==null)break;if(h.type==ge.Text){if(i<0?h.to<n.viewport.from:h.from>n.viewport.to)break;let u=n.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(u&&(i<0?u.top<=a+r:u.bottom>=a+r))break}let f=n.viewState.heightOracle.textHeight/2;a=i>0?h.bottom+f:h.top-f}if(n.viewport.from>=h.to||n.viewport.to<=h.from){if(t)return null;if(h.type==ge.Text){let f=GO(n,s,h,o,l);return new Ke(f,f==h.from?1:-1)}}if(h.type!=ge.Text)return a<(h.top+h.bottom)/2?new Ke(h.from,1):new Ke(h.to,-1);let c=n.docView.lineAt(h.from,2);return(!c||c.length!=h.length)&&(c=n.docView.lineAt(h.from,-2)),new cl(n,o,l,n.textDirectionAt(h.from)).scanTile(c,h.from)}var cl=class{constructor(e,t,i,s){this.view=e,this.x=t,this.y=i,this.baseDir=s,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:s}=this.bidiSpansAt(e);return s[Je.find(s,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:s}=this.bidiSpansAt(e);return s[Je.find(s,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:s}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+s.from<t)}scan(e,t){let i=0,s=e.length-1,r=new Set,o=this.bidiIn(e[0],e[s]),l,a,h=-1,c=1e9,f;e:for(;i<s;){let d=s-i,p=i+s>>1;t:if(r.has(p)){let m=i+Math.floor(Math.random()*d);for(let g=0;g<d;g++){if(!r.has(m)){p=m;break t}m++,m==s&&(m=i)}break e}r.add(p);let O=t(p);if(O)for(let m=0;m<O.length;m++){let g=O[m],S=0;if(!(g.width==0&&O.length>1)){if(g.bottom<this.y)(!l||l.bottom<g.bottom)&&(l=g),S=1;else if(g.top>this.y)(!a||a.top>g.top)&&(a=g),S=-1;else{let b=g.left>this.x?this.x-g.left:g.right<this.x?this.x-g.right:0,A=Math.abs(b);A<c&&(h=p,c=A,f=g),b&&(S=b<0==(this.baseDir==N.LTR)?-1:1)}S==-1&&(!o||this.baseDirAt(e[p],1))?s=p:S==1&&(!o||this.baseDirAt(e[p+1],-1))&&(i=p+1)}}}if(!f){let d=l&&(!a||this.y-l.bottom<a.top-this.y)?l:a;return this.y=(d.top+d.bottom)/2,this.scan(e,t)}let u=(o?this.dirAt(e[h],1):this.baseDir)==N.LTR;return{i:h,after:this.x>(f.left+f.right)/2==u}}scanText(e,t){let i=[];for(let r=0;r<e.length;r=re(e.text,r))i.push(t+r);i.push(t+e.length);let s=this.scan(i,r=>{let o=i[r]-t,l=i[r+1]-t;return wn(e.dom,o,l).getClientRects()});return s.after?new Ke(i[s.i+1],-1):new Ke(i[s.i],1)}scanTile(e,t){if(!e.length)return new Ke(t,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,t);if(l.isComposite())return this.scanTile(l,t)}let i=[t];for(let l=0,a=t;l<e.children.length;l++)i.push(a+=e.children[l].length);let s=this.scan(i,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:wn(a.dom,0,a.length)).getClientRects()}),r=e.children[s.i],o=i[s.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):s.after?new Ke(i[s.i+1],-1):new Ke(o,1)}},Ti=\"\\uFFFF\",fl=class{constructor(e,t){this.points=e,this.view=t,this.text=\"\",this.lineSeparator=t.state.facet(H.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ti}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=te.get(s),l=s.nextSibling;if(l==t){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=te.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:Es(s))||Es(l)&&(s.nodeName!=\"BR\"||o?.isWidget())&&this.text.length>r)&&!JO(l,t)&&this.lineBreak(),s=l}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\\r\\n?|\\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){let t=te.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==\"BR\"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(KO(e,i.node,i.offset)?t:0))}};function KO(n,e,t){for(;;){if(!e||t<Pt(e))return!1;if(e==n)return!0;t=zt(e)+1,e=e.parentNode}}function JO(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let i=te.get(n);if(!i?.isWidget())return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let s=i.overrideDOMText;if(s?.length)return!1}return!0}var Bs=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},ul=class{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text=\"\",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=af(e.docView.tile,t,i,0))){let a=r||o?[]:tm(e),h=new fl(a,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=im(a,this.bounds.from)}else{let a=e.observer.selectionRange,h=r&&r.node==a.focusNode&&r.offset==a.focusOffset||!Go(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Go(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((Z.ios||Z.chrome)&&l.main.empty&&h!=c&&(f.from>0||f.to<e.state.doc.length)){let u=Math.min(h,c),d=Math.max(h,c),p=f.from-u,O=f.to-d;(p==0||p==1||u==0)&&(O==0||O==-1||d==e.state.doc.length)&&(h=0,c=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(x.range(c,h));else if(e.lineWrapping&&c==h&&!(l.main.empty&&l.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let u=e.coordsAtPos(h,-1),d=0;u&&(d=e.inputState.lastTouchY<=u.bottom?-1:1),this.newSel=x.create([x.cursor(h,d)])}else this.newSel=x.single(c,h)}}};function af(n,e,t,i){if(n.isComposite()){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;a<n.children.length;a++){let f=n.children[a],u=h+f.length;if(h<e&&u>t)return af(f,e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==n.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+n.length:l,startDOM:(s?n.children[s-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:o<n.children.length&&o>=0?n.children[o].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function hf(n,e){let t,{newSel:i}=e,{state:s}=n,r=s.selection.main,o=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,h=r.from,c=null;(o===8||Z.android&&e.text.length<a-l)&&(h=r.to,c=\"end\");let f=s.doc.sliceString(l,a,Ti),u,d;!r.empty&&r.from>=l&&r.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,r.from-l)==e.text.slice(0,r.from-l)&&f.slice(r.to-l)==e.text.slice(u=e.text.length-(f.length-(r.to-l)))?t={from:r.from,to:r.to,insert:B.of(e.text.slice(r.from-l,u).split(Ti))}:(d=cf(f,e.text,h-l,c))&&(Z.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Ti+Ti&&d.toB--,t={from:l+d.from,to:l+d.toA,insert:B.of(e.text.slice(d.from,d.toB).split(Ti))})}else i&&(!n.hasFocus&&s.facet(vt)||Ys(i,r))&&(i=null);if(!t&&!i)return!1;if((Z.mac||Z.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute(\"autocorrect\")==\"off\"?(i&&t.insert.length==2&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:B.of([t.insert.toString().replace(\".\",\" \")])}):s.doc.lineAt(r.from).to<r.to&&n.docView.lineHasWidget(r.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:r.from,to:r.to,insert:s.toText(n.inputState.insertingText)}:Z.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==`\n `&&n.lineWrapping&&(i&&(i=x.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:B.of([\" \"])}),t)return Nl(n,t,i,o);if(i&&!Ys(i,r)){let l=!1,a=\"select\";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin==\"select\"&&(l=!0),a=n.inputState.lastSelectionOrigin,a==\"select.pointer\"&&(i=lf(s.facet(kn).map(h=>h(n)),i))),n.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function Nl(n,e,t,i=-1){if(Z.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(Z.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&n.state.sliceDoc(e.from,s.from)==\" \")&&e.insert.length==1&&e.insert.lines==2&&Xi(n.contentDOM,\"Enter\",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&Xi(n.contentDOM,\"Backspace\",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Xi(n.contentDOM,\"Delete\",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=em(n,e,t));return n.state.facet(Gc).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function em(n,e,t){let i,s=n.state,r=s.selection.main,o=-1;if(e.from==e.to&&e.from<r.from||e.from>r.to){let a=e.from<r.from?-1:1,h=a<0?r.from:r.to,c=On(s.facet(kn).map(f=>f(n)),h,a);e.from==c&&(o=c)}if(o>-1)i={changes:e,selection:x.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=r.from<e.from?s.sliceDoc(r.from,e.from):\"\",h=r.to>e.to?s.sliceDoc(e.to,r.to):\"\";i=s.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let a=s.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(s.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let c=n.state.sliceDoc(e.from,e.to),f,u=t&&of(n,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=n.state.doc.lineAt(r.head);let d=r.to-e.to;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:a,range:h||p.map(a)};let O=p.to-d,m=O-c.length;if(n.state.sliceDoc(m,O)!=c||O>=f.from&&m<=f.to)return{range:p};let g=s.changes({from:m,to:O,insert:e.insert}),S=p.to-r.to;return{changes:g,range:h?x.range(Math.max(0,h.anchor+S),Math.max(0,h.head+S)):p.map(g)}})}else i={changes:a,selection:h&&s.selection.replaceRange(h)}}let l=\"input.type\";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=\".compose\",n.inputState.compositionFirstChange&&(l+=\".start\",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:l,scrollIntoView:!0})}function cf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i==\"end\"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function tm(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new Bs(t,i)),(s!=t||r!=i)&&e.push(new Bs(s,r))),e}function im(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?x.single(t+e,i+e):null}function Ys(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}var dl=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=\"\",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Z.safari&&e.contentDOM.addEventListener(\"input\",()=>null),Z.gecko&&mm(e.contentDOM.ownerDocument)}handleEvent(e){!hm(this.view,e)||this.ignoreDuringComposition(e)||e.type==\"keydown\"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=nm(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!=\"scroll\"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!=\"scroll\"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&uf.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Z.android&&Z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=ff.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||sm.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==\"Enter\"&&e&&e.from<e.to&&/^\\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Xi(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Z.safari&&!Z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function nc(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){me(t.state,s)}}}function nm(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec,r=s&&s.plugin.domEventHandlers,o=s&&s.plugin.domEventObservers;if(r)for(let l in r){let a=r[l];a&&t(l).handlers.push(nc(i.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(nc(i.value,a))}}for(let i in ot)t(i).handlers.push(ot[i]);for(let i in Me)t(i).observers.push(Me[i]);return e}var ff=[{key:\"Backspace\",keyCode:8,inputType:\"deleteContentBackward\"},{key:\"Enter\",keyCode:13,inputType:\"insertParagraph\"},{key:\"Enter\",keyCode:13,inputType:\"insertLineBreak\"},{key:\"Delete\",keyCode:46,inputType:\"deleteContentForward\"}],sm=\"dthko\",uf=[16,17,18,20,91,92,224,225],Ss=6;function ws(n){return Math.max(0,n)*.7+8}function rm(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}var pl=class{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Xc(e.contentDOM),this.atoms=e.state.facet(kn).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener(\"mousemove\",this.move=this.move.bind(this)),r.addEventListener(\"mouseup\",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(H.allowMultipleSelections)&&om(e,t),this.dragging=am(e,t)&&Of(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&rm(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=jl(this.view);e.clientX-a.left<=s+Ss?t=-ws(s-e.clientX):e.clientX+a.right>=o-Ss&&(t=ws(e.clientX-o)),e.clientY-a.top<=r+Ss?i=-ws(r-e.clientY):e.clientY+a.bottom>=l-Ss&&(i=ws(e.clientY-l)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(\"mousemove\",this.move),e.removeEventListener(\"mouseup\",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=lf(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:\"select.pointer\"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent(\"input.type\"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function om(n,e){let t=n.state.facet(qc);return t.length?t[0](e):Z.mac?e.metaKey:e.ctrlKey}function lm(n,e){let t=n.state.facet(Vc);return t.length?t[0](e):Z.mac?!e.altKey:!e.ctrlKey}function am(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Sn(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function hm(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=te.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var ot=Object.create(null),Me=Object.create(null),df=Z.ie&&Z.ie_version<15||Z.ios&&Z.webkit_version<604;function cm(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement(\"textarea\"));t.style.cssText=\"position: fixed; left: -10000px; top: 10px\",t.focus(),setTimeout(()=>{n.focus(),t.remove(),pf(n,t.value)},50)}function er(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function pf(n,e){e=er(n.state,Yl,e);let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Ol!=null&&t.selection.ranges.every(a=>a.empty)&&Ol==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:x.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:x.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:\"input.paste\",scrollIntoView:!0})}Me.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Me.wheel=Me.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};ot.keydown=(n,e)=>(n.inputState.setSelectionOrigin(\"select\"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);Me.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin(\"select.pointer\")};Me.touchmove=n=>{n.inputState.setSelectionOrigin(\"select.pointer\")};ot.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(jc))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=um(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new pl(n,e,t,i)),i&&n.observer.ignore(()=>{Lc(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else n.inputState.setSelectionOrigin(\"select.pointer\");return!1};function sc(n,e,t,i){if(i==1)return x.cursor(e,t);if(i==2)return NO(n.state,e,t);{let s=n.docView.lineAt(e,t),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,x.range(o,l)}}var fm=Z.ie&&Z.ie_version<=11,rc=null,oc=0,lc=0;function Of(n){if(!fm)return n.detail;let e=rc,t=lc;return rc=n,lc=Date.now(),oc=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(oc+1)%3:1}function um(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=Of(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=n.posAndSideAtCoords({x:r.clientX,y:r.clientY},!1),h,c=sc(n,a.pos,a.assoc,i);if(t.pos!=a.pos&&!o){let f=sc(n,t.pos,t.assoc,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u<c.from?x.range(u,d,c.assoc):x.range(d,u,c.assoc)}return o?s.replaceRange(s.main.extend(c.from,c.to,c.assoc)):l&&i==1&&s.ranges.length>1&&(h=dm(s,a.pos))?h:l?s.addRange(c):x.create([c])}}}function dm(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:s}=n.ranges[t];if(i<=e&&s>=e)return x.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}ot.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let s=n.docView.tile.nearest(e.target);if(s&&s.isWidget()){let r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=x.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData(\"Text\",er(n.state,Il,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed=\"copyMove\"),!1};ot.dragend=n=>(n.inputState.draggedContent=null,!1);function ac(n,e,t,i){if(t=er(n.state,Yl,t),!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&lm(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?\"move.drop\":\"input.drop\"}),n.inputState.draggedContent=null}ot.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),s=0,r=()=>{++s==t.length&&ac(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData(\"Text\");if(i)return ac(n,e,i,!0),!0}return!1};ot.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=df?null:e.clipboardData;return t?(pf(n,t.getData(\"text/plain\")||t.getData(\"text/uri-list\")),!0):(cm(n),!1)};function pm(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement(\"textarea\"));i.style.cssText=\"position: fixed; left: -10000px; top: 10px\",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function Om(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:er(n,Il,e.join(n.lineBreak)),ranges:t,linewise:i}}var Ol=null;ot.copy=ot.cut=(n,e)=>{if(!cn(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:s}=Om(n.state);if(!t&&!s)return!1;Ol=s?t:null,e.type==\"cut\"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:\"delete.cut\"});let r=df?null:e.clipboardData;return r?(r.clearData(),r.setData(\"text/plain\",t),!0):(pm(n,t),!1)};var mf=Ze.define();function gf(n,e){let t=[];for(let i of n.facet(Uc)){let s=i(n,e);s&&t.push(s)}return t.length?n.update({effects:t,annotations:mf.of(!0)}):null}function yf(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=gf(n.state,e);t?n.dispatch(t):n.update([])}},10)}Me.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),yf(n)};Me.blur=n=>{n.observer.clearSelectionRange(),yf(n)};Me.compositionstart=Me.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};Me.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Z.chrome&&Z.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};Me.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};ot.beforeinput=(n,e)=>{var t,i;if((e.inputType==\"insertText\"||e.inputType==\"insertCompositionText\")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType==\"insertReplacementText\"&&n.observer.editContext){let r=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData(\"text/plain\"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],a=n.posAtDOM(l.startContainer,l.startOffset),h=n.posAtDOM(l.endContainer,l.endOffset);return Nl(n,{from:a,to:h,insert:n.state.toText(r)},null),!0}}let s;if(Z.chrome&&Z.android&&(s=ff.find(r=>r.inputType==e.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key==\"Backspace\"||s.key==\"Delete\")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Z.ios&&e.inputType==\"deleteContentForward\"&&n.observer.flushSoon(),Z.safari&&e.inputType==\"insertText\"&&n.inputState.composing>=0&&setTimeout(()=>Me.compositionend(n,e),20),!1};var hc=new Set;function mm(n){hc.has(n)||(hc.add(n),n.addEventListener(\"copy\",()=>{}),n.addEventListener(\"cut\",()=>{}))}var cc=[\"pre-wrap\",\"normal\",\"pre-line\",\"break-spaces\"],_i=!1;function fc(){_i=!1}var ml=class{constructor(e){this.lineWrapping=e,this.doc=B.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return cc.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let s=e[i];s<0?i++:this.heightSamples[Math.floor(s*10)]||(t=!0,this.heightSamples[Math.floor(s*10)]=!0)}return t}refresh(e,t,i,s,r,o){let l=cc.indexOf(e)>-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(i-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h<o.length;h++){let c=o[h];c<0?h++:this.heightSamples[Math.floor(c*10)]=!0}}return a}},gl=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},st=class n{constructor(e,t,i,s,r){this.from=e,this.length=t,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content==\"number\"?ge.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof oi?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==\"number\"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new n(this.from,this.length+e.length,this.top,this.height+e.height,t)}},ee=(function(n){return n[n.ByPos=0]=\"ByPos\",n[n.ByHeight=1]=\"ByHeight\",n[n.ByPosNoHeight=2]=\"ByPosNoHeight\",n})(ee||(ee={})),Zs=.001,We=class n{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Zs&&(_i=!0),this.height=e)}replace(e,t,i){return n.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,ee.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,ee.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,ee.ByPosNoHeight,i,0,0));c+=u.from-a,a=u.from;let p=xl.build(i.setDoc(o),e,c,f);r=Is(r,r.replace(a,h,p))}return r.updateHeight(i,0)}static empty(){return new He(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,r=0;for(;;)if(t==i)if(s>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[t++];l&&(s+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new yl(n.of(e.slice(0,t)),o,n.of(e.slice(i)))}};function Is(n,e){return n==e?n:(n.constructor!=e.constructor&&(_i=!0),e)}We.prototype.size=1;var gm=R.replace({}),qs=class extends We{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new st(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,s){return this.spaceAbove&&e<i+this.spaceAbove?new st(s,0,i,this.spaceAbove,gm):this.mainBlock(i,s)}lineAt(e,t,i,s,r){let o=this.mainBlock(s,r);return this.spaceAbove?this.blockAt(0,i,s,r).join(o):o}forEachLine(e,t,i,s,r,o){e<=r+this.length&&t>=r&&o(this.lineAt(0,ee.ByPos,i,s,r))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}},He=class n extends qs{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new st(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof n||s instanceof Dt&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Dt?s=new n(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):We.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setMeasuredHeight(s):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:\"\"}${this.widgetHeight?\":\"+this.widgetHeight:\"\"})`}},Dt=class n extends We{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new st(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new st(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==ee.ByHeight)return this.blockAt(e,i,s,r);if(t==ee.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new st(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new st(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new st(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof n?i[i.length-1]=new n(r.length+s):i.push(null,new n(s-1))}if(e>0){let r=i[0];r instanceof n?i[0]=new n(e+r.length):i.unshift(new n(e-1),null)}return We.of(i)}decomposeLeft(e,t){t.push(new n(e-1),null)}decomposeRight(e,t){t.push(null,new n(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new n(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++],u=0;f<0&&(u=-f,f=s.heights[s.index++]),a==-1?a=f:Math.abs(f-a)>=Zs&&(a=-2);let d=new He(c,f,u);d.outdated=!1,o.push(d),l+=c+1}l<=r&&o.push(null,new n(r-l).updateHeight(e,l));let h=We.of(o);return(a<0||Math.abs(h.height-this.height)>=Zs||Math.abs(a-this.heightMetrics(e,t).perLine)>=Zs)&&(_i=!0),Is(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},yl=class extends We{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,r,s+this.left.length+this.break)}lineAt(e,t,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=t==ee.ByHeight?e<o:e<l,h=a?this.left.lineAt(e,t,i,s,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?h.to<l:h.from>l))return h;let c=t==ee.ByPosNoHeight?ee.ByPosNoHeight:ee.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,s,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,ee.ByPos,i,s,r);e<h.from&&this.left.forEachLine(e,h.from-1,i,s,r,o),h.to>=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(t<s)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&uc(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),uc(r,l)}return We.of(r)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<s&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?We.of(this.break?[e,null,t]:[e,t]):(this.left=Is(this.left,e),this.right=Is(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?\" \":\"-\")+this.right}};function uc(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof Dt&&(i=n[e+1])instanceof Dt&&n.splice(e-1,3,new Dt(t.length+1+i.length))}var ym=5,xl=class n{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof He?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new He(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let s=i.widget?i.widget.estimatedHeight:0,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new qs(o,s,i)):(o||r||s>=ym)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new He(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new Dt(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof He)return e;let t=new He(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof He)&&!this.isCovered?this.nodes.push(new He(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let s of this.nodes)s instanceof He&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let r=new n(i,e);return I.spans(t,i,s,r,0),r.finish(i)}};function xm(n,e,t){let i=new bl;return I.compare(n,e,t,i,0),i.changes}var bl=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&Ri(e,t,this.changes,5)}};function bm(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(s.innerHeight,t.bottom);for(let h=n.parentNode;h&&h!=i.body;)if(h.nodeType==1){let c=h,f=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!=\"visible\"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(h==n.parentNode?s.innerHeight:a,u.bottom)}h=f.position==\"absolute\"||f.position==\"fixed\"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Sm(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function wm(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var mn=class{constructor(e,t,i,s){this.from=e,this.to=t,this.size=i,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],r=t[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,t){return R.replace({widget:new Sl(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},Sl=class extends $e{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(\"div\");return this.vertical?e.style.height=this.size+\"px\":(e.style.width=this.size+\"px\",e.style.height=\"2px\",e.style.display=\"inline-block\"),e}get estimatedHeight(){return this.vertical?this.size:-1}},Vs=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=dc,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=N.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=t.facet(ql).some(s=>typeof s!=\"function\"&&s.class==\"cm-lineWrapping\");this.heightOracle=new ml(i),this.stateDeco=pc(t),this.heightMap=We.empty().applyChanges(this.stateDeco,B.empty,this.heightOracle.setDoc(t.doc),[new rt(0,0,0,t.doc.length)]);for(let s=0;s<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());s++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=R.set(this.lineGaps.map(s=>s.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Zi(r,o))}}return this.viewports=e.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?dc:new wl(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(an(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=pc(this.state);let s=e.changedRanges,r=rt.extendWithRanges(s,xm(i,this.stateDeco,e?e.changes:Qe.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);fc(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||_i)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Hc)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction==\"rtl\"?N.RTL:N.LTR;let o=this.heightOracle.mustRefreshForWrapping(r)||this.mustMeasureContent===\"refresh\",l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:w,scaleY:v}=Rc(t,l);(w>.005&&Math.abs(this.scaleX-w)>.005||v>.005&&Math.abs(this.scaleY-v)>.005)&&(this.scaleX=w,this.scaleY=v,h|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let d=Xc(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=Ec(this.scrollParent||e.win);let O=(this.printing?wm:bm)(t,this.paddingTop),m=O.top-this.pixelViewport.top,g=O.bottom-this.pixelViewport.bottom;this.pixelViewport=O;let S=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(S!=this.inView&&(this.inView=S,S&&(a=!0)),!this.inView&&!this.scrollTarget&&!Sm(e.dom))return 0;let b=l.width;if((this.contentDOMWidth!=b||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(w)&&(o=!0),o||s.lineWrapping&&Math.abs(b-this.contentDOMWidth)>s.charWidth){let{lineHeight:v,charWidth:Q,textHeight:D}=e.docView.measureTextSize();o=v>0&&s.refresh(r,v,Q,D,Math.max(5,b/Q),w),o&&(e.docView.minWidth=0,h|=16)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),fc();for(let v of this.viewports){let Q=v.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(v);this.heightMap=(o?We.empty().applyChanges(this.stateDeco,B.empty,this.heightOracle,[new rt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new gl(v.from,Q))}_i&&(h|=2)}let A=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return A&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||A)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Zi(s.lineAt(o-i*1e3,ee.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,ee.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(h<a.from||h>a.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,ee.ByPos,r,0,0),u;t.y==\"center\"?u=(f.top+f.bottom)/2-c/2:t.y==\"start\"||t.y==\"nearest\"&&h<a.from?u=f.top:u=f.bottom-c,a=new Zi(s.lineAt(u-1e3/2,ee.ByHeight,r,0,0).from,s.lineAt(u+c+1e3/2,ee.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new Zi(this.heightMap.lineAt(i,ee.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,ee.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,ee.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,ee.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let s of e)t.touchesRange(s.from,s.to)||i.push(new mn(t.mapPos(s.from),t.mapPos(s.to),s.size,s.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=N.LTR&&!i)return[];let l=[],a=(c,f,u,d)=>{if(f-c<r)return;let p=this.state.selection.main,O=[p.from];p.empty||O.push(p.to);for(let g of O)if(g>c&&g<f){a(c,g-10,u,d),a(g+10,f,u,d);return}let m=Qm(e,g=>g.from>=u.from&&g.to<=u.to&&Math.abs(g.from-c)<r&&Math.abs(g.to-f)<r&&!O.some(S=>g.from<S&&g.to>S));if(!m){if(f<u.to&&t&&i&&t.visibleRanges.some(b=>b.from<=f&&b.to>=f)){let b=t.moveToLineBoundary(x.cursor(f),!1,!0).head;b>c&&(f=b)}let g=this.gapSize(u,c,f,d),S=i||g<2e6?g:2e6;m=new mn(c,f,g,S)}l.push(m)},h=c=>{if(c.length<o||c.type!=ge.Text)return;let f=km(c.from,c.to,this.stateDeco);if(f.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(i){let O=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,m,g;if(u!=null){let S=Qs(f,u),b=((this.visibleBottom-this.visibleTop)/2+O)/c.height;m=S-b,g=S+b}else m=(this.visibleTop-c.top-O)/c.height,g=(this.visibleBottom-c.top+O)/c.height;d=ks(f,m),p=ks(f,g)}else{let O=f.total*this.heightOracle.charWidth,m=s*this.heightOracle.charWidth,g=0;if(O>2e6)for(let v of e)v.from>=c.from&&v.from<c.to&&v.size!=v.displaySize&&v.from*this.heightOracle.charWidth+g<this.pixelViewport.left&&(g=v.size-v.displaySize);let S=this.pixelViewport.left+g,b=this.pixelViewport.right+g,A,w;if(u!=null){let v=Qs(f,u),Q=((b-S)/2+m)/O;A=v-Q,w=v+Q}else A=(S-m)/O,w=(b+m)/O;d=ks(f,A),p=ks(f,w)}d>c.from&&a(c.from,d,c,f),p<c.to&&a(p,c.to,c,f)};for(let c of this.viewportLines)Array.isArray(c.type)?c.type.forEach(h):h(c);return l}gapSize(e,t,i,s){let r=Qs(s,i)-Qs(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){mn.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=R.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];I.spans(t,this.viewport.from,this.viewport.to,{span(r,o){i.push({from:r,to:o})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let r=0;r<i.length&&!(s&8);r++){let o=this.visibleRanges[r],l=i[r];(o.from!=l.from||o.to!=l.to)&&(s|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(s|=8))}return this.visibleRanges=i,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||an(this.heightMap.lineAt(e,ee.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||an(this.heightMap.lineAt(this.scaler.fromDOM(e),ee.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return an(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},Zi=class{constructor(e,t){this.from=e,this.to=t}};function km(n,e,t){let i=[],s=n,r=0;return I.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(i.push({from:s,to:e}),r+=e-s),{total:r,ranges:i}}function ks({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Qs(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Qm(n,e){for(let t of n)if(e(t))return t}var dc={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function pc(n){let e=n.facet(Js).filter(i=>typeof i!=\"function\"),t=n.facet(Vl).filter(i=>typeof i!=\"function\");return t.length&&e.push(I.join(t)),e}var wl=class n{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,ee.ByPos,e,0,0).top,c=t.lineAt(a,ee.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return s+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,s=r.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,s=r.domBottom}}eq(e){return e instanceof n?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}};function an(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new st(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(s=>an(s,e)):n._content)}var vs=P.define({combine:n=>n.join(\" \")}),kl=P.define({combine:n=>n.indexOf(!0)>-1}),Ql=Fe.newName(),xf=Fe.newName(),bf=Fe.newName(),Sf={\"&light\":\".\"+xf,\"&dark\":\".\"+bf};function vl(n,e,t){return new Fe(e,{finish(i){return/&/.test(i)?i.replace(/&\\w*/,s=>{if(s==\"&\")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+\" \"+i}})}var vm=vl(\".\"+Ql,{\"&\":{position:\"relative !important\",boxSizing:\"border-box\",\"&.cm-focused\":{outline:\"1px dotted #212121\"},display:\"flex !important\",flexDirection:\"column\"},\".cm-scroller\":{display:\"flex !important\",alignItems:\"flex-start !important\",fontFamily:\"monospace\",lineHeight:1.4,height:\"100%\",overflowX:\"auto\",position:\"relative\",zIndex:0,overflowAnchor:\"none\"},\".cm-content\":{margin:0,flexGrow:2,flexShrink:0,display:\"block\",whiteSpace:\"pre\",wordWrap:\"normal\",boxSizing:\"border-box\",minHeight:\"100%\",padding:\"4px 0\",outline:\"none\",\"&[contenteditable=true]\":{WebkitUserModify:\"read-write-plaintext-only\"}},\".cm-lineWrapping\":{whiteSpace_fallback:\"pre-wrap\",whiteSpace:\"break-spaces\",wordBreak:\"break-word\",overflowWrap:\"anywhere\",flexShrink:1},\"&light .cm-content\":{caretColor:\"black\"},\"&dark .cm-content\":{caretColor:\"white\"},\".cm-line\":{display:\"block\",padding:\"0 2px 0 6px\"},\".cm-layer\":{position:\"absolute\",left:0,top:0,contain:\"size style\",\"& > *\":{position:\"absolute\"}},\"&light .cm-selectionBackground\":{background:\"#d9d9d9\"},\"&dark .cm-selectionBackground\":{background:\"#222\"},\"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\":{background:\"#d7d4f0\"},\"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\":{background:\"#233\"},\".cm-cursorLayer\":{pointerEvents:\"none\"},\"&.cm-focused > .cm-scroller > .cm-cursorLayer\":{animation:\"steps(1) cm-blink 1.2s infinite\"},\"@keyframes cm-blink\":{\"0%\":{},\"50%\":{opacity:0},\"100%\":{}},\"@keyframes cm-blink2\":{\"0%\":{},\"50%\":{opacity:0},\"100%\":{}},\".cm-cursor, .cm-dropCursor\":{borderLeft:\"1.2px solid black\",marginLeft:\"-0.6px\",pointerEvents:\"none\"},\".cm-cursor\":{display:\"none\"},\"&dark .cm-cursor\":{borderLeftColor:\"#ddd\"},\".cm-selectionHandle\":{backgroundColor:\"currentColor\",width:\"1.5px\"},\".cm-selectionHandle-start::before, .cm-selectionHandle-end::before\":{content:'\"\"',backgroundColor:\"inherit\",borderRadius:\"50%\",width:\"8px\",height:\"8px\",position:\"absolute\",left:\"-3.25px\"},\".cm-selectionHandle-start::before\":{top:\"-8px\"},\".cm-selectionHandle-end::before\":{bottom:\"-8px\"},\".cm-dropCursor\":{position:\"absolute\"},\"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor\":{display:\"block\"},\".cm-iso\":{unicodeBidi:\"isolate\"},\".cm-announced\":{position:\"fixed\",top:\"-10000px\"},\"@media print\":{\".cm-announced\":{display:\"none\"}},\"&light .cm-activeLine\":{backgroundColor:\"#cceeff44\"},\"&dark .cm-activeLine\":{backgroundColor:\"#99eeff33\"},\"&light .cm-specialChar\":{color:\"red\"},\"&dark .cm-specialChar\":{color:\"#f78\"},\".cm-gutters\":{flexShrink:0,display:\"flex\",height:\"100%\",boxSizing:\"border-box\",zIndex:200},\".cm-gutters-before\":{insetInlineStart:0},\".cm-gutters-after\":{insetInlineEnd:0},\"&light .cm-gutters\":{backgroundColor:\"#f5f5f5\",color:\"#6c6c6c\",border:\"0px solid #ddd\",\"&.cm-gutters-before\":{borderRightWidth:\"1px\"},\"&.cm-gutters-after\":{borderLeftWidth:\"1px\"}},\"&dark .cm-gutters\":{backgroundColor:\"#333338\",color:\"#ccc\"},\".cm-gutter\":{display:\"flex !important\",flexDirection:\"column\",flexShrink:0,boxSizing:\"border-box\",minHeight:\"100%\",overflow:\"hidden\"},\".cm-gutterElement\":{boxSizing:\"border-box\"},\".cm-lineNumbers .cm-gutterElement\":{padding:\"0 3px 0 5px\",minWidth:\"20px\",textAlign:\"right\",whiteSpace:\"nowrap\"},\"&light .cm-activeLineGutter\":{backgroundColor:\"#e2f2ff\"},\"&dark .cm-activeLineGutter\":{backgroundColor:\"#222227\"},\".cm-panels\":{boxSizing:\"border-box\",position:\"sticky\",left:0,right:0,zIndex:300},\"&light .cm-panels\":{backgroundColor:\"#f5f5f5\",color:\"black\"},\"&light .cm-panels-top\":{borderBottom:\"1px solid #ddd\"},\"&light .cm-panels-bottom\":{borderTop:\"1px solid #ddd\"},\"&dark .cm-panels\":{backgroundColor:\"#333338\",color:\"white\"},\".cm-dialog\":{padding:\"2px 19px 4px 6px\",position:\"relative\",\"& label\":{fontSize:\"80%\"}},\".cm-dialog-close\":{position:\"absolute\",top:\"3px\",right:\"4px\",backgroundColor:\"inherit\",border:\"none\",font:\"inherit\",fontSize:\"14px\",padding:\"0\"},\".cm-tab\":{display:\"inline-block\",overflow:\"hidden\",verticalAlign:\"bottom\"},\".cm-widgetBuffer\":{verticalAlign:\"text-top\",height:\"1em\",width:0,display:\"inline\"},\".cm-placeholder\":{color:\"#888\",display:\"inline-block\",verticalAlign:\"top\",userSelect:\"none\"},\".cm-highlightSpace\":{backgroundImage:\"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)\",backgroundPosition:\"center\"},\".cm-highlightTab\":{backgroundImage:`url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"20\"><path stroke=\"%23888\" stroke-width=\"1\" fill=\"none\" d=\"M1 10H196L190 5M190 15L196 10M197 4L197 16\"/></svg>')`,backgroundSize:\"auto 100%\",backgroundPosition:\"right 90%\",backgroundRepeat:\"no-repeat\"},\".cm-trailingSpace\":{backgroundColor:\"#ff332255\"},\".cm-button\":{verticalAlign:\"middle\",color:\"inherit\",fontSize:\"70%\",padding:\".2em 1em\",borderRadius:\"1px\"},\"&light .cm-button\":{backgroundImage:\"linear-gradient(#eff1f5, #d9d9df)\",border:\"1px solid #888\",\"&:active\":{backgroundImage:\"linear-gradient(#b4b4b4, #d0d3d6)\"}},\"&dark .cm-button\":{backgroundImage:\"linear-gradient(#393939, #111)\",border:\"1px solid #888\",\"&:active\":{backgroundImage:\"linear-gradient(#111, #333)\"}},\".cm-textfield\":{verticalAlign:\"middle\",color:\"inherit\",fontSize:\"70%\",border:\"1px solid silver\",padding:\".2em .5em\"},\"&light .cm-textfield\":{backgroundColor:\"white\"},\"&dark .cm-textfield\":{border:\"1px solid #555\",backgroundColor:\"inherit\"}},Sf),$m={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},_o=Z.ie&&Z.ie_version<=11,$l=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Uo,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(Z.ie&&Z.ie_version<=11||Z.ios&&e.composing)&&t.some(i=>i.type==\"childList\"&&i.removedNodes.length||i.type==\"characterData\"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Z.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Z.chrome&&Z.chrome_version<126)&&(this.editContext=new Pl(e),e.state.facet(vt)&&(e.contentDOM.editContext=this.editContext.editContext)),_o&&(this.onCharData=t=>{this.queue.push({target:t.target,type:\"characterData\",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(\"print\")),typeof ResizeObserver==\"function\"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==\"function\"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(\"Event\")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(\"Event\"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(\"scroll\",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==\"change\"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(vt)?i.root.activeElement!=this.dom:!cn(this.dom,s))return;let r=s.anchorNode&&i.docView.tile.nearest(s.anchorNode);if(r&&r.isWidget()&&r.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Z.ie&&Z.ie_version<=11||Z.android&&Z.chrome)&&!i.state.selection.main.empty&&s.focusNode&&fn(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Sn(e.root);if(!t)return!1;let i=Z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Pm(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let s=cn(this.dom,i);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&wO(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener(\"scroll\",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener(\"scroll\",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,$m),_o&&this.dom.addEventListener(\"DOMCharacterDataModified\",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),_o&&this.dom.removeEventListener(\"DOMCharacterDataModified\",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let s=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Xi(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e==\"Enter\")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&cn(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new ul(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,s=hf(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!Ys(this.view.state.selection,t.newSel.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==\"attributes\"),e.type==\"childList\"){let i=Oc(t,e.previousSibling||e.target.previousSibling,-1),s=Oc(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type==\"characterData\"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(\"resize\",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(\"change\",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(\"beforeprint\",this.onPrint),e.addEventListener(\"scroll\",this.onScroll),e.document.addEventListener(\"selectionchange\",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(\"scroll\",this.onScroll),e.removeEventListener(\"resize\",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(\"change\",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(\"beforeprint\",this.onPrint),e.document.removeEventListener(\"selectionchange\",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(vt)!=e.state.facet(vt)&&(e.view.contentDOM.editContext=e.state.facet(vt)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener(\"scroll\",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function Oc(n,e,t){for(;e;){let i=te.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function mc(n,e){let t=e.startContainer,i=e.startOffset,s=e.endContainer,r=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor,1);return fn(o.node,o.offset,s,r)&&([t,i,s,r]=[s,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}}function Pm(n,e){if(e.getComposedRanges){let s=e.getComposedRanges(n.root)[0];if(s)return mc(n,s)}let t=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return n.contentDOM.addEventListener(\"beforeinput\",i,!0),n.dom.ownerDocument.execCommand(\"indent\"),n.contentDOM.removeEventListener(\"beforeinput\",i,!0),t?mc(n,t):null}var Pl=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let s=e.state.selection.main,{anchor:r,head:o}=s,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let h=a-l>i.text.length;l==this.from&&r<this.from?l=r:a==this.to&&r>this.to&&(a=r);let c=cf(e.state.sliceDoc(l,a),i.text,(h?s.from:s.to)-l,h?\"end\":null);if(!c){let u=x.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Ys(u,s)||e.dispatch({selection:u,userEvent:\"select\"});return}let f={from:c.from+l,to:c.toA+l,insert:B.of(i.text.slice(c.from,c.toB).split(`\n`))};if((Z.mac||Z.android)&&f.from==o-1&&/^\\. ?$/.test(i.text)&&e.contentDOM.getAttribute(\"autocorrect\")==\"off\"&&(f={from:l,to:a,insert:B.of([i.text.replace(\".\",\" \")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Nl(e,f,x.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\\\p{Alphabetic}\\\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(r.rangeStart),h=this.toEditorPos(r.rangeEnd);if(a<h){let c=`text-decoration: underline ${/^[a-z]/.test(o)?o+\" \":o==\"Dashed\"?\"dashed \":o==\"Squiggle\"?\"wavy \":\"\"}${/thin/i.test(l)?1:2}px`;s.push(R.mark({attributes:{style:c}}).range(a,h))}}}e.dispatch({effects:Jc.of(R.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=Sn(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let c=h.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(h)){s=this.pendingContextChange=null,t+=c,this.to+=c;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(s=>!s.isUserEvent(\"input.type\")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},T=class n{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(\"div\"),this.scrollDOM=document.createElement(\"div\"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=\"cm-scroller\",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(\"div\"),this.announceDOM.className=\"cm-announced\",this.announceDOM.setAttribute(\"aria-live\",\"polite\"),this.dom=document.createElement(\"div\"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(s=>s.forEach(r=>i(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||SO(e.parent)||document,this.viewState=new Vs(this,e.state||H.create(e)),e.scrollTo&&e.scrollTo.is(bs)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ci).map(s=>new dn(s));for(let s of this.plugins)s.update(this);this.observer=new $l(this),this.inputState=new dl(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Ws(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=\"refresh\",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof ae?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error(\"Calls to EditorView.update are not allowed while an update is in progress\");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError(\"Trying to update state with a transaction that doesn't start from the previous state.\");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(mf))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=gf(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);s=zs.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new un(d.empty?d:x.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(bs)&&(f=d.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=js.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ln)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent(\"select.pointer\")))}finally{this.updateState=0}if(s.startState.facet(vs)!=s.state.facet(vs)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(Jo))try{u(s)}catch(d){me(this.state,d,\"update listener\")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!hf(this,c)&&h.force&&Xi(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error(\"Calls to EditorView.setState are not allowed while an update is in progress\");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Vs(this,e),this.plugins=e.facet(Ci).map(i=>new dn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Ws(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ci),i=e.state.facet(Ci);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new dn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){me(this.state,i,\"doc view update listener\")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,s=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Ec(i||this.win))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?\"Measure loop restarted more than 5 times\":\"Viewport failed to stabilize\");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return me(this.state,p),gc}}),f=zs.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d<h.length;d++)if(c[d]!=gc)try{let p=h[d];p.write&&p.write(c[d],this)}catch(p){me(this.state,p)}if(u&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=((r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o)/this.scaleY;if((p>1||p<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){s=s+p,i?i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Jo))l(t)}get themeClasses(){return Ql+\" \"+(this.state.facet(kl)?bf:xf)+\" \"+this.state.facet(vs)}updateAttrs(){let e=yc(this,ef,{class:\"cm-editor\"+(this.hasFocus?\" cm-focused \":\" \")+this.themeClasses}),t={spellcheck:\"false\",autocorrect:\"off\",autocapitalize:\"off\",writingsuggestions:\"false\",translate:\"no\",contenteditable:this.state.facet(vt)?\"true\":\"false\",class:\"cm-content\",style:`${Z.tabSize}: ${this.state.tabSize}`,role:\"textbox\",\"aria-multiline\":\"true\"};this.state.readOnly&&(t[\"aria-readonly\"]=\"true\"),yc(this,ql,t);let i=this.observer.ignore(()=>{let s=Fh(this.contentDOM,this.contentAttrs,t),r=Fh(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(n.announce)){t&&(this.announceDOM.textContent=\"\"),t=!1;let r=this.announceDOM.appendChild(document.createElement(\"div\"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ln);let e=this.state.facet(n.cspNonce);Fe.mount(this.root,this.styleModules.concat(vm).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error(\"Reading the editor layout isn't allowed during an update\");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return zo(this,e,ic(this,e,t,i))}moveByGroup(e,t){return zo(this,e,ic(this,e,t,i=>FO(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return x.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,i=!0){return UO(this,e,t,i)}moveVertically(e,t,i){return zo(this,e,HO(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=hl(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),hl(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[Je.find(r,e-s.from,-1,t)];return Ds(i,o.dir==N.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Fc)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Tm)return Yc(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Bc(r.isolates,i=Jh(this,e))))return r.order;i||(i=Jh(this,e));let s=CO(e.text,t,i);return this.bidiCache.push(new js(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Z.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Lc(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return bs.of(new un(typeof e==\"number\"?x.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return bs.of(new un(x.cursor(i.from),\"start\",\"start\",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==\"boolean\"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ie.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ie.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Fe.newName(),s=[vs.of(i),ln.of(vl(`.${i}`,e))];return t&&t.dark&&s.push(kl.of(!0)),s}static baseTheme(e){return Ue.lowest(ln.of(vl(\".\"+Ql,e,Sf)))}static findFromDOM(e){var t;let i=e.querySelector(\".cm-content\"),s=i&&te.get(i)||te.get(e);return((t=s?.root)===null||t===void 0?void 0:t.view)||null}};T.styleModule=ln;T.inputHandler=Gc;T.clipboardInputFilter=Yl;T.clipboardOutputFilter=Il;T.scrollHandler=Kc;T.focusChangeEffect=Uc;T.perLineTextDirection=Fc;T.exceptionSink=Nc;T.updateListener=Jo;T.editable=vt;T.mouseSelectionStyle=jc;T.dragMovesSelection=Vc;T.clickAddsSelectionRange=qc;T.decorations=Js;T.blockWrappers=tf;T.outerDecorations=Vl;T.atomicRanges=kn;T.bidiIsolatedRanges=nf;T.scrollMargins=sf;T.darkTheme=kl;T.cspNonce=P.define({combine:n=>n.length?n[0]:\"\"});T.contentAttributes=ql;T.editorAttributes=ef;T.lineWrapping=T.contentAttributes.of({class:\"cm-lineWrapping\"});T.announce=E.define();var Tm=4096,gc={},js=class n{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:N.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!t.touchesRange(o.from,o.to)&&i.push(new n(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function yc(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r==\"function\"?r(n):r;o&&_l(o,t)}return t}var Cm=Z.mac?\"mac\":Z.windows?\"win\":Z.linux?\"linux\":\"key\";function Zm(n,e){let t=n.split(/-(?!$)/),i=t[t.length-1];i==\"Space\"&&(i=\" \");let s,r,o,l;for(let a=0;a<t.length-1;++a){let h=t[a];if(/^(cmd|meta|m)$/i.test(h))l=!0;else if(/^a(lt)?$/i.test(h))s=!0;else if(/^(c|ctrl|control)$/i.test(h))r=!0;else if(/^s(hift)?$/i.test(h))o=!0;else if(/^mod$/i.test(h))e==\"mac\"?l=!0:r=!0;else throw new Error(\"Unrecognized modifier name: \"+h)}return s&&(i=\"Alt-\"+i),r&&(i=\"Ctrl-\"+i),l&&(i=\"Meta-\"+i),o&&(i=\"Shift-\"+i),i}function $s(n,e,t){return e.altKey&&(n=\"Alt-\"+n),e.ctrlKey&&(n=\"Ctrl-\"+n),e.metaKey&&(n=\"Meta-\"+n),t!==!1&&e.shiftKey&&(n=\"Shift-\"+n),n}var Am=Ue.default(T.domEventHandlers({keydown(n,e){return Qf(wf(e.state),n,e,\"editor\")}})),Bi=P.define({enables:Am}),xc=new WeakMap;function wf(n){let e=n.facet(Bi),t=xc.get(e);return t||xc.set(e,t=Rm(e.reduce((i,s)=>i.concat(s),[]))),t}function kf(n,e,t){return Qf(wf(n.state),e,n,t)}var Et=null,Mm=4e3;function Rm(n,e=Cm){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error(\"Key binding \"+o+\" is used both as a regular binding and as a multi-stroke prefix\")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(g=>Zm(g,e));for(let g=1;g<p.length;g++){let S=p.slice(0,g).join(\" \");s(S,!0),d[S]||(d[S]={preventDefault:!0,stopPropagation:!1,run:[b=>{let A=Et={view:b,prefix:S,scope:o};return setTimeout(()=>{Et==A&&(Et=null)},Mm),!0}]})}let O=p.join(\" \");s(O,!1);let m=d[O]||(d[O]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0),c&&(m.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(\" \"):[\"editor\"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,Tl))}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,\"Shift-\"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}var Tl=null;function Qf(n,e,t,i){Tl=e;let s=Vh(e),r=Oe(s,0),o=_e(r)==s.length&&s!=\" \",l=\"\",a=!1,h=!1,c=!1;Et&&Et.view==t&&Et.scope==i&&(l=Et.prefix+\" \",uf.indexOf(e.keyCode)<0&&(h=!0,Et=null));let f=new Set,u=m=>{if(m){for(let g of m.run)if(!f.has(g)&&(f.add(g),g(t)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,O;return d&&(u(d[l+$s(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Z.windows&&e.ctrlKey&&e.altKey)&&!(Z.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=Qt[e.keyCode])&&p!=s?(u(d[l+$s(p,e,!0)])||e.shiftKey&&(O=Pi[e.keyCode])!=s&&O!=p&&u(d[l+$s(O,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+$s(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),Tl=null,a}var ri=class n{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement(\"div\");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+\"px\",e.style.top=this.top+\"px\",this.width!=null&&(e.style.width=this.width+\"px\"),e.style.height=this.height+\"px\"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=vf(e);return[new n(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Xm(e,t,i)}};function vf(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==N.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function bc(n,e,t,i){let s=n.coordsAtPos(e,t*2);if(!s)return i;let r=n.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=n.posAtCoords({x:r.left+1,y:o}),a=n.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function Xm(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==N.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=vf(n),h=o.querySelector(\".cm-line\"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=al(n,i,1),p=al(n,s,-1),O=d.type==ge.Text?d:null,m=p.type==ge.Text?p:null;if(O&&(n.lineWrapping||d.widgetLineBreaks)&&(O=bc(n,i,1,O)),m&&(n.lineWrapping||p.widgetLineBreaks)&&(m=bc(n,s,-1,m)),O&&m&&O.from==m.from&&O.to==m.to)return S(b(t.from,t.to,O));{let w=O?b(t.from,null,O):A(d,!1),v=m?b(null,t.to,m):A(p,!0),Q=[];return(O||d).to<(m||p).from-(O&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+n.defaultLineHeight/2<v.top?Q.push(g(f,w.bottom,u,v.top)):w.bottom<v.top&&n.elementAtHeight((w.bottom+v.top)/2).type==ge.Text&&(w.bottom=v.top=(w.bottom+v.top)/2),S(w).concat(Q).concat(S(v))}function g(w,v,Q,D){return new ri(e,w-a.left,v-a.top,Math.max(0,Q-w),D-v)}function S({top:w,bottom:v,horizontal:Q}){let D=[];for(let W=0;W<Q.length;W+=2)D.push(g(Q[W],w,Q[W+1],v));return D}function b(w,v,Q){let D=1e9,W=-1e9,G=[];function _(q,j,fe,ye,qe){let oe=n.coordsAtPos(q,q==Q.to?-2:2),Te=n.coordsAtPos(fe,fe==Q.from?2:-2);!oe||!Te||(D=Math.min(oe.top,Te.top,D),W=Math.max(oe.bottom,Te.bottom,W),qe==N.LTR?G.push(r&&j?f:oe.left,r&&ye?u:Te.right):G.push(!r&&ye?f:Te.left,!r&&j?u:oe.right))}let X=w??Q.from,Y=v??Q.to;for(let q of n.visibleRanges)if(q.to>X&&q.from<Y)for(let j=Math.max(q.from,X),fe=Math.min(q.to,Y);;){let ye=n.state.doc.lineAt(j);for(let qe of n.bidiSpans(ye)){let oe=qe.from+ye.from,Te=qe.to+ye.from;if(oe>=fe)break;Te>j&&_(Math.max(oe,j),w==null&&oe<=X,Math.min(Te,fe),v==null&&Te>=Y,qe.dir)}if(j=ye.to+1,j>=fe)break}return G.length==0&&_(X,w==null,Y,v==null,n.textDirection),{top:D,bottom:W,horizontal:G}}function A(w,v){let Q=l.top+(v?w.top:w.bottom);return{top:Q,bottom:Q,horizontal:[]}}}function Lm(n,e){return n.constructor==e.constructor&&n.eq(e)}var Cl=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(\"div\")),this.dom.classList.add(\"cm-layer\"),t.above&&this.dom.classList.add(\"cm-layer-above\"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(\"aria-hidden\",\"true\"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(As)!=e.state.facet(As)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(As);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,i)=>!Lm(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e,Z.safari&&Z.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?\"\":\"none\")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},As=P.define();function $f(n){return[ie.define(e=>new Cl(e,n)),As.of(n)]}var Wi=P.define({combine(n){return be(n,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Pf(n={}){return[Wi.of(n),Em,Dm,zm,Hc.of(!0)]}function Tf(n){return n.startState.facet(Wi)!=n.state.facet(Wi)}var Em=$f({above:!0,markers(n){let{state:e}=n,t=e.facet(Wi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty||t.drawRangeCursor&&!(r&&Z.ios&&t.iosSelectionHandles)){let o=r?\"cm-cursor cm-cursor-primary\":\"cm-cursor cm-cursor-secondary\",l=s.empty?s:x.cursor(s.head,s.assoc);for(let a of ri.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName==\"cm-blink\"?\"cm-blink2\":\"cm-blink\");let t=Tf(n);return t&&Sc(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){Sc(e.state,n)},class:\"cm-cursorLayer\"});function Sc(n,e){e.style.animationDuration=n.facet(Wi).cursorBlinkRate+\"ms\"}var Dm=$f({above:!1,markers(n){let e=[],{main:t,ranges:i}=n.state.selection;for(let s of i)if(!s.empty)for(let r of ri.forRange(n,\"cm-selectionBackground\",s))e.push(r);if(Z.ios&&!t.empty&&n.state.facet(Wi).iosSelectionHandles){for(let s of ri.forRange(n,\"cm-selectionHandle cm-selectionHandle-start\",x.cursor(t.from,1)))e.push(s);for(let s of ri.forRange(n,\"cm-selectionHandle cm-selectionHandle-end\",x.cursor(t.to,1)))e.push(s)}return e},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Tf(n)},class:\"cm-selectionLayer\"}),zm=Ue.highest(T.theme({\".cm-line\":{\"& ::selection, &::selection\":{backgroundColor:\"transparent !important\"},caretColor:\"transparent !important\"},\".cm-content\":{caretColor:\"transparent !important\",\"& :focus\":{caretColor:\"initial !important\",\"&::selection, & ::selection\":{backgroundColor:\"Highlight !important\"}}}})),Cf=E.define({map(n,e){return n==null?null:e.mapPos(n)}}),hn=ne.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Cf)?i.value:t,n)}}),_m=ie.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(hn);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(\"div\")),this.cursor.className=\"cm-dropCursor\"),(n.startState.field(hn)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(hn),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+\"px\",this.cursor.style.top=n.top/t+\"px\",this.cursor.style.height=n.height/t+\"px\"):this.cursor.style.left=\"-100000px\"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(hn)!=n&&this.view.dispatch({effects:Cf.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Zf(){return[hn,_m]}function wc(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function Wm(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}var Zl=class{constructor(e){let{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError(\"The regular expression given to MatchDecorator should have its 'g' flag set\");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i==\"function\")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError(\"Either 'decorate' or 'decoration' should be provided to MatchDecorator\");this.boundary=r,this.maxLength=o}createDeco(e){let t=new ze,i=t.add.bind(t);for(let{from:s,to:r}of Wm(e,this.maxLength))wc(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(i=Math.min(l,i),s=Math.max(a,s))}),e.viewportMoved||s-i>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>=o){let a=e.state.doc.lineAt(o),h=a.to<l?e.state.doc.lineAt(l):a,c=Math.max(r.from,a.from),f=Math.min(r.to,h.to);if(this.boundary){for(;o>a.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;l<h.to;l++)if(this.boundary.test(h.text[l-h.from])){f=l;break}}let u=[],d,p=(O,m,g)=>u.push(g.range(O,m));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.index<f-a.from;)this.addMatch(d,e,d.index+a.from,p);else wc(e.state.doc,this.regexp,c,f,(O,m)=>this.addMatch(m,e,O,p));t=t.update({filterFrom:c,filterTo:f,filter:(O,m)=>O<c||m>f,add:u})}}return t}},Al=/x/.unicode!=null?\"gu\":\"g\",Bm=new RegExp(`[\\0-\\b\n-\u001f\\x7F-\\x9F\\xAD\\u061C\\u200B\\u200E\\u200F\\u2028\\u2029\\u202D\\u202E\\u2066\\u2067\\u2069\\uFEFF\\uFFF9-\\uFFFC]`,Al),Ym={0:\"null\",7:\"bell\",8:\"backspace\",10:\"newline\",11:\"vertical tab\",13:\"carriage return\",27:\"escape\",8203:\"zero width space\",8204:\"zero width non-joiner\",8205:\"zero width joiner\",8206:\"left-to-right mark\",8207:\"right-to-left mark\",8232:\"line separator\",8237:\"left-to-right override\",8238:\"right-to-left override\",8294:\"left-to-right isolate\",8295:\"right-to-left isolate\",8297:\"pop directional isolate\",8233:\"paragraph separator\",65279:\"zero width no-break space\",65532:\"object replacement\"},Wo=null;function Im(){var n;if(Wo==null&&typeof document<\"u\"&&document.body){let e=document.body.style;Wo=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Wo||!1}var Ms=P.define({combine(n){let e=be(n,{render:null,specialChars:Bm,addSpecialChars:null});return(e.replaceTabs=!Im())&&(e.specialChars=new RegExp(\"\t|\"+e.specialChars.source,Al)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+\"|\"+e.addSpecialChars.source,Al)),e}});function Af(n={}){return[Ms.of(n),qm()]}var kc=null;function qm(){return kc||(kc=ie.fromClass(class{constructor(n){this.view=n,this.decorations=R.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ms)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Zl({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=Oe(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=kt(o.text,l,i-o.from);return R.replace({widget:new Rl((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=R.replace({widget:new Ml(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ms);n.startState.facet(Ms)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}var Vm=\"\\u2022\";function jm(n){return n>=32?Vm:n==10?\"\\u2424\":String.fromCharCode(9216+n)}var Ml=class extends $e{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=jm(this.code),i=e.state.phrase(\"Control character\")+\" \"+(Ym[this.code]||\"0x\"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement(\"span\");return r.textContent=t,r.title=i,r.setAttribute(\"aria-label\",i),r.className=\"cm-specialChar\",r}ignoreEvent(){return!1}},Rl=class extends $e{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(\"span\");return e.textContent=\"\t\",e.className=\"cm-tab\",e.style.width=this.width+\"px\",e}ignoreEvent(){return!1}};function Mf(){return Gm}var Nm=R.line({class:\"cm-activeLine\"}),Gm=ie.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(Nm.range(s.from)),e=s.from)}return R.set(t)}},{decorations:n=>n.decorations});var Xl=2e3;function Um(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Xl||t.off>Xl||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(x.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=ys(h.text,o,n.tabSize,!0);if(c<0)r.push(x.cursor(h.to));else{let f=ys(h.text,l,n.tabSize);r.push(x.range(h.from+c,h.from+f))}}}return r}function Fm(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Qc(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Xl?-1:s==i.length?Fm(n,e.clientX):kt(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Hm(n,e){let t=Qc(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=Qc(n,s);if(!l)return i;let a=Um(n.state,t,l);return a.length?o?x.create(a.concat(i.ranges)):x.create(a):i}}:null}function Rf(n){let e=n?.eventFilter||(t=>t.altKey&&t.button==0);return T.mouseSelectionStyle.of((t,i)=>e(i)?Hm(t,i):null)}var Km={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},Jm={style:\"cursor: crosshair\"};function Xf(n={}){let[e,t]=Km[n.key||\"Alt\"],i=ie.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[i,T.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?Jm:null})]}var Ps=\"-10000px\",Ns=class{constructor(e,t,i,s){this.facet=t,this.createTooltipView=i,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(e,t){var i;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;a<r.length;a++){let h=r[a],c=-1;if(h){for(let f=0;f<this.tooltips.length;f++){let u=this.tooltips[f];u&&u.create==h.create&&(c=f)}if(c<0)o[a]=this.createTooltipView(h,a?o[a-1]:null),l&&(l[a]=!!h.above);else{let f=o[a]=this.tooltipViews[c];l&&(l[a]=t[c]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return t&&(l.forEach((a,h)=>t[h]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}};function eg(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var Bo=P.define({combine:n=>{var e,t,i;return{position:Z.ios?\"absolute\":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||\"fixed\",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||eg}}}),vc=new WeakMap,Gl=ie.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Bo);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==\"function\"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ns(n,Qn,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver==\"function\"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener(\"resize\",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(\"div\"),this.container.style.position=\"relative\",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Bo);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add(\"cm-tooltip\"),n.arrow&&!t.dom.querySelector(\".cm-tooltip > .cm-tooltip-arrow\")){let s=document.createElement(\"div\");s.className=\"cm-tooltip-arrow\",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=Ps,t.dom.style.left=\"0px\",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener(\"resize\",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position==\"fixed\"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(Z.safari){let o=r.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!r.offsetParent&&r.offsetParent!=this.container.ownerDocument.body}if(t||this.position==\"absolute\")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(n=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),s=jl(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Bo).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position=\"absolute\";for(let l of this.manager.tooltipViews)l.dom.style.position=\"absolute\"}let{visible:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],h=this.manager.tooltipViews[l],{dom:c}=h,f=n.pos[l],u=n.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(t.top,i.top)||f.top>=Math.min(t.bottom,i.bottom)||f.right<Math.max(t.left,i.left)-.1||f.left>Math.min(t.right,i.right)+.1)){c.style.top=Ps;continue}let d=a.arrow?h.dom.querySelector(\".cm-tooltip-arrow\"):null,p=d?7:0,O=u.right-u.left,m=(e=vc.get(h))!==null&&e!==void 0?e:u.bottom-u.top,g=h.offset||ig,S=this.view.textDirection==N.LTR,b=u.width>i.right-i.left?S?i.left:i.right-u.width:S?Math.max(i.left,Math.min(f.left-(d?14:0)+g.x,i.right-O)):Math.min(Math.max(i.left,f.left-O+(d?14:0)-g.x),i.right-O),A=this.above[l];!a.strictSide&&(A?f.top-m-p-g.y<i.top:f.bottom+m+p+g.y>i.bottom)&&A==i.bottom-f.bottom>f.top-i.top&&(A=this.above[l]=!A);let w=(A?f.top-i.top:i.bottom-f.bottom)-p;if(w<m&&h.resize!==!1){if(w<this.view.defaultLineHeight){c.style.top=Ps;continue}vc.set(h,m),c.style.height=(m=w)/r+\"px\"}else c.style.height&&(c.style.height=\"\");let v=A?f.top-m-p-g.y:f.bottom+p+g.y,Q=b+O;if(h.overlap!==!0)for(let D of o)D.left<Q&&D.right>b&&D.top<v+m&&D.bottom>v&&(v=A?D.top-m-2-p:D.bottom+p+2);if(this.position==\"absolute\"?(c.style.top=(v-n.parent.top)/r+\"px\",$c(c,(b-n.parent.left)/s)):(c.style.top=v/r+\"px\",$c(c,b/s)),d){let D=f.left+(S?g.x:-g.x)-(b+14-7);d.style.left=D/s+\"px\"}h.overlap!==!0&&o.push({left:b,top:v,right:Q,bottom:v+m}),c.classList.toggle(\"cm-tooltip-above\",A),c.classList.toggle(\"cm-tooltip-below\",!A),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Ps}},{eventObservers:{scroll(){this.maybeMeasure()}}});function $c(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+\"px\")}var tg=T.baseTheme({\".cm-tooltip\":{zIndex:500,boxSizing:\"border-box\"},\"&light .cm-tooltip\":{border:\"1px solid #bbb\",backgroundColor:\"#f5f5f5\"},\"&light .cm-tooltip-section:not(:first-child)\":{borderTop:\"1px solid #bbb\"},\"&dark .cm-tooltip\":{backgroundColor:\"#333338\",color:\"white\"},\".cm-tooltip-arrow\":{height:\"7px\",width:\"14px\",position:\"absolute\",zIndex:-1,overflow:\"hidden\",\"&:before, &:after\":{content:\"''\",position:\"absolute\",width:0,height:0,borderLeft:\"7px solid transparent\",borderRight:\"7px solid transparent\"},\".cm-tooltip-above &\":{bottom:\"-7px\",\"&:before\":{borderTop:\"7px solid #bbb\"},\"&:after\":{borderTop:\"7px solid #f5f5f5\",bottom:\"1px\"}},\".cm-tooltip-below &\":{top:\"-7px\",\"&:before\":{borderBottom:\"7px solid #bbb\"},\"&:after\":{borderBottom:\"7px solid #f5f5f5\",top:\"1px\"}}},\"&dark .cm-tooltip .cm-tooltip-arrow\":{\"&:before\":{borderTopColor:\"#333338\",borderBottomColor:\"#333338\"},\"&:after\":{borderTopColor:\"transparent\",borderBottomColor:\"transparent\"}}}),ig={x:0,y:0},Qn=P.define({enables:[Gl,tg]}),Gs=P.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])}),Us=class n{static create(e){return new n(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(\"div\"),this.dom.classList.add(\"cm-tooltip-hover\"),this.manager=new Ns(e,Gs,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add(\"cm-tooltip-section\"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let s=i[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp(\"offset\")}get getCoords(){return this.passProp(\"getCoords\")}get overlap(){return this.passProp(\"overlap\")}get resize(){return this.passProp(\"resize\")}},ng=Qn.compute([Gs],n=>{let e=n.facet(Gs);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:Us.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),Ll=class{constructor(e,t,i,s,r){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(\"mouseleave\",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(\"mousemove\",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let s,r=1;if(i.isWidget())s=i.posAtStart;else{if(s=e.posAtCoords(t),s==null)return;let l=e.coordsAtPos(s);if(!l||t.y<l.top||t.y>l.bottom||t.x<l.left-e.defaultCharacterWidth||t.x>l.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(c=>c.from<=s&&c.to>=s),h=a&&a.dir==N.RTL?-1:1;r=t.x<l.left?-h:h}let o=this.source(e,s,r);if(o?.then){let l=this.pending={pos:s};o.then(a=>{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>me(e.state,a,\"hover tooltip\"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Gl),t=e?e.manager.tooltips.findIndex(i=>i.create==Us.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:r}=this;if(s.length&&r&&!sg(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(i=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!rg(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener(\"mouseleave\",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(\"mouseleave\",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(\"mouseleave\",this.mouseleave),this.view.dom.removeEventListener(\"mousemove\",this.mousemove)}},Ts=4;function sg(n,e){let{left:t,right:i,top:s,bottom:r}=n.getBoundingClientRect(),o;if(o=n.querySelector(\".cm-tooltip-arrow\")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=t-Ts&&e.clientX<=i+Ts&&e.clientY>=s-Ts&&e.clientY<=r+Ts}function rg(n,e,t,i,s,r){let o=n.scrollDOM.getBoundingClientRect(),l=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>i||o.right<i||o.top>s||Math.min(o.bottom,l)<s)return!1;let a=n.posAtCoords({x:i,y:s},!1);return a>=e&&a<=t}function Lf(n,e={}){let t=E.define(),i=ne.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let a=r.changes.mapPos(l.pos,-1,ce.TrackDel);if(a!=null){let h=Object.assign(Object.create(null),l);h.pos=a,h.end!=null&&(h.end=r.changes.mapPos(h.end)),o.push(h)}}s=o}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(og)&&(s=[]);return s},provide:s=>Gs.from(s)});return{active:i,extension:[i,ie.define(s=>new Ll(s,n,i,t,e.hoverTime||300)),ng]}}function Ul(n,e){let t=n.plugin(Gl);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}var og=E.define();var Pc=P.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function vn(n,e){let t=n.plugin(Ef),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}var Ef=ie.fromClass(class{constructor(n){this.input=n.state.facet(hi),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Pc);this.top=new Ai(n,!0,e.topContainer),this.bottom=new Ai(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add(\"cm-panel\"),t.mount&&t.mount()}update(n){let e=n.state.facet(Pc);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ai(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ai(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(hi);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add(\"cm-panel\"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>T.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})}),Ai=class{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes=\"\",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement(\"div\"),this.dom.className=this.top?\"cm-panels cm-panels-top\":\"cm-panels cm-panels-bottom\",this.dom.style[this.top?\"top\":\"bottom\"]=\"0\";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Tc(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Tc(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(\" \"))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(\" \"))e&&this.container.classList.add(e)}}};function Tc(n){let e=n.nextSibling;return n.remove(),e}var hi=P.define({enables:Ef});function Df(n,e){let t,i=new Promise(o=>t=o),s=o=>lg(o,e,t);n.state.field(Yo,!1)?n.dispatch({effects:zf.of(s)}):n.dispatch({effects:E.appendConfig.of(Yo.init(()=>[s]))});let r=_f.of(s);return{close:r,result:i.then(o=>((n.win.queueMicrotask||(a=>n.win.setTimeout(a,10)))(()=>{n.state.field(Yo).indexOf(s)>-1&&n.dispatch({effects:r})}),o))}}var Yo=ne.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(zf)?n=[t.value].concat(n):t.is(_f)&&(n=n.filter(i=>i!=t.value));return n},provide:n=>hi.computeN([n],e=>e.field(n))}),zf=E.define(),_f=E.define();function lg(n,e,t){let i=e.content?e.content(n,()=>o(null)):null;if(!i){if(i=V(\"form\"),e.input){let l=V(\"input\",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add(\"cm-textfield\"),l.name||(l.name=\"input\"),i.appendChild(V(\"label\",(e.label||\"\")+\": \",l))}else i.appendChild(document.createTextNode(e.label||\"\"));i.appendChild(document.createTextNode(\" \")),i.appendChild(V(\"button\",{class:\"cm-button\",type:\"submit\"},e.submitLabel||\"OK\"))}let s=i.nodeName==\"FORM\"?[i]:i.querySelectorAll(\"form\");for(let l=0;l<s.length;l++){let a=s[l];a.addEventListener(\"keydown\",h=>{h.keyCode==27?(h.preventDefault(),o(null)):h.keyCode==13&&(h.preventDefault(),o(a))}),a.addEventListener(\"submit\",h=>{h.preventDefault(),o(a)})}let r=V(\"div\",i,V(\"button\",{onclick:()=>o(null),\"aria-label\":n.state.phrase(\"close\"),class:\"cm-dialog-close\",type:\"button\"},[\"\\xD7\"]));e.class&&(r.className=e.class),r.classList.add(\"cm-dialog\");function o(l){r.contains(r.ownerDocument.activeElement)&&n.focus(),t(l)}return{dom:r,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus==\"string\"?l=i.querySelector(e.focus):l=i.querySelector(\"input\")||i.querySelector(\"button\"),l&&\"select\"in l?l.select():l&&\"focus\"in l&&l.focus()}}}}var Be=class extends Ge{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Be.prototype.elementClass=\"\";Be.prototype.toDOM=void 0;Be.prototype.mapMode=ce.TrackBefore;Be.prototype.startSide=Be.prototype.endSide=-1;Be.prototype.point=!0;var Rs=P.define(),ag=P.define(),hg={class:\"\",renderEmptyElements:!1,elementStyle:\"\",markers:()=>I.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:\"before\"},gn=P.define();function Fl(n){return[Wf(),gn.of({...hg,...n})]}var El=P.define({combine:n=>n.some(e=>e)});function Wf(n){let e=[cg];return n&&n.fixed===!1&&e.push(El.of(!0)),e}var cg=ie.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement(\"div\"),this.dom.className=\"cm-gutters cm-gutters-before\",this.dom.setAttribute(\"aria-hidden\",\"true\"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+\"px\",this.gutters=n.state.facet(gn).map(e=>new Fs(n,e)),this.fixed=!n.state.facet(El);for(let e of this.gutters)e.config.side==\"after\"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=\"sticky\"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(\"div\"),this.domAfter.className=\"cm-gutters cm-gutters-after\",this.domAfter.setAttribute(\"aria-hidden\",\"true\"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+\"px\",this.domAfter.style.position=this.fixed?\"sticky\":\"\",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+\"px\";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(El)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?\"sticky\":\"\",this.domAfter&&(this.domAfter.style.position=this.fixed?\"sticky\":\"\")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=I.iter(this.view.state.facet(Rs),this.view.viewport.from),i=[],s=this.gutters.map(r=>new zl(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==ge.Text&&o){Dl(t,i,l.from);for(let a of s)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==ge.Text){Dl(t,i,r.from);for(let o of s)o.line(this.view,r,i)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(gn),t=n.state.facet(gn),i=n.docChanged||n.heightChanged||n.viewportChanged||!I.eq(n.startState.facet(Rs),n.state.facet(Rs),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new Fs(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)r.config.side==\"after\"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>T.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,s=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==N.LTR?{left:i,right:s}:{right:i,left:s}})});function Cc(n){return Array.isArray(n)?n:[n]}function Dl(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}var zl=class{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=I.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new Hs(e,o,r,i);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];Dl(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),s=i?[i]:null;for(let r of e.state.facet(ag)){let o=r(e,t.widget,t);o&&(s||(s=[])).push(o)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Fs=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(\"div\"),this.dom.className=\"cm-gutter\"+(this.config.class?\" \"+this.config.class:\"\");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,s)&&s.preventDefault()});this.markers=Cc(t.markers(e)),t.initialSpacer&&(this.spacer=new Hs(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=\"visibility: hidden; pointer-events: none\")}update(e){let t=this.markers;if(this.markers=Cc(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!I.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Hs=class{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(\"div\"),this.dom.className=\"cm-gutterElement\",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.height=t,this.dom.style.height=t+\"px\"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+\"px\":\"\"),fg(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i=\"cm-gutterElement\",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=r<t.length?t[r++]:null,h=!1;if(a){let c=a.elementClass;c&&(i+=\" \"+c);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,h=!0;break}}else l=this.markers.length;for(;o<l;){let c=this.markers[o++];if(c.toDOM){c.destroy(s);let f=s.nextSibling;s.remove(),s=f}}if(!a)break;a.toDOM&&(h?s=s.nextSibling:this.dom.insertBefore(a.toDOM(e),s)),h&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}};function fg(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}var ug=P.define(),dg=P.define(),Mi=P.define({combine(n){return be(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let s in t){let r=i[s],o=t[s];i[s]=r?(l,a,h)=>r(l,a,h)||o(l,a,h):o}return i}})}}),yn=class extends Be{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Io(n,e){return n.state.facet(Mi).formatNumber(e,n.state)}var pg=gn.compute([Mi],n=>({class:\"cm-lineNumbers\",renderEmptyElements:!1,markers(e){return e.state.facet(ug)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new yn(Io(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let s of e.state.facet(dg)){let r=s(e,t,i);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Mi)!=e.state.facet(Mi),initialSpacer(e){return new yn(Io(e,Zc(e.state.doc.lines)))},updateSpacer(e,t){let i=Io(t.view,Zc(t.view.state.doc.lines));return i==e.number?e:new yn(i)},domEventHandlers:n.facet(Mi).domEventHandlers,side:\"before\"}));function Bf(n={}){return[Mi.of(n),Wf(),pg]}function Zc(n){let e=9;for(;e<n;)e=e*10+9;return e}var Og=new class extends Be{constructor(){super(...arguments),this.elementClass=\"cm-activeLineGutter\"}},mg=Rs.compute([\"selection\"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(Og.range(s)))}return I.of(e)});function Yf(){return mg}var Hl,ci=new z;function ar(n){return P.define({combine:n?e=>e.concat(n):void 0})}var hr=new z,Re=class{constructor(e,t,i=[],s=\"\"){this.data=e,this.name=s,H.prototype.hasOwnProperty(\"tree\")||Object.defineProperty(H.prototype,\"tree\",{get(){return se(this)}}),this.parser=t,this.extension=[Wt.of(this),H.languageData.of((r,o,l)=>{let a=If(r,o,l),h=a.type.prop(ci);if(!h)return[];let c=r.facet(h),f=a.type.prop(hr);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type==\"replace\"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return If(e,t,i).type.prop(ci)==this.data}findRegions(e){let t=e.facet(Wt);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(ci)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(z.mounted);if(l){if(l.tree.prop(ci)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let h=r.children[a];h instanceof U&&s(h,r.positions[a]+o)}};return s(se(e),0),i}get allowsNesting(){return!0}};Re.setState=E.define();function If(n,e,t){let i=n.facet(Wt),s=se(n).topNode;if(!i||i.allowsNesting)for(let r=s;r;r=r.enter(e,t,J.ExcludeBuffers|J.EnterBracketed))r.type.isTop&&(s=r);return s}var tr=class n extends Re{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=ar(e.languageData);return new n(t,e.parser.configure({props:[ci.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new n(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function se(n){let e=n.field(Re.state,!1);return e?e.tree:U.empty}var ta=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=\"\",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}},$n=null,Tn=class n{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new n(e,t,[],U.empty,0,i,[],null)}startParse(){return this.parser.startParse(new ta(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=U.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e==\"number\"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(Ut.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ut.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=$n;$n=this;try{return e()}finally{$n=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=qf(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ut.applyChanges(i,a),s=U.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);c<f&&l.push({from:c,to:f})}}}return new n(this.parser,t,i,s,r,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:s,to:r}=this.skipped[i];s<e.to&&r>e.from&&(this.fragments=qf(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ft{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=$n;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new U(pe.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return $n}};function qf(n,e,t){return Ut.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}var Cn=class n{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new n(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Tn.create(e.facet(Wt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new n(i)}};Re.state=ne.define({create:Cn.init,update(n,e){for(let t of e.effects)if(t.is(Re.setState))return t.value;return e.startState.facet(Wt)!=e.state.facet(Wt)?Cn.init(e.state):n.apply(e)}});var Kf=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<\"u\"&&(Kf=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var Kl=typeof navigator<\"u\"&&(!((Hl=navigator.scheduling)===null||Hl===void 0)&&Hl.isInputPending)?()=>navigator.scheduling.isInputPending():null,gg=ie.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Re.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Re.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Kf(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:s}}=this.view,r=i.field(Re.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Kl?Math.max(25,e.timeRemaining()-5):1e9),l=r.context.treeLen<s&&i.doc.length>s+1e3,a=r.context.work(()=>Kl&&Kl()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Re.setState.of(new Cn(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>me(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Wt=P.define({combine(n){return n.length?n[0]:null},enables:n=>[Re.state,gg,T.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{\"data-language\":t.name}:{}})]}),ir=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}};var yg=P.define(),Yi=P.define({combine:n=>{if(!n.length)return\"  \";let e=n[0];if(!e||/\\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error(\"Invalid indent unit: \"+JSON.stringify(n[0]));return e}});function Bt(n){let e=n.facet(Yi);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Ii(n,e){let t=\"\",i=n.tabSize,s=n.facet(Yi)[0];if(s==\"\t\"){for(;e>=i;)t+=\"\t\",e-=i;s=\" \"}for(let r=0;r<e;r++)t+=s;return t}function cr(n,e){n instanceof H&&(n=new fi(n));for(let i of n.state.facet(yg)){let s=i(n,e);if(s!==void 0)return s}let t=se(n.state);return t.length>=e?xg(n,t,e):null}var fi=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Bt(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:\"\",from:e}:(t<0?s<e:s<=e)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return\"\";let{text:i,from:s}=this.lineAt(e,t);return i.slice(e-s,Math.min(i.length,e+100-s))}column(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.countColumn(i,e-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\\S|$/))),r}countColumn(e,t=e.length){return kt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},fr=new z;function xg(n,e,t){let i=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return Jf(i,n,t)}function Jf(n,e,t){for(let i=n;i;i=i.next){let s=Sg(i.node);if(s)return s(ia.create(e,t,i))}return 0}function bg(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Sg(n){let e=n.type.prop(fr);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(z.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>tu(o,!0,1,void 0,r&&!bg(o)?s.from:void 0)}return n.parent==null?wg:null}function wg(){return 0}var ia=class n extends fi{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new n(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(kg(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return Jf(this.context.next,this.base,this.pos)}};function kg(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Qg(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function eu({closing:n,align:e=!0,units:t=1}){return i=>tu(i,e,t,n)}function tu(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?Qg(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}var iu=n=>n.baseIndent;function ur({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}var vg=200;function nu(){return H.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent(\"input.type\")&&!n.isUserEvent(\"input.complete\"))return n;let e=n.startState.languageDataAt(\"indentOnInput\",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+vg)return n;let r=t.sliceString(s.from,i);if(!e.some(h=>h.test(r)))return n;let{state:o}=n,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=cr(o,c.from);if(f==null)continue;let u=/^\\s*/.exec(c.text)[0],d=Ii(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}var $g=P.define(),ca=new z;function su(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function Pg(n,e,t){let i=se(n);if(i.length<t)return null;let s=i.resolveStack(t,1),r=null;for(let o=s;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(r&&l.from<e)break;let a=l.type.prop(ca);if(a&&(l.to<i.length-50||i.length==n.doc.length||!Tg(l))){let h=a(l,n);h&&h.from<=t&&h.from>=e&&h.to>t&&(r=h)}}return r}function Tg(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function nr(n,e,t){for(let i of n.facet($g)){let s=i(n,e,t);if(s)return s}return Pg(n,e,t)}function ru(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}var dr=E.define({map:ru}),An=E.define({map:ru});function ou(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}var ui=ne.define({create(){return R.none},update(n,e){e.isUserEvent(\"delete\")&&e.changes.iterChangedRanges((t,i)=>n=Vf(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(dr)&&!Cg(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(fa),s=i?R.replace({widget:new na(i(e.state,t.value))}):jf;n=n.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(An)&&(n=n.update({filter:(i,s)=>t.value.from!=i||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=Vf(n,e.selection.main.head)),n},provide:n=>T.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError(\"Invalid JSON for fold state\");let e=[];for(let t=0;t<n.length;){let i=n[t++],s=n[t++];if(typeof i!=\"number\"||typeof s!=\"number\")throw new RangeError(\"Invalid JSON for fold state\");e.push(jf.range(i,s))}return R.set(e,!0)}});function Vf(n,e,t=e){let i=!1;return n.between(e,t,(s,r)=>{s<t&&r>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(s,r)=>s>=t||r<=e}):n}function sr(n,e,t){var i;let s=null;return(i=n.field(ui,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!s||s.from>r)&&(s={from:r,to:o})}),s}function Cg(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function lu(n,e){return n.field(ui,!1)?e:e.concat(E.appendConfig.of(cu()))}var Zg=n=>{for(let e of ou(n)){let t=nr(n.state,e.from,e.to);if(t)return n.dispatch({effects:lu(n.state,[dr.of(t),au(n,t)])}),!0}return!1},Ag=n=>{if(!n.state.field(ui,!1))return!1;let e=[];for(let t of ou(n)){let i=sr(n.state,t.from,t.to);i&&e.push(An.of(i),au(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function au(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return T.announce.of(`${n.state.phrase(t?\"Folded lines\":\"Unfolded lines\")} ${i} ${n.state.phrase(\"to\")} ${s}.`)}var Mg=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let s=n.lineBlockAt(i),r=nr(e,s.from,s.to);r&&t.push(dr.of(r)),i=(r?n.lineBlockAt(r.to):s).to+1}return t.length&&n.dispatch({effects:lu(n.state,t)}),!!t.length},Rg=n=>{let e=n.state.field(ui,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(An.of({from:i,to:s}))}),n.dispatch({effects:t}),!0};var hu=[{key:\"Ctrl-Shift-[\",mac:\"Cmd-Alt-[\",run:Zg},{key:\"Ctrl-Shift-]\",mac:\"Cmd-Alt-]\",run:Ag},{key:\"Ctrl-Alt-[\",run:Mg},{key:\"Ctrl-Alt-]\",run:Rg}],Xg={placeholderDOM:null,preparePlaceholder:null,placeholderText:\"\\u2026\"},fa=P.define({combine(n){return be(n,Xg)}});function cu(n){let e=[ui,Eg];return n&&e.push(fa.of(n)),e}function fu(n,e){let{state:t}=n,i=t.facet(fa),s=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=sr(n.state,l.from,l.to);a&&n.dispatch({effects:An.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,s,e);let r=document.createElement(\"span\");return r.textContent=i.placeholderText,r.setAttribute(\"aria-label\",t.phrase(\"folded code\")),r.title=t.phrase(\"unfold\"),r.className=\"cm-foldPlaceholder\",r.onclick=s,r}var jf=R.replace({widget:new class extends $e{toDOM(n){return fu(n,null)}}}),na=class extends $e{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return fu(e,this.value)}},Lg={openText:\"\\u2304\",closedText:\"\\u203A\",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},Pn=class extends Be{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement(\"span\");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?\"Fold line\":\"Unfold line\"),t}};function uu(n={}){let e={...Lg,...n},t=new Pn(e,!0),i=new Pn(e,!1),s=ie.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Wt)!=o.state.facet(Wt)||o.startState.field(ui,!1)!=o.state.field(ui,!1)||se(o.startState)!=se(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new ze;for(let a of o.viewportLineBlocks){let h=sr(o.state,a.from,a.to)?i:nr(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[s,Fl({class:\"cm-foldGutter\",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||I.empty},initialSpacer(){return new Pn(e,!1)},domEventHandlers:{...r,click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=sr(o.state,l.from,l.to);if(h)return o.dispatch({effects:An.of(h)}),!0;let c=nr(o.state,l.from,l.to);return c?(o.dispatch({effects:dr.of(c)}),!0):!1}}}),cu()]}var Eg=T.baseTheme({\".cm-foldPlaceholder\":{backgroundColor:\"#eee\",border:\"1px solid #ddd\",color:\"#888\",borderRadius:\".2em\",margin:\"0 1px\",padding:\"0 1px\",cursor:\"pointer\"},\".cm-foldGutter span\":{padding:\"0 1px\",cursor:\"pointer\"}}),rr=class n{constructor(e,t){this.specs=e;let i;function s(l){let a=Fe.newName();return(i||(i=Object.create(null)))[\".\"+a]=l,a}let r=typeof t.all==\"string\"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof Re?l=>l.prop(ci)==o.data:o?l=>l==o:void 0,this.style=ho(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new Fe(i):null,this.themeType=t.themeType}static define(e,t){return new n(e,t||{})}},sa=P.define(),du=P.define({combine(n){return n.length?[n[0]]:null}});function Jl(n){let e=n.facet(sa);return e.length?e:n.facet(du)}function pu(n,e){let t=[Dg],i;return n instanceof rr&&(n.module&&t.push(T.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(du.of(n)):i?t.push(sa.computeN([T.darkTheme],s=>s.facet(T.darkTheme)==(i==\"dark\")?[n]:[])):t.push(sa.of(n)),t}var ra=class{constructor(e){this.markCache=Object.create(null),this.tree=se(e.state),this.decorations=this.buildDeco(e,Jl(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=se(e.state),i=Jl(e.state),s=i!=Jl(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!s&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return R.none;let i=new ze;for(let{from:s,to:r}of e.visibleRanges)Oh(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=R.mark({class:a})))},s,r);return i.finish()}},Dg=Ue.high(ie.fromClass(ra,{decorations:n=>n.decorations})),Ou=rr.define([{tag:y.meta,color:\"#404740\"},{tag:y.link,textDecoration:\"underline\"},{tag:y.heading,textDecoration:\"underline\",fontWeight:\"bold\"},{tag:y.emphasis,fontStyle:\"italic\"},{tag:y.strong,fontWeight:\"bold\"},{tag:y.strikethrough,textDecoration:\"line-through\"},{tag:y.keyword,color:\"#708\"},{tag:[y.atom,y.bool,y.url,y.contentSeparator,y.labelName],color:\"#219\"},{tag:[y.literal,y.inserted],color:\"#164\"},{tag:[y.string,y.deleted],color:\"#a11\"},{tag:[y.regexp,y.escape,y.special(y.string)],color:\"#e40\"},{tag:y.definition(y.variableName),color:\"#00f\"},{tag:y.local(y.variableName),color:\"#30a\"},{tag:[y.typeName,y.namespace],color:\"#085\"},{tag:y.className,color:\"#167\"},{tag:[y.special(y.variableName),y.macroName],color:\"#256\"},{tag:y.definition(y.propertyName),color:\"#00c\"},{tag:y.comment,color:\"#940\"},{tag:y.invalid,color:\"#f00\"}]),zg=T.baseTheme({\"&.cm-focused .cm-matchingBracket\":{backgroundColor:\"#328c8252\"},\"&.cm-focused .cm-nonmatchingBracket\":{backgroundColor:\"#bb555544\"}}),mu=1e4,gu=\"()[]{}\",yu=P.define({combine(n){return be(n,{afterCursor:!0,brackets:gu,maxScanDistance:mu,renderMatch:Bg})}}),_g=R.mark({class:\"cm-matchingBracket\"}),Wg=R.mark({class:\"cm-nonmatchingBracket\"});function Bg(n){let e=[],t=n.matched?_g:Wg;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function Nf(n){let e=[],t=n.facet(yu);for(let i of n.selection.ranges){if(!i.empty)continue;let s=lt(n,i.head,-1,t)||i.head>0&&lt(n,i.head-1,1,t)||t.afterCursor&&(lt(n,i.head,1,t)||i.head<n.doc.length&&lt(n,i.head+1,-1,t));s&&(e=e.concat(t.renderMatch(s,n)))}return R.set(e,!0)}var Yg=ie.fromClass(class{constructor(n){this.paused=!1,this.decorations=Nf(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=Nf(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),Ig=[Yg,zg];function xu(n={}){return[yu.of(n),Ig]}var qg=new z;function oa(n,e,t){let i=n.prop(e<0?z.openedBy:z.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function la(n){let e=n.type.prop(qg);return e?e(n.node):n}function lt(n,e,t,i={}){let s=i.maxScanDistance||mu,r=i.brackets||gu,o=se(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=oa(a.type,t,r);if(h&&a.from<a.to){let c=la(a);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return Vg(n,e,t,a,c,h,r)}}return jg(n,e,t,o,l.type,s,r)}function Vg(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l?.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from<c.to){let f=la(c);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(oa(c.type,t,o))h++;else if(oa(c.type,-t,o)){if(h==0){let f=la(c);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}h--}}while(t<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function jg(n,e,t,i,s,r,o){let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let O=t>0?0:d.length-1,m=t>0?d.length:-1;O!=m;O+=t){let g=o.indexOf(d[O]);if(!(g<0||i.resolveInner(p+O,1).type!=s))if(g%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+O,to:p+O+1},matched:g>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Gf(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\\s\\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o<e;o++)n.charCodeAt(o)==9?r+=t-r%t:r++;return r}var or=class{constructor(e,t,i,s){this.string=e,this.tabSize=t,this.indentUnit=i,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),i;if(typeof e==\"string\"?i=t==e:i=t&&(e instanceof RegExp?e.test(t):e(t)),i)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\\s\\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Gf(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:Gf(this.string,null,this.tabSize)}match(e,t,i){if(typeof e==\"string\"){let s=o=>i?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}};function Ng(n){return{name:n.name||\"\",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Gg,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||da,mergeTokens:n.mergeTokens!==!1}}function Gg(n){if(typeof n!=\"object\")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}var Uf=new WeakMap,aa=class n extends Re{constructor(e){let t=ar(e.languageData),i=Ng(e),s,r=new class extends Ft{createParse(o,l,a){return new ha(s,o,l,a)}};super(t,r,[],e.name),this.topNode=Kg(t,this),s=this,this.streamParser=i,this.stateAfter=new z({perNode:!0}),this.tokenTable=e.tokenTable?new lr(i.tokenTable):Hg}static define(e){return new n(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=Uf.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let s=ua(this,e.node.tree,e.node.from,e.node.from,t??e.pos),r,o;if(s?(o=s.state,r=s.pos+1):(o=this.streamParser.startState(e.unit),r=e.node.from),e.pos-r>1e4)return null;for(;r<e.pos;){let a=e.state.doc.lineAt(r),h=Math.min(e.pos,a.to);if(a.length){let c=i?i(a.from):-1,f=new or(a.text,e.state.tabSize,e.unit,c<0?void 0:c);for(;f.pos<h-a.from;)Su(this.streamParser.token,f,o)}else this.streamParser.blankLine(o,e.unit);if(h==e.pos)break;r=a.to+1}let l=e.lineAt(e.pos);return i&&t==null&&Uf.set(e.state,l.from),this.streamParser.indent(o,/^\\s*(.*)/.exec(l.text)[1],e)}get allowsNesting(){return!1}};function ua(n,e,t,i,s){let r=t>=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof U&&a<s&&ua(n,l,a,i,s);if(h)return h}return null}function bu(n,e,t,i,s){if(s&&t<=0&&i>=e.length)return e;!s&&t==0&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(o<i&&l instanceof U){if(!(a=bu(n,l,t-o,i-o,s)))break;return s?new U(e.type,e.children.slice(0,r).concat(a),e.positions.slice(0,r+1),o+a.length):a}}return null}function Ug(n,e,t,i,s){for(let r of e){let o=r.from+(r.openStart?25:0),l=r.to-(r.openEnd?25:0),a=o<=t&&l>t&&ua(n,r.tree,0-r.offset,t,l),h;if(a&&a.pos<=i&&(h=bu(n,r.tree,t+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:h}}return{state:n.streamParser.startState(s?Bt(s):4),tree:U.empty}}var ha=class{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Tn.get(),o=s[0].from,{state:l,tree:a}=Ug(e,i,o,this.to,r?.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h<a.children.length;h++)this.chunks.push(a.children[h]),this.chunkPos.push(a.positions[h]);r&&this.parsedPos<r.viewport.from-1e5&&s.some(h=>h.from<=r.viewport.from&&h.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(Bt(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=Tn.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`\n`&&(t=\"\");else{let i=t.indexOf(`\n`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s){let r=4;if(this.ranges.length>1){s=this.skipGapsTo(t,s,1),t+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),s}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new or(t,e?e.state.tabSize:4,e?Bt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Su(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=U.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Fg,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new U(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new U(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function Su(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error(\"Stream parser failed to advance stream.\")}var da=Object.create(null),Zn=[pe.none],Fg=new xi(Zn),Ff=[],Hf=Object.create(null),wu=Object.create(null);for(let[n,e]of[[\"variable\",\"variableName\"],[\"variable-2\",\"variableName.special\"],[\"string-2\",\"string.special\"],[\"def\",\"variableName.definition\"],[\"tag\",\"tagName\"],[\"attribute\",\"attributeName\"],[\"type\",\"typeName\"],[\"builtin\",\"variableName.standard\"],[\"qualifier\",\"modifier\"],[\"error\",\"invalid\"],[\"header\",\"heading\"],[\"property\",\"propertyName\"]])wu[n]=ku(da,e);var lr=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),wu)}resolve(e){return e?this.table[e]||(this.table[e]=ku(this.extra,e)):0}},Hg=new lr(da);function ea(n,e){Ff.indexOf(n)>-1||(Ff.push(n),console.warn(e))}function ku(n,e){let t=[];for(let l of e.split(\" \")){let a=[];for(let h of l.split(\".\")){let c=n[h]||y[h];c?typeof c==\"function\"?a.length?a=a.map(c):ea(h,`Modifier ${h} used at start of tag`):a.length?ea(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:ea(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,\"_\"),s=i+\" \"+t.map(l=>l.id),r=Hf[s];if(r)return r.id;let o=Hf[s]=pe.define({id:Zn.length,name:i,props:[os({[i]:t})]});return Zn.push(o),o.id}function Kg(n,e){let t=pe.define({id:Zn.length,name:\"Document\",props:[ci.add(()=>n),fr.add(()=>i=>e.getIndent(i))],top:!0});return Zn.push(t),t}var Bx={rtl:R.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"rtl\"},bidiIsolate:N.RTL}),ltr:R.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"ltr\"},bidiIsolate:N.LTR}),auto:R.mark({class:\"cm-iso\",inclusive:!0,attributes:{dir:\"auto\"},bidiIsolate:null})};var Or=class{constructor(e,t,i,s){this.state=e,this.pos=t,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=se(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Ru(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e==\"abort\"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}};function Qu(n){let e=Object.keys(n).join(\"\"),t=/\\w/.test(e);return t&&(e=e.replace(/\\w/g,\"\")),`[${t?\"\\\\w\":\"\"}${e.replace(/[^\\w\\s]/g,\"\\\\$&\")}]`}function Jg(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;r<s.length;r++)t[s[r]]=!0}let i=Qu(e)+Qu(t)+\"*$\";return[new RegExp(\"^\"+i),new RegExp(i)]}function $a(n){let e=n.map(s=>typeof s==\"string\"?{label:s}:s),[t,i]=e.every(s=>/^\\w+$/.test(s.label))?[/\\w*$/,/\\w+$/]:Jg(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Mu(n,e){return t=>{for(let i=se(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}var mr=class{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}};function pi(n){return n.selection.main.from}function Ru(n,e){var t;let{source:i}=n,s=e&&i[0]!=\"^\",r=i[i.length-1]!=\"$\";return!s&&!r?n:new RegExp(`${s?\"^\":\"\"}(?:${i})${r?\"$\":\"\"}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?\"i\":\"\")}var Pa=Ze.define();function e0(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return{...n.changeByRange(l=>{if(l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i))return{range:l};let a=n.toText(e);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:x.cursor(l.from+r+a.length)}}),scrollIntoView:!0,userEvent:\"input.complete\"}}var vu=new WeakMap;function t0(n){if(!Array.isArray(n))return n;let e=vu.get(n);return e||vu.set(n,e=$a(n)),e}var gr=E.define(),Mn=E.define(),ga=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=Oe(e,t),s=_e(i);this.chars.push(i);let r=e.slice(t,t+s),o=r.toUpperCase();this.folded.push(Oe(o==r?r.toLowerCase():o,0)),t+=s}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:s,precise:r,byWord:o}=this;if(t.length==1){let S=Oe(e,0),b=_e(S),A=b==e.length?0:-100;if(S!=t[0])if(S==i[0])A+=-200;else return null;return this.ret(A,[0,b])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,h=0;if(l<0){for(let S=0,b=Math.min(e.length,200);S<b&&h<a;){let A=Oe(e,S);(A==t[h]||A==i[h])&&(s[h++]=S),S+=_e(A)}if(h<a)return null}let c=0,f=0,u=!1,d=0,p=-1,O=-1,m=/[a-z]/.test(e),g=!0;for(let S=0,b=Math.min(e.length,200),A=0;S<b&&f<a;){let w=Oe(e,S);l<0&&(c<a&&w==t[c]&&(r[c++]=S),d<a&&(w==t[d]||w==i[d]?(d==0&&(p=S),O=S+1,d++):d=0));let v,Q=w<255?w>=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(v=on(w))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!S||Q==1&&m||A==0&&Q!=0)&&(t[f]==w||i[f]==w&&(u=!0)?o[f++]=S:o.length&&(g=!1)),A=Q,S+=_e(w)}return f==a&&o[0]==0&&g?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(O==e.length?0:-100),[0,O]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,O]):f==a?this.result(-100+(u?-200:0)+-700+(g?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?_e(Oe(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}},ya=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}},ue=P.define({combine(n){return be(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>\"\",optionClass:()=>\"\",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:i0,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>$u(e(i),t(i)),optionClass:(e,t)=>i=>$u(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function $u(n,e){return n?e?n+\" \"+e:n:e}function i0(n,e,t,i,s,r){let o=n.textDirection==N.RTL,l=o,a=!1,h=\"top\",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,O=i.bottom-i.top;if(l&&u<Math.min(p,d)?l=!1:!l&&d<Math.min(p,u)&&(l=!0),p<=(l?u:d))c=Math.max(s.top,Math.min(t.top,s.bottom-O))-e.top,f=Math.min(400,l?u:d);else{a=!0,f=Math.min(400,(o?e.right:s.right-e.left)-30);let S=s.bottom-e.bottom;S>=O||S>e.top?c=t.bottom-e.top:(h=\"bottom\",c=e.bottom-t.top)}let m=(e.bottom-e.top)/r.offsetHeight,g=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/m}px; max-width: ${f/g}px`,class:\"cm-completionInfo-\"+(a?o?\"left-narrow\":\"right-narrow\":l?\"left\":\"right\")}}var Ta=E.define();function n0(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement(\"div\");return i.classList.add(\"cm-completionIcon\"),t.type&&i.classList.add(...t.type.split(/\\s+/g).map(s=>\"cm-completionIcon-\"+s)),i.setAttribute(\"aria-hidden\",\"true\"),i},position:20}),e.push({render(t,i,s,r){let o=document.createElement(\"span\");o.className=\"cm-completionLabel\";let l=t.displayLabel||t.label,a=0;for(let h=0;h<r.length;){let c=r[h++],f=r[h++];c>a&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement(\"span\"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className=\"cm-completionMatchedText\",a=f}return a<l.length&&o.appendChild(document.createTextNode(l.slice(a))),o},position:50},{render(t){if(!t.detail)return null;let i=document.createElement(\"span\");return i.className=\"cm-completionDetail\",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function pa(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}var xa=class{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass=\"\";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(ue);this.optionContent=n0(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=pa(r.length,o,l.maxRenderedOptions),this.dom=document.createElement(\"div\"),this.dom.className=\"cm-tooltip-autocomplete\",this.updateTooltipClass(e.state),this.dom.addEventListener(\"mousedown\",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName==\"LI\"&&(f=/-(\\d+)$/.exec(c.id))&&+f[1]<h.length){this.applyCompletion(e,h[+f[1]]),a.preventDefault();return}if(a.target==this.list){let c=this.list.classList.contains(\"cm-completionListIncompleteTop\")&&a.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(\"cm-completionListIncompleteBottom\")&&a.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(e.dispatch({effects:Ta.of(c)}),a.preventDefault())}}),this.dom.addEventListener(\"focusout\",a=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(ue).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Mn.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(\"scroll\",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=pa(r.length,o,e.state.facet(ue).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle(\"cm-tooltip-autocomplete-disabled\",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(\" \"))i&&this.dom.classList.remove(i);for(let i of t.split(\" \"))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=pa(t.options.length,t.selected,this.view.state.facet(ue).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:s}=t.options[t.selected],{info:r}=s;if(!r)return;let o=typeof r==\"string\"?document.createTextNode(r):r(s);if(!o)return;\"then\"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>me(this.view.state,l,\"completion info\")):(this.addInfoPane(o,s),i.setAttribute(\"aria-describedby\",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement(\"div\");if(i.className=\"cm-tooltip cm-completionInfo\",i.id=\"cm-completionInfo-\"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!=\"LI\"||!i.id?s--:s==e?i.hasAttribute(\"aria-selected\")||(i.setAttribute(\"aria-selected\",\"true\"),t=i):i.hasAttribute(\"aria-selected\")&&(i.removeAttribute(\"aria-selected\"),i.removeAttribute(\"aria-describedby\"));return t&&r0(this.list,t),t}measureInfo(){let e=this.dom.querySelector(\"[aria-selected]\");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(ue).positionInfo(this.view,t,s,i,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=\"cm-tooltip cm-completionInfo \"+(e.class||\"\")):this.info.style.cssText=\"top: -1e6px\")}createListBox(e,t,i){let s=document.createElement(\"ul\");s.id=t,s.setAttribute(\"role\",\"listbox\"),s.setAttribute(\"aria-expanded\",\"true\"),s.setAttribute(\"aria-label\",this.view.state.phrase(\"Completions\")),s.addEventListener(\"mousedown\",o=>{o.target==s&&o.preventDefault()});let r=null;for(let o=i.from;o<i.to;o++){let{completion:l,match:a}=e[o],{section:h}=l;if(h){let u=typeof h==\"string\"?h:h.name;if(u!=r&&(o>i.from||i.from==0))if(r=u,typeof h!=\"string\"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement(\"completion-section\"));d.textContent=u}}let c=s.appendChild(document.createElement(\"li\"));c.id=t+\"-\"+o,c.setAttribute(\"role\",\"option\");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&s.classList.add(\"cm-completionListIncompleteTop\"),i.to<e.length&&s.classList.add(\"cm-completionListIncompleteBottom\"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}};function s0(n,e){return t=>new xa(t,n,e)}function r0(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/s:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function Pu(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function o0(n,e){let t=[],i=null,s=null,r=c=>{t.push(c);let{section:f}=c.completion;if(f){i||(i=[]);let u=typeof f==\"string\"?f:f.name;i.some(d=>d.name==u)||i.push(typeof f==\"string\"?{name:u}:f)}},o=e.facet(ue);for(let c of n)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)r(new mr(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new ya(u):new ga(u);for(let O of c.result.options)if(d=p.match(O.label)){let m=O.displayLabel?f?f(O,d.matched):[]:d.matched,g=d.score+(O.boost||0);if(r(new mr(O,c.source,m,g)),typeof O.section==\"object\"&&O.section.rank===\"dynamic\"){let{name:S}=O.section;s||(s=Object.create(null)),s[S]=Math.max(g,s[S]||-1e9)}}}}if(i){let c=Object.create(null),f=0,u=(d,p)=>(d.rank===\"dynamic\"&&p.rank===\"dynamic\"?s[p.name]-s[d.name]:0)||(typeof d.rank==\"number\"?d.rank:1e9)-(typeof p.rank==\"number\"?p.rank:1e9)||(d.name<p.name?-1:1);for(let d of i.sort(u))f-=1e5,c[d.name]=f;for(let d of t){let{section:p}=d.completion;p&&(d.score+=c[typeof p==\"string\"?p:p.name])}}let l=[],a=null,h=o.compareCompletions;for(let c of t.sort((f,u)=>u.score-f.score||h(f.completion,u.completion))){let f=c.completion;!a||a.label!=f.label||a.detail!=f.detail||a.type!=null&&f.type!=null&&a.type!=f.type||a.apply!=f.apply||a.boost!=f.boost?l.push(c):Pu(c.completion)>Pu(a)&&(l[l.length-1]=c),a=c.completion}return l}var ba=class n{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new n(this.options,Tu(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r,o){if(s&&!o&&e.some(h=>h.isPending))return s.setDisabled();let l=o0(e,t);if(!l.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let a=t.facet(ue).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let h=s.options[s.selected].completion;for(let c=0;c<l.length;c++)if(l[c].completion==h){a=c;break}}return new n(l,Tu(i,a),{pos:e.reduce((h,c)=>c.hasResult()?Math.min(h,c.from):h,1e8),create:u0,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new n(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new n(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Sa=class n{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new n(c0,\"cm-ac-\"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(ue),r=(i.override||t.languageDataAt(\"autocomplete\",pi(t)).map(t0)).map(a=>(this.active.find(c=>c.source==a)||new Tt(a,this.active.some(c=>c.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((a,h)=>a==this.active[h])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(Ca));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!l0(r,this.active)||l?o=ba.build(r,t,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Tt(a.source,0):a));for(let a of e.effects)a.is(Ta)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new n(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?a0:h0}};function l0(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let s=t==n.length,r=i==e.length;if(s||r)return s==r;if(n[t++].result!=e[i++].result)return!1}}var a0={\"aria-autocomplete\":\"list\"},h0={};function Tu(n,e){let t={\"aria-autocomplete\":\"list\",\"aria-haspopup\":\"listbox\",\"aria-controls\":n};return e>-1&&(t[\"aria-activedescendant\"]=n+\"-\"+e),t}var c0=[];function Xu(n,e){if(n.isUserEvent(\"input.complete\")){let i=n.annotation(Pa);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent(\"input.type\");return t&&e.activateOnTyping?5:t?1:n.isUserEvent(\"delete.backward\")?2:n.selection?8:n.docChanged?16:0}var Tt=class n{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=Xu(e,t),s=this;(i&8||i&16&&this.touches(e))&&(s=new n(s.source,0)),i&4&&s.state==0&&(s=new n(this.source,1)),s=s.updateFor(e,i);for(let r of e.effects)if(r.is(gr))s=new n(s.source,1,r.value);else if(r.is(Mn))s=new n(s.source,0);else if(r.is(Ca))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(pi(e.state))}},yr=class n extends Tt{constructor(e,t,i,s,r,o){super(e,3,t),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=pi(e.state);if(l>o||!s||t&2&&(pi(e.startState)==this.from||l<this.limit))return new Tt(this.source,t&4?1:0);let a=e.changes.mapPos(this.limit);return f0(s.validFor,e.state,r,o)?new n(this.source,this.explicit,a,s,r,o):s.update&&(s=s.update(s,r,o,new Or(e.state,l,!1)))?new n(this.source,this.explicit,a,s,s.from,(i=s.to)!==null&&i!==void 0?i:pi(e.state)):new Tt(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new n(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Tt(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function f0(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n==\"function\"?n(s,t,i,e):Ru(n,!0).test(s)}var Ca=E.define({map(n,e){return n.map(t=>t.map(e))}}),Xe=ne.define({create(){return Sa.start()},update(n,e){return n.update(e)},provide:n=>[Qn.from(n,e=>e.tooltip),T.contentAttributes.from(n,e=>e.attrs)]});function Za(n,e){let t=e.completion.apply||e.completion.label,i=n.state.field(Xe).active.find(s=>s.source==e.source);return i instanceof yr?(typeof t==\"string\"?n.dispatch({...e0(n.state,t,i.from,i.to),annotations:Pa.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}var u0=s0(Xe,Za);function pr(n,e=\"option\"){return t=>{let i=t.state.field(Xe,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(ue).interactionDelay)return!1;let s=1,r;e==\"page\"&&(r=Ul(t,i.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector(\"li\").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e==\"page\"?0:o-1:l>=o&&(l=e==\"page\"?o-1:0),t.dispatch({effects:Ta.of(l)}),!0}}var d0=n=>{let e=n.state.field(Xe,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(ue).interactionDelay?!1:Za(n,e.open.options[e.open.selected])},Oa=n=>n.state.field(Xe,!1)?(n.dispatch({effects:gr.of(!0)}),!0):!1,p0=n=>{let e=n.state.field(Xe,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Mn.of(null)}),!0)},wa=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},O0=50,m0=1e3,g0=ie.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Xe).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Xe),t=n.state.facet(ue);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Xe)==e)return;let i=n.transactions.some(r=>{let o=Xu(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(i||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>O0&&Date.now()-o.time>m0){for(let l of o.context.abortListeners)try{l()}catch(a){me(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(gr)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent(\"input.type\")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Xe);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ue).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=pi(e),i=new Or(e,t,n.explicit,this.view),s=new wa(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Mn.of(null)}),me(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ue).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ue),i=this.view.state.field(Xe);for(let s=0;s<this.running.length;s++){let r=this.running[s];if(r.done===void 0)continue;if(this.running.splice(s--,1),r.done){let l=pi(r.updates.length?r.updates[0].startState:this.view.state),a=Math.min(l,r.done.from+(r.active.explicit?0:1)),h=new yr(r.active.source,r.active.explicit,a,r.done,r.done.from,(n=r.done.to)!==null&&n!==void 0?n:l);for(let c of r.updates)h=h.update(c,t);if(h.hasResult()){e.push(h);continue}}let o=i.active.find(l=>l.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Tt(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Ca.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Xe,!1);if(e&&e.tooltip&&this.view.state.facet(ue).closeOnBlur){let t=e.open&&Ul(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Mn.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:gr.of(!1)}),20),this.composing=0}}}),y0=typeof navigator==\"object\"&&/Win/.test(navigator.platform),x0=Ue.highest(T.domEventHandlers({keydown(n,e){let t=e.state.field(Xe,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(y0&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],s=t.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&Za(e,i),!1}})),Lu=T.baseTheme({\".cm-tooltip.cm-tooltip-autocomplete\":{\"& > ul\":{fontFamily:\"monospace\",whiteSpace:\"nowrap\",overflow:\"hidden auto\",maxWidth_fallback:\"700px\",maxWidth:\"min(700px, 95vw)\",minWidth:\"250px\",maxHeight:\"10em\",height:\"100%\",listStyle:\"none\",margin:0,padding:0,\"& > li, & > completion-section\":{padding:\"1px 3px\",lineHeight:1.2},\"& > li\":{overflowX:\"hidden\",textOverflow:\"ellipsis\",cursor:\"pointer\"},\"& > completion-section\":{display:\"list-item\",borderBottom:\"1px solid silver\",paddingLeft:\"0.5em\",opacity:.7}}},\"&light .cm-tooltip-autocomplete ul li[aria-selected]\":{background:\"#17c\",color:\"white\"},\"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]\":{background:\"#777\"},\"&dark .cm-tooltip-autocomplete ul li[aria-selected]\":{background:\"#347\",color:\"white\"},\"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]\":{background:\"#444\"},\".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after\":{content:'\"\\xB7\\xB7\\xB7\"',opacity:.5,display:\"block\",textAlign:\"center\"},\".cm-tooltip.cm-completionInfo\":{position:\"absolute\",padding:\"3px 9px\",width:\"max-content\",maxWidth:\"400px\",boxSizing:\"border-box\",whiteSpace:\"pre-line\"},\".cm-completionInfo.cm-completionInfo-left\":{right:\"100%\"},\".cm-completionInfo.cm-completionInfo-right\":{left:\"100%\"},\".cm-completionInfo.cm-completionInfo-left-narrow\":{right:\"30px\"},\".cm-completionInfo.cm-completionInfo-right-narrow\":{left:\"30px\"},\"&light .cm-snippetField\":{backgroundColor:\"#00000022\"},\"&dark .cm-snippetField\":{backgroundColor:\"#ffffff22\"},\".cm-snippetFieldPosition\":{verticalAlign:\"text-top\",width:0,height:\"1.15em\",display:\"inline-block\",margin:\"0 -0.7px -.7em\",borderLeft:\"1.4px dotted #888\"},\".cm-completionMatchedText\":{textDecoration:\"underline\"},\".cm-completionDetail\":{marginLeft:\"0.5em\",fontStyle:\"italic\"},\".cm-completionIcon\":{fontSize:\"90%\",width:\".8em\",display:\"inline-block\",textAlign:\"center\",paddingRight:\".6em\",opacity:\"0.6\",boxSizing:\"content-box\"},\".cm-completionIcon-function, .cm-completionIcon-method\":{\"&:after\":{content:\"'\\u0192'\"}},\".cm-completionIcon-class\":{\"&:after\":{content:\"'\\u25CB'\"}},\".cm-completionIcon-interface\":{\"&:after\":{content:\"'\\u25CC'\"}},\".cm-completionIcon-variable\":{\"&:after\":{content:\"'\\u{1D465}'\"}},\".cm-completionIcon-constant\":{\"&:after\":{content:\"'\\u{1D436}'\"}},\".cm-completionIcon-type\":{\"&:after\":{content:\"'\\u{1D461}'\"}},\".cm-completionIcon-enum\":{\"&:after\":{content:\"'\\u222A'\"}},\".cm-completionIcon-property\":{\"&:after\":{content:\"'\\u25A1'\"}},\".cm-completionIcon-keyword\":{\"&:after\":{content:\"'\\u{1F511}\\uFE0E'\"}},\".cm-completionIcon-namespace\":{\"&:after\":{content:\"'\\u25A2'\"}},\".cm-completionIcon-text\":{\"&:after\":{content:\"'abc'\",fontSize:\"50%\",verticalAlign:\"middle\"}}}),ka=class{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}},Qa=class n{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,ce.TrackDel),i=e.mapPos(this.to,1,ce.TrackDel);return t==null||i==null?null:new n(this.field,t,i)}},va=class n{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\\t*/.exec(a)[0].length;for(let f=0;f<c;f++)h+=e.facet(Yi);s.push(t+h.length-c),a=h+a.slice(c)}i.push(a),t+=a.length+1}let l=this.fieldPositions.map(a=>new Qa(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\\r\\n?|\\n/)){for(;r=/[#$]\\{(?:(\\d+)(?::([^{}]*))?|((?:\\\\[{}]|[^{}])*))\\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||\"\",h=-1,c=a.replace(/\\\\[{}]/g,f=>f[1]);for(let f=0;f<t.length;f++)(l!=null?t[f].seq==l:c&&t[f].name==c)&&(h=f);if(h<0){let f=0;for(;f<t.length&&(l==null||t[f].seq!=null&&t[f].seq<l);)f++;t.splice(f,0,{seq:l,name:c}),h=f;for(let u of s)u.field>=h&&u.field++}for(let f of s)if(f.line==i.length&&f.from>r.index){let u=r[2]?3+(r[1]||\"\").length:2;f.from-=u,f.to-=u}s.push(new ka(h,i.length,r.index,r.index+c.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\\\([{}])/g,(l,a,h)=>{for(let c of s)c.line==i.length&&c.from>h&&(c.from--,c.to--);return a}),i.push(o)}return new n(i,s)}},b0=R.widget({widget:new class extends $e{toDOM(){let n=document.createElement(\"span\");return n.className=\"cm-snippetFieldPosition\",n}ignoreEvent(){return!1}}}),S0=R.mark({class:\"cm-snippetField\"}),qi=class n{constructor(e,t){this.ranges=e,this.active=t,this.deco=R.set(e.map(i=>(i.from==i.to?b0:S0).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new n(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}},Ln=E.define({map(n,e){return n&&n.map(e)}}),w0=E.define(),Rn=ne.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Ln))return t.value;if(t.is(w0)&&n)return new qi(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>T.decorations.from(n,e=>e?e.deco:R.none)});function Aa(n,e){return x.create(n.filter(t=>t.field==e).map(t=>x.range(t.from,t.to)))}function k0(n){let e=va.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,h={changes:{from:s,to:r==a.from?a.to:r,insert:B.of(o)},scrollIntoView:!0,annotations:i?[Pa.of(i),ae.userEvent.of(\"input.complete\")]:void 0};if(l.length&&(h.selection=Aa(l,0)),l.some(c=>c.field>0)){let c=new qi(l,0),f=h.effects=[Ln.of(c)];t.state.field(Rn,!1)===void 0&&f.push(E.appendConfig.of([Rn,T0,C0,Lu]))}t.dispatch(t.state.update(h))}}function Eu(n){return({state:e,dispatch:t})=>{let i=e.field(Rn,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:Aa(i.ranges,s),effects:Ln.of(r?null:new qi(i.ranges,s)),scrollIntoView:!0})),!0}}var Q0=({state:n,dispatch:e})=>n.field(Rn,!1)?(e(n.update({effects:Ln.of(null)})),!0):!1,v0=Eu(1),$0=Eu(-1);var P0=[{key:\"Tab\",run:v0,shift:$0},{key:\"Escape\",run:Q0}],Cu=P.define({combine(n){return n.length?n[0]:P0}}),T0=Ue.highest(Bi.compute([Cu],n=>n.facet(Cu)));function Pe(n,e){return{...e,apply:k0(n)}}var C0=T.domEventHandlers({mousedown(n,e){let t=e.state.field(Rn,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:Aa(t.ranges,s.field),effects:Ln.of(t.ranges.some(r=>r.field>s.field)?new qi(t.ranges,s.field):null),scrollIntoView:!0}),!0)}});var Xn={brackets:[\"(\",\"[\",\"{\",\"'\",'\"'],before:\")]}:;>\",stringPrefixes:[]},di=E.define({map(n,e){let t=e.mapPos(n,-1,ce.TrackAfter);return t??void 0}}),Ma=new class extends Ge{};Ma.startSide=1;Ma.endSide=-1;var Du=ne.define({create(){return I.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(di)&&(n=n.update({add:[Ma.range(t.value,t.value+1)]}));return n}});function zu(){return[A0,Du]}var ma=\"()[]{}<>\\xAB\\xBB\\xBB\\xAB\\uFF3B\\uFF3D\\uFF5B\\uFF5D\";function _u(n){for(let e=0;e<ma.length;e+=2)if(ma.charCodeAt(e)==n)return ma.charAt(e+1);return on(n<128?n:n+1)}function Wu(n,e){return n.languageDataAt(\"closeBrackets\",e)[0]||Xn}var Z0=typeof navigator==\"object\"&&/Android\\b/.test(navigator.userAgent),A0=T.inputHandler.of((n,e,t,i)=>{if((Z0?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&_e(Oe(i,0))==1||e!=s.from||t!=s.to)return!1;let r=R0(n.state,i);return r?(n.dispatch(r),!0):!1}),M0=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Wu(n,n.selection.main.head).brackets||Xn.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=X0(n.doc,o.head);for(let a of i)if(a==l&&xr(n.doc,o.head)==_u(Oe(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:x.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:\"delete.backward\"})),!s},Bu=[{key:\"Backspace\",run:M0}];function R0(n,e){let t=Wu(n,n.selection.main.head),i=t.brackets||Xn.brackets;for(let s of i){let r=_u(Oe(s,0));if(e==s)return r==s?D0(n,s,i.indexOf(s+s+s)>-1,t):L0(n,s,r,t.before||Xn.before);if(e==r&&Yu(n,n.selection.main.from))return E0(n,s,r)}return null}function Yu(n,e){let t=!1;return n.field(Du).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function xr(n,e){let t=n.sliceString(e,e+2);return t.slice(0,_e(Oe(t,0)))}function X0(n,e){let t=n.sliceString(e-2,e);return _e(Oe(t,0))==t.length?t:t.slice(1)}function L0(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:di.of(o.to+e.length),range:x.range(o.anchor+e.length,o.head+e.length)};let l=xr(n.doc,o.head);return!l||/\\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:di.of(o.head+e.length),range:x.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:\"input.type\"})}function E0(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&xr(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:x.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:\"input.type\"})}function D0(n,e,t,i){let s=i.stringPrefixes||Xn.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:di.of(l.to+e.length),range:x.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=xr(n.doc,a),c;if(h==e){if(Zu(n,a))return{changes:{insert:e+e,from:a},effects:di.of(a+e.length),range:x.cursor(a+e.length)};if(Yu(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:x.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=Au(n,a-2*e.length,s))>-1&&Zu(n,c))return{changes:{insert:e+e+e+e,from:a},effects:di.of(a+e.length),range:x.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=F.Word&&Au(n,a,s)>-1&&!z0(n,a,e,s))return{changes:{insert:e+e,from:a},effects:di.of(a+e.length),range:x.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:\"input.type\"})}function Zu(n,e){let t=se(n).resolveInner(e+1);return t.parent&&t.from==e}function z0(n,e,t,i){let s=se(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function Au(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=F.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=F.Word)return r}return-1}function Iu(n={}){return[x0,Xe,ue.of(n),g0,_0,Lu]}var Ra=[{key:\"Ctrl-Space\",run:Oa},{mac:\"Alt-`\",run:Oa},{mac:\"Alt-i\",run:Oa},{key:\"Escape\",run:p0},{key:\"ArrowDown\",run:pr(!0)},{key:\"ArrowUp\",run:pr(!1)},{key:\"PageDown\",run:pr(!0,\"page\")},{key:\"PageUp\",run:pr(!1,\"page\")},{key:\"Enter\",run:d0}],_0=Ue.highest(Bi.computeN([ue],n=>n.facet(ue).defaultKeymap?[Ra]:[]));var Nu=[Pe(\"function ${name}(${params}) {\\n\t${}\\n}\",{label:\"function\",detail:\"definition\",type:\"keyword\"}),Pe(\"for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\\n\t${}\\n}\",{label:\"for\",detail:\"loop\",type:\"keyword\"}),Pe(\"for (let ${name} of ${collection}) {\\n\t${}\\n}\",{label:\"for\",detail:\"of loop\",type:\"keyword\"}),Pe(\"do {\\n\t${}\\n} while (${})\",{label:\"do\",detail:\"loop\",type:\"keyword\"}),Pe(\"while (${}) {\\n\t${}\\n}\",{label:\"while\",detail:\"loop\",type:\"keyword\"}),Pe(`try {\n\t\\${}\n} catch (\\${error}) {\n\t\\${}\n}`,{label:\"try\",detail:\"/ catch block\",type:\"keyword\"}),Pe(\"if (${}) {\\n\t${}\\n}\",{label:\"if\",detail:\"block\",type:\"keyword\"}),Pe(`if (\\${}) {\n\t\\${}\n} else {\n\t\\${}\n}`,{label:\"if\",detail:\"/ else block\",type:\"keyword\"}),Pe(`class \\${name} {\n\tconstructor(\\${params}) {\n\t\t\\${}\n\t}\n}`,{label:\"class\",detail:\"definition\",type:\"keyword\"}),Pe('import {${names}} from \"${module}\"\\n${}',{label:\"import\",detail:\"named\",type:\"keyword\"}),Pe('import ${name} from \"${module}\"\\n${}',{label:\"import\",detail:\"default\",type:\"keyword\"})],W0=Nu.concat([Pe(\"interface ${name} {\\n\t${}\\n}\",{label:\"interface\",detail:\"definition\",type:\"keyword\"}),Pe(\"type ${name} = ${type}\",{label:\"type\",detail:\"definition\",type:\"keyword\"}),Pe(\"enum ${name} {\\n\t${}\\n}\",{label:\"enum\",detail:\"definition\",type:\"keyword\"})]),qu=new Kn,Gu=new Set([\"Script\",\"Block\",\"FunctionExpression\",\"FunctionDeclaration\",\"ArrowFunction\",\"MethodDeclaration\",\"ForStatement\"]);function En(n){return(e,t)=>{let i=e.node.getChild(\"VariableDefinition\");return i&&t(i,n),!0}}var B0=[\"FunctionDeclaration\"],Y0={FunctionDeclaration:En(\"function\"),ClassDeclaration:En(\"class\"),ClassExpression:()=>!0,EnumDeclaration:En(\"constant\"),TypeAliasDeclaration:En(\"type\"),NamespaceDeclaration:En(\"namespace\"),VariableDefinition(n,e){n.matchContext(B0)||e(n,\"variable\")},TypeDefinition(n,e){e(n,\"type\")},__proto__:null};function Uu(n,e){let t=qu.get(e);if(t)return t;let i=[],s=!0;function r(o,l){let a=n.sliceString(o.from,o.to);i.push({label:a,type:l})}return e.cursor(J.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let l=Y0[o.name];if(l&&l(o,r)||Gu.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of Uu(n,o.node))i.push(l);return!1}}),qu.set(e,i),i}var Vu=/^[\\w$\\xa1-\\uffff][\\w$\\d\\xa1-\\uffff]*$/,Fu=[\"TemplateString\",\"String\",\"RegExp\",\"LineComment\",\"BlockComment\",\"VariableDefinition\",\"TypeDefinition\",\"Label\",\"PropertyDefinition\",\"PropertyName\",\"PrivatePropertyDefinition\",\"PrivatePropertyName\",\"JSXText\",\"JSXAttributeValue\",\"JSXOpenTag\",\"JSXCloseTag\",\"JSXSelfClosingTag\",\".\",\"?.\"];function I0(n){let e=se(n.state).resolveInner(n.pos,-1);if(Fu.indexOf(e.name)>-1)return null;let t=e.name==\"VariableName\"||e.to-e.from<20&&Vu.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let s=e;s;s=s.parent)Gu.has(s.name)&&(i=i.concat(Uu(n.state.doc,s)));return{options:i,from:t?e.from:n.pos,validFor:Vu}}var Oi=tr.define({name:\"javascript\",parser:yh.configure({props:[fr.add({IfStatement:ur({except:/^\\s*({|else\\b)/}),TryStatement:ur({except:/^\\s*({|catch\\b|finally\\b)/}),LabeledStatement:iu,SwitchBody:n=>{let e=n.textAfter,t=/^\\s*\\}/.test(e),i=/^\\s*(case|default)\\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:eu({closing:\"}\"}),ArrowFunction:n=>n.baseIndent+n.unit,\"TemplateString BlockComment\":()=>null,\"Statement Property\":ur({except:/^\\s*{/}),JSXElement(n){let e=/^\\s*<\\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\\s*\\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},\"JSXOpenTag JSXSelfClosingTag\"(n){return n.column(n.node.from)+n.unit}}),ca.add({\"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType\":su,BlockComment(n){return{from:n.from+2,to:n.to-2}},JSXElement(n){let e=n.firstChild;if(!e||e.name==\"JSXSelfClosingTag\")return null;let t=n.lastChild;return{from:e.to,to:t.type.isError?n.to:t.from}},\"JSXSelfClosingTag JSXOpenTag\"(n){var e;let t=(e=n.firstChild)===null||e===void 0?void 0:e.nextSibling,i=n.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?n.to:i.from}}})]}),languageData:{closeBrackets:{brackets:[\"(\",\"[\",\"{\",\"'\",'\"',\"`\"]},commentTokens:{line:\"//\",block:{open:\"/*\",close:\"*/\"}},indentOnInput:/^\\s*(?:case |default:|\\{|\\}|<\\/)$/,wordChars:\"$\"}}),Hu={test:n=>/^JSX/.test(n.name),facet:ar({commentTokens:{block:{open:\"{/*\",close:\"*/}\"}}})},q0=Oi.configure({dialect:\"ts\"},\"typescript\"),V0=Oi.configure({dialect:\"jsx\",props:[hr.add(n=>n.isTop?[Hu]:void 0)]}),j0=Oi.configure({dialect:\"jsx ts\",props:[hr.add(n=>n.isTop?[Hu]:void 0)]},\"typescript\"),Ku=n=>({label:n,type:\"keyword\"}),Ju=\"break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield\".split(\" \").map(Ku),N0=Ju.concat([\"declare\",\"implements\",\"private\",\"protected\",\"public\"].map(Ku));function G0(n={}){let e=n.jsx?n.typescript?j0:V0:n.typescript?q0:Oi,t=n.typescript?W0.concat(N0):Nu.concat(Ju);return new ir(e,[Oi.data.of({autocomplete:Mu(Fu,$a(t))}),Oi.data.of({autocomplete:I0}),n.jsx?H0:[]])}function U0(n){for(;;){if(n.name==\"JSXOpenTag\"||n.name==\"JSXSelfClosingTag\"||n.name==\"JSXFragmentTag\")return n;if(n.name==\"JSXEscape\"||!n.parent)return null;n=n.parent}}function ju(n,e,t=n.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name==\"JSXIdentifier\"||i.name==\"JSXBuiltin\"||i.name==\"JSXNamespacedName\"||i.name==\"JSXMemberExpression\")return n.sliceString(i.from,Math.min(i.to,t));return\"\"}var F0=typeof navigator==\"object\"&&/Android\\b/.test(navigator.userAgent),H0=T.inputHandler.of((n,e,t,i,s)=>{if((F0?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=\">\"&&i!=\"/\"||!Oi.isActiveAt(n.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(a=>{var h;let{head:c}=a,f=se(o).resolveInner(c-1,-1),u;if(f.name==\"JSXStartTag\"&&(f=f.parent),!(o.doc.sliceString(c-1,c)!=i||f.name==\"JSXAttributeValue\"&&f.to>c)){if(i==\">\"&&f.name==\"JSXFragmentTag\")return{range:a,changes:{from:c,insert:\"</>\"}};if(i==\"/\"&&f.name==\"JSXStartCloseTag\"){let d=f.parent,p=d.parent;if(p&&d.from==c-2&&((u=ju(o.doc,p.firstChild,c))||((h=p.firstChild)===null||h===void 0?void 0:h.name)==\"JSXFragmentTag\")){let O=`${u}>`;return{range:x.cursor(c+O.length,-1),changes:{from:c,insert:O}}}}else if(i==\">\"){let d=U0(f);if(d&&d.name==\"JSXOpenTag\"&&!/^\\/?>|^<\\//.test(o.doc.sliceString(c,c+2))&&(u=ju(o.doc,d,c)))return{range:a,changes:{from:c,insert:`</${u}>`}}}}return{range:a}});return l.changes.empty?!1:(n.dispatch([r,o.update(l,{userEvent:\"input.complete\",scrollIntoView:!0})]),!0)});function ed(n){td(n,\"start\");var e={},t=n.languageData||{},i=!1;for(var s in n)if(s!=t&&n.hasOwnProperty(s))for(var r=e[s]=[],o=n[s],l=0;l<o.length;l++){var a=o[l];r.push(new e1(a,n)),(a.indent||a.dedent)&&(i=!0)}return{name:t.name,startState:function(){return{state:\"start\",pending:null,indent:i?[]:null}},copyState:function(h){var c={state:h.state,pending:h.pending,indent:h.indent&&h.indent.slice(0)};return h.stack&&(c.stack=h.stack.slice(0)),c},token:t1(e),indent:i1(e,t),mergeTokens:t.mergeTokens,languageData:t}}function td(n,e){if(!n.hasOwnProperty(e))throw new Error(\"Undefined state \"+e+\" in simple mode\")}function K0(n,e){if(!n)return/(?:)/;var t=\"\";return n instanceof RegExp?(n.ignoreCase&&(t=\"i\"),n.unicode&&(t+=\"u\"),n=n.source):n=String(n),new RegExp((e===!1?\"\":\"^\")+\"(?:\"+n+\")\",t)}function J0(n){if(!n)return null;if(n.apply)return n;if(typeof n==\"string\")return n.replace(/\\./g,\" \");for(var e=[],t=0;t<n.length;t++)e.push(n[t]&&n[t].replace(/\\./g,\" \"));return e}function e1(n,e){(n.next||n.push)&&td(e,n.next||n.push),this.regex=K0(n.regex),this.token=J0(n.token),this.data=n}function t1(n){return function(e,t){if(t.pending){var i=t.pending.shift();return t.pending.length==0&&(t.pending=null),e.pos+=i.text.length,i.token}for(var s=n[t.state],r=0;r<s.length;r++){var o=s[r],l=(!o.data.sol||e.sol())&&e.match(o.regex);if(l){o.data.next?t.state=o.data.next:o.data.push?((t.stack||(t.stack=[])).push(t.state),t.state=o.data.push):o.data.pop&&t.stack&&t.stack.length&&(t.state=t.stack.pop()),o.data.indent&&t.indent.push(e.indentation()+e.indentUnit),o.data.dedent&&t.indent.pop();var a=o.token;if(a&&a.apply&&(a=a(l)),l.length>2&&o.token&&typeof o.token!=\"string\"){t.pending=[];for(var h=2;h<l.length;h++)l[h]&&t.pending.push({text:l[h],token:o.token[h-1]});return e.backUp(l[0].length-(l[1]?l[1].length:0)),a[0]}else return a&&a.join?a[0]:a}}return e.next(),null}}function i1(n,e){return function(t,i){if(t.indent==null||e.dontIndentStates&&e.dontIndentStates.indexOf(t.state)>-1)return null;var s=t.indent.length-1,r=n[t.state];e:for(;;){for(var o=0;o<r.length;o++){var l=r[o];if(l.data.dedent&&l.data.dedentIfLineStart!==!1){var a=l.regex.exec(i);if(a&&a[0]){s--,(l.next||l.push)&&(r=n[l.next||l.push]),i=i.slice(a[0].length);continue e}}}break}return s<0?0:t.indent[s]}}var n1=[\"align\",\"block\",\"br(_if|_table|_on_(cast|data|func|i31|null))?\",\"call(_indirect|_ref)?\",\"current_memory\",\"\\\\bdata\\\\b\",\"catch(_all)?\",\"delegate\",\"drop\",\"elem\",\"else\",\"end\",\"export\",\"\\\\bextern\\\\b\",\"\\\\bfunc\\\\b\",\"global(\\\\.(get|set))?\",\"if\",\"import\",\"local(\\\\.(get|set|tee))?\",\"loop\",\"module\",\"mut\",\"nop\",\"offset\",\"param\",\"result\",\"rethrow\",\"return(_call(_indirect|_ref)?)?\",\"select\",\"start\",\"table(\\\\.(size|get|set|size|grow|fill|init|copy))?\",\"then\",\"throw\",\"try\",\"type\",\"unreachable\",\"unwind\",\"i(32|64)\\\\.(store(8|16)|(load(8|16)_[su]))\",\"i64\\\\.(load32_[su]|store32)\",\"[fi](32|64)\\\\.(const|load|store)\",\"f(32|64)\\\\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)\",\"i(32|64)\\\\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)\",\"i64\\\\.extend_[su]_i32\",\"i32\\\\.wrap_i64\",\"i(32|64)\\\\.trunc_f(32|64)_[su]\",\"f(32|64)\\\\.convert_i(32|64)_[su]\",\"f64\\\\.promote_f32\",\"f32\\\\.demote_f64\",\"f32\\\\.reinterpret_i32\",\"i32\\\\.reinterpret_f32\",\"f64\\\\.reinterpret_i64\",\"i64\\\\.reinterpret_f64\",\"memory(\\\\.((atomic\\\\.(notify|wait(32|64)))|grow|size))?\",\"i64.atomic\\\\.(load32_u|store32|rmw32\\\\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)\",\"i(32|64)\\\\.atomic\\\\.(load((8|16)_u)?|store(8|16)?|rmw(\\\\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\\\\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))\",\"v128\\\\.load(8x8|16x4|32x2)_[su]\",\"v128\\\\.load(8|16|32|64)_splat\",\"v128\\\\.(load|store)(8|16|32|64)_lane\",\"v128\\\\.load(32|64)_zero\",\"v128.(load|store|const|not|andnot|and|or|xor|bitselect|any_true)\",\"i(8x16|16x8)\\\\.(extract_lane_[su]|(add|sub)_sat_[su]|avgr_u)\",\"i(8x16|16x8|32x4|64x2)\\\\.(neg|add|sub|abs|shl|shr_[su]|all_true|bitmask|eq|ne|[lg][te]_s)\",\"(i(8x16|16x8|32x4|64x2)|f(32x4|64x2)).(splat|replace_lane)\",\"i(8x16|16x8|32x4)\\\\.(([lg][te]_u)|((min|max)_[su]))\",\"f(32x4|64x2)\\\\.(neg|add|sub|abs|nearest|eq|ne|[lg][te]|sqrt|mul|div|min|max|ceil|floor|trunc)\",\"[fi](32x4|64x2)\\\\.extract_lane\",\"i8x16\\\\.(shuffle|swizzle|popcnt|narrow_i16x8_[su])\",\"i16x8\\\\.(narrow_i32x4_[su]|mul|extadd_pairwise_i8x16_[su]|q15mulr_sat_s)\",\"i16x8\\\\.(extend|extmul)_(low|high)_i8x16_[su]\",\"i32x4\\\\.(mul|dot_i16x8_s|trunc_sat_f64x2_[su]_zero)\",\"i32x4\\\\.((extend|extmul)_(low|high)_i16x8_|trunc_sat_f32x4_|extadd_pairwise_i16x8_)[su]\",\"i64x2\\\\.(mul|(extend|extmul)_(low|high)_i32x4_[su])\",\"f32x4\\\\.(convert_i32x4_[su]|demote_f64x2_zero)\",\"f64x2\\\\.(promote_low_f32x4|convert_low_i32x4_[su])\",\"\\\\bany\\\\b\",\"array\\\\.len\",\"(array|struct)(\\\\.(new_(default_)?with_rtt|get(_[su])?|set))?\",\"\\\\beq\\\\b\",\"field\",\"i31\\\\.(new|get_[su])\",\"\\\\bnull\\\\b\",\"ref(\\\\.(([ai]s_(data|func|i31))|cast|eq|func|(is_|as_non_)?null|test))?\",\"rtt(\\\\.(canon|sub))?\"],s1=ed({start:[{regex:new RegExp(n1.join(\"|\")),token:\"keyword\"},{regex:/\\b((any|data|eq|extern|i31|func)ref|[fi](32|64)|i(8|16))\\b/,token:\"atom\"},{regex:/\\b(funcref|externref|[fi](32|64))\\b/,token:\"atom\"},{regex:/\\$([a-zA-Z0-9_`\\+\\-\\*\\/\\\\\\^~=<>!\\?@#$%&|:\\.]+)/,token:\"variable\"},{regex:/\"(?:[^\"\\\\\\x00-\\x1f\\x7f]|\\\\[nt\\\\'\"]|\\\\[0-9a-fA-F][0-9a-fA-F])*\"/,token:\"string\"},{regex:/\\(;.*?/,token:\"comment\",next:\"comment\"},{regex:/;;.*$/,token:\"comment\"},{regex:/\\(/,indent:!0},{regex:/\\)/,dedent:!0}],comment:[{regex:/.*?;\\)/,token:\"comment\",next:\"start\"},{regex:/.*/,token:\"comment\"}],languageData:{name:\"wast\",dontIndentStates:[\"comment\"]}});var r1=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Wa(n.state,t.from);return i.line?o1(n):i.block?a1(n):!1};function _a(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}var o1=_a(f1,0);var l1=_a(cd,0);var a1=_a((n,e)=>cd(n,e,c1(e)),0);function Wa(n,e){let t=n.languageDataAt(\"commentTokens\",e,1);return t.length?t[0]:{}}var Dn=50;function h1(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Dn,i),o=n.sliceDoc(s,s+Dn),l=/\\s*$/.exec(r)[0].length,a=/^\\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*Dn?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Dn),f=n.sliceDoc(s-Dn,s));let u=/^\\s*/.exec(c)[0].length,d=/\\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\\s/.test(f.charAt(p-1))?1:0}}:null}function c1(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to);s.from>i.from&&s.from==t.to&&(s=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\\s*/.exec(i.text)[0].length,to:s.to})}return e}function cd(n,e,t=e.selection.ranges){let i=t.map(r=>Wa(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>h1(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+\" \"},{from:r.to,insert:\" \"+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let a=i[o],{open:h,close:c}=l;r.push({from:h.pos-a.open.length,to:h.pos+h.margin},{from:c.pos-c.margin,to:c.pos+a.close.length})}return{changes:r}}return null}function f1(n,e,t=e.selection.ranges){let i=[],s=-1;e:for(let{from:r,to:o}of t){let l=i.length,a=1e9,h;for(let c=r;c<=o;){let f=e.doc.lineAt(c);if(h==null&&(h=Wa(e,f.from).line,!h))continue e;if(f.from>s&&(r==o||o>f.from)){s=f.from;let u=/^\\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;u<f.text.length&&u<a&&(a=u),i.push({line:f,comment:p,token:h,indent:u,empty:d,single:!1})}c=f.to+1}if(a<1e9)for(let c=l;c<i.length;c++)i[c].indent<i[c].line.text.length&&(i[c].indent=a);i.length==l+1&&(i[l].single=!0)}if(n!=2&&i.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+\" \"});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==\" \"&&c++,r.push({from:h,to:c})}return{changes:r}}return null}var La=Ze.define(),u1=Ze.define(),d1=P.define(),fd=P.define({combine(n){return be(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}}),ud=ne.define({create(){return mi.empty},update(n,e){let t=e.state.facet(fd),i=e.annotation(La);if(i){let a=at.fromTransaction(e,i.selection),h=i.side,c=h==0?n.undone:n.done;return a?c=Sr(c,c.length,t.minDepth,a):c=md(c,e.startState.selection),new mi(h==0?i.rest:c,h==0?c:i.rest)}let s=e.annotation(u1);if((s==\"full\"||s==\"before\")&&(n=n.isolate()),e.annotation(ae.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=at.fromTransaction(e),o=e.annotation(ae.time),l=e.annotation(ae.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s==\"full\"||s==\"after\")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new mi(n.done.map(at.fromJSON),n.undone.map(at.fromJSON))}});function dd(n={}){return[ud,fd.of(n),T.domEventHandlers({beforeinput(e,t){let i=e.inputType==\"historyUndo\"?pd:e.inputType==\"historyRedo\"?Ea:null;return i?(e.preventDefault(),i(t)):!1}})]}function wr(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(ud,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}var pd=wr(0,!1),Ea=wr(1,!1),p1=wr(0,!0),O1=wr(1,!0);var at=class n{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new n(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new n(e.changes&&Qe.fromJSON(e.changes),[],e.mapped&&wt.fromJSON(e.mapped),e.startSelection&&x.fromJSON(e.startSelection),e.selectionsAfter.map(x.fromJSON))}static fromTransaction(e,t){let i=et;for(let s of e.startState.facet(d1)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new n(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,et)}static selection(e){return new n(void 0,et,void 0,void 0,e)}};function Sr(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function m1(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a<t.length;){let h=t[a++],c=t[a++];l>=h&&o<=c&&(i=!0)}}),i}function g1(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Od(n,e){return n.length?e.length?n.concat(e):n:e}var et=[],y1=200;function md(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-y1));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Sr(n,n.length-1,1e9,t.setSelAfter(i)))}else return[at.selection([e])]}function x1(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Xa(n,e){if(!n.length)return n;let t=n.length,i=et;for(;t;){let s=b1(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[at.selection(i)]:et}function b1(n,e,t){let i=Od(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):et,t);if(!n.changes)return at.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new at(s,E.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}var S1=/^(input\\.type|delete)($|\\.)/,mi=class n{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new n(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||S1.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,m1(l.changes,e.changes))||i==\"input.type.compose\")?o=Sr(o,o.length-1,s.minDepth,new at(e.changes.compose(l.changes),Od(E.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,et)):o=Sr(o,o.length,s.minDepth,e),new n(o,et,t,i)}addSelection(e,t,i,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:et;return r.length>0&&t-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\\.)/.test(i)&&g1(r[r.length-1],e)?this:new n(md(this.done,e),this.undone,t,i)}addMapping(e){return new n(Xa(this.done,e),Xa(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let s=e==0?this.done:this.undone;if(s.length==0)return null;let r=s[s.length-1],o=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):t.selection);if(i&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:La.of({side:e,rest:x1(s),selection:o}),userEvent:e==0?\"select.undo\":\"select.redo\",scrollIntoView:!0});if(r.changes){let l=s.length==1?et:s.slice(0,s.length-1);return r.mapped&&(l=Xa(l,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:La.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?\"undo\":\"redo\",scrollIntoView:!0})}else return null}};mi.empty=new mi(et,et);var gd=[{key:\"Mod-z\",run:pd,preventDefault:!0},{key:\"Mod-y\",mac:\"Mod-Shift-z\",run:Ea,preventDefault:!0},{linux:\"Ctrl-Shift-z\",run:Ea,preventDefault:!0},{key:\"Mod-u\",run:p1,preventDefault:!0},{key:\"Alt-u\",mac:\"Mod-Shift-u\",run:O1,preventDefault:!0}];function Vi(n,e){return x.create(n.ranges.map(e),n.mainIndex)}function ht(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:\"select\"})}function ct({state:n,dispatch:e},t){let i=Vi(n.selection,t);return i.eq(n.selection,!0)?!1:(e(ht(n,i)),!0)}function kr(n,e){return x.cursor(e?n.to:n.from)}function yd(n,e){return ct(n,t=>t.empty?n.moveByChar(t,e):kr(t,e))}function Se(n){return n.textDirectionAt(n.state.selection.main.head)==N.LTR}var xd=n=>yd(n,!Se(n)),bd=n=>yd(n,Se(n));function Sd(n,e){return ct(n,t=>t.empty?n.moveByGroup(t,e):kr(t,e))}var w1=n=>Sd(n,!Se(n)),k1=n=>Sd(n,Se(n));var Ob=typeof Intl<\"u\"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:\"word\"}):null;function Q1(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Qr(n,e,t){let i=se(n).resolveInner(e.head),s=t?z.closedBy:z.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Q1(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?lt(n,i.from,1):lt(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,x.cursor(l,t?-1:1)}var v1=n=>ct(n,e=>Qr(n.state,e,!Se(n))),$1=n=>ct(n,e=>Qr(n.state,e,Se(n)));function wd(n,e){return ct(n,t=>{if(!t.empty)return kr(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}var kd=n=>wd(n,!1),Qd=n=>wd(n,!0);function vd(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,s;if(e){for(let r of n.state.facet(T.scrollMargins)){let o=r(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(i=Math.max(o?.bottom,i))}s=n.scrollDOM.clientHeight-t-i}else s=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,s-5)}}function $d(n,e){let t=vd(n),{state:i}=n,s=Vi(i.selection,o=>o.empty?n.moveVertically(o,e,t.height):kr(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottom<h&&(r=T.scrollIntoView(s.main.head,{y:\"start\",yMargin:o.top-a}))}return n.dispatch(ht(i,s),{effects:r}),!0}var id=n=>$d(n,!1),Da=n=>$d(n,!0);function Yt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=x.cursor(i.from+r))}return s}var P1=n=>ct(n,e=>Yt(n,e,!0)),T1=n=>ct(n,e=>Yt(n,e,!1)),C1=n=>ct(n,e=>Yt(n,e,!Se(n))),Z1=n=>ct(n,e=>Yt(n,e,Se(n))),A1=n=>ct(n,e=>x.cursor(n.lineBlockAt(e.head).from,1)),M1=n=>ct(n,e=>x.cursor(n.lineBlockAt(e.head).to,-1));function R1(n,e,t){let i=!1,s=Vi(n.selection,r=>{let o=lt(n,r.head,-1)||lt(n,r.head,1)||r.head>0&&lt(n,r.head-1,1)||r.head<n.doc.length&&lt(n,r.head+1,-1);if(!o||!o.end)return r;i=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return t?x.range(r.anchor,l):x.cursor(l)});return i?(e(ht(n,s)),!0):!1}var X1=({state:n,dispatch:e})=>R1(n,e,!1);function tt(n,e){let t=Vi(n.state.selection,i=>{let s=e(i);return x.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return t.eq(n.state.selection)?!1:(n.dispatch(ht(n.state,t)),!0)}function Pd(n,e){return tt(n,t=>n.moveByChar(t,e))}var Td=n=>Pd(n,!Se(n)),Cd=n=>Pd(n,Se(n));function Zd(n,e){return tt(n,t=>n.moveByGroup(t,e))}var L1=n=>Zd(n,!Se(n)),E1=n=>Zd(n,Se(n));var D1=n=>tt(n,e=>Qr(n.state,e,!Se(n))),z1=n=>tt(n,e=>Qr(n.state,e,Se(n)));function Ad(n,e){return tt(n,t=>n.moveVertically(t,e))}var Md=n=>Ad(n,!1),Rd=n=>Ad(n,!0);function Xd(n,e){return tt(n,t=>n.moveVertically(t,e,vd(n).height))}var nd=n=>Xd(n,!1),sd=n=>Xd(n,!0),_1=n=>tt(n,e=>Yt(n,e,!0)),W1=n=>tt(n,e=>Yt(n,e,!1)),B1=n=>tt(n,e=>Yt(n,e,!Se(n))),Y1=n=>tt(n,e=>Yt(n,e,Se(n))),I1=n=>tt(n,e=>x.cursor(n.lineBlockAt(e.head).from)),q1=n=>tt(n,e=>x.cursor(n.lineBlockAt(e.head).to)),rd=({state:n,dispatch:e})=>(e(ht(n,{anchor:0})),!0),od=({state:n,dispatch:e})=>(e(ht(n,{anchor:n.doc.length})),!0),ld=({state:n,dispatch:e})=>(e(ht(n,{anchor:n.selection.main.anchor,head:0})),!0),ad=({state:n,dispatch:e})=>(e(ht(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),V1=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:\"select\"})),!0),j1=({state:n,dispatch:e})=>{let t=vr(n).map(({from:i,to:s})=>x.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:x.create(t),userEvent:\"select\"})),!0},N1=({state:n,dispatch:e})=>{let t=Vi(n.selection,i=>{let s=se(n),r=s.resolveStack(i.from,1);if(i.empty){let o=s.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return x.range(l.to,l.from)}return i});return t.eq(n.selection)?!1:(e(ht(n,t)),!0)};function Ld(n,e){let{state:t}=n,i=t.selection,s=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to<n.state.doc.length:o.from>0)for(let l=r;;){let a=n.moveVertically(l,e);if(a.head<o.from||a.head>o.to){s.some(h=>h.head==a.head)||s.push(a);break}else{if(a.head==l.head)break;l=a}}}return s.length==i.ranges.length?!1:(n.dispatch(ht(t,x.create(s,s.length-1))),!0)}var G1=n=>Ld(n,!1),U1=n=>Ld(n,!0),F1=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=x.create([t.main]):t.main.empty||(i=x.create([x.cursor(t.main.head)])),i?(e(ht(n,i)),!0):!1};function zn(n,e){if(n.state.readOnly)return!1;let t=\"delete.selection\",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);a<o?(t=\"delete.backward\",a=br(n,a,!1)):a>o&&(t=\"delete.forward\",a=br(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=br(n,o,!1),l=br(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:x.cursor(o,o<r.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t==\"delete.selection\"?T.announce.of(i.phrase(\"Selection deleted\")):void 0})),!0)}function br(n,e,t){if(n instanceof T)for(let i of n.state.facet(T.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{s<e&&r>e&&(e=t?r:s)});return e}var Ed=(n,e,t)=>zn(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&s<o.from+200&&!/[^ \\t]/.test(l=o.text.slice(0,s-o.from))){if(l[l.length-1]==\"\t\")return s-1;let h=kt(l,r.tabSize),c=h%Bt(r)||Bt(r);for(let f=0;f<c&&l[l.length-1-f]==\" \";f++)s--;a=s}else a=re(o.text,s-o.from,e,e)+o.from,a==s&&o.number!=(e?r.doc.lines:1)?a+=e?1:-1:!e&&/[\\ufe00-\\ufe0f]/.test(o.text.slice(a-o.from,s-o.from))&&(a=re(o.text,a-o.from,!1,!1)+o.from);return a}),za=n=>Ed(n,!1,!0);var Dd=n=>Ed(n,!0,!1),zd=(n,e)=>zn(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=re(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=\" \"||i!=t.head)&&(l=c),i=a}return i}),_d=n=>zd(n,!1),H1=n=>zd(n,!0);var K1=n=>zn(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)});var J1=n=>zn(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),ey=n=>zn(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)});var ty=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:B.of([\"\",\"\"])},range:x.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:\"input\"})),!0},iy=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:re(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:re(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:x.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:\"move.character\"})),!0)};function vr(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Wd(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of vr(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(x.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(x.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:x.create(s,n.selection.mainIndex),userEvent:\"move.line\"})),!0):!1}var ny=({state:n,dispatch:e})=>Wd(n,e,!1),sy=({state:n,dispatch:e})=>Wd(n,e,!0);function Bd(n,e,t){if(n.readOnly)return!1;let i=[];for(let r of vr(n))t?i.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):i.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});let s=n.changes(i);return e(n.update({changes:s,selection:n.selection.map(s,t?1:-1),scrollIntoView:!0,userEvent:\"input.copyline\"})),!0}var ry=({state:n,dispatch:e})=>Bd(n,e,!1),oy=({state:n,dispatch:e})=>Bd(n,e,!0),ly=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(vr(e).map(({from:s,to:r})=>(s>0?s--:r<e.doc.length&&r++,{from:s,to:r}))),i=Vi(e.selection,s=>{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:\"delete.line\"}),!0};function ay(n,e){if(/\\(\\)|\\[\\]|\\{\\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=se(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(z.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}var hd=Yd(!1),hy=Yd(!0);function Yd(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&ay(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new fi(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=cr(h,r);for(c==null&&(c=kt(/^\\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));o<l.to&&/\\s/.test(l.text[o-l.from]);)o++;a?{from:r,to:o}=a:r>l.from&&r<l.from+100&&!/\\S/.test(l.text.slice(0,r))&&(r=l.from);let f=[\"\",Ii(e,c)];return a&&f.push(Ii(e,h.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:B.of(f)},range:x.cursor(r+1+f[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:\"input\"})),!0}}function Ba(n,e){let t=-1;return n.changeByRange(i=>{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:x.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}var cy=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new fi(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=Ba(n,(r,o,l)=>{let a=cr(i,r.from);if(a==null)return;/\\S/.test(r.text)||(a=0);let h=/^\\s*/.exec(r.text)[0],c=Ii(n,a);(h!=c||l.from<r.from+h.length)&&(t[r.from]=a,o.push({from:r.from,to:r.from+h.length,insert:c}))});return s.changes.empty||e(n.update(s,{userEvent:\"indent\"})),!0},fy=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ba(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Yi)})}),{userEvent:\"input.indent\"})),!0),uy=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ba(n,(t,i)=>{let s=/^\\s*/.exec(t.text)[0];if(!s)return;let r=kt(s,n.tabSize),o=0,l=Ii(n,Math.max(0,r-Bt(n)));for(;o<s.length&&o<l.length&&s.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:t.from+o,to:t.from+s.length,insert:l.slice(o)})}),{userEvent:\"delete.dedent\"})),!0),dy=n=>(n.setTabFocusMode(),!0);var py=[{key:\"Ctrl-b\",run:xd,shift:Td,preventDefault:!0},{key:\"Ctrl-f\",run:bd,shift:Cd},{key:\"Ctrl-p\",run:kd,shift:Md},{key:\"Ctrl-n\",run:Qd,shift:Rd},{key:\"Ctrl-a\",run:A1,shift:I1},{key:\"Ctrl-e\",run:M1,shift:q1},{key:\"Ctrl-d\",run:Dd},{key:\"Ctrl-h\",run:za},{key:\"Ctrl-k\",run:K1},{key:\"Ctrl-Alt-h\",run:_d},{key:\"Ctrl-o\",run:ty},{key:\"Ctrl-t\",run:iy},{key:\"Ctrl-v\",run:Da}],Oy=[{key:\"ArrowLeft\",run:xd,shift:Td,preventDefault:!0},{key:\"Mod-ArrowLeft\",mac:\"Alt-ArrowLeft\",run:w1,shift:L1,preventDefault:!0},{mac:\"Cmd-ArrowLeft\",run:C1,shift:B1,preventDefault:!0},{key:\"ArrowRight\",run:bd,shift:Cd,preventDefault:!0},{key:\"Mod-ArrowRight\",mac:\"Alt-ArrowRight\",run:k1,shift:E1,preventDefault:!0},{mac:\"Cmd-ArrowRight\",run:Z1,shift:Y1,preventDefault:!0},{key:\"ArrowUp\",run:kd,shift:Md,preventDefault:!0},{mac:\"Cmd-ArrowUp\",run:rd,shift:ld},{mac:\"Ctrl-ArrowUp\",run:id,shift:nd},{key:\"ArrowDown\",run:Qd,shift:Rd,preventDefault:!0},{mac:\"Cmd-ArrowDown\",run:od,shift:ad},{mac:\"Ctrl-ArrowDown\",run:Da,shift:sd},{key:\"PageUp\",run:id,shift:nd},{key:\"PageDown\",run:Da,shift:sd},{key:\"Home\",run:T1,shift:W1,preventDefault:!0},{key:\"Mod-Home\",run:rd,shift:ld},{key:\"End\",run:P1,shift:_1,preventDefault:!0},{key:\"Mod-End\",run:od,shift:ad},{key:\"Enter\",run:hd,shift:hd},{key:\"Mod-a\",run:V1},{key:\"Backspace\",run:za,shift:za,preventDefault:!0},{key:\"Delete\",run:Dd,preventDefault:!0},{key:\"Mod-Backspace\",mac:\"Alt-Backspace\",run:_d,preventDefault:!0},{key:\"Mod-Delete\",mac:\"Alt-Delete\",run:H1,preventDefault:!0},{mac:\"Mod-Backspace\",run:J1,preventDefault:!0},{mac:\"Mod-Delete\",run:ey,preventDefault:!0}].concat(py.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Id=[{key:\"Alt-ArrowLeft\",mac:\"Ctrl-ArrowLeft\",run:v1,shift:D1},{key:\"Alt-ArrowRight\",mac:\"Ctrl-ArrowRight\",run:$1,shift:z1},{key:\"Alt-ArrowUp\",run:ny},{key:\"Shift-Alt-ArrowUp\",run:ry},{key:\"Alt-ArrowDown\",run:sy},{key:\"Shift-Alt-ArrowDown\",run:oy},{key:\"Mod-Alt-ArrowUp\",run:G1},{key:\"Mod-Alt-ArrowDown\",run:U1},{key:\"Escape\",run:F1},{key:\"Mod-Enter\",run:hy},{key:\"Alt-l\",mac:\"Ctrl-l\",run:j1},{key:\"Mod-i\",run:N1,preventDefault:!0},{key:\"Mod-[\",run:uy},{key:\"Mod-]\",run:fy},{key:\"Mod-Alt-\\\\\",run:cy},{key:\"Shift-Mod-k\",run:ly},{key:\"Shift-Mod-\\\\\",run:X1},{key:\"Mod-/\",run:r1},{key:\"Alt-A\",run:l1},{key:\"Ctrl-m\",mac:\"Shift-Alt-m\",run:dy}].concat(Oy);var qd=typeof String.prototype.normalize==\"function\"?n=>n.normalize(\"NFKD\"):n=>n,qt=class{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=\"\",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(qd(l)):qd,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Oe(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=on(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=_e(e);let s=this.normalize(t);if(s.length)for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&r<t.length&&t.charCodeAt(r)==l&&o++}}}match(e,t,i){let s=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?s={from:this.matches[r+1],to:i}:(this.matches[r]++,l=!0)),l||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:t,to:i}:this.matches.push(1,t)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}};typeof Symbol<\"u\"&&(qt.prototype[Symbol.iterator]=function(){return this});var Nd={from:-1,to:-1,match:/.*/.exec(\"\")},Na=\"gm\"+(/x/.unicode==null?\"\":\"u\"),Tr=class{constructor(e,t,i,s=0,r=e.length){if(this.text=e,this.to=r,this.curLine=\"\",this.done=!1,this.value=Nd,/\\\\[sWDnr]|\\n|\\r|\\[\\^/.test(t))return new Zr(e,t,i,s,r);this.re=new RegExp(t,Na+(i?.ignoreCase?\"i\":\"\")),this.test=i?.test,this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=Ar(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=\"\":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=\"\":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=Ar(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<s||i>this.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},Ya=new WeakMap,Cr=class n{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let s=Ya.get(e);if(!s||s.from>=i||s.to<=t){let l=new n(t,e.sliceString(t,i));return Ya.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to<i&&(r+=e.sliceString(s.to,i)),Ya.set(e,new n(o,r)),new n(t,r.slice(t-o,i-o))}},Zr=class{constructor(e,t,i,s,r){this.text=e,this.to=r,this.done=!1,this.value=Nd,this.matchPos=Ar(e,s),this.re=new RegExp(t,Na+(i?.ignoreCase?\"i\":\"\")),this.test=i?.test,this.flat=Cr.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=Ar(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Cr.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<\"u\"&&(Tr.prototype[Symbol.iterator]=Zr.prototype[Symbol.iterator]=function(){return this});function my(n){try{return new RegExp(n,Na),!0}catch{return!1}}function Ar(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e<t.to&&(i=t.text.charCodeAt(e-t.from))>=56320&&i<57344;)e++;return e}var gy=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:i,result:s}=Df(n,{label:e.phrase(\"Go to line\"),input:{type:\"text\",name:\"line\",value:t},focus:!0,submitLabel:e.phrase(\"go\")});return s.then(r=>{let o=r&&/^([+-])?(\\d+)?(:\\d+)?(%)?$/.exec(r.elements.line.value);if(!o){n.dispatch({effects:i});return}let l=e.doc.lineAt(e.selection.main.head),[,a,h,c,f]=o,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let m=d/100;a&&(m=m*(a==\"-\"?-1:1)+l.number/e.doc.lines),d=Math.round(e.doc.lines*m)}else h&&a&&(d=d*(a==\"-\"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,d))),O=x.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[i,T.scrollIntoView(O.from,{y:\"center\"})],selection:O})}),!0},yy={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Gd=P.define({combine(n){return be(n,yy,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Ud(n){let e=[ky,wy];return n&&e.push(Gd.of(n)),e}var xy=R.mark({class:\"cm-selectionMatch\"}),by=R.mark({class:\"cm-selectionMatch cm-selectionMatch-main\"});function Vd(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=F.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=F.Word)}function Sy(n,e,t,i){return n(e.sliceDoc(t,t+1))==F.Word&&n(e.sliceDoc(i-1,i))==F.Word}var wy=ie.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Gd),{state:t}=n,i=t.selection;if(i.ranges.length>1)return R.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return R.none;let a=t.wordAt(s.head);if(!a)return R.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a<e.minSelectionLength||a>200)return R.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Vd(o,t,s.from,s.to)&&Sy(o,t,s.from,s.to)))return R.none}else if(r=t.sliceDoc(s.from,s.to),!r)return R.none}let l=[];for(let a of n.visibleRanges){let h=new qt(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Vd(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(by.range(c,f)):(c>=s.to||f<=s.from)&&l.push(xy.range(c,f)),l.length>e.maxMatches))return R.none}}return R.set(l)}},{decorations:n=>n.decorations}),ky=T.baseTheme({\".cm-selectionMatch\":{backgroundColor:\"#99ff7780\"},\".cm-searchMatch .cm-selectionMatch\":{backgroundColor:\"transparent\"}}),Qy=({state:n,dispatch:e})=>{let{selection:t}=n,i=x.create(t.ranges.map(s=>n.wordAt(s.head)||x.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function vy(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new qt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new qt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}var $y=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Qy({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=vy(n,i);return s?(e(n.update({selection:n.selection.addRange(x.range(s.from,s.to),!1),effects:T.scrollIntoView(s.to)})),!0):!1},Gi=P.define({combine(n){return be(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ja(e),scrollToMatch:e=>T.scrollIntoView(e)})}});var Mr=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||\"\",this.valid=!!this.search&&(!this.regexp||my(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\\\([nrt\\\\])/g,(t,i)=>i==\"n\"?`\n`:i==\"r\"?\"\\r\":i==\"t\"?\"\t\":\"\\\\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new qa(this):new Ia(this)}getCursor(e,t=0,i){let s=e.doc?e:H.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Ni(this,s,t,i):ji(this,s,t,i)}},Rr=class{constructor(e){this.spec=e}};function Py(n,e,t){return(i,s,r,o)=>{if(t&&!t(i,s,r,o))return!1;let l=i>=o&&s<=o+r.length?r.slice(i-o,s-o):e.doc.sliceString(i,s);return n(l,e,i,s)}}function ji(n,e,t,i){let s;return n.wholeWord&&(s=Ty(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(s=Py(n.test,e,s)),new qt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),s)}function Ty(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(Xr(s,t-r))!=F.Word||e(Lr(s,t-r))!=F.Word)&&(e(Lr(s,i-r))!=F.Word||e(Xr(s,i-r))!=F.Word))}var Ia=class extends Rr{constructor(e){super(e)}nextMatch(e,t,i){let s=ji(this.spec,e,i,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,t+this.spec.unquoted.length);s=ji(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==i?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=ji(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=i)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=ji(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=ji(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}};function Cy(n,e,t){return(i,s,r)=>(!t||t(i,s,r))&&n(r[0],e,i,s)}function Ni(n,e,t,i){let s;return n.wholeWord&&(s=Zy(e.charCategorizer(e.selection.main.head))),n.test&&(s=Cy(n.test,e,s)),new Tr(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:s},t,i)}function Xr(n,e){return n.slice(re(n,e,!1),e)}function Lr(n,e){return n.slice(e,re(n,e))}function Zy(n){return(e,t,i)=>!i[0].length||(n(Xr(i.input,i.index))!=F.Word||n(Lr(i.input,i.index))!=F.Word)&&(n(Lr(i.input,i.index+i[0].length))!=F.Word||n(Xr(i.input,i.index+i[0].length))!=F.Word)}var qa=class extends Rr{nextMatch(e,t,i){let s=Ni(this.spec,e,i,e.doc.length).next();return s.done&&(s=Ni(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Ni(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\\$([$&]|\\d+)/g,(t,i)=>{if(i==\"&\")return e.match[0];if(i==\"$\")return\"$\";for(let s=i.length;s>0;s--){let r=+i.slice(0,s);if(r>0&&r<e.match.length)return e.match[r]+i.slice(s)}return t})}matchAll(e,t){let i=Ni(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Ni(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}},Wn=E.define(),Ga=E.define(),It=ne.define({create(n){return new _n(Va(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Wn)?n=new _n(t.value.create(),n.panel):t.is(Ga)&&(n=new _n(n.query,t.value?Ua:null));return n},provide:n=>hi.from(n,e=>e.panel)});var _n=class{constructor(e,t){this.query=e,this.panel=t}},Ay=R.mark({class:\"cm-searchMatch\"}),My=R.mark({class:\"cm-searchMatch cm-searchMatch-selected\"}),Ry=ie.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(It))}update(n){let e=n.state.field(It);(e!=n.startState.field(It)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return R.none;let{view:t}=this,i=new ze;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-500;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?My:Ay)})}return i.finish()}},{decorations:n=>n.decorations});function Bn(n){return e=>{let t=e.state.field(It,!1);return t&&t.query.spec.valid?n(e,t):Kd(e)}}var Er=Bn((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=x.single(i.from,i.to),r=n.state.facet(Gi);return n.dispatch({selection:s,effects:[Fa(n,i),r.scrollToMatch(s.main,n)],userEvent:\"select.search\"}),Hd(n),!0}),Dr=Bn((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=x.single(s.from,s.to),o=n.state.facet(Gi);return n.dispatch({selection:r,effects:[Fa(n,s),o.scrollToMatch(r.main,n)],userEvent:\"select.search\"}),Hd(n),!0}),Xy=Bn((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:x.create(t.map(i=>x.range(i.from,i.to))),userEvent:\"select.search.matches\"}),!0)}),Ly=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new qt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(x.range(l.value.from,l.value.to))}return e(n.update({selection:x.create(r,o),userEvent:\"select.search.matches\"})),!0},jd=Bn((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=r,l=[],a,h,c=[];o.from==i&&o.to==s&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(T.announce.of(t.phrase(\"replaced match on line $\",t.doc.lineAt(i).number)+\".\")));let f=n.state.changes(l);return o&&(a=x.single(o.from,o.to).map(f),c.push(Fa(n,o)),c.push(t.facet(Gi).scrollToMatch(a.main,n))),n.dispatch({changes:f,selection:a,effects:c,userEvent:\"input.replace\"}),!0}),Ey=Bn((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase(\"replaced $ matches\",t.length)+\".\";return n.dispatch({changes:t,effects:T.announce.of(i),userEvent:\"input.replace.all\"}),!0});function Ua(n){return n.state.facet(Gi).createPanel(n)}function Va(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?\"\":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(Gi);return new Mr({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\\n/g,\"\\\\n\"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e?.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Fd(n){let e=vn(n,Ua);return e&&e.dom.querySelector(\"[main-field]\")}function Hd(n){let e=Fd(n);e&&e==n.root.activeElement&&e.select()}var Kd=n=>{let e=n.state.field(It,!1);if(e&&e.panel){let t=Fd(n);if(t&&t!=n.root.activeElement){let i=Va(n.state,e.query.spec);i.valid&&n.dispatch({effects:Wn.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Ga.of(!0),e?Wn.of(Va(n.state,e.query.spec)):E.appendConfig.of(zy)]});return!0},Jd=n=>{let e=n.state.field(It,!1);if(!e||!e.panel)return!1;let t=vn(n,Ua);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Ga.of(!1)}),!0},ep=[{key:\"Mod-f\",run:Kd,scope:\"editor search-panel\"},{key:\"F3\",run:Er,shift:Dr,scope:\"editor search-panel\",preventDefault:!0},{key:\"Mod-g\",run:Er,shift:Dr,scope:\"editor search-panel\",preventDefault:!0},{key:\"Escape\",run:Jd,scope:\"editor search-panel\"},{key:\"Mod-Shift-l\",run:Ly},{key:\"Mod-Alt-g\",run:gy},{key:\"Mod-d\",run:$y,preventDefault:!0}],ja=class{constructor(e){this.view=e;let t=this.query=e.state.field(It).query.spec;this.commit=this.commit.bind(this),this.searchField=V(\"input\",{value:t.search,placeholder:Ye(e,\"Find\"),\"aria-label\":Ye(e,\"Find\"),class:\"cm-textfield\",name:\"search\",form:\"\",\"main-field\":\"true\",onchange:this.commit,onkeyup:this.commit}),this.replaceField=V(\"input\",{value:t.replace,placeholder:Ye(e,\"Replace\"),\"aria-label\":Ye(e,\"Replace\"),class:\"cm-textfield\",name:\"replace\",form:\"\",onchange:this.commit,onkeyup:this.commit}),this.caseField=V(\"input\",{type:\"checkbox\",name:\"case\",form:\"\",checked:t.caseSensitive,onchange:this.commit}),this.reField=V(\"input\",{type:\"checkbox\",name:\"re\",form:\"\",checked:t.regexp,onchange:this.commit}),this.wordField=V(\"input\",{type:\"checkbox\",name:\"word\",form:\"\",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return V(\"button\",{class:\"cm-button\",name:s,onclick:r,type:\"button\"},o)}this.dom=V(\"div\",{onkeydown:s=>this.keydown(s),class:\"cm-search\"},[this.searchField,i(\"next\",()=>Er(e),[Ye(e,\"next\")]),i(\"prev\",()=>Dr(e),[Ye(e,\"previous\")]),i(\"select\",()=>Xy(e),[Ye(e,\"all\")]),V(\"label\",null,[this.caseField,Ye(e,\"match case\")]),V(\"label\",null,[this.reField,Ye(e,\"regexp\")]),V(\"label\",null,[this.wordField,Ye(e,\"by word\")]),...e.state.readOnly?[]:[V(\"br\"),this.replaceField,i(\"replace\",()=>jd(e),[Ye(e,\"replace\")]),i(\"replaceAll\",()=>Ey(e),[Ye(e,\"replace all\")])],V(\"button\",{name:\"close\",onclick:()=>Jd(e),\"aria-label\":Ye(e,\"close\"),type:\"button\"},[\"\\xD7\"])])}commit(){let e=new Mr({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Wn.of(e)}))}keydown(e){kf(this.view,e,\"search-panel\")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Dr:Er)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),jd(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Wn)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Gi).top}};function Ye(n,e){return n.state.phrase(e)}var $r=30,Pr=/[\\s\\.,:;?!]/;function Fa(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-$r),o=Math.min(s,t+$r),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<$r;a++)if(!Pr.test(l[a+1])&&Pr.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-$r;a--)if(!Pr.test(l[a-1])&&Pr.test(l[a])){l=l.slice(0,a);break}}return T.announce.of(`${n.state.phrase(\"current match\")}. ${l} ${n.state.phrase(\"on line\")} ${i.number}.`)}var Dy=T.baseTheme({\".cm-panel.cm-search\":{padding:\"2px 6px 4px\",position:\"relative\",\"& [name=close]\":{position:\"absolute\",top:\"0\",right:\"4px\",backgroundColor:\"inherit\",border:\"none\",font:\"inherit\",padding:0,margin:0},\"& input, & button, & label\":{margin:\".2em .6em .2em 0\"},\"& input[type=checkbox]\":{marginRight:\".2em\"},\"& label\":{fontSize:\"80%\",whiteSpace:\"pre\"}},\"&light .cm-searchMatch\":{backgroundColor:\"#ffff0054\"},\"&dark .cm-searchMatch\":{backgroundColor:\"#00ffff8a\"},\"&light .cm-searchMatch-selected\":{backgroundColor:\"#ff6a0054\"},\"&dark .cm-searchMatch-selected\":{backgroundColor:\"#ff00ff8a\"}}),zy=[It,Ue.low(Ry),Dy];var _r=class{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}},gi=class n{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=i.facet(Yn).markerFilter;s&&(e=s(e,i));let r=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new ze,l=[],a=0,h=i.doc.iter(),c=0,f=i.doc.length;for(let d=0;;){let p=d==r.length?null:r[d];if(!p&&!l.length)break;let O,m;if(l.length)O=a,m=l.reduce((b,A)=>Math.min(b,A.to),p&&p.from>O?p.from:1e8);else{if(O=p.from,O>f)break;m=p.to,l.push(p),d++}for(;d<r.length;){let b=r[d];if(b.from==O&&(b.to>b.from||b.to==O))l.push(b),d++,m=Math.min(b.to,m);else{m=Math.min(b.from,m);break}}m=Math.min(m,f);let g=!1;if(l.some(b=>b.from==O&&(b.to==m||m==f))&&(g=O==m,!g&&m-O<10)){let b=O-(c+h.value.length);b>0&&(h.next(b),c=O);for(let A=O;;){if(A>=m){g=!0;break}if(!h.lineBreak&&c+h.value.length>A)break;A=c+h.value.length,c+=h.value.length,h.next()}}let S=Uy(l);if(g)o.add(O,O,R.widget({widget:new Ha(S),diagnostics:l.slice()}));else{let b=l.reduce((A,w)=>w.markClass?A+\" \"+w.markClass:A,\"\");o.add(O,m,R.mark({class:\"cm-lintRange cm-lintRange-\"+S+b,diagnostics:l.slice(),inclusiveEnd:l.some(A=>A.to>m)}))}if(a=m,a==f)break;for(let b=0;b<l.length;b++)l[b].to<=a&&l.splice(b--,1)}let u=o.finish();return new n(u,t,Vt(u))}};function Vt(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new _r(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new _r(i.from,r,i.diagnostic)}}),i}function _y(n,e){let t=e.pos,i=e.end||t,s=n.state.facet(Yn).hideOn(n,t,i);if(s!=null)return s;let r=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is(np))||n.changes.touchesRange(r.from,Math.max(r.to,i)))}function Wy(n,e){return n.field(Ie,!1)?e:e.concat(E.appendConfig.of(Fy))}var np=E.define(),Ka=E.define(),sp=E.define(),Ie=ne.define({create(){return new gi(R.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,s=n.panel;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=Vt(t,n.selected.diagnostic,r)||Vt(t,null,r)}!t.size&&s&&e.state.facet(Yn).autoPanel&&(s=null),n=new gi(t,s,i)}for(let t of e.effects)if(t.is(np)){let i=e.state.facet(Yn).autoPanel?t.value.length?In.open:null:n.panel;n=gi.init(t.value,i,e.state)}else t.is(Ka)?n=new gi(n.diagnostics,t.value?In.open:null,n.selected):t.is(sp)&&(n=new gi(n.diagnostics,n.panel,t.value));return n},provide:n=>[hi.from(n,e=>e.panel),T.decorations.from(n,e=>e.diagnostics)]});var By=R.mark({class:\"cm-lintRange cm-lintRange-active\"});function Yy(n,e,t){let{diagnostics:i}=n.state.field(Ie),s,r=-1,o=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{if(e>=a&&e<=h&&(a==h||(e>a||t>0)&&(e<h||t<0)))return s=c.diagnostics,r=a,o=h,!1});let l=n.state.facet(Yn).tooltipFilter;return s&&l&&(s=l(s,n.state)),s?{pos:r,end:o,above:n.state.doc.lineAt(r).to<o,create(){return{dom:Iy(n,s)}}}:null}function Iy(n,e){return V(\"ul\",{class:\"cm-tooltip-lint\"},e.map(t=>lp(n,t,!1)))}var qy=n=>{let e=n.state.field(Ie,!1);(!e||!e.panel)&&n.dispatch({effects:Wy(n.state,[Ka.of(!0)])});let t=vn(n,In.open);return t&&t.dom.querySelector(\".cm-panel-lint ul\").focus(),!0},tp=n=>{let e=n.state.field(Ie,!1);return!e||!e.panel?!1:(n.dispatch({effects:Ka.of(!1)}),!0)},Vy=n=>{let e=n.state.field(Ie,!1);if(!e)return!1;let t=n.state.selection.main,i=Vt(e.diagnostics,null,t.to+1);return!i&&(i=Vt(e.diagnostics,null,0),!i||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)};var rp=[{key:\"Mod-Shift-m\",run:qy,preventDefault:!0},{key:\"F8\",run:Vy}];var Yn=P.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...be(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:ip,tooltipFilter:ip,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,s,r)=>e(i,s,r)||t(i,s,r):e:t,autoPanel:(e,t)=>e||t})}}});function ip(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function op(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let s=t[i];if(/[a-zA-Z]/.test(s)&&!e.some(r=>r.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push(\"\")}return e}function lp(n,e,t){var i;let s=t?op(e.actions):[];return V(\"li\",{class:\"cm-diagnostic cm-diagnostic-\"+e.severity},V(\"span\",{class:\"cm-diagnosticText\"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=Vt(n.state.field(Ie).diagnostics,e);p&&r.apply(n,p.from,p.to)},{name:h}=r,c=s[o]?h.indexOf(s[o]):-1,f=c<0?h:[h.slice(0,c),V(\"u\",h.slice(c,c+1)),h.slice(c+1)],u=r.markClass?\" \"+r.markClass:\"\";return V(\"button\",{type:\"button\",class:\"cm-diagnosticAction\"+u,onclick:a,onmousedown:a,\"aria-label\":` Action: ${h}${c<0?\"\":` (access key \"${s[o]})\"`}.`},f)}),e.source&&V(\"div\",{class:\"cm-diagnosticSource\"},e.source))}var Ha=class extends $e{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return V(\"span\",{class:\"cm-lintPoint cm-lintPoint-\"+this.sev})}},Wr=class{constructor(e,t){this.diagnostic=t,this.id=\"item_\"+Math.floor(Math.random()*4294967295).toString(16),this.dom=lp(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(\"role\",\"option\")}},In=class n{constructor(e){this.view=e,this.items=[];let t=s=>{if(!(s.ctrlKey||s.altKey||s.metaKey)){if(s.keyCode==27)tp(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=op(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==s.keyCode){let a=Vt(this.view.state.field(Ie).diagnostics,r);a&&r.actions[l].apply(e,a.from,a.to)}}else return;s.preventDefault()}},i=s=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(s.target)&&this.moveSelection(r)};this.list=V(\"ul\",{tabIndex:0,role:\"listbox\",\"aria-label\":this.view.state.phrase(\"Diagnostics\"),onkeydown:t,onclick:i}),this.dom=V(\"div\",{class:\"cm-panel-lint\"},this.list,V(\"button\",{type:\"button\",name:\"close\",\"aria-label\":this.view.state.phrase(\"close\"),onclick:()=>tp(this.view)},\"\\xD7\")),this.update()}get selectedIndex(){let e=this.view.state.field(Ie).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Ie),i=0,s=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:h})=>{for(let c of h.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,u;for(let d=i;d<this.items.length;d++)if(this.items[d].diagnostic==c){f=d;break}f<0?(u=new Wr(this.view,c),this.items.splice(i,0,u),s=!0):(u=this.items[f],f>i&&(this.items.splice(i,f-i),s=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute(\"aria-selected\")||(u.dom.setAttribute(\"aria-selected\",\"true\"),r=u):u.dom.hasAttribute(\"aria-selected\")&&u.dom.removeAttribute(\"aria-selected\"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new Wr(this.view,{from:-1,to:-1,severity:\"info\",message:this.view.state.phrase(\"No diagnostics\")})),s=!0),r?(this.list.setAttribute(\"aria-activedescendant\",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let h=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/h:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute(\"aria-activedescendant\"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Ie),i=Vt(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:sp.of(i)})}static open(e){return new n(e)}};function jy(n,e='viewBox=\"0 0 40 40\"'){return`url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" ${e}>${encodeURIComponent(n)}</svg>')`}function zr(n){return jy(`<path d=\"m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0\" stroke=\"${n}\" fill=\"none\" stroke-width=\".7\"/>`,'width=\"6\" height=\"3\"')}var Ny=T.baseTheme({\".cm-diagnostic\":{padding:\"3px 6px 3px 8px\",marginLeft:\"-1px\",display:\"block\",whiteSpace:\"pre-wrap\"},\".cm-diagnostic-error\":{borderLeft:\"5px solid #d11\"},\".cm-diagnostic-warning\":{borderLeft:\"5px solid orange\"},\".cm-diagnostic-info\":{borderLeft:\"5px solid #999\"},\".cm-diagnostic-hint\":{borderLeft:\"5px solid #66d\"},\".cm-diagnosticAction\":{font:\"inherit\",border:\"none\",padding:\"2px 4px\",backgroundColor:\"#444\",color:\"white\",borderRadius:\"3px\",marginLeft:\"8px\",cursor:\"pointer\"},\".cm-diagnosticSource\":{fontSize:\"70%\",opacity:.7},\".cm-lintRange\":{backgroundPosition:\"left bottom\",backgroundRepeat:\"repeat-x\",paddingBottom:\"0.7px\"},\".cm-lintRange-error\":{backgroundImage:zr(\"#d11\")},\".cm-lintRange-warning\":{backgroundImage:zr(\"orange\")},\".cm-lintRange-info\":{backgroundImage:zr(\"#999\")},\".cm-lintRange-hint\":{backgroundImage:zr(\"#66d\")},\".cm-lintRange-active\":{backgroundColor:\"#ffdd9980\"},\".cm-tooltip-lint\":{padding:0,margin:0},\".cm-lintPoint\":{position:\"relative\",\"&:after\":{content:'\"\"',position:\"absolute\",bottom:0,left:\"-2px\",borderLeft:\"3px solid transparent\",borderRight:\"3px solid transparent\",borderBottom:\"4px solid #d11\"}},\".cm-lintPoint-warning\":{\"&:after\":{borderBottomColor:\"orange\"}},\".cm-lintPoint-info\":{\"&:after\":{borderBottomColor:\"#999\"}},\".cm-lintPoint-hint\":{\"&:after\":{borderBottomColor:\"#66d\"}},\".cm-panel.cm-panel-lint\":{position:\"relative\",\"& ul\":{maxHeight:\"100px\",overflowY:\"auto\",\"& [aria-selected]\":{backgroundColor:\"#ddd\",\"& u\":{textDecoration:\"underline\"}},\"&:focus [aria-selected]\":{background_fallback:\"#bdf\",backgroundColor:\"Highlight\",color_fallback:\"white\",color:\"HighlightText\"},\"& u\":{textDecoration:\"none\"},padding:0,margin:0},\"& [name=close]\":{position:\"absolute\",top:\"0\",right:\"2px\",background:\"inherit\",border:\"none\",font:\"inherit\",padding:0,margin:0}},\"&dark .cm-lintRange-active\":{backgroundColor:\"#86714a80\"},\"&dark .cm-panel.cm-panel-lint ul\":{\"& [aria-selected]\":{backgroundColor:\"#2e343e\"}}});function Gy(n){return n==\"error\"?4:n==\"warning\"?3:n==\"info\"?2:1}function Uy(n){let e=\"hint\",t=1;for(let i of n){let s=Gy(i.severity);s>t&&(t=s,e=i.severity)}return e}var Fy=[Ie,T.decorations.compute([Ie],n=>{let{selected:e,panel:t}=n.field(Ie);return!e||!t||e.from==e.to?R.none:R.set([By.range(e.from,e.to)])}),Lf(Yy,{hideOn:_y}),Ny];var Hy=[Bf(),Yf(),Af(),dd(),uu(),Pf(),Zf(),H.allowMultipleSelections.of(!0),nu(),pu(Ou,{fallback:!0}),xu(),zu(),Iu(),Rf(),Xf(),Mf(),Ud(),Bi.of([...Bu,...Id,...ep,...gd,...hu,...Ra,...rp])];var it=typeof window<\"u\"?window:null,eh=it===null,Vn=eh?void 0:it.document,ft=\"addEventListener\",ut=\"removeEventListener\",Ja=\"getBoundingClientRect\",qn=\"_a\",dt=\"_b\",Ct=\"_c\",Br=\"horizontal\",pt=function(){return!1},Ky=eh?\"calc\":[\"\",\"-webkit-\",\"-moz-\",\"-o-\"].filter(function(n){var e=Vn.createElement(\"div\");return e.style.cssText=\"width:\"+n+\"calc(9px)\",!!e.style.length}).shift()+\"calc\",hp=function(n){return typeof n==\"string\"||n instanceof String},ap=function(n){if(hp(n)){var e=Vn.querySelector(n);if(!e)throw new Error(\"Selector \"+n+\" did not match a DOM element\");return e}return n},we=function(n,e,t){var i=n[e];return i!==void 0?i:t},Yr=function(n,e,t,i){if(e){if(i===\"end\")return 0;if(i===\"center\")return n/2}else if(t){if(i===\"start\")return 0;if(i===\"center\")return n/2}return n},Jy=function(n,e){var t=Vn.createElement(\"div\");return t.className=\"gutter gutter-\"+e,t},ex=function(n,e,t){var i={};return hp(e)?i[n]=e:i[n]=Ky+\"(\"+e+\"% - \"+t+\"px)\",i},tx=function(n,e){var t;return t={},t[n]=e+\"px\",t},ix=function(n,e){if(e===void 0&&(e={}),eh)return{};var t=n,i,s,r,o,l,a;Array.from&&(t=Array.from(t));var h=ap(t[0]),c=h.parentNode,f=getComputedStyle?getComputedStyle(c):null,u=f?f.flexDirection:null,d=we(e,\"sizes\")||t.map(function(){return 100/t.length}),p=we(e,\"minSize\",100),O=Array.isArray(p)?p:t.map(function(){return p}),m=we(e,\"maxSize\",1/0),g=Array.isArray(m)?m:t.map(function(){return m}),S=we(e,\"expandToMin\",!1),b=we(e,\"gutterSize\",10),A=we(e,\"gutterAlign\",\"center\"),w=we(e,\"snapOffset\",30),v=Array.isArray(w)?w:t.map(function(){return w}),Q=we(e,\"dragInterval\",1),D=we(e,\"direction\",Br),W=we(e,\"cursor\",D===Br?\"col-resize\":\"row-resize\"),G=we(e,\"gutter\",Jy),_=we(e,\"elementStyle\",ex),X=we(e,\"gutterStyle\",tx);D===Br?(i=\"width\",s=\"clientX\",r=\"left\",o=\"right\",l=\"clientWidth\"):D===\"vertical\"&&(i=\"height\",s=\"clientY\",r=\"top\",o=\"bottom\",l=\"clientHeight\");function Y(M,k,C,L){var de=_(i,k,C,L);Object.keys(de).forEach(function(le){M.style[le]=de[le]})}function q(M,k,C){var L=X(i,k,C);Object.keys(L).forEach(function(de){M.style[de]=L[de]})}function j(){return a.map(function(M){return M.size})}function fe(M){return\"touches\"in M?M.touches[0][s]:M[s]}function ye(M){var k=a[this.a],C=a[this.b],L=k.size+C.size;k.size=M/this.size*L,C.size=L-M/this.size*L,Y(k.element,k.size,this[dt],k.i),Y(C.element,C.size,this[Ct],C.i)}function qe(M){var k,C=a[this.a],L=a[this.b];this.dragging&&(k=fe(M)-this.start+(this[dt]-this.dragOffset),Q>1&&(k=Math.round(k/Q)*Q),k<=C.minSize+C.snapOffset+this[dt]?k=C.minSize+this[dt]:k>=this.size-(L.minSize+L.snapOffset+this[Ct])&&(k=this.size-(L.minSize+this[Ct])),k>=C.maxSize-C.snapOffset+this[dt]?k=C.maxSize+this[dt]:k<=this.size-(L.maxSize-L.snapOffset+this[Ct])&&(k=this.size-(L.maxSize+this[Ct])),ye.call(this,k),we(e,\"onDrag\",pt)(j()))}function oe(){var M=a[this.a].element,k=a[this.b].element,C=M[Ja](),L=k[Ja]();this.size=C[i]+L[i]+this[dt]+this[Ct],this.start=C[r],this.end=C[o]}function Te(M){if(!getComputedStyle)return null;var k=getComputedStyle(M);if(!k)return null;var C=M[l];return C===0?null:(D===Br?C-=parseFloat(k.paddingLeft)+parseFloat(k.paddingRight):C-=parseFloat(k.paddingTop)+parseFloat(k.paddingBottom),C)}function Ve(M){var k=Te(c);if(k===null||O.reduce(function(le,Le){return le+Le},0)>k)return M;var C=0,L=[],de=M.map(function(le,Le){var jt=k*le/100,Nn=Yr(b,Le===0,Le===M.length-1,A),Gn=O[Le]+Nn;return jt<Gn?(C+=Gn-jt,L.push(0),Gn):(L.push(jt-Gn),jt)});return C===0?M:de.map(function(le,Le){var jt=le;if(C>0&&L[Le]-C>0){var Nn=Math.min(C,L[Le]-C);C-=Nn,jt=le-Nn}return jt/k*100})}function Ce(){var M=this,k=a[M.a].element,C=a[M.b].element;M.dragging&&we(e,\"onDragEnd\",pt)(j()),M.dragging=!1,it[ut](\"mouseup\",M.stop),it[ut](\"touchend\",M.stop),it[ut](\"touchcancel\",M.stop),it[ut](\"mousemove\",M.move),it[ut](\"touchmove\",M.move),M.stop=null,M.move=null,k[ut](\"selectstart\",pt),k[ut](\"dragstart\",pt),C[ut](\"selectstart\",pt),C[ut](\"dragstart\",pt),k.style.userSelect=\"\",k.style.webkitUserSelect=\"\",k.style.MozUserSelect=\"\",k.style.pointerEvents=\"\",C.style.userSelect=\"\",C.style.webkitUserSelect=\"\",C.style.MozUserSelect=\"\",C.style.pointerEvents=\"\",M.gutter.style.cursor=\"\",M.parent.style.cursor=\"\",Vn.body.style.cursor=\"\"}function je(M){if(!(\"button\"in M&&M.button!==0)){var k=this,C=a[k.a].element,L=a[k.b].element;k.dragging||we(e,\"onDragStart\",pt)(j()),M.preventDefault(),k.dragging=!0,k.move=qe.bind(k),k.stop=Ce.bind(k),it[ft](\"mouseup\",k.stop),it[ft](\"touchend\",k.stop),it[ft](\"touchcancel\",k.stop),it[ft](\"mousemove\",k.move),it[ft](\"touchmove\",k.move),C[ft](\"selectstart\",pt),C[ft](\"dragstart\",pt),L[ft](\"selectstart\",pt),L[ft](\"dragstart\",pt),C.style.userSelect=\"none\",C.style.webkitUserSelect=\"none\",C.style.MozUserSelect=\"none\",C.style.pointerEvents=\"none\",L.style.userSelect=\"none\",L.style.webkitUserSelect=\"none\",L.style.MozUserSelect=\"none\",L.style.pointerEvents=\"none\",k.gutter.style.cursor=W,k.parent.style.cursor=W,Vn.body.style.cursor=W,oe.call(k),k.dragOffset=fe(M)-k.end}}d=Ve(d);var ke=[];a=t.map(function(M,k){var C={element:ap(M),size:d[k],minSize:O[k],maxSize:g[k],snapOffset:v[k],i:k},L;if(k>0&&(L={a:k-1,b:k,dragging:!1,direction:D,parent:c},L[dt]=Yr(b,k-1===0,!1,A),L[Ct]=Yr(b,!1,k===t.length-1,A),u===\"row-reverse\"||u===\"column-reverse\")){var de=L.a;L.a=L.b,L.b=de}if(k>0){var le=G(k,D,C.element);q(le,b,k),L[qn]=je.bind(L),le[ft](\"mousedown\",L[qn]),le[ft](\"touchstart\",L[qn]),c.insertBefore(le,C.element),L.gutter=le}return Y(C.element,C.size,Yr(b,k===0,k===t.length-1,A),k),k>0&&ke.push(L),C});function bt(M){var k=M.i===ke.length,C=k?ke[M.i-1]:ke[M.i];oe.call(C);var L=k?C.size-M.minSize-C[Ct]:M.minSize+C[dt];ye.call(C,L)}a.forEach(function(M){var k=M.element[Ja]()[i];k<M.minSize&&(S?bt(M):M.minSize=k)});function yi(M){var k=Ve(M);k.forEach(function(C,L){if(L>0){var de=ke[L-1],le=a[de.a],Le=a[de.b];le.size=k[L-1],Le.size=C,Y(le.element,le.size,de[dt],le.i),Y(Le.element,Le.size,de[Ct],Le.i)}})}function jn(M,k){ke.forEach(function(C){if(k!==!0?C.parent.removeChild(C.gutter):(C.gutter[ut](\"mousedown\",C[qn]),C.gutter[ut](\"touchstart\",C[qn])),M!==!0){var L=_(i,C.a.size,C[dt]);Object.keys(L).forEach(function(de){a[C.a].element.style[de]=\"\",a[C.b].element.style[de]=\"\"})}})}return{setSizes:yi,getSizes:j,collapse:function(k){bt(a[k])},destroy:jn,parent:c,pairs:ke}},nx=ix;export{H as EditorState,T as EditorView,nx as Split,aa as StreamLanguage,Hy as basicSetup,G0 as javascript,s1 as wast};\n//# sourceMappingURL=third_party.bundle.js.map\n"
  },
  {
    "path": "docs/demo/wasm2wat/demo.js",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport WabtModule from '../libwabt.js';\nimport {getLocalStorageFeatures, renderFeatures, saveLocalStorageFeatures} from '../share.js';\nimport {basicSetup, EditorState, EditorView, StreamLanguage, wast} from '../third_party.bundle.js';\n\nimport {examples} from './examples.js';\n\nconst features = getLocalStorageFeatures();\n\nconst wabt = await WabtModule({\n  locateFile: (url) => {\n    if (url.endsWith('.wasm')) {\n      return '../' + url;\n    }\n    return url;\n  }\n});\n\nconst editorEl = document.querySelector('.editor');\nconst uploadEl = document.getElementById('upload');\nconst selectEl = document.getElementById('select');\nconst uploadInputEl = document.getElementById('uploadInput');\nconst generateNamesEl = document.getElementById('generateNames');\nconst foldExprsEl = document.getElementById('foldExprs');\nconst inlineExportEl = document.getElementById('inlineExport');\nconst checkEl = document.getElementById('check');\nconst readDebugNamesEl = document.getElementById('readDebugNames');\nconst editor = new EditorView({\n  state: EditorState.create(\n      {extensions: [basicSetup, StreamLanguage.define(wast)]}),\n  parent: document.querySelector('main')\n});\n\nconst editorContainer = editor.dom;\n\neditorContainer.ondrop = (e) => {\n  e.preventDefault();\n  let file = e.dataTransfer.files[0];\n  if (!file) {\n    return;\n  }\n  readAndCompileFile(file);\n};\n\nlet fileBuffer = null;\nrenderFeatures(wabt, features, () => {\n  saveLocalStorageFeatures(features);\n  compile(fileBuffer);\n});\n\nfunction compile(contents) {\n  if (!contents) {\n    return;\n  }\n\n  const readDebugNames = readDebugNamesEl.checked;\n  const check = checkEl.checked;\n  const generateNames = generateNamesEl.checked;\n  const foldExprs = foldExprsEl.checked;\n  const inlineExport = inlineExportEl.checked;\n\n  let module;\n  try {\n    module = wabt.readWasm(\n        contents,\n        {readDebugNames : readDebugNames, check : check, ...features});\n    if (generateNames) {\n      module.generateNames();\n      module.applyNames();\n    }\n    const result =\n        module.toText({foldExprs: foldExprs, inlineExport: inlineExport});\n    editor.dispatch(\n        {changes: {from: 0, to: editor.state.doc.length, insert: result}});\n  } catch (e) {\n    editor.dispatch({\n      changes: {from: 0, to: editor.state.doc.length, insert: e.toString()}\n    });\n  } finally {\n    if (module)\n      module.destroy();\n  }\n}\n\nfunction onUploadClicked(e) {\n  uploadInput.value = '';\n  // See https://developer.mozilla.com/en-US/docs/Web/API/MouseEvent\n  const event = new MouseEvent('click', {\n    view: window,\n    bubbles: true,\n    cancelable: true,\n  });\n  uploadInput.dispatchEvent(event);\n}\n\nfunction onUploadedFile(e) {\n  const file = e.target.files[0];\n  readAndCompileFile(file);\n}\n// extract common util function\nasync function readAndCompileFile(file) {\n  fileBuffer = new Uint8Array(await file.arrayBuffer());\n  compile(fileBuffer);\n}\n\nfunction recompileIfChanged(el) {\n  el.addEventListener('change', () => {\n    compile(fileBuffer);\n  });\n}\n\nfunction setExample(index) {\n  const contents = examples[index].contents;\n  fileBuffer = contents;\n  compile(contents);\n}\n\nfunction onSelectChanged(e) {\n  setExample(this.selectedIndex);\n}\n\nuploadEl.addEventListener('click', onUploadClicked);\nuploadInputEl.addEventListener('change', onUploadedFile);\nrecompileIfChanged(generateNamesEl);\nrecompileIfChanged(foldExprsEl);\nrecompileIfChanged(inlineExportEl);\nrecompileIfChanged(readDebugNamesEl);\nselectEl.addEventListener('change', onSelectChanged);\n\nfor (let i = 0; i < examples.length; ++i) {\n  const example = examples[i];\n  const option = document.createElement('option');\n  option.textContent = example.name;\n  selectEl.appendChild(option);\n}\nselectEl.selectedIndex = 0;\nsetExample(selectEl.selectedIndex);\n"
  },
  {
    "path": "docs/demo/wasm2wat/examples.js",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const examples = [\n  {\n    name: 'simple',\n    contents: new Uint8Array([\n      0,   97,  115, 109, 1,   0,   0, 0,  1,  7, 1,  96,  2,   127, 127,\n      1,   127, 3,   2,   1,   0,   7, 10, 1,  6, 97, 100, 100, 84,  119,\n      111, 0,   0,   10,  9,   1,   7, 0,  32, 0, 32, 1,   106, 11,  0,\n      25,  4,   110, 97,  109, 101, 1, 9,  1,  0, 6,  97,  100, 100, 84,\n      119, 111, 2,   7,   1,   0,   2, 0,  0,  1, 0\n    ]),\n  },\n\n  {\n    name: 'factorial',\n    contents: new Uint8Array([\n      0,  97, 115, 109, 1,   0,   0,  0,  1,   6,  1,  96,  1,  126, 1,   126,\n      3,  2,  1,   0,   7,   7,   1,  3,  102, 97, 99, 0,   0,  10,  25,  1,\n      23, 0,  32,  0,   66,  1,   83, 4,  126, 66, 1,  5,   32, 0,   32,  0,\n      66, 1,  125, 16,  0,   126, 11, 11, 0,   20, 4,  110, 97, 109, 101, 1,\n      6,  1,  0,   3,   102, 97,  99, 2,  5,   1,  0,  1,   0,  0\n    ]),\n  },\n\n  {\n    name: 'stuff',\n    contents: new Uint8Array([\n      0,   97,  115, 109, 1,   0,   0,   0,   1,   13,  3,  96,  1,   125,\n      0,   96,  1,   127, 1,   127, 96,  0,   0,   2,   11, 1,   3,   102,\n      111, 111, 3,   98,  97,  114, 0,   0,   3,   3,   2,  2,   0,   4,\n      5,   1,   112, 1,   0,   1,   5,   4,   1,   1,   1,  1,   7,   9,\n      1,   5,   102, 117, 110, 99,  49,  0,   1,   8,   1,  1,   10,  10,\n      2,   2,   0,   11,  5,   0,   65,  42,  26,  11,  11, 8,   1,   0,\n      65,  0,   11,  2,   104, 105, 0,   44,  4,   110, 97, 109, 101, 1,\n      24,  3,   0,   7,   105, 109, 112, 111, 114, 116, 48, 1,   5,   102,\n      117, 110, 99,  48,  2,   5,   102, 117, 110, 99,  49, 2,   11,  3,\n      0,   1,   0,   0,   1,   0,   2,   1,   0,   0\n    ]),\n  },\n];\n"
  },
  {
    "path": "docs/demo/wasm2wat/index.html",
    "content": "<!--\n Copyright 2017 WebAssembly Community Group participants\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes\">\n  <title>wasm2wat demo</title>\n  <link rel=\"icon\" type=\"image/x-icon\" href=\"../favicon.ico\">\n  <link href=\"https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.18/codemirror.min.css\" rel=\"stylesheet\">\n  <link href=\"../custom.css\" rel=\"stylesheet\">\n</head>\n<body>\n  <header>\n    <h1>wasm2wat demo</h1>\n    <p>WebAssembly has a\n      <a href=\"https://webassembly.github.io/spec/core/text/\">text format</a>\n      and a\n      <a href=\"https://webassembly.github.io/spec/core/binary/\">binary format</a>.\n      This demo converts from the binary format to the text format.\n    </p>\n    <p>\n      Upload a WebAssembly binary file, and the text format will be displayed.\n    </p>\n    <div>\n    </div>\n    <div>Enabled features:</div>\n    <div id=\"features\"></div>\n  </header>\n  <main>\n    <div class=\"toolbar\">\n      <input type=\"checkbox\" id=\"generateNames\" checked>\n      <label for=\"generateNames\">Generate Names</label>\n\n      <input type=\"checkbox\" id=\"foldExprs\" checked>\n      <label for=\"foldExprs\">Fold Expressions</label>\n\n      <input type=\"checkbox\" id=\"inlineExport\" checked>\n      <label for=\"inlineExport\">Inline Export</label>\n\n      <input type=\"checkbox\" id=\"readDebugNames\" checked>\n      <label for=\"readDebugNames\">Read Debug Names</label>\n\n      <input type=\"checkbox\" id=\"check\" checked>\n      <label for=\"check\">Check for invalid modules</label>\n\n      <div class=\"right\">\n        <input type=\"file\" id=\"uploadInput\" class=\"hidden\"></a>\n        <label>example:</label>\n        <select id=\"select\" class=\"form-select\"></select>\n        <button class=\"btn\" type=\"button\" id=\"upload\">Upload</button>\n      </div>\n    </div>\n    <textarea class=\"editor\" autofocus autocomplete=\"off\" autocorrect=\"off\"\n        autocapitalize=\"off\" spellcheck=\"false\" hidden></textarea>\n  </main>\n  <script type=\"module\" src=\"demo.js\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/demo/wat2wasm/demo.js",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport WabtModule from '../libwabt.js';\nimport {renderFeatures} from '../share.js';\nimport {basicSetup, EditorState, EditorView, javascript, Split, StreamLanguage, wast} from '../third_party.bundle.js';\n\nimport {examples} from './examples.js';\n\nSplit([\"#top-left\", \"#top-right\"]);\nSplit([\"#bottom-left\", \"#bottom-right\"]);\n\nSplit([\"#top-row\", \"#bottom-row\"], {\n  direction: 'vertical'\n});\n\nconst features = {};\n\nconst wabt = await WabtModule({\n  locateFile: (url) => {\n    if (url.endsWith('.wasm')) {\n      return '../' + url;\n    }\n    return url;\n  }\n});\n\nconst kCompileMinMS = 100;\nlet outputShowBase64 = false;\nlet outputLog;\nlet outputBase64;\n\nconst outputEl = document.getElementById('output');\nconst jsLogEl = document.getElementById('js_log');\nconst selectEl = document.getElementById('select');\nconst downloadEl = document.getElementById('download');\nconst runEl = document.getElementById('run');\nconst downloadLink = document.getElementById('downloadLink');\nconst buildLogEl = document.getElementById('buildLog');\nconst base64El = document.getElementById('base64');\nlet binaryBuffer = null;\nlet binaryBlobUrl = null;\n\nrenderFeatures(wabt, features, () => onWatChange());\n\nconst watEditor = new EditorView({\n  state: EditorState.create({\n    extensions: [\n      basicSetup, StreamLanguage.define(wast),\n      EditorView.updateListener.of((update) => {\n        if (update.docChanged)\n          onWatChange();\n      })\n    ]\n  }),\n  parent: document.getElementById('top-left')\n});\n\nconst jsEditor = new EditorView({\n  state: EditorState.create({\n    extensions: [\n      basicSetup, javascript(), EditorView.updateListener.of((update) => {\n        if (update.docChanged)\n          onJsChange();\n      })\n    ]\n  }),\n  parent: document.getElementById('bottom-left')\n});\n\nfunction debounce(f, wait) {\n  let lastTime = 0;\n  let timeoutId = -1;\n  const wrapped = (...args) => {\n    const time = +new Date();\n    if (time - lastTime < wait) {\n      if (timeoutId == -1)\n        timeoutId = setTimeout(wrapped, (lastTime + wait) - time);\n      return;\n    }\n    if (timeoutId != -1)\n      clearTimeout(timeoutId);\n    timeoutId = -1;\n    lastTime = time;\n    f(...args);\n  };\n  return wrapped;\n}\n\nfunction compile() {\n  outputLog = '';\n  outputBase64 = 'Error occured, base64 output is not available';\n\n  let module;\n  try {\n    module =\n        wabt.parseWat('test.wast', watEditor.state.doc.toString(), features);\n    module.resolveNames();\n    module.validate(features);\n    const binaryOutput = module.toBinary({log: true, write_debug_names: true});\n    outputLog = binaryOutput.log;\n    binaryBuffer = binaryOutput.buffer;\n    // binaryBuffer is a Uint8Array, so we need to convert it to a string to use\n    // btoa\n    // https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string\n    outputBase64 = btoa(String.fromCharCode.apply(null, binaryBuffer));\n\n    const blob = new Blob([binaryOutput.buffer]);\n    if (binaryBlobUrl) {\n      URL.revokeObjectURL(binaryBlobUrl);\n    }\n    binaryBlobUrl = URL.createObjectURL(blob);\n    downloadLink.setAttribute('href', binaryBlobUrl);\n    downloadEl.classList.remove('disabled');\n  } catch (e) {\n    outputLog += e.toString();\n    downloadEl.classList.add('disabled');\n  } finally {\n    if (module)\n      module.destroy();\n    outputEl.textContent = outputShowBase64 ? outputBase64 : outputLog;\n  }\n}\n\nlet activeWorker = null;\nfunction run() {\n  if (activeWorker != null)\n    stop();\n  runEl.textContent = 'Stop';\n  jsLogEl.textContent = '';\n  if (binaryBuffer === null)\n    return;\n  const js = jsEditor.state.doc.toString();\n  activeWorker = new Worker('./worker.js');\n  activeWorker.addEventListener('message', (event) => {\n    switch (event.data.type) {\n      case 'log':\n        jsLogEl.textContent += event.data.data;\n        break;\n      case 'done':\n        stop();\n        break;\n    }\n  });\n  activeWorker.postMessage({binaryBuffer: binaryBuffer.buffer, js}, []);\n}\n\nfunction stop() {\n  if (activeWorker != null) {\n    activeWorker.terminate();\n    activeWorker = null;\n  }\n  runEl.textContent = 'Run';\n}\n\nconst onWatChange = debounce(compile, kCompileMinMS);\nconst onJsChange = debounce(run, kCompileMinMS);\n\nfunction setExample(index) {\n  const example = examples[index];\n  watEditor.dispatch({\n    changes: {from: 0, to: watEditor.state.doc.length, insert: example.contents}\n  });\n  jsEditor.dispatch(\n      {changes: {from: 0, to: jsEditor.state.doc.length, insert: example.js}});\n}\n\nfunction onSelectChanged(e) {\n  setExample(this.selectedIndex);\n}\n\nfunction onRunClicked(e) {\n  if (activeWorker != null) {\n    stop();\n  } else {\n    onJsChange();\n  }\n}\n\nfunction onDownloadClicked(e) {\n  // See https://developer.mozilla.com/en-US/docs/Web/API/MouseEvent\n  const event = new MouseEvent('click', {\n    view: window,\n    bubbles: true,\n    cancelable: true,\n  });\n  downloadLink.dispatchEvent(event);\n}\n\nfunction onBuildLogClicked(e) {\n  outputShowBase64 = false;\n  outputEl.textContent = outputLog;\n  buildLogEl.style.textDecoration = 'underline';\n  base64El.style.textDecoration = 'none';\n}\n\nfunction onBase64Clicked(e) {\n  outputShowBase64 = true;\n  outputEl.textContent = outputBase64;\n  buildLogEl.style.textDecoration = 'none';\n  base64El.style.textDecoration = 'underline';\n}\n\n\nselectEl.addEventListener('change', onSelectChanged);\nrunEl.addEventListener('click', onRunClicked);\ndownloadEl.addEventListener('click', onDownloadClicked);\nbuildLogEl.addEventListener('click', onBuildLogClicked);\nbase64El.addEventListener('click', onBase64Clicked);\n\nfor (let i = 0; i < examples.length; ++i) {\n  const example = examples[i];\n  const option = document.createElement('option');\n  option.textContent = example.name;\n  selectEl.appendChild(option);\n}\nselectEl.selectedIndex = 1;\nsetExample(selectEl.selectedIndex);\nrunEl.classList.remove('disabled');\n"
  },
  {
    "path": "docs/demo/wat2wasm/examples.js",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const examples = [\n  {\n    name: 'empty',\n    contents: '(module)',\n    js: '',\n  },\n\n  {\n    name: 'simple',\n    contents: `(module\n  (func (export \"addTwo\") (param i32 i32) (result i32)\n    local.get 0\n    local.get 1\n    i32.add))\n`,\n    js: `const wasmInstance =\n      new WebAssembly.Instance(wasmModule, {});\nconst { addTwo } = wasmInstance.exports;\nfor (let i = 0; i < 10; i++) {\n  console.log(addTwo(i, i));\n}\n`,\n  },\n\n  {\n    name: 'factorial',\n    contents: `(module\n  (func $fac (export \"fac\") (param f64) (result f64)\n    local.get 0\n    f64.const 1\n    f64.lt\n    if (result f64)\n      f64.const 1\n    else\n      local.get 0\n      local.get 0\n      f64.const 1\n      f64.sub\n      call $fac\n      f64.mul\n    end))\n`,\n    js: `const wasmInstance =\n    new WebAssembly.Instance(wasmModule, {});\nconst { fac } = wasmInstance.exports;\nfor (let i = 1; i <= 15; i++) {\n  console.log(fac(i));\n}\n`,\n  },\n\n  {\n    name: 'stuff',\n    contents: `(module\n  (import \"foo\" \"bar\" (func (param f32)))\n  (memory (data \"hi\"))\n  (type (func (param i32) (result i32)))\n  (start 1)\n  (table 0 1 funcref)\n  (func)\n  (func (type 1)\n    i32.const 42\n    drop)\n  (export \"e\" (func 1)))\n`,\n    js: `const wasmInstance = new WebAssembly.Instance(wasmModule, {\n  foo: {\n    bar() {}\n  },\n});\n`,\n  },\n\n  {\n    name: 'mutable globals',\n    contents: `(module\n  (import \"env\" \"g\" (global (mut i32)))\n  (func (export \"f\")\n    i32.const 100\n    global.set 0))\n`,\n    js: `\n  const g = new WebAssembly.Global({value: 'i32', mutable: true});\n  const wasmInstance = new WebAssembly.Instance(wasmModule, {env: {g}});\n  console.log('before: ' + g.value);\n  wasmInstance.exports.f();\n  console.log('after: ' + g.value);\n`\n  },\n\n  {\n    name: 'saturating float-to-int',\n    contents: `(module\n  (func (export \"f\") (param f32) (result i32)\n    local.get 0\n    i32.trunc_sat_f32_s))`,\n    js: `const wasmInstance = new WebAssembly.Instance(wasmModule);\nconst {f} = wasmInstance.exports;\nconsole.log(f(Infinity));`\n  },\n\n  {\n    name: 'sign extension',\n    contents: `(module\n  (func (export \"f\") (param i32) (result i32)\n    local.get 0\n    i32.extend8_s))\n`,\n    js: `const wasmInstance = new WebAssembly.Instance(wasmModule);\nconst {f} = wasmInstance.exports;\nconsole.log(f(0));\nconsole.log(f(127));\nconsole.log(f(128));\nconsole.log(f(255));`\n  },\n\n  {\n    name: 'multi value',\n    contents: `(module\n  (func $swap (param i32 i32) (result i32 i32)\n    local.get 1\n    local.get 0)\n\n  (func (export \"reverseSub\") (param i32 i32) (result i32)\n    local.get 0\n    local.get 1\n    call $swap\n    i32.sub))\n`,\n    js: `const wasmInstance = new WebAssembly.Instance(wasmModule);\nconst {reverseSub} = wasmInstance.exports;\nconsole.log(reverseSub(10, 3));`\n  },\n\n  {\n    name: 'bulk memory',\n    contents: `(module\n  (memory (export \"mem\") 1)\n  (func (export \"fill\") (param i32 i32 i32)\n    local.get 0\n    local.get 1\n    local.get 2\n    memory.fill))\n`,\n    js: `const wasmInstance = new WebAssembly.Instance(wasmModule);\nconst {fill, mem} = wasmInstance.exports;\nfill(0, 13, 5);\nfill(10, 77, 7);\nfill(20, 255, 1000);\nconsole.log(new Uint8Array(mem.buffer, 0, 50));\n`\n  }\n];\n"
  },
  {
    "path": "docs/demo/wat2wasm/index.html",
    "content": "<!--\n Copyright 2016 WebAssembly Community Group participants\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes\">\n  <title>wat2wasm demo</title>\n  <link rel=\"icon\" type=\"image/x-icon\" href=\"../favicon.ico\">\n  <link href=\"https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.18/codemirror.min.css\" rel=\"stylesheet\">\n  <link href=\"../custom.css\" rel=\"stylesheet\">\n</head>\n<body>\n  <header>\n    <h1>wat2wasm demo</h1>\n    <p>WebAssembly has a\n      <a href=\"https://webassembly.github.io/spec/core/text/index.html\">text format</a>\n      and a\n      <a href=\"https://webassembly.github.io/spec/core/binary/index.html\">binary format</a>.\n      This demo converts from the text format to the binary format.\n    </p>\n    <p>\n      Enter WebAssembly text in the textarea on the left. The right side will\n      either show an error, or will show a log with a description of the\n      generated binary file.\n    </p>\n    <div>Enabled features:</div>\n    <div id=\"features\"></div>\n  </header>\n  <main>\n    <div id=\"split-grid\" class=\"split-grid\">\n      <div id=\"top-row\" class=\"split-vertical\">\n        <div id=\"top-left\" class=\"split split-horizontal\">\n          <div class=\"toolbar\">\n            WAT\n            <div class=\"right\">\n              <label>example:</label>\n              <select id=\"select\" class=\"form-select\"></select>\n              <button class=\"btn disabled\" type=\"button\" id=\"run\">Run</button>\n              <button class=\"btn disabled\" type=\"button\" id=\"download\">Download</button>\n              <a id=\"downloadLink\" download=\"test.wasm\" class=\"hidden\"></a>\n            </div>\n          </div>\n        </div>\n        <div id=\"top-right\" class=\"split split-horizontal\">\n          <pre id=\"output\" class=\"output\"></pre>\n          <div class=\"toolbar\">\n            <button class=\"btn disabled\" type=\"button\" id=\"buildLog\" style=\"text-decoration: underline\">BUILD LOG</button>\n            <button class=\"btn disabled\" type=\"button\" id=\"base64\">BASE64</button>\n          </div>\n        </div>\n      </div>\n      <div id=\"bottom-row\" class=\"split-vertical\">\n        <div id=\"bottom-left\" class=\"split split-horizontal\">\n          <div class=\"toolbar\">JS</div>\n        </div>\n        <div id=\"bottom-right\" class=\"split split-horizontal\">\n          <pre id=\"js_log\" class=\"output\"></pre>\n          <div class=\"toolbar\">JS LOG</div>\n        </div>\n      </div>\n    </div>\n  </main>\n  <script type=\"module\" src=\"demo.js\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/demo/wat2wasm/worker.js",
    "content": "// This worker runs the generated WebAssembly module and sends console.log\n// output back to the main thread in order to prevent infinite loops from\n// locking up the main thread.\nlet wrappedConsole = Object.create(console);\n\nwrappedConsole.log = (...args) => {\n  const line = args.map(String).join('') + '\\n';\n  postMessage({type: 'log', data: line});\n  console.log(...args);\n};\n\nself.onmessage = async (event) => {\n  console.log(\"Running WebAssembly\");\n  const { binaryBuffer, js } = event.data;\n  let wasm;\n  try {\n    wasm = new WebAssembly.Module(binaryBuffer);\n  } catch (e) {\n    postMessage({type: 'log', data: String(e)});\n  }\n  const fn =\n      new Function('wasmModule', 'console', js + '//# sourceURL=demo.js');\n  fn(wasm, wrappedConsole);\n  postMessage({type: 'done'});\n};\n"
  },
  {
    "path": "docs/doc/spectest-interp.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">spectest-interp</code> &#x2014;\n    <span class=\"Nd\">read a Spectest JSON file, and run its tests in the\n    interpreter</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">spectest-interp</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">spectest-interp</code> Reads a Spectest JSON\n    file, and runs its tests in the interpreter.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print a help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"v\"><a class=\"permalink\" href=\"#v\"><code class=\"Fl\">-v</code></a>,\n    <code class=\"Fl\">--verbose</code></dt>\n  <dd>Use multiple times for more info</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"V\"><a class=\"permalink\" href=\"#V\"><code class=\"Fl\">-V</code></a>,\n    <code class=\"Fl\">--value-stack-size=SIZE</code></dt>\n  <dd>Size in elements of the value stack</dd>\n  <dt id=\"C\"><a class=\"permalink\" href=\"#C\"><code class=\"Fl\">-C</code></a>,\n    <code class=\"Fl\">--call-stack-size=SIZE</code></dt>\n  <dd>Size in elements of the call stack</dd>\n  <dt id=\"t\"><a class=\"permalink\" href=\"#t\"><code class=\"Fl\">-t</code></a>,\n    <code class=\"Fl\">--trace</code></dt>\n  <dd>Trace execution</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Parse test.json and run the spec tests</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ spectest-interp\n  test.json</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wasm-decompile.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-decompile</code> &#x2014;\n    <span class=\"Nd\">translate from the binary format to readable C-like\n    syntax</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wasm-decompile</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-decompile</code> Read a file in the\n    WebAssembly binary format, and convert it to a decompiled text file.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print a help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"o\"><a class=\"permalink\" href=\"#o\"><code class=\"Fl\">-o</code></a>,\n    <code class=\"Fl\">--output=FILENAME</code></dt>\n  <dd>Output file for the decompiled file, by default use stdout</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"ignore-custom-section-errors\"><a class=\"permalink\" href=\"#ignore-custom-section-errors\"><code class=\"Fl\">--ignore-custom-section-errors</code></a></dt>\n  <dd>Ignore errors in custom sections</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Parse binary file test.wasm and write text file test.dcmp</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-decompile test.wasm -o\n  test.dcmp</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wasm-interp.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-interp</code> &#x2014;\n    <span class=\"Nd\">decode and run a WebAssembly binary file</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wasm-interp</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-interp</code> Read a file in the wasm binary\n    format, and run it in a stack-based interpreter.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print a help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"v\"><a class=\"permalink\" href=\"#v\"><code class=\"Fl\">-v</code></a>,\n    <code class=\"Fl\">--verbose</code></dt>\n  <dd>Use multiple times for more info</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"V\"><a class=\"permalink\" href=\"#V\"><code class=\"Fl\">-V</code></a>,\n    <code class=\"Fl\">--value-stack-size=SIZE</code></dt>\n  <dd>Size in elements of the value stack</dd>\n  <dt id=\"C\"><a class=\"permalink\" href=\"#C\"><code class=\"Fl\">-C</code></a>,\n    <code class=\"Fl\">--call-stack-size=SIZE</code></dt>\n  <dd>Size in elements of the call stack</dd>\n  <dt id=\"t\"><a class=\"permalink\" href=\"#t\"><code class=\"Fl\">-t</code></a>,\n    <code class=\"Fl\">--trace</code></dt>\n  <dd>Trace execution</dd>\n  <dt id=\"wasi\"><a class=\"permalink\" href=\"#wasi\"><code class=\"Fl\">--wasi</code></a></dt>\n  <dd>Assume input module is WASI compliant (Export WASI API the the module and\n      invoke _start function)</dd>\n  <dt id=\"e\"><a class=\"permalink\" href=\"#e\"><code class=\"Fl\">-e</code></a>,\n    <code class=\"Fl\">--env=ENV</code></dt>\n  <dd>Pass the given environment string in the WASI runtime</dd>\n  <dt id=\"d\"><a class=\"permalink\" href=\"#d\"><code class=\"Fl\">-d</code></a>,\n    <code class=\"Fl\">--dir=DIR</code></dt>\n  <dd>Pass the given directory the the WASI runtime</dd>\n  <dt id=\"run-all-exports\"><a class=\"permalink\" href=\"#run-all-exports\"><code class=\"Fl\">--run-all-exports</code></a></dt>\n  <dd>Run all the exported functions, in order. Useful for testing</dd>\n  <dt id=\"host-print\"><a class=\"permalink\" href=\"#host-print\"><code class=\"Fl\">--host-print</code></a></dt>\n  <dd>Include an importable function named &quot;host.print&quot; for printing\n      to stdout</dd>\n  <dt id=\"dummy-import-func\"><a class=\"permalink\" href=\"#dummy-import-func\"><code class=\"Fl\">--dummy-import-func</code></a></dt>\n  <dd>Provide a dummy implementation of all imported functions. The function\n      will log the call and return an appropriate zero value.</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Parse binary file test.wasm, and type-check it</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-interp test.wasm</code></div>\n<p class=\"Pp\">Parse test.wasm and run all its exported functions</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-interp test.wasm\n  --run-all-exports</code></div>\n<p class=\"Pp\">Parse test.wasm, run the exported functions and trace the\n  output</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-interp test.wasm\n  --run-all-exports --trace</code></div>\n<p class=\"Pp\">Parse test.wasm and run all its exported functions, setting the\n    value stack size to 100 elements</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-interp test.wasm -V 100\n  --run-all-exports</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wasm-objdump.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-objdump</code> &#x2014;\n    <span class=\"Nd\">print information about a wasm binary</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wasm-objdump</code></td>\n    <td>[options] <var class=\"Ar\">file ...</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-objdump</code> Print information about the\n    contents of wasm binaries.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print a help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"h\"><a class=\"permalink\" href=\"#h\"><code class=\"Fl\">-h</code></a>,\n    <code class=\"Fl\">--headers</code></dt>\n  <dd>Print headers</dd>\n  <dt id=\"j\"><a class=\"permalink\" href=\"#j\"><code class=\"Fl\">-j</code></a>,\n    <code class=\"Fl\">--section=SECTION</code></dt>\n  <dd>Select just one section</dd>\n  <dt id=\"s\"><a class=\"permalink\" href=\"#s\"><code class=\"Fl\">-s</code></a>,\n    <code class=\"Fl\">--full-contents</code></dt>\n  <dd>Print raw section contents</dd>\n  <dt id=\"d\"><a class=\"permalink\" href=\"#d\"><code class=\"Fl\">-d</code></a>,\n    <code class=\"Fl\">--disassemble</code></dt>\n  <dd>Disassemble function bodies</dd>\n  <dt id=\"debug\"><a class=\"permalink\" href=\"#debug\"><code class=\"Fl\">--debug</code></a></dt>\n  <dd>Print extra debug information</dd>\n  <dt id=\"x\"><a class=\"permalink\" href=\"#x\"><code class=\"Fl\">-x</code></a>,\n    <code class=\"Fl\">--details</code></dt>\n  <dd>Show section details</dd>\n  <dt id=\"r\"><a class=\"permalink\" href=\"#r\"><code class=\"Fl\">-r</code></a>,\n    <code class=\"Fl\">--reloc</code></dt>\n  <dd>Show relocations inline with disassembly</dd>\n  <dt id=\"section-offsets\"><a class=\"permalink\" href=\"#section-offsets\"><code class=\"Fl\">--section-offsets</code></a></dt>\n  <dd>Print section offsets instead of file offsets in code disassembly</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-objdump test.wasm</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wasm-stats.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-stats</code> &#x2014; <span class=\"Nd\">show\n    stats for a module</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wasm-stats</code></td>\n    <td>[options] <var class=\"Ar\">file ...</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-stats</code> Read a file in the wasm binary\n    format, and show stats.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print a help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"v\"><a class=\"permalink\" href=\"#v\"><code class=\"Fl\">-v</code></a>,\n    <code class=\"Fl\">--verbose</code></dt>\n  <dd>Use multiple times for more info</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"o\"><a class=\"permalink\" href=\"#o\"><code class=\"Fl\">-o</code></a>,\n    <code class=\"Fl\">--output=FILENAME</code></dt>\n  <dd>Output file for the opcode counts, by default use stdout</dd>\n  <dt id=\"c\"><a class=\"permalink\" href=\"#c\"><code class=\"Fl\">-c</code></a>,\n    <code class=\"Fl\">--cutoff=N</code></dt>\n  <dd>Cutoff for reporting counts less than N</dd>\n  <dt id=\"s\"><a class=\"permalink\" href=\"#s\"><code class=\"Fl\">-s</code></a>,\n    <code class=\"Fl\">--separator=SEPARATOR</code></dt>\n  <dd>Separator text between element and count when reporting counts</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Parse binary file test.wasm and write opcode dist file\n  test.dist</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-stats test.wasm -o\n  test.dist</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wasm-strip.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-strip</code> &#x2014;\n    <span class=\"Nd\">remove sections of a WebAssembly binary file</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wasm-strip</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-strip</code> Remove sections of a\n    WebAssembly binary file.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print a help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"o\"><a class=\"permalink\" href=\"#o\"><code class=\"Fl\">-o</code></a>,\n    <code class=\"Fl\">--output=FILE</code></dt>\n  <dd>output wasm binary file</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Remove all custom sections from test.wasm</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-strip test.wasm</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wasm-validate.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-validate</code> &#x2014;\n    <span class=\"Nd\">validate a file in the WebAssembly binary format</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wasm-validate</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm-validate</code> Read a file in the\n    WebAssembly binary format, and validate it.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print this help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"v\"><a class=\"permalink\" href=\"#v\"><code class=\"Fl\">-v</code></a>,\n    <code class=\"Fl\">--verbose</code></dt>\n  <dd>Use multiple times for more info</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"no-debug-names\"><a class=\"permalink\" href=\"#no-debug-names\"><code class=\"Fl\">--no-debug-names</code></a></dt>\n  <dd>Ignore debug names in the binary file</dd>\n  <dt id=\"ignore-custom-section-errors\"><a class=\"permalink\" href=\"#ignore-custom-section-errors\"><code class=\"Fl\">--ignore-custom-section-errors</code></a></dt>\n  <dd>Ignore errors in custom sections</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Validate binary file test.wasm</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm-validate\n  test.wasm</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wasm2c.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm2c</code> &#x2014; <span class=\"Nd\">convert a\n    WebAssembly binary file to a C source and header</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wasm2c</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm2c</code> takes a WebAssembly module and\n    produces an equivalent C source and header.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print a help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"v\"><a class=\"permalink\" href=\"#v\"><code class=\"Fl\">-v</code></a>,\n    <code class=\"Fl\">--verbose</code></dt>\n  <dd>Use multiple times for more info</dd>\n  <dt id=\"o\"><a class=\"permalink\" href=\"#o\"><code class=\"Fl\">-o</code></a>,\n    <code class=\"Fl\">--output=FILENAME</code></dt>\n  <dd>Output file for the generated C source file, by default use stdout</dd>\n  <dt id=\"n\"><a class=\"permalink\" href=\"#n\"><code class=\"Fl\">-n</code></a>,\n    <code class=\"Fl\">--module-name=MODNAME</code></dt>\n  <dd>Unique name for the module being generated. This name is prefixed to each\n      of the generaed C symbols. By default, the module name from the names\n      section is used. If that is not present the name of the input file is used\n      as the default.</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"no-debug-names\"><a class=\"permalink\" href=\"#no-debug-names\"><code class=\"Fl\">--no-debug-names</code></a></dt>\n  <dd>Ignore debug names in the binary file</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Parse binary file test.wasm and write test.c and test.h</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm2c test.wasm -o\n  test.c</code></div>\n<p class=\"Pp\">Parse test.wasm, write test.c and test.h, but ignore the debug\n    names, if any</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm2c test.wasm --no-debug-names\n  -o test.c</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wasm2wat.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm2wat</code> &#x2014;\n    <span class=\"Nd\">translate from the binary format to the text\n  format</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wasm2wat</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wasm2wat</code> Read a file in the WebAssembly\n    binary format, and convert it to the WebAssembly text format.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print a help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"v\"><a class=\"permalink\" href=\"#v\"><code class=\"Fl\">-v</code></a>,\n    <code class=\"Fl\">--verbose</code></dt>\n  <dd>Use multiple times for more info</dd>\n  <dt id=\"o\"><a class=\"permalink\" href=\"#o\"><code class=\"Fl\">-o</code></a>,\n    <code class=\"Fl\">--output=FILENAME</code></dt>\n  <dd>Output file for the generated wast file, by default use stdout</dd>\n  <dt id=\"f\"><a class=\"permalink\" href=\"#f\"><code class=\"Fl\">-f</code></a>,\n    <code class=\"Fl\">--fold-exprs</code></dt>\n  <dd>Write folded expressions where possible</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"inline-exports\"><a class=\"permalink\" href=\"#inline-exports\"><code class=\"Fl\">--inline-exports</code></a></dt>\n  <dd>Write all exports inline</dd>\n  <dt id=\"inline-imports\"><a class=\"permalink\" href=\"#inline-imports\"><code class=\"Fl\">--inline-imports</code></a></dt>\n  <dd>Write all imports inline</dd>\n  <dt id=\"no-debug-names\"><a class=\"permalink\" href=\"#no-debug-names\"><code class=\"Fl\">--no-debug-names</code></a></dt>\n  <dd>Ignore debug names in the binary file</dd>\n  <dt id=\"ignore-custom-section-errors\"><a class=\"permalink\" href=\"#ignore-custom-section-errors\"><code class=\"Fl\">--ignore-custom-section-errors</code></a></dt>\n  <dd>Ignore errors in custom sections</dd>\n  <dt id=\"generate-names\"><a class=\"permalink\" href=\"#generate-names\"><code class=\"Fl\">--generate-names</code></a></dt>\n  <dd>Give auto-generated names to non-named functions, types, etc.</dd>\n  <dt id=\"no-check\"><a class=\"permalink\" href=\"#no-check\"><code class=\"Fl\">--no-check</code></a></dt>\n  <dd>Don't check for invalid modules</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Parse binary file test.wasm and write text file test.wast</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm2wat test.wasm -o\n  test.wat</code></div>\n<p class=\"Pp\">Parse test.wasm, write test.wat, but ignore the debug names, if\n    any</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wasm2wat test.wasm --no-debug-names\n  -o test.wat</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wast2json.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wast2json</code> &#x2014;\n    <span class=\"Nd\">convert a file in the wasm spec test format to a JSON file\n    and associated wasm binary files</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wast2json</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wast2json</code> Read a file in the wasm spec\n    test format, check it for errors, and convert it to a JSON file and\n    associated wasm binary files.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print this help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"v\"><a class=\"permalink\" href=\"#v\"><code class=\"Fl\">-v</code></a>,\n    <code class=\"Fl\">--verbose</code></dt>\n  <dd>Use multiple times for more info</dd>\n  <dt id=\"debug-parser\"><a class=\"permalink\" href=\"#debug-parser\"><code class=\"Fl\">--debug-parser</code></a></dt>\n  <dd>Turn on debugging the parser of wast files</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"o\"><a class=\"permalink\" href=\"#o\"><code class=\"Fl\">-o</code></a>,\n    <code class=\"Fl\">--output=FILE</code></dt>\n  <dd>output JSON file</dd>\n  <dt id=\"r\"><a class=\"permalink\" href=\"#r\"><code class=\"Fl\">-r</code></a>,\n    <code class=\"Fl\">--relocatable</code></dt>\n  <dd>Create a relocatable wasm binary (suitable for linking with e.g. lld)</dd>\n  <dt id=\"no-canonicalize-leb128s\"><a class=\"permalink\" href=\"#no-canonicalize-leb128s\"><code class=\"Fl\">--no-canonicalize-leb128s</code></a></dt>\n  <dd>Write all LEB128 sizes as 5-bytes instead of their minimal size</dd>\n  <dt id=\"debug-names\"><a class=\"permalink\" href=\"#debug-names\"><code class=\"Fl\">--debug-names</code></a></dt>\n  <dd>Write debug names to the generated binary file</dd>\n  <dt id=\"no-check\"><a class=\"permalink\" href=\"#no-check\"><code class=\"Fl\">--no-check</code></a></dt>\n  <dd>Don't check for invalid modules</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Parse spec-test.wast, and write files to spec-test.json. Modules\n    are written to spec-test.0.wasm, spec-test.1.wasm, etc.</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wast2json spec-test.wast -o\n  spec-test.json</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wat-desugar.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wat-desugar</code> &#x2014;\n    <span class=\"Nd\">parse .wat text form and print canonical flat\n  format</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wat-desugar</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wat-desugar</code> Parses .wat text form as\n    supported by the spec interpreter (s-expressions, flat syntax, or mixed) and\n    prints &quot;canonical&quot; flat format.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print this help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"o\"><a class=\"permalink\" href=\"#o\"><code class=\"Fl\">-o</code></a>,\n    <code class=\"Fl\">--output=FILE</code></dt>\n  <dd>Output file for the formatted file</dd>\n  <dt id=\"debug-parser\"><a class=\"permalink\" href=\"#debug-parser\"><code class=\"Fl\">--debug-parser</code></a></dt>\n  <dd>Turn on debugging the parser of wat files</dd>\n  <dt id=\"f\"><a class=\"permalink\" href=\"#f\"><code class=\"Fl\">-f</code></a>,\n    <code class=\"Fl\">--fold-exprs</code></dt>\n  <dd>Write folded expressions where possible</dd>\n  <dt id=\"inline-exports\"><a class=\"permalink\" href=\"#inline-exports\"><code class=\"Fl\">--inline-exports</code></a></dt>\n  <dd>Write all exports inline</dd>\n  <dt id=\"inline-imports\"><a class=\"permalink\" href=\"#inline-imports\"><code class=\"Fl\">--inline-imports</code></a></dt>\n  <dd>Write all imports inline</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"generate-names\"><a class=\"permalink\" href=\"#generate-names\"><code class=\"Fl\">--generate-names</code></a></dt>\n  <dd>Give auto-generated names to non-named functions, types, etc.</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Write output to stdout</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wat-desugar test.wat</code></div>\n<p class=\"Pp\">Write output to test2.wat</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wat-desugar test.wat -o\n  test2.wat</code></div>\n<p class=\"Pp\">Generate names for indexed variables</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wat-desugar --generate-names\n  test.wat</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat2wasm.1.html\">wat2wasm(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/doc/wat2wasm.1.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n  <style>\n    table.head, table.foot { width: 100%; }\n    td.head-rtitle, td.foot-os { text-align: right; }\n    td.head-vol { text-align: center; }\n    .Nd, .Bf, .Op { display: inline; }\n    .Pa, .Ad { font-style: italic; }\n    .Ms { font-weight: bold; }\n    .Bl-diag > dt { font-weight: bold; }\n    code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;\n      font-family: inherit; }\n  </style>\n  <title>WABT(1)</title>\n</head>\n<body>\n<table class=\"head\">\n  <tr>\n    <td class=\"head-ltitle\">WABT(1)</td>\n    <td class=\"head-vol\">General Commands Manual</td>\n    <td class=\"head-rtitle\">WABT(1)</td>\n  </tr>\n</table>\n<div class=\"manual-text\">\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"NAME\"><a class=\"permalink\" href=\"#NAME\">NAME</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wat2wasm</code> &#x2014;\n    <span class=\"Nd\">translate from WebAssembly text format to the WebAssembly\n    binary format</span></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SYNOPSIS\"><a class=\"permalink\" href=\"#SYNOPSIS\">SYNOPSIS</a></h1>\n<table class=\"Nm\">\n  <tr>\n    <td><code class=\"Nm\">wat2wasm</code></td>\n    <td>[options] <var class=\"Ar\">file</var></td>\n  </tr>\n</table>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"DESCRIPTION\"><a class=\"permalink\" href=\"#DESCRIPTION\">DESCRIPTION</a></h1>\n<p class=\"Pp\"><code class=\"Nm\">wat2wasm</code> Read a file in the wasm text\n    format, check it for errors, and convert it to the wasm binary format.</p>\n<p class=\"Pp\">The options are as follows:</p>\n<dl class=\"Bl-tag\">\n  <dt id=\"help\"><a class=\"permalink\" href=\"#help\"><code class=\"Fl\">--help</code></a></dt>\n  <dd>Print this help message</dd>\n  <dt id=\"version\"><a class=\"permalink\" href=\"#version\"><code class=\"Fl\">--version</code></a></dt>\n  <dd>Print version information</dd>\n  <dt id=\"v\"><a class=\"permalink\" href=\"#v\"><code class=\"Fl\">-v</code></a>,\n    <code class=\"Fl\">--verbose</code></dt>\n  <dd>Use multiple times for more info</dd>\n  <dt id=\"debug-parser\"><a class=\"permalink\" href=\"#debug-parser\"><code class=\"Fl\">--debug-parser</code></a></dt>\n  <dd>Turn on debugging the parser of wat files</dd>\n  <dt id=\"d\"><a class=\"permalink\" href=\"#d\"><code class=\"Fl\">-d</code></a>,\n    <code class=\"Fl\">--dump-module</code></dt>\n  <dd>Print a hexdump of the module to stdout</dd>\n  <dt id=\"enable-exceptions\"><a class=\"permalink\" href=\"#enable-exceptions\"><code class=\"Fl\">--enable-exceptions</code></a></dt>\n  <dd>Enable Experimental exception handling</dd>\n  <dt id=\"disable-mutable-globals\"><a class=\"permalink\" href=\"#disable-mutable-globals\"><code class=\"Fl\">--disable-mutable-globals</code></a></dt>\n  <dd>Disable Import/export mutable globals</dd>\n  <dt id=\"disable-saturating-float-to-int\"><a class=\"permalink\" href=\"#disable-saturating-float-to-int\"><code class=\"Fl\">--disable-saturating-float-to-int</code></a></dt>\n  <dd>Disable Saturating float-to-int operators</dd>\n  <dt id=\"disable-sign-extension\"><a class=\"permalink\" href=\"#disable-sign-extension\"><code class=\"Fl\">--disable-sign-extension</code></a></dt>\n  <dd>Disable Sign-extension operators</dd>\n  <dt id=\"disable-simd\"><a class=\"permalink\" href=\"#disable-simd\"><code class=\"Fl\">--disable-simd</code></a></dt>\n  <dd>Disable SIMD support</dd>\n  <dt id=\"enable-threads\"><a class=\"permalink\" href=\"#enable-threads\"><code class=\"Fl\">--enable-threads</code></a></dt>\n  <dd>Enable Threading support</dd>\n  <dt id=\"enable-function-references\"><a class=\"permalink\" href=\"#enable-function-references\"><code class=\"Fl\">--enable-function-references</code></a></dt>\n  <dd>Enable Typed function references</dd>\n  <dt id=\"disable-multi-value\"><a class=\"permalink\" href=\"#disable-multi-value\"><code class=\"Fl\">--disable-multi-value</code></a></dt>\n  <dd>Disable Multi-value</dd>\n  <dt id=\"enable-tail-call\"><a class=\"permalink\" href=\"#enable-tail-call\"><code class=\"Fl\">--enable-tail-call</code></a></dt>\n  <dd>Enable Tail-call support</dd>\n  <dt id=\"disable-bulk-memory\"><a class=\"permalink\" href=\"#disable-bulk-memory\"><code class=\"Fl\">--disable-bulk-memory</code></a></dt>\n  <dd>Disable Bulk-memory operations</dd>\n  <dt id=\"disable-reference-types\"><a class=\"permalink\" href=\"#disable-reference-types\"><code class=\"Fl\">--disable-reference-types</code></a></dt>\n  <dd>Disable Reference types (externref)</dd>\n  <dt id=\"enable-annotations\"><a class=\"permalink\" href=\"#enable-annotations\"><code class=\"Fl\">--enable-annotations</code></a></dt>\n  <dd>Enable Custom annotation syntax</dd>\n  <dt id=\"enable-code-metadata\"><a class=\"permalink\" href=\"#enable-code-metadata\"><code class=\"Fl\">--enable-code-metadata</code></a></dt>\n  <dd>Enable Code metadata</dd>\n  <dt id=\"enable-gc\"><a class=\"permalink\" href=\"#enable-gc\"><code class=\"Fl\">--enable-gc</code></a></dt>\n  <dd>Enable Garbage collection</dd>\n  <dt id=\"enable-memory64\"><a class=\"permalink\" href=\"#enable-memory64\"><code class=\"Fl\">--enable-memory64</code></a></dt>\n  <dd>Enable 64-bit memory</dd>\n  <dt id=\"enable-multi-memory\"><a class=\"permalink\" href=\"#enable-multi-memory\"><code class=\"Fl\">--enable-multi-memory</code></a></dt>\n  <dd>Enable Multi-memory</dd>\n  <dt id=\"enable-extended-const\"><a class=\"permalink\" href=\"#enable-extended-const\"><code class=\"Fl\">--enable-extended-const</code></a></dt>\n  <dd>Enable Extended constant expressions</dd>\n  <dt id=\"enable-all\"><a class=\"permalink\" href=\"#enable-all\"><code class=\"Fl\">--enable-all</code></a></dt>\n  <dd>Enable all features</dd>\n  <dt id=\"o\"><a class=\"permalink\" href=\"#o\"><code class=\"Fl\">-o</code></a>,\n    <code class=\"Fl\">--output=FILE</code></dt>\n  <dd>Output wasm binary file. Use &quot;-&quot; to write to stdout.</dd>\n  <dt id=\"r\"><a class=\"permalink\" href=\"#r\"><code class=\"Fl\">-r</code></a>,\n    <code class=\"Fl\">--relocatable</code></dt>\n  <dd>Create a relocatable wasm binary (suitable for linking with e.g. lld)</dd>\n  <dt id=\"no-canonicalize-leb128s\"><a class=\"permalink\" href=\"#no-canonicalize-leb128s\"><code class=\"Fl\">--no-canonicalize-leb128s</code></a></dt>\n  <dd>Write all LEB128 sizes as 5-bytes instead of their minimal size</dd>\n  <dt id=\"debug-names\"><a class=\"permalink\" href=\"#debug-names\"><code class=\"Fl\">--debug-names</code></a></dt>\n  <dd>Write debug names to the generated binary file</dd>\n  <dt id=\"no-check\"><a class=\"permalink\" href=\"#no-check\"><code class=\"Fl\">--no-check</code></a></dt>\n  <dd>Don't check for invalid modules</dd>\n</dl>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"EXAMPLES\"><a class=\"permalink\" href=\"#EXAMPLES\">EXAMPLES</a></h1>\n<p class=\"Pp\">Parse test.wat and write to .wasm binary file with the same\n  name</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wat2wasm test.wat</code></div>\n<p class=\"Pp\">Parse test.wat and write to binary file test.wasm</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wat2wasm test.wat -o\n  test.wasm</code></div>\n<p class=\"Pp\">Parse spec-test.wast, and write verbose output to stdout\n    (including the meaning of every byte)</p>\n<p class=\"Pp\"></p>\n<div class=\"Bd Bd-indent\"><code class=\"Li\">$ wat2wasm spec-test.wast\n  -v</code></div>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"SEE_ALSO\"><a class=\"permalink\" href=\"#SEE_ALSO\">SEE\n  ALSO</a></h1>\n<p class=\"Pp\"><a class=\"Xr\" href=\"wasm-decompile.1.html\">wasm-decompile(1)</a>,\n    <a class=\"Xr\" href=\"wasm-interp.1.html\">wasm-interp(1)</a>,\n    <a class=\"Xr\" href=\"wasm-objdump.1.html\">wasm-objdump(1)</a>,\n    <a class=\"Xr\" href=\"wasm-stats.1.html\">wasm-stats(1)</a>,\n    <a class=\"Xr\" href=\"wasm-strip.1.html\">wasm-strip(1)</a>,\n    <a class=\"Xr\" href=\"wasm-validate.1.html\">wasm-validate(1)</a>,\n    <a class=\"Xr\" href=\"wasm2c.1.html\">wasm2c(1)</a>,\n    <a class=\"Xr\" href=\"wasm2wat.1.html\">wasm2wat(1)</a>,\n    <a class=\"Xr\" href=\"wast2json.1.html\">wast2json(1)</a>,\n    <a class=\"Xr\" href=\"wat-desugar.1.html\">wat-desugar(1)</a>,\n    <a class=\"Xr\" href=\"spectest-interp.1.html\">spectest-interp(1)</a></p>\n</section>\n<section class=\"Sh\">\n<h1 class=\"Sh\" id=\"BUGS\"><a class=\"permalink\" href=\"#BUGS\">BUGS</a></h1>\n<p class=\"Pp\">If you find a bug, please report it at\n  <br/>\n  <a class=\"Lk\" href=\"https://github.com/WebAssembly/wabt/issues\">https://github.com/WebAssembly/wabt/issues</a>.</p>\n</section>\n</div>\n<table class=\"foot\">\n  <tr>\n    <td class=\"foot-date\">September 23, 2025</td>\n    <td class=\"foot-os\">Debian</td>\n  </tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "docs/wast2json.md",
    "content": "# wast2json\n\n`wast2json` converts a `.wast` file to a `.json` file, and a collection of\nassociated `.wat` file and `.wasm` files.\n\n## Example\n\n```sh\n# parse spec-test.wast, and write files to spec-test.json. Modules are written\n# to spec-test.0.wasm, spec-test.1.wasm, etc.\n$ bin/wast2json spec-test.wast -o spec-test.json\n```\n\n## Wast\n\nThe wast format is described in the [spec\ninterpreter](https://github.com/WebAssembly/spec/tree/master/interpreter#scripts).\nIt is an extension of the `.wat` text format, with additional commands for\nrunning scripts. The syntax is repeated here:\n\n```\nscript: <cmd>*\n\ncmd:\n  <module>                                   ;; define, validate, and initialize module\n  ( register <string> <name>? )              ;; register module for imports\nmodule with given failure string\n  <action>                                   ;; perform action and print results\n  <assertion>                                ;; assert result of an action\n  <meta>                                     ;; meta command\n\nmodule:\n  ...\n  ( module <name>? binary <string>* )        ;; module in binary format (may be malformed)\n  ( module <name>? quote <string>* )         ;; module quoted in text (may be malformed)\n\naction:\n  ( invoke <name>? <string> <expr>* )        ;; invoke function export\n  ( get <name>? <string> )                   ;; get global export\n\nassertion:\n  ( assert_return <action> <result>* )       ;; assert action has expected results\n  ( assert_trap <action> <failure> )         ;; assert action traps with given failure string\n  ( assert_exhaustion <action> <failure> )   ;; assert action exhausts system resources\n  ( assert_malformed <module> <failure> )    ;; assert module cannot be decoded with given failure string\n  ( assert_invalid <module> <failure> )      ;; assert module is invalid with given failure string\n  ( assert_unlinkable <module> <failure> )   ;; assert module fails to link\n  ( assert_trap <module> <failure> )         ;; assert module traps on instantiation\n\nresult:\n  ( <val_type>.const <numpat> )\n\nnumpat:\n  <value>                                    ;; literal result\n  nan:canonical                              ;; NaN in canonical form\n  nan:arithmetic                             ;; NaN with 1 in MSB of payload\n\nmeta:\n  ( script <name>? <script> )                ;; name a subscript\n  ( input <name>? <string> )                 ;; read script or module from file\n  ( output <name>? <string>? )               ;; output module to stout or file\n```\n\n`wast2json` supports all of this format except the `meta` commands. The meta\ncommands are not used in any of the spec tests.\n\n## JSON format\n\nThe JSON format has the following structure:\n\n```\n{\"source_filename\": <string>,\n \"commands\": [ <commands>* ] }\n```\n\nThe `source_filename` is the name of the input `.wast` file. Each command is a\nJSON object. They all have the following structure:\n\n```\n{\"type\": <string>, \"line\": <number>, ...}\n```\n\nThe `line` property is the line in the `.wast` file where this command is\ndefined. The `type` property can be one of the following. Given the string, the\nrest of the command object has the given structure:\n\n| type | extra properties |\n| - | - |\n| \"module\" | `{..., \"name\": <string>, \"filename\": <string>}` |\n| \"action\" | `{..., \"action\": <action>}` |\n| \"assert_return\" | `{..., \"action\": <action>, \"expected\": <expected>}` |\n| \"assert_exhaustion\" | `{..., \"action\": <action>, \"text\": <string>}` |\n| \"assert_trap\" | `{..., \"action\": <action>, \"text\": <string>}` |\n| \"assert_invalid\" | `{..., \"filename\": <string>, \"text\": <string>, \"module_type\": <module_type>}` |\n| \"assert_malformed\" | `{..., \"filename\": <string>, \"text\": <string>, \"module_type\": <module_type>}` |\n| \"assert_uninstantiable\" | `{..., \"filename\": <string>, \"text\": <string>, \"module_type\": <module_type>}` |\n| \"assert_unlinkable\" | `{..., \"filename\": <string>, \"text\": <string>, \"module_type\": <module_type>}` |\n| \"register\" | `{..., \"name\": <string>, \"as\": <string>}` |\n\n### Actions\n\nAn action represents the wast `action`: either an \"invoke\" or a \"get\" command.\nAn action can be run with or without an associated assertion.\n\nIf this is an \"invoke\" action, the \"field\" property represents the name of the\nexported function to run. If this is a \"get\" action, the \"field\" property\nrepresents the name of the exported global to access.\n\nAn action has an optional module name. If the name is provided, this is the\nmodule to run the action on. If the name is not provided, the action is run on\nthe most recently instantiated module.\n\nThe complete format for an \"invoke\" action command is:\n\n```\n{\n  \"type\": \"invoke\",\n  (\"module\": <string>)?,\n  \"field\": <string>,\n  \"args\": <const_vector>\n}\n```\n\nThe \"args\" property represents the parameters to pass to the exported function.\n\nThe complete format for a \"get\" action command is:\n\n```\n{\n  \"type\": \"get\",\n  (\"module\": <string>)?,\n  \"field\": <string>\n}\n```\n\n### Const Vectors\n\nA const vector is an array of consts.\n\n```\n[<const>]\n```\n\n### Const\n\nA const is a constant value. It contains both a type and a value. The following\ntypes are supported, with the given JSON format:\n\n| type | JSON format |\n| - | - |\n| \"i32\" | `{\"type\": \"i32\", \"value\": <string>}` |\n| \"i64\" | `{\"type\": \"i64\", \"value\": <string>}` |\n| \"f32\" | `{\"type\": \"f32\", \"value\": <string>}` |\n| \"f64\" | `{\"type\": \"f64\", \"value\": <string>}` |\n\nThe `reference-types` proposal adds three more valid types. In each case the\nvalue can either be an integer or `\"null\"`:\n\n| type | JSON format |\n| - | - |\n| \"externref\" | `{\"type\": \"externref\", \"value\": <string>}` |\n| \"funcref\" | `{\"type\": \"funcref\", \"value\": <string>}` |\n| \"exnref\" | `{\"type\": \"exnref\", \"value\": <string>}` |\n\nThe `simd` proposal adds another type, with a slightly different syntax.\n\n```\n{\n  \"type\": \"v128\",\n  \"lane_type\": \"i8\" | \"i16\" | \"i32\" | \"f32\" | \"f64\",\n  \"value\": [ (<string>,)* ]\n}\n```\n\nAll numeric value are stored as strings, since JSON numbers are not guaranteed\nto be precise enough to store all Wasm values. Values are always written as\ndecimal numbers. For example, the following const has the type \"i32\" and the\nvalue `34`.\n\n```\n(\"type\": \"i32\", \"value\": \"34\"}\n```\n\nFor floats, the numbers are written as the decimal encoding of the binary\nrepresentation of the number. For example, the following const has the type\n\"f32\" and the value `1.0`. The value is `1065353216` because that is equivalent\nto hexadecimal `0x3f800000`, which is the binary representation of `1.0` as a\n32-bit float.\n\n```\n(\"type\": \"f32\", \"value\": \"1065353216\"}\n```\n\nA \"v128\" value stores each of its lanes as a separate string. The number of\nlanes depends on the \"lane_type\" property:\n\n| \"lane_type\" | #lanes |\n| - | - |\n| \"i8\" | 16 |\n| \"i16\" | 8 |\n| \"i32\" | 4 |\n| \"i64\" | 2 |\n| \"f32\" | 4 |\n| \"f64\" | 2 |\n\nFor example, a \"v128\" const with lane type \"i32\" and lanes `0`, `1`, `2`, `3`\nwould be written:\n\n```\n{\n  \"type\": \"v128\",\n  \"lane_type\": \"i32\",\n  \"value\": [\"0\", \"1\", \"2\", \"3\"]\n}\n```\n\n### Expected\n\nExpected values are similar to a const vector. They are always arrays, and they\ntypically contain const values. For example, the following expected value is\nthe same as a const vector, and has the type \"i32\" and the value \"1\":\n\n```\n[\n  {\"type\": \"i32\", \"value\": \"1\"}\n]\n```\n\nHowever, an expected value can also contain a pattern. In particular, for \"f32\"\nand \"f64\" types (and simd lanes), the pattern can also be \"nan:canonical\" or\n\"nan:arithmetic\". For example, the following expected value has the type \"f32\"\nand must be a canonical NaN:\n\n```\n[\n  {\"type\": \"f32\", \"value\": \"nan:canonical\"}\n]\n```\n\nThe `simd` proposal extends this pattern for multiple lanes, where each lane\ncan be a const or a pattern. For example, the following expected value has four\nlanes, each of type \"f32\", two of which have const values (lanes 0 and 2), and\ntwo of which are patterns (lanes 1 and 3):\n\n```\n[\n  {\n    \"type\": \"v128\",\n    \"lane_type\": \"f32\",\n    \"value\": [\n      \"0\",\n      \"nan:arithmetic\",\n      \"0\",\n      \"nan:arithmetic\",\n    ]\n  }\n]\n```\n\nThe `multi-value` proposal allows for multiple return values from a function,\nwhich is why the expected values is always an array. For example, the following\nexample has two expected values:\n\n```\n[\n  {\"type\": \"i32\", \"value\": \"1\"},\n  {\"type\": \"i64\", \"value\": \"2\"}\n]\n```\n\n### \"module\" command\n\nThe \"module\" JSON command represents the wast `module` command. It compiles and\ninstantiates a new module, which then becomes the default target for future\nassertions.\n\nThe complete format for the \"module\" command is:\n\n```\n{\n \"type\": \"module\",\n \"line\": <number>,\n (\"name\": <string>,)?\n \"filename\": <string>\n}\n```\n\nOptionally, the module can be given a name via the \"name\" property. If given,\nthis name can be used in action commands to refer to this module instead of the\nmost recently instantiated one.\n\nThe \"filename\" property specifies the path to the `.wasm` file for this module.\nThe path is always relative to the JSON file.\n\n### \"action\" command\n\n```\n{\n \"type\": \"action\",\n \"line\": <number>,\n \"action\": <action>\n}\n```\n\nThe \"action\" JSON command represents a wast action (either `invoke` or `get`)\nthat does not have an associated assertion).\n\n### \"assert_return\" command\n\n```\n{\n \"type\": \"assert_return\",\n \"line\": <number>,\n \"action\": <action>\n \"expected\": <expected>\n}\n```\n\nThe \"assert_return\" JSON command represents the wast `assert_return` command.\nIt runs an action and checks that the result is an expected value.\n\n### \"assert_exhaustion\" command\n\n```\n{\n \"type\": \"assert_exhaustion\",\n \"line\": <number>,\n \"action\": <action>,\n \"text\": <string>\n}\n```\n\nThe \"assert_exhaustion\" JSON command represents the wast `assert_exhaustion`\ncommand. It runs an action, and checks whether this produces a stack overflow.\n\nThe \"text\" property specifies the text expected by the rerefence interpreter.\n\n### \"assert_trap\" command\n\n```\n{\n \"type\": \"assert_trap\",\n \"line\": <number>,\n \"action\": <action>,\n \"text\": <string>\n}\n```\n\nThe \"assert_trap\" JSON command represents the action form of the wast\n`assert_trap` command. The wast format also has an `assert_trap` that operates\non a module which is called \"assert_uninstantiable\" in the JSON format.\n\nThe \"assert_trap\" command runs an action with the expectation that it will\ntrap.\n\nThe \"text\" property specifies the text expected by the rerefence interpreter.\n\n### \"assert_invalid\" command\n\n```\n{\n  \"type\": \"assert_invalid\",\n  \"line\": <number>,\n  \"filename\": <string>,\n  \"text\": <string>,\n  \"module_type\": \"binary\" | \"text\"\n}\n```\n\nThe \"assert_invalid\" JSON command represents the wast `assert_invalid` command.\nIt reads a module with the expectation that it will not validate.\n\nThe \"filename\" property specifies the path to the `.wasm` or `.wat` file for\nthis module. The path is always relative to the JSON file.\n\nThe \"text\" property specifies the error text expected by the reference\ninterpreter.\n\nThe \"module_type\" property specifies whether this module is in text or binary\nformat.\n\n### \"assert_malformed\" command\n\n```\n{\n  \"type\": \"assert_malformed\",\n  \"line\": <number>,\n  \"filename\": <string>,\n  \"text\": <string>,\n  \"module_type\": \"binary\" | \"text\"\n}\n```\n\nThe \"assert_malformed\" JSON command represents the wast `assert_malformed`\ncommand. It reads a module with the expectation that it is malformed. Note that\nthis is different than being invalid; a malformed module is one that doesn't\nobey the syntax rules of the binary or text format.\n\nThe \"filename\" property specifies the path to the `.wasm` or `.wat` file for\nthis module. The path is always relative to the JSON file.\n\nThe \"text\" property specifies the error text expected by the reference\ninterpreter.\n\nThe \"module_type\" property specifies whether this module is in text or binary\nformat.\n\n### \"assert_uninstantiable\" command\n\n```\n{\n  \"type\": \"assert_uninstantiable\",\n  \"line\": <number>,\n  \"filename\": <string>,\n  \"text\": <string>,\n  \"module_type\": \"binary\" | \"text\"\n}\n```\n\nThe \"assert_uninstantiable\" JSON command represents the module form of the wast\n`assert_trap` command. The wast format also has an `assert_trap` command that\nruns an action, which is called \"assert_trap\" in the JSON format.\n\nAn uninstantiable module is one where the linking step succeeds, but the start\nfunction traps.\n\nThe \"filename\" property specifies the path to the `.wasm` or `.wat` file for\nthis module. The path is always relative to the JSON file.\n\nThe \"text\" property specifies the error text expected by the reference\ninterpreter.\n\nThe \"module_type\" property specifies whether this module is in text or binary\nformat.\n\n### \"assert_unlinkable\" command\n\n```\n{\n  \"type\": \"assert_unlinkable\",\n  \"line\": <number>,\n  \"filename\": <string>,\n  \"text\": <string>,\n  \"module_type\": \"binary\" | \"text\"\n}\n```\n\nThe \"assert_unlinkable\" JSON command represents the wast `assert_unlinkable`\ncommand. It reads a module with the expectation that it will not link with the\nother modules provided; i.e., one of its imports is not provided or does not\nmatch.\n\nThe \"filename\" property specifies the path to the `.wasm` or `.wat` file for\nthis module. The path is always relative to the JSON file.\n\nThe \"text\" property specifies the error text expected by the reference\ninterpreter.\n\nThe \"module_type\" property specifies whether this module is in text or binary\nformat.\n\n### \"register\" command\n\n```\n{\n  \"type\": \"register\",\n  (\"name\": <string>,)?\n  \"as\": <string>\n}\n```\n\nThe \"register\" JSON command represents the wast `register` command. It\nregisters the exports of the given module as a given name.\n\nThe \"name\" property specifies the module to be registered. If it is empty, the\nmost recently instantiated module is used.\n\nThe \"as\" property specifies the name to use in the registry. For example, if a module is registered as:\n\n```\n{\n  \"type\": \"register\",\n  \"as\": \"my_module\"\n}\n```\n\nThen its exports can be imported as:\n\n```wasm\n(import \"my_module\" \"my_export\" ...)\n```\n\n## Full Example\n\nAssume we have the following `.wast` file:\n\n```wasm\n(module\n  (func (export \"add\") (param i32 i32) (result i32)\n    local.get 0\n    local.get 1\n    i32.add)\n\n  (func (export \"trap\")\n    unreachable)\n)\n\n(assert_return (invoke \"add\" (i32.const 11) (i32.const 22)) (i32.const 33))\n\n(assert_trap (invoke \"trap\") \"unreachable\")\n\n(assert_malformed\n  (module quote \"(modulee)\")\n  \"syntax error\"\n)\n```\n\nThe following JSON file will be generated (with added whitespace for clarity):\n\n```\n{\n  \"source_filename\": \"example.wast\",\n  \"commands\": [\n    {\n      \"type\": \"module\",\n      \"line\": 1,\n      \"filename\": \"example.0.wasm\"\n    },\n\n    {\n      \"type\": \"assert_return\",\n      \"line\": 11,\n      \"action\": {\n        \"type\": \"invoke\",\n        \"field\": \"add\",\n        \"args\": [\n          {\"type\": \"i32\", \"value\": \"11\"},\n          {\"type\": \"i32\", \"value\": \"22\"}\n        ]\n      },\n      \"expected\": [\n        {\"type\": \"i32\", \"value\": \"33\"}\n      ]\n    },\n\n    {\n      \"type\": \"assert_trap\",\n      \"line\": 13,\n      \"action\": {\n        \"type\": \"invoke\",\n        \"field\": \"trap\",\n        \"args\": []\n      },\n      \"text\": \"unreachable\",\n    },\n\n    {\n      \"type\": \"assert_malformed\",\n      \"line\": 16,\n      \"filename\": \"example.1.wat\",\n      \"text\": \"syntax error\",\n      \"module_type\": \"text\"\n    }\n  ]\n}\n```\n"
  },
  {
    "path": "fuzz-in/wast/basic.txt",
    "content": "(module\n  (func (result i32)\n    (return (i32.const 42))))\n"
  },
  {
    "path": "fuzz-in/wast.dict",
    "content": "# AFL dictionary for the WAST format\n\nopen=\"(\"\nclose=\")\"\ncomment=\";;\"\nblock_comment_open=\"(;\"\nblock_comment_close=\";)\"\n\nparam_i32=\"(param i32)\"\nparam_i64=\"(param i64)\"\nparam_f32=\"(param f32)\"\nparam_f64=\"(param f64)\"\n\nresult_i32=\"(result i32)\"\nresult_i64=\"(result i64)\"\nresult_f32=\"(result f32)\"\nresult_f64=\"(result f64)\"\n\ntype_i32=\"i32\"\ntype_i64=\"i64\"\ntype_f32=\"f32\"\ntype_f64=\"f64\"\n\nmisc_name=\"$foobar\"\nmisc_int=\"42\"\nmisc_int_hex=\"0xdeadcode\"\nmisc_float=\"3.14159\"\nmisc_float_exp=\"1e100\"\nmisc_float_hex=\"0xcab.ba6ep4\"\nmisc_float_inf=\"infinity\"\nmisc_float_nan=\"nan:0xf00baa\"\nmisc_float_sign=\"-6.02e-23\"\n\nop_nop=\"nop\"\nop_block=\"block\"\nop_if=\"if\"\nop_then=\"then\"\nop_else=\"else\"\nop_loop=\"loop\"\nop_br=\"br\"\nop_br_if=\"br_if\"\nop_br_table=\"br_table\"\nop_call=\"call\"\nop_call_indirect=\"call_indirect\"\nop_drop=\"drop\"\nop_end=\"end\"\nop_return=\"return\"\nop_local_get=\"local.get\"\nop_local_set=\"local.set\"\nop_local_tee=\"local.tee\"\nop_global_get=\"global.get\"\nop_global_set=\"global.set\"\nop_i32_load=\"i32.load\"\nop_i64_load=\"i64.load\"\nop_f32_load=\"f32.load\"\nop_f64_load=\"f64.load\"\nop_i32_store=\"i32.store\"\nop_i64_store=\"i64.store\"\nop_f32_store=\"f32.store\"\nop_f64_store=\"f64.store\"\nop_i32_load8_s=\"i32.load8_s\"\nop_i64_load8_s=\"i64.load8_s\"\nop_i32_load8_u=\"i32.load8_u\"\nop_i64_load8_u=\"i64.load8_u\"\nop_i32_load16_s=\"i32.load16_s\"\nop_i64_load16_s=\"i64.load16_s\"\nop_i32_load16_u=\"i32.load16_u\"\nop_i64_load16_u=\"i64.load16_u\"\nop_i64_load32_s=\"i64.load32_s\"\nop_i64_load32_u=\"i64.load32_u\"\nop_i32_store8=\"i32.store8\"\nop_i64_store8=\"i64.store8\"\nop_i32_store16=\"i32.store16\"\nop_i64_store16=\"i64.store16\"\nop_i64_store32=\"i64.store32\"\nop_i32_const=\"i32.const\"\nop_i64_const=\"i64.const\"\nop_f32_const=\"f32.const\"\nop_f64_const=\"f64.const\"\nop_i32_eqz=\"i32.eqz\"\nop_i64_eqz=\"i64.eqz\"\nop_i32_clz=\"i32.clz\"\nop_i64_clz=\"i64.clz\"\nop_i32_ctz=\"i32.ctz\"\nop_i64_ctz=\"i64.ctz\"\nop_i32_popcnt=\"i32.popcnt\"\nop_i64_popcnt=\"i64.popcnt\"\nop_f32_neg=\"f32.neg\"\nop_f64_neg=\"f64.neg\"\nop_f32_abs=\"f32.abs\"\nop_f64_abs=\"f64.abs\"\nop_f32_sqrt=\"f32.sqrt\"\nop_f64_sqrt=\"f64.sqrt\"\nop_f32_ceil=\"f32.ceil\"\nop_f64_ceil=\"f64.ceil\"\nop_f32_floor=\"f32.floor\"\nop_f64_floor=\"f64.floor\"\nop_f32_trunc=\"f32.trunc\"\nop_f64_trunc=\"f64.trunc\"\nop_f32_nearest=\"f32.nearest\"\nop_f64_nearest=\"f64.nearest\"\nop_i32_add=\"i32.add\"\nop_i64_add=\"i64.add\"\nop_i32_sub=\"i32.sub\"\nop_i64_sub=\"i64.sub\"\nop_i32_mul=\"i32.mul\"\nop_i64_mul=\"i64.mul\"\nop_i32_div_s=\"i32.div_s\"\nop_i64_div_s=\"i64.div_s\"\nop_i32_div_u=\"i32.div_u\"\nop_i64_div_u=\"i64.div_u\"\nop_i32_rem_s=\"i32.rem_s\"\nop_i64_rem_s=\"i64.rem_s\"\nop_i32_rem_u=\"i32.rem_u\"\nop_i64_rem_u=\"i64.rem_u\"\nop_i32_and=\"i32.and\"\nop_i64_and=\"i64.and\"\nop_i32_or=\"i32.or\"\nop_i64_or=\"i64.or\"\nop_i32_xor=\"i32.xor\"\nop_i64_xor=\"i64.xor\"\nop_i32_shl=\"i32.shl\"\nop_i64_shl=\"i64.shl\"\nop_i32_shr_s=\"i32.shr_s\"\nop_i64_shr_s=\"i64.shr_s\"\nop_i32_shr_u=\"i32.shr_u\"\nop_i64_shr_u=\"i64.shr_u\"\nop_i32_rotl=\"i32.rotl\"\nop_i64_rotl=\"i64.rotl\"\nop_f32_add=\"f32.add\"\nop_f64_add=\"f64.add\"\nop_f32_sub=\"f32.sub\"\nop_f64_sub=\"f64.sub\"\nop_f32_mul=\"f32.mul\"\nop_f64_mul=\"f64.mul\"\nop_f32_div=\"f32.div\"\nop_f64_div=\"f64.div\"\nop_f32_min=\"f32.min\"\nop_f64_min=\"f64.min\"\nop_f32_max=\"f32.max\"\nop_f64_max=\"f64.max\"\nop_f32_copysign=\"f32.copysign\"\nop_f64_copysign=\"f64.copysign\"\nop_i32_eq=\"i32.eq\"\nop_i64_eq=\"i64.eq\"\nop_i32_ne=\"i32.ne\"\nop_i64_ne=\"i64.ne\"\nop_i32_lt_s=\"i32.lt_s\"\nop_i64_lt_s=\"i64.lt_s\"\nop_i32_lt_u=\"i32.lt_u\"\nop_i64_lt_u=\"i64.lt_u\"\nop_i32_le_s=\"i32.le_s\"\nop_i64_le_s=\"i64.le_s\"\nop_i32_le_u=\"i32.le_u\"\nop_i64_le_u=\"i64.le_u\"\nop_i32_gt_s=\"i32.gt_s\"\nop_i64_gt_s=\"i64.gt_s\"\nop_i32_gt_u=\"i32.gt_u\"\nop_i64_gt_u=\"i64.gt_u\"\nop_i32_ge_s=\"i32.ge_s\"\nop_i64_ge_s=\"i64.ge_s\"\nop_i32_ge_u=\"i32.ge_u\"\nop_i64_ge_u=\"i64.ge_u\"\nop_f32_eq=\"f32.eq\"\nop_f64_eq=\"f64.eq\"\nop_f32_ne=\"f32.ne\"\nop_f64_ne=\"f64.ne\"\nop_f32_lt=\"f32.lt\"\nop_f64_lt=\"f64.lt\"\nop_f32_le=\"f32.le\"\nop_f64_le=\"f64.le\"\nop_f32_gt=\"f32.gt\"\nop_f64_gt=\"f64.gt\"\nop_f32_ge=\"f32.ge\"\nop_f64_ge=\"f64.ge\"\nop_i64_extend_i32_s=\"i64.extend_i32_s\"\nop_i64_extend_i32_u=\"i64.extend_i32_u\"\nop_i32_wrap_i64=\"i32.wrap_i64\"\nop_i32_trunc_f32_s=\"i32.trunc_f32_s\"\nop_i64_trunc_f32_s=\"i64.trunc_f32_s\"\nop_i32_trunc_f64_s=\"i32.trunc_f64_s\"\nop_i64_trunc_f64_s=\"i64.trunc_f64_s\"\nop_i32_trunc_f32_u=\"i32.trunc_f32_u\"\nop_i64_trunc_f32_u=\"i64.trunc_f32_u\"\nop_i32_trunc_f64_u=\"i32.trunc_f64_u\"\nop_i64_trunc_f64_u=\"i64.trunc_f64_u\"\nop_f32_convert_i32_s=\"f32.convert_i32_s\"\nop_f64_convert_i32_s=\"f64.convert_i32_s\"\nop_f32_convert_i64_s=\"f32.convert_i64_s\"\nop_f64_convert_i64_s=\"f64.convert_i64_s\"\nop_f32_convert_i32_u=\"f32.convert_i32_u\"\nop_f64_convert_i32_u=\"f64.convert_i32_u\"\nop_f32_convert_i64_u=\"f32.convert_i64_u\"\nop_f64_convert_i64_u=\"f64.convert_i64_u\"\nop_f64_promote_f32=\"f64.promote_f32\"\nop_f32_demote_f64=\"f32.demote_f64\"\nop_f32_reinterpret_i32=\"f32.reinterpret_i32\"\nop_i32_reinterpret_f32=\"i32.reinterpret_f32\"\nop_f64_reinterpret_i64=\"f64.reinterpret_i64\"\nop_i64_reinterpret_f64=\"i64.reinterpret_f64\"\nop_select=\"select\"\nop_unreachable=\"unreachable\"\nop_memory_size=\"memory.size\"\nop_memory_grow=\"memory.grow\"\nop_type=\"type\"\nop_func=\"func\"\nop_param=\"param\"\nop_result=\"result\"\nop_local=\"local\"\nop_global=\"global\"\nop_module=\"module\"\nop_table=\"table\"\nop_memory=\"memory\"\nop_table=\"start\"\nop_elem=\"elem\"\nop_data=\"data\"\nop_offset=\"offset\"\nop_align=\"align=\"\nop_import=\"import\"\nop_export=\"export\"\nop_register=\"register\"\nop_invoke=\"invoke\"\nop_get=\"get\"\nop_assert_malformed=\"assert_malformed\"\nop_assert_invalid=\"assert_invalid\"\nop_assert_unlinkable=\"assert_unlinkable\"\nop_assert_return=\"assert_return\"\nop_assert_trap=\"assert_trap\"\nop_assert_exhaustion=\"assert_exhaustion\"\n"
  },
  {
    "path": "fuzzers/read_binary_interp_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"wabt/binary-reader.h\"\n#include \"wabt/interp/binary-reader-interp.h\"\n#include \"wabt/interp/interp.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  wabt::Errors errors;\n  wabt::Features features;\n  wabt::interp::ModuleDesc module;\n  FuzzedDataProvider data_provider(data, size);\n\n#define WABT_FEATURE(variable, flag, default_, help) \\\n  if (data_provider.ConsumeBool()) { features.enable_##variable(); }\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n  // Add only feature related options, but no logging, stop_on_first_error, etc.\n  wabt::ReadBinaryOptions options(features, nullptr, false, false, false);\n  std::vector<uint8_t> text = data_provider.ConsumeRemainingBytes<uint8_t>();\n  ReadBinaryInterp(\"<fuzzer>\", text.data(), text.size(), options, &errors,\n                   &module);\n  return 0;\n}\n"
  },
  {
    "path": "fuzzers/read_binary_ir_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <cstddef>\n#include <cstdint>\n\n#include <fuzzer/FuzzedDataProvider.h>\n\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n  wabt::Errors errors;\n  wabt::Module module;\n  wabt::Features features;\n  FuzzedDataProvider data_provider(data, size);\n#define WABT_FEATURE(variable, flag, default_, help) \\\n  if (data_provider.ConsumeBool()) { features.enable_##variable(); }\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n  // Add only feature related options, but no logging, stop_on_first_error, etc.\n  wabt::ReadBinaryOptions options(features, nullptr, false, false, false);\n  std::vector<uint8_t> text = data_provider.ConsumeRemainingBytes<uint8_t>();\n  ReadBinaryIr(\"\", text.data(), text.size(), options, &errors, &module);\n  return 0;\n}\n"
  },
  {
    "path": "fuzzers/wasm2wat_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/common.h\"\n#include \"wabt/ir.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  wabt::ReadBinaryOptions options;\n  wabt::Errors errors;\n  wabt::Module module;\n  wabt::ReadBinaryIr(\"dummy filename\", data, size, options, &errors, &module);\n  return 0;\n}\n"
  },
  {
    "path": "fuzzers/wasm_objdump_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"wabt/binary-reader-objdump.h\"\n#include \"wabt/binary-reader.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  wabt::ObjdumpOptions objdump_options{};\n  wabt::ObjdumpState state;\n\n  objdump_options.debug = false;\n  objdump_options.filename = \"dummy\";\n  objdump_options.log_stream = nullptr;\n\n  objdump_options.mode = wabt::ObjdumpMode::Prepass;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  objdump_options.mode = wabt::ObjdumpMode::Headers;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  objdump_options.mode = wabt::ObjdumpMode::Details;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  objdump_options.mode = wabt::ObjdumpMode::Disassemble;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  objdump_options.mode = wabt::ObjdumpMode::RawData;\n  wabt::ReadBinaryObjdump(data, size, &objdump_options, &state);\n\n  return 0;\n}\n"
  },
  {
    "path": "fuzzers/wat2wasm_fuzzer.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"wabt/ir.h\"\n#include \"wabt/wast-lexer.h\"\n#include \"wabt/wast-parser.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  wabt::Errors Lexerrors;\n  std::unique_ptr<wabt::WastLexer> lexer =\n      wabt::WastLexer::CreateBufferLexer(\"fake_file\", data, size, &Lexerrors);\n\n  if (!lexer) {\n    return 0;\n  }\n\n  std::unique_ptr<wabt::Module> module;\n  wabt::Errors errors;\n  wabt::Features features;\n  wabt::WastParseOptions parse_wast_options(features);\n  ParseWatModule(lexer.get(), &module, &errors, &parse_wast_options);\n\n  return 0;\n}\n"
  },
  {
    "path": "include/wabt/apply-names.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_APPLY_NAMES_H_\n#define WABT_APPLY_NAMES_H_\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nstruct Module;\n\n/* Use function, import, function type, parameter and local names in Vars\n * that reference them.\n *\n * e.g. transform this:\n *\n *    (func $foo ...)\n *    ...\n *    (call 0 ...)\n *\n * to this:\n *\n *    (func $foo ...)\n *    ...\n *    (call $foo ...)\n */\nResult ApplyNames(struct Module*);\n\n}  // namespace wabt\n\n#endif /* WABT_APPLY_NAMES_H_ */\n"
  },
  {
    "path": "include/wabt/base-types.h",
    "content": "/*\n * Copyright 2021 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BASE_TYPES_H_\n#define WABT_BASE_TYPES_H_\n\n#include <cstddef>\n#include <cstdint>\n\nnamespace wabt {\n\nusing Index = uint32_t;    // An index into one of the many index spaces.\nusing Address = uint64_t;  // An address or size in linear memory.\nusing Offset = size_t;     // An offset into a host's file or memory buffer.\n\nconstexpr Address kInvalidAddress = ~0;\nconstexpr Index kInvalidIndex = ~0;\nconstexpr Offset kInvalidOffset = ~0;\n\n}  // namespace wabt\n\n#endif  // WABT_BASE_TYPES_H_\n"
  },
  {
    "path": "include/wabt/binary-reader-ir.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_READER_IR_H_\n#define WABT_BINARY_READER_IR_H_\n\n#include \"wabt/common.h\"\n#include \"wabt/error.h\"\n\nnamespace wabt {\n\nstruct Module;\nstruct ReadBinaryOptions;\n\nResult ReadBinaryIr(const char* filename,\n                    const void* data,\n                    size_t size,\n                    const ReadBinaryOptions& options,\n                    Errors*,\n                    Module* out_module);\n\n}  // namespace wabt\n\n#endif /* WABT_BINARY_READER_IR_H_ */\n"
  },
  {
    "path": "include/wabt/binary-reader-logging.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_READER_LOGGING_H_\n#define WABT_BINARY_READER_LOGGING_H_\n\n#include \"wabt/binary-reader.h\"\n\nnamespace wabt {\n\nclass Stream;\n\nclass BinaryReaderLogging : public BinaryReaderDelegate {\n public:\n  BinaryReaderLogging(Stream*, BinaryReaderDelegate* forward);\n\n  bool OnError(const Error&) override;\n  void OnSetState(const State* s) override;\n\n  Result BeginModule(uint32_t version) override;\n  Result EndModule() override;\n\n  Result BeginSection(Index section_index,\n                      BinarySection section_type,\n                      Offset size) override;\n\n  Result BeginCustomSection(Index section_index,\n                            Offset size,\n                            std::string_view section_name) override;\n  Result EndCustomSection() override;\n\n  Result BeginTypeSection(Offset size) override;\n  Result OnTypeCount(Index count) override;\n  Result OnFuncType(Index index,\n                    Index param_count,\n                    Type* param_types,\n                    Index result_count,\n                    Type* result_types) override;\n  Result OnStructType(Index index, Index field_count, TypeMut* fields) override;\n  Result OnArrayType(Index index, TypeMut field) override;\n  Result EndTypeSection() override;\n\n  Result BeginImportSection(Offset size) override;\n  Result OnImportCount(Index count) override;\n  Result OnImport(Index index,\n                  ExternalKind kind,\n                  std::string_view module_name,\n                  std::string_view field_name) override;\n  Result OnImportFunc(Index import_index,\n                      std::string_view module_name,\n                      std::string_view field_name,\n                      Index func_index,\n                      Index sig_index) override;\n  Result OnImportTable(Index import_index,\n                       std::string_view module_name,\n                       std::string_view field_name,\n                       Index table_index,\n                       Type elem_type,\n                       const Limits* elem_limits) override;\n  Result OnImportMemory(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index memory_index,\n                        const Limits* page_limits,\n                        uint32_t page_size) override;\n  Result OnImportGlobal(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index global_index,\n                        Type type,\n                        bool mutable_) override;\n  Result OnImportTag(Index import_index,\n                     std::string_view module_name,\n                     std::string_view field_name,\n                     Index tag_index,\n                     Index sig_index) override;\n  Result EndImportSection() override;\n\n  Result BeginFunctionSection(Offset size) override;\n  Result OnFunctionCount(Index count) override;\n  Result OnFunction(Index index, Index sig_index) override;\n  Result EndFunctionSection() override;\n\n  Result BeginTableSection(Offset size) override;\n  Result OnTableCount(Index count) override;\n  Result BeginTable(Index index,\n                    Type elem_type,\n                    const Limits* elem_limits,\n                    TableInitExprStatus init_provided) override;\n  Result BeginTableInitExpr(Index index) override;\n  Result EndTableInitExpr(Index index) override;\n  Result EndTable(Index index) override;\n  Result EndTableSection() override;\n\n  Result BeginMemorySection(Offset size) override;\n  Result OnMemoryCount(Index count) override;\n  Result OnMemory(Index index,\n                  const Limits* limits,\n                  uint32_t page_size) override;\n  Result EndMemorySection() override;\n\n  Result BeginGlobalSection(Offset size) override;\n  Result OnGlobalCount(Index count) override;\n  Result BeginGlobal(Index index, Type type, bool mutable_) override;\n  Result BeginGlobalInitExpr(Index index) override;\n  Result EndGlobalInitExpr(Index index) override;\n  Result EndGlobal(Index index) override;\n  Result EndGlobalSection() override;\n\n  Result BeginExportSection(Offset size) override;\n  Result OnExportCount(Index count) override;\n  Result OnExport(Index index,\n                  ExternalKind kind,\n                  Index item_index,\n                  std::string_view name) override;\n  Result EndExportSection() override;\n\n  Result BeginStartSection(Offset size) override;\n  Result OnStartFunction(Index func_index) override;\n  Result EndStartSection() override;\n\n  Result BeginCodeSection(Offset size) override;\n  Result OnFunctionBodyCount(Index count) override;\n  Result BeginFunctionBody(Index index, Offset size) override;\n  Result OnLocalDeclCount(Index count) override;\n  Result OnLocalDecl(Index decl_index, Index count, Type type) override;\n  Result EndLocalDecls() override;\n\n  Result OnOpcode(Opcode opcode) override;\n  Result OnOpcodeBare() override;\n  Result OnOpcodeIndex(Index value) override;\n  Result OnOpcodeIndexIndex(Index value, Index value2) override;\n  Result OnOpcodeUint32(uint32_t value) override;\n  Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) override;\n  Result OnOpcodeUint32Uint32Uint32(uint32_t value,\n                                    uint32_t value2,\n                                    uint32_t value3) override;\n  Result OnOpcodeUint32Uint32Uint32Uint32(uint32_t value,\n                                          uint32_t value2,\n                                          uint32_t value3,\n                                          uint32_t value4) override;\n  Result OnOpcodeUint64(uint64_t value) override;\n  Result OnOpcodeF32(uint32_t value) override;\n  Result OnOpcodeF64(uint64_t value) override;\n  Result OnOpcodeV128(v128 value) override;\n  Result OnOpcodeBlockSig(Type sig_type) override;\n  Result OnOpcodeType(Type type) override;\n\n  Result OnUnaryExpr(Opcode opcode) override;\n  Result OnBinaryExpr(Opcode opcode) override;\n  Result OnTernaryExpr(Opcode opcode) override;\n  Result OnQuaternaryExpr(Opcode opcode) override;\n\n  Result OnAtomicLoadExpr(Opcode opcode,\n                          Index memidx,\n                          Address alignment_log2,\n                          Address offset) override;\n  Result OnAtomicStoreExpr(Opcode opcode,\n                           Index memidx,\n                           Address alignment_log2,\n                           Address offset) override;\n  Result OnAtomicRmwExpr(Opcode opcode,\n                         Index memidx,\n                         Address alignment_log2,\n                         Address offset) override;\n  Result OnAtomicRmwCmpxchgExpr(Opcode opcode,\n                                Index memidx,\n                                Address alignment_log2,\n                                Address offset) override;\n  Result OnBlockExpr(Type sig_type) override;\n  Result OnBrExpr(Index depth) override;\n  Result OnBrIfExpr(Index depth) override;\n  Result OnBrOnNonNullExpr(Index depth) override;\n  Result OnBrOnNullExpr(Index depth) override;\n  Result OnBrTableExpr(Index num_targets,\n                       Index* target_depths,\n                       Index default_target_depth) override;\n  Result OnCallExpr(Index func_index) override;\n  Result OnCatchExpr(Index tag_index) override;\n  Result OnCatchAllExpr() override;\n  Result OnCallIndirectExpr(Index sig_index, Index table_index) override;\n  Result OnCallRefExpr(Type sig_type) override;\n  Result OnCompareExpr(Opcode opcode) override;\n  Result OnConvertExpr(Opcode opcode) override;\n  Result OnDelegateExpr(Index depth) override;\n  Result OnDropExpr() override;\n  Result OnElseExpr() override;\n  Result OnEndExpr() override;\n  Result OnF32ConstExpr(uint32_t value_bits) override;\n  Result OnF64ConstExpr(uint64_t value_bits) override;\n  Result OnV128ConstExpr(v128 value_bits) override;\n  Result OnGlobalGetExpr(Index global_index) override;\n  Result OnGlobalSetExpr(Index global_index) override;\n  Result OnI32ConstExpr(uint32_t value) override;\n  Result OnI64ConstExpr(uint64_t value) override;\n  Result OnIfExpr(Type sig_type) override;\n  Result OnLoadExpr(Opcode opcode,\n                    Index memidx,\n                    Address alignment_log2,\n                    Address offset) override;\n  Result OnLocalGetExpr(Index local_index) override;\n  Result OnLocalSetExpr(Index local_index) override;\n  Result OnLocalTeeExpr(Index local_index) override;\n  Result OnLoopExpr(Type sig_type) override;\n  Result OnMemoryCopyExpr(Index destmemidx, Index srcmemidx) override;\n  Result OnDataDropExpr(Index segment_index) override;\n  Result OnMemoryFillExpr(Index memidx) override;\n  Result OnMemoryGrowExpr(Index memidx) override;\n  Result OnMemoryInitExpr(Index segment_index, Index memidx) override;\n  Result OnMemorySizeExpr(Index memidx) override;\n  Result OnTableCopyExpr(Index dst_index, Index src_index) override;\n  Result OnElemDropExpr(Index segment_index) override;\n  Result OnTableInitExpr(Index segment_index, Index table_index) override;\n  Result OnTableGetExpr(Index table) override;\n  Result OnTableSetExpr(Index table) override;\n  Result OnTableGrowExpr(Index table) override;\n  Result OnTableSizeExpr(Index table) override;\n  Result OnTableFillExpr(Index table) override;\n  Result OnRefAsNonNullExpr() override;\n  Result OnRefFuncExpr(Index index) override;\n  Result OnRefNullExpr(Type type) override;\n  Result OnRefIsNullExpr() override;\n  Result OnNopExpr() override;\n  Result OnRethrowExpr(Index depth) override;\n  Result OnReturnCallExpr(Index func_index) override;\n  Result OnReturnCallRefExpr(Type sig_type) override;\n  Result OnReturnCallIndirectExpr(Index sig_index, Index table_index) override;\n  Result OnReturnExpr() override;\n  Result OnSelectExpr(Index result_count, Type* result_types) override;\n  Result OnStoreExpr(Opcode opcode,\n                     Index memidx,\n                     Address alignment_log2,\n                     Address offset) override;\n  Result OnThrowExpr(Index tag_index) override;\n  Result OnThrowRefExpr() override;\n  Result OnTryExpr(Type sig_type) override;\n  Result OnTryTableExpr(Type sig_type,\n                        const CatchClauseVector& catches) override;\n  Result OnUnreachableExpr() override;\n  Result OnAtomicWaitExpr(Opcode opcode,\n                          Index memidx,\n                          Address alignment_log2,\n                          Address offset) override;\n  Result OnAtomicFenceExpr(uint32_t consistency_model) override;\n  Result OnAtomicNotifyExpr(Opcode opcode,\n                            Index memidx,\n                            Address alignment_log2,\n                            Address offset) override;\n  Result EndFunctionBody(Index index) override;\n  Result EndCodeSection() override;\n  Result OnSimdLaneOpExpr(Opcode opcode, uint64_t value) override;\n  Result OnSimdLoadLaneExpr(Opcode opcode,\n                            Index memidx,\n                            Address alignment_log2,\n                            Address offset,\n                            uint64_t value) override;\n  Result OnSimdStoreLaneExpr(Opcode opcode,\n                             Index memidx,\n                             Address alignment_log2,\n                             Address offset,\n                             uint64_t value) override;\n  Result OnSimdShuffleOpExpr(Opcode opcode, v128 value) override;\n  Result OnLoadSplatExpr(Opcode opcode,\n                         Index memidx,\n                         Address alignment_log2,\n                         Address offset) override;\n  Result OnLoadZeroExpr(Opcode opcode,\n                        Index memidx,\n                        Address alignment_log2,\n                        Address offset) override;\n\n  Result BeginElemSection(Offset size) override;\n  Result OnElemSegmentCount(Index count) override;\n  Result BeginElemSegment(Index index,\n                          Index table_index,\n                          uint8_t flags) override;\n  Result BeginElemSegmentInitExpr(Index index) override;\n  Result EndElemSegmentInitExpr(Index index) override;\n  Result OnElemSegmentElemType(Index index, Type elem_type) override;\n  Result OnElemSegmentElemExprCount(Index index, Index count) override;\n  Result BeginElemExpr(Index elem_index, Index expr_index) override;\n  Result EndElemExpr(Index elem_index, Index expr_index) override;\n  Result EndElemSegment(Index index) override;\n  Result EndElemSection() override;\n\n  Result BeginDataSection(Offset size) override;\n  Result OnDataSegmentCount(Index count) override;\n  Result BeginDataSegment(Index index,\n                          Index memory_index,\n                          uint8_t flags) override;\n  Result BeginDataSegmentInitExpr(Index index) override;\n  Result EndDataSegmentInitExpr(Index index) override;\n  Result OnDataSegmentData(Index index,\n                           const void* data,\n                           Address size) override;\n  Result EndDataSegment(Index index) override;\n  Result EndDataSection() override;\n\n  Result BeginDataCountSection(Offset size) override;\n  Result OnDataCount(Index count) override;\n  Result EndDataCountSection() override;\n\n  Result BeginNamesSection(Offset size) override;\n  Result OnModuleNameSubsection(Index index,\n                                uint32_t name_type,\n                                Offset subsection_size) override;\n  Result OnModuleName(std::string_view name) override;\n  Result OnFunctionNameSubsection(Index index,\n                                  uint32_t name_type,\n                                  Offset subsection_size) override;\n  Result OnFunctionNamesCount(Index num_functions) override;\n  Result OnFunctionName(Index function_index,\n                        std::string_view function_name) override;\n  Result OnLocalNameSubsection(Index index,\n                               uint32_t name_type,\n                               Offset subsection_size) override;\n  Result OnLocalNameFunctionCount(Index num_functions) override;\n  Result OnLocalNameLocalCount(Index function_index, Index num_locals) override;\n  Result OnLocalName(Index function_index,\n                     Index local_index,\n                     std::string_view local_name) override;\n  Result OnNameSubsection(Index index,\n                          NameSectionSubsection subsection_type,\n                          Offset subsection_size) override;\n  Result OnNameEntry(NameSectionSubsection type,\n                     Index index,\n                     std::string_view name) override;\n  Result OnNameCount(Index num_names) override;\n  Result EndNamesSection() override;\n\n  Result BeginRelocSection(Offset size) override;\n  Result OnRelocCount(Index count, Index section_index) override;\n  Result OnReloc(RelocType type,\n                 Offset offset,\n                 Index index,\n                 uint32_t addend) override;\n  Result EndRelocSection() override;\n\n  Result BeginDylinkSection(Offset size) override;\n  Result OnDylinkInfo(uint32_t mem_size,\n                      uint32_t mem_align,\n                      uint32_t table_size,\n                      uint32_t table_align) override;\n  Result OnDylinkNeededCount(Index count) override;\n  Result OnDylinkNeeded(std::string_view needed) override;\n  Result OnDylinkImportCount(Index count) override;\n  Result OnDylinkExportCount(Index count) override;\n  Result OnDylinkImport(std::string_view module,\n                        std::string_view name,\n                        uint32_t flags) override;\n  Result OnDylinkExport(std::string_view name, uint32_t flags) override;\n  Result EndDylinkSection() override;\n\n  Result BeginGenericCustomSection(Offset size) override;\n  Result OnGenericCustomSection(std::string_view name,\n                                const void* data,\n                                Offset size) override;\n  Result EndGenericCustomSection() override;\n\n  Result BeginTargetFeaturesSection(Offset size) override;\n  Result OnFeatureCount(Index count) override;\n  Result OnFeature(uint8_t prefix, std::string_view name) override;\n  Result EndTargetFeaturesSection() override;\n\n  Result BeginLinkingSection(Offset size) override;\n  Result OnSymbolCount(Index count) override;\n  Result OnDataSymbol(Index index,\n                      uint32_t flags,\n                      std::string_view name,\n                      Index segment,\n                      uint32_t offset,\n                      uint32_t size) override;\n  Result OnFunctionSymbol(Index index,\n                          uint32_t flags,\n                          std::string_view name,\n                          Index func_index) override;\n  Result OnGlobalSymbol(Index index,\n                        uint32_t flags,\n                        std::string_view name,\n                        Index global_index) override;\n  Result OnSectionSymbol(Index index,\n                         uint32_t flags,\n                         Index section_index) override;\n  Result OnTagSymbol(Index index,\n                     uint32_t flags,\n                     std::string_view name,\n                     Index tag_index) override;\n  Result OnTableSymbol(Index index,\n                       uint32_t flags,\n                       std::string_view name,\n                       Index tag_index) override;\n  Result OnSegmentInfoCount(Index count) override;\n  Result OnSegmentInfo(Index index,\n                       std::string_view name,\n                       Address alignment,\n                       uint32_t flags) override;\n  Result OnInitFunctionCount(Index count) override;\n  Result OnInitFunction(uint32_t priority, Index symbol_index) override;\n  Result OnComdatCount(Index count) override;\n  Result OnComdatBegin(std::string_view name,\n                       uint32_t flags,\n                       Index count) override;\n  Result OnComdatEntry(ComdatType kind, Index index) override;\n  Result EndLinkingSection() override;\n\n  Result BeginTagSection(Offset size) override;\n  Result OnTagCount(Index count) override;\n  Result OnTagType(Index index, Index sig_index) override;\n  Result EndTagSection() override;\n\n  /* Code Metadata sections */\n  Result BeginCodeMetadataSection(std::string_view name, Offset size) override;\n  Result OnCodeMetadataFuncCount(Index count) override;\n  Result OnCodeMetadataCount(Index function_index, Index count) override;\n  Result OnCodeMetadata(Offset offset, const void* data, Address size) override;\n  Result EndCodeMetadataSection() override;\n\n private:\n  void Indent();\n  void Dedent();\n  void WriteIndent();\n  void LogType(Type type);\n  void LogTypes(Index type_count, Type* types);\n  void LogTypes(TypeVector& types);\n  void LogField(TypeMut field);\n\n  Stream* stream_;\n  BinaryReaderDelegate* reader_;\n  int indent_;\n};\n\n}  // namespace wabt\n\n#endif  // WABT_BINARY_READER_LOGGING_H_\n"
  },
  {
    "path": "include/wabt/binary-reader-nop.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_READER_NOP_H_\n#define WABT_BINARY_READER_NOP_H_\n\n#include \"wabt/binary-reader.h\"\n\nnamespace wabt {\n\nclass BinaryReaderNop : public BinaryReaderDelegate {\n public:\n  bool OnError(const Error&) override { return false; }\n\n  /* Module */\n  Result BeginModule(uint32_t version) override { return Result::Ok; }\n  Result EndModule() override { return Result::Ok; }\n\n  Result BeginSection(Index section_index,\n                      BinarySection section_type,\n                      Offset size) override {\n    return Result::Ok;\n  }\n\n  /* Custom section */\n  Result BeginCustomSection(Index section_index,\n                            Offset size,\n                            std::string_view section_name) override {\n    return Result::Ok;\n  }\n  Result EndCustomSection() override { return Result::Ok; }\n\n  /* Type section */\n  Result BeginTypeSection(Offset size) override { return Result::Ok; }\n  Result OnTypeCount(Index count) override { return Result::Ok; }\n  Result OnFuncType(Index index,\n                    Index param_count,\n                    Type* param_types,\n                    Index result_count,\n                    Type* result_types) override {\n    return Result::Ok;\n  }\n  Result OnStructType(Index index,\n                      Index field_count,\n                      TypeMut* fields) override {\n    return Result::Ok;\n  }\n  Result OnArrayType(Index index, TypeMut field) override { return Result::Ok; }\n  Result EndTypeSection() override { return Result::Ok; }\n\n  /* Import section */\n  Result BeginImportSection(Offset size) override { return Result::Ok; }\n  Result OnImportCount(Index count) override { return Result::Ok; }\n  Result OnImport(Index index,\n                  ExternalKind kind,\n                  std::string_view module_name,\n                  std::string_view field_name) override {\n    return Result::Ok;\n  }\n  Result OnImportFunc(Index import_index,\n                      std::string_view module_name,\n                      std::string_view field_name,\n                      Index func_index,\n                      Index sig_index) override {\n    return Result::Ok;\n  }\n  Result OnImportTable(Index import_index,\n                       std::string_view module_name,\n                       std::string_view field_name,\n                       Index table_index,\n                       Type elem_type,\n                       const Limits* elem_limits) override {\n    return Result::Ok;\n  }\n  Result OnImportMemory(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index memory_index,\n                        const Limits* page_limits,\n                        uint32_t page_size) override {\n    return Result::Ok;\n  }\n  Result OnImportGlobal(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index global_index,\n                        Type type,\n                        bool mutable_) override {\n    return Result::Ok;\n  }\n  Result OnImportTag(Index import_index,\n                     std::string_view module_name,\n                     std::string_view field_name,\n                     Index tag_index,\n                     Index sig_index) override {\n    return Result::Ok;\n  }\n  Result EndImportSection() override { return Result::Ok; }\n\n  /* Function section */\n  Result BeginFunctionSection(Offset size) override { return Result::Ok; }\n  Result OnFunctionCount(Index count) override { return Result::Ok; }\n  Result OnFunction(Index index, Index sig_index) override {\n    return Result::Ok;\n  }\n  Result EndFunctionSection() override { return Result::Ok; }\n\n  /* Table section */\n  Result BeginTableSection(Offset size) override { return Result::Ok; }\n  Result OnTableCount(Index count) override { return Result::Ok; }\n  Result BeginTable(Index index,\n                    Type elem_type,\n                    const Limits* elem_limits,\n                    TableInitExprStatus init_provided) override {\n    return Result::Ok;\n  }\n  Result BeginTableInitExpr(Index index) override { return Result::Ok; }\n  Result EndTableInitExpr(Index index) override { return Result::Ok; }\n  Result EndTable(Index index) override { return Result::Ok; }\n  Result EndTableSection() override { return Result::Ok; }\n\n  /* Memory section */\n  Result BeginMemorySection(Offset size) override { return Result::Ok; }\n  Result OnMemoryCount(Index count) override { return Result::Ok; }\n  Result OnMemory(Index index,\n                  const Limits* limits,\n                  uint32_t page_size) override {\n    return Result::Ok;\n  }\n  Result EndMemorySection() override { return Result::Ok; }\n\n  /* Global section */\n  Result BeginGlobalSection(Offset size) override { return Result::Ok; }\n  Result OnGlobalCount(Index count) override { return Result::Ok; }\n  Result BeginGlobal(Index index, Type type, bool mutable_) override {\n    return Result::Ok;\n  }\n  Result BeginGlobalInitExpr(Index index) override { return Result::Ok; }\n  Result EndGlobalInitExpr(Index index) override { return Result::Ok; }\n  Result EndGlobal(Index index) override { return Result::Ok; }\n  Result EndGlobalSection() override { return Result::Ok; }\n\n  /* Exports section */\n  Result BeginExportSection(Offset size) override { return Result::Ok; }\n  Result OnExportCount(Index count) override { return Result::Ok; }\n  Result OnExport(Index index,\n                  ExternalKind kind,\n                  Index item_index,\n                  std::string_view name) override {\n    return Result::Ok;\n  }\n  Result EndExportSection() override { return Result::Ok; }\n\n  /* Start section */\n  Result BeginStartSection(Offset size) override { return Result::Ok; }\n  Result OnStartFunction(Index func_index) override { return Result::Ok; }\n  Result EndStartSection() override { return Result::Ok; }\n\n  /* Code section */\n  Result BeginCodeSection(Offset size) override { return Result::Ok; }\n  Result OnFunctionBodyCount(Index count) override { return Result::Ok; }\n  Result BeginFunctionBody(Index index, Offset size) override {\n    return Result::Ok;\n  }\n  Result OnLocalDeclCount(Index count) override { return Result::Ok; }\n  Result OnLocalDecl(Index decl_index, Index count, Type type) override {\n    return Result::Ok;\n  }\n  Result EndLocalDecls() override { return Result::Ok; }\n\n  /* Function expressions; called between BeginFunctionBody and\n   EndFunctionBody */\n  Result OnOpcode(Opcode Opcode) override { return Result::Ok; }\n  Result OnOpcodeBare() override { return Result::Ok; }\n  Result OnOpcodeIndex(Index value) override { return Result::Ok; }\n  Result OnOpcodeIndexIndex(Index value, Index value2) override {\n    return Result::Ok;\n  }\n  Result OnOpcodeUint32(uint32_t value) override { return Result::Ok; }\n  Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) override {\n    return Result::Ok;\n  }\n  Result OnOpcodeUint32Uint32Uint32(uint32_t value,\n                                    uint32_t value2,\n                                    uint32_t value3) override {\n    return Result::Ok;\n  }\n  Result OnOpcodeUint32Uint32Uint32Uint32(uint32_t value,\n                                          uint32_t value2,\n                                          uint32_t value3,\n                                          uint32_t value4) override {\n    return Result::Ok;\n  }\n  Result OnOpcodeUint64(uint64_t value) override { return Result::Ok; }\n  Result OnOpcodeF32(uint32_t value) override { return Result::Ok; }\n  Result OnOpcodeF64(uint64_t value) override { return Result::Ok; }\n  Result OnOpcodeV128(v128 value) override { return Result::Ok; }\n  Result OnOpcodeBlockSig(Type sig_type) override { return Result::Ok; }\n  Result OnOpcodeType(Type type) override { return Result::Ok; }\n\n  Result OnUnaryExpr(Opcode opcode) override { return Result::Ok; }\n  Result OnBinaryExpr(Opcode opcode) override { return Result::Ok; }\n  Result OnTernaryExpr(Opcode opcode) override { return Result::Ok; }\n  Result OnQuaternaryExpr(Opcode opcode) override { return Result::Ok; }\n\n  Result OnAtomicLoadExpr(Opcode opcode,\n                          Index memidx,\n                          Address alignment_log2,\n                          Address offset) override {\n    return Result::Ok;\n  }\n  Result OnAtomicStoreExpr(Opcode opcode,\n                           Index memidx,\n                           Address alignment_log2,\n                           Address offset) override {\n    return Result::Ok;\n  }\n  Result OnAtomicRmwExpr(Opcode opcode,\n                         Index memidx,\n                         Address alignment_log2,\n                         Address offset) override {\n    return Result::Ok;\n  }\n  Result OnAtomicRmwCmpxchgExpr(Opcode opcode,\n                                Index memidx,\n                                Address alignment_log2,\n                                Address offset) override {\n    return Result::Ok;\n  }\n  Result OnAtomicWaitExpr(Opcode, Index, Address, Address) override {\n    return Result::Ok;\n  }\n  Result OnAtomicFenceExpr(uint32_t) override { return Result::Ok; }\n  Result OnAtomicNotifyExpr(Opcode, Index, Address, Address) override {\n    return Result::Ok;\n  }\n  Result OnBlockExpr(Type sig_type) override { return Result::Ok; }\n  Result OnBrExpr(Index depth) override { return Result::Ok; }\n  Result OnBrIfExpr(Index depth) override { return Result::Ok; }\n  Result OnBrOnNonNullExpr(Index depth) override { return Result::Ok; }\n  Result OnBrOnNullExpr(Index depth) override { return Result::Ok; }\n  Result OnBrTableExpr(Index num_targets,\n                       Index* target_depths,\n                       Index default_target_depth) override {\n    return Result::Ok;\n  }\n  Result OnCallExpr(Index func_index) override { return Result::Ok; }\n  Result OnCallIndirectExpr(Index sig_index, Index table_index) override {\n    return Result::Ok;\n  }\n  Result OnCallRefExpr(Type sig_type) override { return Result::Ok; }\n  Result OnCatchExpr(Index tag_index) override { return Result::Ok; }\n  Result OnCatchAllExpr() override { return Result::Ok; }\n  Result OnCompareExpr(Opcode opcode) override { return Result::Ok; }\n  Result OnConvertExpr(Opcode opcode) override { return Result::Ok; }\n  Result OnDelegateExpr(Index depth) override { return Result::Ok; }\n  Result OnDropExpr() override { return Result::Ok; }\n  Result OnElseExpr() override { return Result::Ok; }\n  Result OnEndExpr() override { return Result::Ok; }\n  Result OnF32ConstExpr(uint32_t value_bits) override { return Result::Ok; }\n  Result OnF64ConstExpr(uint64_t value_bits) override { return Result::Ok; }\n  Result OnV128ConstExpr(v128 value_bits) override { return Result::Ok; }\n  Result OnGlobalGetExpr(Index global_index) override { return Result::Ok; }\n  Result OnGlobalSetExpr(Index global_index) override { return Result::Ok; }\n  Result OnI32ConstExpr(uint32_t value) override { return Result::Ok; }\n  Result OnI64ConstExpr(uint64_t value) override { return Result::Ok; }\n  Result OnIfExpr(Type sig_type) override { return Result::Ok; }\n  Result OnLoadExpr(Opcode opcode,\n                    Index memidx,\n                    Address alignment_log2,\n                    Address offset) override {\n    return Result::Ok;\n  }\n  Result OnLocalGetExpr(Index local_index) override { return Result::Ok; }\n  Result OnLocalSetExpr(Index local_index) override { return Result::Ok; }\n  Result OnLocalTeeExpr(Index local_index) override { return Result::Ok; }\n  Result OnLoopExpr(Type sig_type) override { return Result::Ok; }\n  Result OnMemoryCopyExpr(Index destmemidx, Index srcmemidx) override {\n    return Result::Ok;\n  }\n  Result OnDataDropExpr(Index segment_index) override { return Result::Ok; }\n  Result OnMemoryFillExpr(Index memidx) override { return Result::Ok; }\n  Result OnMemoryGrowExpr(Index memidx) override { return Result::Ok; }\n  Result OnMemoryInitExpr(Index segment_index, Index memidx) override {\n    return Result::Ok;\n  }\n  Result OnMemorySizeExpr(Index memidx) override { return Result::Ok; }\n  Result OnTableCopyExpr(Index dst_index, Index src_index) override {\n    return Result::Ok;\n  }\n  Result OnElemDropExpr(Index segment_index) override { return Result::Ok; }\n  Result OnTableInitExpr(Index segment_index, Index table_index) override {\n    return Result::Ok;\n  }\n  Result OnTableGetExpr(Index table_index) override { return Result::Ok; }\n  Result OnTableSetExpr(Index table_index) override { return Result::Ok; }\n  Result OnTableGrowExpr(Index table_index) override { return Result::Ok; }\n  Result OnTableSizeExpr(Index table_index) override { return Result::Ok; }\n  Result OnTableFillExpr(Index table_index) override { return Result::Ok; }\n  Result OnRefAsNonNullExpr() override { return Result::Ok; }\n  Result OnRefFuncExpr(Index func_index) override { return Result::Ok; }\n  Result OnRefNullExpr(Type type) override { return Result::Ok; }\n  Result OnRefIsNullExpr() override { return Result::Ok; }\n  Result OnNopExpr() override { return Result::Ok; }\n  Result OnRethrowExpr(Index depth) override { return Result::Ok; }\n  Result OnReturnCallExpr(Index sig_index) override { return Result::Ok; }\n  Result OnReturnCallIndirectExpr(Index sig_index, Index table_index) override {\n    return Result::Ok;\n  }\n  Result OnReturnCallRefExpr(Type sig_type) override { return Result::Ok; }\n  Result OnReturnExpr() override { return Result::Ok; }\n  Result OnSelectExpr(Index result_count, Type* result_types) override {\n    return Result::Ok;\n  }\n  Result OnStoreExpr(Opcode opcode,\n                     Index memidx,\n                     Address alignment_log2,\n                     Address offset) override {\n    return Result::Ok;\n  }\n  Result OnThrowExpr(Index depth) override { return Result::Ok; }\n  Result OnThrowRefExpr() override { return Result::Ok; }\n  Result OnTryExpr(Type sig_type) override { return Result::Ok; }\n  Result OnTryTableExpr(Type sig_type,\n                        const CatchClauseVector& catches) override {\n    return Result::Ok;\n  }\n  Result OnUnreachableExpr() override { return Result::Ok; }\n  Result EndFunctionBody(Index index) override { return Result::Ok; }\n  Result EndCodeSection() override { return Result::Ok; }\n  Result OnSimdLaneOpExpr(Opcode opcode, uint64_t value) override {\n    return Result::Ok;\n  }\n  Result OnSimdLoadLaneExpr(Opcode opcode,\n                            Index memidx,\n                            Address alignment_log2,\n                            Address offset,\n                            uint64_t value) override {\n    return Result::Ok;\n  }\n  Result OnSimdStoreLaneExpr(Opcode opcode,\n                             Index memidx,\n                             Address alignment_log2,\n                             Address offset,\n                             uint64_t value) override {\n    return Result::Ok;\n  }\n  Result OnSimdShuffleOpExpr(Opcode opcode, v128 value) override {\n    return Result::Ok;\n  }\n  Result OnLoadSplatExpr(Opcode opcode,\n                         Index memidx,\n                         Address alignment_log2,\n                         Address offset) override {\n    return Result::Ok;\n  }\n  Result OnLoadZeroExpr(Opcode opcode,\n                        Index memidx,\n                        Address alignment_log2,\n                        Address offset) override {\n    return Result::Ok;\n  }\n\n  /* Elem section */\n  Result BeginElemSection(Offset size) override { return Result::Ok; }\n  Result OnElemSegmentCount(Index count) override { return Result::Ok; }\n  Result BeginElemSegment(Index index,\n                          Index table_index,\n                          uint8_t flags) override {\n    return Result::Ok;\n  }\n  Result BeginElemSegmentInitExpr(Index index) override { return Result::Ok; }\n  Result EndElemSegmentInitExpr(Index index) override { return Result::Ok; }\n  Result OnElemSegmentElemType(Index index, Type elem_type) override {\n    return Result::Ok;\n  }\n  Result OnElemSegmentElemExprCount(Index index, Index count) override {\n    return Result::Ok;\n  }\n  Result BeginElemExpr(Index elem_index, Index expr_index) override {\n    return Result::Ok;\n  }\n  Result EndElemExpr(Index elem_index, Index expr_index) override {\n    return Result::Ok;\n  }\n  Result EndElemSegment(Index index) override { return Result::Ok; }\n  Result EndElemSection() override { return Result::Ok; }\n\n  /* Data section */\n  Result BeginDataSection(Offset size) override { return Result::Ok; }\n  Result OnDataSegmentCount(Index count) override { return Result::Ok; }\n  Result BeginDataSegment(Index index,\n                          Index memory_index,\n                          uint8_t flags) override {\n    return Result::Ok;\n  }\n  Result BeginDataSegmentInitExpr(Index index) override { return Result::Ok; }\n  Result EndDataSegmentInitExpr(Index index) override { return Result::Ok; }\n  Result OnDataSegmentData(Index index,\n                           const void* data,\n                           Address size) override {\n    return Result::Ok;\n  }\n  Result EndDataSegment(Index index) override { return Result::Ok; }\n  Result EndDataSection() override { return Result::Ok; }\n\n  /* DataCount section */\n  Result BeginDataCountSection(Offset size) override { return Result::Ok; }\n  Result OnDataCount(Index count) override { return Result::Ok; }\n  Result EndDataCountSection() override { return Result::Ok; }\n\n  /* Names section */\n  Result BeginNamesSection(Offset size) override { return Result::Ok; }\n  Result OnModuleNameSubsection(Index index,\n                                uint32_t name_type,\n                                Offset subsection_size) override {\n    return Result::Ok;\n  }\n  Result OnModuleName(std::string_view name) override { return Result::Ok; }\n  Result OnFunctionNameSubsection(Index index,\n                                  uint32_t name_type,\n                                  Offset subsection_size) override {\n    return Result::Ok;\n  }\n  Result OnFunctionNamesCount(Index num_functions) override {\n    return Result::Ok;\n  }\n  Result OnFunctionName(Index function_index,\n                        std::string_view function_name) override {\n    return Result::Ok;\n  }\n  Result OnLocalNameSubsection(Index index,\n                               uint32_t name_type,\n                               Offset subsection_size) override {\n    return Result::Ok;\n  }\n  Result OnLocalNameFunctionCount(Index num_functions) override {\n    return Result::Ok;\n  }\n  Result OnLocalNameLocalCount(Index function_index,\n                               Index num_locals) override {\n    return Result::Ok;\n  }\n  Result OnLocalName(Index function_index,\n                     Index local_index,\n                     std::string_view local_name) override {\n    return Result::Ok;\n  }\n  Result EndNamesSection() override { return Result::Ok; }\n\n  Result OnNameSubsection(Index index,\n                          NameSectionSubsection subsection_type,\n                          Offset subsection_size) override {\n    return Result::Ok;\n  }\n  Result OnNameCount(Index num_names) override { return Result::Ok; }\n  Result OnNameEntry(NameSectionSubsection type,\n                     Index index,\n                     std::string_view name) override {\n    return Result::Ok;\n  }\n\n  /* Reloc section */\n  Result BeginRelocSection(Offset size) override { return Result::Ok; }\n  Result OnRelocCount(Index count, Index section_code) override {\n    return Result::Ok;\n  }\n  Result OnReloc(RelocType type,\n                 Offset offset,\n                 Index index,\n                 uint32_t addend) override {\n    return Result::Ok;\n  }\n  Result EndRelocSection() override { return Result::Ok; }\n\n  /* Tag section */\n  Result BeginTagSection(Offset size) override { return Result::Ok; }\n  Result OnTagCount(Index count) override { return Result::Ok; }\n  Result OnTagType(Index index, Index sig_index) override { return Result::Ok; }\n  Result EndTagSection() override { return Result::Ok; }\n\n  /* Code Metadata sections */\n  Result BeginCodeMetadataSection(std::string_view name, Offset size) override {\n    return Result::Ok;\n  }\n  Result OnCodeMetadataFuncCount(Index count) override { return Result::Ok; }\n  Result OnCodeMetadataCount(Index function_index, Index count) override {\n    return Result::Ok;\n  }\n  Result OnCodeMetadata(Offset offset,\n                        const void* data,\n                        Address size) override {\n    return Result::Ok;\n  }\n  Result EndCodeMetadataSection() override { return Result::Ok; }\n\n  /* Dylink section */\n  Result BeginDylinkSection(Offset size) override { return Result::Ok; }\n  Result OnDylinkInfo(uint32_t mem_size,\n                      uint32_t mem_align,\n                      uint32_t table_size,\n                      uint32_t table_align) override {\n    return Result::Ok;\n  }\n  Result OnDylinkNeededCount(Index count) override { return Result::Ok; }\n  Result OnDylinkNeeded(std::string_view so_name) override {\n    return Result::Ok;\n  }\n  Result OnDylinkImportCount(Index count) override { return Result::Ok; }\n  Result OnDylinkExportCount(Index count) override { return Result::Ok; }\n  Result OnDylinkImport(std::string_view module,\n                        std::string_view name,\n                        uint32_t flags) override {\n    return Result::Ok;\n  }\n  Result OnDylinkExport(std::string_view name, uint32_t flags) override {\n    return Result::Ok;\n  }\n  Result EndDylinkSection() override { return Result::Ok; }\n\n  /* target_features section */\n  Result BeginTargetFeaturesSection(Offset size) override { return Result::Ok; }\n  Result OnFeatureCount(Index count) override { return Result::Ok; }\n  Result OnFeature(uint8_t prefix, std::string_view name) override {\n    return Result::Ok;\n  }\n  Result EndTargetFeaturesSection() override { return Result::Ok; }\n\n  /* Generic custom section */\n  Result BeginGenericCustomSection(Offset size) override { return Result::Ok; }\n  Result OnGenericCustomSection(std::string_view name,\n                                const void* data,\n                                Offset size) override {\n    return Result::Ok;\n  };\n  Result EndGenericCustomSection() override { return Result::Ok; }\n\n  /* Linking section */\n  Result BeginLinkingSection(Offset size) override { return Result::Ok; }\n  Result OnSymbolCount(Index count) override { return Result::Ok; }\n  Result OnDataSymbol(Index index,\n                      uint32_t flags,\n                      std::string_view name,\n                      Index segment,\n                      uint32_t offset,\n                      uint32_t size) override {\n    return Result::Ok;\n  }\n  Result OnFunctionSymbol(Index index,\n                          uint32_t flags,\n                          std::string_view name,\n                          Index func_index) override {\n    return Result::Ok;\n  }\n  Result OnGlobalSymbol(Index index,\n                        uint32_t flags,\n                        std::string_view name,\n                        Index global_index) override {\n    return Result::Ok;\n  }\n  Result OnSectionSymbol(Index index,\n                         uint32_t flags,\n                         Index section_index) override {\n    return Result::Ok;\n  }\n  Result OnTagSymbol(Index index,\n                     uint32_t flags,\n                     std::string_view name,\n                     Index tag_index) override {\n    return Result::Ok;\n  }\n  Result OnTableSymbol(Index index,\n                       uint32_t flags,\n                       std::string_view name,\n                       Index table_index) override {\n    return Result::Ok;\n  }\n  Result OnSegmentInfoCount(Index count) override { return Result::Ok; }\n  Result OnSegmentInfo(Index index,\n                       std::string_view name,\n                       Address alignment,\n                       uint32_t flags) override {\n    return Result::Ok;\n  }\n  Result OnInitFunctionCount(Index count) override { return Result::Ok; }\n  Result OnInitFunction(uint32_t priority, Index symbol_index) override {\n    return Result::Ok;\n  }\n  Result OnComdatCount(Index count) override { return Result::Ok; }\n  Result OnComdatBegin(std::string_view name,\n                       uint32_t flags,\n                       Index count) override {\n    return Result::Ok;\n  }\n  Result OnComdatEntry(ComdatType kind, Index index) override {\n    return Result::Ok;\n  }\n  Result EndLinkingSection() override { return Result::Ok; }\n};\n\n}  // namespace wabt\n\n#endif /* WABT_BINARY_READER_H_ */\n"
  },
  {
    "path": "include/wabt/binary-reader-objdump.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_READER_OBJDUMP_H_\n#define WABT_BINARY_READER_OBJDUMP_H_\n\n#include <map>\n#include <string>\n\n#include \"wabt/common.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/stream.h\"\n\nnamespace wabt {\n\nstruct Module;\nstruct ReadBinaryOptions;\n\nenum class ObjdumpMode {\n  Prepass,\n  Headers,\n  Details,\n  Disassemble,\n  RawData,\n};\n\nstruct ObjdumpOptions {\n  Stream* log_stream;\n  bool headers;\n  bool details;\n  bool raw;\n  bool disassemble;\n  bool debug;\n  bool relocs;\n  bool section_offsets;\n  ObjdumpMode mode;\n  const char* filename;\n  const char* section_name;\n};\n\nstruct ObjdumpSymbol {\n  wabt::SymbolType kind;\n  std::string name;\n  Index index;\n};\n\nstruct ObjdumpNames {\n  std::string_view Get(Index index) const;\n  void Set(Index index, std::string_view name);\n\n  std::map<Index, std::string> names;\n};\n\nstruct ObjdumpLocalNames {\n  std::string_view Get(Index function_index, Index local_index) const;\n  void Set(Index function_index, Index local_index, std::string_view name);\n\n  std::map<std::pair<Index, Index>, std::string> names;\n};\n\n// read_binary_objdump uses this state to store information from previous runs\n// and use it to display more useful information.\nstruct ObjdumpState {\n  std::vector<Reloc> code_relocations;\n  std::vector<Reloc> data_relocations;\n  ObjdumpNames type_names;\n  ObjdumpNames function_names;\n  ObjdumpNames global_names;\n  ObjdumpNames section_names;\n  ObjdumpNames tag_names;\n  ObjdumpNames segment_names;\n  ObjdumpNames table_names;\n  ObjdumpLocalNames local_names;\n  std::vector<ObjdumpSymbol> symtab;\n  std::map<Index, Index> function_param_counts;\n  std::map<Index, Index> function_types;\n};\n\nResult ReadBinaryObjdump(const uint8_t* data,\n                         size_t size,\n                         ObjdumpOptions* options,\n                         ObjdumpState* state);\n\n}  // namespace wabt\n\n#endif /* WABT_BINARY_READER_OBJDUMP_H_ */\n"
  },
  {
    "path": "include/wabt/binary-reader-stats.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_READER_OPCNT_H_\n#define WABT_BINARY_READER_OPCNT_H_\n\n#include <map>\n#include <vector>\n\n#include \"wabt/common.h\"\n#include \"wabt/opcode.h\"\n\nnamespace wabt {\n\nstruct Module;\nstruct ReadBinaryOptions;\nclass Stream;\n\nclass OpcodeInfo {\n public:\n  enum class Kind {\n    Bare,\n    Uint32,\n    Uint64,\n    Index,\n    Float32,\n    Float64,\n    Uint32Uint32,\n    Uint32Uint32Uint32,\n    Uint32Uint32Uint32Uint32,\n    BlockSig,\n    BrTable,\n    V128,\n  };\n\n  explicit OpcodeInfo(Opcode, Kind);\n  template <typename T>\n  OpcodeInfo(Opcode, Kind, T* data, size_t count = 1);\n  template <typename T>\n  OpcodeInfo(Opcode, Kind, T* data, size_t count, T extra);\n\n  Opcode opcode() const { return opcode_; }\n\n  void Write(Stream&);\n\n private:\n  template <typename T>\n  std::pair<const T*, size_t> GetDataArray() const;\n  template <typename T>\n  const T* GetData(size_t expected_size = 1) const;\n\n  template <typename T, typename F>\n  void WriteArray(Stream& stream, F&& write_func);\n\n  Opcode opcode_;\n  Kind kind_;\n  std::vector<uint8_t> data_;\n\n  friend bool operator==(const OpcodeInfo&, const OpcodeInfo&);\n  friend bool operator!=(const OpcodeInfo&, const OpcodeInfo&);\n  friend bool operator<(const OpcodeInfo&, const OpcodeInfo&);\n  friend bool operator<=(const OpcodeInfo&, const OpcodeInfo&);\n  friend bool operator>(const OpcodeInfo&, const OpcodeInfo&);\n  friend bool operator>=(const OpcodeInfo&, const OpcodeInfo&);\n};\n\nbool operator==(const OpcodeInfo&, const OpcodeInfo&);\nbool operator!=(const OpcodeInfo&, const OpcodeInfo&);\nbool operator<(const OpcodeInfo&, const OpcodeInfo&);\nbool operator<=(const OpcodeInfo&, const OpcodeInfo&);\nbool operator>(const OpcodeInfo&, const OpcodeInfo&);\nbool operator>=(const OpcodeInfo&, const OpcodeInfo&);\n\nusing OpcodeInfoCounts = std::map<OpcodeInfo, size_t>;\n\nResult ReadBinaryOpcnt(const void* data,\n                       size_t size,\n                       const ReadBinaryOptions& options,\n                       OpcodeInfoCounts* opcode_counts);\n\n}  // namespace wabt\n\n#endif /* WABT_BINARY_READER_OPCNT_H_ */\n"
  },
  {
    "path": "include/wabt/binary-reader.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_READER_H_\n#define WABT_BINARY_READER_H_\n\n#include <cstddef>\n#include <cstdint>\n#include <string_view>\n\n#include \"wabt/binary.h\"\n#include \"wabt/common.h\"\n#include \"wabt/error.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/opcode.h\"\n\nnamespace wabt {\n\nclass Stream;\n\nstruct ReadBinaryOptions {\n  ReadBinaryOptions() = default;\n  ReadBinaryOptions(const Features& features,\n                    Stream* log_stream,\n                    bool read_debug_names,\n                    bool stop_on_first_error,\n                    bool fail_on_custom_section_error)\n      : features(features),\n        log_stream(log_stream),\n        read_debug_names(read_debug_names),\n        stop_on_first_error(stop_on_first_error),\n        fail_on_custom_section_error(fail_on_custom_section_error) {}\n\n  Features features;\n  Stream* log_stream = nullptr;\n  bool read_debug_names = false;\n  bool stop_on_first_error = true;\n  bool fail_on_custom_section_error = true;\n  bool skip_function_bodies = false;\n};\n\n// TODO: Move somewhere else?\nstruct TypeMut {\n  Type type;\n  bool mutable_;\n};\nusing TypeMutVector = std::vector<TypeMut>;\n\nstruct CatchClause {\n  CatchKind kind;\n  Index tag;\n  Index depth;\n};\nusing CatchClauseVector = std::vector<CatchClause>;\n\nenum class TableInitExprStatus {\n  TableWithInitExpression,\n  TableWithoutInitExpression,\n};\n\nclass BinaryReaderDelegate {\n public:\n  struct State {\n    State(const uint8_t* data, Offset size)\n        : data(data), size(size), offset(0) {}\n\n    const uint8_t* data;\n    Offset size;\n    Offset offset;\n  };\n\n  virtual ~BinaryReaderDelegate() {}\n\n  virtual bool OnError(const Error&) = 0;\n  virtual void OnSetState(const State* s) { state = s; }\n\n  /* Module */\n  virtual Result BeginModule(uint32_t version) = 0;\n  virtual Result EndModule() = 0;\n\n  virtual Result BeginSection(Index section_index,\n                              BinarySection section_type,\n                              Offset size) = 0;\n\n  /* Custom section */\n  virtual Result BeginCustomSection(Index section_index,\n                                    Offset size,\n                                    std::string_view section_name) = 0;\n  virtual Result EndCustomSection() = 0;\n\n  /* Type section */\n  virtual Result BeginTypeSection(Offset size) = 0;\n  virtual Result OnTypeCount(Index count) = 0;\n  virtual Result OnFuncType(Index index,\n                            Index param_count,\n                            Type* param_types,\n                            Index result_count,\n                            Type* result_types) = 0;\n  virtual Result OnStructType(Index index,\n                              Index field_count,\n                              TypeMut* fields) = 0;\n  virtual Result OnArrayType(Index index, TypeMut field) = 0;\n  virtual Result EndTypeSection() = 0;\n\n  /* Import section */\n  virtual Result BeginImportSection(Offset size) = 0;\n  virtual Result OnImportCount(Index count) = 0;\n  virtual Result OnImport(Index index,\n                          ExternalKind kind,\n                          std::string_view module_name,\n                          std::string_view field_name) = 0;\n  virtual Result OnImportFunc(Index import_index,\n                              std::string_view module_name,\n                              std::string_view field_name,\n                              Index func_index,\n                              Index sig_index) = 0;\n  virtual Result OnImportTable(Index import_index,\n                               std::string_view module_name,\n                               std::string_view field_name,\n                               Index table_index,\n                               Type elem_type,\n                               const Limits* elem_limits) = 0;\n  virtual Result OnImportMemory(Index import_index,\n                                std::string_view module_name,\n                                std::string_view field_name,\n                                Index memory_index,\n                                const Limits* page_limits,\n                                uint32_t page_size) = 0;\n  virtual Result OnImportGlobal(Index import_index,\n                                std::string_view module_name,\n                                std::string_view field_name,\n                                Index global_index,\n                                Type type,\n                                bool mutable_) = 0;\n  virtual Result OnImportTag(Index import_index,\n                             std::string_view module_name,\n                             std::string_view field_name,\n                             Index tag_index,\n                             Index sig_index) = 0;\n  virtual Result EndImportSection() = 0;\n\n  /* Function section */\n  virtual Result BeginFunctionSection(Offset size) = 0;\n  virtual Result OnFunctionCount(Index count) = 0;\n  virtual Result OnFunction(Index index, Index sig_index) = 0;\n  virtual Result EndFunctionSection() = 0;\n\n  /* Table section */\n  virtual Result BeginTableSection(Offset size) = 0;\n  virtual Result OnTableCount(Index count) = 0;\n  virtual Result BeginTable(Index index,\n                            Type elem_type,\n                            const Limits* elem_limits,\n                            TableInitExprStatus init_provided) = 0;\n  virtual Result BeginTableInitExpr(Index index) = 0;\n  virtual Result EndTableInitExpr(Index index) = 0;\n  virtual Result EndTable(Index index) = 0;\n  virtual Result EndTableSection() = 0;\n\n  /* Memory section */\n  virtual Result BeginMemorySection(Offset size) = 0;\n  virtual Result OnMemoryCount(Index count) = 0;\n  virtual Result OnMemory(Index index,\n                          const Limits* limits,\n                          uint32_t page_size) = 0;\n  virtual Result EndMemorySection() = 0;\n\n  /* Global section */\n  virtual Result BeginGlobalSection(Offset size) = 0;\n  virtual Result OnGlobalCount(Index count) = 0;\n  virtual Result BeginGlobal(Index index, Type type, bool mutable_) = 0;\n  virtual Result BeginGlobalInitExpr(Index index) = 0;\n  virtual Result EndGlobalInitExpr(Index index) = 0;\n  virtual Result EndGlobal(Index index) = 0;\n  virtual Result EndGlobalSection() = 0;\n\n  /* Exports section */\n  virtual Result BeginExportSection(Offset size) = 0;\n  virtual Result OnExportCount(Index count) = 0;\n  virtual Result OnExport(Index index,\n                          ExternalKind kind,\n                          Index item_index,\n                          std::string_view name) = 0;\n  virtual Result EndExportSection() = 0;\n\n  /* Start section */\n  virtual Result BeginStartSection(Offset size) = 0;\n  virtual Result OnStartFunction(Index func_index) = 0;\n  virtual Result EndStartSection() = 0;\n\n  /* Code section */\n  virtual Result BeginCodeSection(Offset size) = 0;\n  virtual Result OnFunctionBodyCount(Index count) = 0;\n  virtual Result BeginFunctionBody(Index index, Offset size) = 0;\n  virtual Result OnLocalDeclCount(Index count) = 0;\n  virtual Result OnLocalDecl(Index decl_index, Index count, Type type) = 0;\n  virtual Result EndLocalDecls() = 0;\n\n  /* Function expressions; called between BeginFunctionBody and\n   EndFunctionBody */\n  virtual Result OnOpcode(Opcode Opcode) = 0;\n  virtual Result OnOpcodeBare() = 0;\n  virtual Result OnOpcodeUint32(uint32_t value) = 0;\n  virtual Result OnOpcodeIndex(Index value) = 0;\n  virtual Result OnOpcodeIndexIndex(Index value, Index value2) = 0;\n  virtual Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) = 0;\n  virtual Result OnOpcodeUint32Uint32Uint32(uint32_t value,\n                                            uint32_t value2,\n                                            uint32_t value3) = 0;\n  virtual Result OnOpcodeUint32Uint32Uint32Uint32(uint32_t value,\n                                                  uint32_t value2,\n                                                  uint32_t value3,\n                                                  uint32_t value4) = 0;\n  virtual Result OnOpcodeUint64(uint64_t value) = 0;\n  virtual Result OnOpcodeF32(uint32_t value) = 0;\n  virtual Result OnOpcodeF64(uint64_t value) = 0;\n  virtual Result OnOpcodeV128(v128 value) = 0;\n  virtual Result OnOpcodeBlockSig(Type sig_type) = 0;\n  virtual Result OnOpcodeType(Type type) = 0;\n\n  virtual Result OnUnaryExpr(Opcode opcode) = 0;\n  virtual Result OnBinaryExpr(Opcode opcode) = 0;\n  virtual Result OnTernaryExpr(Opcode opcode) = 0;\n  virtual Result OnQuaternaryExpr(Opcode opcode) = 0;\n\n  virtual Result OnAtomicLoadExpr(Opcode opcode,\n                                  Index memidx,\n                                  Address alignment_log2,\n                                  Address offset) = 0;\n  virtual Result OnAtomicStoreExpr(Opcode opcode,\n                                   Index memidx,\n                                   Address alignment_log2,\n                                   Address offset) = 0;\n  virtual Result OnAtomicRmwExpr(Opcode opcode,\n                                 Index memidx,\n                                 Address alignment_log2,\n                                 Address offset) = 0;\n  virtual Result OnAtomicRmwCmpxchgExpr(Opcode opcode,\n                                        Index memidx,\n                                        Address alignment_log2,\n                                        Address offset) = 0;\n  virtual Result OnAtomicWaitExpr(Opcode opcode,\n                                  Index memidx,\n                                  Address alignment_log2,\n                                  Address offset) = 0;\n  virtual Result OnAtomicFenceExpr(uint32_t consistency_model) = 0;\n  virtual Result OnAtomicNotifyExpr(Opcode opcode,\n                                    Index memidx,\n                                    Address alignment_log2,\n                                    Address offset) = 0;\n  virtual Result OnBlockExpr(Type sig_type) = 0;\n  virtual Result OnBrExpr(Index depth) = 0;\n  virtual Result OnBrIfExpr(Index depth) = 0;\n  virtual Result OnBrOnNonNullExpr(Index depth) = 0;\n  virtual Result OnBrOnNullExpr(Index depth) = 0;\n  virtual Result OnBrTableExpr(Index num_targets,\n                               Index* target_depths,\n                               Index default_target_depth) = 0;\n  virtual Result OnCallExpr(Index func_index) = 0;\n  virtual Result OnCallIndirectExpr(Index sig_index, Index table_index) = 0;\n  virtual Result OnCallRefExpr(Type sig_type) = 0;\n  virtual Result OnCatchExpr(Index tag_index) = 0;\n  virtual Result OnCatchAllExpr() = 0;\n  virtual Result OnCompareExpr(Opcode opcode) = 0;\n  virtual Result OnConvertExpr(Opcode opcode) = 0;\n  virtual Result OnDelegateExpr(Index depth) = 0;\n  virtual Result OnDropExpr() = 0;\n  virtual Result OnElseExpr() = 0;\n  virtual Result OnEndExpr() = 0;\n  virtual Result OnF32ConstExpr(uint32_t value_bits) = 0;\n  virtual Result OnF64ConstExpr(uint64_t value_bits) = 0;\n  virtual Result OnV128ConstExpr(v128 value_bits) = 0;\n  virtual Result OnGlobalGetExpr(Index global_index) = 0;\n  virtual Result OnGlobalSetExpr(Index global_index) = 0;\n  virtual Result OnI32ConstExpr(uint32_t value) = 0;\n  virtual Result OnI64ConstExpr(uint64_t value) = 0;\n  virtual Result OnIfExpr(Type sig_type) = 0;\n  virtual Result OnLoadExpr(Opcode opcode,\n                            Index memidx,\n                            Address alignment_log2,\n                            Address offset) = 0;\n  virtual Result OnLocalGetExpr(Index local_index) = 0;\n  virtual Result OnLocalSetExpr(Index local_index) = 0;\n  virtual Result OnLocalTeeExpr(Index local_index) = 0;\n  virtual Result OnLoopExpr(Type sig_type) = 0;\n  virtual Result OnMemoryCopyExpr(Index destmemidx, Index srcmemidx) = 0;\n  virtual Result OnDataDropExpr(Index segment_index) = 0;\n  virtual Result OnMemoryFillExpr(Index memidx) = 0;\n  virtual Result OnMemoryGrowExpr(Index memidx) = 0;\n  virtual Result OnMemoryInitExpr(Index segment_index, Index memidx) = 0;\n  virtual Result OnMemorySizeExpr(Index memidx) = 0;\n  virtual Result OnTableCopyExpr(Index dst_index, Index src_index) = 0;\n  virtual Result OnElemDropExpr(Index segment_index) = 0;\n  virtual Result OnTableInitExpr(Index segment_index, Index table_index) = 0;\n  virtual Result OnTableGetExpr(Index table_index) = 0;\n  virtual Result OnTableSetExpr(Index table_index) = 0;\n  virtual Result OnTableGrowExpr(Index table_index) = 0;\n  virtual Result OnTableSizeExpr(Index table_index) = 0;\n  virtual Result OnTableFillExpr(Index table_index) = 0;\n  virtual Result OnRefAsNonNullExpr() = 0;\n  virtual Result OnRefFuncExpr(Index func_index) = 0;\n  virtual Result OnRefNullExpr(Type type) = 0;\n  virtual Result OnRefIsNullExpr() = 0;\n  virtual Result OnNopExpr() = 0;\n  virtual Result OnRethrowExpr(Index depth) = 0;\n  virtual Result OnReturnExpr() = 0;\n  virtual Result OnReturnCallExpr(Index func_index) = 0;\n  virtual Result OnReturnCallIndirectExpr(Index sig_index,\n                                          Index table_index) = 0;\n  virtual Result OnReturnCallRefExpr(Type sig_type) = 0;\n  virtual Result OnSelectExpr(Index result_count, Type* result_types) = 0;\n  virtual Result OnStoreExpr(Opcode opcode,\n                             Index memidx,\n                             Address alignment_log2,\n                             Address offset) = 0;\n  virtual Result OnThrowExpr(Index tag_index) = 0;\n  virtual Result OnThrowRefExpr() = 0;\n  virtual Result OnTryExpr(Type sig_type) = 0;\n  virtual Result OnTryTableExpr(Type sig_type,\n                                const CatchClauseVector& catches) = 0;\n\n  virtual Result OnUnreachableExpr() = 0;\n  virtual Result EndFunctionBody(Index index) = 0;\n  virtual Result EndCodeSection() = 0;\n\n  /* Simd instructions with Lane Imm operand*/\n  virtual Result OnSimdLaneOpExpr(Opcode opcode, uint64_t value) = 0;\n  virtual Result OnSimdShuffleOpExpr(Opcode opcode, v128 value) = 0;\n  virtual Result OnSimdLoadLaneExpr(Opcode opcode,\n                                    Index memidx,\n                                    Address alignment_log2,\n                                    Address offset,\n                                    uint64_t value) = 0;\n  virtual Result OnSimdStoreLaneExpr(Opcode opcode,\n                                     Index memidx,\n                                     Address alignment_log2,\n                                     Address offset,\n                                     uint64_t value) = 0;\n\n  virtual Result OnLoadSplatExpr(Opcode opcode,\n                                 Index memidx,\n                                 Address alignment_log2,\n                                 Address offset) = 0;\n  virtual Result OnLoadZeroExpr(Opcode opcode,\n                                Index memidx,\n                                Address alignment_log2,\n                                Address offset) = 0;\n\n  /* Elem section */\n  virtual Result BeginElemSection(Offset size) = 0;\n  virtual Result OnElemSegmentCount(Index count) = 0;\n  virtual Result BeginElemSegment(Index index,\n                                  Index table_index,\n                                  uint8_t flags) = 0;\n  virtual Result BeginElemSegmentInitExpr(Index index) = 0;\n  virtual Result EndElemSegmentInitExpr(Index index) = 0;\n  virtual Result OnElemSegmentElemType(Index index, Type elem_type) = 0;\n  virtual Result OnElemSegmentElemExprCount(Index index, Index count) = 0;\n  virtual Result BeginElemExpr(Index elem_index, Index expr_index) = 0;\n  virtual Result EndElemExpr(Index elem_index, Index expr_index) = 0;\n  virtual Result EndElemSegment(Index index) = 0;\n  virtual Result EndElemSection() = 0;\n\n  /* Data section */\n  virtual Result BeginDataSection(Offset size) = 0;\n  virtual Result OnDataSegmentCount(Index count) = 0;\n  virtual Result BeginDataSegment(Index index,\n                                  Index memory_index,\n                                  uint8_t flags) = 0;\n  virtual Result BeginDataSegmentInitExpr(Index index) = 0;\n  virtual Result EndDataSegmentInitExpr(Index index) = 0;\n  virtual Result OnDataSegmentData(Index index,\n                                   const void* data,\n                                   Address size) = 0;\n  virtual Result EndDataSegment(Index index) = 0;\n  virtual Result EndDataSection() = 0;\n\n  /* DataCount section */\n  virtual Result BeginDataCountSection(Offset size) = 0;\n  virtual Result OnDataCount(Index count) = 0;\n  virtual Result EndDataCountSection() = 0;\n\n  /* Names section */\n  virtual Result BeginNamesSection(Offset size) = 0;\n  virtual Result OnModuleNameSubsection(Index index,\n                                        uint32_t name_type,\n                                        Offset subsection_size) = 0;\n  virtual Result OnModuleName(std::string_view name) = 0;\n  virtual Result OnFunctionNameSubsection(Index index,\n                                          uint32_t name_type,\n                                          Offset subsection_size) = 0;\n  virtual Result OnFunctionNamesCount(Index num_functions) = 0;\n  virtual Result OnFunctionName(Index function_index,\n                                std::string_view function_name) = 0;\n  virtual Result OnLocalNameSubsection(Index index,\n                                       uint32_t name_type,\n                                       Offset subsection_size) = 0;\n  virtual Result OnLocalNameFunctionCount(Index num_functions) = 0;\n  virtual Result OnLocalNameLocalCount(Index function_index,\n                                       Index num_locals) = 0;\n  virtual Result OnLocalName(Index function_index,\n                             Index local_index,\n                             std::string_view local_name) = 0;\n  virtual Result OnNameSubsection(Index index,\n                                  NameSectionSubsection subsection_type,\n                                  Offset subsection_size) = 0;\n  virtual Result OnNameCount(Index num_names) = 0;\n  virtual Result OnNameEntry(NameSectionSubsection type,\n                             Index index,\n                             std::string_view name) = 0;\n  virtual Result EndNamesSection() = 0;\n\n  /* Reloc section */\n  virtual Result BeginRelocSection(Offset size) = 0;\n  virtual Result OnRelocCount(Index count, Index section_index) = 0;\n  virtual Result OnReloc(RelocType type,\n                         Offset offset,\n                         Index index,\n                         uint32_t addend) = 0;\n  virtual Result EndRelocSection() = 0;\n\n  /* Dylink section */\n  virtual Result BeginDylinkSection(Offset size) = 0;\n  virtual Result OnDylinkInfo(uint32_t mem_size,\n                              uint32_t mem_align_log2,\n                              uint32_t table_size,\n                              uint32_t table_align_log2) = 0;\n  virtual Result OnDylinkImportCount(Index count) = 0;\n  virtual Result OnDylinkExportCount(Index count) = 0;\n  virtual Result OnDylinkImport(std::string_view module,\n                                std::string_view name,\n                                uint32_t flags) = 0;\n  virtual Result OnDylinkExport(std::string_view name, uint32_t flags) = 0;\n  virtual Result OnDylinkNeededCount(Index count) = 0;\n  virtual Result OnDylinkNeeded(std::string_view so_name) = 0;\n  virtual Result EndDylinkSection() = 0;\n\n  /* target_features section */\n  virtual Result BeginTargetFeaturesSection(Offset size) = 0;\n  virtual Result OnFeatureCount(Index count) = 0;\n  virtual Result OnFeature(uint8_t prefix, std::string_view name) = 0;\n  virtual Result EndTargetFeaturesSection() = 0;\n\n  /* Generic custom section */\n  virtual Result BeginGenericCustomSection(Offset size) = 0;\n  virtual Result OnGenericCustomSection(std::string_view name,\n                                        const void* data,\n                                        Offset size) = 0;\n  virtual Result EndGenericCustomSection() = 0;\n\n  /* Linking section */\n  virtual Result BeginLinkingSection(Offset size) = 0;\n  virtual Result OnSymbolCount(Index count) = 0;\n  virtual Result OnDataSymbol(Index index,\n                              uint32_t flags,\n                              std::string_view name,\n                              Index segment,\n                              uint32_t offset,\n                              uint32_t size) = 0;\n  virtual Result OnFunctionSymbol(Index index,\n                                  uint32_t flags,\n                                  std::string_view name,\n                                  Index function_index) = 0;\n  virtual Result OnGlobalSymbol(Index index,\n                                uint32_t flags,\n                                std::string_view name,\n                                Index global_index) = 0;\n  virtual Result OnSectionSymbol(Index index,\n                                 uint32_t flags,\n                                 Index section_index) = 0;\n  virtual Result OnTagSymbol(Index index,\n                             uint32_t flags,\n                             std::string_view name,\n                             Index tag_index) = 0;\n  virtual Result OnTableSymbol(Index index,\n                               uint32_t flags,\n                               std::string_view name,\n                               Index table_index) = 0;\n  virtual Result OnSegmentInfoCount(Index count) = 0;\n  virtual Result OnSegmentInfo(Index index,\n                               std::string_view name,\n                               Address alignment_log2,\n                               uint32_t flags) = 0;\n  virtual Result OnInitFunctionCount(Index count) = 0;\n  virtual Result OnInitFunction(uint32_t priority, Index symbol_index) = 0;\n  virtual Result OnComdatCount(Index count) = 0;\n  virtual Result OnComdatBegin(std::string_view name,\n                               uint32_t flags,\n                               Index count) = 0;\n  virtual Result OnComdatEntry(ComdatType kind, Index index) = 0;\n  virtual Result EndLinkingSection() = 0;\n\n  /* Tag section */\n  virtual Result BeginTagSection(Offset size) = 0;\n  virtual Result OnTagCount(Index count) = 0;\n  virtual Result OnTagType(Index index, Index sig_index) = 0;\n  virtual Result EndTagSection() = 0;\n\n  /* Code Metadata sections */\n  virtual Result BeginCodeMetadataSection(std::string_view name,\n                                          Offset size) = 0;\n  virtual Result OnCodeMetadataFuncCount(Index count) = 0;\n  virtual Result OnCodeMetadataCount(Index function_index, Index count) = 0;\n  virtual Result OnCodeMetadata(Offset offset,\n                                const void* data,\n                                Address size) = 0;\n  virtual Result EndCodeMetadataSection() = 0;\n\n  const State* state = nullptr;\n};\n\nResult ReadBinary(const void* data,\n                  size_t size,\n                  BinaryReaderDelegate* reader,\n                  const ReadBinaryOptions& options);\n\nsize_t ReadU32Leb128(const uint8_t* ptr,\n                     const uint8_t* end,\n                     uint32_t* out_value);\n\nsize_t ReadI32Leb128(const uint8_t* ptr,\n                     const uint8_t* end,\n                     uint32_t* out_value);\n\n}  // namespace wabt\n\n#endif /* WABT_BINARY_READER_H_ */\n"
  },
  {
    "path": "include/wabt/binary-writer-spec.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_WRITER_SPEC_H_\n#define WABT_BINARY_WRITER_SPEC_H_\n\n#include <functional>\n#include <utility>\n#include <vector>\n\n#include \"wabt/binary-writer.h\"\n#include \"wabt/common.h\"\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nstruct FilenameMemoryStreamPair {\n  FilenameMemoryStreamPair(std::string_view filename,\n                           std::unique_ptr<MemoryStream> stream)\n      : filename(filename), stream(std::move(stream)) {}\n  std::string filename;\n  std::unique_ptr<MemoryStream> stream;\n};\n\nusing WriteBinarySpecStreamFactory =\n    std::function<Stream*(std::string_view filename)>;\n\nResult WriteBinarySpecScript(Stream* json_stream,\n                             WriteBinarySpecStreamFactory module_stream_factory,\n                             Script*,\n                             std::string_view source_filename,\n                             std::string_view module_filename_noext,\n                             const WriteBinaryOptions&);\n\n// Convenience function for producing MemoryStream outputs all modules.\nResult WriteBinarySpecScript(\n    Stream* json_stream,\n    Script*,\n    std::string_view source_filename,\n    std::string_view module_filename_noext,\n    const WriteBinaryOptions&,\n    std::vector<FilenameMemoryStreamPair>* out_module_streams,\n    Stream* log_stream = nullptr);\n\n}  // namespace wabt\n\n#endif /* WABT_BINARY_WRITER_SPEC_H_ */\n"
  },
  {
    "path": "include/wabt/binary-writer.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_WRITER_H_\n#define WABT_BINARY_WRITER_H_\n\n#include \"wabt/common.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/opcode.h\"\n#include \"wabt/stream.h\"\n\nnamespace wabt {\n\nstruct Module;\nstruct Script;\n\nstruct WriteBinaryOptions {\n  WriteBinaryOptions() = default;\n  WriteBinaryOptions(const Features& features,\n                     bool canonicalize_lebs,\n                     bool relocatable,\n                     bool write_debug_names)\n      : features(features),\n        canonicalize_lebs(canonicalize_lebs),\n        relocatable(relocatable),\n        write_debug_names(write_debug_names) {}\n\n  Features features;\n  bool canonicalize_lebs = true;\n  bool relocatable = false;\n  bool write_debug_names = false;\n};\n\nResult WriteBinaryModule(Stream*, const Module*, const WriteBinaryOptions&);\n\nvoid WriteType(Stream* stream, Type type, const char* desc = nullptr);\n\nvoid WriteStr(Stream* stream,\n              std::string_view s,\n              const char* desc,\n              PrintChars print_chars = PrintChars::No);\n\nvoid WriteOpcode(Stream* stream, Opcode opcode);\n\nvoid WriteLimits(Stream* stream, const Limits* limits);\n\n}  // namespace wabt\n\n#endif /* WABT_BINARY_WRITER_H_ */\n"
  },
  {
    "path": "include/wabt/binary.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_H_\n#define WABT_BINARY_H_\n\n#include \"wabt/common.h\"\n\n#define WABT_BINARY_MAGIC 0x6d736100\n#define WABT_BINARY_VERSION 1\n#define WABT_BINARY_LAYER_MODULE 0\n#define WABT_BINARY_LAYER_COMPONENT 1\n#define WABT_BINARY_LIMITS_HAS_MAX_FLAG 0x1\n#define WABT_BINARY_LIMITS_IS_SHARED_FLAG 0x2\n#define WABT_BINARY_LIMITS_IS_64_FLAG 0x4\n#define WABT_BINARY_LIMITS_HAS_CUSTOM_PAGE_SIZE_FLAG 0x8\n#define WABT_BINARY_LIMITS_ALL_MEMORY_FLAGS                              \\\n  (WABT_BINARY_LIMITS_HAS_MAX_FLAG | WABT_BINARY_LIMITS_IS_SHARED_FLAG | \\\n   WABT_BINARY_LIMITS_IS_64_FLAG |                                       \\\n   WABT_BINARY_LIMITS_HAS_CUSTOM_PAGE_SIZE_FLAG)\n#define WABT_BINARY_LIMITS_ALL_TABLE_FLAGS                               \\\n  (WABT_BINARY_LIMITS_HAS_MAX_FLAG | WABT_BINARY_LIMITS_IS_SHARED_FLAG | \\\n   WABT_BINARY_LIMITS_IS_64_FLAG)\n\n#define WABT_BINARY_SECTION_NAME \"name\"\n#define WABT_BINARY_SECTION_RELOC \"reloc\"\n#define WABT_BINARY_SECTION_LINKING \"linking\"\n#define WABT_BINARY_SECTION_TARGET_FEATURES \"target_features\"\n#define WABT_BINARY_SECTION_DYLINK \"dylink\"\n#define WABT_BINARY_SECTION_DYLINK0 \"dylink.0\"\n#define WABT_BINARY_SECTION_CODE_METADATA \"metadata.code.\"\n\n#define WABT_FOREACH_BINARY_SECTION(V) \\\n  V(Custom, custom, 0)                 \\\n  V(Type, type, 1)                     \\\n  V(Import, import, 2)                 \\\n  V(Function, function, 3)             \\\n  V(Table, table, 4)                   \\\n  V(Memory, memory, 5)                 \\\n  V(Tag, tag, 13)                      \\\n  V(Global, global, 6)                 \\\n  V(Export, export, 7)                 \\\n  V(Start, start, 8)                   \\\n  V(Elem, elem, 9)                     \\\n  V(DataCount, data_count, 12)         \\\n  V(Code, code, 10)                    \\\n  V(Data, data, 11)\n\nnamespace wabt {\n\n/* clang-format off */\nenum class BinarySection {\n#define V(Name, name, code) Name = code,\n  WABT_FOREACH_BINARY_SECTION(V)\n#undef V\n  Invalid = ~0,\n\n  First = Custom,\n  Last = Tag,\n};\n/* clang-format on */\nconstexpr int kBinarySectionCount = WABT_ENUM_COUNT(BinarySection);\n\nenum class BinarySectionOrder {\n#define V(Name, name, code) Name,\n  WABT_FOREACH_BINARY_SECTION(V)\n#undef V\n};\n\nBinarySectionOrder GetSectionOrder(BinarySection);\nconst char* GetSectionName(BinarySection);\n\n// See\n// https://github.com/WebAssembly/extended-name-section/blob/main/proposals/extended-name-section/Overview.md\nenum class NameSectionSubsection {\n  Module = 0,\n  Function = 1,\n  Local = 2,\n  Label = 3,\n  Type = 4,\n  Table = 5,\n  Memory = 6,\n  Global = 7,\n  ElemSegment = 8,\n  DataSegment = 9,\n  Field = 10,\n  Tag = 11,\n\n  First = Module,\n  Last = Tag,\n};\nconst char* GetNameSectionSubsectionName(NameSectionSubsection subsec);\n\n}  // namespace wabt\n\n#endif /* WABT_BINARY_H_ */\n"
  },
  {
    "path": "include/wabt/binding-hash.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINDING_HASH_H_\n#define WABT_BINDING_HASH_H_\n\n#include <functional>\n#include <string>\n#include <string_view>\n#include <unordered_map>\n#include <vector>\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nstruct Var;\n\nstruct Binding {\n  explicit Binding(Index index) : index(index) {}\n  Binding(const Location& loc, Index index) : loc(loc), index(index) {}\n\n  Location loc;\n  Index index;\n};\n\n// This class derives from a C++ container, which is usually not advisable\n// because they don't have virtual destructors. So don't delete a BindingHash\n// object through a pointer to std::unordered_multimap.\nclass BindingHash : public std::unordered_multimap<std::string, Binding> {\n public:\n  using DuplicateCallback =\n      std::function<void(const value_type&, const value_type&)>;\n\n  void FindDuplicates(DuplicateCallback callback) const;\n\n  Index FindIndex(const Var&) const;\n\n  Index FindIndex(const std::string& name) const {\n    auto iter = find(name);\n    return iter != end() ? iter->second.index : kInvalidIndex;\n  }\n\n  Index FindIndex(std::string_view name) const {\n    return FindIndex(std::string(name));\n  }\n\n private:\n  using ValueTypeVector = std::vector<const value_type*>;\n\n  void CreateDuplicatesVector(ValueTypeVector* out_duplicates) const;\n  void SortDuplicatesVectorByLocation(ValueTypeVector* duplicates) const;\n  void CallCallbacks(const ValueTypeVector& duplicates,\n                     DuplicateCallback callback) const;\n};\n\n}  // namespace wabt\n\n#endif /* WABT_BINDING_HASH_H_ */\n"
  },
  {
    "path": "include/wabt/c-writer.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_C_WRITER_H_\n#define WABT_C_WRITER_H_\n\n#include <functional>\n#include \"wabt/common.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nstruct Module;\nclass Stream;\n\nstruct WriteCOptions {\n  std::string_view module_name;\n  Features features;\n  /*\n   * name_to_output_file_index takes const iterators to begin and end of a list\n   * of all functions in the module, number of imported functions, and number of\n   * .c outputs as argument, returns a vector where vector[i] the index of the\n   * .c output that funcs_begin + i goes into. Only called when --num-outputs is\n   * used.\n   */\n  std::function<std::vector<size_t>(\n      std::vector<Func*>::const_iterator funcs_begin,\n      std::vector<Func*>::const_iterator funcs_end,\n      size_t num_imported_functions,\n      size_t num_outputs)>\n      name_to_output_file_index;\n};\n\nResult WriteC(std::vector<Stream*>&& c_streams,\n              Stream* h_stream,\n              Stream* h_impl_stream,\n              const char* header_name,\n              const char* header_impl_name,\n              const Module*,\n              const WriteCOptions&);\n\n}  // namespace wabt\n\n#endif /* WABT_C_WRITER_H_ */\n"
  },
  {
    "path": "include/wabt/cast.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_CAST_H_\n#define WABT_CAST_H_\n\n#include <memory>\n#include <type_traits>\n\n#include \"wabt/common.h\"\n\n// Modeled after LLVM's dynamic casts:\n// http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates\n//\n// Use isa<T>(foo) to check whether foo is a T*:\n//\n//     if (isa<Minivan>(car)) {\n//        ...\n//     }\n//\n// Use cast<T>(foo) when you know that foo is a T* -- it will assert that the\n// type matches:\n//\n//     switch (car.type) {\n//       case CarType::Minivan: {\n//         auto minivan = cast<Minivan>(car);\n//         ...\n//       }\n//     }\n//\n// Use dyn_cast<T>(foo) as a combination if isa and cast, it will return\n// nullptr if the type doesn't match:\n//\n//     if (auto minivan = dyn_cast<Minivan>(car)) {\n//       ...\n//     }\n//\n//\n// To use these classes in a type hierarchy, you must implement classof:\n//\n//     enum CarType { Minivan, ... };\n//     struct Car { CarType type; ... };\n//     struct Minivan : Car {\n//       static bool classof(const Car* car) { return car->type == Minivan; }\n//       ...\n//     };\n//\n\nnamespace wabt {\n\ntemplate <typename Derived, typename Base>\nbool isa(const Base* base) {\n  WABT_STATIC_ASSERT((std::is_base_of<Base, Derived>::value));\n  return Derived::classof(base);\n}\n\ntemplate <typename Derived, typename Base>\nconst Derived* cast(const Base* base) {\n  assert(isa<Derived>(base));\n  return static_cast<const Derived*>(base);\n};\n\ntemplate <typename Derived, typename Base>\nDerived* cast(Base* base) {\n  assert(isa<Derived>(base));\n  return static_cast<Derived*>(base);\n};\n\ntemplate <typename Derived, typename Base>\nconst Derived* dyn_cast(const Base* base) {\n  return isa<Derived>(base) ? static_cast<const Derived*>(base) : nullptr;\n};\n\ntemplate <typename Derived, typename Base>\nDerived* dyn_cast(Base* base) {\n  return isa<Derived>(base) ? static_cast<Derived*>(base) : nullptr;\n};\n\n// Cast functionality for unique_ptr. isa and dyn_cast are not included because\n// they won't always pass ownership back to the caller.\n\ntemplate <typename Derived, typename Base>\nstd::unique_ptr<const Derived> cast(std::unique_ptr<const Base>&& base) {\n  assert(isa<Derived>(base.get()));\n  return std::unique_ptr<Derived>(static_cast<const Derived*>(base.release()));\n};\n\ntemplate <typename Derived, typename Base>\nstd::unique_ptr<Derived> cast(std::unique_ptr<Base>&& base) {\n  assert(isa<Derived>(base.get()));\n  return std::unique_ptr<Derived>(static_cast<Derived*>(base.release()));\n};\n\n}  // namespace wabt\n\n#endif  // WABT_CAST_H_\n"
  },
  {
    "path": "include/wabt/color.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_COLOR_H_\n#define WABT_COLOR_H_\n\n#include <cstdio>\n\nnamespace wabt {\n\n#define WABT_FOREACH_COLOR_CODE(V) \\\n  V(Default, \"\\x1b[0m\")            \\\n  V(Bold, \"\\x1b[1m\")               \\\n  V(NoBold, \"\\x1b[22m\")            \\\n  V(Black, \"\\x1b[30m\")             \\\n  V(Red, \"\\x1b[31m\")               \\\n  V(Green, \"\\x1b[32m\")             \\\n  V(Yellow, \"\\x1b[33m\")            \\\n  V(Blue, \"\\x1b[34m\")              \\\n  V(Magenta, \"\\x1b[35m\")           \\\n  V(Cyan, \"\\x1b[36m\")              \\\n  V(White, \"\\x1b[37m\")\n\nclass Color {\n public:\n  Color() : file_(nullptr), enabled_(false) {}\n  Color(FILE*, bool enabled = true);\n\n// Write the given color to the file, if enabled.\n#define WABT_COLOR(Name, code) \\\n  void Name() const { WriteCode(Name##Code()); }\n  WABT_FOREACH_COLOR_CODE(WABT_COLOR)\n#undef WABT_COLOR\n\n// Get the color code as a string, if enabled.\n#define WABT_COLOR(Name, code) \\\n  const char* Maybe##Name##Code() const { return enabled_ ? Name##Code() : \"\"; }\n  WABT_FOREACH_COLOR_CODE(WABT_COLOR)\n#undef WABT_COLOR\n\n// Get the color code as a string.\n#define WABT_COLOR(Name, code) \\\n  static const char* Name##Code() { return code; }\n  WABT_FOREACH_COLOR_CODE(WABT_COLOR)\n#undef WABT_COLOR\n\n private:\n  static bool SupportsColor(FILE*);\n  void WriteCode(const char*) const;\n\n  FILE* file_;\n  bool enabled_;\n};\n\n#undef WABT_FOREACH_COLOR_CODE\n\n}  // namespace wabt\n\n#endif  //  WABT_COLOR_H_\n"
  },
  {
    "path": "include/wabt/common.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_COMMON_H_\n#define WABT_COMMON_H_\n\n#include <algorithm>\n#include <cassert>\n#include <cstdarg>\n#include <cstddef>\n#include <cstdint>\n#include <cstdio>\n#include <cstdlib>\n#include <cstring>\n#include <memory>\n#include <string>\n#include <string_view>\n#include <type_traits>\n#include <vector>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/base-types.h\"\n#include \"wabt/result.h\"\n#include \"wabt/string-format.h\"\n#include \"wabt/type.h\"\n\n#define WABT_FATAL(...) fprintf(stderr, __VA_ARGS__), exit(1)\n#define WABT_ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))\n\n#define WABT_USE(x) static_cast<void>(x)\n\n// 64k\n#define WABT_DEFAULT_PAGE_SIZE 0x10000\n\ninline uint64_t WABT_BYTES_TO_MIN_PAGES(uint64_t num_bytes,\n                                        uint32_t page_size) {\n  if ((page_size == 0) ||\n      (page_size & (page_size - 1))) {  // malformed page sizes\n    WABT_UNREACHABLE;\n    return 0;\n  }\n  uint64_t num_pages = num_bytes / page_size;\n  return (page_size * num_pages == num_bytes) ? num_pages : num_pages + 1;\n}\n\n#define WABT_ENUM_COUNT(name) \\\n  (static_cast<int>(name::Last) - static_cast<int>(name::First) + 1)\n\n#define WABT_DISALLOW_COPY_AND_ASSIGN(type) \\\n  type(const type&) = delete;               \\\n  type& operator=(const type&) = delete;\n\n#if WITH_EXCEPTIONS\n#define WABT_TRY try {\n#define WABT_CATCH_BAD_ALLOC \\\n  }                          \\\n  catch (std::bad_alloc&) {  \\\n  }\n#define WABT_CATCH_BAD_ALLOC_AND_EXIT           \\\n  }                                             \\\n  catch (std::bad_alloc&) {                     \\\n    WABT_FATAL(\"Memory allocation failure.\\n\"); \\\n  }\n#else\n#define WABT_TRY\n#define WABT_CATCH_BAD_ALLOC\n#define WABT_CATCH_BAD_ALLOC_AND_EXIT\n#endif\n\n#define PRIindex \"u\"\n#define PRIaddress PRIu64\n#define PRIoffset PRIzx\n\nnamespace wabt {\ninline void MemcpyEndianAware(void* dst,\n                              const void* src,\n                              size_t dsize,\n                              size_t ssize,\n                              size_t doff,\n                              size_t soff,\n                              size_t len) {\n#if WABT_BIG_ENDIAN\n  memcpy(static_cast<char*>(dst) + (dsize) - (len) - (doff),\n         static_cast<const char*>(src) + (ssize) - (len) - (soff), (len));\n#else\n  memcpy(static_cast<char*>(dst) + (doff),\n         static_cast<const char*>(src) + (soff), (len));\n#endif\n}\n}\n\nstruct v128 {\n  v128() = default;\n  v128(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3) {\n    set_u32(0, x0);\n    set_u32(1, x1);\n    set_u32(2, x2);\n    set_u32(3, x3);\n  }\n\n  bool operator==(const v128& other) const {\n    return std::equal(std::begin(v), std::end(v), std::begin(other.v));\n  }\n  bool operator!=(const v128& other) const { return !(*this == other); }\n\n  uint8_t u8(int lane) const { return To<uint8_t>(lane); }\n  uint16_t u16(int lane) const { return To<uint16_t>(lane); }\n  uint32_t u32(int lane) const { return To<uint32_t>(lane); }\n  uint64_t u64(int lane) const { return To<uint64_t>(lane); }\n  uint32_t f32_bits(int lane) const { return To<uint32_t>(lane); }\n  uint64_t f64_bits(int lane) const { return To<uint64_t>(lane); }\n\n  void set_u8(int lane, uint8_t x) { return From<uint8_t>(lane, x); }\n  void set_u16(int lane, uint16_t x) { return From<uint16_t>(lane, x); }\n  void set_u32(int lane, uint32_t x) { return From<uint32_t>(lane, x); }\n  void set_u64(int lane, uint64_t x) { return From<uint64_t>(lane, x); }\n  void set_f32_bits(int lane, uint32_t x) { return From<uint32_t>(lane, x); }\n  void set_f64_bits(int lane, uint64_t x) { return From<uint64_t>(lane, x); }\n\n  bool is_zero() const {\n    return std::all_of(std::begin(v), std::end(v),\n                       [](uint8_t x) { return x == 0; });\n  }\n  void set_zero() { std::fill(std::begin(v), std::end(v), 0); }\n\n  template <typename T>\n  T To(int lane) const {\n    static_assert(sizeof(T) <= sizeof(v), \"Invalid cast!\");\n    assert((lane + 1) * sizeof(T) <= sizeof(v));\n    T result;\n    wabt::MemcpyEndianAware(&result, v, sizeof(result), sizeof(v), 0,\n                            lane * sizeof(T), sizeof(result));\n    return result;\n  }\n\n  template <typename T>\n  void From(int lane, T data) {\n    static_assert(sizeof(T) <= sizeof(v), \"Invalid cast!\");\n    assert((lane + 1) * sizeof(T) <= sizeof(v));\n    wabt::MemcpyEndianAware(v, &data, sizeof(v), sizeof(data), lane * sizeof(T),\n                            0, sizeof(data));\n  }\n\n  uint8_t v[16];\n};\n\nnamespace wabt {\n\ntemplate <typename Dst, typename Src>\nDst WABT_VECTORCALL Bitcast(Src&& value) {\n  static_assert(sizeof(Src) == sizeof(Dst), \"Bitcast sizes must match.\");\n  Dst result;\n  memcpy(&result, &value, sizeof(result));\n  return result;\n}\n\ntemplate <typename T>\nvoid ZeroMemory(T& v) {\n  WABT_STATIC_ASSERT(std::is_trivial<T>::value);\n  memset(&v, 0, sizeof(v));\n}\n\n// Placement construct\ntemplate <typename T, typename... Args>\nvoid Construct(T& placement, Args&&... args) {\n  new (&placement) T(std::forward<Args>(args)...);\n}\n\n// Placement destruct\ntemplate <typename T>\nvoid Destruct(T& placement) {\n  placement.~T();\n}\n\nenum class LabelType {\n  Func,\n  InitExpr,\n  Block,\n  Loop,\n  If,\n  Else,\n  Try,\n  TryTable,\n  Catch,\n\n  First = Func,\n  Last = Catch,\n};\nconstexpr int kLabelTypeCount = WABT_ENUM_COUNT(LabelType);\n\nstruct Location {\n  enum class Type {\n    Text,\n    Binary,\n  };\n\n  Location() : line(0), first_column(0), last_column(0) {}\n  Location(std::string_view filename,\n           int line,\n           int first_column,\n           int last_column)\n      : filename(filename),\n        line(line),\n        first_column(first_column),\n        last_column(last_column) {}\n  explicit Location(size_t offset) : offset(offset) {}\n\n  std::string_view filename;\n  union {\n    // For text files.\n    struct {\n      int line;\n      int first_column;\n      int last_column;\n    };\n    // For binary files.\n    struct {\n      size_t offset;\n    };\n  };\n};\n\nenum class SegmentKind {\n  Active,\n  Passive,\n  Declared,\n};\n\nenum class CatchKind {\n  Catch,\n  CatchRef,\n  CatchAll,\n  CatchAllRef,\n};\n\n// Used in test asserts for special expected values \"nan:canonical\" and\n// \"nan:arithmetic\"\nenum class ExpectedNan {\n  None,\n  Canonical,\n  Arithmetic,\n};\n\n// Matches binary format, do not change.\nenum SegmentFlags : uint8_t {\n  SegFlagsNone = 0,\n  SegPassive = 1,        // bit 0: Is passive\n  SegExplicitIndex = 2,  // bit 1: Has explict index (Implies table 0 if absent)\n  SegDeclared = 3,       // Only used for declared segments\n  SegUseElemExprs = 4,   // bit 2: Is elemexpr (Or else index sequence)\n\n  SegFlagMax = (SegUseElemExprs << 1) - 1,  // All bits set.\n};\n\nenum class RelocType {\n  FuncIndexLEB = 0,       // e.g. Immediate of call instruction\n  TableIndexSLEB = 1,     // e.g. Loading address of function\n  TableIndexI32 = 2,      // e.g. Function address in DATA\n  MemoryAddressLEB = 3,   // e.g. Memory address in load/store offset immediate\n  MemoryAddressSLEB = 4,  // e.g. Memory address in i32.const\n  MemoryAddressI32 = 5,   // e.g. Memory address in DATA\n  TypeIndexLEB = 6,       // e.g. Immediate type in call_indirect\n  GlobalIndexLEB = 7,     // e.g. Immediate of global.get inst\n  FunctionOffsetI32 = 8,  // e.g. Code offset in DWARF metadata\n  SectionOffsetI32 = 9,   // e.g. Section offset in DWARF metadata\n  TagIndexLEB = 10,       // Used in throw instructions\n  MemoryAddressRelSLEB = 11,  // In PIC code, addr relative to __memory_base\n  TableIndexRelSLEB = 12,   // In PIC code, table index relative to __table_base\n  GlobalIndexI32 = 13,      // e.g. Global index in data (e.g. DWARF)\n  MemoryAddressLEB64 = 14,  // Memory64: Like MemoryAddressLEB\n  MemoryAddressSLEB64 = 15,     // Memory64: Like MemoryAddressSLEB\n  MemoryAddressI64 = 16,        // Memory64: Like MemoryAddressI32\n  MemoryAddressRelSLEB64 = 17,  // Memory64: Like MemoryAddressRelSLEB\n  TableIndexSLEB64 = 18,        // Memory64: Like TableIndexSLEB\n  TableIndexI64 = 19,           // Memory64: Like TableIndexI32\n  TableNumberLEB = 20,          // e.g. Immediate of table.get\n  MemoryAddressTLSSLEB = 21,    // Address relative to __tls_base\n  FunctionOffsetI64 = 22,       // Memory64: Like FunctionOffsetI32\n  MemoryAddressLocRelI32 = 23,  // Address relative to the relocation's location\n  TableIndexRelSLEB64 = 24,     // Memory64: TableIndexRelSLEB\n  MemoryAddressTLSSLEB64 = 25,  // Memory64: MemoryAddressTLSSLEB\n  FuncIndexI32 = 26,            // Function index as an I32\n\n  First = FuncIndexLEB,\n  Last = FuncIndexI32,\n};\nconstexpr int kRelocTypeCount = WABT_ENUM_COUNT(RelocType);\n\nstruct Reloc {\n  Reloc(RelocType, size_t offset, Index index, int32_t addend = 0);\n\n  RelocType type;\n  size_t offset;\n  Index index;\n  int32_t addend;\n};\n\nenum class LinkingEntryType {\n  SegmentInfo = 5,\n  InitFunctions = 6,\n  ComdatInfo = 7,\n  SymbolTable = 8,\n};\n\nenum class DylinkEntryType {\n  MemInfo = 1,\n  Needed = 2,\n  ExportInfo = 3,\n  ImportInfo = 4,\n};\n\nenum class SymbolType {\n  Function = 0,\n  Data = 1,\n  Global = 2,\n  Section = 3,\n  Tag = 4,\n  Table = 5,\n};\n\nenum class ComdatType {\n  Data = 0x0,\n  Function = 0x1,\n};\n\n#define WABT_SYMBOL_MASK_VISIBILITY 0x4\n#define WABT_SYMBOL_MASK_BINDING 0x3\n#define WABT_SYMBOL_FLAG_UNDEFINED 0x10\n#define WABT_SYMBOL_FLAG_EXPORTED 0x20\n#define WABT_SYMBOL_FLAG_EXPLICIT_NAME 0x40\n#define WABT_SYMBOL_FLAG_NO_STRIP 0x80\n#define WABT_SYMBOL_FLAG_TLS 0x100\n#define WABT_SYMBOL_FLAG_ABS 0x200\n#define WABT_SYMBOL_FLAG_MAX 0x3ff\n\n#define WABT_SEGMENT_FLAG_STRINGS 0x1\n#define WABT_SEGMENT_FLAG_TLS 0x2\n#define WASM_SEGMENT_FLAG_RETAIN 0x4\n#define WABT_SEGMENT_FLAG_MAX 0xff\n\nenum class SymbolVisibility {\n  Default = 0,\n  Hidden = 4,\n};\n\nenum class SymbolBinding {\n  Global = 0,\n  Weak = 1,\n  Local = 2,\n};\n\n/* matches binary format, do not change */\nenum class ExternalKind {\n  Func = 0,\n  Table = 1,\n  Memory = 2,\n  Global = 3,\n  Tag = 4,\n\n  First = Func,\n  Last = Tag,\n};\nconstexpr int kExternalKindCount = WABT_ENUM_COUNT(ExternalKind);\n\nstruct Limits {\n  Limits() = default;\n  explicit Limits(uint64_t initial) : initial(initial) {}\n  Limits(uint64_t initial, uint64_t max)\n      : initial(initial), max(max), has_max(true) {}\n  Limits(uint64_t initial, uint64_t max, bool is_shared)\n      : initial(initial), max(max), has_max(true), is_shared(is_shared) {}\n  Limits(uint64_t initial, uint64_t max, bool is_shared, bool is_64)\n      : initial(initial),\n        max(max),\n        has_max(true),\n        is_shared(is_shared),\n        is_64(is_64) {}\n  Type IndexType() const { return is_64 ? Type::I64 : Type::I32; }\n\n  uint64_t initial = 0;\n  uint64_t max = 0;\n  bool has_max = false;\n  bool is_shared = false;\n  bool is_64 = false;\n};\n\nenum { WABT_USE_NATURAL_ALIGNMENT = 0xFFFFFFFFFFFFFFFF };\n\nResult ReadFile(std::string_view filename, std::vector<uint8_t>* out_data);\n\nvoid InitStdio();\n\n/* external kind */\n\nextern const char* g_kind_name[];\n\nstatic inline const char* GetKindName(ExternalKind kind) {\n  return static_cast<size_t>(kind) < kExternalKindCount\n             ? g_kind_name[static_cast<size_t>(kind)]\n             : \"<error_kind>\";\n}\n\n/* reloc */\n\nextern const char* g_reloc_type_name[];\n\nstatic inline const char* GetRelocTypeName(RelocType reloc) {\n  return static_cast<size_t>(reloc) < kRelocTypeCount\n             ? g_reloc_type_name[static_cast<size_t>(reloc)]\n             : \"<error_reloc_type>\";\n}\n\n/* symbol */\n\nstatic inline const char* GetSymbolTypeName(SymbolType type) {\n  switch (type) {\n    case SymbolType::Function:\n      return \"func\";\n    case SymbolType::Global:\n      return \"global\";\n    case SymbolType::Data:\n      return \"data\";\n    case SymbolType::Section:\n      return \"section\";\n    case SymbolType::Tag:\n      return \"tag\";\n    case SymbolType::Table:\n      return \"table\";\n    default:\n      return \"<error_symbol_type>\";\n  }\n}\n\ntemplate <typename T>\nvoid ConvertBackslashToSlash(T begin, T end) {\n  std::replace(begin, end, '\\\\', '/');\n}\n\ninline void ConvertBackslashToSlash(char* s, size_t length) {\n  ConvertBackslashToSlash(s, s + length);\n}\n\ninline void ConvertBackslashToSlash(char* s) {\n  ConvertBackslashToSlash(s, strlen(s));\n}\n\ninline void ConvertBackslashToSlash(std::string* s) {\n  ConvertBackslashToSlash(s->begin(), s->end());\n}\n\ninline void SwapBytesSized(void* addr, size_t size) {\n  auto bytes = static_cast<uint8_t*>(addr);\n  for (size_t i = 0; i < size / 2; i++) {\n    std::swap(bytes[i], bytes[size - 1 - i]);\n  }\n}\n\n}  // namespace wabt\n\n#endif  // WABT_COMMON_H_\n"
  },
  {
    "path": "include/wabt/decompiler-ast.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_DECOMPILER_AST_H_\n#define WABT_DECOMPILER_AST_H_\n\n#include \"wabt/cast.h\"\n#include \"wabt/generate-names.h\"\n#include \"wabt/ir-util.h\"\n#include \"wabt/ir.h\"\n\n#include <map>\n\nnamespace wabt {\n\nenum class NodeType {\n  Uninitialized,\n  FlushToVars,\n  FlushedVar,\n  Statements,\n  EndReturn,\n  Decl,\n  DeclInit,\n  Expr\n};\n\n// The AST we're going to convert the standard IR into.\nstruct Node {\n  NodeType ntype;\n  ExprType etype;  // Only if ntype == Expr.\n  const Expr* e;\n  std::vector<Node> children;\n  // Node specific annotations.\n  union {\n    struct {\n      Index var_start, var_count;  // FlushedVar/FlushToVars\n    };\n    const Var* var;  // Decl/DeclInit.\n    LabelType lt;    // br/br_if target.\n  } u;\n\n  Node() : ntype(NodeType::Uninitialized), etype(ExprType::Nop), e(nullptr) {}\n  Node(NodeType ntype, ExprType etype, const Expr* e, const Var* v)\n      : ntype(ntype), etype(etype), e(e) {\n    u.var = v;\n  }\n\n  // This value should really never be copied, only moved.\n  Node(const Node& rhs) = delete;\n  Node& operator=(const Node& rhs) = delete;\n\n  Node(Node&& rhs) { *this = std::move(rhs); }\n  Node& operator=(Node&& rhs) {\n    ntype = rhs.ntype;\n    // Reset ntype to avoid moved from values still being used.\n    rhs.ntype = NodeType::Uninitialized;\n    etype = rhs.etype;\n    rhs.etype = ExprType::Nop;\n    e = rhs.e;\n    std::swap(children, rhs.children);\n    u = rhs.u;\n    return *this;\n  }\n};\n\nstruct AST {\n  AST(ModuleContext& mc, const Func* f) : mc(mc), f(f) {\n    if (f) {\n      mc.BeginFunc(*f);\n      for (Index i = 0; i < f->GetNumParams(); i++) {\n        auto name = \"$\" + IndexToAlphaName(i);\n        vars_defined.insert({name, {0, false}});\n      }\n    }\n  }\n\n  ~AST() {\n    if (f) {\n      mc.EndFunc();\n    }\n  }\n\n  // Create a new node, take nargs existing nodes on the exp stack as children.\n  Node& InsertNode(NodeType ntype, ExprType etype, const Expr* e, Index nargs) {\n    assert(exp_stack.size() >= nargs);\n    Node n{ntype, etype, e, nullptr};\n    n.children.reserve(nargs);\n    std::move(exp_stack.end() - nargs, exp_stack.end(),\n              std::back_inserter(n.children));\n    exp_stack.erase(exp_stack.end() - nargs, exp_stack.end());\n    exp_stack.push_back(std::move(n));\n    return exp_stack.back();\n  }\n\n  template <ExprType T>\n  void PreDecl(const VarExpr<T>& ve) {\n    // FIXME: this is slow, and would be better to avoid in callers.\n    // See https://github.com/WebAssembly/wabt/issues/1565\n    // And https://github.com/WebAssembly/wabt/issues/1665\n    for (auto& n : predecls) {\n      if (n.u.var->name() == ve.var.name()) {\n        return;\n      }\n    }\n    predecls.emplace_back(NodeType::Decl, ExprType::Nop, nullptr, &ve.var);\n  }\n\n  template <ExprType T>\n  void Get(const VarExpr<T>& ve, bool local) {\n    if (local) {\n      auto ret = vars_defined.insert({ve.var.name(), {cur_block_id, false}});\n      if (ret.second) {\n        // Use before def, may happen since locals are guaranteed 0.\n        PreDecl(ve);\n      } else if (blocks_closed[ret.first->second.block_id]) {\n        // This is a use of a variable that was defined in a block that has\n        // already ended. This happens rarely, but we should cater for this\n        // case by lifting it to the top scope.\n        PreDecl(ve);\n      }\n    }\n    InsertNode(NodeType::Expr, T, &ve, 0);\n  }\n\n  template <ExprType T>\n  void Set(const VarExpr<T>& ve, bool local) {\n    // Seen this var before?\n    if (local &&\n        vars_defined.insert({ve.var.name(), {cur_block_id, false}}).second) {\n      if (value_stack_depth == 1) {\n        // Top level, declare it here.\n        InsertNode(NodeType::DeclInit, ExprType::Nop, nullptr, 1).u.var =\n            &ve.var;\n        return;\n      } else {\n        // Inside exp, better leave it as assignment exp and lift the decl out.\n        PreDecl(ve);\n      }\n    }\n    InsertNode(NodeType::Expr, T, &ve, 1);\n  }\n\n  template <ExprType T>\n  void Block(const BlockExprBase<T>& be, LabelType label) {\n    mc.BeginBlock(label, be.block);\n    Construct(be.block.exprs, be.block.decl.GetNumResults(),\n              be.block.decl.GetNumParams(), false);\n    mc.EndBlock();\n    InsertNode(NodeType::Expr, T, &be, 1);\n  }\n\n  void Construct(const Expr& e) {\n    auto arity = mc.GetExprArity(e);\n    switch (e.type()) {\n      case ExprType::LocalGet: {\n        Get(*cast<LocalGetExpr>(&e), true);\n        return;\n      }\n      case ExprType::GlobalGet: {\n        Get(*cast<GlobalGetExpr>(&e), false);\n        return;\n      }\n      case ExprType::LocalSet: {\n        Set(*cast<LocalSetExpr>(&e), true);\n        return;\n      }\n      case ExprType::GlobalSet: {\n        Set(*cast<GlobalSetExpr>(&e), false);\n        return;\n      }\n      case ExprType::LocalTee: {\n        auto& lt = *cast<LocalTeeExpr>(&e);\n        Set(lt, true);\n        if (value_stack_depth == 1) {  // Tee is the only thing on there.\n          Get(lt, true);               // Now Set + Get instead.\n        } else {\n          // Things are above us on the stack so the Tee can't be eliminated.\n          // The Set makes this work as a Tee when consumed by a parent.\n        }\n        return;\n      }\n      case ExprType::If: {\n        auto ife = cast<IfExpr>(&e);\n        value_stack_depth--;  // Condition.\n        mc.BeginBlock(LabelType::Block, ife->true_);\n        Construct(ife->true_.exprs, ife->true_.decl.GetNumResults(),\n                  ife->true_.decl.GetNumParams(), false);\n        if (!ife->false_.empty()) {\n          Construct(ife->false_, ife->true_.decl.GetNumResults(),\n                    ife->true_.decl.GetNumParams(), false);\n        }\n        mc.EndBlock();\n        value_stack_depth++;  // Put Condition back.\n        InsertNode(NodeType::Expr, ExprType::If, &e,\n                   ife->false_.empty() ? 2 : 3);\n        return;\n      }\n      case ExprType::Block: {\n        Block(*cast<BlockExpr>(&e), LabelType::Block);\n        return;\n      }\n      case ExprType::Loop: {\n        Block(*cast<LoopExpr>(&e), LabelType::Loop);\n        return;\n      }\n      case ExprType::Br: {\n        InsertNode(NodeType::Expr, ExprType::Br, &e, 0).u.lt =\n            mc.GetLabel(cast<BrExpr>(&e)->var)->label_type;\n        return;\n      }\n      case ExprType::BrIf: {\n        InsertNode(NodeType::Expr, ExprType::BrIf, &e, 1).u.lt =\n            mc.GetLabel(cast<BrIfExpr>(&e)->var)->label_type;\n        return;\n      }\n      case ExprType::BrTable: {\n        InsertNode(NodeType::Expr, ExprType::BrTable, &e, 1).u.lt =\n            mc.GetLabel(cast<BrTableExpr>(&e)->default_target)->label_type;\n        return;\n      }\n      default: {\n        InsertNode(NodeType::Expr, e.type(), &e, arity.nargs);\n        return;\n      }\n    }\n  }\n\n  void Construct(const ExprList& es,\n                 Index nresults,\n                 Index nparams,\n                 bool is_function_body) {\n    block_stack.push_back(cur_block_id);\n    cur_block_id = blocks_closed.size();\n    blocks_closed.push_back(false);\n    auto start = exp_stack.size();\n    int value_stack_depth_start = value_stack_depth - nparams;\n    auto value_stack_in_variables = value_stack_depth;\n    bool unreachable = false;\n    for (auto& e : es) {\n      Construct(e);\n      auto arity = mc.GetExprArity(e);\n      value_stack_depth -= arity.nargs;\n      value_stack_in_variables =\n          std::min(value_stack_in_variables, value_stack_depth);\n      unreachable = unreachable || arity.unreachable;\n      assert(unreachable || value_stack_depth >= value_stack_depth_start);\n      value_stack_depth += arity.nreturns;\n      // We maintain the invariant that a value_stack_depth of N is represented\n      // by the last N exp_stack items (each of which returning exactly 1\n      // value), all exp_stack items before it return void (\"statements\").\n      // In particular for the wasm stack:\n      // - The values between 0 and value_stack_depth_start are part of the\n      //   parent block, and not touched here.\n      // - The values from there up to value_stack_in_variables are variables\n      //   to be used, representing previous statements that flushed the\n      //   stack into variables.\n      // - Values on top of that up to value_stack_depth are exps returning\n      //   a single value.\n      // The code below maintains the above invariants. With this in place\n      // code \"falls into place\" the way you expect it.\n      if (arity.nreturns != 1) {\n        auto num_vars = value_stack_in_variables - value_stack_depth_start;\n        auto num_vals = value_stack_depth - value_stack_in_variables;\n        auto GenFlushVars = [&](int nargs) {\n          auto& ftv =\n              InsertNode(NodeType::FlushToVars, ExprType::Nop, nullptr, nargs);\n          ftv.u.var_start = flushed_vars;\n          ftv.u.var_count = num_vals;\n        };\n        auto MoveStatementsBelowVars = [&](size_t amount) {\n          std::rotate(exp_stack.end() - num_vars - amount,\n                      exp_stack.end() - amount, exp_stack.end());\n        };\n        auto GenFlushedVars = [&]() {\n          // Re-generate these values as vars.\n          for (int i = 0; i < num_vals; i++) {\n            auto& fv =\n                InsertNode(NodeType::FlushedVar, ExprType::Nop, nullptr, 0);\n            fv.u.var_start = flushed_vars++;\n            fv.u.var_count = 1;\n          }\n        };\n        if (arity.nreturns == 0 &&\n            value_stack_depth > value_stack_depth_start) {\n          // We have a void item on top of the exp_stack, so we must \"lift\" the\n          // previous values around it.\n          // We track what part of the stack is in variables to avoid doing\n          // this unnecessarily.\n          if (num_vals > 0) {\n            // We have actual new values that need lifting.\n            // This puts the part of the stack that wasn't already a variable\n            // (before the current void exp) into a FlushToVars.\n            auto void_exp = std::move(exp_stack.back());\n            exp_stack.pop_back();\n            GenFlushVars(num_vals);\n            exp_stack.push_back(std::move(void_exp));\n            // Put this flush statement + void statement before any\n            // existing variables.\n            MoveStatementsBelowVars(2);\n            // Now re-generate these values after the void exp as vars.\n            GenFlushedVars();\n          } else {\n            // We have existing variables that need lifting, but no need to\n            // create them anew.\n            std::rotate(exp_stack.end() - num_vars - 1, exp_stack.end() - 1,\n                        exp_stack.end());\n          }\n          value_stack_in_variables = value_stack_depth;\n        } else if (arity.nreturns > 1) {\n          // Multivalue: we flush the stack also.\n          // Number of other non-variable values that may be present:\n          assert(num_vals >= static_cast<int>(arity.nreturns));\n          // Flush multi-value exp + others.\n          GenFlushVars(num_vals - arity.nreturns + 1);\n          // Put this flush statement before any existing variables.\n          MoveStatementsBelowVars(1);\n          GenFlushedVars();\n          value_stack_in_variables = value_stack_depth;\n        }\n      } else {\n        // Special optimisation: for constant instructions, we can mark these\n        // as if they were variables, so they can be re-ordered for free with\n        // the above code, without needing new variables!\n        // TODO: this would be nice to also do for local.get and maybe others,\n        // though that needs a way to ensure there's no local.set in between\n        // when they get lifted, so complicates matters a bit.\n        if (e.type() == ExprType::Const &&\n            value_stack_in_variables == value_stack_depth - 1) {\n          value_stack_in_variables++;\n        }\n      }\n    }\n    assert(unreachable || value_stack_depth - value_stack_depth_start ==\n                              static_cast<int>(nresults));\n    // Undo any changes to value_stack_depth, since parent takes care of arity\n    // changes.\n    value_stack_depth = value_stack_depth_start;\n    auto end = exp_stack.size();\n    assert(end >= start);\n    if (is_function_body) {\n      if (!exp_stack.empty()) {\n        if (exp_stack.back().etype == ExprType::Return) {\n          if (exp_stack.back().children.empty()) {\n            // Return statement at the end of a void function.\n            exp_stack.pop_back();\n          }\n        } else if (nresults) {\n          // Combine nresults into a return statement, for when this is used as\n          // a function body.\n          // TODO: if this is some other kind of block and >1 value is being\n          // returned, probably need some kind of syntax to make that clearer.\n          InsertNode(NodeType::EndReturn, ExprType::Nop, nullptr, nresults);\n        }\n      }\n      // TODO: these predecls are always at top level, but in the case of\n      // use inside an exp, it be nice to do it in the current block. Can't\n      // do that for predecls that are \"out if scope\" however.\n      std::move(predecls.begin(), predecls.end(),\n                std::back_inserter(exp_stack));\n      std::rotate(exp_stack.begin(), exp_stack.end() - predecls.size(),\n                  exp_stack.end());\n      predecls.clear();\n    }\n    end = exp_stack.size();\n    assert(end >= start);\n    auto size = end - start;\n    if (size != 1) {\n      InsertNode(NodeType::Statements, ExprType::Nop, nullptr, size);\n    }\n    blocks_closed[cur_block_id] = true;\n    cur_block_id = block_stack.back();\n    block_stack.pop_back();\n  }\n\n  ModuleContext& mc;\n  std::vector<Node> exp_stack;\n  std::vector<Node> predecls;\n  const Func* f;\n  int value_stack_depth = 0;\n  struct Variable {\n    size_t block_id;\n    bool defined;\n  };\n  std::map<std::string, Variable> vars_defined;\n  Index flushed_vars = 0;\n  size_t cur_block_id = 0;\n  std::vector<size_t> block_stack;\n  std::vector<bool> blocks_closed;\n};\n\n}  // namespace wabt\n\n#endif  // WABT_DECOMPILER_AST_H_\n"
  },
  {
    "path": "include/wabt/decompiler-ls.h",
    "content": "/*\n * Copyright 2019 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_DECOMPILER_LS_H_\n#define WABT_DECOMPILER_LS_H_\n\n#include \"wabt/decompiler-ast.h\"\n#include \"wabt/string-util.h\"\n\n#include <map>\n\nnamespace wabt {\n\n// Names starting with \"u\" are unsigned, the rest are \"signed or doesn't matter\"\ninline const char* GetDecompTypeName(Type t) {\n  switch (t) {\n    case Type::I8: return \"byte\";\n    case Type::I8U: return \"ubyte\";\n    case Type::I16: return \"short\";\n    case Type::I16U: return \"ushort\";\n    case Type::I32: return \"int\";\n    case Type::I32U: return \"uint\";\n    case Type::I64: return \"long\";\n    case Type::F32: return \"float\";\n    case Type::F64: return \"double\";\n    case Type::V128: return \"simd\";\n    case Type::Func: return \"func\";\n    case Type::FuncRef: return \"funcref\";\n    case Type::ExternRef: return \"externref\";\n    case Type::Void: return \"void\";\n    default: return \"ILLEGAL\";\n  }\n}\n\ninline Type GetMemoryType(Type operand_type, Opcode opc) {\n  // TODO: something something SIMD.\n  // TODO: this loses information of the type it is read into.\n  // That may well not be the biggest deal since that is usually obvious\n  // from context, if not, we should probably represent that as a cast around\n  // the access, since it should not be part of the field type.\n  if (operand_type == Type::I32 || operand_type == Type::I64) {\n    auto name = std::string_view(opc.GetName());\n    // FIXME: change into a new column in opcode.def instead?\n    auto is_unsigned = name.substr(name.size() - 2) == \"_u\";\n    switch (opc.GetMemorySize()) {\n      case 1: return is_unsigned ? Type::I8U : Type::I8;\n      case 2: return is_unsigned ? Type::I16U : Type::I16;\n      case 4: return is_unsigned ? Type::I32U : Type::I32;\n    }\n  }\n  return operand_type;\n}\n\n// Track all loads and stores inside a single function, to be able to detect\n// struct layouts we can use to annotate variables with, to make code more\n// readable.\nstruct LoadStoreTracking {\n  struct LSAccess {\n    Address byte_size = 0;\n    Type type = Type::Any;\n    Address align = 0;\n    uint32_t idx = 0;\n    bool is_uniform = true;\n  };\n\n  struct LSVar {\n    std::map<uint64_t, LSAccess> accesses;\n    bool struct_layout = true;\n    Type same_type = Type::Any;\n    Address same_align = kInvalidAddress;\n    Opcode last_opc;\n  };\n\n  void Track(const Node& n) {\n    for (auto& c : n.children) {\n      Track(c);\n    }\n    switch (n.etype) {\n      case ExprType::Load: {\n        auto& le = *cast<LoadExpr>(n.e);\n        LoadStore(le.offset, le.opcode, le.opcode.GetResultType(), le.align,\n                  n.children[0]);\n        break;\n      }\n      case ExprType::Store: {\n        auto& se = *cast<StoreExpr>(n.e);\n        LoadStore(se.offset, se.opcode, se.opcode.GetParamType2(), se.align,\n                  n.children[0]);\n        break;\n      }\n      default:\n        break;\n    }\n  }\n\n  const std::string AddrExpName(const Node& addr_exp) const {\n    // TODO: expand this to more kinds of address expressions.\n    switch (addr_exp.etype) {\n      case ExprType::LocalGet:\n        return cast<LocalGetExpr>(addr_exp.e)->var.name();\n        break;\n      case ExprType::LocalTee:\n        return cast<LocalTeeExpr>(addr_exp.e)->var.name();\n        break;\n      default:\n        return \"\";\n    }\n  }\n\n  void LoadStore(uint64_t offset,\n                 Opcode opc,\n                 Type type,\n                 Address align,\n                 const Node& addr_exp) {\n    auto byte_size = opc.GetMemorySize();\n    type = GetMemoryType(type, opc);\n    // We want to associate memory ops of a certain offset & size as being\n    // relative to a uniquely identifiable pointer, such as a local.\n    auto name = AddrExpName(addr_exp);\n    if (name.empty()) {\n      return;\n    }\n    auto& var = vars[name];\n    auto& access = var.accesses[offset];\n    // Check if previous access at this offset (if any) is of same size\n    // and type (see Checklayouts below).\n    if (access.byte_size && ((access.byte_size != byte_size) ||\n                             (access.type != type) || (access.align != align)))\n      access.is_uniform = false;\n    // Also exclude weird alignment accesses from structs.\n    if (!opc.IsNaturallyAligned(align))\n      access.is_uniform = false;\n    access.byte_size = byte_size;\n    access.type = type;\n    access.align = align;\n    // Additionally, check if all accesses are to the same type, so\n    // if layout check fails, we can at least declare it as pointer to\n    // a type.\n    if ((var.same_type == type || var.same_type == Type::Any) &&\n        (var.same_align == align || var.same_align == kInvalidAddress)) {\n      var.same_type = type;\n      var.same_align = align;\n      var.last_opc = opc;\n    } else {\n      var.same_type = Type::Void;\n      var.same_align = kInvalidAddress;\n    }\n  }\n\n  void CheckLayouts() {\n    // Here we check if the set of accesses we have collected form a sequence\n    // we could declare as a struct, meaning they are properly aligned,\n    // contiguous, and have no overlaps between different types and sizes.\n    // We do this because an int access of size 2 at offset 0 followed by\n    // a float access of size 4 at offset 4 can compactly represented as a\n    // struct { short, float }, whereas something that reads from overlapping\n    // or discontinuous offsets would need a more complicated syntax that\n    // involves explicit offsets.\n    // We assume that the bulk of memory accesses are of this very regular kind,\n    // so we choose not to even emit struct layouts for irregular ones,\n    // given that they are rare and confusing, and thus do not benefit from\n    // being represented as if they were structs.\n    for (auto& var : vars) {\n      if (var.second.accesses.size() == 1) {\n        // If we have just one access, this is better represented as a pointer\n        // than a struct.\n        var.second.struct_layout = false;\n        continue;\n      }\n      uint64_t cur_offset = 0;\n      uint32_t idx = 0;\n      for (auto& access : var.second.accesses) {\n        access.second.idx = idx++;\n        if (!access.second.is_uniform) {\n          var.second.struct_layout = false;\n          break;\n        }\n        // Align to next access: all elements are expected to be aligned to\n        // a memory address thats a multiple of their own size.\n        auto mask = static_cast<uint64_t>(access.second.byte_size - 1);\n        cur_offset = (cur_offset + mask) & ~mask;\n        if (cur_offset != access.first) {\n          var.second.struct_layout = false;\n          break;\n        }\n        cur_offset += access.second.byte_size;\n      }\n    }\n  }\n\n  std::string IdxToName(uint32_t idx) const {\n    return IndexToAlphaName(idx);  // TODO: more descriptive names?\n  }\n\n  std::string GenAlign(Address align, Opcode opc) const {\n    return opc.IsNaturallyAligned(align) ? \"\" : cat(\"@\", std::to_string(align));\n  }\n\n  std::string GenTypeDecl(const std::string& name) const {\n    auto it = vars.find(name);\n    if (it == vars.end()) {\n      return \"\";\n    }\n    if (it->second.struct_layout) {\n      std::string s = \"{ \";\n      for (auto& access : it->second.accesses) {\n        if (access.second.idx) {\n          s += \", \";\n        }\n        s += IdxToName(access.second.idx);\n        s += ':';\n        s += GetDecompTypeName(access.second.type);\n      }\n      s += \" }\";\n      return s;\n    }\n    // We don't have a struct layout, or the struct has just one field,\n    // so maybe we can just declare it as a pointer to one type?\n    if (it->second.same_type != Type::Void) {\n      return cat(GetDecompTypeName(it->second.same_type), \"_ptr\",\n                 GenAlign(it->second.same_align, it->second.last_opc));\n    }\n    return \"\";\n  }\n\n  std::string GenAccess(uint64_t offset, const Node& addr_exp) const {\n    auto name = AddrExpName(addr_exp);\n    if (name.empty()) {\n      return \"\";\n    }\n    auto it = vars.find(name);\n    if (it == vars.end()) {\n      return \"\";\n    }\n    if (it->second.struct_layout) {\n      auto ait = it->second.accesses.find(offset);\n      assert(ait != it->second.accesses.end());\n      return IdxToName(ait->second.idx);\n    }\n    // Not a struct, see if it is a typed pointer.\n    if (it->second.same_type != Type::Void) {\n      return \"*\";\n    }\n    return \"\";\n  }\n\n  void Clear() { vars.clear(); }\n\n  std::map<std::string, LSVar> vars;\n};\n\n}  // namespace wabt\n\n#endif  // WABT_DECOMPILER_LS_H_\n"
  },
  {
    "path": "include/wabt/decompiler-naming.h",
    "content": "/*\n * Copyright 2019 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_DECOMPILER_NAMING_H_\n#define WABT_DECOMPILER_NAMING_H_\n\n#include \"wabt/decompiler-ast.h\"\n\n#include <set>\n\nnamespace wabt {\n\ninline void RenameToIdentifier(std::string& name,\n                               Index i,\n                               BindingHash& bh,\n                               const std::set<std::string_view>* filter) {\n  // Filter out non-identifier characters, and try to reduce the size of\n  // gigantic C++ signature names.\n  std::string s;\n  size_t nesting = 0;\n  size_t read = 0;\n  size_t word_start = 0;\n  for (auto c : name) {\n    read++;\n    // We most certainly don't want to parse the entirety of C++ signatures,\n    // but these names are sometimes several lines long, so would be great\n    // to trim down. One quick way to do that is to remove anything between\n    // nested (), which usually means the parameter list.\n    if (c == '(') {\n      nesting++;\n    }\n    if (c == ')') {\n      nesting--;\n    }\n    if (nesting) {\n      continue;\n    }\n    if (!isalnum(static_cast<unsigned char>(c))) {\n      c = '_';\n    }\n    if (c == '_') {\n      if (s.empty()) {\n        continue;  // Skip leading.\n      }\n      if (s.back() == '_') {\n        continue;  // Consecutive.\n      }\n    }\n    s += c;\n    if (filter && (c == '_' || read == name.size())) {\n      // We found a \"word\" inside a snake_case identifier.\n      auto word_end = s.size();\n      if (c == '_') {\n        word_end--;\n      }\n      assert(word_end > word_start);\n      auto word =\n          std::string_view(s.c_str() + word_start, word_end - word_start);\n      if (filter->find(word) != filter->end()) {\n        s.resize(word_start);\n      }\n      word_start = s.size();\n    }\n  }\n  if (!s.empty() && s.back() == '_') {\n    s.pop_back();  // Trailing.\n  }\n  // If after all this culling, we're still gigantic (STL identifier can\n  // easily be hundreds of chars in size), just cut the identifier\n  // down, it will be disambiguated below, if needed.\n  const size_t max_identifier_length = 100;\n  if (s.size() > max_identifier_length) {\n    s.resize(max_identifier_length);\n  }\n  if (s.empty()) {\n    s = \"__empty\";\n  }\n  // Remove original binding first, such that it doesn't match with our\n  // new name.\n  bh.erase(name);\n  // Find a unique name.\n  Index disambiguator = 0;\n  auto base_len = s.size();\n  for (;;) {\n    if (bh.count(s) == 0) {\n      break;\n    }\n    disambiguator++;\n    s.resize(base_len);\n    s += '_';\n    s += std::to_string(disambiguator);\n  }\n  // Replace name in bindings.\n  name = s;\n  bh.emplace(s, Binding(i));\n}\n\ntemplate <typename T>\nvoid RenameToIdentifiers(std::vector<T*>& things,\n                         BindingHash& bh,\n                         const std::set<std::string_view>* filter) {\n  Index i = 0;\n  for (auto thing : things) {\n    RenameToIdentifier(thing->name, i++, bh, filter);\n  }\n}\n\nenum {\n  // This a bit arbitrary, change at will.\n  min_content_identifier_size = 7,\n  max_content_identifier_size = 30\n};\n\nvoid RenameToContents(std::vector<DataSegment*>& segs, BindingHash& bh) {\n  std::string s;\n  for (auto seg : segs) {\n    if (seg->name.substr(0, 2) != \"d_\") {\n      // This segment was named explicitly by a symbol.\n      // FIXME: this is not a great check, a symbol could start with d_.\n      continue;\n    }\n    s = \"d_\";\n    for (auto c : seg->data) {\n      if (isalnum(c) || c == '_') {\n        s += static_cast<char>(c);\n      }\n      if (s.size() >= max_content_identifier_size) {\n        // We truncate any very long names, since those make for hard to\n        // format output. They can be somewhat long though, since data segment\n        // references tend to not occur that often.\n        break;\n      }\n    }\n    if (s.size() < min_content_identifier_size) {\n      // It is useful to have a minimum, since if there few printable characters\n      // in a data section, that is probably a sign of binary, and those few\n      // characters are not going to be very significant.\n      continue;\n    }\n    // We could do the same disambiguition as RenameToIdentifier and\n    // GenerateNames do, but if we come up with a clashing name here it is\n    // likely a sign of not very meaningful binary data, so it is easier to\n    // just keep the original generated name in that case.\n    if (bh.count(s) != 0) {\n      continue;\n    }\n    // Remove original entry.\n    bh.erase(seg->name);\n    seg->name = s;\n    bh.emplace(s, Binding(static_cast<Index>(&seg - &segs[0])));\n  }\n}\n\n// Function names may contain arbitrary C++ syntax, so we want to\n// filter those to look like identifiers. A function name may be set\n// by a name section (applied in ReadBinaryIr, called before this function)\n// or by an export (applied by GenerateNames, called before this function),\n// to both the Func and func_bindings.\n// Those names then further perculate down the IR in ApplyNames (called after\n// this function).\n// To not have to add too many decompiler-specific code into those systems\n// (using a callback??) we instead rename everything here.\n// Also do data section renaming here.\nvoid RenameAll(Module& module) {\n  // We also filter common C++ keywords/STL idents that make for huge\n  // identifiers.\n  // FIXME: this can obviously give bad results if the input is not C++..\n  std::set<std::string_view> filter = {\n      {\"const\"},    {\"std\"},   {\"allocator\"}, {\"char\"},  {\"basic\"},\n      {\"traits\"},   {\"wchar\"}, {\"t\"},         {\"void\"},  {\"int\"},\n      {\"unsigned\"}, {\"2\"},     {\"cxxabiv1\"},  {\"short\"}, {\"4096ul\"},\n  };\n  RenameToIdentifiers(module.funcs, module.func_bindings, &filter);\n  // Also do this for some other kinds of names, but without the keyword\n  // substitution.\n  RenameToIdentifiers(module.globals, module.global_bindings, nullptr);\n  RenameToIdentifiers(module.tables, module.table_bindings, nullptr);\n  RenameToIdentifiers(module.tags, module.tag_bindings, nullptr);\n  RenameToIdentifiers(module.exports, module.export_bindings, nullptr);\n  RenameToIdentifiers(module.types, module.type_bindings, nullptr);\n  RenameToIdentifiers(module.memories, module.memory_bindings, nullptr);\n  RenameToIdentifiers(module.data_segments, module.data_segment_bindings,\n                      nullptr);\n  RenameToIdentifiers(module.elem_segments, module.elem_segment_bindings,\n                      nullptr);\n  // Special purpose naming for data segments.\n  RenameToContents(module.data_segments, module.data_segment_bindings);\n}\n\n}  // namespace wabt\n\n#endif  // WABT_DECOMPILER_NAMING_H_\n"
  },
  {
    "path": "include/wabt/decompiler.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_DECOMPILER_H_\n#define WABT_DECOMPILER_H_\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nstruct Module;\nclass Stream;\n\nstruct DecompileOptions {};\n\nvoid RenameAll(Module&);\n\nstd::string Decompile(const Module&, const DecompileOptions&);\n\n}  // namespace wabt\n\n#endif /* WABT_DECOMPILER_H_ */\n"
  },
  {
    "path": "include/wabt/error-formatter.h",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_ERROR_FORMATTER_H_\n#define WABT_ERROR_FORMATTER_H_\n\n#include <cstdio>\n#include <memory>\n#include <string>\n\n#include \"wabt/color.h\"\n#include \"wabt/error.h\"\n#include \"wabt/lexer-source-line-finder.h\"\n\nnamespace wabt {\n\nenum class PrintHeader {\n  Never,\n  Once,\n  Always,\n};\n\nstd::string FormatErrorsToString(const Errors&,\n                                 Location::Type,\n                                 LexerSourceLineFinder* = nullptr,\n                                 const Color& color = Color(nullptr, false),\n                                 const std::string& header = {},\n                                 PrintHeader print_header = PrintHeader::Never,\n                                 int source_line_max_length = 80);\n\nvoid FormatErrorsToFile(const Errors&,\n                        Location::Type,\n                        LexerSourceLineFinder* = nullptr,\n                        FILE* = stderr,\n                        const std::string& header = {},\n                        PrintHeader print_header = PrintHeader::Never,\n                        int source_line_max_length = 80);\n\n}  // namespace wabt\n\n#endif  // WABT_ERROR_FORMATTER_H_\n"
  },
  {
    "path": "include/wabt/error.h",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_ERROR_H_\n#define WABT_ERROR_H_\n\n#include <string>\n#include <string_view>\n#include <vector>\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nenum class ErrorLevel {\n  Warning,\n  Error,\n};\n\nstatic inline const char* GetErrorLevelName(ErrorLevel error_level) {\n  switch (error_level) {\n    case ErrorLevel::Warning:\n      return \"warning\";\n    case ErrorLevel::Error:\n      return \"error\";\n  }\n  WABT_UNREACHABLE;\n}\n\nclass Error {\n public:\n  Error() : error_level(ErrorLevel::Error) {}\n  Error(ErrorLevel error_level, Location loc, std::string_view message)\n      : error_level(error_level), loc(loc), message(message) {}\n\n  ErrorLevel error_level;\n  Location loc;\n  std::string message;\n};\n\nusing Errors = std::vector<Error>;\n\n}  // namespace wabt\n\n#endif  //  WABT_ERROR_H_\n"
  },
  {
    "path": "include/wabt/expr-visitor.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_EXPR_VISITOR_H_\n#define WABT_EXPR_VISITOR_H_\n\n#include \"wabt/common.h\"\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nclass ExprVisitor {\n public:\n  class Delegate;\n  class DelegateNop;\n\n  explicit ExprVisitor(Delegate* delegate);\n\n  Result VisitExpr(Expr*);\n  Result VisitExprList(ExprList&);\n  Result VisitFunc(Func*);\n\n private:\n  enum class State {\n    Default,\n    Block,\n    IfTrue,\n    IfFalse,\n    Loop,\n    Try,\n    TryTable,\n    Catch,\n  };\n\n  Result HandleDefaultState(Expr*);\n  void PushDefault(Expr*);\n  void PopDefault();\n  void PushExprlist(State state, Expr*, ExprList&);\n  void PopExprlist();\n  void PushCatch(Expr*, Index catch_index, ExprList&);\n  void PopCatch();\n\n  Delegate* delegate_;\n\n  // Use parallel arrays instead of array of structs so we can avoid allocating\n  // unneeded objects. ExprList::iterator has no default constructor, so it\n  // must only be allocated for states that use it.\n  std::vector<State> state_stack_;\n  std::vector<Expr*> expr_stack_;\n  std::vector<ExprList::iterator> expr_iter_stack_;\n  std::vector<Index> catch_index_stack_;\n};\n\nclass ExprVisitor::Delegate {\n public:\n  virtual ~Delegate() {}\n\n  virtual Result OnUnaryExpr(UnaryExpr*) = 0;\n  virtual Result OnBinaryExpr(BinaryExpr*) = 0;\n  virtual Result OnTernaryExpr(TernaryExpr*) = 0;\n  virtual Result OnQuaternaryExpr(QuaternaryExpr*) = 0;\n\n  virtual Result BeginBlockExpr(BlockExpr*) = 0;\n  virtual Result EndBlockExpr(BlockExpr*) = 0;\n  virtual Result OnBrExpr(BrExpr*) = 0;\n  virtual Result OnBrIfExpr(BrIfExpr*) = 0;\n  virtual Result OnBrOnNonNullExpr(BrOnNonNullExpr*) = 0;\n  virtual Result OnBrOnNullExpr(BrOnNullExpr*) = 0;\n  virtual Result OnBrTableExpr(BrTableExpr*) = 0;\n  virtual Result BeginTryTableExpr(TryTableExpr*) = 0;\n  virtual Result EndTryTableExpr(TryTableExpr*) = 0;\n  virtual Result OnCallExpr(CallExpr*) = 0;\n  virtual Result OnCallIndirectExpr(CallIndirectExpr*) = 0;\n  virtual Result OnCallRefExpr(CallRefExpr*) = 0;\n  virtual Result OnCodeMetadataExpr(CodeMetadataExpr*) = 0;\n  virtual Result OnCompareExpr(CompareExpr*) = 0;\n  virtual Result OnConstExpr(ConstExpr*) = 0;\n  virtual Result OnConvertExpr(ConvertExpr*) = 0;\n  virtual Result OnDropExpr(DropExpr*) = 0;\n  virtual Result OnGlobalGetExpr(GlobalGetExpr*) = 0;\n  virtual Result OnGlobalSetExpr(GlobalSetExpr*) = 0;\n  virtual Result BeginIfExpr(IfExpr*) = 0;\n  virtual Result AfterIfTrueExpr(IfExpr*) = 0;\n  virtual Result EndIfExpr(IfExpr*) = 0;\n  virtual Result OnLoadExpr(LoadExpr*) = 0;\n  virtual Result OnLocalGetExpr(LocalGetExpr*) = 0;\n  virtual Result OnLocalSetExpr(LocalSetExpr*) = 0;\n  virtual Result OnLocalTeeExpr(LocalTeeExpr*) = 0;\n  virtual Result BeginLoopExpr(LoopExpr*) = 0;\n  virtual Result EndLoopExpr(LoopExpr*) = 0;\n  virtual Result OnMemoryCopyExpr(MemoryCopyExpr*) = 0;\n  virtual Result OnDataDropExpr(DataDropExpr*) = 0;\n  virtual Result OnMemoryFillExpr(MemoryFillExpr*) = 0;\n  virtual Result OnMemoryGrowExpr(MemoryGrowExpr*) = 0;\n  virtual Result OnMemoryInitExpr(MemoryInitExpr*) = 0;\n  virtual Result OnMemorySizeExpr(MemorySizeExpr*) = 0;\n  virtual Result OnTableCopyExpr(TableCopyExpr*) = 0;\n  virtual Result OnElemDropExpr(ElemDropExpr*) = 0;\n  virtual Result OnTableInitExpr(TableInitExpr*) = 0;\n  virtual Result OnTableGetExpr(TableGetExpr*) = 0;\n  virtual Result OnTableSetExpr(TableSetExpr*) = 0;\n  virtual Result OnTableGrowExpr(TableGrowExpr*) = 0;\n  virtual Result OnTableSizeExpr(TableSizeExpr*) = 0;\n  virtual Result OnTableFillExpr(TableFillExpr*) = 0;\n  virtual Result OnRefAsNonNullExpr(RefAsNonNullExpr*) = 0;\n  virtual Result OnRefFuncExpr(RefFuncExpr*) = 0;\n  virtual Result OnRefNullExpr(RefNullExpr*) = 0;\n  virtual Result OnRefIsNullExpr(RefIsNullExpr*) = 0;\n  virtual Result OnNopExpr(NopExpr*) = 0;\n  virtual Result OnReturnExpr(ReturnExpr*) = 0;\n  virtual Result OnReturnCallExpr(ReturnCallExpr*) = 0;\n  virtual Result OnReturnCallIndirectExpr(ReturnCallIndirectExpr*) = 0;\n  virtual Result OnReturnCallRefExpr(ReturnCallRefExpr*) = 0;\n  virtual Result OnSelectExpr(SelectExpr*) = 0;\n  virtual Result OnStoreExpr(StoreExpr*) = 0;\n  virtual Result OnUnreachableExpr(UnreachableExpr*) = 0;\n  virtual Result BeginTryExpr(TryExpr*) = 0;\n  virtual Result OnCatchExpr(TryExpr*, Catch*) = 0;\n  virtual Result OnDelegateExpr(TryExpr*) = 0;\n  virtual Result EndTryExpr(TryExpr*) = 0;\n  virtual Result OnThrowExpr(ThrowExpr*) = 0;\n  virtual Result OnThrowRefExpr(ThrowRefExpr*) = 0;\n  virtual Result OnRethrowExpr(RethrowExpr*) = 0;\n  virtual Result OnAtomicWaitExpr(AtomicWaitExpr*) = 0;\n  virtual Result OnAtomicFenceExpr(AtomicFenceExpr*) = 0;\n  virtual Result OnAtomicNotifyExpr(AtomicNotifyExpr*) = 0;\n  virtual Result OnAtomicLoadExpr(AtomicLoadExpr*) = 0;\n  virtual Result OnAtomicStoreExpr(AtomicStoreExpr*) = 0;\n  virtual Result OnAtomicRmwExpr(AtomicRmwExpr*) = 0;\n  virtual Result OnAtomicRmwCmpxchgExpr(AtomicRmwCmpxchgExpr*) = 0;\n  virtual Result OnSimdLaneOpExpr(SimdLaneOpExpr*) = 0;\n  virtual Result OnSimdLoadLaneExpr(SimdLoadLaneExpr*) = 0;\n  virtual Result OnSimdStoreLaneExpr(SimdStoreLaneExpr*) = 0;\n  virtual Result OnSimdShuffleOpExpr(SimdShuffleOpExpr*) = 0;\n  virtual Result OnLoadSplatExpr(LoadSplatExpr*) = 0;\n  virtual Result OnLoadZeroExpr(LoadZeroExpr*) = 0;\n};\n\nclass ExprVisitor::DelegateNop : public ExprVisitor::Delegate {\n public:\n  Result OnUnaryExpr(UnaryExpr*) override { return Result::Ok; }\n  Result OnBinaryExpr(BinaryExpr*) override { return Result::Ok; }\n  Result OnTernaryExpr(TernaryExpr*) override { return Result::Ok; }\n  Result OnQuaternaryExpr(QuaternaryExpr*) override { return Result::Ok; }\n\n  Result BeginBlockExpr(BlockExpr*) override { return Result::Ok; }\n  Result EndBlockExpr(BlockExpr*) override { return Result::Ok; }\n  Result OnBrExpr(BrExpr*) override { return Result::Ok; }\n  Result OnBrIfExpr(BrIfExpr*) override { return Result::Ok; }\n  Result OnBrOnNonNullExpr(BrOnNonNullExpr*) override { return Result::Ok; };\n  Result OnBrOnNullExpr(BrOnNullExpr*) override { return Result::Ok; };\n  Result OnBrTableExpr(BrTableExpr*) override { return Result::Ok; }\n  Result BeginTryTableExpr(TryTableExpr*) override { return Result::Ok; }\n  Result EndTryTableExpr(TryTableExpr*) override { return Result::Ok; }\n  Result OnCallExpr(CallExpr*) override { return Result::Ok; }\n  Result OnCallIndirectExpr(CallIndirectExpr*) override { return Result::Ok; }\n  Result OnCallRefExpr(CallRefExpr*) override { return Result::Ok; }\n  Result OnCodeMetadataExpr(CodeMetadataExpr*) override { return Result::Ok; }\n  Result OnCompareExpr(CompareExpr*) override { return Result::Ok; }\n  Result OnConstExpr(ConstExpr*) override { return Result::Ok; }\n  Result OnConvertExpr(ConvertExpr*) override { return Result::Ok; }\n  Result OnDropExpr(DropExpr*) override { return Result::Ok; }\n  Result OnGlobalGetExpr(GlobalGetExpr*) override { return Result::Ok; }\n  Result OnGlobalSetExpr(GlobalSetExpr*) override { return Result::Ok; }\n  Result BeginIfExpr(IfExpr*) override { return Result::Ok; }\n  Result AfterIfTrueExpr(IfExpr*) override { return Result::Ok; }\n  Result EndIfExpr(IfExpr*) override { return Result::Ok; }\n  Result OnLoadExpr(LoadExpr*) override { return Result::Ok; }\n  Result OnLocalGetExpr(LocalGetExpr*) override { return Result::Ok; }\n  Result OnLocalSetExpr(LocalSetExpr*) override { return Result::Ok; }\n  Result OnLocalTeeExpr(LocalTeeExpr*) override { return Result::Ok; }\n  Result BeginLoopExpr(LoopExpr*) override { return Result::Ok; }\n  Result EndLoopExpr(LoopExpr*) override { return Result::Ok; }\n  Result OnMemoryCopyExpr(MemoryCopyExpr*) override { return Result::Ok; }\n  Result OnDataDropExpr(DataDropExpr*) override { return Result::Ok; }\n  Result OnMemoryFillExpr(MemoryFillExpr*) override { return Result::Ok; }\n  Result OnMemoryGrowExpr(MemoryGrowExpr*) override { return Result::Ok; }\n  Result OnMemoryInitExpr(MemoryInitExpr*) override { return Result::Ok; }\n  Result OnMemorySizeExpr(MemorySizeExpr*) override { return Result::Ok; }\n  Result OnTableCopyExpr(TableCopyExpr*) override { return Result::Ok; }\n  Result OnElemDropExpr(ElemDropExpr*) override { return Result::Ok; }\n  Result OnTableInitExpr(TableInitExpr*) override { return Result::Ok; }\n  Result OnTableGetExpr(TableGetExpr*) override { return Result::Ok; }\n  Result OnTableSetExpr(TableSetExpr*) override { return Result::Ok; }\n  Result OnTableGrowExpr(TableGrowExpr*) override { return Result::Ok; }\n  Result OnTableSizeExpr(TableSizeExpr*) override { return Result::Ok; }\n  Result OnTableFillExpr(TableFillExpr*) override { return Result::Ok; }\n  Result OnRefAsNonNullExpr(RefAsNonNullExpr*) override { return Result::Ok; }\n  Result OnRefFuncExpr(RefFuncExpr*) override { return Result::Ok; }\n  Result OnRefNullExpr(RefNullExpr*) override { return Result::Ok; }\n  Result OnRefIsNullExpr(RefIsNullExpr*) override { return Result::Ok; }\n  Result OnNopExpr(NopExpr*) override { return Result::Ok; }\n  Result OnReturnExpr(ReturnExpr*) override { return Result::Ok; }\n  Result OnReturnCallExpr(ReturnCallExpr*) override { return Result::Ok; }\n  Result OnReturnCallIndirectExpr(ReturnCallIndirectExpr*) override {\n    return Result::Ok;\n  }\n  Result OnReturnCallRefExpr(ReturnCallRefExpr*) override { return Result::Ok; }\n  Result OnSelectExpr(SelectExpr*) override { return Result::Ok; }\n  Result OnStoreExpr(StoreExpr*) override { return Result::Ok; }\n  Result OnUnreachableExpr(UnreachableExpr*) override { return Result::Ok; }\n  Result BeginTryExpr(TryExpr*) override { return Result::Ok; }\n  Result OnCatchExpr(TryExpr*, Catch*) override { return Result::Ok; }\n  Result OnDelegateExpr(TryExpr*) override { return Result::Ok; }\n  Result EndTryExpr(TryExpr*) override { return Result::Ok; }\n  Result OnThrowExpr(ThrowExpr*) override { return Result::Ok; }\n  Result OnThrowRefExpr(ThrowRefExpr*) override { return Result::Ok; }\n  Result OnRethrowExpr(RethrowExpr*) override { return Result::Ok; }\n  Result OnAtomicWaitExpr(AtomicWaitExpr*) override { return Result::Ok; }\n  Result OnAtomicFenceExpr(AtomicFenceExpr*) override { return Result::Ok; }\n  Result OnAtomicNotifyExpr(AtomicNotifyExpr*) override { return Result::Ok; }\n  Result OnAtomicLoadExpr(AtomicLoadExpr*) override { return Result::Ok; }\n  Result OnAtomicStoreExpr(AtomicStoreExpr*) override { return Result::Ok; }\n  Result OnAtomicRmwExpr(AtomicRmwExpr*) override { return Result::Ok; }\n  Result OnAtomicRmwCmpxchgExpr(AtomicRmwCmpxchgExpr*) override {\n    return Result::Ok;\n  }\n  Result OnSimdLaneOpExpr(SimdLaneOpExpr*) override { return Result::Ok; }\n  Result OnSimdLoadLaneExpr(SimdLoadLaneExpr*) override { return Result::Ok; }\n  Result OnSimdStoreLaneExpr(SimdStoreLaneExpr*) override { return Result::Ok; }\n  Result OnSimdShuffleOpExpr(SimdShuffleOpExpr*) override { return Result::Ok; }\n  Result OnLoadSplatExpr(LoadSplatExpr*) override { return Result::Ok; }\n  Result OnLoadZeroExpr(LoadZeroExpr*) override { return Result::Ok; }\n};\n\n}  // namespace wabt\n\n#endif  // WABT_EXPR_VISITOR_H_\n"
  },
  {
    "path": "include/wabt/feature.def",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_FEATURE\n#error \"You must define WABT_FEATURE before including this file.\"\n#endif\n\n/*\n *           variable          flag                       default  help\n * ========================================================================= */\n\nWABT_FEATURE(exceptions,          \"exceptions\",              false,   \"Experimental exception handling\")\nWABT_FEATURE(mutable_globals,     \"mutable-globals\",         true,    \"Import/export mutable globals\")\nWABT_FEATURE(sat_float_to_int,    \"saturating-float-to-int\", true,    \"Saturating float-to-int operators\")\nWABT_FEATURE(sign_extension,      \"sign-extension\",          true,    \"Sign-extension operators\")\nWABT_FEATURE(simd,                \"simd\",                    true,    \"SIMD support\")\nWABT_FEATURE(threads,             \"threads\",                 false,   \"Threading support\")\nWABT_FEATURE(function_references, \"function-references\",     false,   \"Typed function references\")\nWABT_FEATURE(multi_value,         \"multi-value\",             true,    \"Multi-value\")\nWABT_FEATURE(tail_call,           \"tail-call\",               false,   \"Tail-call support\")\nWABT_FEATURE(bulk_memory,         \"bulk-memory\",             true,    \"Bulk-memory operations\")\nWABT_FEATURE(reference_types,     \"reference-types\",         true,    \"Reference types (externref)\")\nWABT_FEATURE(annotations,         \"annotations\",             false,   \"Custom annotation syntax\")\nWABT_FEATURE(code_metadata,       \"code-metadata\",           false,   \"Code metadata\")\nWABT_FEATURE(gc,                  \"gc\",                      false,   \"Garbage collection\")\nWABT_FEATURE(memory64,            \"memory64\",                false,   \"64-bit memory\")\nWABT_FEATURE(multi_memory,        \"multi-memory\",            false,   \"Multi-memory\")\nWABT_FEATURE(extended_const,      \"extended-const\",          false,   \"Extended constant expressions\")\nWABT_FEATURE(relaxed_simd,        \"relaxed-simd\",            false,   \"Relaxed SIMD\")\nWABT_FEATURE(custom_page_sizes,   \"custom-page-sizes\",       false,   \"Custom page sizes\")\nWABT_FEATURE(compact_imports,     \"compact-imports\",         false,   \"Compact import section\")\nWABT_FEATURE(wide_arithmetic,     \"wide-arithmetic\",         false,   \"Wide arithmetic\")\n"
  },
  {
    "path": "include/wabt/feature.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_FEATURE_H_\n#define WABT_FEATURE_H_\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nclass OptionParser;\n\nclass Features {\n public:\n  void AddOptions(OptionParser*);\n\n  void EnableAll() {\n#define WABT_FEATURE(variable, flag, default_, help) enable_##variable();\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n  }\n\n#define WABT_FEATURE(variable, flag, default_, help)              \\\n  bool variable##_enabled() const { return variable##_enabled_; } \\\n  void enable_##variable() { set_##variable##_enabled(true); }    \\\n  void disable_##variable() { set_##variable##_enabled(false); }  \\\n  void set_##variable##_enabled(bool value) {                     \\\n    variable##_enabled_ = value;                                  \\\n    UpdateDependencies();                                         \\\n  }\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n\n private:\n  void UpdateDependencies();\n\n#define WABT_FEATURE(variable, flag, default_, help) \\\n  bool variable##_enabled_ = default_;\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n};\n\n}  // namespace wabt\n\n#endif  // WABT_FEATURE_H_\n"
  },
  {
    "path": "include/wabt/filenames.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_FILENAMES_H_\n#define WABT_FILENAMES_H_\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nextern const char* kWasmExtension;\nextern const char* kWatExtension;\n\n// Return only the file extension, e.g.:\n//\n// \"foo.txt\", => \".txt\"\n// \"foo\" => \"\"\n// \"/foo/bar/foo.wasm\" => \".wasm\"\nstd::string_view GetExtension(std::string_view filename);\n\n// Strip extension, e.g.:\n//\n// \"foo\", => \"foo\"\n// \"foo.bar\" => \"foo\"\n// \"/path/to/foo.bar\" => \"/path/to/foo\"\n// \"\\\\path\\\\to\\\\foo.bar\" => \"\\\\path\\\\to\\\\foo\"\nstd::string_view StripExtension(std::string_view s);\n\n// Strip everything up to and including the last slash, e.g.:\n//\n// \"/foo/bar/baz\", => \"baz\"\n// \"/usr/local/include/stdio.h\", => \"stdio.h\"\n// \"foo.bar\", => \"foo.bar\"\nstd::string_view GetBasename(std::string_view filename);\n\n}  // namespace wabt\n\n#endif /* WABT_FILENAMES_H_ */\n"
  },
  {
    "path": "include/wabt/generate-names.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_GENERATE_NAMES_H_\n#define WABT_GENERATE_NAMES_H_\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nstruct Module;\n\nenum NameOpts {\n  None = 0,\n  AlphaNames = 1 << 0,\n};\n\nResult GenerateNames(struct Module*, NameOpts opts = NameOpts::None);\n\ninline std::string IndexToAlphaName(Index index) {\n  std::string s;\n  do {\n    // For multiple chars, put most frequently changing char first.\n    s += 'a' + (index % 26);\n    index /= 26;\n    // Continue remaining sequence with 'a' rather than 'b'.\n  } while (index--);\n  return s;\n}\n\n}  // namespace wabt\n\n#endif /* WABT_GENERATE_NAMES_H_ */\n"
  },
  {
    "path": "include/wabt/interp/binary-reader-interp.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_BINARY_READER_INTERP_H_\n#define WABT_BINARY_READER_INTERP_H_\n\n#include \"wabt/common.h\"\n#include \"wabt/error.h\"\n#include \"wabt/interp/interp.h\"\n\nnamespace wabt {\n\nstruct ReadBinaryOptions;\n\nnamespace interp {\n\nResult ReadBinaryInterp(std::string_view filename,\n                        const void* data,\n                        size_t size,\n                        const ReadBinaryOptions& options,\n                        Errors*,\n                        ModuleDesc* out_module);\n\n}  // namespace interp\n}  // namespace wabt\n\n#endif /* WABT_BINARY_READER_INTERP_H_ */\n"
  },
  {
    "path": "include/wabt/interp/interp-inl.h",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <limits>\n#include <string>\n\nnamespace wabt {\nnamespace interp {\n\n//// Ref ////\ninline Ref::Ref(size_t index) : index(index) {}\n\ninline bool operator==(Ref lhs, Ref rhs) {\n  return lhs.index == rhs.index;\n}\n\ninline bool operator!=(Ref lhs, Ref rhs) {\n  return lhs.index != rhs.index;\n}\n\n//// ExternType ////\ninline ExternType::ExternType(ExternKind kind) : kind(kind) {}\n\n//// FuncType ////\n// static\ninline bool FuncType::classof(const ExternType* type) {\n  return type->kind == skind;\n}\n\ninline FuncType::FuncType(ValueTypes params, ValueTypes results)\n    : ExternType(ExternKind::Func), params(params), results(results), func_types(nullptr) {}\n\n//// TableType ////\n// static\ninline bool TableType::classof(const ExternType* type) {\n  return type->kind == skind;\n}\n\ninline TableType::TableType(ValueType element, Limits limits)\n    : ExternType(ExternKind::Table), element(element), limits(limits) {\n  // Always set max.\n  if (!limits.has_max) {\n    this->limits.max = std::numeric_limits<u32>::max();\n  }\n}\n\n//// MemoryType ////\n// static\ninline bool MemoryType::classof(const ExternType* type) {\n  return type->kind == skind;\n}\n\ninline MemoryType::MemoryType(Limits limits, uint32_t page_size)\n    : ExternType(ExternKind::Memory), limits(limits), page_size(page_size) {\n  // Always set max.\n  if (!limits.has_max) {\n    this->limits.max = WABT_BYTES_TO_MIN_PAGES(\n        (limits.is_64 ? UINT64_MAX : UINT32_MAX), page_size);\n  }\n}\n\n//// GlobalType ////\n// static\ninline bool GlobalType::classof(const ExternType* type) {\n  return type->kind == skind;\n}\n\ninline GlobalType::GlobalType(ValueType type, Mutability mut)\n    : ExternType(ExternKind::Global), type(type), mut(mut) {}\n\n//// TagType ////\n// static\ninline bool TagType::classof(const ExternType* type) {\n  return type->kind == skind;\n}\n\ninline TagType::TagType(TagAttr attr, const ValueTypes& signature)\n    : ExternType(ExternKind::Tag), attr(attr), signature(signature) {}\n\n//// ImportType ////\ninline ImportType::ImportType(std::string module,\n                              std::string name,\n                              std::unique_ptr<ExternType> type)\n    : module(module), name(name), type(std::move(type)) {}\n\ninline ImportType::ImportType(const ImportType& other)\n    : module(other.module), name(other.name), type(other.type->Clone()) {}\n\ninline ImportType& ImportType::operator=(const ImportType& other) {\n  if (this != &other) {\n    module = other.module;\n    name = other.name;\n    type = other.type->Clone();\n  }\n  return *this;\n}\n\n//// ExportType ////\ninline ExportType::ExportType(std::string name,\n                              std::unique_ptr<ExternType> type)\n    : name(name), type(std::move(type)) {}\n\ninline ExportType::ExportType(const ExportType& other)\n    : name(other.name), type(other.type->Clone()) {}\n\ninline ExportType& ExportType::operator=(const ExportType& other) {\n  if (this != &other) {\n    name = other.name;\n    type = other.type->Clone();\n  }\n  return *this;\n}\n\n//// Frame ////\ninline Frame::Frame(Ref func,\n                    u32 values,\n                    u32 exceptions,\n                    u32 offset,\n                    Instance* inst,\n                    Module* mod)\n    : func(func),\n      values(values),\n      exceptions(exceptions),\n      offset(offset),\n      inst(inst),\n      mod(mod) {}\n\n//// FreeList ////\ntemplate <>\ninline bool FreeList<Ref>::IsUsed(Index index) const {\n  return (list_[index].index & refFreeBit) == 0;\n}\n\ntemplate <>\ninline FreeList<Ref>::~FreeList() {}\n\ntemplate <>\ntemplate <typename... Args>\nauto FreeList<Ref>::New(Args&&... args) -> Index {\n  if (free_head_ == 0) {\n    list_.push_back(Ref(std::forward<Args>(args)...));\n    return list_.size() - 1;\n  }\n\n  Index index = free_head_ - 1;\n\n  assert(!IsUsed(index));\n  assert(free_items_ > 0);\n\n  free_head_ = list_[index].index & (refFreeBit - 1);\n  list_[index] = Ref(std::forward<Args>(args)...);\n  free_items_--;\n  return index;\n}\n\ntemplate <>\ninline void FreeList<Ref>::Delete(Index index) {\n  assert(IsUsed(index));\n\n  list_[index].index = free_head_ | refFreeBit;\n  free_head_ = index + 1;\n  free_items_++;\n}\n\ntemplate <typename T>\nbool FreeList<T>::IsUsed(Index index) const {\n  return (reinterpret_cast<uintptr_t>(list_[index]) & ptrFreeBit) == 0;\n}\n\ntemplate <typename T>\nFreeList<T>::~FreeList() {\n  for (auto object : list_) {\n    if ((reinterpret_cast<uintptr_t>(object) & ptrFreeBit) == 0) {\n      delete object;\n    }\n  }\n}\n\ntemplate <typename T>\ntemplate <typename... Args>\nauto FreeList<T>::New(Args&&... args) -> Index {\n  if (free_head_ == 0) {\n    list_.push_back(T(std::forward<Args>(args)...));\n    return list_.size() - 1;\n  }\n\n  Index index = free_head_ - 1;\n\n  assert(!IsUsed(index));\n  assert(free_items_ > 0);\n\n  free_head_ = reinterpret_cast<uintptr_t>(list_[index]) >> ptrFreeShift;\n  list_[index] = T(std::forward<Args>(args)...);\n  free_items_--;\n  return index;\n}\n\ntemplate <typename T>\nvoid FreeList<T>::Delete(Index index) {\n  assert(IsUsed(index));\n\n  delete list_[index];\n  list_[index] = reinterpret_cast<T>((free_head_ << ptrFreeShift) | ptrFreeBit);\n  free_head_ = index + 1;\n  free_items_++;\n}\n\ntemplate <typename T>\nconst T& FreeList<T>::Get(Index index) const {\n  assert(IsUsed(index));\n  return list_[index];\n}\n\ntemplate <typename T>\nT& FreeList<T>::Get(Index index) {\n  assert(IsUsed(index));\n  return list_[index];\n}\n\ntemplate <typename T>\nauto FreeList<T>::size() const -> Index {\n  return list_.size();\n}\n\ntemplate <typename T>\nauto FreeList<T>::count() const -> Index {\n  return list_.size() - free_items_;\n}\n\n//// RefPtr ////\ntemplate <typename T>\nRefPtr<T>::RefPtr() : obj_(nullptr), store_(nullptr), root_index_(0) {}\n\ntemplate <typename T>\nRefPtr<T>::RefPtr(Store& store, Ref ref) {\n#ifndef NDEBUG\n  if (!store.Is<T>(ref)) {\n    ObjectKind ref_kind;\n    if (ref == Ref::Null) {\n      ref_kind = ObjectKind::Null;\n    } else {\n      ref_kind = store.objects_.Get(ref.index)->kind();\n    }\n    fprintf(stderr, \"Invalid conversion from Ref (%s) to RefPtr<%s>!\\n\",\n            GetName(ref_kind), T::GetTypeName());\n    abort();\n  }\n#endif\n  root_index_ = store.NewRoot(ref);\n  obj_ = static_cast<T*>(store.objects_.Get(ref.index));\n  store_ = &store;\n}\n\ntemplate <typename T>\nRefPtr<T>::RefPtr(const RefPtr& other)\n    : obj_(other.obj_), store_(other.store_) {\n  root_index_ = store_ ? store_->CopyRoot(other.root_index_) : 0;\n}\n\ntemplate <typename T>\nRefPtr<T>& RefPtr<T>::operator=(const RefPtr& other) {\n  if (this == &other) return *this;\n  reset();\n  obj_ = other.obj_;\n  store_ = other.store_;\n  root_index_ = store_ ? store_->CopyRoot(other.root_index_) : 0;\n  return *this;\n}\n\ntemplate <typename T>\nRefPtr<T>::RefPtr(RefPtr&& other)\n    : obj_(other.obj_), store_(other.store_), root_index_(other.root_index_) {\n  other.obj_ = nullptr;\n  other.store_ = nullptr;\n  other.root_index_ = 0;\n}\n\ntemplate <typename T>\nRefPtr<T>& RefPtr<T>::operator=(RefPtr&& other) {\n  if (this == &other) return *this;\n  reset();\n  obj_ = other.obj_;\n  store_ = other.store_;\n  root_index_ = other.root_index_;\n  other.obj_ = nullptr;\n  other.store_ = nullptr;\n  other.root_index_ = 0;\n  return *this;\n}\n\ntemplate <typename T>\nRefPtr<T>::~RefPtr() {\n  reset();\n}\n\ntemplate <typename T>\ntemplate <typename U>\nRefPtr<T>::RefPtr(const RefPtr<U>& other)\n    : obj_(other.obj_), store_(other.store_) {\n  root_index_ = store_ ? store_->CopyRoot(other.root_index_) : 0;\n}\n\ntemplate <typename T>\ntemplate <typename U>\nRefPtr<T>& RefPtr<T>::operator=(const RefPtr<U>& other) {\n  assert(static_cast<const void*>(this) != static_cast<const void*>(&other));\n  reset();\n  obj_ = other.obj_;\n  store_ = other.store_;\n  root_index_ = store_ ? store_->CopyRoot(other.root_index_) : 0;\n  return *this;\n}\n\ntemplate <typename T>\ntemplate <typename U>\nRefPtr<T>::RefPtr(RefPtr&& other)\n    : obj_(other.obj_), store_(other.store_), root_index_(other.root_index_) {\n  other.obj_ = nullptr;\n  other.store_ = nullptr;\n  other.root_index_ = 0;\n}\n\ntemplate <typename T>\ntemplate <typename U>\nRefPtr<T>& RefPtr<T>::operator=(RefPtr&& other) {\n  assert(static_cast<const void*>(this) != static_cast<const void*>(&other));\n  reset();\n  obj_ = other.obj_;\n  store_ = other.store_;\n  root_index_ = other.root_index_;\n  other.obj_ = nullptr;\n  other.store_ = nullptr;\n  other.root_index_ = 0;\n  return *this;\n}\n\ntemplate <typename T>\ntemplate <typename U>\nRefPtr<U> RefPtr<T>::As() {\n  static_assert(std::is_base_of<T, U>::value, \"T must be base class of U\");\n  assert(store_->Is<U>(obj_->self()));\n  RefPtr<U> result;\n  result.obj_ = static_cast<U*>(obj_);\n  result.store_ = store_;\n  result.root_index_ = store_->CopyRoot(root_index_);\n  return result;\n}\n\ntemplate <typename T>\nbool RefPtr<T>::empty() const {\n  return obj_ == nullptr;\n}\n\ntemplate <typename T>\nvoid RefPtr<T>::reset() {\n  if (obj_) {\n    store_->DeleteRoot(root_index_);\n    obj_ = nullptr;\n    root_index_ = 0;\n    store_ = nullptr;\n  }\n}\n\ntemplate <typename T>\nT* RefPtr<T>::get() const {\n  return obj_;\n}\n\ntemplate <typename T>\nT* RefPtr<T>::operator->() const {\n  return obj_;\n}\n\ntemplate <typename T>\nT& RefPtr<T>::operator*() const {\n  return *obj_;\n}\n\ntemplate <typename T>\nRefPtr<T>::operator bool() const {\n  return obj_ != nullptr;\n}\n\ntemplate <typename T>\nRef RefPtr<T>::ref() const {\n  return store_ ? store_->roots_.Get(root_index_) : Ref::Null;\n}\n\ntemplate <typename T>\nStore* RefPtr<T>::store() const {\n  return store_;\n}\n\ntemplate <typename U, typename V>\nbool operator==(const RefPtr<U>& lhs, const RefPtr<V>& rhs) {\n  return lhs.obj_->self() == rhs.obj_->self();\n}\n\ntemplate <typename U, typename V>\nbool operator!=(const RefPtr<U>& lhs, const RefPtr<V>& rhs) {\n  return lhs.obj_->self() != rhs.obj_->self();\n}\n\n//// ValueType ////\ninline bool IsReference(ValueType type) { return type.IsRef(); }\ntemplate <> inline bool HasType<s32>(ValueType type) { return type == ValueType::I32; }\ntemplate <> inline bool HasType<u32>(ValueType type) { return type == ValueType::I32; }\ntemplate <> inline bool HasType<s64>(ValueType type) { return type == ValueType::I64; }\ntemplate <> inline bool HasType<u64>(ValueType type) { return type == ValueType::I64; }\ntemplate <> inline bool HasType<f32>(ValueType type) { return type == ValueType::F32; }\ntemplate <> inline bool HasType<f64>(ValueType type) { return type == ValueType::F64; }\ntemplate <> inline bool HasType<Ref>(ValueType type) { return IsReference(type); }\n\ntemplate <typename T>\nvoid RequireType(ValueType type) {\n  assert(HasType<T>(type));\n}\n\n//// Value ////\ninline Value WABT_VECTORCALL Value::Make(s32 val) { Value res; res.i32_ = val; res.SetType(ValueType::I32); return res; }\ninline Value WABT_VECTORCALL Value::Make(u32 val) { Value res; res.i32_ = val; res.SetType(ValueType::I32); return res; }\ninline Value WABT_VECTORCALL Value::Make(s64 val) { Value res; res.i64_ = val; res.SetType(ValueType::I64); return res; }\ninline Value WABT_VECTORCALL Value::Make(u64 val) { Value res; res.i64_ = val; res.SetType(ValueType::I64); return res; }\ninline Value WABT_VECTORCALL Value::Make(f32 val) { Value res; res.f32_ = val; res.SetType(ValueType::F32); return res; }\ninline Value WABT_VECTORCALL Value::Make(f64 val) { Value res; res.f64_ = val; res.SetType(ValueType::F64); return res; }\ninline Value WABT_VECTORCALL Value::Make(v128 val) { Value res; res.v128_ = val; res.SetType(ValueType::V128); return res; }\ninline Value WABT_VECTORCALL Value::Make(Ref val) { Value res; res.ref_ = val; res.SetType(ValueType::ExternRef); return res; }\ntemplate <typename T, u8 L>\nValue WABT_VECTORCALL Value::Make(Simd<T, L> val) {\n  Value res;\n  res.v128_ = Bitcast<v128>(val);\n  res.SetType(ValueType::V128);\n  return res;\n}\n\ntemplate <> inline s8 WABT_VECTORCALL Value::Get<s8>() const { CheckType(ValueType::I32); return i32_; }\ntemplate <> inline u8 WABT_VECTORCALL Value::Get<u8>() const { CheckType(ValueType::I32); return i32_; }\ntemplate <> inline s16 WABT_VECTORCALL Value::Get<s16>() const { CheckType(ValueType::I32); return i32_; }\ntemplate <> inline u16 WABT_VECTORCALL Value::Get<u16>() const { CheckType(ValueType::I32); return i32_; }\ntemplate <> inline s32 WABT_VECTORCALL Value::Get<s32>() const { CheckType(ValueType::I32); return i32_; }\ntemplate <> inline u32 WABT_VECTORCALL Value::Get<u32>() const { CheckType(ValueType::I32); return i32_; }\ntemplate <> inline s64 WABT_VECTORCALL Value::Get<s64>() const { CheckType(ValueType::I64); return i64_; }\ntemplate <> inline u64 WABT_VECTORCALL Value::Get<u64>() const { CheckType(ValueType::I64); return i64_; }\ntemplate <> inline f32 WABT_VECTORCALL Value::Get<f32>() const { CheckType(ValueType::F32); return f32_; }\ntemplate <> inline f64 WABT_VECTORCALL Value::Get<f64>() const { CheckType(ValueType::F64); return f64_; }\ntemplate <> inline v128 WABT_VECTORCALL Value::Get<v128>() const { CheckType(ValueType::V128); return v128_; }\ntemplate <> inline Ref WABT_VECTORCALL Value::Get<Ref>() const { CheckType(ValueType::ExternRef); return ref_; }\n\ntemplate <> inline s8x16 WABT_VECTORCALL Value::Get<s8x16>() const { CheckType(ValueType::V128); return Bitcast<s8x16>(v128_); }\ntemplate <> inline u8x16 WABT_VECTORCALL Value::Get<u8x16>() const { CheckType(ValueType::V128); return Bitcast<u8x16>(v128_); }\ntemplate <> inline s16x8 WABT_VECTORCALL Value::Get<s16x8>() const { CheckType(ValueType::V128); return Bitcast<s16x8>(v128_); }\ntemplate <> inline u16x8 WABT_VECTORCALL Value::Get<u16x8>() const { CheckType(ValueType::V128); return Bitcast<u16x8>(v128_); }\ntemplate <> inline s32x4 WABT_VECTORCALL Value::Get<s32x4>() const { CheckType(ValueType::V128); return Bitcast<s32x4>(v128_); }\ntemplate <> inline u32x4 WABT_VECTORCALL Value::Get<u32x4>() const { CheckType(ValueType::V128); return Bitcast<u32x4>(v128_); }\ntemplate <> inline s64x2 WABT_VECTORCALL Value::Get<s64x2>() const { CheckType(ValueType::V128); return Bitcast<s64x2>(v128_); }\ntemplate <> inline u64x2 WABT_VECTORCALL Value::Get<u64x2>() const { CheckType(ValueType::V128); return Bitcast<u64x2>(v128_); }\ntemplate <> inline f32x4 WABT_VECTORCALL Value::Get<f32x4>() const { CheckType(ValueType::V128); return Bitcast<f32x4>(v128_); }\ntemplate <> inline f64x2 WABT_VECTORCALL Value::Get<f64x2>() const { CheckType(ValueType::V128); return Bitcast<f64x2>(v128_); }\n\ntemplate <> inline void WABT_VECTORCALL Value::Set<s32>(s32 val) { i32_ = val; SetType(ValueType::I32); }\ntemplate <> inline void WABT_VECTORCALL Value::Set<u32>(u32 val) { i32_ = val; SetType(ValueType::I32); }\ntemplate <> inline void WABT_VECTORCALL Value::Set<s64>(s64 val) { i64_ = val; SetType(ValueType::I64); }\ntemplate <> inline void WABT_VECTORCALL Value::Set<u64>(u64 val) { i64_ = val; SetType(ValueType::I64); }\ntemplate <> inline void WABT_VECTORCALL Value::Set<f32>(f32 val) { f32_ = val; SetType(ValueType::F32); }\ntemplate <> inline void WABT_VECTORCALL Value::Set<f64>(f64 val) { f64_ = val; SetType(ValueType::F64); }\ntemplate <> inline void WABT_VECTORCALL Value::Set<v128>(v128 val) { v128_ = val; SetType(ValueType::V128); }\ntemplate <> inline void WABT_VECTORCALL Value::Set<Ref>(Ref val) { ref_ = val; SetType(ValueType::ExternRef); }\n\n//// Store ////\ninline bool Store::IsValid(Ref ref) const {\n  return objects_.IsUsed(ref.index) && objects_.Get(ref.index);\n}\n\ntemplate <typename T>\nbool Store::Is(Ref ref) const {\n  return objects_.IsUsed(ref.index) && isa<T>(objects_.Get(ref.index));\n}\n\ntemplate <typename T>\nResult Store::Get(Ref ref, RefPtr<T>* out) {\n  if (Is<T>(ref)) {\n    *out = RefPtr<T>(*this, ref);\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\ntemplate <typename T>\nRefPtr<T> Store::UnsafeGet(Ref ref) {\n  return RefPtr<T>(*this, ref);\n}\n\ntemplate <typename T, typename... Args>\nRefPtr<T> Store::Alloc(Args&&... args) {\n  Ref ref{objects_.New(new T(std::forward<Args>(args)...))};\n  RefPtr<T> ptr{*this, ref};\n  ptr->self_ = ref;\n  return ptr;\n}\n\ninline Store::ObjectList::Index Store::object_count() const {\n  return objects_.count();\n}\n\ninline const Features& Store::features() const {\n  return features_;\n}\n\ninline std::set<Thread*>& Store::threads() {\n  return threads_;\n}\n\n//// Object ////\n// static\ninline bool Object::classof(const Object* obj) {\n  return true;\n}\n\ninline Object::Object(ObjectKind kind) : kind_(kind) {}\n\ninline ObjectKind Object::kind() const {\n  return kind_;\n}\n\ninline Ref Object::self() const {\n  return self_;\n}\n\ninline void* Object::host_info() const {\n  return host_info_;\n}\n\ninline void Object::set_host_info(void* host_info) {\n  host_info_ = host_info;\n}\n\ninline Finalizer Object::get_finalizer() const {\n  return finalizer_;\n}\n\ninline void Object::set_finalizer(Finalizer finalizer) {\n  finalizer_ = finalizer;\n}\n\n//// Foreign ////\n// static\ninline bool Foreign::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline Foreign::Ptr Foreign::New(Store& store, void* ptr) {\n  return store.Alloc<Foreign>(store, ptr);\n}\n\ninline void* Foreign::ptr() {\n  return ptr_;\n}\n\n//// Trap ////\n// static\ninline bool Trap::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline Trap::Ptr Trap::New(Store& store,\n                           const std::string& msg,\n                           const std::vector<Frame>& trace) {\n  return store.Alloc<Trap>(store, msg, trace);\n}\n\ninline std::string Trap::message() const {\n  return message_;\n}\n\n//// Exception ////\n// static\ninline bool Exception::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline Exception::Ptr Exception::New(Store& store, Ref tag, Values& args) {\n  return store.Alloc<Exception>(store, tag, args);\n}\n\ninline Ref Exception::tag() const {\n  return tag_;\n}\n\ninline Values& Exception::args() {\n  return args_;\n}\n\n//// Extern ////\n// static\ninline bool Extern::classof(const Object* obj) {\n  switch (obj->kind()) {\n    case ObjectKind::DefinedFunc:\n    case ObjectKind::HostFunc:\n    case ObjectKind::Table:\n    case ObjectKind::Memory:\n    case ObjectKind::Global:\n    case ObjectKind::Tag:\n      return true;\n    default:\n      return false;\n  }\n}\n\ninline Extern::Extern(ObjectKind kind) : Object(kind) {}\n\n//// Func ////\n// static\ninline bool Func::classof(const Object* obj) {\n  switch (obj->kind()) {\n    case ObjectKind::DefinedFunc:\n    case ObjectKind::HostFunc:\n      return true;\n    default:\n      return false;\n  }\n}\n\ninline const ExternType& Func::extern_type() {\n  return type_;\n}\n\ninline const FuncType& Func::type() const {\n  return type_;\n}\n\n//// DefinedFunc ////\n// static\ninline bool DefinedFunc::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline DefinedFunc::Ptr DefinedFunc::New(Store& store,\n                                         Ref instance,\n                                         FuncDesc desc) {\n  return store.Alloc<DefinedFunc>(store, instance, desc);\n}\n\ninline Ref DefinedFunc::instance() const {\n  return instance_;\n}\n\ninline const FuncDesc& DefinedFunc::desc() const {\n  return desc_;\n}\n\n//// HostFunc ////\n// static\ninline bool HostFunc::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline HostFunc::Ptr HostFunc::New(Store& store, FuncType type, Callback cb) {\n  return store.Alloc<HostFunc>(store, type, cb);\n}\n\n//// Table ////\n// static\ninline bool Table::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline Table::Ptr Table::New(Store& store, TableType type, Ref init_ref) {\n  return store.Alloc<Table>(store, type, init_ref);\n}\n\ninline const ExternType& Table::extern_type() {\n  return type_;\n}\n\ninline const TableType& Table::type() const {\n  return type_;\n}\n\ninline const RefVec& Table::elements() const {\n  return elements_;\n}\n\ninline u32 Table::size() const {\n  return static_cast<u32>(elements_.size());\n}\n\n//// Memory ////\n// static\ninline bool Memory::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline Memory::Ptr Memory::New(interp::Store& store, MemoryType type) {\n  return store.Alloc<Memory>(store, type);\n}\n\ninline bool Memory::IsValidAccess(u64 offset, u64 addend, u64 size) const {\n  // FIXME: make this faster.\n  return offset <= data_.size() && addend <= data_.size() &&\n         size <= data_.size() && offset + addend + size <= data_.size();\n}\n\ninline bool Memory::IsValidAtomicAccess(u64 offset,\n                                        u64 addend,\n                                        u64 size) const {\n  return IsValidAccess(offset, addend, size) &&\n         ((offset + addend) & (size - 1)) == 0;\n}\n\ntemplate <typename T>\nResult Memory::Load(u64 offset, u64 addend, T* out) const {\n  if (!IsValidAccess(offset, addend, sizeof(T))) {\n    return Result::Error;\n  }\n  MemcpyEndianAware(out, data_.data(), sizeof(T), data_.size(), 0,\n                    offset + addend, sizeof(T));\n  return Result::Ok;\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL Memory::UnsafeLoad(u64 offset, u64 addend) const {\n  assert(IsValidAccess(offset, addend, sizeof(T)));\n  T val;\n  MemcpyEndianAware(&val, data_.data(), sizeof(T), data_.size(), 0,\n                    offset + addend, sizeof(T));\n  return val;\n}\n\ntemplate <typename T>\nResult WABT_VECTORCALL Memory::Store(u64 offset, u64 addend, T val) {\n  if (!IsValidAccess(offset, addend, sizeof(T))) {\n    return Result::Error;\n  }\n  MemcpyEndianAware(data_.data(), &val, data_.size(), sizeof(T),\n                    offset + addend, 0, sizeof(T));\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult Memory::AtomicLoad(u64 offset, u64 addend, T* out) const {\n  if (!IsValidAtomicAccess(offset, addend, sizeof(T))) {\n    return Result::Error;\n  }\n  MemcpyEndianAware(out, data_.data(), sizeof(T), data_.size(), 0,\n                    offset + addend, sizeof(T));\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult Memory::AtomicStore(u64 offset, u64 addend, T val) {\n  if (!IsValidAtomicAccess(offset, addend, sizeof(T))) {\n    return Result::Error;\n  }\n  MemcpyEndianAware(data_.data(), &val, data_.size(), sizeof(T),\n                    offset + addend, 0, sizeof(T));\n  return Result::Ok;\n}\n\ntemplate <typename T, typename F>\nResult Memory::AtomicRmw(u64 offset, u64 addend, T rhs, F&& func, T* out) {\n  T lhs;\n  CHECK_RESULT(AtomicLoad(offset, addend, &lhs));\n  CHECK_RESULT(AtomicStore(offset, addend, func(lhs, rhs)));\n  *out = lhs;\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult Memory::AtomicRmwCmpxchg(u64 offset,\n                                u64 addend,\n                                T expect,\n                                T replace,\n                                T* out) {\n  T read;\n  CHECK_RESULT(AtomicLoad(offset, addend, &read));\n  if (read == expect) {\n    CHECK_RESULT(AtomicStore(offset, addend, replace));\n  }\n  *out = read;\n  return Result::Ok;\n}\n\ninline u8* Memory::UnsafeData() {\n  return data_.data();\n}\n\ninline u64 Memory::ByteSize() const {\n  return data_.size();\n}\n\ninline u64 Memory::PageSize() const {\n  return pages_;\n}\n\ninline const ExternType& Memory::extern_type() {\n  return type_;\n}\n\ninline const MemoryType& Memory::type() const {\n  return type_;\n}\n\n//// Global ////\n// static\ninline bool Global::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline Global::Ptr Global::New(Store& store, GlobalType type, Value value) {\n  return store.Alloc<Global>(store, type, value);\n}\n\ninline Value Global::Get() const {\n  return value_;\n}\n\ntemplate <typename T>\nResult Global::Get(T* out) const {\n  if (HasType<T>(type_.type)) {\n    *out = value_.Get<T>();\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL Global::UnsafeGet() const {\n  RequireType<T>(type_.type);\n  return value_.Get<T>();\n}\n\ntemplate <typename T>\nResult WABT_VECTORCALL Global::Set(T val) {\n  if (type_.mut == Mutability::Var && HasType<T>(type_.type)) {\n    value_.Set(val);\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\ninline const ExternType& Global::extern_type() {\n  return type_;\n}\n\ninline const GlobalType& Global::type() const {\n  return type_;\n}\n\n//// Tag ////\n// static\ninline bool Tag::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline Tag::Ptr Tag::New(Store& store, TagType type) {\n  return store.Alloc<Tag>(store, type);\n}\n\ninline const ExternType& Tag::extern_type() {\n  return type_;\n}\n\ninline const TagType& Tag::type() const {\n  return type_;\n}\n\n//// ElemSegment ////\ninline void ElemSegment::Drop() {\n  elements_.clear();\n}\n\ninline const ElemDesc& ElemSegment::desc() const {\n  return *desc_;\n}\n\ninline const RefVec& ElemSegment::elements() const {\n  return elements_;\n}\n\ninline u32 ElemSegment::size() const {\n  return elements_.size();\n}\n\n//// DataSegment ////\ninline void DataSegment::Drop() {\n  size_ = 0;\n}\n\ninline const DataDesc& DataSegment::desc() const {\n  return *desc_;\n}\n\ninline u64 DataSegment::size() const {\n  return size_;\n}\n\n//// Module ////\n// static\ninline bool Module::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\n// static\ninline Module::Ptr Module::New(Store& store, ModuleDesc desc) {\n  return store.Alloc<Module>(store, std::move(desc));\n}\n\ninline const ModuleDesc& Module::desc() const {\n  return desc_;\n}\n\ninline const std::vector<ImportType>& Module::import_types() const {\n  return import_types_;\n}\n\ninline const std::vector<ExportType>& Module::export_types() const {\n  return export_types_;\n}\n\n//// Instance ////\n// static\ninline bool Instance::classof(const Object* obj) {\n  return obj->kind() == skind;\n}\n\ninline Ref Instance::module() const {\n  return module_;\n}\n\ninline const RefVec& Instance::imports() const {\n  return imports_;\n}\n\ninline const RefVec& Instance::funcs() const {\n  return funcs_;\n}\n\ninline const RefVec& Instance::tables() const {\n  return tables_;\n}\n\ninline const RefVec& Instance::memories() const {\n  return memories_;\n}\n\ninline const RefVec& Instance::globals() const {\n  return globals_;\n}\n\ninline const RefVec& Instance::tags() const {\n  return tags_;\n}\n\ninline const RefVec& Instance::exports() const {\n  return exports_;\n}\n\ninline const std::vector<ElemSegment>& Instance::elems() const {\n  return elems_;\n}\n\ninline std::vector<ElemSegment>& Instance::elems() {\n  return elems_;\n}\n\ninline const std::vector<DataSegment>& Instance::datas() const {\n  return datas_;\n}\n\ninline std::vector<DataSegment>& Instance::datas() {\n  return datas_;\n}\n\n//// Thread ////\ninline Store& Thread::store() {\n  return store_;\n}\n\n}  // namespace interp\n}  // namespace wabt\n"
  },
  {
    "path": "include/wabt/interp/interp-math.h",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_INTERP_MATH_H_\n#define WABT_INTERP_MATH_H_\n\n#include <cmath>\n#include <limits>\n#include <string>\n#include <type_traits>\n\n#if COMPILER_IS_MSVC && _M_X64\n#include <emmintrin.h>\n#include <immintrin.h>\n#endif\n\n#include \"wabt/common.h\"\n#include \"wabt/interp/interp.h\"\n\nnamespace wabt {\nnamespace interp {\n\ntemplate <\n    typename T,\n    typename std::enable_if<!std::is_floating_point<T>::value, int>::type = 0>\nbool WABT_VECTORCALL IsNaN(T val) {\n  return false;\n}\n\ntemplate <\n    typename T,\n    typename std::enable_if<std::is_floating_point<T>::value, int>::type = 0>\nbool WABT_VECTORCALL IsNaN(T val) {\n  return std::isnan(val);\n}\n\ntemplate <\n    typename T,\n    typename std::enable_if<!std::is_floating_point<T>::value, int>::type = 0>\nT WABT_VECTORCALL CanonNaN(T val) {\n  return val;\n}\n\ntemplate <\n    typename T,\n    typename std::enable_if<std::is_floating_point<T>::value, int>::type = 0>\nT WABT_VECTORCALL CanonNaN(T val) {\n  if (WABT_UNLIKELY(std::isnan(val))) {\n    return std::numeric_limits<T>::quiet_NaN();\n  }\n  return val;\n}\n\ntemplate <typename T> T ShiftMask(T val) { return val & (sizeof(T)*8-1); }\n\ntemplate <typename T> bool WABT_VECTORCALL IntEqz(T val) { return val == 0; }\ntemplate <typename T> bool WABT_VECTORCALL Eq(T lhs, T rhs) { return lhs == rhs; }\ntemplate <typename T> bool WABT_VECTORCALL Ne(T lhs, T rhs) { return lhs != rhs; }\ntemplate <typename T> bool WABT_VECTORCALL Lt(T lhs, T rhs) { return lhs < rhs; }\ntemplate <typename T> bool WABT_VECTORCALL Le(T lhs, T rhs) { return lhs <= rhs; }\ntemplate <typename T> bool WABT_VECTORCALL Gt(T lhs, T rhs) { return lhs > rhs; }\ntemplate <typename T> bool WABT_VECTORCALL Ge(T lhs, T rhs) { return lhs >= rhs; }\ntemplate <typename T> T WABT_VECTORCALL IntClz(T val) { return Clz(val); }\ntemplate <typename T> T WABT_VECTORCALL IntCtz(T val) { return Ctz(val); }\ntemplate <typename T> T WABT_VECTORCALL IntPopcnt(T val) { return Popcount(val); }\ntemplate <typename T> T WABT_VECTORCALL IntNot(T val) { return ~val; }\ntemplate <typename T> T WABT_VECTORCALL IntNeg(T val) { return ~val + 1; }\ntemplate <typename T> T WABT_VECTORCALL Add(T lhs, T rhs) { return CanonNaN(lhs + rhs); }\ntemplate <typename T> T WABT_VECTORCALL Sub(T lhs, T rhs) { return CanonNaN(lhs - rhs); }\ntemplate <typename T> T WABT_VECTORCALL IntAnd(T lhs, T rhs) { return lhs & rhs; }\ntemplate <typename T> T WABT_VECTORCALL IntOr(T lhs, T rhs) { return lhs | rhs; }\ntemplate <typename T> T WABT_VECTORCALL IntXor(T lhs, T rhs) { return lhs ^ rhs; }\ntemplate <typename T> T WABT_VECTORCALL IntShl(T lhs, T rhs) { return lhs << ShiftMask(rhs); }\ntemplate <typename T> T WABT_VECTORCALL IntShr(T lhs, T rhs) { return lhs >> ShiftMask(rhs); }\ntemplate <typename T> T WABT_VECTORCALL IntMin(T lhs, T rhs) { return std::min(lhs, rhs); }\ntemplate <typename T> T WABT_VECTORCALL IntMax(T lhs, T rhs) { return std::max(lhs, rhs); }\ntemplate <typename T> T WABT_VECTORCALL IntAndNot(T lhs, T rhs) { return lhs & ~rhs; }\ntemplate <typename T> T WABT_VECTORCALL IntAvgr(T lhs, T rhs) { return (lhs + rhs + 1) / 2; }\ntemplate <typename T> T WABT_VECTORCALL Xchg(T lhs, T rhs) { return rhs; }\n\n// This is a wrapping absolute value function, so a negative number that is not\n// representable as a positive number will be unchanged (e.g. abs(-128) = 128).\n//\n// Note that std::abs() does not have this behavior (e.g. abs(-128) is UB).\n// Similarly, using unary minus is also UB.\ntemplate <typename T>\nT WABT_VECTORCALL IntAbs(T val) {\n  static_assert(std::is_unsigned<T>::value, \"T must be unsigned.\");\n  const auto signbit = T(-1) << (sizeof(T) * 8 - 1);\n  return (val & signbit) ? ~val + 1 : val;\n}\n\n// Because of the integer promotion rules [1], any value of a type T which is\n// smaller than `int` will be converted to an `int`, as long as `int` can hold\n// any value of type T.\n//\n// So type `u16` will be promoted to `int`, since all values can be stored in\n// an int. Unfortunately, the product of two `u16` values cannot always be\n// stored in an `int` (e.g. 65535 * 65535). This triggers an error in UBSan.\n//\n// As a result, we make sure to promote the type ahead of time for `u16`. Note\n// that this isn't a problem for any other unsigned types.\n//\n// [1]; https://en.cppreference.com/w/cpp/language/implicit_conversion#Integral_promotion\ntemplate <typename T> struct PromoteMul { using type = T; };\ntemplate <> struct PromoteMul<u16> { using type = u32; };\n\ntemplate <typename T>\nT WABT_VECTORCALL Mul(T lhs, T rhs) {\n  using U = typename PromoteMul<T>::type;\n  return CanonNaN(U(lhs) * U(rhs));\n}\n\ntemplate <typename T> struct Mask { using Type = T; };\ntemplate <> struct Mask<f32> { using Type = u32; };\ntemplate <> struct Mask<f64> { using Type = u64; };\n\ntemplate <typename T> typename Mask<T>::Type WABT_VECTORCALL EqMask(T lhs, T rhs) { return lhs == rhs ? -1 : 0; }\ntemplate <typename T> typename Mask<T>::Type WABT_VECTORCALL NeMask(T lhs, T rhs) { return lhs != rhs ? -1 : 0; }\ntemplate <typename T> typename Mask<T>::Type WABT_VECTORCALL LtMask(T lhs, T rhs) { return lhs < rhs ? -1 : 0; }\ntemplate <typename T> typename Mask<T>::Type WABT_VECTORCALL LeMask(T lhs, T rhs) { return lhs <= rhs ? -1 : 0; }\ntemplate <typename T> typename Mask<T>::Type WABT_VECTORCALL GtMask(T lhs, T rhs) { return lhs > rhs ? -1 : 0; }\ntemplate <typename T> typename Mask<T>::Type WABT_VECTORCALL GeMask(T lhs, T rhs) { return lhs >= rhs ? -1 : 0; }\n\ntemplate <typename T>\nT WABT_VECTORCALL IntRotl(T lhs, T rhs) {\n  return (lhs << ShiftMask(rhs)) | (lhs >> ShiftMask<T>(0 - rhs));\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL IntRotr(T lhs, T rhs) {\n  return (lhs >> ShiftMask(rhs)) | (lhs << ShiftMask<T>(0 - rhs));\n}\n\n// i{32,64}.{div,rem}_s are special-cased because they trap when dividing the\n// max signed value by -1. The modulo operation on x86 uses the same\n// instruction to generate the quotient and the remainder.\ntemplate <typename T,\n          typename std::enable_if<std::is_signed<T>::value, int>::type = 0>\nbool IsNormalDivRem(T lhs, T rhs) {\n  return !(lhs == std::numeric_limits<T>::min() && rhs == -1);\n}\n\ntemplate <typename T,\n          typename std::enable_if<!std::is_signed<T>::value, int>::type = 0>\nbool IsNormalDivRem(T lhs, T rhs) {\n  return true;\n}\n\ntemplate <typename T>\nRunResult WABT_VECTORCALL IntDiv(T lhs, T rhs, T* out, std::string* out_msg) {\n  if (WABT_UNLIKELY(rhs == 0)) {\n    *out_msg = \"integer divide by zero\";\n    return RunResult::Trap;\n  }\n  if (WABT_LIKELY(IsNormalDivRem(lhs, rhs))) {\n    *out = lhs / rhs;\n    return RunResult::Ok;\n  } else {\n    *out_msg = \"integer overflow\";\n    return RunResult::Trap;\n  }\n}\n\ntemplate <typename T>\nRunResult WABT_VECTORCALL IntRem(T lhs, T rhs, T* out, std::string* out_msg) {\n  if (WABT_UNLIKELY(rhs == 0)) {\n    *out_msg = \"integer divide by zero\";\n    return RunResult::Trap;\n  }\n  if (WABT_LIKELY(IsNormalDivRem(lhs, rhs))) {\n    *out = lhs % rhs;\n  } else {\n    *out = 0;\n  }\n  return RunResult::Ok;\n}\n\n#if COMPILER_IS_MSVC && _M_X64\ntemplate <typename T> T WABT_VECTORCALL FloatAbs(T val);\ntemplate <typename T> T WABT_VECTORCALL FloatCopysign(T lhs, T rhs);\n\n// Don't use std::{abs,copysign} directly on MSVC, since that seems to lose\n// the NaN tag.\ntemplate <>\ninline f32 WABT_VECTORCALL FloatAbs(f32 val) {\n  return _mm_cvtss_f32(_mm_and_ps(\n      _mm_set1_ps(val), _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))));\n}\n\ntemplate <>\ninline f64 WABT_VECTORCALL FloatAbs(f64 val) {\n  return _mm_cvtsd_f64(\n      _mm_and_pd(_mm_set1_pd(val),\n                 _mm_castsi128_pd(_mm_set1_epi64x(0x7fffffffffffffffull))));\n}\n\ntemplate <>\ninline f32 WABT_VECTORCALL FloatCopysign(f32 lhs, f32 rhs) {\n  return _mm_cvtss_f32(\n      _mm_or_ps(_mm_and_ps(_mm_set1_ps(lhs),\n                           _mm_castsi128_ps(_mm_set1_epi32(0x7fffffff))),\n                _mm_and_ps(_mm_set1_ps(rhs),\n                           _mm_castsi128_ps(_mm_set1_epi32(0x80000000)))));\n}\n\ntemplate <>\ninline f64 WABT_VECTORCALL FloatCopysign(f64 lhs, f64 rhs) {\n  return _mm_cvtsd_f64(_mm_or_pd(\n      _mm_and_pd(_mm_set1_pd(lhs),\n                 _mm_castsi128_pd(_mm_set1_epi64x(0x7fffffffffffffffull))),\n      _mm_and_pd(_mm_set1_pd(rhs),\n                 _mm_castsi128_pd(_mm_set1_epi64x(0x8000000000000000ull)))));\n}\n\n#else\ntemplate <typename T>\nT WABT_VECTORCALL FloatAbs(T val) {\n  return std::abs(val);\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL FloatCopysign(T lhs, T rhs) {\n  return std::copysign(lhs, rhs);\n}\n#endif\n\n#if COMPILER_IS_MSVC\n#else\n#endif\n\ntemplate <typename T> T WABT_VECTORCALL FloatNeg(T val) { return -val; }\ntemplate <typename T> T WABT_VECTORCALL FloatCeil(T val) { return CanonNaN(std::ceil(val)); }\ntemplate <typename T> T WABT_VECTORCALL FloatFloor(T val) { return CanonNaN(std::floor(val)); }\ntemplate <typename T> T WABT_VECTORCALL FloatTrunc(T val) { return CanonNaN(std::trunc(val)); }\ntemplate <typename T> T WABT_VECTORCALL FloatNearest(T val) { return CanonNaN(std::nearbyint(val)); }\ntemplate <typename T> T WABT_VECTORCALL FloatSqrt(T val) { return CanonNaN(std::sqrt(val)); }\n\ntemplate <typename T>\nT WABT_VECTORCALL FloatDiv(T lhs, T rhs) {\n  // IEE754 specifies what should happen when dividing a float by zero, but\n  // C/C++ says it is undefined behavior.\n  if (WABT_UNLIKELY(rhs == 0)) {\n    return std::isnan(lhs) || lhs == 0\n               ? std::numeric_limits<T>::quiet_NaN()\n               : ((std::signbit(lhs) ^ std::signbit(rhs))\n                      ? -std::numeric_limits<T>::infinity()\n                      : std::numeric_limits<T>::infinity());\n  }\n  return CanonNaN(lhs / rhs);\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL FloatMin(T lhs, T rhs) {\n  if (WABT_UNLIKELY(std::isnan(lhs) || std::isnan(rhs))) {\n    return std::numeric_limits<T>::quiet_NaN();\n  } else if (WABT_UNLIKELY(lhs == 0 && rhs == 0)) {\n    return std::signbit(lhs) ? lhs : rhs;\n  } else {\n    return std::min(lhs, rhs);\n  }\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL FloatPMin(T lhs, T rhs) {\n  return std::min(lhs, rhs);\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL FloatMax(T lhs, T rhs) {\n  if (WABT_UNLIKELY(std::isnan(lhs) || std::isnan(rhs))) {\n    return std::numeric_limits<T>::quiet_NaN();\n  } else if (WABT_UNLIKELY(lhs == 0 && rhs == 0)) {\n    return std::signbit(lhs) ? rhs : lhs;\n  } else {\n    return std::max(lhs, rhs);\n  }\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL FloatPMax(T lhs, T rhs) {\n  return std::max(lhs, rhs);\n}\n\ntemplate <typename R, typename T> bool WABT_VECTORCALL CanConvert(T val) { return true; }\ntemplate <> inline bool WABT_VECTORCALL CanConvert<s32, f32>(f32 val) { return val >= -2147483648.f && val < 2147483648.f; }\ntemplate <> inline bool WABT_VECTORCALL CanConvert<s32, f64>(f64 val) { return val > -2147483649. && val < 2147483648.; }\ntemplate <> inline bool WABT_VECTORCALL CanConvert<u32, f32>(f32 val) { return val > -1.f && val < 4294967296.f; }\ntemplate <> inline bool WABT_VECTORCALL CanConvert<u32, f64>(f64 val) { return val > -1. && val < 4294967296.; }\ntemplate <> inline bool WABT_VECTORCALL CanConvert<s64, f32>(f32 val) { return val >= -9223372036854775808.f && val < 9223372036854775808.f; }\ntemplate <> inline bool WABT_VECTORCALL CanConvert<s64, f64>(f64 val) { return val >= -9223372036854775808. && val < 9223372036854775808.; }\ntemplate <> inline bool WABT_VECTORCALL CanConvert<u64, f32>(f32 val) { return val > -1.f && val < 18446744073709551616.f; }\ntemplate <> inline bool WABT_VECTORCALL CanConvert<u64, f64>(f64 val) { return val > -1. && val < 18446744073709551616.; }\n\ntemplate <typename R, typename T>\nR WABT_VECTORCALL Convert(T val) {\n  assert((CanConvert<R, T>(val)));\n  return static_cast<R>(val);\n}\n\ntemplate <>\ninline f32 WABT_VECTORCALL Convert(f64 val) {\n  // The WebAssembly rounding mode means that these values (which are > F32_MAX)\n  // should be rounded to F32_MAX and not set to infinity. Unfortunately, UBSAN\n  // complains that the value is not representable as a float, so we'll special\n  // case them.\n  const f64 kMin = 3.4028234663852886e38;\n  const f64 kMax = 3.4028235677973366e38;\n  if (WABT_LIKELY(val >= -kMin && val <= kMin)) {\n    return val;\n  } else if (WABT_UNLIKELY(val > kMin && val < kMax)) {\n    return std::numeric_limits<f32>::max();\n  } else if (WABT_UNLIKELY(val > -kMax && val < -kMin)) {\n    return -std::numeric_limits<f32>::max();\n  } else if (WABT_UNLIKELY(std::isnan(val))) {\n    return std::numeric_limits<f32>::quiet_NaN();\n  } else {\n    return std::copysign(std::numeric_limits<f32>::infinity(), val);\n  }\n}\n\ntemplate <>\ninline f32 WABT_VECTORCALL Convert(u64 val) {\n  return wabt_convert_uint64_to_float(val);\n}\n\ntemplate <>\ninline f64 WABT_VECTORCALL Convert(u64 val) {\n  return wabt_convert_uint64_to_double(val);\n}\n\ntemplate <>\ninline f32 WABT_VECTORCALL Convert(s64 val) {\n  return wabt_convert_int64_to_float(val);\n}\n\ntemplate <>\ninline f64 WABT_VECTORCALL Convert(s64 val) {\n  return wabt_convert_int64_to_double(val);\n}\n\ntemplate <typename T, int N>\nT WABT_VECTORCALL IntExtend(T val) {\n  // Hacker's delight 2.6 - sign extension\n  auto bit = T{1} << N;\n  auto mask = (bit << 1) - 1;\n  return ((val & mask) ^ bit) - bit;\n}\n\ntemplate <typename R, typename T>\nR WABT_VECTORCALL IntTruncSat(T val) {\n  if (WABT_UNLIKELY(std::isnan(val))) {\n    return 0;\n  } else if (WABT_UNLIKELY(!CanConvert<R>(val))) {\n    return std::signbit(val) ? std::numeric_limits<R>::min()\n                             : std::numeric_limits<R>::max();\n  } else {\n    return static_cast<R>(val);\n  }\n}\n\ntemplate <typename T> struct SatPromote;\ntemplate <> struct SatPromote<s8> { using type = s32; };\ntemplate <> struct SatPromote<s16> { using type = s32; };\ntemplate <> struct SatPromote<u8> { using type = s32; };\ntemplate <> struct SatPromote<u16> { using type = s32; };\n\ntemplate <typename R, typename T>\nR WABT_VECTORCALL Saturate(T val) {\n  static_assert(sizeof(R) < sizeof(T), \"Incorrect types for Saturate\");\n  const T min = std::numeric_limits<R>::min();\n  const T max = std::numeric_limits<R>::max();\n  return val > max ? max : val < min ? min : val;\n}\n\ntemplate <typename T, typename U = typename SatPromote<T>::type>\nT WABT_VECTORCALL IntAddSat(T lhs, T rhs) {\n  return Saturate<T, U>(lhs + rhs);\n}\n\ntemplate <typename T, typename U = typename SatPromote<T>::type>\nT WABT_VECTORCALL IntSubSat(T lhs, T rhs) {\n  return Saturate<T, U>(lhs - rhs);\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL SaturatingRoundingQMul(T lhs, T rhs) {\n  constexpr int size_in_bits = sizeof(T) * 8;\n  int round_const = 1 << (size_in_bits - 2);\n  int64_t product = lhs * rhs;\n  product += round_const;\n  product >>= (size_in_bits - 1);\n  return Saturate<T, int64_t>(product);\n}\n\n}  // namespace interp\n}  // namespace wabt\n\n#endif  // WABT_INTERP_MATH_H_\n"
  },
  {
    "path": "include/wabt/interp/interp-util.h",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_INTERP_UTIL_H_\n#define WABT_INTERP_UTIL_H_\n\n#include <string>\n#include <string_view>\n#include <vector>\n\n#include \"wabt/interp/interp.h\"\n\nnamespace wabt {\n\nclass Stream;\n\nnamespace interp {\n\nstd::string TypedValueToString(const TypedValue&);\n\nvoid WriteValue(Stream* stream, const TypedValue&);\n\nvoid WriteValues(Stream* stream, const ValueTypes&, const Values&);\n\nvoid WriteTrap(Stream* stream, const char* desc, const Trap::Ptr&);\n\nvoid WriteCall(Stream* stream,\n               std::string_view name,\n               const FuncType& func_type,\n               const Values& params,\n               const Values& results,\n               const Trap::Ptr& trap);\n\n}  // namespace interp\n}  // namespace wabt\n\n#endif  // WABT_INTERP_UTIL_H_\n"
  },
  {
    "path": "include/wabt/interp/interp-wasi.h",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_INTERP_WASI_H_\n#define WABT_INTERP_WASI_H_\n\n#include \"wabt/common.h\"\n#include \"wabt/error.h\"\n#include \"wabt/interp/interp.h\"\n\n#ifdef WITH_WASI\n\nstruct uvwasi_s;\n\nnamespace wabt {\nnamespace interp {\n\nResult WasiBindImports(const Module::Ptr& module,\n                       RefVec& imports,\n                       Stream* err_stream,\n                       Stream* trace_stream);\n\nResult WasiRunStart(const Instance::Ptr& instance,\n                    uvwasi_s* uvwasi,\n                    Stream* stream,\n                    Stream* trace_stream);\n\n}  // namespace interp\n}  // namespace wabt\n\n#endif\n\n#endif /* WABT_INTERP_WASI_H_ */\n"
  },
  {
    "path": "include/wabt/interp/interp.h",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_INTERP_H_\n#define WABT_INTERP_H_\n\n#include <cstdint>\n#include <functional>\n#include <memory>\n#include <set>\n#include <string>\n#include <string_view>\n#include <type_traits>\n#include <vector>\n\n#include \"wabt/cast.h\"\n#include \"wabt/config.h\"\n#include \"wabt/common.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/opcode.h\"\n#include \"wabt/result.h\"\n\n#include \"wabt/interp/istream.h\"\n\nnamespace wabt {\nnamespace interp {\n\nclass Store;\nclass Object;\nclass Trap;\nclass DataSegment;\nclass ElemSegment;\nclass Module;\nclass Instance;\nclass Thread;\ntemplate <typename T>\nclass RefPtr;\n\nusing s8 = int8_t;\nusing u8 = uint8_t;\nusing s16 = int16_t;\nusing u16 = uint16_t;\nusing s32 = int32_t;\nusing u32 = uint32_t;\nusing Index = uint32_t;\nusing s64 = int64_t;\nusing u64 = uint64_t;\nusing f32 = float;\nusing f64 = double;\n\nusing Buffer = std::vector<u8>;\n\nusing ValueType = wabt::Type;\nusing ValueTypes = std::vector<ValueType>;\n\ntemplate <typename T>\nbool HasType(ValueType);\ntemplate <typename T>\nvoid RequireType(ValueType);\nbool IsReference(ValueType);\nbool TypesMatch(ValueType expected, ValueType actual);\n\nusing ExternKind = ExternalKind;\nenum class Mutability { Const, Var };\nenum class TagAttr { Exception };\nusing SegmentMode = SegmentKind;\n\nenum class ObjectKind {\n  Null,\n  Foreign,\n  Trap,\n  Exception,\n  DefinedFunc,\n  HostFunc,\n  Table,\n  Memory,\n  Global,\n  Tag,\n  Module,\n  Instance,\n\n  First = Null,\n  Last = Instance,\n};\n\nconstexpr int kCommandTypeCount = WABT_ENUM_COUNT(ObjectKind);\n\nconst char* GetName(Mutability);\nconst std::string GetName(ValueType);\nconst char* GetName(ExternKind);\nconst char* GetName(ObjectKind);\n\nstruct Ref {\n  static const Ref Null;\n\n  Ref() = default;\n  explicit Ref(size_t index);\n\n  friend bool operator==(Ref, Ref);\n  friend bool operator!=(Ref, Ref);\n\n  size_t index;\n};\nusing RefVec = std::vector<Ref>;\n\ntemplate <typename T, u8 L>\nstruct Simd {\n  using LaneType = T;\n  static constexpr u8 lanes = L;\n\n  T v[L];\n\n  inline T& operator[](u8 idx) {\n#if WABT_BIG_ENDIAN\n    idx = (~idx) & (L - 1);\n#endif\n    return v[idx];\n  }\n  inline T operator[](u8 idx) const {\n#if WABT_BIG_ENDIAN\n    idx = (~idx) & (L - 1);\n#endif\n    return v[idx];\n  }\n};\nusing s8x16 = Simd<s8, 16>;\nusing u8x16 = Simd<u8, 16>;\nusing s16x8 = Simd<s16, 8>;\nusing u16x8 = Simd<u16, 8>;\nusing s32x4 = Simd<s32, 4>;\nusing u32x4 = Simd<u32, 4>;\nusing s64x2 = Simd<s64, 2>;\nusing u64x2 = Simd<u64, 2>;\nusing f32x4 = Simd<f32, 4>;\nusing f64x2 = Simd<f64, 2>;\n\n// Used for load extend instructions.\nusing s8x8 = Simd<s8, 8>;\nusing u8x8 = Simd<u8, 8>;\nusing s16x4 = Simd<s16, 4>;\nusing u16x4 = Simd<u16, 4>;\nusing s32x2 = Simd<s32, 2>;\nusing u32x2 = Simd<u32, 2>;\n\n//// Types ////\n\nbool TypesMatch(ValueType expected, ValueType actual);\n\n//// Limits ////\n\nbool CanGrow(const Limits&, u32 old_size, u32 delta, u32* new_size);\nResult Match(const Limits& expected,\n             const Limits& actual,\n             std::string* out_msg);\n\nstruct ExternType {\n  explicit ExternType(ExternKind);\n  virtual ~ExternType() {}\n  virtual std::unique_ptr<ExternType> Clone() const = 0;\n\n  ExternKind kind;\n};\n\nstruct FuncType : ExternType {\n  static const ExternKind skind = ExternKind::Func;\n  static bool classof(const ExternType* type);\n\n  explicit FuncType(ValueTypes params, ValueTypes results);\n\n  std::unique_ptr<ExternType> Clone() const override;\n\n  friend Result Match(const FuncType& expected,\n                      const FuncType& actual,\n                      std::string* out_msg);\n\n  ValueTypes params;\n  ValueTypes results;\n  // When params or results contain references, the referenced\n  // types are also needed for type equality comparisons.\n  // An example for these comparisons is import validation.\n  std::vector<FuncType>* func_types;\n};\n\nstruct TableType : ExternType {\n  static const ExternKind skind = ExternKind::Table;\n  static bool classof(const ExternType* type);\n\n  explicit TableType(ValueType, Limits);\n\n  std::unique_ptr<ExternType> Clone() const override;\n\n  friend Result Match(const TableType& expected,\n                      const TableType& actual,\n                      std::string* out_msg);\n\n  ValueType element;\n  Limits limits;\n};\n\nstruct MemoryType : ExternType {\n  static const ExternKind skind = ExternKind::Memory;\n  static bool classof(const ExternType* type);\n\n  explicit MemoryType(Limits, uint32_t);\n\n  std::unique_ptr<ExternType> Clone() const override;\n\n  friend Result Match(const MemoryType& expected,\n                      const MemoryType& actual,\n                      std::string* out_msg);\n\n  Limits limits;\n  uint32_t page_size;\n};\n\nstruct GlobalType : ExternType {\n  static const ExternKind skind = ExternKind::Global;\n  static bool classof(const ExternType* type);\n\n  explicit GlobalType(ValueType, Mutability);\n\n  std::unique_ptr<ExternType> Clone() const override;\n\n  friend Result Match(const GlobalType& expected,\n                      const GlobalType& actual,\n                      std::string* out_msg);\n\n  ValueType type;\n  Mutability mut;\n};\n\nstruct TagType : ExternType {\n  static const ExternKind skind = ExternKind::Tag;\n  static bool classof(const ExternType* type);\n\n  explicit TagType(TagAttr, const ValueTypes&);\n\n  std::unique_ptr<ExternType> Clone() const override;\n\n  friend Result Match(const TagType& expected,\n                      const TagType& actual,\n                      std::string* out_msg);\n\n  TagAttr attr;\n  ValueTypes signature;\n};\n\nstruct ImportType {\n  explicit ImportType(std::string module,\n                      std::string name,\n                      std::unique_ptr<ExternType>);\n  ImportType(const ImportType&);\n  ImportType& operator=(const ImportType&);\n\n  std::string module;\n  std::string name;\n  std::unique_ptr<ExternType> type;\n};\n\nstruct ExportType {\n  explicit ExportType(std::string name, std::unique_ptr<ExternType>);\n  ExportType(const ExportType&);\n  ExportType& operator=(const ExportType&);\n\n  std::string name;\n  std::unique_ptr<ExternType> type;\n};\n\n//// Structure ////\n\nstruct ImportDesc {\n  ImportType type;\n};\n\nstruct LocalDesc {\n  ValueType type;\n  u32 count;\n  // One past the last local index that has this type. For example, a vector of\n  // LocalDesc might look like:\n  //\n  //   {{I32, 2, 2}, {I64, 3, 5}, {F32, 1, 6}, ...}\n  //\n  // This makes it possible to use a binary search to find the type of a local\n  // at a given index.\n  u32 end;\n};\n\n// Metadata for representing exception handlers associated with a function's\n// code. This is needed to look up exceptions from call frames from interpreter\n// instructions.\nstruct CatchDesc {\n  Index tag_index;\n  u32 offset;\n  bool ref = false;\n};\n\n// Handlers for a catch-less `try` or `try-catch` block are included in the\n// Catch kind. `try-delegate` instructions create a Delegate handler.\nenum class HandlerKind { Catch, Delegate };\n\nstruct HandlerDesc {\n  HandlerKind kind;\n  u32 try_start_offset;\n  u32 try_end_offset;\n  std::vector<CatchDesc> catches;\n  union {\n    u32 catch_all_offset;\n    u32 delegate_handler_index;\n  };\n  // Local stack heights at the handler site that need to be restored.\n  u32 values;\n  u32 exceptions;\n  bool catch_all_ref = false;\n};\n\nstruct FuncDesc {\n  // Includes params.\n  ValueType GetLocalType(Index) const;\n\n  FuncType type;\n  std::vector<LocalDesc> locals;\n  u32 code_offset;  // Istream offset.\n  std::vector<HandlerDesc> handlers;\n};\n\nstruct TableDesc {\n  TableType type;\n  FuncDesc init_func;\n};\n\nstruct MemoryDesc {\n  MemoryType type;\n};\n\nstruct GlobalDesc {\n  GlobalType type;\n  FuncDesc init_func;\n};\n\nstruct TagDesc {\n  TagType type;\n};\n\nstruct ExportDesc {\n  ExportType type;\n  Index index;\n};\n\nstruct StartDesc {\n  Index func_index;\n};\n\nstruct DataDesc {\n  Buffer data;\n  SegmentMode mode;\n  Index memory_index;\n  FuncDesc init_func;\n};\n\nstruct ElemDesc {\n  std::vector<FuncDesc> elements;\n  ValueType type;\n  SegmentMode mode;\n  Index table_index;\n  FuncDesc init_func;\n};\n\nstruct ModuleDesc {\n  std::vector<FuncType> func_types;\n  std::vector<ImportDesc> imports;\n  std::vector<FuncDesc> funcs;\n  std::vector<TableDesc> tables;\n  std::vector<MemoryDesc> memories;\n  std::vector<GlobalDesc> globals;\n  std::vector<TagDesc> tags;\n  std::vector<ExportDesc> exports;\n  std::vector<StartDesc> starts;\n  std::vector<ElemDesc> elems;\n  std::vector<DataDesc> datas;\n  Istream istream;\n};\n\n//// Runtime ////\n\nstruct Frame {\n  explicit Frame(Ref func,\n                 u32 values,\n                 u32 exceptions,\n                 u32 offset,\n                 Instance*,\n                 Module*);\n\n  void Mark(Store&);\n\n  Ref func;\n  u32 values;      // Height of the value stack at this activation.\n  u32 exceptions;  // Height of the exception stack at this activation.\n  u32 offset;      // Istream offset; either the return PC, or the current PC.\n\n  // Cached for convenience. Both are null if func is a HostFunc.\n  Instance* inst;\n  Module* mod;\n};\n\ntemplate <typename T>\nclass FreeList {\n public:\n  using Index = size_t;\n\n  ~FreeList();\n\n  template <typename... Args>\n  Index New(Args&&...);\n  void Delete(Index);\n\n  bool IsUsed(Index) const;\n\n  const T& Get(Index) const;\n  T& Get(Index);\n\n  Index size() const;   // 1 greater than the maximum index.\n  Index count() const;  // The number of used elements.\n\n private:\n  // As for Refs, the free bit is 0x80..0. This bit is never\n  // set for valid Refs, since it would mean more objects\n  // are allocated than the total amount of memory.\n  static const Index refFreeBit = (SIZE_MAX >> 1) + 1;\n\n  // As for Objects, the free bit is 0x1. This bit is never\n  // set for valid Objects, since pointers are aligned to at\n  // least four bytes.\n  static const Index ptrFreeBit = 1;\n  static const int ptrFreeShift = 1;\n\n  std::vector<T> list_;\n  // If free_head_ is zero, there is no free slots in list_,\n  // otherwise free_head_ - 1 represents the first free slot.\n  Index free_head_ = 0;\n  Index free_items_ = 0;\n};\n\nclass Store {\n public:\n  using ObjectList = FreeList<Object*>;\n  using RootList = FreeList<Ref>;\n\n  explicit Store(const Features& = Features{});\n\n  Store(const Store&) = delete;\n  Store& operator=(const Store&) = delete;\n  Store& operator=(const Store&&) = delete;\n\n  bool IsValid(Ref) const;\n  bool HasValueType(Ref, ValueType) const;\n  template <typename T>\n  bool Is(Ref) const;\n\n  template <typename T, typename... Args>\n  RefPtr<T> Alloc(Args&&...);\n  template <typename T>\n  Result Get(Ref, RefPtr<T>* out);\n  template <typename T>\n  RefPtr<T> UnsafeGet(Ref);\n\n  RootList::Index NewRoot(Ref);\n  RootList::Index CopyRoot(RootList::Index);\n  void DeleteRoot(RootList::Index);\n\n  void Collect();\n  void Mark(Ref);\n  void Mark(const RefVec&);\n\n  ObjectList::Index object_count() const;\n\n  const Features& features() const;\n  void setFeatures(const Features& features) { features_ = features; }\n\n  std::set<Thread*>& threads();\n\n private:\n  template <typename T>\n  friend class RefPtr;\n\n  struct GCContext {\n    int call_depth = 0;\n    std::vector<bool> marks;\n    std::vector<size_t> untraced_objects;\n  };\n\n  static const int max_call_depth = 10;\n\n  Features features_;\n  GCContext gc_context_;\n  // This set contains the currently active Thread objects.\n  std::set<Thread*> threads_;\n  ObjectList objects_;\n  RootList roots_;\n};\n\ntemplate <typename T>\nclass RefPtr {\n public:\n  RefPtr();\n  RefPtr(Store&, Ref);\n  RefPtr(const RefPtr&);\n  RefPtr& operator=(const RefPtr&);\n  RefPtr(RefPtr&&);\n  RefPtr& operator=(RefPtr&&);\n  ~RefPtr();\n\n  template <typename U>\n  RefPtr(const RefPtr<U>&);\n  template <typename U>\n  RefPtr& operator=(const RefPtr<U>&);\n  template <typename U>\n  RefPtr(RefPtr&&);\n  template <typename U>\n  RefPtr& operator=(RefPtr&&);\n\n  template <typename U>\n  RefPtr<U> As();\n\n  bool empty() const;\n  void reset();\n\n  T* get() const;\n  T* operator->() const;\n  T& operator*() const;\n  explicit operator bool() const;\n\n  Ref ref() const;\n  Store* store() const;\n\n  template <typename U, typename V>\n  friend bool operator==(const RefPtr<U>& lhs, const RefPtr<V>& rhs);\n  template <typename U, typename V>\n  friend bool operator!=(const RefPtr<U>& lhs, const RefPtr<V>& rhs);\n\n private:\n  template <typename U>\n  friend class RefPtr;\n\n  T* obj_;\n  Store* store_;\n  Store::RootList::Index root_index_;\n};\n\nstruct Value {\n  static Value WABT_VECTORCALL Make(s32);\n  static Value WABT_VECTORCALL Make(u32);\n  static Value WABT_VECTORCALL Make(s64);\n  static Value WABT_VECTORCALL Make(u64);\n  static Value WABT_VECTORCALL Make(f32);\n  static Value WABT_VECTORCALL Make(f64);\n  static Value WABT_VECTORCALL Make(v128);\n  static Value WABT_VECTORCALL Make(Ref);\n  template <typename T, u8 L>\n  static Value WABT_VECTORCALL Make(Simd<T, L>);\n\n  template <typename T>\n  T WABT_VECTORCALL Get() const;\n  template <typename T>\n  void WABT_VECTORCALL Set(T);\n\n private:\n  union {\n    u32 i32_;\n    u64 i64_;\n    f32 f32_;\n    f64 f64_;\n    v128 v128_;\n    Ref ref_;\n  };\n\n public:\n#ifdef WABT_DEBUG\n  Value() : v128_(0, 0, 0, 0), type(ValueType::Any) {}\n  void SetType(ValueType t) { type = t; }\n  void CheckType(ValueType t) const {\n    // Sadly we must allow Any here, since locals may be uninitialized.\n    // Alternatively we could modify InterpAlloca to set the type.\n    assert(t == type || type == ValueType::Any);\n  }\n  ValueType type;\n#else\n  Value() : v128_(0, 0, 0, 0) {}\n  void SetType(ValueType) {}\n  void CheckType(ValueType) const {}\n#endif\n};\nusing Values = std::vector<Value>;\n\nstruct TypedValue {\n  ValueType type;\n  Value value;\n};\nusing TypedValues = std::vector<TypedValue>;\n\nusing Finalizer = std::function<void(Object*)>;\n\nclass Object {\n public:\n  static bool classof(const Object* obj);\n  static const char* GetTypeName() { return \"Object\"; }\n  using Ptr = RefPtr<Object>;\n\n  Object(const Object&) = delete;\n  Object& operator=(const Object&) = delete;\n\n  virtual ~Object();\n\n  ObjectKind kind() const;\n  Ref self() const;\n\n  void* host_info() const;\n  void set_host_info(void*);\n\n  Finalizer get_finalizer() const;\n  void set_finalizer(Finalizer);\n\n protected:\n  friend Store;\n  explicit Object(ObjectKind);\n  virtual void Mark(Store&) {}\n\n  ObjectKind kind_;\n  Finalizer finalizer_ = nullptr;\n  void* host_info_ = nullptr;\n  Ref self_ = Ref::Null;\n};\n\nclass Foreign : public Object {\n public:\n  static const ObjectKind skind = ObjectKind::Foreign;\n  static bool classof(const Object* obj);\n  static const char* GetTypeName() { return \"Foreign\"; }\n  using Ptr = RefPtr<Foreign>;\n\n  static Foreign::Ptr New(Store&, void*);\n\n  void* ptr();\n\n private:\n  friend Store;\n  explicit Foreign(Store&, void*);\n  void Mark(Store&) override;\n\n  void* ptr_;\n};\n\nclass Trap : public Object {\n public:\n  static const ObjectKind skind = ObjectKind::Trap;\n  static bool classof(const Object* obj);\n  using Ptr = RefPtr<Trap>;\n\n  static Trap::Ptr New(Store&,\n                       const std::string& msg,\n                       const std::vector<Frame>& trace = std::vector<Frame>());\n\n  std::string message() const;\n\n private:\n  friend Store;\n  explicit Trap(Store&,\n                const std::string& msg,\n                const std::vector<Frame>& trace = std::vector<Frame>());\n  void Mark(Store&) override;\n\n  std::string message_;\n  std::vector<Frame> trace_;\n};\n\nclass Exception : public Object {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::Exception;\n  static const char* GetTypeName() { return \"Exception\"; }\n  using Ptr = RefPtr<Exception>;\n\n  static Exception::Ptr New(Store&, Ref tag, Values& args);\n\n  Ref tag() const;\n  Values& args();\n\n private:\n  friend Store;\n  explicit Exception(Store&, Ref, Values&);\n  void Mark(Store&) override;\n\n  Ref tag_;\n  Values args_;\n};\n\nclass Extern : public Object {\n public:\n  static bool classof(const Object* obj);\n  static const char* GetTypeName() { return \"Foreign\"; }\n  using Ptr = RefPtr<Extern>;\n\n  virtual Result Match(Store&, const ImportType&, Trap::Ptr* out_trap) = 0;\n  virtual const ExternType& extern_type() = 0;\n\n protected:\n  friend Store;\n  explicit Extern(ObjectKind);\n\n  template <typename T>\n  Result MatchImpl(Store&,\n                   const ImportType&,\n                   const T& actual,\n                   Trap::Ptr* out_trap);\n};\n\nclass Func : public Extern {\n public:\n  static bool classof(const Object* obj);\n  using Ptr = RefPtr<Func>;\n\n  Result Call(Thread& thread,\n              const Values& params,\n              Values& results,\n              Trap::Ptr* out_trap);\n\n  // Convenience function that creates new Thread.\n  Result Call(Store&,\n              const Values& params,\n              Values& results,\n              Trap::Ptr* out_trap,\n              Stream* = nullptr);\n\n  const ExternType& extern_type() override;\n  const FuncType& type() const;\n\n protected:\n  explicit Func(ObjectKind, FuncType);\n  virtual Result DoCall(Thread& thread,\n                        const Values& params,\n                        Values& results,\n                        Trap::Ptr* out_trap) = 0;\n\n  FuncType type_;\n};\n\nclass DefinedFunc : public Func {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::DefinedFunc;\n  static const char* GetTypeName() { return \"DefinedFunc\"; }\n  using Ptr = RefPtr<DefinedFunc>;\n\n  static DefinedFunc::Ptr New(Store&, Ref instance, FuncDesc);\n\n  Result Match(Store&, const ImportType&, Trap::Ptr* out_trap) override;\n\n  Ref instance() const;\n  const FuncDesc& desc() const;\n\n protected:\n  Result DoCall(Thread& thread,\n                const Values& params,\n                Values& results,\n                Trap::Ptr* out_trap) override;\n\n private:\n  friend Store;\n  explicit DefinedFunc(Store&, Ref instance, FuncDesc);\n  void Mark(Store&) override;\n\n  Ref instance_;\n  FuncDesc desc_;\n};\n\nclass HostFunc : public Func {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::HostFunc;\n  static const char* GetTypeName() { return \"HostFunc\"; }\n  using Ptr = RefPtr<HostFunc>;\n\n  using Callback = std::function<Result(Thread& thread,\n                                        const Values& params,\n                                        Values& results,\n                                        Trap::Ptr* out_trap)>;\n\n  static HostFunc::Ptr New(Store&, FuncType, Callback);\n\n  Result Match(Store&, const ImportType&, Trap::Ptr* out_trap) override;\n\n protected:\n  Result DoCall(Thread& thread,\n                const Values& params,\n                Values& results,\n                Trap::Ptr* out_trap) override;\n\n private:\n  friend Store;\n  friend Thread;\n  explicit HostFunc(Store&, FuncType, Callback);\n  void Mark(Store&) override;\n\n  Callback callback_;\n};\n\nclass Table : public Extern {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::Table;\n  static const char* GetTypeName() { return \"Table\"; }\n  using Ptr = RefPtr<Table>;\n\n  static Table::Ptr New(Store&, TableType, Ref);\n\n  Result Match(Store&, const ImportType&, Trap::Ptr* out_trap) override;\n\n  bool IsValidRange(u32 offset, u32 size) const;\n\n  Result Get(u32 offset, Ref* out) const;\n  Result Set(Store&, u32 offset, Ref);\n  Result Grow(Store&, u32 count, Ref);\n  Result Fill(Store&, u32 offset, Ref, u32 size);\n  Result Init(Store&,\n              u32 dst_offset,\n              const ElemSegment&,\n              u32 src_offset,\n              u32 size);\n  static Result Copy(Store&,\n                     Table& dst,\n                     u32 dst_offset,\n                     const Table& src,\n                     u32 src_offset,\n                     u32 size);\n\n  // Unsafe API.\n  Ref UnsafeGet(u32 offset) const;\n\n  const ExternType& extern_type() override;\n  const TableType& type() const;\n  const RefVec& elements() const;\n  u32 size() const;\n\n private:\n  friend Store;\n  explicit Table(Store&, TableType, Ref);\n  void Mark(Store&) override;\n\n  TableType type_;\n  RefVec elements_;\n};\n\nclass Memory : public Extern {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::Memory;\n  static const char* GetTypeName() { return \"Memory\"; }\n  using Ptr = RefPtr<Memory>;\n\n  static Memory::Ptr New(Store&, MemoryType);\n\n  Result Match(Store&, const ImportType&, Trap::Ptr* out_trap) override;\n\n  bool IsValidAccess(u64 offset, u64 addend, u64 size) const;\n  bool IsValidAtomicAccess(u64 offset, u64 addend, u64 size) const;\n\n  template <typename T>\n  Result Load(u64 offset, u64 addend, T* out) const;\n  template <typename T>\n  Result WABT_VECTORCALL Store(u64 offset, u64 addend, T);\n  Result Grow(u64 pages);\n  Result Fill(u64 offset, u8 value, u64 size);\n  Result Init(u64 dst_offset, const DataSegment&, u64 src_offset, u64 size);\n  static Result Copy(Memory& dst,\n                     u64 dst_offset,\n                     const Memory& src,\n                     u64 src_offset,\n                     u64 size);\n\n  // Fake atomics; just checks alignment.\n  template <typename T>\n  Result AtomicLoad(u64 offset, u64 addend, T* out) const;\n  template <typename T>\n  Result AtomicStore(u64 offset, u64 addend, T);\n  template <typename T, typename F>\n  Result AtomicRmw(u64 offset, u64 addend, T, F&& func, T* out);\n  template <typename T>\n  Result AtomicRmwCmpxchg(u64 offset, u64 addend, T expect, T replace, T* out);\n\n  u64 ByteSize() const;\n  u64 PageSize() const;\n\n  // Unsafe API.\n  template <typename T>\n  T WABT_VECTORCALL UnsafeLoad(u64 offset, u64 addend) const;\n  u8* UnsafeData();\n\n  const ExternType& extern_type() override;\n  const MemoryType& type() const;\n\n private:\n  friend class Store;\n  explicit Memory(class Store&, MemoryType);\n  void Mark(class Store&) override;\n\n  MemoryType type_;\n  Buffer data_;\n  u64 pages_;\n};\n\nclass Global : public Extern {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::Global;\n  static const char* GetTypeName() { return \"Global\"; }\n  using Ptr = RefPtr<Global>;\n\n  static Global::Ptr New(Store&, GlobalType, Value);\n\n  Result Match(Store&, const ImportType&, Trap::Ptr* out_trap) override;\n\n  Value Get() const;\n  template <typename T>\n  Result Get(T* out) const;\n  template <typename T>\n  Result WABT_VECTORCALL Set(T);\n  void Set(Store&, Ref);\n\n  template <typename T>\n  T WABT_VECTORCALL UnsafeGet() const;\n  void UnsafeSet(Value);\n\n  const ExternType& extern_type() override;\n  const GlobalType& type() const;\n\n private:\n  friend Store;\n  explicit Global(Store&, GlobalType, Value);\n  void Mark(Store&) override;\n\n  GlobalType type_;\n  Value value_;\n};\n\nclass Tag : public Extern {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::Tag;\n  static const char* GetTypeName() { return \"Tag\"; }\n  using Ptr = RefPtr<Tag>;\n\n  static Tag::Ptr New(Store&, TagType);\n\n  Result Match(Store&, const ImportType&, Trap::Ptr* out_trap) override;\n\n  const ExternType& extern_type() override;\n  const TagType& type() const;\n\n private:\n  friend Store;\n  explicit Tag(Store&, TagType);\n  void Mark(Store&) override;\n\n  TagType type_;\n};\n\nclass ElemSegment {\n public:\n  explicit ElemSegment(Store& store, const ElemDesc*, RefPtr<Instance>&);\n\n  bool IsValidRange(u32 offset, u32 size) const;\n  void Drop();\n\n  const ElemDesc& desc() const;\n  const RefVec& elements() const;\n  u32 size() const;\n\n private:\n  friend Instance;\n  void Mark(Store&);\n\n  const ElemDesc* desc_;  // Borrowed from the Module.\n  RefVec elements_;\n};\n\nclass DataSegment {\n public:\n  explicit DataSegment(const DataDesc*);\n\n  bool IsValidRange(u64 offset, u64 size) const;\n  void Drop();\n\n  const DataDesc& desc() const;\n  u64 size() const;\n\n private:\n  const DataDesc* desc_;  // Borrowed from the Module.\n  u64 size_;\n};\n\nclass Module : public Object {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::Module;\n  static const char* GetTypeName() { return \"Module\"; }\n  using Ptr = RefPtr<Module>;\n\n  static Module::Ptr New(Store&, ModuleDesc);\n\n  const ModuleDesc& desc() const;\n  const std::vector<ImportType>& import_types() const;\n  const std::vector<ExportType>& export_types() const;\n\n private:\n  friend Store;\n  friend Instance;\n  explicit Module(Store&, ModuleDesc);\n  void Mark(Store&) override;\n\n  ModuleDesc desc_;\n  std::vector<ImportType> import_types_;\n  std::vector<ExportType> export_types_;\n};\n\nclass Instance : public Object {\n public:\n  static bool classof(const Object* obj);\n  static const ObjectKind skind = ObjectKind::Instance;\n  static const char* GetTypeName() { return \"Instance\"; }\n  using Ptr = RefPtr<Instance>;\n\n  static Instance::Ptr Instantiate(Store&,\n                                   Ref module,\n                                   const RefVec& imports,\n                                   Trap::Ptr* out_trap);\n\n  Ref module() const;\n  const RefVec& imports() const;\n  const RefVec& funcs() const;\n  const RefVec& tables() const;\n  const RefVec& memories() const;\n  const RefVec& globals() const;\n  const RefVec& tags() const;\n  const RefVec& exports() const;\n  const std::vector<ElemSegment>& elems() const;\n  std::vector<ElemSegment>& elems();\n  const std::vector<DataSegment>& datas() const;\n  std::vector<DataSegment>& datas();\n\n private:\n  friend Store;\n  friend ElemSegment;\n  friend DataSegment;\n  explicit Instance(Store&, Ref module);\n  void Mark(Store&) override;\n\n  Result CallInitFunc(Store&,\n                      const Ref func_ref,\n                      Value* result,\n                      Trap::Ptr* out_trap);\n\n  Ref module_;\n  RefVec imports_;\n  RefVec funcs_;\n  RefVec tables_;\n  RefVec memories_;\n  RefVec globals_;\n  RefVec tags_;\n  RefVec exports_;\n  std::vector<ElemSegment> elems_;\n  std::vector<DataSegment> datas_;\n};\n\nenum class RunResult {\n  Ok,\n  Return,\n  Trap,\n  Exception,\n};\n\nclass Thread {\n public:\n  struct Options {\n    static constexpr u32 kDefaultValueStackSize = 64 * 1024 / sizeof(Value);\n    static constexpr u32 kDefaultCallStackSize = 64 * 1024 / sizeof(Frame);\n\n    u32 value_stack_size = kDefaultValueStackSize;\n    u32 call_stack_size = kDefaultCallStackSize;\n    Stream* trace_stream = nullptr;\n  };\n\n  Thread(Store& store, Stream* trace_stream = nullptr);\n  ~Thread();\n\n  RunResult Run(Trap::Ptr* out_trap);\n  RunResult Run(int num_instructions, Trap::Ptr* out_trap);\n  RunResult Step(Trap::Ptr* out_trap);\n\n  Store& store();\n  void Mark();\n\n  Instance* GetCallerInstance();\n\n private:\n  friend Store;\n  friend DefinedFunc;\n\n  struct TraceSource;\n\n  RunResult PushCall(Ref func, u32 offset, Trap::Ptr* out_trap);\n  RunResult PushCall(const DefinedFunc&, Trap::Ptr* out_trap);\n  RunResult PushCall(const HostFunc&, Trap::Ptr* out_trap);\n  RunResult PopCall();\n  RunResult DoCall(const Func::Ptr&, Trap::Ptr* out_trap);\n  RunResult DoReturnCall(const Func::Ptr&, Trap::Ptr* out_trap);\n\n  void PushValues(const ValueTypes&, const Values&);\n  void PopValues(const ValueTypes&, Values*);\n\n  Value& Pick(Index);\n\n  template <typename T>\n  T WABT_VECTORCALL Pop();\n  Value Pop();\n  u64 PopPtr(const Memory::Ptr& memory);\n  u64 PopPtr(const Table::Ptr& table);\n  void PushPtr(const Memory::Ptr& memory, u64 value);\n  void PushPtr(const Table::Ptr& table, u64 value);\n\n  template <typename T>\n  void WABT_VECTORCALL Push(T);\n  void Push(Value);\n  void Push(Ref);\n\n  template <typename R, typename T>\n  using UnopFunc = R WABT_VECTORCALL(T);\n  template <typename R, typename T>\n  using UnopTrapFunc = RunResult WABT_VECTORCALL(T, R*, std::string*);\n  template <typename R, typename T>\n  using BinopFunc = R WABT_VECTORCALL(T, T);\n  template <typename R, typename T>\n  using BinopTrapFunc = RunResult WABT_VECTORCALL(T, T, R*, std::string*);\n\n  template <typename R, typename T>\n  RunResult DoUnop(UnopFunc<R, T>);\n  template <typename R, typename T>\n  RunResult DoUnop(UnopTrapFunc<R, T>, Trap::Ptr* out_trap);\n  template <typename R, typename T>\n  RunResult DoBinop(BinopFunc<R, T>);\n  template <typename R, typename T>\n  RunResult DoBinop(BinopTrapFunc<R, T>, Trap::Ptr* out_trap);\n\n  template <typename R, typename T>\n  RunResult DoConvert(Trap::Ptr* out_trap);\n  template <typename R, typename T>\n  RunResult DoReinterpret();\n\n  template <typename T>\n  RunResult Load(Instr, T* out, Trap::Ptr* out_trap);\n  template <typename T, typename V = T>\n  RunResult DoLoad(Instr, Trap::Ptr* out_trap);\n  template <typename T, typename V = T>\n  RunResult DoStore(Instr, Trap::Ptr* out_trap);\n\n  RunResult DoMemoryInit(Instr, Trap::Ptr* out_trap);\n  RunResult DoDataDrop(Instr);\n  RunResult DoMemoryCopy(Instr, Trap::Ptr* out_trap);\n  RunResult DoMemoryFill(Instr, Trap::Ptr* out_trap);\n\n  RunResult DoTableInit(Instr, Trap::Ptr* out_trap);\n  RunResult DoElemDrop(Instr);\n  RunResult DoTableCopy(Instr, Trap::Ptr* out_trap);\n  RunResult DoTableGet(Instr, Trap::Ptr* out_trap);\n  RunResult DoTableSet(Instr, Trap::Ptr* out_trap);\n  RunResult DoTableGrow(Instr, Trap::Ptr* out_trap);\n  RunResult DoTableSize(Instr);\n  RunResult DoTableFill(Instr, Trap::Ptr* out_trap);\n\n  template <typename R, typename T>\n  RunResult DoSimdSplat();\n  template <typename R, typename T>\n  RunResult DoSimdExtract(Instr);\n  template <typename R, typename T>\n  RunResult DoSimdReplace(Instr);\n\n  template <typename R, typename T>\n  RunResult DoSimdUnop(UnopFunc<R, T>);\n  // Like DoSimdUnop but zeroes top half.\n  template <typename R, typename T>\n  RunResult DoSimdUnopZero(UnopFunc<R, T>);\n  template <typename R, typename T>\n  RunResult DoSimdBinop(BinopFunc<R, T>);\n  RunResult DoSimdBitSelect();\n  template <typename S, u8 count>\n  RunResult DoSimdIsTrue();\n  template <typename S>\n  RunResult DoSimdBitmask();\n  template <typename R, typename T>\n  RunResult DoSimdShift(BinopFunc<R, T>);\n  template <typename S>\n  RunResult DoSimdLoadSplat(Instr, Trap::Ptr* out_trap);\n  template <typename S>\n  RunResult DoSimdLoadLane(Instr, Trap::Ptr* out_trap);\n  template <typename S>\n  RunResult DoSimdStoreLane(Instr, Trap::Ptr* out_trap);\n  template <typename S, typename T>\n  RunResult DoSimdLoadZero(Instr, Trap::Ptr* out_trap);\n  RunResult DoSimdSwizzle();\n  RunResult DoSimdShuffle(Instr);\n  template <typename S, typename T>\n  RunResult DoSimdNarrow();\n  template <typename S, typename T, bool low>\n  RunResult DoSimdConvert();\n  template <typename S, typename T>\n  RunResult DoSimdDot();\n  template <typename S, typename T>\n  RunResult DoSimdDotAdd();\n  template <typename S>\n  RunResult DoSimdRelaxedMadd();\n  template <typename S>\n  RunResult DoSimdRelaxedNmadd();\n  template <typename S, typename T>\n  RunResult DoSimdLoadExtend(Instr, Trap::Ptr* out_trap);\n  template <typename S, typename T>\n  RunResult DoSimdExtaddPairwise();\n  template <typename S, typename T, bool low>\n  RunResult DoSimdExtmul();\n\n  template <typename T, typename V = T>\n  RunResult DoAtomicLoad(Instr, Trap::Ptr* out_trap);\n  template <typename T, typename V = T>\n  RunResult DoAtomicStore(Instr, Trap::Ptr* out_trap);\n  template <typename R, typename T>\n  RunResult DoAtomicRmw(BinopFunc<T, T>, Instr, Trap::Ptr* out_trap);\n  template <typename T, typename V = T>\n  RunResult DoAtomicRmwCmpxchg(Instr, Trap::Ptr* out_trap);\n\n  RunResult DoThrow(Exception::Ptr exn_ref);\n\n  RunResult StepInternal(Trap::Ptr* out_trap);\n\n  std::vector<Frame> frames_;\n  std::vector<Value> values_;\n  std::vector<u32> refs_;  // Index into values_.\n\n  // Exception handling requires tracking a separate stack of caught\n  // exceptions for catch blocks.\n  RefVec exceptions_;\n\n  // Cached for convenience.\n  Store& store_;\n  Instance* inst_ = nullptr;\n  Module* mod_ = nullptr;\n\n  // Tracing.\n  Stream* trace_stream_;\n  std::unique_ptr<TraceSource> trace_source_;\n};\n\nstruct Thread::TraceSource : Istream::TraceSource {\n public:\n  explicit TraceSource(Thread*);\n  std::string Header(Istream::Offset) override;\n  std::string Pick(Index, Instr) override;\n\n private:\n  ValueType GetLocalType(Index);\n  ValueType GetGlobalType(Index);\n  ValueType GetTableElementType(Index);\n\n  Thread* thread_;\n};\n\n}  // namespace interp\n}  // namespace wabt\n\n#include \"wabt/interp/interp-inl.h\"\n\n#endif  // WABT_INTERP_H_\n"
  },
  {
    "path": "include/wabt/interp/istream.h",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_INTERP_ISTREAM_H_\n#define WABT_INTERP_ISTREAM_H_\n\n#include <cstdint>\n#include <string>\n#include <vector>\n\n#include \"wabt/common.h\"\n#include \"wabt/opcode.h\"\n#include \"wabt/stream.h\"\n\nnamespace wabt {\nnamespace interp {\n\nusing u8 = uint8_t;\nusing u16 = uint16_t;\nusing u32 = uint32_t;\nusing u64 = uint64_t;\nusing f32 = float;\nusing f64 = double;\n\nusing Buffer = std::vector<u8>;\n\nusing ValueType = wabt::Type;\n\n// Group instructions based on their immediates their operands. This way we can\n// simplify instruction decoding, disassembling, and tracing. There is an\n// example of an instruction that uses this encoding on the right.\nenum class InstrKind {\n  Imm_0_Op_0,                  // Nop\n  Imm_0_Op_1,                  // i32.eqz\n  Imm_0_Op_2,                  // i32.add\n  Imm_0_Op_3,                  // select\n  Imm_Jump_Op_0,               // br\n  Imm_Jump_Op_1,               // br_if\n  Imm_Index_Op_0,              // global.get\n  Imm_Index_Op_1,              // global.set\n  Imm_Index_Op_2,              // table.set\n  Imm_Index_Op_3,              // memory.fill\n  Imm_Index_Op_N,              // call\n  Imm_Index_Index_Op_3,        // memory.init\n  Imm_Index_Index_Op_N,        // call_indirect\n  Imm_Index_Offset_Op_1,       // i32.load\n  Imm_Index_Offset_Op_2,       // i32.store\n  Imm_Index_Offset_Op_3,       // i32.atomic.rmw.cmpxchg\n  Imm_Index_Offset_Lane_Op_2,  // v128.load8_lane\n  Imm_I32_Op_0,                // i32.const\n  Imm_I64_Op_0,                // i64.const\n  Imm_F32_Op_0,                // f32.const\n  Imm_F64_Op_0,                // f64.const\n  Imm_I32_I32_Op_0,            // drop_keep\n  Imm_I8_Op_1,                 // i32x4.extract_lane\n  Imm_I8_Op_2,                 // i32x4.replace_lane\n  Imm_V128_Op_0,               // v128.const\n  Imm_V128_Op_2,               // i8x16.shuffle\n};\n\nstruct Instr {\n  Opcode op;\n  InstrKind kind;\n  union {\n    u8 imm_u8;\n    u32 imm_u32;\n    f32 imm_f32;\n    u64 imm_u64;\n    f64 imm_f64;\n    v128 imm_v128;\n    struct {\n      u32 fst, snd;\n    } imm_u32x2;\n    struct {\n      u32 fst, snd;\n      u8 idx;\n    } imm_u32x2_u8;\n  };\n};\n\nclass Istream {\n public:\n  using SerializedOpcode = u32;  // TODO: change to u16\n  using Offset = u32;\n  static constexpr Offset kInvalidOffset = ~0;\n  // Each br_table entry is made up of three instructions:\n  //\n  //   interp_drop_keep $drop $keep\n  //   interp_catch_drop $catches\n  //   br $label\n  //\n  // Each opcode is a SerializedOpcode, and each immediate is a u32.\n  static constexpr Offset kBrTableEntrySize =\n      sizeof(SerializedOpcode) * 3 + 4 * sizeof(u32);\n\n  // Emit API.\n  void Emit(u32);\n  void Emit(Opcode::Enum);\n  void Emit(Opcode::Enum, u8);\n  void Emit(Opcode::Enum, u32);\n  void Emit(Opcode::Enum, u64);\n  void Emit(Opcode::Enum, v128);\n  void Emit(Opcode::Enum, u32, u32);\n  void Emit(Opcode::Enum, u32, u32, u8);\n  void EmitDropKeep(u32 drop, u32 keep);\n  void EmitCatchDrop(u32 drop);\n\n  Offset EmitFixupU32();\n  void ResolveFixupU32(Offset);\n\n  Offset end() const;\n\n  // Read API.\n  Instr Read(Offset*) const;\n\n  // Disassemble/Trace API.\n  // TODO separate out disassembly/tracing?\n  struct TraceSource {\n    virtual ~TraceSource() {}\n    // Whatever content should go before the instruction on each line, e.g. the\n    // call stack size, value stack size, and istream offset.\n    virtual std::string Header(Offset) = 0;\n    virtual std::string Pick(Index, Instr) = 0;\n  };\n\n  struct DisassemblySource : TraceSource {\n    std::string Header(Offset) override;\n    std::string Pick(Index, Instr) override;\n  };\n\n  void Disassemble(Stream*) const;\n  Offset Disassemble(Stream*, Offset) const;\n  void Disassemble(Stream*, Offset from, Offset to) const;\n\n  Offset Trace(Stream*, Offset, TraceSource*) const;\n\n private:\n  template <typename T>\n  void WABT_VECTORCALL EmitAt(Offset, T val);\n  template <typename T>\n  void WABT_VECTORCALL EmitInternal(T val);\n\n  template <typename T>\n  T WABT_VECTORCALL ReadAt(Offset*) const;\n\n  Buffer data_;\n};\n\n}  // namespace interp\n}  // namespace wabt\n\n#endif  // WABT_INTERP_ISTREAM_H_\n"
  },
  {
    "path": "include/wabt/intrusive-list.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_INTRUSIVE_LIST_H_\n#define WABT_INTRUSIVE_LIST_H_\n\n#include <cassert>\n#include <iterator>\n#include <memory>\n\n// This uses a similar interface as std::list, but is missing the following\n// features:\n//\n// * Add \"extract_\" functions that remove an element from the list and return\n//   it.\n// * Only supports move-only operations\n// * No allocator support\n// * No initializer lists\n// * Asserts instead of exceptions\n// * Some functions are not implemented (merge, remove, remove_if, reverse,\n//   unique, sort, non-member comparison operators)\n\nnamespace wabt {\n\ntemplate <typename T>\nclass intrusive_list;\n\ntemplate <typename T>\nclass intrusive_list_base {\n private:\n  friend class intrusive_list<T>;\n\n  mutable T* next_ = nullptr;\n  mutable T* prev_ = nullptr;\n};\n\ntemplate <typename T>\nclass intrusive_list {\n public:\n  // types:\n  using value_type = T;\n  using reference = value_type&;\n  using const_reference = const value_type&;\n  class iterator;\n  class const_iterator;\n  using size_type = std::size_t;\n  using difference_type = std::ptrdiff_t;\n  using reverse_iterator = std::reverse_iterator<iterator>;\n  using const_reverse_iterator = std::reverse_iterator<const_iterator>;\n\n  // construct/copy/destroy:\n  intrusive_list();\n  explicit intrusive_list(std::unique_ptr<T> node);\n  explicit intrusive_list(T&& node);\n  intrusive_list(const intrusive_list&) = delete;\n  intrusive_list(intrusive_list&&);\n  ~intrusive_list();\n  intrusive_list& operator=(const intrusive_list& other) = delete;\n  intrusive_list& operator=(intrusive_list&& other);\n\n  // iterators:\n  iterator begin() noexcept;\n  const_iterator begin() const noexcept;\n  iterator end() noexcept;\n  const_iterator end() const noexcept;\n\n  reverse_iterator rbegin() noexcept;\n  const_reverse_iterator rbegin() const noexcept;\n  reverse_iterator rend() noexcept;\n  const_reverse_iterator rend() const noexcept;\n\n  const_iterator cbegin() const noexcept;\n  const_iterator cend() const noexcept;\n  const_reverse_iterator crbegin() const noexcept;\n  const_reverse_iterator crend() const noexcept;\n\n  // capacity:\n  size_type size() const noexcept;\n  bool empty() const noexcept;\n\n  // element access:\n  reference front();\n  const_reference front() const;\n  reference back();\n  const_reference back() const;\n\n  // modifiers:\n  template <class... Args>\n  void emplace_front(Args&&... args);\n  template <class... Args>\n  void emplace_back(Args&&... args);\n  void push_front(std::unique_ptr<T> node);\n  void push_front(T&& node);\n  void push_back(std::unique_ptr<T> node);\n  void push_back(T&& node);\n  void pop_front();\n  void pop_back();\n  std::unique_ptr<T> extract_front();\n  std::unique_ptr<T> extract_back();\n\n  template <class... Args>\n  iterator emplace(iterator pos, Args&&... args);\n  iterator insert(iterator pos, std::unique_ptr<T> node);\n  iterator insert(iterator pos, T&& node);\n  std::unique_ptr<T> extract(iterator it);\n\n  iterator erase(iterator pos);\n  iterator erase(iterator first, iterator last);\n  void swap(intrusive_list&);\n  void clear() noexcept;\n\n  void splice(iterator pos, intrusive_list& node);\n  void splice(iterator pos, intrusive_list&& node);\n  void splice(iterator pos, intrusive_list& node, iterator it);\n  void splice(iterator pos,\n              intrusive_list& node,\n              iterator first,\n              iterator last);\n\n private:\n  T* first_ = nullptr;\n  T* last_ = nullptr;\n  size_t size_ = 0;\n};\n\n/// iterator\ntemplate <typename T>\nclass intrusive_list<T>::iterator {\n public:\n  using difference_type = std::ptrdiff_t;\n  using iterator_category = std::bidirectional_iterator_tag;\n  using value_type = T;\n  using pointer = T*;\n  using reference = T&;\n\n  iterator(const intrusive_list<T>& list, T* node)\n      : list_(&list), node_(node) {}\n\n  reference operator*() const {\n    assert(node_);\n    return *node_;\n  }\n\n  pointer operator->() const {\n    assert(node_);\n    return node_;\n  }\n\n  iterator& operator++() {\n    assert(node_);\n    node_ = node_->next_;\n    return *this;\n  }\n\n  iterator operator++(int) {\n    iterator tmp = *this;\n    operator++();\n    return tmp;\n  }\n\n  iterator& operator--() {\n    node_ = node_ ? node_->prev_ : list_->last_;\n    return *this;\n  }\n\n  iterator operator--(int) {\n    iterator tmp = *this;\n    operator--();\n    return tmp;\n  }\n\n  bool operator==(iterator rhs) const {\n    assert(list_ == rhs.list_);\n    return node_ == rhs.node_;\n  }\n\n  bool operator!=(iterator rhs) const {\n    assert(list_ == rhs.list_);\n    return node_ != rhs.node_;\n  }\n\n private:\n  friend class const_iterator;\n\n  const intrusive_list<T>* list_;\n  T* node_;\n};\n\n/// const_iterator\ntemplate <typename T>\nclass intrusive_list<T>::const_iterator {\n public:\n  using difference_type = std::ptrdiff_t;\n  using iterator_category = std::bidirectional_iterator_tag;\n  using value_type = T;\n  using pointer = const T*;\n  using reference = const T&;\n\n  const_iterator(const intrusive_list<T>& list, T* node)\n      : list_(&list), node_(node) {}\n\n  const_iterator(const iterator& other)\n      : list_(other.list_), node_(other.node_) {}\n\n  reference operator*() const {\n    assert(node_);\n    return *node_;\n  }\n\n  pointer operator->() const {\n    assert(node_);\n    return node_;\n  }\n\n  const_iterator& operator++() {\n    assert(node_);\n    node_ = node_->next_;\n    return *this;\n  }\n\n  const_iterator operator++(int) {\n    const_iterator tmp = *this;\n    operator++();\n    return tmp;\n  }\n\n  const_iterator& operator--() {\n    node_ = node_ ? node_->prev_ : list_->last_;\n    return *this;\n  }\n\n  const_iterator operator--(int) {\n    const_iterator tmp = *this;\n    operator--();\n    return tmp;\n  }\n\n  bool operator==(const_iterator rhs) const {\n    assert(list_ == rhs.list_);\n    return node_ == rhs.node_;\n  }\n\n  bool operator!=(const_iterator rhs) const {\n    assert(list_ == rhs.list_);\n    return node_ != rhs.node_;\n  }\n\n private:\n  const intrusive_list<T>* list_;\n  T* node_;\n};\n\ntemplate <typename T>\ninline intrusive_list<T>::intrusive_list() {}\n\ntemplate <typename T>\ninline intrusive_list<T>::intrusive_list(std::unique_ptr<T> node) {\n  push_back(std::move(node));\n}\n\ntemplate <typename T>\ninline intrusive_list<T>::intrusive_list(T&& node) {\n  push_back(std::move(node));\n}\n\ntemplate <typename T>\ninline intrusive_list<T>::intrusive_list(intrusive_list&& other)\n    : first_(other.first_), last_(other.last_), size_(other.size_) {\n  other.first_ = other.last_ = nullptr;\n  other.size_ = 0;\n}\n\ntemplate <typename T>\ninline intrusive_list<T>::~intrusive_list() {\n  clear();\n}\n\ntemplate <typename T>\ninline intrusive_list<T>& intrusive_list<T>::operator=(\n    intrusive_list<T>&& other) {\n  clear();\n  first_ = other.first_;\n  last_ = other.last_;\n  size_ = other.size_;\n  other.first_ = other.last_ = nullptr;\n  other.size_ = 0;\n  return *this;\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::iterator\nintrusive_list<T>::begin() noexcept {\n  return iterator(*this, first_);\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_iterator intrusive_list<T>::begin()\n    const noexcept {\n  return const_iterator(*this, first_);\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::iterator intrusive_list<T>::end() noexcept {\n  return iterator(*this, nullptr);\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_iterator intrusive_list<T>::end()\n    const noexcept {\n  return const_iterator(*this, nullptr);\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::reverse_iterator\nintrusive_list<T>::rbegin() noexcept {\n  return reverse_iterator(iterator(*this, nullptr));\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_reverse_iterator\nintrusive_list<T>::rbegin() const noexcept {\n  return const_reverse_iterator(const_iterator(*this, nullptr));\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::reverse_iterator\nintrusive_list<T>::rend() noexcept {\n  return reverse_iterator(iterator(*this, first_));\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_reverse_iterator\nintrusive_list<T>::rend() const noexcept {\n  return const_reverse_iterator(const_iterator(*this, first_));\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_iterator intrusive_list<T>::cbegin()\n    const noexcept {\n  return const_iterator(*this, first_);\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_iterator intrusive_list<T>::cend()\n    const noexcept {\n  return const_iterator(*this, nullptr);\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_reverse_iterator\nintrusive_list<T>::crbegin() const noexcept {\n  return const_reverse_iterator(const_iterator(*this, nullptr));\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_reverse_iterator\nintrusive_list<T>::crend() const noexcept {\n  return const_reverse_iterator(const_iterator(*this, first_));\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::size_type intrusive_list<T>::size()\n    const noexcept {\n  return size_;\n}\n\ntemplate <typename T>\ninline bool intrusive_list<T>::empty() const noexcept {\n  return size_ == 0;\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::reference intrusive_list<T>::front() {\n  assert(!empty());\n  return *first_;\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_reference intrusive_list<T>::front()\n    const {\n  assert(!empty());\n  return *first_;\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::reference intrusive_list<T>::back() {\n  assert(!empty());\n  return *last_;\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::const_reference intrusive_list<T>::back()\n    const {\n  assert(!empty());\n  return *last_;\n}\n\ntemplate <typename T>\ntemplate <class... Args>\ninline void intrusive_list<T>::emplace_front(Args&&... args) {\n  push_front(std::make_unique<T>(std::forward<Args>(args)...));\n}\n\ntemplate <typename T>\ntemplate <class... Args>\ninline void intrusive_list<T>::emplace_back(Args&&... args) {\n  push_back(std::make_unique<T>(std::forward<Args>(args)...));\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::push_front(std::unique_ptr<T> node) {\n  assert(node->prev_ == nullptr && node->next_ == nullptr);\n\n  T* node_p = node.release();\n  if (first_) {\n    node_p->next_ = first_;\n    first_->prev_ = node_p;\n  } else {\n    last_ = node_p;\n  }\n  first_ = node_p;\n  size_++;\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::push_front(T&& node) {\n  push_front(std::make_unique<T>(std::move(node)));\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::push_back(std::unique_ptr<T> node) {\n  assert(node->prev_ == nullptr && node->next_ == nullptr);\n\n  T* node_p = node.release();\n  if (last_) {\n    node_p->prev_ = last_;\n    last_->next_ = node_p;\n  } else {\n    first_ = node_p;\n  }\n  last_ = node_p;\n  size_++;\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::push_back(T&& node) {\n  push_back(std::make_unique<T>(std::move(node)));\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::pop_front() {\n  extract_front();\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::pop_back() {\n  extract_back();\n}\n\ntemplate <typename T>\ninline std::unique_ptr<T> intrusive_list<T>::extract_front() {\n  assert(!empty());\n  T* node = first_;\n  if (first_ == last_) {\n    first_ = last_ = nullptr;\n  } else {\n    first_ = first_->next_;\n    first_->prev_ = nullptr;\n  }\n  node->next_ = node->prev_ = nullptr;\n  size_--;\n  return std::unique_ptr<T>(node);\n}\n\ntemplate <typename T>\ninline std::unique_ptr<T> intrusive_list<T>::extract_back() {\n  assert(!empty());\n  T* node = last_;\n  if (first_ == last_) {\n    first_ = last_ = nullptr;\n  } else {\n    last_ = last_->prev_;\n    last_->next_ = nullptr;\n  }\n  node->next_ = node->prev_ = nullptr;\n  size_--;\n  return std::unique_ptr<T>(node);\n}\n\ntemplate <typename T>\ntemplate <class... Args>\ninline typename intrusive_list<T>::iterator intrusive_list<T>::emplace(\n    iterator pos,\n    Args&&... args) {\n  return insert(pos, std::make_unique<T>(std::forward<Args>(args)...));\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::iterator intrusive_list<T>::insert(\n    iterator pos,\n    std::unique_ptr<T> node) {\n  assert(node->prev_ == nullptr && node->next_ == nullptr);\n\n  T* node_p;\n  if (pos == end()) {\n    push_back(std::move(node));\n    node_p = &back();\n  } else {\n    node_p = node.release();\n    node_p->prev_ = pos->prev_;\n    node_p->next_ = &*pos;\n    if (pos->prev_) {\n      pos->prev_->next_ = node_p;\n    } else {\n      first_ = node_p;\n    }\n    pos->prev_ = node_p;\n    size_++;\n  }\n  return iterator(*this, node_p);\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::iterator intrusive_list<T>::insert(\n    iterator pos,\n    T&& node) {\n  return insert(pos, std::make_unique<T>(std::move(node)));\n}\n\ntemplate <typename T>\ninline std::unique_ptr<T> intrusive_list<T>::extract(iterator pos) {\n  assert(!empty());\n  assert(pos != end());\n  T* node = &*pos;\n  if (first_ == last_) {\n    first_ = last_ = nullptr;\n  } else {\n    if (node->prev_) {\n      node->prev_->next_ = node->next_;\n    } else {\n      first_ = node->next_;\n    }\n\n    if (node->next_) {\n      node->next_->prev_ = node->prev_;\n    } else {\n      last_ = node->prev_;\n    }\n  }\n  node->next_ = node->prev_ = nullptr;\n  size_--;\n  return std::unique_ptr<T>(node);\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::iterator intrusive_list<T>::erase(\n    iterator pos) {\n  iterator next = std::next(pos);\n  extract(pos);\n  return next;\n}\n\ntemplate <typename T>\ninline typename intrusive_list<T>::iterator intrusive_list<T>::erase(\n    iterator first,\n    iterator last) {\n  while (first != last)\n    first = erase(first);\n  return first;\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::swap(intrusive_list& other) {\n  std::swap(first_, other.first_);\n  std::swap(last_, other.last_);\n  std::swap(size_, other.size_);\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::clear() noexcept {\n  for (T* iter = first_; iter;) {\n    T* next = iter->next_;\n    delete iter;\n    iter = next;\n  }\n  first_ = last_ = nullptr;\n  size_ = 0;\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::splice(iterator pos, intrusive_list& other) {\n  splice(pos, other, other.begin(), other.end());\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::splice(iterator pos, intrusive_list&& other) {\n  splice(pos, other, other.begin(), other.end());\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::splice(iterator pos,\n                                      intrusive_list& other,\n                                      iterator it) {\n  insert(pos, other.extract(it));\n}\n\ntemplate <typename T>\ninline void intrusive_list<T>::splice(iterator pos,\n                                      intrusive_list& other,\n                                      iterator first,\n                                      iterator last) {\n  while (first != last)\n    insert(pos, other.extract(first++));\n}\n\n}  // namespace wabt\n\n#endif  // WABT_INTRUSIVE_LIST_H_\n"
  },
  {
    "path": "include/wabt/ir-util.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_IR_UTIL_H_\n#define WABT_IR_UTIL_H_\n\n#include \"wabt/common.h\"\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nstruct Label {\n  Label(LabelType label_type,\n        const std::string& name,\n        const TypeVector& param_types,\n        const TypeVector& result_types)\n      : name(name),\n        label_type(label_type),\n        param_types(param_types),\n        result_types(result_types) {}\n\n  std::string name;\n  LabelType label_type;\n  TypeVector param_types;\n  TypeVector result_types;\n};\n\nstruct ModuleContext {\n  ModuleContext(const Module& module) : module(module) {}\n\n  Index GetLabelStackSize() const { return label_stack_.size(); }\n  const Label* GetLabel(const Var& var) const;\n  Index GetLabelArity(const Var& var) const;\n  void SetTopLabelType(LabelType label_type) {\n    label_stack_.back().label_type = label_type;\n  }\n\n  Index GetFuncParamCount(const Var& var) const;\n  Index GetFuncResultCount(const Var& var) const;\n\n  void BeginBlock(LabelType label_type, const Block& block);\n  void EndBlock();\n  void BeginFunc(const Func& func);\n  void EndFunc();\n\n  struct Arities {\n    Index nargs;\n    Index nreturns;\n    bool unreachable;\n    Arities(Index na, Index nr, bool ur = false)\n        : nargs(na), nreturns(nr), unreachable(ur) {}\n  };\n  Arities GetExprArity(const Expr& expr) const;\n\n  const Module& module;\n\n private:\n  const Func* current_func_ = nullptr;\n  std::vector<Label> label_stack_;\n};\n\n}  // namespace wabt\n\n#endif /* WABT_IR_UTIL_H_ */\n"
  },
  {
    "path": "include/wabt/ir.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_IR_H_\n#define WABT_IR_H_\n\n#include <cassert>\n#include <cstddef>\n#include <cstdint>\n#include <memory>\n#include <set>\n#include <string>\n#include <string_view>\n#include <type_traits>\n#include <vector>\n\n#include \"wabt/binding-hash.h\"\n#include \"wabt/common.h\"\n#include \"wabt/intrusive-list.h\"\n#include \"wabt/opcode.h\"\n\nnamespace wabt {\n\nstruct Module;\n\n// VarType (16 bit) and the opt_type_ (16 bit)\n// fields of Var forms a 32 bit field.\nenum class VarType : uint16_t {\n  Index,\n  Name,\n};\n\nstruct Var {\n  // Var can represent variables or types.\n\n  // Represent a variable:\n  //   has_opt_type() is false\n  //   Only used by wast-parser\n\n  // Represent a type:\n  //   has_opt_type() is true, is_index() is true\n  //   type can be get by to_type()\n  //   Binary reader only constructs this variant\n\n  // Represent both a variable and a type:\n  //   has_opt_type() is true, is_name() is true\n  //   A reference, which index is unknown\n  //   Only used by wast-parser\n\n  explicit Var();\n  explicit Var(Index index, const Location& loc);\n  explicit Var(std::string_view name, const Location& loc);\n  explicit Var(Type type, const Location& loc);\n  Var(Var&&);\n  Var(const Var&);\n  Var& operator=(const Var&);\n  Var& operator=(Var&&);\n  ~Var();\n\n  bool is_index() const { return type_ == VarType::Index; }\n  bool is_name() const { return type_ == VarType::Name; }\n  bool has_opt_type() const { return opt_type_ < 0; }\n\n  Index index() const {\n    assert(is_index());\n    return index_;\n  }\n  const std::string& name() const {\n    assert(is_name());\n    return name_;\n  }\n  Type::Enum opt_type() const {\n    assert(has_opt_type());\n    return static_cast<Type::Enum>(opt_type_);\n  }\n\n  void set_index(Index);\n  void set_name(std::string&&);\n  void set_name(std::string_view);\n  void set_opt_type(Type::Enum);\n  Type to_type() const;\n\n  Location loc;\n\n private:\n  void Destroy();\n\n  VarType type_;\n  // Can be set to Type::Enum types, Type::Any represent no optional type.\n  int16_t opt_type_;\n  union {\n    Index index_;\n    std::string name_;\n  };\n};\nusing VarVector = std::vector<Var>;\n\nstruct Const {\n  static constexpr uintptr_t kRefNullBits = ~uintptr_t(0);\n\n  Const() : Const(Type::I32, uint32_t(0)) {}\n\n  static Const I32(uint32_t val = 0, const Location& loc = Location()) {\n    return Const(Type::I32, val, loc);\n  }\n  static Const I64(uint64_t val = 0, const Location& loc = Location()) {\n    return Const(Type::I64, val, loc);\n  }\n  static Const F32(uint32_t val = 0, const Location& loc = Location()) {\n    return Const(Type::F32, val, loc);\n  }\n  static Const F64(uint64_t val = 0, const Location& loc = Location()) {\n    return Const(Type::F64, val, loc);\n  }\n  static Const V128(v128 val, const Location& loc = Location()) {\n    return Const(Type::V128, val, loc);\n  }\n\n  Type type() const { return type_; }\n  Type lane_type() const {\n    assert(type_ == Type::V128);\n    return lane_type_;\n  }\n\n  int lane_count() const {\n    switch (lane_type()) {\n      case Type::I8:  return 16;\n      case Type::I16: return 8;\n      case Type::I32: return 4;\n      case Type::I64: return 2;\n      case Type::F32: return 4;\n      case Type::F64: return 2;\n      default: WABT_UNREACHABLE;\n    }\n  }\n\n  uint32_t u32() const { return data_.u32(0); }\n  uint64_t u64() const { return data_.u64(0); }\n  uint32_t f32_bits() const { return data_.f32_bits(0); }\n  uint64_t f64_bits() const { return data_.f64_bits(0); }\n  uintptr_t ref_bits() const { return data_.To<uintptr_t>(0); }\n  v128 vec128() const { return data_; }\n\n  template <typename T>\n  T v128_lane(int lane) const {\n    return data_.To<T>(lane);\n  }\n\n  void set_u32(uint32_t x) { From(Type::I32, x); }\n  void set_u64(uint64_t x) { From(Type::I64, x); }\n  void set_f32(uint32_t x) { From(Type::F32, x); }\n  void set_f64(uint64_t x) { From(Type::F64, x); }\n\n  void set_v128_u8(int lane, uint8_t x) { set_v128_lane(lane, Type::I8, x); }\n  void set_v128_u16(int lane, uint16_t x) { set_v128_lane(lane, Type::I16, x); }\n  void set_v128_u32(int lane, uint32_t x) { set_v128_lane(lane, Type::I32, x); }\n  void set_v128_u64(int lane, uint64_t x) { set_v128_lane(lane, Type::I64, x); }\n  void set_v128_f32(int lane, uint32_t x) { set_v128_lane(lane, Type::F32, x); }\n  void set_v128_f64(int lane, uint64_t x) { set_v128_lane(lane, Type::F64, x); }\n\n  // Only used for expectations. (e.g. wast assertions)\n  void set_f32(ExpectedNan nan) {\n    set_f32(0);\n    set_expected_nan(0, nan);\n  }\n  void set_f64(ExpectedNan nan) {\n    set_f64(0);\n    set_expected_nan(0, nan);\n  }\n  void set_funcref() { From<uintptr_t>(Type::FuncRef, 0); }\n  void set_externref(uintptr_t x) { From(Type::ExternRef, x); }\n  void set_extern(uintptr_t x) { From(Type(Type::ExternRef, Type::ReferenceNonNull), x); }\n  void set_null(Type type) { From<uintptr_t>(type, kRefNullBits); }\n\n  bool is_expected_nan(int lane = 0) const {\n    return expected_nan(lane) != ExpectedNan::None;\n  }\n\n  ExpectedNan expected_nan(int lane = 0) const {\n    return lane < 4 ? nan_[lane] : ExpectedNan::None;\n  }\n\n  void set_expected_nan(int lane, ExpectedNan nan) {\n    if (lane < 4) {\n      nan_[lane] = nan;\n    }\n  }\n\n  // v128 support\n  Location loc;\n\n private:\n  template <typename T>\n  void set_v128_lane(int lane, Type lane_type, T x) {\n    lane_type_ = lane_type;\n    From(Type::V128, x, lane);\n    set_expected_nan(lane, ExpectedNan::None);\n  }\n\n  template <typename T>\n  Const(Type type, T data, const Location& loc = Location()) : loc(loc) {\n    From<T>(type, data);\n  }\n\n  template <typename T>\n  void From(Type type, T data, int lane = 0) {\n    static_assert(sizeof(T) <= sizeof(data_), \"Invalid cast!\");\n    assert((lane + 1) * sizeof(T) <= sizeof(data_));\n    type_ = type;\n    data_.From<T>(lane, data);\n    set_expected_nan(lane, ExpectedNan::None);\n  }\n\n  Type type_;\n  Type lane_type_;  // Only valid if type_ == Type::V128.\n  v128 data_;\n  ExpectedNan nan_[4];\n};\nusing ConstVector = std::vector<Const>;\n\nenum class ExpectationType {\n  Values,\n  Either,\n};\n\nclass Expectation {\n public:\n  Expectation() = delete;\n  virtual ~Expectation() = default;\n  ExpectationType type() const { return type_; }\n\n  Location loc;\n\n  ConstVector expected;\n\n protected:\n  explicit Expectation(ExpectationType type, const Location& loc = Location())\n      : loc(loc), type_(type) {}\n\n private:\n  ExpectationType type_;\n};\n\ntemplate <ExpectationType TypeEnum>\nclass ExpectationMixin : public Expectation {\n public:\n  static bool classof(const Expectation* expectation) {\n    return expectation->type() == TypeEnum;\n  }\n\n  explicit ExpectationMixin(const Location& loc = Location())\n      : Expectation(TypeEnum, loc) {}\n};\n\nclass ValueExpectation : public ExpectationMixin<ExpectationType::Values> {\n public:\n  explicit ValueExpectation(const Location& loc = Location())\n      : ExpectationMixin<ExpectationType::Values>(loc) {}\n};\n\nstruct EitherExpectation : public ExpectationMixin<ExpectationType::Either> {\n public:\n  explicit EitherExpectation(const Location& loc = Location())\n      : ExpectationMixin<ExpectationType::Either>(loc) {}\n};\n\ntypedef std::unique_ptr<Expectation> ExpectationPtr;\n\nstruct FuncSignature {\n  TypeVector param_types;\n  TypeVector result_types;\n\n  Index GetNumParams() const { return param_types.size(); }\n  Index GetNumResults() const { return result_types.size(); }\n  Type GetParamType(Index index) const { return param_types[index]; }\n  Type GetResultType(Index index) const { return result_types[index]; }\n\n  bool operator==(const FuncSignature&) const;\n};\n\nenum class TypeEntryKind {\n  Func,\n  Struct,\n  Array,\n};\n\nclass TypeEntry {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(TypeEntry);\n\n  virtual ~TypeEntry() = default;\n\n  TypeEntryKind kind() const { return kind_; }\n\n  Location loc;\n  std::string name;\n\n protected:\n  explicit TypeEntry(TypeEntryKind kind,\n                     std::string_view name = std::string_view(),\n                     const Location& loc = Location())\n      : loc(loc), name(name), kind_(kind) {}\n\n  TypeEntryKind kind_;\n};\n\nclass FuncType : public TypeEntry {\n public:\n  static bool classof(const TypeEntry* entry) {\n    return entry->kind() == TypeEntryKind::Func;\n  }\n\n  explicit FuncType(std::string_view name = std::string_view())\n      : TypeEntry(TypeEntryKind::Func, name) {}\n\n  Index GetNumParams() const { return sig.GetNumParams(); }\n  Index GetNumResults() const { return sig.GetNumResults(); }\n  Type GetParamType(Index index) const { return sig.GetParamType(index); }\n  Type GetResultType(Index index) const { return sig.GetResultType(index); }\n\n  FuncSignature sig;\n\n  // The BinaryReaderIR tracks whether a FuncType is the target of a tailcall\n  // (via a return_call_indirect). wasm2c (CWriter) uses this information to\n  // limit its output in some cases.\n  struct {\n    bool tailcall = false;\n  } features_used;\n};\n\nstruct Field {\n  std::string name;\n  Type type = Type::Void;\n  bool mutable_ = false;\n};\n\nclass StructType : public TypeEntry {\n public:\n  static bool classof(const TypeEntry* entry) {\n    return entry->kind() == TypeEntryKind::Struct;\n  }\n\n  explicit StructType(std::string_view name = std::string_view())\n      : TypeEntry(TypeEntryKind::Struct) {}\n\n  std::vector<Field> fields;\n};\n\nclass ArrayType : public TypeEntry {\n public:\n  static bool classof(const TypeEntry* entry) {\n    return entry->kind() == TypeEntryKind::Array;\n  }\n\n  explicit ArrayType(std::string_view name = std::string_view())\n      : TypeEntry(TypeEntryKind::Array) {}\n\n  Field field;\n};\n\nstruct FuncDeclaration {\n  Index GetNumParams() const { return sig.GetNumParams(); }\n  Index GetNumResults() const { return sig.GetNumResults(); }\n  Type GetParamType(Index index) const { return sig.GetParamType(index); }\n  Type GetResultType(Index index) const { return sig.GetResultType(index); }\n\n  bool has_func_type = false;\n  Var type_var;\n  FuncSignature sig;\n};\n\nenum class ExprType {\n  AtomicLoad,\n  AtomicRmw,\n  AtomicRmwCmpxchg,\n  AtomicStore,\n  AtomicNotify,\n  AtomicFence,\n  AtomicWait,\n  Binary,\n  Quaternary,\n  Block,\n  Br,\n  BrIf,\n  BrOnNonNull,\n  BrOnNull,\n  BrTable,\n  Call,\n  CallIndirect,\n  CallRef,\n  CodeMetadata,\n  Compare,\n  Const,\n  Convert,\n  Drop,\n  GlobalGet,\n  GlobalSet,\n  If,\n  Load,\n  LocalGet,\n  LocalSet,\n  LocalTee,\n  Loop,\n  MemoryCopy,\n  DataDrop,\n  MemoryFill,\n  MemoryGrow,\n  MemoryInit,\n  MemorySize,\n  Nop,\n  RefAsNonNull,\n  RefIsNull,\n  RefFunc,\n  RefNull,\n  Rethrow,\n  Return,\n  ReturnCall,\n  ReturnCallIndirect,\n  ReturnCallRef,\n  Select,\n  SimdLaneOp,\n  SimdLoadLane,\n  SimdStoreLane,\n  SimdShuffleOp,\n  LoadSplat,\n  LoadZero,\n  Store,\n  TableCopy,\n  ElemDrop,\n  TableInit,\n  TableGet,\n  TableGrow,\n  TableSize,\n  TableSet,\n  TableFill,\n  Ternary,\n  Throw,\n  ThrowRef,\n  Try,\n  TryTable,\n  Unary,\n  Unreachable,\n\n  First = AtomicLoad,\n  Last = Unreachable\n};\n\nconst char* GetExprTypeName(ExprType type);\n\nclass Expr;\nusing ExprList = intrusive_list<Expr>;\n\nusing BlockDeclaration = FuncDeclaration;\n\nstruct Block {\n  Block() = default;\n  explicit Block(ExprList exprs) : exprs(std::move(exprs)) {}\n\n  std::string label;\n  BlockDeclaration decl;\n  ExprList exprs;\n  Location end_loc;\n};\n\nstruct Catch {\n  explicit Catch(const Location& loc = Location()) : loc(loc) {}\n  explicit Catch(const Var& var, const Location& loc = Location())\n      : loc(loc), var(var) {}\n  Location loc;\n  Var var;\n  ExprList exprs;\n  bool IsCatchAll() const {\n    return var.is_index() && var.index() == kInvalidIndex;\n  }\n};\nusing CatchVector = std::vector<Catch>;\n\nstruct TableCatch {\n  explicit TableCatch(const Location& loc = Location()) : loc(loc) {}\n  Location loc;\n  Var tag;\n  Var target;\n  CatchKind kind;\n  bool IsCatchAll() const {\n    return kind == CatchKind::CatchAll || kind == CatchKind::CatchAllRef;\n  }\n  bool IsRef() const {\n    return kind == CatchKind::CatchRef || kind == CatchKind::CatchAllRef;\n  }\n};\nusing TryTableVector = std::vector<TableCatch>;\n\nenum class TryKind { Plain, Catch, Delegate };\n\nclass Expr : public intrusive_list_base<Expr> {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(Expr);\n  Expr() = delete;\n  virtual ~Expr() = default;\n\n  ExprType type() const { return type_; }\n\n  Location loc;\n\n protected:\n  explicit Expr(ExprType type, const Location& loc = Location())\n      : loc(loc), type_(type) {}\n\n  ExprType type_;\n};\n\nconst char* GetExprTypeName(const Expr& expr);\n\ntemplate <ExprType TypeEnum>\nclass ExprMixin : public Expr {\n public:\n  static bool classof(const Expr* expr) { return expr->type() == TypeEnum; }\n\n  explicit ExprMixin(const Location& loc = Location()) : Expr(TypeEnum, loc) {}\n};\n\ntemplate <ExprType TypeEnum>\nclass MemoryExpr : public ExprMixin<TypeEnum> {\n public:\n  MemoryExpr(Var memidx, const Location& loc = Location())\n      : ExprMixin<TypeEnum>(loc), memidx(memidx) {}\n\n  Var memidx;\n};\n\ntemplate <ExprType TypeEnum>\nclass MemoryBinaryExpr : public ExprMixin<TypeEnum> {\n public:\n  MemoryBinaryExpr(Var destmemidx,\n                   Var srcmemidx,\n                   const Location& loc = Location())\n      : ExprMixin<TypeEnum>(loc),\n        destmemidx(destmemidx),\n        srcmemidx(srcmemidx) {}\n\n  Var destmemidx;\n  Var srcmemidx;\n};\n\nusing DropExpr = ExprMixin<ExprType::Drop>;\nusing NopExpr = ExprMixin<ExprType::Nop>;\nusing ReturnExpr = ExprMixin<ExprType::Return>;\nusing UnreachableExpr = ExprMixin<ExprType::Unreachable>;\nusing ThrowRefExpr = ExprMixin<ExprType::ThrowRef>;\n\nusing MemoryGrowExpr = MemoryExpr<ExprType::MemoryGrow>;\nusing MemorySizeExpr = MemoryExpr<ExprType::MemorySize>;\nusing MemoryFillExpr = MemoryExpr<ExprType::MemoryFill>;\n\nusing MemoryCopyExpr = MemoryBinaryExpr<ExprType::MemoryCopy>;\n\ntemplate <ExprType TypeEnum>\nclass RefTypeExpr : public ExprMixin<TypeEnum> {\n public:\n  RefTypeExpr(Var type, const Location& loc = Location())\n      : ExprMixin<TypeEnum>(loc), type(type) {}\n\n  Var type;\n};\n\nusing RefNullExpr = RefTypeExpr<ExprType::RefNull>;\nusing RefIsNullExpr = ExprMixin<ExprType::RefIsNull>;\n\ntemplate <ExprType TypeEnum>\nclass OpcodeExpr : public ExprMixin<TypeEnum> {\n public:\n  OpcodeExpr(Opcode opcode, const Location& loc = Location())\n      : ExprMixin<TypeEnum>(loc), opcode(opcode) {}\n\n  Opcode opcode;\n};\n\nusing BinaryExpr = OpcodeExpr<ExprType::Binary>;\nusing QuaternaryExpr = OpcodeExpr<ExprType::Quaternary>;\nusing CompareExpr = OpcodeExpr<ExprType::Compare>;\nusing ConvertExpr = OpcodeExpr<ExprType::Convert>;\nusing UnaryExpr = OpcodeExpr<ExprType::Unary>;\nusing TernaryExpr = OpcodeExpr<ExprType::Ternary>;\nusing RefAsNonNullExpr = OpcodeExpr<ExprType::RefAsNonNull>;\n\nclass SimdLaneOpExpr : public ExprMixin<ExprType::SimdLaneOp> {\n public:\n  SimdLaneOpExpr(Opcode opcode, uint64_t val, const Location& loc = Location())\n      : ExprMixin<ExprType::SimdLaneOp>(loc), opcode(opcode), val(val) {}\n\n  Opcode opcode;\n  uint64_t val;\n};\n\nclass SimdLoadLaneExpr : public MemoryExpr<ExprType::SimdLoadLane> {\n public:\n  SimdLoadLaneExpr(Opcode opcode,\n                   Var memidx,\n                   Address align,\n                   Address offset,\n                   uint64_t val,\n                   const Location& loc = Location())\n      : MemoryExpr<ExprType::SimdLoadLane>(memidx, loc),\n        opcode(opcode),\n        align(align),\n        offset(offset),\n        val(val) {}\n\n  Opcode opcode;\n  Address align;\n  Address offset;\n  uint64_t val;\n};\n\nclass SimdStoreLaneExpr : public MemoryExpr<ExprType::SimdStoreLane> {\n public:\n  SimdStoreLaneExpr(Opcode opcode,\n                    Var memidx,\n                    Address align,\n                    Address offset,\n                    uint64_t val,\n                    const Location& loc = Location())\n      : MemoryExpr<ExprType::SimdStoreLane>(memidx, loc),\n        opcode(opcode),\n        align(align),\n        offset(offset),\n        val(val) {}\n\n  Opcode opcode;\n  Address align;\n  Address offset;\n  uint64_t val;\n};\n\nclass SimdShuffleOpExpr : public ExprMixin<ExprType::SimdShuffleOp> {\n public:\n  SimdShuffleOpExpr(Opcode opcode, v128 val, const Location& loc = Location())\n      : ExprMixin<ExprType::SimdShuffleOp>(loc), opcode(opcode), val(val) {}\n\n  Opcode opcode;\n  v128 val;\n};\n\ntemplate <ExprType TypeEnum>\nclass VarExpr : public ExprMixin<TypeEnum> {\n public:\n  VarExpr(const Var& var, const Location& loc = Location())\n      : ExprMixin<TypeEnum>(loc), var(var) {}\n\n  Var var;\n};\n\ntemplate <ExprType TypeEnum>\nclass MemoryVarExpr : public MemoryExpr<TypeEnum> {\n public:\n  MemoryVarExpr(const Var& var, Var memidx, const Location& loc = Location())\n      : MemoryExpr<TypeEnum>(memidx, loc), var(var) {}\n\n  Var var;\n};\n\nusing BrExpr = VarExpr<ExprType::Br>;\nusing BrIfExpr = VarExpr<ExprType::BrIf>;\nusing BrOnNonNullExpr = VarExpr<ExprType::BrOnNonNull>;\nusing BrOnNullExpr = VarExpr<ExprType::BrOnNull>;\nusing CallExpr = VarExpr<ExprType::Call>;\nusing RefFuncExpr = VarExpr<ExprType::RefFunc>;\nusing GlobalGetExpr = VarExpr<ExprType::GlobalGet>;\nusing GlobalSetExpr = VarExpr<ExprType::GlobalSet>;\nusing LocalGetExpr = VarExpr<ExprType::LocalGet>;\nusing LocalSetExpr = VarExpr<ExprType::LocalSet>;\nusing LocalTeeExpr = VarExpr<ExprType::LocalTee>;\nusing ReturnCallExpr = VarExpr<ExprType::ReturnCall>;\nusing ThrowExpr = VarExpr<ExprType::Throw>;\nusing RethrowExpr = VarExpr<ExprType::Rethrow>;\n\nusing DataDropExpr = VarExpr<ExprType::DataDrop>;\nusing ElemDropExpr = VarExpr<ExprType::ElemDrop>;\nusing TableGetExpr = VarExpr<ExprType::TableGet>;\nusing TableSetExpr = VarExpr<ExprType::TableSet>;\nusing TableGrowExpr = VarExpr<ExprType::TableGrow>;\nusing TableSizeExpr = VarExpr<ExprType::TableSize>;\nusing TableFillExpr = VarExpr<ExprType::TableFill>;\n\nusing MemoryInitExpr = MemoryVarExpr<ExprType::MemoryInit>;\n\nclass SelectExpr : public ExprMixin<ExprType::Select> {\n public:\n  SelectExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::Select>(loc) {}\n  TypeVector result_type;\n};\n\nclass TableInitExpr : public ExprMixin<ExprType::TableInit> {\n public:\n  TableInitExpr(const Var& segment_index,\n                const Var& table_index,\n                const Location& loc = Location())\n      : ExprMixin<ExprType::TableInit>(loc),\n        segment_index(segment_index),\n        table_index(table_index) {}\n\n  Var segment_index;\n  Var table_index;\n};\n\nclass TableCopyExpr : public ExprMixin<ExprType::TableCopy> {\n public:\n  TableCopyExpr(const Var& dst,\n                const Var& src,\n                const Location& loc = Location())\n      : ExprMixin<ExprType::TableCopy>(loc), dst_table(dst), src_table(src) {}\n\n  Var dst_table;\n  Var src_table;\n};\n\nclass CallIndirectExpr : public ExprMixin<ExprType::CallIndirect> {\n public:\n  explicit CallIndirectExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::CallIndirect>(loc) {}\n\n  FuncDeclaration decl;\n  Var table;\n};\n\nclass CodeMetadataExpr : public ExprMixin<ExprType::CodeMetadata> {\n public:\n  explicit CodeMetadataExpr(std::string_view name,\n                            std::vector<uint8_t> data,\n                            const Location& loc = Location())\n      : ExprMixin<ExprType::CodeMetadata>(loc),\n        name(std::move(name)),\n        data(std::move(data)) {}\n\n  std::string_view name;\n  std::vector<uint8_t> data;\n};\n\nclass ReturnCallIndirectExpr : public ExprMixin<ExprType::ReturnCallIndirect> {\n public:\n  explicit ReturnCallIndirectExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::ReturnCallIndirect>(loc) {}\n\n  FuncDeclaration decl;\n  Var table;\n};\n\nclass CallRefExpr : public ExprMixin<ExprType::CallRef> {\n public:\n  explicit CallRefExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::CallRef>(loc) {}\n\n  Var sig_type;\n};\n\nclass ReturnCallRefExpr : public ExprMixin<ExprType::ReturnCallRef> {\n public:\n  explicit ReturnCallRefExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::ReturnCallRef>(loc) {}\n\n  Var sig_type;\n};\n\ntemplate <ExprType TypeEnum>\nclass BlockExprBase : public ExprMixin<TypeEnum> {\n public:\n  explicit BlockExprBase(const Location& loc = Location())\n      : ExprMixin<TypeEnum>(loc) {}\n\n  Block block;\n};\n\nusing BlockExpr = BlockExprBase<ExprType::Block>;\nusing LoopExpr = BlockExprBase<ExprType::Loop>;\n\nclass IfExpr : public ExprMixin<ExprType::If> {\n public:\n  explicit IfExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::If>(loc) {}\n\n  Block true_;\n  ExprList false_;\n  Location false_end_loc;\n};\n\nclass TryTableExpr : public ExprMixin<ExprType::TryTable> {\n public:\n  explicit TryTableExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::TryTable>(loc) {}\n\n  Block block;\n  TryTableVector catches;\n};\n\nclass TryExpr : public ExprMixin<ExprType::Try> {\n public:\n  explicit TryExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::Try>(loc), kind(TryKind::Plain) {}\n\n  TryKind kind;\n  Block block;\n  CatchVector catches;\n  Var delegate_target;\n};\n\nclass BrTableExpr : public ExprMixin<ExprType::BrTable> {\n public:\n  BrTableExpr(const Location& loc = Location())\n      : ExprMixin<ExprType::BrTable>(loc) {}\n\n  VarVector targets;\n  Var default_target;\n};\n\nclass ConstExpr : public ExprMixin<ExprType::Const> {\n public:\n  ConstExpr(const Const& c, const Location& loc = Location())\n      : ExprMixin<ExprType::Const>(loc), const_(c) {}\n\n  Const const_;\n};\n\n// TODO(binji): Rename this, it is used for more than loads/stores now.\ntemplate <ExprType TypeEnum>\nclass LoadStoreExpr : public MemoryExpr<TypeEnum> {\n public:\n  LoadStoreExpr(Opcode opcode,\n                Var memidx,\n                Address align,\n                Address offset,\n                const Location& loc = Location())\n      : MemoryExpr<TypeEnum>(memidx, loc),\n        opcode(opcode),\n        align(align),\n        offset(offset) {}\n\n  Opcode opcode;\n  Address align;\n  Address offset;\n};\n\nusing LoadExpr = LoadStoreExpr<ExprType::Load>;\nusing StoreExpr = LoadStoreExpr<ExprType::Store>;\n\nusing AtomicLoadExpr = LoadStoreExpr<ExprType::AtomicLoad>;\nusing AtomicStoreExpr = LoadStoreExpr<ExprType::AtomicStore>;\nusing AtomicRmwExpr = LoadStoreExpr<ExprType::AtomicRmw>;\nusing AtomicRmwCmpxchgExpr = LoadStoreExpr<ExprType::AtomicRmwCmpxchg>;\nusing AtomicWaitExpr = LoadStoreExpr<ExprType::AtomicWait>;\nusing AtomicNotifyExpr = LoadStoreExpr<ExprType::AtomicNotify>;\nusing LoadSplatExpr = LoadStoreExpr<ExprType::LoadSplat>;\nusing LoadZeroExpr = LoadStoreExpr<ExprType::LoadZero>;\n\nclass AtomicFenceExpr : public ExprMixin<ExprType::AtomicFence> {\n public:\n  explicit AtomicFenceExpr(uint32_t consistency_model,\n                           const Location& loc = Location())\n      : ExprMixin<ExprType::AtomicFence>(loc),\n        consistency_model(consistency_model) {}\n\n  uint32_t consistency_model;\n};\n\nstruct Tag {\n  explicit Tag(std::string_view name) : name(name) {}\n\n  std::string name;\n  FuncDeclaration decl;\n};\n\nclass LocalTypes {\n public:\n  using Decl = std::pair<Type, Index>;\n  using Decls = std::vector<Decl>;\n\n  struct const_iterator {\n    const_iterator(Decls::const_iterator decl, Index index)\n        : decl(decl), index(index) {}\n    Type operator*() const { return decl->first; }\n    const_iterator& operator++();\n    const_iterator operator++(int);\n\n    Decls::const_iterator decl;\n    Index index;\n  };\n\n  void Set(const TypeVector&);\n\n  const Decls& decls() const { return decls_; }\n\n  void AppendDecl(Type type, Index count) {\n    if (count != 0) {\n      decls_.emplace_back(type, count);\n    }\n  }\n\n  Index size() const;\n  Type operator[](Index) const;\n\n  const_iterator begin() const { return {decls_.begin(), 0}; }\n  const_iterator end() const { return {decls_.end(), 0}; }\n\n private:\n  Decls decls_;\n};\n\ninline LocalTypes::const_iterator& LocalTypes::const_iterator::operator++() {\n  ++index;\n  if (index >= decl->second) {\n    ++decl;\n    index = 0;\n  }\n  return *this;\n}\n\ninline LocalTypes::const_iterator LocalTypes::const_iterator::operator++(int) {\n  const_iterator result = *this;\n  operator++();\n  return result;\n}\n\ninline bool operator==(const LocalTypes::const_iterator& lhs,\n                       const LocalTypes::const_iterator& rhs) {\n  return lhs.decl == rhs.decl && lhs.index == rhs.index;\n}\n\ninline bool operator!=(const LocalTypes::const_iterator& lhs,\n                       const LocalTypes::const_iterator& rhs) {\n  return !operator==(lhs, rhs);\n}\n\nstruct Func {\n  explicit Func(std::string_view name) : name(name) {}\n\n  Type GetParamType(Index index) const { return decl.GetParamType(index); }\n  Type GetResultType(Index index) const { return decl.GetResultType(index); }\n  Type GetLocalType(Index index) const;\n  Type GetLocalType(const Var& var) const;\n  Index GetNumParams() const { return decl.GetNumParams(); }\n  Index GetNumLocals() const { return local_types.size(); }\n  Index GetNumParamsAndLocals() const {\n    return GetNumParams() + GetNumLocals();\n  }\n  Index GetNumResults() const { return decl.GetNumResults(); }\n  Index GetLocalIndex(const Var&) const;\n\n  std::string name;\n  FuncDeclaration decl;\n  LocalTypes local_types;\n  BindingHash bindings;\n  ExprList exprs;\n  Location loc;\n\n  // For a subset of features, the BinaryReaderIR tracks whether they are\n  // actually used by the function. wasm2c (CWriter) uses this information to\n  // limit its output in some cases.\n  struct {\n    bool tailcall = false;\n  } features_used;\n};\n\nstruct Global {\n  explicit Global(std::string_view name) : name(name) {}\n\n  std::string name;\n  Type type = Type::Void;\n  bool mutable_ = false;\n  ExprList init_expr;\n};\n\nstruct Table {\n  explicit Table(std::string_view name)\n      : name(name), elem_type(Type::FuncRef) {}\n\n  std::string name;\n  Limits elem_limits;\n  Type elem_type;\n  ExprList init_expr;\n};\n\nusing ExprListVector = std::vector<ExprList>;\n\nstruct ElemSegment {\n  explicit ElemSegment(std::string_view name) : name(name) {}\n  uint8_t GetFlags(const Module*, bool function_references_enabled) const;\n\n  SegmentKind kind = SegmentKind::Active;\n  std::string name;\n  Var table_var;\n  Type elem_type;\n  ExprList offset;\n  ExprListVector elem_exprs;\n};\n\nstruct Memory {\n  explicit Memory(std::string_view name) : name(name) {}\n\n  std::string name;\n  Limits page_limits;\n  uint32_t page_size;\n};\n\nstruct DataSegment {\n  explicit DataSegment(std::string_view name) : name(name) {}\n  uint8_t GetFlags(const Module*) const;\n\n  SegmentKind kind = SegmentKind::Active;\n  std::string name;\n  Var memory_var;\n  ExprList offset;\n  std::vector<uint8_t> data;\n};\n\nclass Import {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(Import);\n  Import() = delete;\n  virtual ~Import() = default;\n\n  ExternalKind kind() const { return kind_; }\n\n  std::string module_name;\n  std::string field_name;\n\n protected:\n  Import(ExternalKind kind) : kind_(kind) {}\n\n  ExternalKind kind_;\n};\n\ntemplate <ExternalKind TypeEnum>\nclass ImportMixin : public Import {\n public:\n  static bool classof(const Import* import) {\n    return import->kind() == TypeEnum;\n  }\n\n  ImportMixin() : Import(TypeEnum) {}\n};\n\nclass FuncImport : public ImportMixin<ExternalKind::Func> {\n public:\n  explicit FuncImport(std::string_view name = std::string_view())\n      : ImportMixin<ExternalKind::Func>(), func(name) {}\n\n  Func func;\n};\n\nclass TableImport : public ImportMixin<ExternalKind::Table> {\n public:\n  explicit TableImport(std::string_view name = std::string_view())\n      : ImportMixin<ExternalKind::Table>(), table(name) {}\n\n  Table table;\n};\n\nclass MemoryImport : public ImportMixin<ExternalKind::Memory> {\n public:\n  explicit MemoryImport(std::string_view name = std::string_view())\n      : ImportMixin<ExternalKind::Memory>(), memory(name) {}\n\n  Memory memory;\n};\n\nclass GlobalImport : public ImportMixin<ExternalKind::Global> {\n public:\n  explicit GlobalImport(std::string_view name = std::string_view())\n      : ImportMixin<ExternalKind::Global>(), global(name) {}\n\n  Global global;\n};\n\nclass TagImport : public ImportMixin<ExternalKind::Tag> {\n public:\n  explicit TagImport(std::string_view name = std::string_view())\n      : ImportMixin<ExternalKind::Tag>(), tag(name) {}\n\n  Tag tag;\n};\n\nstruct Export {\n  std::string name;\n  ExternalKind kind;\n  Var var;\n};\n\nenum class ModuleFieldType {\n  Func,\n  Global,\n  Import,\n  Export,\n  Type,\n  Table,\n  ElemSegment,\n  Memory,\n  DataSegment,\n  Start,\n  Tag\n};\n\nclass ModuleField : public intrusive_list_base<ModuleField> {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(ModuleField);\n  ModuleField() = delete;\n  virtual ~ModuleField() = default;\n\n  ModuleFieldType type() const { return type_; }\n\n  Location loc;\n\n protected:\n  ModuleField(ModuleFieldType type, const Location& loc)\n      : loc(loc), type_(type) {}\n\n  ModuleFieldType type_;\n};\n\nusing ModuleFieldList = intrusive_list<ModuleField>;\n\ntemplate <ModuleFieldType TypeEnum>\nclass ModuleFieldMixin : public ModuleField {\n public:\n  static bool classof(const ModuleField* field) {\n    return field->type() == TypeEnum;\n  }\n\n  explicit ModuleFieldMixin(const Location& loc) : ModuleField(TypeEnum, loc) {}\n};\n\nclass FuncModuleField : public ModuleFieldMixin<ModuleFieldType::Func> {\n public:\n  explicit FuncModuleField(const Location& loc = Location(),\n                           std::string_view name = std::string_view())\n      : ModuleFieldMixin<ModuleFieldType::Func>(loc), func(name) {}\n\n  Func func;\n};\n\nclass GlobalModuleField : public ModuleFieldMixin<ModuleFieldType::Global> {\n public:\n  explicit GlobalModuleField(const Location& loc = Location(),\n                             std::string_view name = std::string_view())\n      : ModuleFieldMixin<ModuleFieldType::Global>(loc), global(name) {}\n\n  Global global;\n};\n\nclass ImportModuleField : public ModuleFieldMixin<ModuleFieldType::Import> {\n public:\n  explicit ImportModuleField(const Location& loc = Location())\n      : ModuleFieldMixin<ModuleFieldType::Import>(loc) {}\n  explicit ImportModuleField(std::unique_ptr<Import> import,\n                             const Location& loc = Location())\n      : ModuleFieldMixin<ModuleFieldType::Import>(loc),\n        import(std::move(import)) {}\n\n  std::unique_ptr<Import> import;\n};\n\nclass ExportModuleField : public ModuleFieldMixin<ModuleFieldType::Export> {\n public:\n  explicit ExportModuleField(const Location& loc = Location())\n      : ModuleFieldMixin<ModuleFieldType::Export>(loc) {}\n\n  Export export_;\n};\n\nclass TypeModuleField : public ModuleFieldMixin<ModuleFieldType::Type> {\n public:\n  explicit TypeModuleField(const Location& loc = Location())\n      : ModuleFieldMixin<ModuleFieldType::Type>(loc) {}\n\n  std::unique_ptr<TypeEntry> type;\n};\n\nclass TableModuleField : public ModuleFieldMixin<ModuleFieldType::Table> {\n public:\n  explicit TableModuleField(const Location& loc = Location(),\n                            std::string_view name = std::string_view())\n      : ModuleFieldMixin<ModuleFieldType::Table>(loc), table(name) {}\n\n  Table table;\n};\n\nclass ElemSegmentModuleField\n    : public ModuleFieldMixin<ModuleFieldType::ElemSegment> {\n public:\n  explicit ElemSegmentModuleField(const Location& loc = Location(),\n                                  std::string_view name = std::string_view())\n      : ModuleFieldMixin<ModuleFieldType::ElemSegment>(loc),\n        elem_segment(name) {}\n\n  ElemSegment elem_segment;\n};\n\nclass MemoryModuleField : public ModuleFieldMixin<ModuleFieldType::Memory> {\n public:\n  explicit MemoryModuleField(const Location& loc = Location(),\n                             std::string_view name = std::string_view())\n      : ModuleFieldMixin<ModuleFieldType::Memory>(loc), memory(name) {}\n\n  Memory memory;\n};\n\nclass DataSegmentModuleField\n    : public ModuleFieldMixin<ModuleFieldType::DataSegment> {\n public:\n  explicit DataSegmentModuleField(const Location& loc = Location(),\n                                  std::string_view name = std::string_view())\n      : ModuleFieldMixin<ModuleFieldType::DataSegment>(loc),\n        data_segment(name) {}\n\n  DataSegment data_segment;\n};\n\nclass TagModuleField : public ModuleFieldMixin<ModuleFieldType::Tag> {\n public:\n  explicit TagModuleField(const Location& loc = Location(),\n                          std::string_view name = std::string_view())\n      : ModuleFieldMixin<ModuleFieldType::Tag>(loc), tag(name) {}\n\n  Tag tag;\n};\n\nclass StartModuleField : public ModuleFieldMixin<ModuleFieldType::Start> {\n public:\n  explicit StartModuleField(Var start = Var(), const Location& loc = Location())\n      : ModuleFieldMixin<ModuleFieldType::Start>(loc), start(start) {}\n\n  Var start;\n};\n\nstruct Custom {\n  explicit Custom(const Location& loc = Location(),\n                  std::string_view name = std::string_view(),\n                  std::vector<uint8_t> data = std::vector<uint8_t>())\n      : name(name), data(data), loc(loc) {}\n\n  std::string name;\n  std::vector<uint8_t> data;\n  Location loc;\n};\n\nstruct Module {\n  Index GetFuncTypeIndex(const Var&) const;\n  Index GetFuncTypeIndex(const FuncDeclaration&) const;\n  Index GetFuncTypeIndex(const FuncSignature&) const;\n  const FuncType* GetFuncType(const Var&) const;\n  FuncType* GetFuncType(const Var&);\n  Index GetFuncIndex(const Var&) const;\n  const Func* GetFunc(const Var&) const;\n  Func* GetFunc(const Var&);\n  Index GetTableIndex(const Var&) const;\n  const Table* GetTable(const Var&) const;\n  Table* GetTable(const Var&);\n  Index GetMemoryIndex(const Var&) const;\n  const Memory* GetMemory(const Var&) const;\n  Memory* GetMemory(const Var&);\n  Index GetGlobalIndex(const Var&) const;\n  const Global* GetGlobal(const Var&) const;\n  Global* GetGlobal(const Var&);\n  const Export* GetExport(std::string_view) const;\n  Tag* GetTag(const Var&) const;\n  Index GetTagIndex(const Var&) const;\n  const DataSegment* GetDataSegment(const Var&) const;\n  DataSegment* GetDataSegment(const Var&);\n  Index GetDataSegmentIndex(const Var&) const;\n  const ElemSegment* GetElemSegment(const Var&) const;\n  ElemSegment* GetElemSegment(const Var&);\n  Index GetElemSegmentIndex(const Var&) const;\n\n  bool IsImport(ExternalKind kind, const Var&) const;\n  bool IsImport(const Export& export_) const {\n    return IsImport(export_.kind, export_.var);\n  }\n\n  // TODO(binji): move this into a builder class?\n  void AppendField(std::unique_ptr<DataSegmentModuleField>);\n  void AppendField(std::unique_ptr<ElemSegmentModuleField>);\n  void AppendField(std::unique_ptr<TagModuleField>);\n  void AppendField(std::unique_ptr<ExportModuleField>);\n  void AppendField(std::unique_ptr<FuncModuleField>);\n  void AppendField(std::unique_ptr<TypeModuleField>);\n  void AppendField(std::unique_ptr<GlobalModuleField>);\n  void AppendField(std::unique_ptr<ImportModuleField>);\n  void AppendField(std::unique_ptr<MemoryModuleField>);\n  void AppendField(std::unique_ptr<StartModuleField>);\n  void AppendField(std::unique_ptr<TableModuleField>);\n  void AppendField(std::unique_ptr<ModuleField>);\n  void AppendFields(ModuleFieldList*);\n\n  Location loc;\n  std::string name;\n  ModuleFieldList fields;\n\n  Index num_tag_imports = 0;\n  Index num_func_imports = 0;\n  Index num_table_imports = 0;\n  Index num_memory_imports = 0;\n  Index num_global_imports = 0;\n\n  // Cached for convenience; the pointers are shared with values that are\n  // stored in either ModuleField or Import.\n  std::vector<Tag*> tags;\n  std::vector<Func*> funcs;\n  std::vector<Global*> globals;\n  std::vector<Import*> imports;\n  std::vector<Export*> exports;\n  std::vector<TypeEntry*> types;\n  std::vector<Table*> tables;\n  std::vector<ElemSegment*> elem_segments;\n  std::vector<Memory*> memories;\n  std::vector<DataSegment*> data_segments;\n  std::vector<Var*> starts;\n  std::vector<Custom> customs;\n\n  BindingHash tag_bindings;\n  BindingHash func_bindings;\n  BindingHash global_bindings;\n  BindingHash export_bindings;\n  BindingHash type_bindings;\n  BindingHash table_bindings;\n  BindingHash memory_bindings;\n  BindingHash data_segment_bindings;\n  BindingHash elem_segment_bindings;\n\n  // For a subset of features, the BinaryReaderIR tracks whether they are\n  // actually used by the module. wasm2c (CWriter) uses this information to\n  // limit its output in some cases.\n  struct {\n    bool simd = false;\n    bool exceptions = false;\n    bool threads = false;\n  } features_used;\n\n  // The BinaryReaderIR tracks function references used by the module, whether\n  // in element segment initializers, global initializers, or functions. wasm2c\n  // needs to emit wrappers for any functions that might get used as function\n  // references, and uses this information to limit its output.\n  std::set<Index> used_func_refs;\n};\n\nenum class ScriptModuleType {\n  Text,\n  Binary,\n  Quoted,\n};\n\n// A ScriptModule is a module that may not yet be decoded. This allows for text\n// and binary parsing errors to be deferred until validation time.\nclass ScriptModule {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(ScriptModule);\n  ScriptModule() = delete;\n  virtual ~ScriptModule() = default;\n\n  ScriptModuleType type() const { return type_; }\n  virtual const Location& location() const = 0;\n\n protected:\n  explicit ScriptModule(ScriptModuleType type) : type_(type) {}\n\n  ScriptModuleType type_;\n};\n\ntemplate <ScriptModuleType TypeEnum>\nclass ScriptModuleMixin : public ScriptModule {\n public:\n  static bool classof(const ScriptModule* script_module) {\n    return script_module->type() == TypeEnum;\n  }\n\n  ScriptModuleMixin() : ScriptModule(TypeEnum) {}\n};\n\nclass TextScriptModule : public ScriptModuleMixin<ScriptModuleType::Text> {\n public:\n  const Location& location() const override { return module.loc; }\n\n  Module module;\n};\n\ntemplate <ScriptModuleType TypeEnum>\nclass DataScriptModule : public ScriptModuleMixin<TypeEnum> {\n public:\n  const Location& location() const override { return loc; }\n\n  Location loc;\n  std::string name;\n  std::vector<uint8_t> data;\n};\n\nusing BinaryScriptModule = DataScriptModule<ScriptModuleType::Binary>;\nusing QuotedScriptModule = DataScriptModule<ScriptModuleType::Quoted>;\n\nenum class ActionType {\n  Invoke,\n  Get,\n};\n\nclass Action {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(Action);\n  Action() = delete;\n  virtual ~Action() = default;\n\n  ActionType type() const { return type_; }\n\n  Location loc;\n  Var module_var;\n  std::string name;\n\n protected:\n  explicit Action(ActionType type, const Location& loc = Location())\n      : loc(loc), type_(type) {}\n\n  ActionType type_;\n};\n\nusing ActionPtr = std::unique_ptr<Action>;\n\ntemplate <ActionType TypeEnum>\nclass ActionMixin : public Action {\n public:\n  static bool classof(const Action* action) {\n    return action->type() == TypeEnum;\n  }\n\n  explicit ActionMixin(const Location& loc = Location())\n      : Action(TypeEnum, loc) {}\n};\n\nclass GetAction : public ActionMixin<ActionType::Get> {\n public:\n  explicit GetAction(const Location& loc = Location())\n      : ActionMixin<ActionType::Get>(loc) {}\n};\n\nclass InvokeAction : public ActionMixin<ActionType::Invoke> {\n public:\n  explicit InvokeAction(const Location& loc = Location())\n      : ActionMixin<ActionType::Invoke>(loc) {}\n\n  ConstVector args;\n};\n\nenum class CommandType {\n  Module,\n  ScriptModule,\n  Action,\n  Register,\n  AssertMalformed,\n  AssertInvalid,\n  AssertUnlinkable,\n  AssertUninstantiable,\n  AssertReturn,\n  AssertTrap,\n  AssertExhaustion,\n  AssertException,\n\n  First = Module,\n  Last = AssertException,\n};\nconstexpr int kCommandTypeCount = WABT_ENUM_COUNT(CommandType);\n\nclass Command {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(Command);\n  Command() = delete;\n  virtual ~Command() = default;\n\n  CommandType type;\n\n protected:\n  explicit Command(CommandType type) : type(type) {}\n};\n\ntemplate <CommandType TypeEnum>\nclass CommandMixin : public Command {\n public:\n  static bool classof(const Command* cmd) { return cmd->type == TypeEnum; }\n  CommandMixin() : Command(TypeEnum) {}\n};\n\nclass ModuleCommand : public CommandMixin<CommandType::Module> {\n public:\n  Module module;\n};\n\nclass ScriptModuleCommand : public CommandMixin<CommandType::ScriptModule> {\n public:\n  // Both the module and the script_module need to be stored since the module\n  // has the parsed information about the module, but the script_module has the\n  // original contents (binary or quoted).\n  Module module;\n  std::unique_ptr<ScriptModule> script_module;\n};\n\ntemplate <CommandType TypeEnum>\nclass ActionCommandBase : public CommandMixin<TypeEnum> {\n public:\n  ActionPtr action;\n};\n\nusing ActionCommand = ActionCommandBase<CommandType::Action>;\n\nclass RegisterCommand : public CommandMixin<CommandType::Register> {\n public:\n  RegisterCommand(std::string_view module_name, const Var& var)\n      : module_name(module_name), var(var) {}\n\n  std::string module_name;\n  Var var;\n};\n\nclass AssertReturnCommand : public CommandMixin<CommandType::AssertReturn> {\n public:\n  ActionPtr action;\n  ExpectationPtr expected;\n};\n\ntemplate <CommandType TypeEnum>\nclass AssertTrapCommandBase : public CommandMixin<TypeEnum> {\n public:\n  ActionPtr action;\n  std::string text;\n};\n\nusing AssertTrapCommand = AssertTrapCommandBase<CommandType::AssertTrap>;\nusing AssertExhaustionCommand =\n    AssertTrapCommandBase<CommandType::AssertExhaustion>;\n\ntemplate <CommandType TypeEnum>\nclass AssertModuleCommand : public CommandMixin<TypeEnum> {\n public:\n  std::unique_ptr<ScriptModule> module;\n  std::string text;\n};\n\nusing AssertMalformedCommand =\n    AssertModuleCommand<CommandType::AssertMalformed>;\nusing AssertInvalidCommand = AssertModuleCommand<CommandType::AssertInvalid>;\nusing AssertUnlinkableCommand =\n    AssertModuleCommand<CommandType::AssertUnlinkable>;\nusing AssertUninstantiableCommand =\n    AssertModuleCommand<CommandType::AssertUninstantiable>;\n\nclass AssertExceptionCommand\n    : public CommandMixin<CommandType::AssertException> {\n public:\n  ActionPtr action;\n};\n\nusing CommandPtr = std::unique_ptr<Command>;\nusing CommandPtrVector = std::vector<CommandPtr>;\n\nstruct Script {\n  WABT_DISALLOW_COPY_AND_ASSIGN(Script);\n  Script() = default;\n\n  const Module* GetFirstModule() const;\n  Module* GetFirstModule();\n  const Module* GetModule(const Var&) const;\n\n  CommandPtrVector commands;\n  BindingHash module_bindings;\n};\n\nvoid MakeTypeBindingReverseMapping(\n    size_t num_types,\n    const BindingHash& bindings,\n    std::vector<std::string>* out_reverse_mapping);\n\n}  // namespace wabt\n\n#endif /* WABT_IR_H_ */\n"
  },
  {
    "path": "include/wabt/leb128.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_LEB128_H_\n#define WABT_LEB128_H_\n\n#include <cstdint>\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nclass Stream;\n\n// Returns the length of the leb128.\nOffset U32Leb128Length(uint32_t value);\n\nvoid WriteU32Leb128(Stream* stream, uint32_t value, const char* desc);\nvoid WriteS32Leb128(Stream* stream, uint32_t value, const char* desc);\nvoid WriteU64Leb128(Stream* stream, uint64_t value, const char* desc);\nvoid WriteS64Leb128(Stream* stream, uint64_t value, const char* desc);\nvoid WriteFixedS32Leb128(Stream* stream, uint32_t value, const char* desc);\nvoid WriteFixedU32Leb128(Stream* stream, uint32_t value, const char* desc);\n\nOffset WriteU32Leb128At(Stream* stream,\n                        Offset offset,\n                        uint32_t value,\n                        const char* desc);\n\nOffset WriteFixedU32Leb128At(Stream* stream,\n                             Offset offset,\n                             uint32_t value,\n                             const char* desc);\n\nOffset WriteU32Leb128Raw(uint8_t* data, uint8_t* end, uint32_t value);\nOffset WriteFixedU32Leb128Raw(uint8_t* data, uint8_t* end, uint32_t value);\n\n// Convenience functions for writing enums as LEB128s.\ntemplate <typename T>\nvoid WriteU32Leb128(Stream* stream, T value, const char* desc) {\n  WriteU32Leb128(stream, static_cast<uint32_t>(value), desc);\n}\n\ntemplate <typename T>\nvoid WriteS32Leb128(Stream* stream, T value, const char* desc) {\n  WriteS32Leb128(stream, static_cast<uint32_t>(value), desc);\n}\n\n// Returns the length of the leb128.\nsize_t ReadU32Leb128(const uint8_t* p, const uint8_t* end, uint32_t* out_value);\nsize_t ReadU64Leb128(const uint8_t* p, const uint8_t* end, uint64_t* out_value);\nsize_t ReadS32Leb128(const uint8_t* p, const uint8_t* end, uint32_t* out_value);\nsize_t ReadS64Leb128(const uint8_t* p, const uint8_t* end, uint64_t* out_value);\n\n}  // namespace wabt\n\n#endif  // WABT_LEB128_H_\n"
  },
  {
    "path": "include/wabt/lexer-source-line-finder.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_LEXER_SOURCE_LINE_FINDER_H_\n#define WABT_LEXER_SOURCE_LINE_FINDER_H_\n\n#include <memory>\n#include <string>\n#include <vector>\n\n#include \"wabt/common.h\"\n#include \"wabt/lexer-source.h\"\n#include \"wabt/range.h\"\n\nnamespace wabt {\n\nclass LexerSourceLineFinder {\n public:\n  struct SourceLine {\n    std::string line;\n    int column_offset;\n  };\n\n  explicit LexerSourceLineFinder(std::unique_ptr<LexerSource>);\n\n  Result GetSourceLine(const Location& loc,\n                       Offset max_line_length,\n                       SourceLine* out_source_line);\n  Result GetLineOffsets(int line, OffsetRange* out_offsets);\n\n private:\n  static OffsetRange ClampSourceLineOffsets(OffsetRange line_offset_range,\n                                            ColumnRange column_range,\n                                            Offset max_line_length);\n\n  bool IsLineCached(int line) const;\n  OffsetRange GetCachedLine(int line) const;\n\n  std::unique_ptr<LexerSource> source_;\n  std::vector<OffsetRange> line_ranges_;\n  Offset next_line_start_;\n  bool last_cr_;  // Last read character was a '\\r' (carriage return).\n  bool eof_;\n};\n\n}  // namespace wabt\n\n#endif  // WABT_LEXER_SOURCE_LINE_FINDER_H_\n"
  },
  {
    "path": "include/wabt/lexer-source.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_LEXER_SOURCE_H_\n#define WABT_LEXER_SOURCE_H_\n\n#include <cstddef>\n#include <memory>\n#include <string>\n#include <vector>\n\n#include \"wabt/common.h\"\n#include \"wabt/range.h\"\n\nnamespace wabt {\n\nclass LexerSource {\n public:\n  LexerSource(const void* data, Offset size);\n\n  std::unique_ptr<LexerSource> Clone();\n  Result Tell(Offset* out_offset);\n  size_t Fill(void* dest, size_t size);\n  Result ReadRange(OffsetRange, std::vector<char>* out_data);\n  Result Seek(Offset offset);\n\n  WABT_DISALLOW_COPY_AND_ASSIGN(LexerSource);\n\n  const void* data() { return data_; }\n  Offset size() { return size_; }\n\n private:\n  const void* data_;\n  Offset size_;\n  Offset read_offset_;\n};\n\n}  // namespace wabt\n\n#endif  // WABT_LEXER_SOURCE_H_\n"
  },
  {
    "path": "include/wabt/literal.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_LITERAL_H_\n#define WABT_LITERAL_H_\n\n#include <cstdint>\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\n// These functions all return Result::Ok on success and Result::Error on\n// failure.\n//\n// NOTE: the functions are written for use with wast-lexer, assuming that the\n// literal has already matched the patterns defined there. As a result, the\n// only validation that is done is for overflow, not for otherwise bogus input.\n\nenum class LiteralType {\n  Int,\n  Float,\n  Hexfloat,\n  Infinity,\n  Nan,\n};\n\nenum class ParseIntType {\n  UnsignedOnly = 0,\n  SignedAndUnsigned = 1,\n};\n\n/* Size of char buffer required to hold hex representation of a float/double */\n#define WABT_MAX_FLOAT_HEX 20\n#define WABT_MAX_DOUBLE_HEX 40\n\nResult ParseHexdigit(char c, uint32_t* out);\nResult ParseInt8(const char* s,\n                 const char* end,\n                 uint8_t* out,\n                 ParseIntType parse_type);\nResult ParseInt16(const char* s,\n                  const char* end,\n                  uint16_t* out,\n                  ParseIntType parse_type);\nResult ParseInt32(const char* s,\n                  const char* end,\n                  uint32_t* out,\n                  ParseIntType parse_type);\nResult ParseInt64(const char* s,\n                  const char* end,\n                  uint64_t* out,\n                  ParseIntType parse_type);\nResult ParseUint64(const char* s, const char* end, uint64_t* out);\nResult ParseUint128(const char* s, const char* end, v128* out);\nResult ParseFloat(LiteralType literal_type,\n                  const char* s,\n                  const char* end,\n                  uint32_t* out_bits);\nResult ParseDouble(LiteralType literal_type,\n                   const char* s,\n                   const char* end,\n                   uint64_t* out_bits);\n\n// Same as above but taking a string_view\ninline Result ParseInt8(std::string_view v,\n                        uint8_t* out,\n                        ParseIntType parse_type) {\n  return ParseInt8(v.data(), v.data() + v.size(), out, parse_type);\n}\n\ninline Result ParseInt16(std::string_view v,\n                         uint16_t* out,\n                         ParseIntType parse_type) {\n  return ParseInt16(v.data(), v.data() + v.size(), out, parse_type);\n}\n\ninline Result ParseInt32(std::string_view v,\n                         uint32_t* out,\n                         ParseIntType parse_type) {\n  return ParseInt32(v.data(), v.data() + v.size(), out, parse_type);\n}\n\ninline Result ParseInt64(std::string_view v,\n                         uint64_t* out,\n                         ParseIntType parse_type) {\n  return ParseInt64(v.data(), v.data() + v.size(), out, parse_type);\n}\n\ninline Result ParseUint64(std::string_view v, uint64_t* out) {\n  return ParseUint64(v.data(), v.data() + v.size(), out);\n}\n\ninline Result ParseUint128(std::string_view v, v128* out) {\n  return ParseUint128(v.data(), v.data() + v.size(), out);\n}\n\ninline Result ParseFloat(LiteralType literal_type,\n                         std::string_view v,\n                         uint32_t* out_bits) {\n  return ParseFloat(literal_type, v.data(), v.data() + v.size(), out_bits);\n}\n\ninline Result ParseDouble(LiteralType literal_type,\n                          std::string_view v,\n                          uint64_t* out_bits) {\n  return ParseDouble(literal_type, v.data(), v.data() + v.size(), out_bits);\n}\n\nvoid WriteFloatHex(char* buffer, size_t size, uint32_t bits);\nvoid WriteDoubleHex(char* buffer, size_t size, uint64_t bits);\nvoid WriteUint128(char* buffer, size_t size, v128 bits);\n\n}  // namespace wabt\n\n#endif /* WABT_LITERAL_H_ */\n"
  },
  {
    "path": "include/wabt/opcode-code-table.h",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_OPCODE_CODE_TABLE_H_\n#define WABT_OPCODE_CODE_TABLE_H_\n\n#include <stdint.h>\n#include <stdlib.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define WABT_OPCODE_CODE_TABLE_SIZE 131072\n\n/*\n * Number of bits required to store an opcode\n */\n#define MAX_OPCODE_BITS 9\n\n/* This structure is defined in C because C++ doesn't (yet) allow you to use\n * designated array initializers, i.e. [10] = {foo}.\n */\nextern uint32_t WabtOpcodeCodeTable[WABT_OPCODE_CODE_TABLE_SIZE];\n\n#ifdef __cplusplus\n} /* extern \"C\" */\n#endif\n\n#endif /* WABT_OPCODE_CODE_TABLE_H_ */\n"
  },
  {
    "path": "include/wabt/opcode.def",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_OPCODE\n#error \"You must define WABT_OPCODE before including this file.\"\n#endif\n\n/* *** NOTE *** This list must be kept sorted so it can be binary searched */\n\n/*\n *     tr1: result type\n *     tr2: secord result type (for instruciton that return 2 values)\n *     t1: type of the 1st parameter\n *     t2: type of the 2nd parameter\n *     t3: type of the 3rd parameter\n *      m: memory size of the operation, if any\n * prefix: the 1-byte opcode prefix, if any\n *   code: opcode\n *   Name: used to generate the opcode enum\n *   text: a string of the opcode name in the text format\n * decomp: an optional friendly version of text, used for decompilation.\n *\n *          tr   tr2   t1    t2    t3    m  prefix code  Name text\n * ==============================================================  */\n\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x00, Unreachable, \"unreachable\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x01, Nop, \"nop\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x02, Block, \"block\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x03, Loop, \"loop\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x04, If, \"if\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x05, Else, \"else\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x06, Try, \"try\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x07, Catch, \"catch\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x08, Throw, \"throw\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x09, Rethrow, \"rethrow\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x0a, ThrowRef, \"throw_ref\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x0b, End, \"end\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x0c, Br, \"br\", \"\")\nWABT_OPCODE(___, ___,  I32,  ___,  ___,  0,  0,    0x0d, BrIf, \"br_if\", \"\")\nWABT_OPCODE(___, ___,  I32,  ___,  ___,  0,  0,    0x0e, BrTable, \"br_table\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x0f, Return, \"return\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x10, Call, \"call\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x11, CallIndirect, \"call_indirect\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x12, ReturnCall, \"return_call\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x13, ReturnCallIndirect, \"return_call_indirect\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x14, CallRef, \"call_ref\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x15, ReturnCallRef, \"return_call_ref\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x18, Delegate, \"delegate\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x19, CatchAll, \"catch_all\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x1a, Drop, \"drop\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  I32,  0,  0,    0x1b, Select, \"select\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  I32,  0,  0,    0x1c, SelectT, \"select\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x1f, TryTable, \"try_table\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x20, LocalGet, \"local.get\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x21, LocalSet, \"local.set\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x22, LocalTee, \"local.tee\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x23, GlobalGet, \"global.get\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0x24, GlobalSet, \"global.set\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  4,  0,    0x28, I32Load, \"i32.load\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  8,  0,    0x29, I64Load, \"i64.load\", \"\")\nWABT_OPCODE(F32, ___,  I32,  ___,  ___,  4,  0,    0x2a, F32Load, \"f32.load\", \"\")\nWABT_OPCODE(F64, ___,  I32,  ___,  ___,  8,  0,    0x2b, F64Load, \"f64.load\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  1,  0,    0x2c, I32Load8S, \"i32.load8_s\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  1,  0,    0x2d, I32Load8U, \"i32.load8_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  2,  0,    0x2e, I32Load16S, \"i32.load16_s\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  2,  0,    0x2f, I32Load16U, \"i32.load16_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  1,  0,    0x30, I64Load8S, \"i64.load8_s\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  1,  0,    0x31, I64Load8U, \"i64.load8_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  2,  0,    0x32, I64Load16S, \"i64.load16_s\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  2,  0,    0x33, I64Load16U, \"i64.load16_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  4,  0,    0x34, I64Load32S, \"i64.load32_s\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  4,  0,    0x35, I64Load32U, \"i64.load32_u\", \"\")\nWABT_OPCODE(___, ___,  I32,  I32,  ___,  4,  0,    0x36, I32Store, \"i32.store\", \"\")\nWABT_OPCODE(___, ___,  I32,  I64,  ___,  8,  0,    0x37, I64Store, \"i64.store\", \"\")\nWABT_OPCODE(___, ___,  I32,  F32,  ___,  4,  0,    0x38, F32Store, \"f32.store\", \"\")\nWABT_OPCODE(___, ___,  I32,  F64,  ___,  8,  0,    0x39, F64Store, \"f64.store\", \"\")\nWABT_OPCODE(___, ___,  I32,  I32,  ___,  1,  0,    0x3a, I32Store8, \"i32.store8\", \"\")\nWABT_OPCODE(___, ___,  I32,  I32,  ___,  2,  0,    0x3b, I32Store16, \"i32.store16\", \"\")\nWABT_OPCODE(___, ___,  I32,  I64,  ___,  1,  0,    0x3c, I64Store8, \"i64.store8\", \"\")\nWABT_OPCODE(___, ___,  I32,  I64,  ___,  2,  0,    0x3d, I64Store16, \"i64.store16\", \"\")\nWABT_OPCODE(___, ___,  I32,  I64,  ___,  4,  0,    0x3e, I64Store32, \"i64.store32\", \"\")\nWABT_OPCODE(I32, ___,  ___,  ___,  ___,  0,  0,    0x3f, MemorySize, \"memory.size\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  0,  0,    0x40, MemoryGrow, \"memory.grow\", \"\")\nWABT_OPCODE(I32, ___,  ___,  ___,  ___,  0,  0,    0x41, I32Const, \"i32.const\", \"\")\nWABT_OPCODE(I64, ___,  ___,  ___,  ___,  0,  0,    0x42, I64Const, \"i64.const\", \"\")\nWABT_OPCODE(F32, ___,  ___,  ___,  ___,  0,  0,    0x43, F32Const, \"f32.const\", \"\")\nWABT_OPCODE(F64, ___,  ___,  ___,  ___,  0,  0,    0x44, F64Const, \"f64.const\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  0,  0,    0x45, I32Eqz, \"i32.eqz\", \"eqz\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x46, I32Eq, \"i32.eq\", \"==\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x47, I32Ne, \"i32.ne\", \"!=\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x48, I32LtS, \"i32.lt_s\", \"<\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x49, I32LtU, \"i32.lt_u\", \"<\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x4a, I32GtS, \"i32.gt_s\", \">\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x4b, I32GtU, \"i32.gt_u\", \">\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x4c, I32LeS, \"i32.le_s\", \"<=\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x4d, I32LeU, \"i32.le_u\", \"<=\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x4e, I32GeS, \"i32.ge_s\", \">=\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x4f, I32GeU, \"i32.ge_u\", \">=\")\nWABT_OPCODE(I32, ___,  I64,  ___,  ___,  0,  0,    0x50, I64Eqz, \"i64.eqz\", \"eqz\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x51, I64Eq, \"i64.eq\", \"==\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x52, I64Ne, \"i64.ne\", \"!=\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x53, I64LtS, \"i64.lt_s\", \"<\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x54, I64LtU, \"i64.lt_u\", \"<\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x55, I64GtS, \"i64.gt_s\", \">\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x56, I64GtU, \"i64.gt_u\", \">\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x57, I64LeS, \"i64.le_s\", \"<=\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x58, I64LeU, \"i64.le_u\", \"<=\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x59, I64GeS, \"i64.ge_s\", \">=\")\nWABT_OPCODE(I32, ___,  I64,  I64,  ___,  0,  0,    0x5a, I64GeU, \"i64.ge_u\", \">=\")\nWABT_OPCODE(I32, ___,  F32,  F32,  ___,  0,  0,    0x5b, F32Eq, \"f32.eq\", \"==\")\nWABT_OPCODE(I32, ___,  F32,  F32,  ___,  0,  0,    0x5c, F32Ne, \"f32.ne\", \"!=\")\nWABT_OPCODE(I32, ___,  F32,  F32,  ___,  0,  0,    0x5d, F32Lt, \"f32.lt\", \"<\")\nWABT_OPCODE(I32, ___,  F32,  F32,  ___,  0,  0,    0x5e, F32Gt, \"f32.gt\", \">\")\nWABT_OPCODE(I32, ___,  F32,  F32,  ___,  0,  0,    0x5f, F32Le, \"f32.le\", \"<=\")\nWABT_OPCODE(I32, ___,  F32,  F32,  ___,  0,  0,    0x60, F32Ge, \"f32.ge\", \">=\")\nWABT_OPCODE(I32, ___,  F64,  F64,  ___,  0,  0,    0x61, F64Eq, \"f64.eq\", \"==\")\nWABT_OPCODE(I32, ___,  F64,  F64,  ___,  0,  0,    0x62, F64Ne, \"f64.ne\", \"!=\")\nWABT_OPCODE(I32, ___,  F64,  F64,  ___,  0,  0,    0x63, F64Lt, \"f64.lt\", \"<\")\nWABT_OPCODE(I32, ___,  F64,  F64,  ___,  0,  0,    0x64, F64Gt, \"f64.gt\", \">\")\nWABT_OPCODE(I32, ___,  F64,  F64,  ___,  0,  0,    0x65, F64Le, \"f64.le\", \"<=\")\nWABT_OPCODE(I32, ___,  F64,  F64,  ___,  0,  0,    0x66, F64Ge, \"f64.ge\", \">=\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  0,  0,    0x67, I32Clz, \"i32.clz\", \"clz\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  0,  0,    0x68, I32Ctz, \"i32.ctz\", \"ctz\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  0,  0,    0x69, I32Popcnt, \"i32.popcnt\", \"popcnt\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x6a, I32Add, \"i32.add\", \"+\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x6b, I32Sub, \"i32.sub\", \"-\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x6c, I32Mul, \"i32.mul\", \"*\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x6d, I32DivS, \"i32.div_s\", \"/\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x6e, I32DivU, \"i32.div_u\", \"/\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x6f, I32RemS, \"i32.rem_s\", \"%\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x70, I32RemU, \"i32.rem_u\", \"%\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x71, I32And, \"i32.and\", \"&\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x72, I32Or, \"i32.or\", \"|\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x73, I32Xor, \"i32.xor\", \"^\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x74, I32Shl, \"i32.shl\", \"<<\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x75, I32ShrS, \"i32.shr_s\", \">>\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x76, I32ShrU, \"i32.shr_u\", \">>\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x77, I32Rotl, \"i32.rotl\", \"<<\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  0,  0,    0x78, I32Rotr, \"i32.rotr\", \">>\")\nWABT_OPCODE(I64, ___,  I64,  ___,  ___,  0,  0,    0x79, I64Clz, \"i64.clz\", \"clz\")\nWABT_OPCODE(I64, ___,  I64,  ___,  ___,  0,  0,    0x7a, I64Ctz, \"i64.ctz\", \"ctz\")\nWABT_OPCODE(I64, ___,  I64,  ___,  ___,  0,  0,    0x7b, I64Popcnt, \"i64.popcnt\", \"popcnt\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x7c, I64Add, \"i64.add\", \"+\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x7d, I64Sub, \"i64.sub\", \"-\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x7e, I64Mul, \"i64.mul\", \"*\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x7f, I64DivS, \"i64.div_s\", \"/\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x80, I64DivU, \"i64.div_u\", \"/\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x81, I64RemS, \"i64.rem_s\", \"%\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x82, I64RemU, \"i64.rem_u\", \"%\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x83, I64And, \"i64.and\", \"&\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x84, I64Or, \"i64.or\", \"|\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x85, I64Xor, \"i64.xor\", \"^\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x86, I64Shl, \"i64.shl\", \"<<\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x87, I64ShrS, \"i64.shr_s\", \">>\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x88, I64ShrU, \"i64.shr_u\", \">>\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x89, I64Rotl, \"i64.rotl\", \"<<\")\nWABT_OPCODE(I64, ___,  I64,  I64,  ___,  0,  0,    0x8a, I64Rotr, \"i64.rotr\", \">>\")\nWABT_OPCODE(F32, ___,  F32,  ___,  ___,  0,  0,    0x8b, F32Abs, \"f32.abs\", \"abs\")\nWABT_OPCODE(F32, ___,  F32,  ___,  ___,  0,  0,    0x8c, F32Neg, \"f32.neg\", \"-\")\nWABT_OPCODE(F32, ___,  F32,  ___,  ___,  0,  0,    0x8d, F32Ceil, \"f32.ceil\", \"ceil\")\nWABT_OPCODE(F32, ___,  F32,  ___,  ___,  0,  0,    0x8e, F32Floor, \"f32.floor\", \"floor\")\nWABT_OPCODE(F32, ___,  F32,  ___,  ___,  0,  0,    0x8f, F32Trunc, \"f32.trunc\", \"trunc\")\nWABT_OPCODE(F32, ___,  F32,  ___,  ___,  0,  0,    0x90, F32Nearest, \"f32.nearest\", \"nearest\")\nWABT_OPCODE(F32, ___,  F32,  ___,  ___,  0,  0,    0x91, F32Sqrt, \"f32.sqrt\", \"sqrt\")\nWABT_OPCODE(F32, ___,  F32,  F32,  ___,  0,  0,    0x92, F32Add, \"f32.add\", \"+\")\nWABT_OPCODE(F32, ___,  F32,  F32,  ___,  0,  0,    0x93, F32Sub, \"f32.sub\", \"-\")\nWABT_OPCODE(F32, ___,  F32,  F32,  ___,  0,  0,    0x94, F32Mul, \"f32.mul\", \"*\")\nWABT_OPCODE(F32, ___,  F32,  F32,  ___,  0,  0,    0x95, F32Div, \"f32.div\", \"/\")\nWABT_OPCODE(F32, ___,  F32,  F32,  ___,  0,  0,    0x96, F32Min, \"f32.min\", \"min\")\nWABT_OPCODE(F32, ___,  F32,  F32,  ___,  0,  0,    0x97, F32Max, \"f32.max\", \"max\")\nWABT_OPCODE(F32, ___,  F32,  F32,  ___,  0,  0,    0x98, F32Copysign, \"f32.copysign\", \"copysign\")\nWABT_OPCODE(F64, ___,  F64,  ___,  ___,  0,  0,    0x99, F64Abs, \"f64.abs\", \"abs\")\nWABT_OPCODE(F64, ___,  F64,  ___,  ___,  0,  0,    0x9a, F64Neg, \"f64.neg\", \"-\")\nWABT_OPCODE(F64, ___,  F64,  ___,  ___,  0,  0,    0x9b, F64Ceil, \"f64.ceil\", \"ceil\")\nWABT_OPCODE(F64, ___,  F64,  ___,  ___,  0,  0,    0x9c, F64Floor, \"f64.floor\", \"floor\")\nWABT_OPCODE(F64, ___,  F64,  ___,  ___,  0,  0,    0x9d, F64Trunc, \"f64.trunc\", \"trunc\")\nWABT_OPCODE(F64, ___,  F64,  ___,  ___,  0,  0,    0x9e, F64Nearest, \"f64.nearest\", \"nearest\")\nWABT_OPCODE(F64, ___,  F64,  ___,  ___,  0,  0,    0x9f, F64Sqrt, \"f64.sqrt\", \"sqrt\")\nWABT_OPCODE(F64, ___,  F64,  F64,  ___,  0,  0,    0xa0, F64Add, \"f64.add\", \"+\")\nWABT_OPCODE(F64, ___,  F64,  F64,  ___,  0,  0,    0xa1, F64Sub, \"f64.sub\", \"-\")\nWABT_OPCODE(F64, ___,  F64,  F64,  ___,  0,  0,    0xa2, F64Mul, \"f64.mul\", \"*\")\nWABT_OPCODE(F64, ___,  F64,  F64,  ___,  0,  0,    0xa3, F64Div, \"f64.div\", \"/\")\nWABT_OPCODE(F64, ___,  F64,  F64,  ___,  0,  0,    0xa4, F64Min, \"f64.min\", \"min\")\nWABT_OPCODE(F64, ___,  F64,  F64,  ___,  0,  0,    0xa5, F64Max, \"f64.max\", \"max\")\nWABT_OPCODE(F64, ___,  F64,  F64,  ___,  0,  0,    0xa6, F64Copysign, \"f64.copysign\", \"copysign\")\nWABT_OPCODE(I32, ___,  I64,  ___,  ___,  0,  0,    0xa7, I32WrapI64, \"i32.wrap_i64\", \"\")\nWABT_OPCODE(I32, ___,  F32,  ___,  ___,  0,  0,    0xa8, I32TruncF32S, \"i32.trunc_f32_s\", \"\")\nWABT_OPCODE(I32, ___,  F32,  ___,  ___,  0,  0,    0xa9, I32TruncF32U, \"i32.trunc_f32_u\", \"\")\nWABT_OPCODE(I32, ___,  F64,  ___,  ___,  0,  0,    0xaa, I32TruncF64S, \"i32.trunc_f64_s\", \"\")\nWABT_OPCODE(I32, ___,  F64,  ___,  ___,  0,  0,    0xab, I32TruncF64U, \"i32.trunc_f64_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  0,  0,    0xac, I64ExtendI32S, \"i64.extend_i32_s\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  0,  0,    0xad, I64ExtendI32U, \"i64.extend_i32_u\", \"\")\nWABT_OPCODE(I64, ___,  F32,  ___,  ___,  0,  0,    0xae, I64TruncF32S, \"i64.trunc_f32_s\", \"\")\nWABT_OPCODE(I64, ___,  F32,  ___,  ___,  0,  0,    0xaf, I64TruncF32U, \"i64.trunc_f32_u\", \"\")\nWABT_OPCODE(I64, ___,  F64,  ___,  ___,  0,  0,    0xb0, I64TruncF64S, \"i64.trunc_f64_s\", \"\")\nWABT_OPCODE(I64, ___,  F64,  ___,  ___,  0,  0,    0xb1, I64TruncF64U, \"i64.trunc_f64_u\", \"\")\nWABT_OPCODE(F32, ___,  I32,  ___,  ___,  0,  0,    0xb2, F32ConvertI32S, \"f32.convert_i32_s\", \"\")\nWABT_OPCODE(F32, ___,  I32,  ___,  ___,  0,  0,    0xb3, F32ConvertI32U, \"f32.convert_i32_u\", \"\")\nWABT_OPCODE(F32, ___,  I64,  ___,  ___,  0,  0,    0xb4, F32ConvertI64S, \"f32.convert_i64_s\", \"\")\nWABT_OPCODE(F32, ___,  I64,  ___,  ___,  0,  0,    0xb5, F32ConvertI64U, \"f32.convert_i64_u\", \"\")\nWABT_OPCODE(F32, ___,  F64,  ___,  ___,  0,  0,    0xb6, F32DemoteF64, \"f32.demote_f64\", \"\")\nWABT_OPCODE(F64, ___,  I32,  ___,  ___,  0,  0,    0xb7, F64ConvertI32S, \"f64.convert_i32_s\", \"\")\nWABT_OPCODE(F64, ___,  I32,  ___,  ___,  0,  0,    0xb8, F64ConvertI32U, \"f64.convert_i32_u\", \"\")\nWABT_OPCODE(F64, ___,  I64,  ___,  ___,  0,  0,    0xb9, F64ConvertI64S, \"f64.convert_i64_s\", \"\")\nWABT_OPCODE(F64, ___,  I64,  ___,  ___,  0,  0,    0xba, F64ConvertI64U, \"f64.convert_i64_u\", \"\")\nWABT_OPCODE(F64, ___,  F32,  ___,  ___,  0,  0,    0xbb, F64PromoteF32, \"f64.promote_f32\", \"\")\nWABT_OPCODE(I32, ___,  F32,  ___,  ___,  0,  0,    0xbc, I32ReinterpretF32, \"i32.reinterpret_f32\", \"\")\nWABT_OPCODE(I64, ___,  F64,  ___,  ___,  0,  0,    0xbd, I64ReinterpretF64, \"i64.reinterpret_f64\", \"\")\nWABT_OPCODE(F32, ___,  I32,  ___,  ___,  0,  0,    0xbe, F32ReinterpretI32, \"f32.reinterpret_i32\", \"\")\nWABT_OPCODE(F64, ___,  I64,  ___,  ___,  0,  0,    0xbf, F64ReinterpretI64, \"f64.reinterpret_i64\", \"\")\n\n/* Sign-extension opcodes (--enable-sign-extension) */\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  0,  0,    0xC0, I32Extend8S, \"i32.extend8_s\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  0,  0,    0xC1, I32Extend16S, \"i32.extend16_s\", \"\")\nWABT_OPCODE(I64, ___,  I64,  ___,  ___,  0,  0,    0xC2, I64Extend8S, \"i64.extend8_s\", \"\")\nWABT_OPCODE(I64, ___,  I64,  ___,  ___,  0,  0,    0xC3, I64Extend16S, \"i64.extend16_s\", \"\")\nWABT_OPCODE(I64, ___,  I64,  ___,  ___,  0,  0,    0xC4, I64Extend32S, \"i64.extend32_s\", \"\")\n\n/* Interpreter-only opcodes */\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xe0, InterpAlloca, \"alloca\", \"\")\nWABT_OPCODE(___, ___,  I32,  ___,  ___,  0,  0,    0xe1, InterpBrUnless, \"br_unless\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xe2, InterpCallImport, \"call_import\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xe3, InterpData, \"data\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xe4, InterpDropKeep, \"drop_keep\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xe5, InterpCatchDrop, \"catch_drop\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xe6, InterpAdjustFrameForReturnCall, \"adjust_frame_for_return_call\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xe7, InterpGlobalGetRef, \"global.get.ref\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xe9, InterpLocalGetRef, \"local.get.ref\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xea, InterpMarkRef, \"mark_ref\", \"\")\n\n/* Saturating float-to-int opcodes (--enable-saturating-float-to-int) */\nWABT_OPCODE(I32, ___,  F32,  ___,  ___,  0,  0xfc, 0x00, I32TruncSatF32S, \"i32.trunc_sat_f32_s\", \"\")\nWABT_OPCODE(I32, ___,  F32,  ___,  ___,  0,  0xfc, 0x01, I32TruncSatF32U, \"i32.trunc_sat_f32_u\", \"\")\nWABT_OPCODE(I32, ___,  F64,  ___,  ___,  0,  0xfc, 0x02, I32TruncSatF64S, \"i32.trunc_sat_f64_s\", \"\")\nWABT_OPCODE(I32, ___,  F64,  ___,  ___,  0,  0xfc, 0x03, I32TruncSatF64U, \"i32.trunc_sat_f64_u\", \"\")\nWABT_OPCODE(I64, ___,  F32,  ___,  ___,  0,  0xfc, 0x04, I64TruncSatF32S, \"i64.trunc_sat_f32_s\", \"\")\nWABT_OPCODE(I64, ___,  F32,  ___,  ___,  0,  0xfc, 0x05, I64TruncSatF32U, \"i64.trunc_sat_f32_u\", \"\")\nWABT_OPCODE(I64, ___,  F64,  ___,  ___,  0,  0xfc, 0x06, I64TruncSatF64S, \"i64.trunc_sat_f64_s\", \"\")\nWABT_OPCODE(I64, ___,  F64,  ___,  ___,  0,  0xfc, 0x07, I64TruncSatF64U, \"i64.trunc_sat_f64_u\", \"\")\n\n/* Wide arithmetic */\nWABT_OPCODE(I64, I64,  I64,  I64,  I64,  0,  0xfc, 0x13, I64Add128, \"i64.add128\", \"\")\nWABT_OPCODE(I64, I64,  I64,  I64,  I64,  0,  0xfc, 0x14, I64Sub128, \"i64.sub128\", \"\")\nWABT_OPCODE(I64, I64,  I64,  I64,  ___,  0,  0xfc, 0x15, I64MulWideS, \"i64.mul_wide_s\", \"\")\nWABT_OPCODE(I64, I64,  I64,  I64,  ___,  0,  0xfc, 0x16, I64MulWideU, \"i64.mul_wide_u\", \"\")\n\n/* Bulk-memory */\nWABT_OPCODE(___, ___, I32,  I32,  I32,  0,  0xfc, 0x08, MemoryInit, \"memory.init\", \"\")\nWABT_OPCODE(___, ___, ___,  ___,  ___,  0,  0xfc, 0x09, DataDrop, \"data.drop\", \"\")\nWABT_OPCODE(___, ___, I32,  I32,  I32,  0,  0xfc, 0x0a, MemoryCopy, \"memory.copy\", \"\")\nWABT_OPCODE(___, ___, I32,  I32,  I32,  0,  0xfc, 0x0b, MemoryFill, \"memory.fill\", \"\")\nWABT_OPCODE(___, ___, I32,  I32,  I32,  0,  0xfc, 0x0c, TableInit, \"table.init\", \"\")\nWABT_OPCODE(___, ___, ___,  ___,  ___,  0,  0xfc, 0x0d, ElemDrop, \"elem.drop\", \"\")\nWABT_OPCODE(___, ___, I32,  I32,  I32,  0,  0xfc, 0x0e, TableCopy, \"table.copy\", \"\")\n\n/* Reference types */\nWABT_OPCODE(___, ___,  I32,  ___,  ___,  0,  0,    0x25, TableGet, \"table.get\", \"\")\nWABT_OPCODE(___, ___,  I32,  ___,  ___,  0,  0,    0x26, TableSet, \"table.set\", \"\")\nWABT_OPCODE(___, ___,  ___,  I32,  ___,  0,  0xfc, 0x0f, TableGrow, \"table.grow\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0xfc, 0x10, TableSize, \"table.size\", \"\")\nWABT_OPCODE(___, ___,  I32,  ___,  I32,  0,  0xfc, 0x11, TableFill, \"table.fill\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xd0, RefNull, \"ref.null\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xd1, RefIsNull, \"ref.is_null\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xd2, RefFunc, \"ref.func\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xd4, RefAsNonNull, \"ref.as_non_null\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xd5, BrOnNull, \"br_on_null\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0,    0xd6, BrOnNonNull, \"br_on_non_null\", \"\")\n\n/* Simd opcodes */\nWABT_OPCODE(V128, ___, I32,  ___,  ___,  16, 0xfd, 0x00, V128Load, \"v128.load\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  8,  0xfd, 0x01, V128Load8X8S, \"v128.load8x8_s\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  8,  0xfd, 0x02, V128Load8X8U, \"v128.load8x8_u\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  8,  0xfd, 0x03, V128Load16X4S, \"v128.load16x4_s\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  8,  0xfd, 0x04, V128Load16X4U, \"v128.load16x4_u\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  8,  0xfd, 0x05, V128Load32X2S, \"v128.load32x2_s\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  8,  0xfd, 0x06, V128Load32X2U, \"v128.load32x2_u\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  1,  0xfd, 0x07, V128Load8Splat, \"v128.load8_splat\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  2,  0xfd, 0x08, V128Load16Splat, \"v128.load16_splat\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  4,  0xfd, 0x09, V128Load32Splat, \"v128.load32_splat\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  8,  0xfd, 0x0a, V128Load64Splat, \"v128.load64_splat\", \"\")\nWABT_OPCODE(___, ___,  I32,  V128, ___,  16, 0xfd, 0x0b, V128Store, \"v128.store\", \"\")\nWABT_OPCODE(V128, ___, ___,  ___,  ___,  0,  0xfd, 0x0c, V128Const, \"v128.const\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x0d, I8X16Shuffle, \"i8x16.shuffle\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x0e, I8X16Swizzle, \"i8x16.swizzle\", \"\")\nWABT_OPCODE(V128, ___, I32,  ___,  ___,  0,  0xfd, 0x0f, I8X16Splat, \"i8x16.splat\", \"\")\nWABT_OPCODE(V128, ___, I32,  ___,  ___,  0,  0xfd, 0x10, I16X8Splat, \"i16x8.splat\", \"\")\nWABT_OPCODE(V128, ___, I32,  ___,  ___,  0,  0xfd, 0x11, I32X4Splat, \"i32x4.splat\", \"\")\nWABT_OPCODE(V128, ___, I64,  ___,  ___,  0,  0xfd, 0x12, I64X2Splat, \"i64x2.splat\", \"\")\nWABT_OPCODE(V128, ___, F32,  ___,  ___,  0,  0xfd, 0x13, F32X4Splat, \"f32x4.splat\", \"\")\nWABT_OPCODE(V128, ___, F64,  ___,  ___,  0,  0xfd, 0x14, F64X2Splat, \"f64x2.splat\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x15, I8X16ExtractLaneS, \"i8x16.extract_lane_s\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x16, I8X16ExtractLaneU, \"i8x16.extract_lane_u\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x17, I8X16ReplaceLane, \"i8x16.replace_lane\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x18, I16X8ExtractLaneS, \"i16x8.extract_lane_s\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x19, I16X8ExtractLaneU, \"i16x8.extract_lane_u\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x1a, I16X8ReplaceLane, \"i16x8.replace_lane\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x1b, I32X4ExtractLane, \"i32x4.extract_lane\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x1c, I32X4ReplaceLane, \"i32x4.replace_lane\", \"\")\nWABT_OPCODE(I64, ___,  V128, ___,  ___,  0,  0xfd, 0x1d, I64X2ExtractLane, \"i64x2.extract_lane\", \"\")\nWABT_OPCODE(V128, ___, V128, I64,  ___,  0,  0xfd, 0x1e, I64X2ReplaceLane, \"i64x2.replace_lane\", \"\")\nWABT_OPCODE(F32, ___,  V128, ___,  ___,  0,  0xfd, 0x1f, F32X4ExtractLane, \"f32x4.extract_lane\", \"\")\nWABT_OPCODE(V128, ___, V128, F32,  ___,  0,  0xfd, 0x20, F32X4ReplaceLane, \"f32x4.replace_lane\", \"\")\nWABT_OPCODE(F64, ___,  V128, ___,  ___,  0,  0xfd, 0x21, F64X2ExtractLane, \"f64x2.extract_lane\", \"\")\nWABT_OPCODE(V128, ___, V128, F64,  ___,  0,  0xfd, 0x22, F64X2ReplaceLane, \"f64x2.replace_lane\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x23, I8X16Eq, \"i8x16.eq\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x24, I8X16Ne, \"i8x16.ne\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x25, I8X16LtS, \"i8x16.lt_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x26, I8X16LtU, \"i8x16.lt_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x27, I8X16GtS, \"i8x16.gt_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x28, I8X16GtU, \"i8x16.gt_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x29, I8X16LeS, \"i8x16.le_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x2a, I8X16LeU, \"i8x16.le_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x2b, I8X16GeS, \"i8x16.ge_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x2c, I8X16GeU, \"i8x16.ge_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x2d, I16X8Eq, \"i16x8.eq\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x2e, I16X8Ne, \"i16x8.ne\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x2f, I16X8LtS, \"i16x8.lt_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x30, I16X8LtU, \"i16x8.lt_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x31, I16X8GtS, \"i16x8.gt_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x32, I16X8GtU, \"i16x8.gt_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x33, I16X8LeS, \"i16x8.le_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x34, I16X8LeU, \"i16x8.le_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x35, I16X8GeS, \"i16x8.ge_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x36, I16X8GeU, \"i16x8.ge_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x37, I32X4Eq, \"i32x4.eq\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x38, I32X4Ne, \"i32x4.ne\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x39, I32X4LtS, \"i32x4.lt_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x3a, I32X4LtU, \"i32x4.lt_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x3b, I32X4GtS, \"i32x4.gt_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x3c, I32X4GtU, \"i32x4.gt_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x3d, I32X4LeS, \"i32x4.le_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x3e, I32X4LeU, \"i32x4.le_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x3f, I32X4GeS, \"i32x4.ge_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x40, I32X4GeU, \"i32x4.ge_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x41, F32X4Eq, \"f32x4.eq\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x42, F32X4Ne, \"f32x4.ne\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x43, F32X4Lt, \"f32x4.lt\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x44, F32X4Gt, \"f32x4.gt\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x45, F32X4Le, \"f32x4.le\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x46, F32X4Ge, \"f32x4.ge\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x47, F64X2Eq, \"f64x2.eq\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x48, F64X2Ne, \"f64x2.ne\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x49, F64X2Lt, \"f64x2.lt\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x4a, F64X2Gt, \"f64x2.gt\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x4b, F64X2Le, \"f64x2.le\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x4c, F64X2Ge, \"f64x2.ge\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x4d, V128Not, \"v128.not\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x4e, V128And, \"v128.and\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x4f, V128Andnot, \"v128.andnot\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x50, V128Or,  \"v128.or\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x51, V128Xor, \"v128.xor\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x52, V128BitSelect, \"v128.bitselect\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x53, V128AnyTrue, \"v128.any_true\", \"\")\nWABT_OPCODE(V128, ___, I32, V128,  ___,  1,  0xfd, 0x54, V128Load8Lane, \"v128.load8_lane\", \"\")\nWABT_OPCODE(V128, ___, I32, V128,  ___,  2,  0xfd, 0x55, V128Load16Lane, \"v128.load16_lane\", \"\")\nWABT_OPCODE(V128, ___, I32, V128,  ___,  4,  0xfd, 0x56, V128Load32Lane, \"v128.load32_lane\", \"\")\nWABT_OPCODE(V128, ___, I32, V128,  ___,  8,  0xfd, 0x57, V128Load64Lane, \"v128.load64_lane\", \"\")\nWABT_OPCODE(___, ___,  I32, V128,  ___,  1,  0xfd, 0x58, V128Store8Lane, \"v128.store8_lane\", \"\")\nWABT_OPCODE(___, ___,  I32, V128,  ___,  2,  0xfd, 0x59, V128Store16Lane, \"v128.store16_lane\", \"\")\nWABT_OPCODE(___, ___,  I32, V128,  ___,  4,  0xfd, 0x5a, V128Store32Lane, \"v128.store32_lane\", \"\")\nWABT_OPCODE(___, ___,  I32, V128,  ___,  8,  0xfd, 0x5b, V128Store64Lane, \"v128.store64_lane\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  4,  0xfd, 0x5c, V128Load32Zero, \"v128.load32_zero\", \"\")\nWABT_OPCODE(V128, ___, I32,   ___, ___,  8,  0xfd, 0x5d, V128Load64Zero, \"v128.load64_zero\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x5e, F32X4DemoteF64X2Zero, \"f32x4.demote_f64x2_zero\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x5f, F64X2PromoteLowF32X4, \"f64x2.promote_low_f32x4\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x60, I8X16Abs, \"i8x16.abs\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x61, I8X16Neg, \"i8x16.neg\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x62, I8X16Popcnt, \"i8x16.popcnt\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x63, I8X16AllTrue, \"i8x16.all_true\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x64, I8X16Bitmask, \"i8x16.bitmask\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x65, I8X16NarrowI16X8S, \"i8x16.narrow_i16x8_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x66, I8X16NarrowI16X8U, \"i8x16.narrow_i16x8_u\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x6b, I8X16Shl, \"i8x16.shl\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x6c, I8X16ShrS, \"i8x16.shr_s\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x6d, I8X16ShrU, \"i8x16.shr_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x6e, I8X16Add, \"i8x16.add\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x6f, I8X16AddSatS, \"i8x16.add_sat_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x70, I8X16AddSatU, \"i8x16.add_sat_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x71, I8X16Sub, \"i8x16.sub\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x72, I8X16SubSatS, \"i8x16.sub_sat_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x73, I8X16SubSatU, \"i8x16.sub_sat_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x76, I8X16MinS, \"i8x16.min_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x77, I8X16MinU, \"i8x16.min_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x78, I8X16MaxS, \"i8x16.max_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x79, I8X16MaxU, \"i8x16.max_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x7b, I8X16AvgrU, \"i8x16.avgr_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x7c, I16X8ExtaddPairwiseI8X16S, \"i16x8.extadd_pairwise_i8x16_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x7d, I16X8ExtaddPairwiseI8X16U, \"i16x8.extadd_pairwise_i8x16_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x7e, I32X4ExtaddPairwiseI16X8S, \"i32x4.extadd_pairwise_i16x8_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x7f, I32X4ExtaddPairwiseI16X8U, \"i32x4.extadd_pairwise_i16x8_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x80, I16X8Abs, \"i16x8.abs\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x81, I16X8Neg, \"i16x8.neg\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x82, I16X8Q15mulrSatS, \"i16x8.q15mulr_sat_s\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x83, I16X8AllTrue, \"i16x8.all_true\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0x84, I16X8Bitmask, \"i16x8.bitmask\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x85, I16X8NarrowI32X4S, \"i16x8.narrow_i32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x86, I16X8NarrowI32X4U, \"i16x8.narrow_i32x4_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x87, I16X8ExtendLowI8X16S, \"i16x8.extend_low_i8x16_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x88, I16X8ExtendHighI8X16S, \"i16x8.extend_high_i8x16_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x89, I16X8ExtendLowI8X16U, \"i16x8.extend_low_i8x16_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0x8a, I16X8ExtendHighI8X16U, \"i16x8.extend_high_i8x16_u\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x8b, I16X8Shl, \"i16x8.shl\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x8c, I16X8ShrS, \"i16x8.shr_s\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0x8d, I16X8ShrU, \"i16x8.shr_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x8e, I16X8Add, \"i16x8.add\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x8f, I16X8AddSatS, \"i16x8.add_sat_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x90, I16X8AddSatU, \"i16x8.add_sat_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x91, I16X8Sub, \"i16x8.sub\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x92, I16X8SubSatS, \"i16x8.sub_sat_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x93, I16X8SubSatU, \"i16x8.sub_sat_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x95, I16X8Mul, \"i16x8.mul\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x96, I16X8MinS, \"i16x8.min_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x97, I16X8MinU, \"i16x8.min_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x98, I16X8MaxS, \"i16x8.max_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x99, I16X8MaxU, \"i16x8.max_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x9b, I16X8AvgrU, \"i16x8.avgr_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x9c, I16X8ExtmulLowI8X16S, \"i16x8.extmul_low_i8x16_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x9d, I16X8ExtmulHighI8X16S, \"i16x8.extmul_high_i8x16_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x9e, I16X8ExtmulLowI8X16U, \"i16x8.extmul_low_i8x16_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x9f, I16X8ExtmulHighI8X16U, \"i16x8.extmul_high_i8x16_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xa0, I32X4Abs, \"i32x4.abs\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xa1, I32X4Neg, \"i32x4.neg\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0xa3, I32X4AllTrue, \"i32x4.all_true\", \"\")\nWABT_OPCODE(I32, ___,  V128, ___,  ___,  0,  0xfd, 0xa4, I32X4Bitmask, \"i32x4.bitmask\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xa7, I32X4ExtendLowI16X8S, \"i32x4.extend_low_i16x8_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xa8, I32X4ExtendHighI16X8S, \"i32x4.extend_high_i16x8_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xa9, I32X4ExtendLowI16X8U, \"i32x4.extend_low_i16x8_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xaa, I32X4ExtendHighI16X8U, \"i32x4.extend_high_i16x8_u\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0xab, I32X4Shl, \"i32x4.shl\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0xac, I32X4ShrS, \"i32x4.shr_s\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0xad, I32X4ShrU, \"i32x4.shr_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xae, I32X4Add, \"i32x4.add\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xb1, I32X4Sub, \"i32x4.sub\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xb5, I32X4Mul, \"i32x4.mul\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xb6, I32X4MinS, \"i32x4.min_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xb7, I32X4MinU, \"i32x4.min_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xb8, I32X4MaxS, \"i32x4.max_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xb9, I32X4MaxU, \"i32x4.max_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xba, I32X4DotI16X8S, \"i32x4.dot_i16x8_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xbc, I32X4ExtmulLowI16X8S, \"i32x4.extmul_low_i16x8_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xbd, I32X4ExtmulHighI16X8S, \"i32x4.extmul_high_i16x8_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xbe, I32X4ExtmulLowI16X8U, \"i32x4.extmul_low_i16x8_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xbf, I32X4ExtmulHighI16X8U, \"i32x4.extmul_high_i16x8_u\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xc0, I64X2Abs, \"i64x2.abs\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xc1, I64X2Neg, \"i64x2.neg\", \"\")\nWABT_OPCODE( I32, ___, V128,  ___, ___,  0,  0xfd, 0xc3, I64X2AllTrue, \"i64x2.all_true\", \"\")\nWABT_OPCODE( I32, ___, V128,  ___, ___,  0,  0xfd, 0xc4, I64X2Bitmask, \"i64x2.bitmask\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xc7, I64X2ExtendLowI32X4S, \"i64x2.extend_low_i32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xc8, I64X2ExtendHighI32X4S, \"i64x2.extend_high_i32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xc9, I64X2ExtendLowI32X4U, \"i64x2.extend_low_i32x4_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xca, I64X2ExtendHighI32X4U, \"i64x2.extend_high_i32x4_u\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0xcb, I64X2Shl, \"i64x2.shl\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0xcc, I64X2ShrS, \"i64x2.shr_s\", \"\")\nWABT_OPCODE(V128, ___, V128, I32,  ___,  0,  0xfd, 0xcd, I64X2ShrU, \"i64x2.shr_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xce, I64X2Add, \"i64x2.add\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xd1, I64X2Sub, \"i64x2.sub\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xd5, I64X2Mul, \"i64x2.mul\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xd6, I64X2Eq, \"i64x2.eq\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xd7, I64X2Ne, \"i64x2.ne\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xd8, I64X2LtS, \"i64x2.lt_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xd9, I64X2GtS, \"i64x2.gt_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xda, I64X2LeS, \"i64x2.le_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xdb, I64X2GeS, \"i64x2.ge_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xdc, I64X2ExtmulLowI32X4S, \"i64x2.extmul_low_i32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xdd, I64X2ExtmulHighI32X4S, \"i64x2.extmul_high_i32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xde, I64X2ExtmulLowI32X4U, \"i64x2.extmul_low_i32x4_u\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xdf, I64X2ExtmulHighI32X4U, \"i64x2.extmul_high_i32x4_u\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x67, F32X4Ceil, \"f32x4.ceil\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x68, F32X4Floor, \"f32x4.floor\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x69, F32X4Trunc, \"f32x4.trunc\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x6a, F32X4Nearest, \"f32x4.nearest\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x74, F64X2Ceil, \"f64x2.ceil\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x75, F64X2Floor, \"f64x2.floor\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x7a, F64X2Trunc, \"f64x2.trunc\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x94, F64X2Nearest, \"f64x2.nearest\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xe0, F32X4Abs, \"f32x4.abs\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xe1, F32X4Neg, \"f32x4.neg\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xe3, F32X4Sqrt, \"f32x4.sqrt\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xe4, F32X4Add, \"f32x4.add\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xe5, F32X4Sub, \"f32x4.sub\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xe6, F32X4Mul, \"f32x4.mul\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xe7, F32X4Div, \"f32x4.div\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xe8, F32X4Min, \"f32x4.min\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xe9, F32X4Max, \"f32x4.max\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xea, F32X4PMin, \"f32x4.pmin\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xeb, F32X4PMax, \"f32x4.pmax\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xec, F64X2Abs, \"f64x2.abs\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xed, F64X2Neg, \"f64x2.neg\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xef, F64X2Sqrt, \"f64x2.sqrt\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xf0, F64X2Add, \"f64x2.add\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xf1, F64X2Sub, \"f64x2.sub\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xf2, F64X2Mul, \"f64x2.mul\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xf3, F64X2Div, \"f64x2.div\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xf4, F64X2Min, \"f64x2.min\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xf5, F64X2Max, \"f64x2.max\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xf6, F64X2PMin, \"f64x2.pmin\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0xf7, F64X2PMax, \"f64x2.pmax\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xf8, I32X4TruncSatF32X4S, \"i32x4.trunc_sat_f32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xf9, I32X4TruncSatF32X4U, \"i32x4.trunc_sat_f32x4_u\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xfa, F32X4ConvertI32X4S, \"f32x4.convert_i32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0xfb, F32X4ConvertI32X4U, \"f32x4.convert_i32x4_u\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xfc, I32X4TruncSatF64X2SZero, \"i32x4.trunc_sat_f64x2_s_zero\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xfd, I32X4TruncSatF64X2UZero, \"i32x4.trunc_sat_f64x2_u_zero\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xfe, F64X2ConvertLowI32X4S, \"f64x2.convert_low_i32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128,  ___, ___,  0,  0xfd, 0xff, F64X2ConvertLowI32X4U, \"f64x2.convert_low_i32x4_u\", \"\")\n\n/* Relaxed-SIMD opcodes */\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x100, I8X16RelaxedSwizzle, \"i8x16.relaxed_swizzle\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x101, I32X4RelaxedTruncF32X4S, \"i32x4.relaxed_trunc_f32x4_s\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x102, I32X4RelaxedTruncF32X4U, \"i32x4.relaxed_trunc_f32x4_u\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x103, I32X4RelaxedTruncF64X2SZero, \"i32x4.relaxed_trunc_f64x2_s_zero\", \"\")\nWABT_OPCODE(V128, ___, V128, ___,  ___,  0,  0xfd, 0x104, I32X4RelaxedTruncF64X2UZero, \"i32x4.relaxed_trunc_f64x2_u_zero\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x105, F32X4RelaxedMadd, \"f32x4.relaxed_madd\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x106, F32X4RelaxedNmadd, \"f32x4.relaxed_nmadd\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x107, F64X2RelaxedMadd, \"f64x2.relaxed_madd\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x108, F64X2RelaxedNmadd, \"f64x2.relaxed_nmadd\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x109, I8X16RelaxedLaneSelect, \"i8x16.relaxed_laneselect\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x10a, I16X8RelaxedLaneSelect, \"i16x8.relaxed_laneselect\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x10b, I32X4RelaxedLaneSelect, \"i32x4.relaxed_laneselect\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x10c, I64X2RelaxedLaneSelect, \"i64x2.relaxed_laneselect\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x10d, F32X4RelaxedMin, \"f32x4.relaxed_min\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x10e, F32X4RelaxedMax, \"f32x4.relaxed_max\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x10f, F64X2RelaxedMin, \"f64x2.relaxed_min\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x110, F64X2RelaxedMax, \"f64x2.relaxed_max\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x111, I16X8RelaxedQ15mulrS, \"i16x8.relaxed_q15mulr_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, ___,  0,  0xfd, 0x112, I16X8DotI8X16I7X16S, \"i16x8.relaxed_dot_i8x16_i7x16_s\", \"\")\nWABT_OPCODE(V128, ___, V128, V128, V128, 0,  0xfd, 0x113, I32X4DotI8X16I7X16AddS, \"i32x4.relaxed_dot_i8x16_i7x16_add_s\", \"\")\n\n/* Thread opcodes (--enable-threads) */\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  4,  0xfe, 0x00, MemoryAtomicNotify, \"memory.atomic.notify\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  I64,  4,  0xfe, 0x01, MemoryAtomicWait32, \"memory.atomic.wait32\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I64,  I64,  8,  0xfe, 0x02, MemoryAtomicWait64, \"memory.atomic.wait64\", \"\")\nWABT_OPCODE(___, ___,  ___,  ___,  ___,  0,  0xfe, 0x03, AtomicFence, \"atomic.fence\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  4,  0xfe, 0x10, I32AtomicLoad, \"i32.atomic.load\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  8,  0xfe, 0x11, I64AtomicLoad, \"i64.atomic.load\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  1,  0xfe, 0x12, I32AtomicLoad8U, \"i32.atomic.load8_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  ___,  ___,  2,  0xfe, 0x13, I32AtomicLoad16U, \"i32.atomic.load16_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  1,  0xfe, 0x14, I64AtomicLoad8U, \"i64.atomic.load8_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  2,  0xfe, 0x15, I64AtomicLoad16U, \"i64.atomic.load16_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  ___,  ___,  4,  0xfe, 0x16, I64AtomicLoad32U, \"i64.atomic.load32_u\", \"\")\nWABT_OPCODE(___, ___,  I32,  I32,  ___,  4,  0xfe, 0x17, I32AtomicStore, \"i32.atomic.store\", \"\")\nWABT_OPCODE(___, ___,  I32,  I64,  ___,  8,  0xfe, 0x18, I64AtomicStore, \"i64.atomic.store\", \"\")\nWABT_OPCODE(___, ___,  I32,  I32,  ___,  1,  0xfe, 0x19, I32AtomicStore8, \"i32.atomic.store8\", \"\")\nWABT_OPCODE(___, ___,  I32,  I32,  ___,  2,  0xfe, 0x1a, I32AtomicStore16, \"i32.atomic.store16\", \"\")\nWABT_OPCODE(___, ___,  I32,  I64,  ___,  1,  0xfe, 0x1b, I64AtomicStore8, \"i64.atomic.store8\", \"\")\nWABT_OPCODE(___, ___,  I32,  I64,  ___,  2,  0xfe, 0x1c, I64AtomicStore16, \"i64.atomic.store16\", \"\")\nWABT_OPCODE(___, ___,  I32,  I64,  ___,  4,  0xfe, 0x1d, I64AtomicStore32, \"i64.atomic.store32\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  4,  0xfe, 0x1e, I32AtomicRmwAdd, \"i32.atomic.rmw.add\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  8,  0xfe, 0x1f, I64AtomicRmwAdd, \"i64.atomic.rmw.add\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  1,  0xfe, 0x20, I32AtomicRmw8AddU, \"i32.atomic.rmw8.add_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  2,  0xfe, 0x21, I32AtomicRmw16AddU, \"i32.atomic.rmw16.add_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  1,  0xfe, 0x22, I64AtomicRmw8AddU, \"i64.atomic.rmw8.add_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  2,  0xfe, 0x23, I64AtomicRmw16AddU, \"i64.atomic.rmw16.add_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  4,  0xfe, 0x24, I64AtomicRmw32AddU, \"i64.atomic.rmw32.add_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  4,  0xfe, 0x25, I32AtomicRmwSub, \"i32.atomic.rmw.sub\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  8,  0xfe, 0x26, I64AtomicRmwSub, \"i64.atomic.rmw.sub\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  1,  0xfe, 0x27, I32AtomicRmw8SubU, \"i32.atomic.rmw8.sub_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  2,  0xfe, 0x28, I32AtomicRmw16SubU, \"i32.atomic.rmw16.sub_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  1,  0xfe, 0x29, I64AtomicRmw8SubU, \"i64.atomic.rmw8.sub_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  2,  0xfe, 0x2a, I64AtomicRmw16SubU, \"i64.atomic.rmw16.sub_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  4,  0xfe, 0x2b, I64AtomicRmw32SubU, \"i64.atomic.rmw32.sub_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  4,  0xfe, 0x2c, I32AtomicRmwAnd, \"i32.atomic.rmw.and\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  8,  0xfe, 0x2d, I64AtomicRmwAnd, \"i64.atomic.rmw.and\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  1,  0xfe, 0x2e, I32AtomicRmw8AndU, \"i32.atomic.rmw8.and_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  2,  0xfe, 0x2f, I32AtomicRmw16AndU, \"i32.atomic.rmw16.and_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  1,  0xfe, 0x30, I64AtomicRmw8AndU, \"i64.atomic.rmw8.and_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  2,  0xfe, 0x31, I64AtomicRmw16AndU, \"i64.atomic.rmw16.and_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  4,  0xfe, 0x32, I64AtomicRmw32AndU, \"i64.atomic.rmw32.and_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  4,  0xfe, 0x33, I32AtomicRmwOr, \"i32.atomic.rmw.or\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  8,  0xfe, 0x34, I64AtomicRmwOr, \"i64.atomic.rmw.or\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  1,  0xfe, 0x35, I32AtomicRmw8OrU, \"i32.atomic.rmw8.or_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  2,  0xfe, 0x36, I32AtomicRmw16OrU, \"i32.atomic.rmw16.or_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  1,  0xfe, 0x37, I64AtomicRmw8OrU, \"i64.atomic.rmw8.or_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  2,  0xfe, 0x38, I64AtomicRmw16OrU, \"i64.atomic.rmw16.or_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  4,  0xfe, 0x39, I64AtomicRmw32OrU, \"i64.atomic.rmw32.or_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  4,  0xfe, 0x3a, I32AtomicRmwXor, \"i32.atomic.rmw.xor\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  8,  0xfe, 0x3b, I64AtomicRmwXor, \"i64.atomic.rmw.xor\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  1,  0xfe, 0x3c, I32AtomicRmw8XorU, \"i32.atomic.rmw8.xor_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  2,  0xfe, 0x3d, I32AtomicRmw16XorU, \"i32.atomic.rmw16.xor_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  1,  0xfe, 0x3e, I64AtomicRmw8XorU, \"i64.atomic.rmw8.xor_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  2,  0xfe, 0x3f, I64AtomicRmw16XorU, \"i64.atomic.rmw16.xor_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  4,  0xfe, 0x40, I64AtomicRmw32XorU, \"i64.atomic.rmw32.xor_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  4,  0xfe, 0x41, I32AtomicRmwXchg, \"i32.atomic.rmw.xchg\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  8,  0xfe, 0x42, I64AtomicRmwXchg, \"i64.atomic.rmw.xchg\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  1,  0xfe, 0x43, I32AtomicRmw8XchgU, \"i32.atomic.rmw8.xchg_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  ___,  2,  0xfe, 0x44, I32AtomicRmw16XchgU, \"i32.atomic.rmw16.xchg_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  1,  0xfe, 0x45, I64AtomicRmw8XchgU, \"i64.atomic.rmw8.xchg_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  2,  0xfe, 0x46, I64AtomicRmw16XchgU, \"i64.atomic.rmw16.xchg_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  ___,  4,  0xfe, 0x47, I64AtomicRmw32XchgU, \"i64.atomic.rmw32.xchg_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  I32,  4,  0xfe, 0x48, I32AtomicRmwCmpxchg, \"i32.atomic.rmw.cmpxchg\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  I64,  8,  0xfe, 0x49, I64AtomicRmwCmpxchg, \"i64.atomic.rmw.cmpxchg\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  I32,  1,  0xfe, 0x4a, I32AtomicRmw8CmpxchgU, \"i32.atomic.rmw8.cmpxchg_u\", \"\")\nWABT_OPCODE(I32, ___,  I32,  I32,  I32,  2,  0xfe, 0x4b, I32AtomicRmw16CmpxchgU, \"i32.atomic.rmw16.cmpxchg_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  I64,  1,  0xfe, 0x4c, I64AtomicRmw8CmpxchgU, \"i64.atomic.rmw8.cmpxchg_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  I64,  2,  0xfe, 0x4d, I64AtomicRmw16CmpxchgU, \"i64.atomic.rmw16.cmpxchg_u\", \"\")\nWABT_OPCODE(I64, ___,  I32,  I64,  I64,  4,  0xfe, 0x4e, I64AtomicRmw32CmpxchgU, \"i64.atomic.rmw32.cmpxchg_u\", \"\")\n"
  },
  {
    "path": "include/wabt/opcode.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_OPCODE_H_\n#define WABT_OPCODE_H_\n\n#include <vector>\n\n#include \"wabt/common.h\"\n#include \"wabt/leb128.h\"\n#include \"wabt/opcode-code-table.h\"\n\nnamespace wabt {\n\nclass Features;\n\nstruct Opcode {\n  // Opcode enumerations.\n  //\n  // NOTE: this enum does not match the binary encoding.\n  //\n  enum Enum : uint32_t {\n#define WABT_OPCODE(rtype, rtype2, type1, type2, type3, mem_size, prefix, \\\n                    code, Name, text, decomp)                             \\\n  Name,\n#include \"wabt/opcode.def\"\n#undef WABT_OPCODE\n    Invalid,\n  };\n\n// Static opcode objects.\n#define WABT_OPCODE(rtype, rtype2, type1, type2, type3, mem_size, prefix, \\\n                    code, Name, text, decomp)                             \\\n  static Opcode Name##_Opcode;\n#include \"wabt/opcode.def\"\n#undef WABT_OPCODE\n\n  Opcode() = default;  // Provided so Opcode can be member of a union.\n  Opcode(Enum e) : enum_(e) {}\n  operator Enum() const { return enum_; }\n\n  static Opcode FromCode(uint32_t);\n  static Opcode FromCode(uint8_t prefix, uint32_t code);\n  bool HasPrefix() const { return GetInfo().prefix != 0; }\n  uint8_t GetPrefix() const { return GetInfo().prefix; }\n  uint32_t GetCode() const { return GetInfo().code; }\n  size_t GetLength() const { return GetBytes().size(); }\n  const char* GetName() const { return GetInfo().name; }\n  const char* GetDecomp() const {\n    return *GetInfo().decomp ? GetInfo().decomp : GetInfo().name;\n  }\n  Type GetResultType() const { return GetInfo().result_type; }\n  Type GetResultType2() const { return GetInfo().result_type2; }\n  Type GetParamType1() const { return GetInfo().param_types[0]; }\n  Type GetParamType2() const { return GetInfo().param_types[1]; }\n  Type GetParamType3() const { return GetInfo().param_types[2]; }\n  Type GetParamType(int n) const { return GetInfo().param_types[n - 1]; }\n  Address GetMemorySize() const { return GetInfo().memory_size; }\n\n  // Get the byte sequence for this opcode, including prefix.\n  std::vector<uint8_t> GetBytes() const;\n\n  // Get the lane count of an extract/replace simd op.\n  uint32_t GetSimdLaneCount() const;\n\n  // Return 1 if |alignment| matches the alignment of |opcode|, or if\n  // |alignment| is WABT_USE_NATURAL_ALIGNMENT.\n  bool IsNaturallyAligned(Address alignment) const;\n\n  // If |alignment| is WABT_USE_NATURAL_ALIGNMENT, return the alignment of\n  // |opcode|, else return |alignment|.\n  Address GetAlignment(Address alignment) const;\n\n  static bool IsPrefixByte(uint8_t byte) {\n    return byte == kMathPrefix || byte == kThreadsPrefix || byte == kSimdPrefix;\n  }\n\n  bool IsEnabled(const Features& features) const;\n  bool IsInvalid() const { return enum_ >= Invalid; }\n\n private:\n  static constexpr uint32_t kMathPrefix = 0xfc;\n  static constexpr uint32_t kThreadsPrefix = 0xfe;\n  static constexpr uint32_t kSimdPrefix = 0xfd;\n\n  struct Info {\n    const char* name;\n    const char* decomp;\n    Type result_type;\n    Type result_type2;\n    Type param_types[3];\n    Address memory_size;\n    uint8_t prefix;\n    uint32_t code;\n    uint32_t prefix_code;  // See PrefixCode below. Used for fast lookup.\n  };\n\n  static uint32_t PrefixCode(uint8_t prefix, uint32_t code) {\n    if (code >= (1 << MAX_OPCODE_BITS)) {\n      // Clamp to (2^bits - 1), since we know that it is an invalid code.\n      code = (1 << MAX_OPCODE_BITS) - 1;\n    }\n    return (prefix << MAX_OPCODE_BITS) | code;\n  }\n\n  // The Opcode struct only stores an enumeration (Opcode::Enum) of all valid\n  // opcodes, densely packed. We want to be able to store invalid opcodes as\n  // well, for display to the user. To encode these, we use PrefixCode() to\n  // generate a uint32_t of the prefix/code pair, then negate the value so it\n  // doesn't overlap with the valid enum values. The negation is done using\n  // `~code + 1` since prefix_code is unsigned, and MSVC warns if you use - on\n  // an unsigned value.\n  //\n  // | 0             | Opcode::Invalid         | INT32_MAX+1    UINT32_MAX |\n  // |---------------|-------------------------|---------------------------|\n  // | valid opcodes |      unused space       |      invalid opcodes      |\n  //\n  static Enum EncodeInvalidOpcode(uint32_t prefix_code) {\n    Enum result = static_cast<Enum>(~prefix_code + 1);\n    assert(result >= Invalid);\n    return result;\n  }\n\n  static void DecodeInvalidOpcode(Enum e,\n                                  uint8_t* out_prefix,\n                                  uint32_t* out_code) {\n    uint32_t prefix_code = ~static_cast<uint32_t>(e) + 1;\n    *out_prefix = prefix_code >> MAX_OPCODE_BITS;\n    *out_code = prefix_code & 0xff;\n  }\n\n  Info GetInfo() const;\n  static Info infos_[];\n\n  Enum enum_;\n};\n\n// static\ninline Opcode Opcode::FromCode(uint32_t code) {\n  return FromCode(0, code);\n}\n\n// static\ninline Opcode Opcode::FromCode(uint8_t prefix, uint32_t code) {\n  uint32_t prefix_code = PrefixCode(prefix, code);\n\n  if (WABT_LIKELY(prefix_code < WABT_ARRAY_SIZE(WabtOpcodeCodeTable))) {\n    uint32_t value = WabtOpcodeCodeTable[prefix_code];\n    // The default value in the table is 0. That's a valid value, but only if\n    // the code is 0 (for nop).\n    if (WABT_LIKELY(value != 0 || code == 0)) {\n      return Opcode(static_cast<Enum>(value));\n    }\n  }\n\n  return Opcode(EncodeInvalidOpcode(prefix_code));\n}\n\n}  // namespace wabt\n\n#endif  // WABT_OPCODE_H_\n"
  },
  {
    "path": "include/wabt/option-parser.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_OPTION_PARSER_H_\n#define WABT_OPTION_PARSER_H_\n\n#include <functional>\n#include <string>\n#include <vector>\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\nclass OptionParser {\n public:\n  enum class HasArgument { No, Yes };\n  enum class ArgumentCount { One, OneOrMore, ZeroOrMore };\n\n  struct Option;\n  using Callback = std::function<void(const char*)>;\n  using NullCallback = std::function<void()>;\n\n  struct Option {\n    Option(char short_name,\n           const std::string& long_name,\n           const std::string& metavar,\n           HasArgument has_argument,\n           const std::string& help,\n           const Callback&);\n\n    char short_name;\n    std::string long_name;\n    std::string metavar;\n    bool has_argument;\n    std::string help;\n    Callback callback;\n  };\n\n  struct Argument {\n    Argument(const std::string& name, ArgumentCount, const Callback&);\n\n    std::string name;\n    ArgumentCount count;\n    Callback callback;\n    int handled_count = 0;\n  };\n\n  explicit OptionParser(const char* program_name, const char* description);\n\n  void AddOption(const Option&);\n  void AddArgument(const std::string& name, ArgumentCount, const Callback&);\n  void SetErrorCallback(const Callback&);\n  void Parse(int argc, char* argv[]);\n  void PrintHelp();\n\n  // Helper functions.\n  void AddOption(char short_name,\n                 const char* long_name,\n                 const char* help,\n                 const NullCallback&);\n  void AddOption(const char* long_name, const char* help, const NullCallback&);\n  void AddOption(char short_name,\n                 const char* long_name,\n                 const char* metavar,\n                 const char* help,\n                 const Callback&);\n\n private:\n  static int Match(const char* s, const std::string& full, bool has_argument);\n  void WABT_PRINTF_FORMAT(2, 3) Errorf(const char* format, ...);\n  void HandleArgument(size_t* arg_index, const char* arg_value);\n\n  // Print the error and exit(1).\n  void DefaultError(const std::string&);\n\n  std::string program_name_;\n  std::string description_;\n  std::vector<Option> options_;\n  std::vector<Argument> arguments_;\n  Callback on_error_;\n};\n\n}  // namespace wabt\n\n#endif /* WABT_OPTION_PARSER_H_ */\n"
  },
  {
    "path": "include/wabt/range.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_RANGE_H_\n#define WABT_RANGE_H_\n\nnamespace wabt {\n\ntemplate <typename T>\nstruct Range {\n  Range() : start(0), end(0) {}\n  Range(T start, T end) : start(start), end(end) {}\n  T start;\n  T end;\n\n  T size() const { return end - start; }\n};\n\nusing OffsetRange = Range<Offset>;\nusing ColumnRange = Range<int>;\n\n}  // namespace wabt\n\n#endif  // WABT_RANGE_H_\n"
  },
  {
    "path": "include/wabt/resolve-names.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_RESOLVE_NAMES_H_\n#define WABT_RESOLVE_NAMES_H_\n\n#include \"wabt/common.h\"\n#include \"wabt/error.h\"\n\nnamespace wabt {\n\nstruct Module;\nstruct Script;\n\nResult ResolveNamesModule(Module*, Errors*);\nResult ResolveNamesScript(Script*, Errors*);\n\n}  // namespace wabt\n\n#endif /* WABT_RESOLVE_NAMES_H_ */\n"
  },
  {
    "path": "include/wabt/result.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_RESULT_H_\n#define WABT_RESULT_H_\n\nnamespace wabt {\n\nstruct Result {\n  enum Enum {\n    Ok,\n    Error,\n  };\n\n  Result() : Result(Ok) {}\n  Result(Enum e) : enum_(e) {}\n  operator Enum() const { return enum_; }\n  Result& operator|=(Result rhs);\n\n private:\n  Enum enum_;\n};\n\ninline Result operator|(Result lhs, Result rhs) {\n  return (lhs == Result::Error || rhs == Result::Error) ? Result::Error\n                                                        : Result::Ok;\n}\n\ninline Result& Result::operator|=(Result rhs) {\n  enum_ = *this | rhs;\n  return *this;\n}\n\ninline bool Succeeded(Result result) {\n  return result == Result::Ok;\n}\ninline bool Failed(Result result) {\n  return result == Result::Error;\n}\n\n#define CHECK_RESULT(expr)          \\\n  do {                              \\\n    if (Failed(expr)) {             \\\n      return ::wabt::Result::Error; \\\n    }                               \\\n  } while (0)\n\n}  // namespace wabt\n\n#endif  // WABT_RESULT_H_\n"
  },
  {
    "path": "include/wabt/sha256.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_SHA256_H_\n#define WABT_SHA256_H_\n\n#include \"wabt/config.h\"\n\n#include <string>\n#include <string_view>\n\nnamespace wabt {\n\nvoid sha256(std::string_view input, std::string& digest);\n\n}  // namespace wabt\n\n#endif  // WABT_SHA256_H_\n"
  },
  {
    "path": "include/wabt/shared-validator.h",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_SHARED_VALIDATOR_H_\n#define WABT_SHARED_VALIDATOR_H_\n\n#include <map>\n#include <set>\n#include <string>\n#include <vector>\n\n#include \"wabt/common.h\"\n#include \"wabt/error.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/opcode.h\"\n#include \"wabt/type-checker.h\"\n\n#include \"wabt/binary-reader.h\"  // For TypeMut.\n\nnamespace wabt {\n\nstruct ValidateOptions {\n  ValidateOptions() = default;\n  ValidateOptions(const Features& features) : features(features) {}\n\n  Features features;\n};\n\nenum class TableImportStatus {\n  TableIsImported,\n  TableIsNotImported,\n};\n\nclass SharedValidator {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(SharedValidator);\n  using FuncType = TypeChecker::FuncType;\n  SharedValidator(Errors*, const ValidateOptions& options);\n\n  // TODO: Move into SharedValidator?\n  using Label = TypeChecker::Label;\n  size_t type_stack_size() const { return typechecker_.type_stack_size(); }\n  Result GetLabel(Index depth, Label** out_label) {\n    return typechecker_.GetLabel(depth, out_label);\n  }\n  Result GetCatchCount(Index depth, Index* out_count) {\n    return typechecker_.GetCatchCount(depth, out_count);\n  }\n\n  Result WABT_PRINTF_FORMAT(3, 4)\n      PrintError(const Location& loc, const char* fmt, ...);\n\n  void OnTypecheckerError(const char* msg);\n\n  Index GetLocalCount() const;\n\n  Result EndModule();\n\n  Result OnFuncType(const Location&,\n                    Index param_count,\n                    const Type* param_types,\n                    Index result_count,\n                    const Type* result_types,\n                    Index type_index);\n  Result OnStructType(const Location&, Index field_count, TypeMut* fields);\n  Result OnArrayType(const Location&, TypeMut field);\n\n  Result OnFunction(const Location&, Var sig_var);\n  Result OnTable(const Location&, Type elem_type, const Limits&, TableImportStatus import_status, TableInitExprStatus init_provided);\n  Result OnMemory(const Location&, const Limits&, uint32_t page_size);\n  Result OnGlobalImport(const Location&, Type type, bool mutable_);\n  Result OnGlobal(const Location&, Type type, bool mutable_);\n  Result OnTag(const Location&, Var sig_var);\n\n  Result OnExport(const Location&,\n                  ExternalKind,\n                  Var item_var,\n                  std::string_view name);\n\n  Result OnStart(const Location&, Var func_var);\n\n  Result OnElemSegment(const Location&, Var table_var, SegmentKind);\n  Result OnElemSegmentElemType(const Location&, Type elem_type);\n\n  void OnDataCount(Index count);\n  Result OnDataSegment(const Location&, Var memory_var, SegmentKind);\n\n  Result BeginInitExpr(const Location&, Type type);\n  Result EndInitExpr();\n\n  Result BeginFunctionBody(const Location&, Index func_index);\n  Result EndFunctionBody(const Location&);\n  Result OnLocalDecl(const Location&, Index count, Type type);\n\n  Result OnAtomicFence(const Location&, uint32_t consistency_model);\n  Result OnAtomicLoad(const Location&,\n                      Opcode,\n                      Var memidx,\n                      Address align,\n                      Address offset);\n  Result OnAtomicNotify(const Location&,\n                        Opcode,\n                        Var memidx,\n                        Address align,\n                        Address offset);\n  Result OnAtomicRmwCmpxchg(const Location&,\n                            Opcode,\n                            Var memidx,\n                            Address align,\n                            Address offset);\n  Result OnAtomicRmw(const Location&,\n                     Opcode,\n                     Var memidx,\n                     Address align,\n                     Address offset);\n  Result OnAtomicStore(const Location&,\n                       Opcode,\n                       Var memidx,\n                       Address align,\n                       Address offset);\n  Result OnAtomicWait(const Location&,\n                      Opcode,\n                      Var memidx,\n                      Address align,\n                      Address offset);\n  Result OnBinary(const Location&, Opcode);\n  Result OnTernary(const Location&, Opcode);\n  Result OnQuaternary(const Location&, Opcode);\n  Result OnBlock(const Location&, Type sig_type);\n  Result OnBr(const Location&, Var depth);\n  Result OnBrIf(const Location&, Var depth);\n  Result OnBrOnNonNull(const Location&, Var depth);\n  Result OnBrOnNull(const Location&, Var depth);\n  Result BeginBrTable(const Location&);\n  Result OnBrTableTarget(const Location&, Var depth);\n  Result EndBrTable(const Location&);\n  Result OnCall(const Location&, Var func_var);\n  Result OnCallIndirect(const Location&, Var sig_var, Var table_var);\n  Result OnCallRef(const Location&, Var function_type_var);\n  Result OnCatch(const Location&, Var tag_var, bool is_catch_all);\n  Result OnCompare(const Location&, Opcode);\n  Result OnConst(const Location&, Type);\n  Result OnConvert(const Location&, Opcode);\n  Result OnDataDrop(const Location&, Var segment_var);\n  Result OnDelegate(const Location&, Var depth);\n  Result OnDrop(const Location&);\n  Result OnElemDrop(const Location&, Var segment_var);\n  Result OnElse(const Location&);\n  Result OnEnd(const Location&);\n  Result OnGlobalGet(const Location&, Var);\n  Result OnGlobalSet(const Location&, Var);\n  Result OnIf(const Location&, Type sig_type);\n  Result OnLoad(const Location&, Opcode, Var memidx, Address align, Address offset);\n  Result OnLoadSplat(const Location&,\n                     Opcode,\n                     Var memidx,\n                     Address align,\n                     Address offset);\n  Result OnLoadZero(const Location&,\n                    Opcode,\n                    Var memidx,\n                    Address align,\n                    Address offset);\n  Result OnLocalGet(const Location&, Var);\n  Result OnLocalSet(const Location&, Var);\n  Result OnLocalTee(const Location&, Var);\n  Result OnLoop(const Location&, Type sig_type);\n  Result OnMemoryCopy(const Location&, Var destmemidx, Var srcmemidx);\n  Result OnMemoryFill(const Location&, Var memidx);\n  Result OnMemoryGrow(const Location&, Var memidx);\n  Result OnMemoryInit(const Location&, Var segment_var, Var memidx);\n  Result OnMemorySize(const Location&, Var memidx);\n  Result OnNop(const Location&);\n  Result OnRefAsNonNull(const Location&);\n  Result OnRefFunc(const Location&, Var func_var);\n  Result OnRefIsNull(const Location&);\n  Result OnRefNull(const Location&, Var func_type_var);\n  Result OnRethrow(const Location&, Var depth);\n  Result OnReturnCall(const Location&, Var func_var);\n  Result OnReturnCallIndirect(const Location&, Var sig_var, Var table_var);\n  Result OnReturnCallRef(const Location&, Var function_type_var);\n  Result OnReturn(const Location&);\n  Result OnSelect(const Location&, Index result_count, Type* result_types);\n  Result OnSimdLaneOp(const Location&, Opcode, uint64_t lane_idx);\n  Result OnSimdLoadLane(const Location&,\n                        Opcode,\n                        Var memidx,\n                        Address align,\n                        Address offset,\n                        uint64_t lane_idx);\n  Result OnSimdStoreLane(const Location&,\n                         Opcode,\n                         Var memidx,\n                         Address align,\n                         Address offset,\n                         uint64_t lane_idx);\n  Result OnSimdShuffleOp(const Location&, Opcode, v128 lane_idx);\n  Result OnStore(const Location&,\n                 Opcode,\n                 Var memidx,\n                 Address align,\n                 Address offset);\n  Result OnTableCopy(const Location&, Var dst_var, Var src_var);\n  Result OnTableFill(const Location&, Var table_var);\n  Result OnTableGet(const Location&, Var table_var);\n  Result OnTableGrow(const Location&, Var table_var);\n  Result OnTableInit(const Location&, Var segment_var, Var table_var);\n  Result OnTableSet(const Location&, Var table_var);\n  Result OnTableSize(const Location&, Var table_var);\n  Result OnThrow(const Location&, Var tag_var);\n  Result OnThrowRef(const Location&);\n  Result OnTry(const Location&, Type sig_type);\n  Result BeginTryTable(const Location&, Type sig_type);\n  Result OnTryTableCatch(const Location&, const TableCatch&);\n  Result EndTryTable(const Location&, Type sig_type);\n  Result OnUnary(const Location&, Opcode);\n  Result OnUnreachable(const Location&);\n\n private:\n  struct StructType {\n    StructType() = default;\n    StructType(const TypeMutVector& fields) : fields(fields) {}\n\n    TypeMutVector fields;\n  };\n\n  struct ArrayType {\n    ArrayType() = default;\n    ArrayType(TypeMut field) : field(field) {}\n\n    TypeMut field;\n  };\n\n  struct TableType {\n    TableType() = default;\n    TableType(Type element, Limits limits) : element(element), limits(limits) {}\n\n    Type element = Type::Any;\n    Limits limits;\n  };\n\n  struct MemoryType {\n    MemoryType() = default;\n    MemoryType(Limits limits) : limits(limits) {}\n\n    Limits limits;\n  };\n\n  struct GlobalType {\n    GlobalType() = default;\n    GlobalType(Type type, bool mutable_) : type(type), mutable_(mutable_) {}\n\n    Type type = Type::Any;\n    bool mutable_ = true;\n  };\n\n  struct TagType {\n    TypeVector params;\n  };\n\n  struct ElemType {\n    ElemType() = default;\n    ElemType(Type element, bool is_active, Type table_type)\n        : element(element), is_active(is_active), table_type(table_type) {}\n\n    Type element;\n    bool is_active;\n    Type table_type;\n  };\n\n  struct LocalDecl {\n    Type type;\n    Index end;\n  };\n\n  struct LocalReferenceMap {\n    Type type;\n    // An index for a single bit value, which represents that\n    // the corresponding local reference has been set before.\n    size_t local_ref_is_set;\n  };\n\n  bool ValidInitOpcode(Opcode opcode) const;\n  Result CheckInstr(Opcode opcode, const Location& loc);\n  Result CheckType(const Location&,\n                   Type actual,\n                   Type expected,\n                   const char* desc);\n  Result CheckReferenceType(const Location&, Type type, const char* desc);\n  Result CheckLimits(const Location&,\n                     const Limits&,\n                     uint64_t absolute_max,\n                     const char* desc);\n\n  Result CheckLocalIndex(Var local_var, Type* out_type);\n\n  Result CheckDeclaredFunc(Var func_var);\n\n  Result CheckIndex(Var var, Index max_index, const char* desc);\n  template <typename T>\n  Result CheckIndexWithValue(Var var,\n                             const std::vector<T>& values,\n                             T* out,\n                             const char* desc);\n  Result CheckFuncTypeIndex(Var sig_var, FuncType* out = nullptr);\n  Result CheckFuncIndex(Var func_var, FuncType* out = nullptr);\n  Result CheckTableIndex(Var table_var, TableType* out = nullptr);\n  Result CheckMemoryIndex(Var memory_var, MemoryType* out = nullptr);\n  Result CheckGlobalIndex(Var global_var, GlobalType* out = nullptr);\n  Result CheckTagIndex(Var tag_var, TagType* out = nullptr);\n  Result CheckElemSegmentIndex(Var elem_segment_var, ElemType* out = nullptr);\n  Result CheckDataSegmentIndex(Var data_segment_var);\n\n  Result CheckAlign(const Location&, Address align, Address natural_align);\n  Result CheckOffset(const Location&, Address offset, const Limits& limits);\n  Result CheckAtomicAlign(const Location&,\n                          Address align,\n                          Address natural_align);\n\n  Result CheckBlockSignature(const Location&,\n                             Opcode,\n                             Type sig_type,\n                             TypeVector* out_param_types,\n                             TypeVector* out_result_types);\n\n  Index GetFunctionTypeIndex(Index func_index) const;\n\n  TypeVector ToTypeVector(Index count, const Type* types);\n\n  void SaveLocalRefs();\n  void RestoreLocalRefs(Result result);\n  void IgnoreLocalRefs();\n\n  ValidateOptions options_;\n  Errors* errors_;\n  TypeChecker typechecker_;  // TODO: Move into SharedValidator.\n  // Cached for access by OnTypecheckerError.\n  Location expr_loc_ = Location(kInvalidOffset);\n  bool in_init_expr_ = false;\n\n  Index num_types_ = 0;\n  std::map<Index, FuncType> func_types_;\n  std::map<Index, StructType> struct_types_;\n  std::map<Index, ArrayType> array_types_;\n\n  std::vector<FuncType> funcs_;       // Includes imported and defined.\n  std::vector<TableType> tables_;     // Includes imported and defined.\n  std::vector<MemoryType> memories_;  // Includes imported and defined.\n  std::vector<GlobalType> globals_;   // Includes imported and defined.\n  std::vector<TagType> tags_;         // Includes imported and defined.\n  std::vector<ElemType> elems_;\n  Index starts_ = 0;\n  Index num_imported_globals_ = 0;\n  Index data_segments_ = 0;\n\n  // Includes parameters, since this is only used for validating\n  // local.{get,set,tee} instructions.\n  std::vector<LocalDecl> locals_;\n  std::map<Index, LocalReferenceMap> local_refs_map_;\n  std::vector<bool> local_ref_is_set_;\n\n  std::set<std::string> export_names_;  // Used to check for duplicates.\n  std::set<Index> declared_funcs_;      // TODO: optimize?\n  std::vector<Var> check_declared_funcs_;\n};\n\n}  // namespace wabt\n\n#endif  // WABT_SHARED_VALIDATOR_H_\n"
  },
  {
    "path": "include/wabt/stream.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_STREAM_H_\n#define WABT_STREAM_H_\n\n#include <cassert>\n#include <memory>\n#include <vector>\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\n/* whether to display the ASCII characters in the debug output for\n * write_memory */\nenum class PrintChars {\n  No = 0,\n  Yes = 1,\n};\n\nclass Stream {\n public:\n  explicit Stream(Stream* log_stream = nullptr);\n  virtual ~Stream() = default;\n\n  size_t offset() { return offset_; }\n  Result result() { return result_; }\n\n  void set_log_stream(Stream* stream) {\n    assert(stream);\n    log_stream_ = stream;\n  }\n\n  Stream& log_stream() {\n    assert(log_stream_);\n    return *log_stream_;\n  }\n\n  bool has_log_stream() const { return log_stream_ != nullptr; }\n\n  void ClearOffset() { offset_ = 0; }\n  void AddOffset(ssize_t delta);\n\n  void WriteData(const void* src,\n                 size_t size,\n                 const char* desc = nullptr,\n                 PrintChars = PrintChars::No);\n\n  template <typename T>\n  void WriteData(const std::vector<T> src,\n                 const char* desc,\n                 PrintChars print_chars = PrintChars::No) {\n    if (!src.empty()) {\n      WriteData(src.data(), src.size() * sizeof(T), desc, print_chars);\n    }\n  }\n\n  void WriteDataAt(size_t offset,\n                   const void* src,\n                   size_t size,\n                   const char* desc = nullptr,\n                   PrintChars = PrintChars::No);\n\n  void MoveData(size_t dst_offset, size_t src_offset, size_t size);\n\n  void Truncate(size_t size);\n\n  void WABT_PRINTF_FORMAT(2, 3) Writef(const char* format, ...);\n\n  // Specified as uint32_t instead of uint8_t so we can check if the value\n  // given is in range before wrapping.\n  void WriteU8(uint32_t value,\n               const char* desc = nullptr,\n               PrintChars print_chars = PrintChars::No) {\n    assert(value <= UINT8_MAX);\n    Write(static_cast<uint8_t>(value), desc, print_chars);\n  }\n  void WriteU32(uint32_t value,\n                const char* desc = nullptr,\n                PrintChars print_chars = PrintChars::No) {\n    Write(value, desc, print_chars);\n  }\n  void WriteU64(uint64_t value,\n                const char* desc = nullptr,\n                PrintChars print_chars = PrintChars::No) {\n    Write(value, desc, print_chars);\n  }\n  void WriteU128(v128 value,\n                 const char* desc = nullptr,\n                 PrintChars print_chars = PrintChars::No) {\n    Write(value, desc, print_chars);\n  }\n\n  void WriteChar(char c,\n                 const char* desc = nullptr,\n                 PrintChars print_chars = PrintChars::No) {\n    WriteU8(static_cast<unsigned char>(c), desc, print_chars);\n  }\n\n  // Dump memory as text, similar to the xxd format.\n  void WriteMemoryDump(const void* start,\n                       size_t size,\n                       size_t offset = 0,\n                       PrintChars print_chars = PrintChars::No,\n                       const char* prefix = nullptr,\n                       const char* desc = nullptr);\n\n  // Convenience functions for writing enums.\n  template <typename T>\n  void WriteU8Enum(T value,\n                   const char* desc = nullptr,\n                   PrintChars print_chars = PrintChars::No) {\n    WriteU8(static_cast<uint32_t>(value), desc, print_chars);\n  }\n\n  virtual void Flush() {}\n\n protected:\n  virtual Result WriteDataImpl(size_t offset,\n                               const void* data,\n                               size_t size) = 0;\n  virtual Result MoveDataImpl(size_t dst_offset,\n                              size_t src_offset,\n                              size_t size) = 0;\n  virtual Result TruncateImpl(size_t size) = 0;\n\n private:\n  template <typename T>\n  void Write(const T& data, const char* desc, PrintChars print_chars) {\n#if WABT_BIG_ENDIAN\n    char tmp[sizeof(T)];\n    memcpy(tmp, &data, sizeof(tmp));\n    SwapBytesSized(tmp, sizeof(tmp));\n    WriteData(tmp, sizeof(tmp), desc, print_chars);\n#else\n    WriteData(&data, sizeof(data), desc, print_chars);\n#endif\n  }\n\n  size_t offset_;\n  Result result_;\n  // Not owned. If non-null, log all writes to this stream.\n  Stream* log_stream_;\n};\n\nstruct OutputBuffer {\n  Result WriteToFile(std::string_view filename) const;\n  Result WriteToStdout() const;\n\n  void clear() { data.clear(); }\n  size_t size() const { return data.size(); }\n\n  std::vector<uint8_t> data;\n};\n\nclass MemoryStream : public Stream {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(MemoryStream);\n  MemoryStream(MemoryStream&&) = default;\n  explicit MemoryStream(Stream* log_stream = nullptr);\n  explicit MemoryStream(std::unique_ptr<OutputBuffer>&&,\n                        Stream* log_stream = nullptr);\n\n  OutputBuffer& output_buffer() { return *buf_; }\n  std::unique_ptr<OutputBuffer> ReleaseOutputBuffer();\n\n  void Clear();\n\n  Result WriteToFile(std::string_view filename) {\n    return buf_->WriteToFile(filename);\n  }\n\n protected:\n  Result WriteDataImpl(size_t offset, const void* data, size_t size) override;\n  Result MoveDataImpl(size_t dst_offset,\n                      size_t src_offset,\n                      size_t size) override;\n  Result TruncateImpl(size_t size) override;\n\n private:\n  std::unique_ptr<OutputBuffer> buf_;\n};\n\nclass FileStream : public Stream {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(FileStream);\n  explicit FileStream(std::string_view filename, Stream* log_stream = nullptr);\n  explicit FileStream(FILE*, Stream* log_stream = nullptr);\n  FileStream(FileStream&&);\n  FileStream& operator=(FileStream&&);\n  ~FileStream() override;\n\n  static std::unique_ptr<FileStream> CreateStdout();\n  static std::unique_ptr<FileStream> CreateStderr();\n\n  bool is_open() const { return file_ != nullptr; }\n\n  void Flush() override;\n\n protected:\n  Result WriteDataImpl(size_t offset, const void* data, size_t size) override;\n  Result MoveDataImpl(size_t dst_offset,\n                      size_t src_offset,\n                      size_t size) override;\n  Result TruncateImpl(size_t size) override;\n\n private:\n  FILE* file_;\n  size_t offset_;\n  bool should_close_;\n};\n\n}  // namespace wabt\n\n#endif /* WABT_STREAM_H_ */\n"
  },
  {
    "path": "include/wabt/string-format.h",
    "content": "/*\n * Copyright 2021 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_STRING_FORMAT_H_\n#define WABT_STRING_FORMAT_H_\n\n#include <cstdarg>\n#include <string>\n#include <vector>\n\n#include \"wabt/config.h\"\n\n#define PRIstringview \"%.*s\"\n#define WABT_PRINTF_STRING_VIEW_ARG(x) \\\n  static_cast<int>((x).length()), (x).data()\n\n#define PRItypecode \"%s%#x\"\n#define WABT_PRINTF_TYPE_CODE(x) \\\n  (static_cast<int32_t>(x) < 0 ? \"-\" : \"\"), std::abs(static_cast<int32_t>(x))\n\n#define WABT_DEFAULT_SNPRINTF_ALLOCA_BUFSIZE 128\n#define WABT_SNPRINTF_ALLOCA(buffer, len, format)                          \\\n  va_list args;                                                            \\\n  va_list args_copy;                                                       \\\n  va_start(args, format);                                                  \\\n  va_copy(args_copy, args);                                                \\\n  char fixed_buf[WABT_DEFAULT_SNPRINTF_ALLOCA_BUFSIZE];                    \\\n  char* buffer = fixed_buf;                                                \\\n  size_t len = wabt_vsnprintf(fixed_buf, sizeof(fixed_buf), format, args); \\\n  va_end(args);                                                            \\\n  if (len + 1 > sizeof(fixed_buf)) {                                       \\\n    buffer = static_cast<char*>(alloca(len + 1));                          \\\n    len = wabt_vsnprintf(buffer, len + 1, format, args_copy);              \\\n  }                                                                        \\\n  va_end(args_copy)\n\nnamespace wabt {\n\ninline std::string WABT_PRINTF_FORMAT(1, 2)\n    StringPrintf(const char* format, ...) {\n  va_list args;\n  va_list args_copy;\n  va_start(args, format);\n  va_copy(args_copy, args);\n  size_t len = wabt_vsnprintf(nullptr, 0, format, args) + 1;  // For \\0.\n  std::vector<char> buffer(len);\n  va_end(args);\n  wabt_vsnprintf(buffer.data(), len, format, args_copy);\n  va_end(args_copy);\n  return std::string(buffer.data(), len - 1);\n}\n\n}  // namespace wabt\n\n#endif  // WABT_STRING_FORMAT_H_\n"
  },
  {
    "path": "include/wabt/string-util.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_STRING_UTIL_H_\n#define WABT_STRING_UTIL_H_\n\n#include <string>\n#include <string_view>\n\nnamespace wabt {\n\ninline std::string& operator+=(std::string& x, std::string_view y) {\n  x.append(y.data(), y.size());\n  return x;\n}\n\ninline std::string operator+(std::string_view x, std::string_view y) {\n  std::string s;\n  s.reserve(x.size() + y.size());\n  s.append(x.data(), x.size());\n  s.append(y.data(), y.size());\n  return s;\n}\n\ninline std::string operator+(const std::string& x, std::string_view y) {\n  return std::string_view(x) + y;\n}\n\ninline std::string operator+(std::string_view x, const std::string& y) {\n  return x + std::string_view(y);\n}\n\ninline std::string operator+(const char* x, std::string_view y) {\n  return std::string_view(x) + y;\n}\n\ninline std::string operator+(std::string_view x, const char* y) {\n  return x + std::string_view(y);\n}\n\ninline void cat_concatenate(std::string&) {}\n\ntemplate <typename T, typename... Ts>\nvoid cat_concatenate(std::string& s, const T& t, const Ts&... args) {\n  s += t;\n  cat_concatenate(s, args...);\n}\n\ninline size_t cat_compute_size() {\n  return 0;\n}\n\ntemplate <typename T, typename... Ts>\nsize_t cat_compute_size(const T& t, const Ts&... args) {\n  return std::string_view(t).size() + cat_compute_size(args...);\n}\n\n// Is able to concatenate any combination of string/string_view/char*\ntemplate <typename... Ts>\nstd::string cat(const Ts&... args) {\n  std::string s;\n  s.reserve(cat_compute_size(args...));\n  cat_concatenate(s, args...);\n  return s;\n}\n\n}  // namespace wabt\n\n#endif  // WABT_STRING_UTIL_H_\n"
  },
  {
    "path": "include/wabt/token.def",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_TOKEN\n#error \"You must define WABT_TOKEN before including this file.\"\n#endif\n\n/* Tokens with no additional data (i.e. bare). */\nWABT_TOKEN(Invalid, \"Invalid\")\nWABT_TOKEN(After, \"after\")\nWABT_TOKEN(Array, \"array\")\nWABT_TOKEN(AssertException, \"assert_exception\")\nWABT_TOKEN(AssertExhaustion, \"assert_exhaustion\")\nWABT_TOKEN(AssertInvalid, \"assert_invalid\")\nWABT_TOKEN(AssertMalformed, \"assert_malformed\")\nWABT_TOKEN(AssertReturn, \"assert_return\")\nWABT_TOKEN(AssertTrap, \"assert_trap\")\nWABT_TOKEN(AssertUnlinkable, \"assert_unlinkable\")\nWABT_TOKEN(Before, \"before\")\nWABT_TOKEN(Bin, \"bin\")\nWABT_TOKEN(Item, \"item\")\nWABT_TOKEN(Data, \"data\")\nWABT_TOKEN(Declare, \"declare\")\nWABT_TOKEN(Delegate, \"delegate\")\nWABT_TOKEN(Do, \"do\")\nWABT_TOKEN(Either, \"either\")\nWABT_TOKEN(Elem, \"elem\")\nWABT_TOKEN(Eof, \"EOF\")\nWABT_TOKEN(Tag, \"tag\")\nWABT_TOKEN(Export, \"export\")\nWABT_TOKEN(Field, \"field\")\nWABT_TOKEN(Function, \"function\")\nWABT_TOKEN(Get, \"get\")\nWABT_TOKEN(Global, \"global\")\nWABT_TOKEN(Import, \"import\")\nWABT_TOKEN(Invoke, \"invoke\")\nWABT_TOKEN(Input, \"input\")\nWABT_TOKEN(Local, \"local\")\nWABT_TOKEN(Lpar, \"(\")\nWABT_TOKEN(Memory, \"memory\")\nWABT_TOKEN(Module, \"module\")\nWABT_TOKEN(Mut, \"mut\")\nWABT_TOKEN(NanArithmetic, \"nan:arithmetic\")\nWABT_TOKEN(NanCanonical, \"nan:canonical\")\nWABT_TOKEN(Null, \"null\")\nWABT_TOKEN(Offset, \"offset\")\nWABT_TOKEN(Output, \"output\")\nWABT_TOKEN(PageSize, \"pagesize\")\nWABT_TOKEN(Param, \"param\")\nWABT_TOKEN(Ref, \"ref\")\nWABT_TOKEN(Quote, \"quote\")\nWABT_TOKEN(Register, \"register\")\nWABT_TOKEN(Result, \"result\")\nWABT_TOKEN(Rpar, \")\")\nWABT_TOKEN(Shared, \"shared\")\nWABT_TOKEN(Start, \"start\")\nWABT_TOKEN(Struct, \"struct\")\nWABT_TOKEN(Table, \"table\")\nWABT_TOKEN(Then, \"then\")\nWABT_TOKEN(Type, \"type\")\nWABT_TOKEN(I8X16, \"i8x16\")\nWABT_TOKEN(I16X8, \"i16x8\")\nWABT_TOKEN(I32X4, \"i32x4\")\nWABT_TOKEN(I64X2, \"i64x2\")\nWABT_TOKEN(F32X4, \"f32x4\")\nWABT_TOKEN(F64X2, \"f64x2\")\nWABT_TOKEN_FIRST(Bare, Invalid)\nWABT_TOKEN_LAST(Bare, F64X2)\n\n/* Tokens with Literal data. */\nWABT_TOKEN(Float, \"FLOAT\")\nWABT_TOKEN(Int, \"INT\")\nWABT_TOKEN(Nat, \"NAT\")\nWABT_TOKEN_FIRST(Literal, Float)\nWABT_TOKEN_LAST(Literal, Nat)\n\n/* Tokens with Opcode data. */\nWABT_TOKEN(AtomicFence, \"atomic.fence\")\nWABT_TOKEN(AtomicLoad, \"ATOMIC_LOAD\")\nWABT_TOKEN(AtomicNotify, \"ATOMIC_NOTIFY\")\nWABT_TOKEN(AtomicRmw, \"ATOMIC_RMW\")\nWABT_TOKEN(AtomicRmwCmpxchg, \"ATOMIC_RMW_CMPXCHG\")\nWABT_TOKEN(AtomicStore, \"ATOMIC_STORE\")\nWABT_TOKEN(AtomicWait, \"ATOMIC_WAIT\")\nWABT_TOKEN(Binary, \"BINARY\")\nWABT_TOKEN(Quaternary, \"QUATERNARY\")\nWABT_TOKEN(Block, \"block\")\nWABT_TOKEN(Br, \"br\")\nWABT_TOKEN(BrIf, \"br_if\")\nWABT_TOKEN(BrOnNonNull, \"br_on_non_null\")\nWABT_TOKEN(BrOnNull, \"br_on_null\")\nWABT_TOKEN(BrTable, \"br_table\")\nWABT_TOKEN(Code, \"code\")\nWABT_TOKEN(Call, \"call\")\nWABT_TOKEN(CallIndirect, \"call_indirect\")\nWABT_TOKEN(CallRef, \"call_ref\")\nWABT_TOKEN(ReturnCallRef, \"return_call_ref\")\nWABT_TOKEN(Catch, \"catch\")\nWABT_TOKEN(CatchAll, \"catch_all\")\nWABT_TOKEN(CatchRef, \"catch_ref\")\nWABT_TOKEN(CatchAllRef, \"catch_all_ref\")\nWABT_TOKEN(Compare, \"COMPARE\")\nWABT_TOKEN(Const, \"CONST\")\nWABT_TOKEN(Convert, \"CONVERT\")\nWABT_TOKEN(DataDrop, \"data.drop\")\nWABT_TOKEN(Drop, \"drop\")\nWABT_TOKEN(ElemDrop, \"elem.drop\")\nWABT_TOKEN(Else, \"else\")\nWABT_TOKEN(End, \"end\")\nWABT_TOKEN(GlobalGet, \"global.get\")\nWABT_TOKEN(GlobalSet, \"global.set\")\nWABT_TOKEN(If, \"if\")\nWABT_TOKEN(Load, \"LOAD\")\nWABT_TOKEN(LocalGet, \"local.get\")\nWABT_TOKEN(LocalSet, \"local.set\")\nWABT_TOKEN(LocalTee, \"local.tee\")\nWABT_TOKEN(Loop, \"loop\")\nWABT_TOKEN(MemoryCopy, \"memory.copy\")\nWABT_TOKEN(MemoryFill, \"memory.fill\")\nWABT_TOKEN(MemoryGrow, \"memory.grow\")\nWABT_TOKEN(MemoryInit, \"memory.init\")\nWABT_TOKEN(MemorySize, \"memory.size\")\nWABT_TOKEN(Nop, \"nop\")\nWABT_TOKEN(RefAsNonNull, \"ref.as_non_null\")\nWABT_TOKEN(RefExtern, \"ref.extern\")\nWABT_TOKEN(RefFunc, \"ref.func\")\nWABT_TOKEN(RefIsNull, \"ref.is_null\")\nWABT_TOKEN(RefNull, \"ref.null\")\nWABT_TOKEN(Rethrow, \"rethrow\")\nWABT_TOKEN(ReturnCallIndirect, \"return_call_indirect\")\nWABT_TOKEN(ReturnCall, \"return_call\")\nWABT_TOKEN(Return, \"return\")\nWABT_TOKEN(Select, \"select\")\nWABT_TOKEN(SimdLaneOp, \"SIMDLANEOP\")\nWABT_TOKEN(SimdLoadSplat, \"SIMDLOADSPLAT\")\nWABT_TOKEN(SimdLoadLane, \"SIMDLOADLANE\")\nWABT_TOKEN(SimdStoreLane, \"SIMDSTORELANE\")\nWABT_TOKEN(SimdShuffleOp, \"i8x16.shuffle\")\nWABT_TOKEN(Store, \"STORE\")\nWABT_TOKEN(TableCopy, \"table.copy\")\nWABT_TOKEN(TableFill, \"table.fill\")\nWABT_TOKEN(TableGet, \"table.get\")\nWABT_TOKEN(TableGrow, \"table.grow\")\nWABT_TOKEN(TableInit, \"table.init\")\nWABT_TOKEN(TableSet, \"table.set\")\nWABT_TOKEN(TableSize, \"table.size\")\nWABT_TOKEN(Ternary, \"TERNARY\")\nWABT_TOKEN(Throw, \"throw\")\nWABT_TOKEN(ThrowRef, \"throw_ref\")\nWABT_TOKEN(Try, \"try\")\nWABT_TOKEN(TryTable, \"try_table\")\nWABT_TOKEN(Unary, \"UNARY\")\nWABT_TOKEN(Unreachable, \"unreachable\")\nWABT_TOKEN_FIRST(Opcode, AtomicFence)\nWABT_TOKEN_LAST(Opcode, Unreachable)\n\n/* Tokens with string data. */\nWABT_TOKEN(AlignEqNat, \"align=\")\nWABT_TOKEN(LparAnn, \"Annotation\")\nWABT_TOKEN(OffsetEqNat, \"offset=\")\nWABT_TOKEN(Reserved, \"Reserved\")\nWABT_TOKEN(Text, \"TEXT\")\nWABT_TOKEN(Var, \"VAR\")\nWABT_TOKEN_FIRST(String, AlignEqNat)\nWABT_TOKEN_LAST(String, Var)\n\n/* Tokens with Type data. */\nWABT_TOKEN(ValueType, \"VALUETYPE\")\nWABT_TOKEN_FIRST(Type, ValueType)\nWABT_TOKEN_LAST(Type, ValueType)\n\n/* Tokens with Type data, but are reference kinds. */\nWABT_TOKEN(Func, \"func\")\nWABT_TOKEN(Extern, \"extern\")\nWABT_TOKEN(Exn, \"exn\")\nWABT_TOKEN_FIRST(RefKind, Func)\nWABT_TOKEN_LAST(RefKind, Exn)\n"
  },
  {
    "path": "include/wabt/token.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_TOKEN_H_\n#define WABT_TOKEN_H_\n\n#include <string_view>\n\n#include \"wabt/literal.h\"\n#include \"wabt/opcode.h\"\n\nnamespace wabt {\n\nstruct Literal {\n  Literal() = default;\n  Literal(LiteralType type, std::string_view text) : type(type), text(text) {}\n\n  LiteralType type;\n  std::string_view text;\n};\n\nenum class TokenType {\n#define WABT_TOKEN(name, string) name,\n#define WABT_TOKEN_FIRST(group, first) First_##group = first,\n#define WABT_TOKEN_LAST(group, last) Last_##group = last,\n#include \"wabt/token.def\"\n#undef WABT_TOKEN\n#undef WABT_TOKEN_FIRST\n#undef WABT_TOKEN_LAST\n\n  First = First_Bare,\n  Last = Last_RefKind,\n};\n\nconst char* GetTokenTypeName(TokenType);\n\ninline bool IsTokenTypeBare(TokenType token_type) {\n  return token_type >= TokenType::First_Bare &&\n         token_type <= TokenType::Last_Bare;\n}\n\ninline bool IsTokenTypeString(TokenType token_type) {\n  return token_type >= TokenType::First_String &&\n         token_type <= TokenType::Last_String;\n}\n\ninline bool IsTokenTypeType(TokenType token_type) {\n  return token_type == TokenType::ValueType;\n}\n\ninline bool IsTokenTypeOpcode(TokenType token_type) {\n  return token_type >= TokenType::First_Opcode &&\n         token_type <= TokenType::Last_Opcode;\n}\n\ninline bool IsTokenTypeLiteral(TokenType token_type) {\n  return token_type >= TokenType::First_Literal &&\n         token_type <= TokenType::Last_Literal;\n}\n\ninline bool IsTokenTypeRefKind(TokenType token_type) {\n  return token_type >= TokenType::First_RefKind &&\n         token_type <= TokenType::Last_RefKind;\n}\n\nstruct Token {\n  Token() : token_type_(TokenType::Invalid) {}\n  Token(Location, TokenType);\n  Token(Location, TokenType, Type);\n  Token(Location, TokenType, std::string_view);\n  Token(Location, TokenType, Opcode);\n  Token(Location, TokenType, const Literal&);\n\n  Location loc;\n\n  TokenType token_type() const { return token_type_; }\n\n  bool HasText() const { return IsTokenTypeString(token_type_); }\n  bool HasType() const {\n    return IsTokenTypeType(token_type_) || IsTokenTypeRefKind(token_type_);\n  }\n  bool HasOpcode() const { return IsTokenTypeOpcode(token_type_); }\n  bool HasLiteral() const { return IsTokenTypeLiteral(token_type_); }\n\n  std::string_view text() const {\n    assert(HasText());\n    return text_;\n  }\n\n  Type type() const {\n    assert(HasType());\n    return type_;\n  }\n\n  Opcode opcode() const {\n    assert(HasOpcode());\n    return opcode_;\n  }\n\n  const Literal& literal() const {\n    assert(HasLiteral());\n    return literal_;\n  }\n\n  std::string to_string() const;\n  std::string to_string_clamp(size_t max_length) const;\n\n private:\n  TokenType token_type_;\n\n  union {\n    std::string_view text_;\n    Type type_;\n    Opcode opcode_;\n    Literal literal_;\n  };\n};\n\n}  // namespace wabt\n\n#endif  // WABT_TOKEN_H_\n"
  },
  {
    "path": "include/wabt/tracing.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_TRACING_H_\n#define WABT_TRACING_H_\n\n// Provides a simple tracing class that automatically generates enter/exit\n// messages using the scope of the instance.\n//\n// It also assumes that this file is only included in .cc files.\n// Immediately before the inclusion of this file, there is a define of\n// for WABT_TRACING, defining whether tracing should be compiled in for\n// that source file.\n\n#ifndef WABT_TRACING\n#define WABT_TRACING 0\n#endif\n\n#include \"wabt/common.h\"\n\nnamespace wabt {\n\n#if WABT_TRACING\n\n// Scoped class that automatically prints enter(\"->\") and exit(\"<-\")\n// lines, indented by trace level.\nstruct TraceScope {\n  WABT_DISALLOW_COPY_AND_ASSIGN(TraceScope);\n  TraceScope() = delete;\n  TraceScope(const char* method);\n  template <typename... Args>\n  TraceScope(const char* method, const char* format, Args&&... args)\n      : method_(method) {\n    PrintEnter(method);\n    fprintf(stderr, format, std::forward<Args>(args)...);\n    PrintNewline();\n  }\n  ~TraceScope();\n\n private:\n  const char* method_;\n  void PrintEnter(const char* method);\n  void PrintNewline();\n};\n\n#define WABT_TRACE(method_name) TraceScope _func_(#method_name)\n\n#define WABT_TRACE_ARGS(method_name, format, ...) \\\n  TraceScope _func_(#method_name, format, __VA_ARGS__)\n\n#else\n\n#define WABT_TRACE(method)\n#define WABT_TRACE_ARGS(method_name, format, ...)\n\n#endif\n\n}  // end namespace wabt\n\n#endif  // WABT_TRACING_H_\n"
  },
  {
    "path": "include/wabt/type-checker.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_TYPE_CHECKER_H_\n#define WABT_TYPE_CHECKER_H_\n\n#include <functional>\n#include <type_traits>\n#include <vector>\n#include <map>\n\n#include \"wabt/common.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/opcode.h\"\n\nnamespace wabt {\n\nclass TypeChecker {\n public:\n  using ErrorCallback = std::function<void(const char* msg)>;\n\n  struct FuncType {\n    FuncType() = default;\n    FuncType(const TypeVector& params,\n             const TypeVector& results,\n             Index type_index)\n        : params(params), results(results), type_index(type_index) {}\n\n    TypeVector params;\n    TypeVector results;\n    Index type_index;\n  };\n\n  struct Label {\n    Label(LabelType,\n          const TypeVector& param_types,\n          const TypeVector& result_types,\n          size_t limit);\n\n    TypeVector& br_types() {\n      return label_type == LabelType::Loop ? param_types : result_types;\n    }\n\n    LabelType label_type;\n    TypeVector param_types;\n    TypeVector result_types;\n    size_t type_stack_limit;\n    bool unreachable;\n    std::vector<bool> local_ref_is_set_;\n  };\n\n  explicit TypeChecker(const Features& features, std::map<Index, FuncType>& func_types)\n    : features_(features), func_types_(func_types) {}\n\n  void set_error_callback(const ErrorCallback& error_callback) {\n    error_callback_ = error_callback;\n  }\n\n  size_t type_stack_size() const { return type_stack_.size(); }\n\n  bool IsUnreachable();\n  Result GetLabel(Index depth, Label** out_label);\n  Result GetRethrowLabel(Index depth, Label** out_label);\n  Result GetCatchCount(Index depth, Index* out_depth);\n\n  Result BeginFunction(const TypeVector& sig);\n  Result OnUnary(Opcode);\n  Result OnBinary(Opcode);\n  Result OnQuaternary(Opcode);\n  Result OnTernary(Opcode);\n  Result OnAtomicFence(uint32_t consistency_model);\n  Result OnAtomicLoad(Opcode, const Limits& limits);\n  Result OnAtomicNotify(Opcode, const Limits& limits);\n  Result OnAtomicStore(Opcode, const Limits& limits);\n  Result OnAtomicRmw(Opcode, const Limits& limits);\n  Result OnAtomicRmwCmpxchg(Opcode, const Limits& limits);\n  Result OnAtomicWait(Opcode, const Limits& limits);\n  Result OnBlock(const TypeVector& param_types, const TypeVector& result_types);\n  Result OnBr(Index depth);\n  Result OnBrIf(Index depth);\n  Result OnBrOnNonNull(Index depth);\n  Result OnBrOnNull(Index depth);\n  Result BeginBrTable();\n  Result OnBrTableTarget(Index depth);\n  Result EndBrTable();\n  Result OnCall(const TypeVector& param_types, const TypeVector& result_types);\n  Result OnCallIndirect(const TypeVector& param_types,\n                        const TypeVector& result_types,\n                        const Limits& table_limits);\n  Result OnCallRef(Type type,\n                   const TypeVector& param_types,\n                   const TypeVector& result_types);\n  Result OnReturnCall(const TypeVector& param_types,\n                      const TypeVector& result_types);\n  Result OnReturnCallIndirect(const TypeVector& param_types,\n                              const TypeVector& result_types);\n  Result OnReturnCallRef(Type type,\n                         const TypeVector& param_types,\n                         const TypeVector& result_types);\n  Result OnCatch(const TypeVector& sig);\n  Result OnCompare(Opcode);\n  Result OnConst(Type);\n  Result OnConvert(Opcode);\n  Result OnDelegate(Index depth);\n  Result OnDrop();\n  Result OnElse();\n  Result OnEnd();\n  Result OnGlobalGet(Type);\n  Result OnGlobalSet(Type);\n  Result OnIf(const TypeVector& param_types, const TypeVector& result_types);\n  Result OnLoad(Opcode, const Limits& limits);\n  Result OnLocalGet(Type);\n  Result OnLocalSet(Type);\n  Result OnLocalTee(Type);\n  Result OnLoop(const TypeVector& param_types, const TypeVector& result_types);\n  Result OnMemoryCopy(const Limits& dst_limits, const Limits& src_limits);\n  Result OnDataDrop(Index);\n  Result OnMemoryFill(const Limits& limits);\n  Result OnMemoryGrow(const Limits& limits);\n  Result OnMemoryInit(Index, const Limits& limits);\n  Result OnMemorySize(const Limits& limits);\n  Result OnTableCopy(const Limits& dst_limits, const Limits& src_limits);\n  Result OnElemDrop(Index);\n  Result OnTableInit(Index, const Limits& limits);\n  Result OnTableGet(Type elem_type, const Limits& limits);\n  Result OnTableSet(Type elem_type, const Limits& limits);\n  Result OnTableGrow(Type elem_type, const Limits& limits);\n  Result OnTableSize(const Limits& limits);\n  Result OnTableFill(Type elem_type, const Limits& limits);\n  Result OnRefFuncExpr(Index func_type);\n  Result OnRefAsNonNullExpr();\n  Result OnRefNullExpr(Type type);\n  Result OnRefIsNullExpr();\n  Result OnRethrow(Index depth);\n  Result OnReturn();\n  Result OnSelect(const TypeVector& result_types);\n  Result OnSimdLaneOp(Opcode, uint64_t);\n  Result OnSimdLoadLane(Opcode, const Limits& limits, uint64_t);\n  Result OnSimdStoreLane(Opcode, const Limits& limits, uint64_t);\n  Result OnSimdShuffleOp(Opcode, v128);\n  Result OnStore(Opcode, const Limits& limits);\n  Result OnThrow(const TypeVector& sig);\n  Result OnThrowRef();\n  Result OnTry(const TypeVector& param_types, const TypeVector& result_types);\n  Result OnTryTableCatch(const TypeVector& sig, Index);\n  Result BeginTryTable(const TypeVector& param_types);\n  Result EndTryTable(const TypeVector& param_types,\n                     const TypeVector& result_types);\n  Result OnUnreachable();\n  Result EndFunction();\n\n  Result BeginInitExpr(Type type);\n  Result EndInitExpr();\n\n  Result CheckType(Type actual, Type expected);\n\n private:\n  void WABT_PRINTF_FORMAT(2, 3) PrintError(const char* fmt, ...);\n  Result TopLabel(Label** out_label);\n  void ResetTypeStackToLabel(Label* label);\n  Result SetUnreachable();\n  void PushLabel(LabelType label_type,\n                 const TypeVector& param_types,\n                 const TypeVector& result_types);\n  Result PopLabel();\n  Result CheckLabelType(Label* label, LabelType label_type);\n  Result Check2LabelTypes(Label* label,\n                          LabelType label_type1,\n                          LabelType label_type2);\n  Result GetThisFunctionLabel(Label** label);\n  Result PeekType(Index depth, Type* out_type);\n  Result PeekAndCheckType(Index depth, Type expected);\n  Result DropTypes(size_t drop_count);\n  void PushType(Type type);\n  void PushTypes(const TypeVector& types);\n  Result CheckTypeStackEnd(const char* desc);\n  Result CheckTypes(const TypeVector& actual, const TypeVector& expected);\n  Result CheckSignature(const TypeVector& sig, const char* desc);\n  Result CheckReturnSignature(const TypeVector& sig,\n                              const TypeVector& expected,\n                              const char* desc);\n  Result PopAndCheckSignature(const TypeVector& sig, const char* desc);\n  Result PopAndCheckCall(const TypeVector& param_types,\n                         const TypeVector& result_types,\n                         const char* desc);\n  Result PopAndCheckReturnCall(const TypeVector& result_types,\n                               const char* desc);\n  Result PopAndCheck1Type(Type expected, const char* desc);\n  Result PopAndCheck2Types(Type expected1, Type expected2, const char* desc);\n  Result PopAndCheck3Types(Type expected1,\n                           Type expected2,\n                           Type expected3,\n                           const char* desc);\n  Result PopAndCheck4Types(Type expected1,\n                           Type expected2,\n                           Type expected3,\n                           Type expected4,\n                           const char* desc);\n  Result PopAndCheckReference(Type* actual, const char* desc);\n  Result CheckOpcode1(Opcode opcode, const Limits* limits = nullptr);\n  Result CheckOpcode2(Opcode opcode, const Limits* limits = nullptr);\n  Result CheckOpcode3(Opcode opcode,\n                      const Limits* limits1 = nullptr,\n                      const Limits* limits2 = nullptr,\n                      const Limits* limits3 = nullptr);\n  Result CheckOpcode4(Opcode opcode,\n                      const Limits* limits1 = nullptr,\n                      const Limits* limits2 = nullptr,\n                      const Limits* limits3 = nullptr,\n                      const Limits* limits4 = nullptr);\n  Result OnEnd(Label* label, const char* sig_desc, const char* end_desc);\n\n  template <typename... Args>\n  void PrintStackIfFailed(Result result, const char* desc, Args... args) {\n    // Assert all args are Type or Type::Enum. If it's a TypeVector then\n    // PrintStackIfFailedV() should be used instead.\n    static_assert((std::is_constructible_v<Type, Args> && ...));\n    // Minor optimization, check result before constructing the vector to pass\n    // to the other overload of PrintStackIfFailed.\n    if (Failed(result)) {\n      PrintStackIfFailedV(result, desc, {args...}, /*is_end=*/false);\n    }\n  }\n\n  void PrintStackIfFailedV(Result,\n                           const char* desc,\n                           const TypeVector&,\n                           bool is_end);\n\n  ErrorCallback error_callback_;\n  TypeVector type_stack_;\n  std::vector<Label> label_stack_;\n  // Cache the expected br_table signature. It will be initialized to `nullptr`\n  // to represent \"any\".\n  TypeVector* br_table_sig_ = nullptr;\n  Features features_;\n  std::map<Index, FuncType>& func_types_;\n};\n\n}  // namespace wabt\n\n#endif /* WABT_TYPE_CHECKER_H_ */\n"
  },
  {
    "path": "include/wabt/type.h",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_TYPE_H_\n#define WABT_TYPE_H_\n\n#include <cassert>\n#include <cstdint>\n#include <vector>\n\n#include \"wabt/config.h\"\n#include \"wabt/base-types.h\"\n#include \"wabt/string-format.h\"\n\nnamespace wabt {\n\nclass Type;\n\nusing TypeVector = std::vector<Type>;\n\nclass Type {\n public:\n  // Matches binary format, do not change.\n  enum Enum : int32_t {\n    I32 = -0x01,        // 0x7f\n    I64 = -0x02,        // 0x7e\n    F32 = -0x03,        // 0x7d\n    F64 = -0x04,        // 0x7c\n    V128 = -0x05,       // 0x7b\n    I8 = -0x06,         // 0x7a  : packed-type only, used in gc and as v128 lane\n    I16 = -0x07,        // 0x79  : packed-type only, used in gc and as v128 lane\n    ExnRef = -0x17,     // 0x69\n    FuncRef = -0x10,    // 0x70\n    ExternRef = -0x11,  // 0x6f\n    Reference = -0x15,  // 0x6b\n    Ref = -0x1c,        // 0x64\n    RefNull = -0x1d,    // 0x63\n    Func = -0x20,       // 0x60\n    Struct = -0x21,     // 0x5f\n    Array = -0x22,      // 0x5e\n    Void = -0x40,       // 0x40\n    ___ = Void,         // Convenient for the opcode table in opcode.h\n\n    Any = 0,   // Not actually specified, but useful for type-checking\n    I8U = 4,   // Not actually specified, but used internally with load/store\n    I16U = 6,  // Not actually specified, but used internally with load/store\n    I32U = 7,  // Not actually specified, but used internally with load/store\n  };\n\n  // Used by FuncRef / ExternRef\n  enum GenericReferenceType : uint32_t {\n    ReferenceOrNull = 0,\n    ReferenceNonNull = 1,\n  };\n\n  Type() = default;  // Provided so Type can be member of a union.\n  Type(int32_t code)\n      : enum_(static_cast<Enum>(code)), type_index_(0) {\n    assert(!IsReferenceWithIndex());\n  }\n  Type(Enum e) : enum_(e), type_index_(0) {\n    assert(!IsReferenceWithIndex());\n  }\n  Type(Enum e, Index type_index) : enum_(e), type_index_(type_index) {\n    assert(IsReferenceWithIndex() ||\n           (IsNonTypedRef() && (type_index_ == ReferenceOrNull || type_index_ == ReferenceNonNull)));\n  }\n\n  constexpr operator Enum() const { return enum_; }\n\n  friend constexpr bool operator==(const Type a, const Type b) {\n    return a.enum_ == b.enum_ && a.type_index_ == b.type_index_;\n  }\n  friend constexpr bool operator!=(const Type a, const Type b) {\n    return !(a == b);\n  }\n  friend constexpr bool operator==(const Type ty, const Enum code) {\n    return ty.enum_ == code;\n  }\n  friend constexpr bool operator!=(const Type ty, const Enum code) {\n    return !(ty == code);\n  }\n  friend constexpr bool operator<(const Type a, const Type b) {\n    return a.enum_ == b.enum_ ? a.type_index_ < b.type_index_\n                              : a.enum_ < b.enum_;\n  }\n\n  bool IsRef() const {\n    return enum_ == Type::ExternRef || enum_ == Type::FuncRef ||\n           enum_ == Type::Reference || enum_ == Type::ExnRef ||\n           enum_ == Type::RefNull || enum_ == Type::Ref;\n  }\n\n  bool IsNullableRef() const {\n    return enum_ == Type::Reference || enum_ == Type::ExnRef ||\n           enum_ == Type::RefNull ||\n           ((enum_ == Type::ExternRef || enum_ == Type::FuncRef) && type_index_ == ReferenceOrNull);\n  }\n\n  bool IsNonNullableRef() const {\n    return enum_ == Type::Ref ||\n           ((enum_ == Type::ExternRef || enum_ == Type::FuncRef) && type_index_ != ReferenceOrNull);\n  }\n\n  bool IsReferenceWithIndex() const { return EnumIsReferenceWithIndex(enum_); }\n\n  bool IsNonTypedRef() const {\n    return EnumIsNonTypedRef(enum_);\n  }\n\n  bool IsNullableNonTypedRef() const {\n    assert(EnumIsNonTypedRef(enum_));\n    return type_index_ == ReferenceOrNull;\n  }\n\n  std::string GetName() const {\n    switch (enum_) {\n      case Type::I32:       return \"i32\";\n      case Type::I64:       return \"i64\";\n      case Type::F32:       return \"f32\";\n      case Type::F64:       return \"f64\";\n      case Type::V128:      return \"v128\";\n      case Type::I8:        return \"i8\";\n      case Type::I16:       return \"i16\";\n      case Type::ExnRef:    return \"exnref\";\n      case Type::Func:      return \"func\";\n      case Type::Void:      return \"void\";\n      case Type::Any:       return \"any\";\n      case Type::FuncRef:\n        return type_index_ == ReferenceOrNull ? \"funcref\" : \"(ref func)\";\n      case Type::ExternRef:\n        return type_index_ == ReferenceOrNull ? \"externref\" : \"(ref extern)\";\n      case Type::Reference:\n      case Type::Ref:\n        return StringPrintf(\"(ref %d)\", type_index_);\n      case Type::RefNull:\n        return StringPrintf(\"(ref null %d)\", type_index_);\n      default:\n        return StringPrintf(\"<type_index[%d]>\", enum_);\n    }\n  }\n\n  const char* GetRefKindName() const {\n    switch (enum_) {\n      case Type::FuncRef:   return \"func\";\n      case Type::ExternRef: return \"extern\";\n      case Type::ExnRef:    return \"exn\";\n      case Type::Struct:    return \"struct\";\n      case Type::Array:     return \"array\";\n      default:              return \"<invalid>\";\n    }\n  }\n\n  // Functions for handling types that are an index into the type section.\n  // These are always positive integers. They occur in the binary format in\n  // block signatures, e.g.\n  //\n  //   (block (result i32 i64) ...)\n  //\n  // is encoded as\n  //\n  //   (type $T (func (result i32 i64)))\n  //   ...\n  //   (block (type $T) ...)\n  //\n  bool IsIndex() const { return static_cast<int32_t>(enum_) >= 0; }\n\n  Index GetIndex() const {\n    assert(IsIndex());\n    return static_cast<Index>(enum_);\n  }\n\n  Index GetReferenceIndex() const {\n    assert(IsReferenceWithIndex());\n    return type_index_;\n  }\n\n  TypeVector GetInlineVector() const {\n    assert(!IsIndex());\n    switch (enum_) {\n      case Type::Void:\n        return TypeVector();\n\n      case Type::I32:\n      case Type::I64:\n      case Type::F32:\n      case Type::F64:\n      case Type::V128:\n      case Type::FuncRef:\n      case Type::ExnRef:\n      case Type::ExternRef:\n      case Type::Reference:\n      case Type::Ref:\n      case Type::RefNull:\n        return TypeVector(this, this + 1);\n\n      default:\n        WABT_UNREACHABLE;\n    }\n  }\n\n  static bool EnumIsReferenceWithIndex(Enum value) {\n    return value == Type::Reference || value == Type::Ref ||\n           value == Type::RefNull;\n  }\n\n  static bool EnumIsNonTypedRef(Enum value) {\n    return value == Type::ExternRef || value == Type::FuncRef;\n  }\n\n private:\n  Enum enum_;\n  // This index is 0 for non-references, so a zeroed\n  // memory area represents a valid Type::Any type.\n  // It contains an index for references with type index.\n  Index type_index_;\n};\n\n}  // namespace wabt\n\n#endif  // WABT_TYPE_H_\n"
  },
  {
    "path": "include/wabt/utf8.h",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_UTF8_H_\n#define WABT_UTF8_H_\n\n#include <cstddef>\n\nnamespace wabt {\n\nbool IsValidUtf8(const char* s, size_t length);\n\n}  // namespace wabt\n\n#endif  // WABT_UTF8_H_\n"
  },
  {
    "path": "include/wabt/validator.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_VALIDATOR_H_\n#define WABT_VALIDATOR_H_\n\n#include \"wabt/error.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/shared-validator.h\"\n\nnamespace wabt {\n\nstruct Module;\nstruct Script;\n\n// Perform all checks on the script. It is valid if and only if this function\n// succeeds.\nResult ValidateScript(const Script*, Errors*, const ValidateOptions&);\nResult ValidateModule(const Module*, Errors*, const ValidateOptions&);\n\n}  // namespace wabt\n\n#endif  // WABT_VALIDATOR_H_\n"
  },
  {
    "path": "include/wabt/wast-lexer.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_WAST_LEXER_H_\n#define WABT_WAST_LEXER_H_\n\n#include <cstddef>\n#include <cstdio>\n#include <memory>\n\n#include \"wabt/common.h\"\n#include \"wabt/error.h\"\n#include \"wabt/lexer-source-line-finder.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/opcode.h\"\n#include \"wabt/token.h\"\n\nnamespace wabt {\n\nclass ErrorHandler;\nclass LexerSource;\n\nclass WastLexer {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(WastLexer);\n\n  WastLexer(std::unique_ptr<LexerSource> source,\n            std::string_view filename,\n            Errors*);\n\n  // Convenience functions.\n  static std::unique_ptr<WastLexer> CreateBufferLexer(std::string_view filename,\n                                                      const void* data,\n                                                      size_t size,\n                                                      Errors*);\n\n  Token GetToken();\n\n  // TODO(binji): Move this out of the lexer.\n  std::unique_ptr<LexerSourceLineFinder> MakeLineFinder() {\n    return std::make_unique<LexerSourceLineFinder>(source_->Clone());\n  }\n\n private:\n  static constexpr int kEof = -1;\n  enum class CharClass { IdChar = 1, Keyword = 2, HexDigit = 4, Digit = 8 };\n\n  Location GetLocation();\n  std::string_view GetText(size_t offset = 0);\n\n  Token BareToken(TokenType);\n  Token LiteralToken(TokenType, LiteralType);\n  Token TextToken(TokenType, size_t offset = 0);\n\n  int PeekChar();\n  int ReadChar();\n  bool MatchChar(char);\n  bool MatchString(std::string_view);\n  void Newline();\n  bool ReadBlockComment();             // Returns false if EOF.\n  bool ReadLineComment();              // Returns false if EOF.\n  void ReadWhitespace();\n\n  static bool IsCharClass(int c, CharClass);\n  static bool IsDigit(int c) { return IsCharClass(c, CharClass::Digit); }\n  static bool IsHexDigit(int c) { return IsCharClass(c, CharClass::HexDigit); }\n  static bool IsKeyword(int c) { return IsCharClass(c, CharClass::Keyword); }\n  static bool IsIdChar(int c) { return IsCharClass(c, CharClass::IdChar); }\n\n  bool ReadNum();\n  bool ReadHexNum();\n\n  enum class ReservedChars { None, Some, Id };\n  ReservedChars ReadReservedChars();\n  bool NoTrailingReservedChars() {\n    return ReadReservedChars() == ReservedChars::None;\n  }\n  void ReadSign();\n  Token GetStringToken(TokenType);\n  Token GetNumberToken(TokenType);\n  Token GetHexNumberToken(TokenType);\n  Token GetInfToken();\n  Token GetNanToken();\n  Token GetNameEqNumToken(std::string_view name, TokenType);\n  Token GetIdChars();\n  Token GetKeywordToken();\n  Token GetReservedToken();\n\n  std::unique_ptr<LexerSource> source_;\n  std::string filename_;\n  int line_;\n  const char* buffer_;\n  const char* buffer_end_;\n  const char* line_start_;\n  const char* token_start_;\n  const char* cursor_;\n\n  Errors* errors_;\n  void WABT_PRINTF_FORMAT(3, 4) Error(Location, const char* format, ...);\n};\n\n}  // namespace wabt\n\n#endif /* WABT_WAST_LEXER_H_ */\n"
  },
  {
    "path": "include/wabt/wast-parser.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_WAST_PARSER_H_\n#define WABT_WAST_PARSER_H_\n\n#include <array>\n#include <memory>\n#include <optional>\n#include <unordered_map>\n\n#include \"wabt/error.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/intrusive-list.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/wast-lexer.h\"\n\nnamespace wabt {\n\nstruct WastParseOptions {\n  WastParseOptions(const Features& features) : features(features) {}\n\n  Features features;\n  bool debug_parsing = false;\n  bool parse_binary_modules = true;\n};\n\nusing TokenTypePair = std::array<TokenType, 2>;\n\nclass WastParser {\n public:\n  WastParser(WastLexer*, Errors*, WastParseOptions*);\n\n  void WABT_PRINTF_FORMAT(3, 4) Error(Location, const char* format, ...);\n  Result ParseModule(std::unique_ptr<Module>* out_module);\n  Result ParseScript(std::unique_ptr<Script>* out_script);\n\n  std::unique_ptr<Script> ReleaseScript();\n\n private:\n  enum class ConstType {\n    Normal,\n    Expectation,\n  };\n\n  struct ResolveRefType {\n    ResolveRefType(Type* target_type, Var var)\n      : target_type(target_type), var(var) {}\n\n    Type* target_type;\n    Var var;\n  };\n\n  struct ReferenceVar {\n    ReferenceVar(uint32_t index, Var var)\n      : index(index), var(var) {}\n\n    uint32_t index;\n    Var var;\n  };\n\n  typedef std::vector<ReferenceVar> ReferenceVars;\n\n  struct ResolveTypeVector {\n    ResolveTypeVector(TypeVector* target_vector)\n      : target_vector(target_vector) {}\n\n    TypeVector* target_vector;\n    ReferenceVars vars;\n  };\n\n  struct ResolveFunc {\n    ResolveFunc(Func* target_func)\n      : target_func(target_func) {}\n\n    Func* target_func;\n    TypeVector types;\n    ReferenceVars vars;\n  };\n\n  void ErrorUnlessOpcodeEnabled(const Token&);\n\n  // Print an error message listing the expected tokens, as well as an example\n  // of expected input.\n  Result ErrorExpected(const std::vector<std::string>& expected,\n                       const char* example = nullptr);\n\n  // Print an error message, and and return Result::Error if the next token is\n  // '('. This is commonly used after parsing a sequence of s-expressions -- if\n  // no more can be parsed, we know that a following '(' is invalid. This\n  // function consumes the '(' so a better error message can be provided\n  // (assuming the following token was unexpected).\n  Result ErrorIfLpar(const std::vector<std::string>& expected,\n                     const char* example = nullptr);\n\n  // Returns the next token without consuming it.\n  Token GetToken();\n\n  // Returns the location of the next token.\n  Location GetLocation();\n\n  // Returns the type of the next token.\n  TokenType Peek(size_t n = 0);\n\n  // Returns the types of the next two tokens.\n  TokenTypePair PeekPair();\n\n  // Returns true if the next token's type is equal to the parameter.\n  bool PeekMatch(TokenType, size_t n = 0);\n\n  // Returns true if the next token's type is '(' and the following token is\n  // equal to the parameter.\n  bool PeekMatchLpar(TokenType);\n\n  // Returns true if the next two tokens can start an Expr. This allows for\n  // folded expressions, plain instructions and block instructions.\n  bool PeekMatchExpr();\n\n  // Returns true if the next two tokens are form reference type - (ref $t)\n  bool PeekMatchRefType();\n\n  // Returns true if the next token represents a var.\n  bool PeekMatchVar();\n\n  // Returns true if the next token's type is equal to the parameter. If so,\n  // then the token is consumed.\n  bool Match(TokenType);\n\n  // Returns true if the next token's type is equal to '(' and the following\n  // token is equal to the parameter. If so, then the token is consumed.\n  bool MatchLpar(TokenType);\n\n  // Like Match(), but prints an error message if the token doesn't match, and\n  // returns Result::Error.\n  Result Expect(TokenType);\n\n  // Consume one token and return it.\n  Token Consume();\n\n  // Give the Match() function a clearer name when used to optionally consume a\n  // token (used for printing better error messages).\n  void ConsumeIfLpar() { Match(TokenType::Lpar); }\n\n  using SynchronizeFunc = bool(*)(TokenTypePair pair);\n\n  // Attempt to synchronize the token stream by dropping tokens until the\n  // SynchronizeFunc returns true, or until a token limit is reached. This\n  // function returns Result::Error if the stream was not able to be\n  // synchronized.\n  Result Synchronize(SynchronizeFunc);\n\n  Result ParseVarText(Token& token, std::string* out_text);\n  Result ParseBindVarOpt(std::string* name);\n  Result ParseVar(Var* out_var);\n  Result ParseVarOpt(Var* out_var, Var default_var = Var());\n  Result ParseOffsetExpr(ExprList* out_expr_list);\n  bool ParseOffsetExprOpt(ExprList* out_expr_list);\n  Result ParseTextList(std::vector<uint8_t>* out_data);\n  bool ParseTextListOpt(std::vector<uint8_t>* out_data);\n  Result ParseVarList(VarVector* out_var_list);\n  bool ParseElemExprOpt(ExprList* out_elem_expr);\n  bool ParseElemExprListOpt(ExprListVector* out_list);\n  Result ParseElemExprVarListOpt(ExprListVector* out_list);\n  Result ParseRefDeclaration(Var* out_type);\n  Result ParseValueType(Var* out_type);\n  Result ParseValueTypeList(\n      TypeVector* out_type_list,\n      ReferenceVars* type_vars);\n  Result ParseRefKind(Var* out_type);\n  Result ParseRefType(Var* out_type);\n  bool ParseRefTypeOpt(Var* out_type, Result& result);\n  Result ParseQuotedText(std::string* text, bool check_utf8 = true);\n  bool ParseOffsetOpt(Address* offset);\n  bool ParseAlignOpt(Address* align);\n  Result ParseMemidx(Location loc, Var* memidx);\n  Result ParseLimitsIndex(Limits*);\n  Result ParseLimits(Limits*);\n  Result ParsePageSize(uint32_t*);\n  Result ParseNat(uint64_t*, bool is_64);\n\n  static Result ResolveTargetRefType(const Module&, Type*, const Var&, Errors*);\n  static Result ResolveTargetTypeVector(const Module&, TypeVector*,\n                                        ReferenceVars*, Errors*);\n  Result ParseModuleFieldList(Module*);\n  Result ParseModuleField(Module*);\n  Result ParseDataModuleField(Module*);\n  Result ParseElemModuleField(Module*);\n  Result ParseTagModuleField(Module*);\n  Result ParseExportModuleField(Module*);\n  Result ParseFuncModuleField(Module*);\n  Result ParseTypeModuleField(Module*);\n  Result ParseGlobalModuleField(Module*);\n  Result ParseImportModuleField(Module*);\n  Result ParseMemoryModuleField(Module*);\n  Result ParseStartModuleField(Module*);\n  Result ParseTableModuleField(Module*);\n\n  Result ParseCustomSectionAnnotation(Module*);\n  bool PeekIsCustom();\n\n  Result ParseExportDesc(Export*);\n  Result ParseInlineExports(ModuleFieldList*, ExternalKind);\n  Result ParseInlineImport(Import*);\n  Result ParseTypeUseOpt(FuncDeclaration*);\n  Result ParseFuncSignature(FuncSignature*, BindingHash* param_bindings);\n  Result ParseUnboundFuncSignature(FuncSignature*);\n  Result ParseBoundValueTypeList(TokenType,\n                                 TypeVector*,\n                                 BindingHash*,\n                                 ReferenceVars*,\n                                 Index binding_index_offset = 0);\n  Result ParseUnboundValueTypeList(TokenType,\n                                   TypeVector*,\n                                   ReferenceVars*);\n  Result ParseResultList(TypeVector*,\n                         ReferenceVars*);\n  Result ParseInstrList(ExprList*);\n  Result ParseTerminatingInstrList(ExprList*);\n  Result ParseInstr(ExprList*);\n  Result ParseCodeMetadataAnnotation(ExprList*);\n  Result ParsePlainInstr(std::unique_ptr<Expr>*);\n  Result ParseF32(Const*, ConstType type);\n  Result ParseF64(Const*, ConstType type);\n  Result ParseConst(Const*, ConstType type);\n  Result ParseExpectedValues(ExpectationPtr*);\n  Result ParseEither(ConstVector*);\n  Result ParseExternref(Const*);\n  Result ParseExpectedNan(ExpectedNan* expected);\n  Result ParseConstList(ConstVector*, ConstType type);\n  Result ParseBlockInstr(std::unique_ptr<Expr>*);\n  Result ParseLabelOpt(std::string*);\n  Result ParseEndLabelOpt(const std::string&);\n  Result ParseBlockDeclaration(BlockDeclaration*);\n  Result ParseBlock(Block*);\n  Result ParseExprList(ExprList*);\n  Result ParseExpr(ExprList*);\n  Result ParseTryTableCatches(TryTableVector* catches);\n  Result ParseCatchInstrList(CatchVector* catches);\n  Result ParseCatchExprList(CatchVector* catches);\n  Result ParseGlobalType(Global*);\n  Result ParseField(Field*);\n  Result ParseFieldList(std::vector<Field>*);\n\n  template <typename T>\n  Result ParsePlainInstrVar(Location, std::unique_ptr<Expr>*);\n  template <typename T>\n  Result ParseMemoryInstrVar(Location, std::unique_ptr<Expr>*);\n  template <typename T>\n  Result ParseLoadStoreInstr(Location, Token, std::unique_ptr<Expr>*);\n  template <typename T>\n  Result ParseSIMDLoadStoreInstr(Location loc,\n                                 Token token,\n                                 std::unique_ptr<Expr>* out_expr);\n  template <typename T>\n  Result ParseMemoryExpr(Location, std::unique_ptr<Expr>*);\n  template <typename T>\n  Result ParseMemoryBinaryExpr(Location, std::unique_ptr<Expr>*);\n  Result ParseSimdLane(Location, uint64_t*);\n\n  Result ParseCommandList(Script*, CommandPtrVector*);\n  Result ParseCommand(Script*, CommandPtr*);\n  Result ParseAssertExceptionCommand(CommandPtr*);\n  Result ParseAssertExhaustionCommand(CommandPtr*);\n  Result ParseAssertInvalidCommand(CommandPtr*);\n  Result ParseAssertMalformedCommand(CommandPtr*);\n  Result ParseAssertReturnCommand(CommandPtr*);\n  Result ParseAssertReturnFuncCommand(CommandPtr*);\n  Result ParseAssertTrapCommand(CommandPtr*);\n  Result ParseAssertUnlinkableCommand(CommandPtr*);\n  Result ParseActionCommand(CommandPtr*);\n  Result ParseModuleCommand(Script*, CommandPtr*);\n  Result ParseRegisterCommand(CommandPtr*);\n  Result ParseInputCommand(CommandPtr*);\n  Result ParseOutputCommand(CommandPtr*);\n\n  Result ParseAction(ActionPtr*);\n  Result ParseScriptModule(std::unique_ptr<ScriptModule>*);\n\n  template <typename T>\n  Result ParseActionCommand(TokenType, CommandPtr*);\n  template <typename T>\n  Result ParseAssertActionCommand(TokenType, CommandPtr*);\n  template <typename T>\n  Result ParseAssertActionTextCommand(TokenType, CommandPtr*);\n  template <typename T>\n  Result ParseAssertScriptModuleCommand(TokenType, CommandPtr*);\n\n  Result ParseSimdV128Const(Const*, TokenType, ConstType);\n\n  void CheckImportOrdering(Module*);\n  bool HasError() const;\n  bool CheckRefType(Type::Enum type);\n  void VarToType(const Var& var, Type* type);\n\n  WastLexer* lexer_;\n  Index last_module_index_ = kInvalidIndex;\n  Errors* errors_;\n  WastParseOptions* options_;\n\n  // Reference types can have names or indicies. For example (ref $foo)\n  // represents a type which name is $foo, and (ref 5) represents\n  // the fifth type declaration. Both of these variants needs to\n  // be validated after the parsing is completed.\n\n  // Single type references are stored in the following vector.\n  std::vector<ResolveRefType> resolve_ref_types_;\n\n  // Type vectors and their corresponding references are stored in the\n  // following vector. At least one reference must be present for each vector.\n  std::vector<ResolveTypeVector> resolve_type_vectors_;\n\n  // Local vectors and their corresponding references are stored in the\n  // following vector. At least one reference must be present for each vector.\n  std::vector<ResolveFunc> resolve_funcs_;\n\n  // two-element queue of upcoming tokens\n  class TokenQueue {\n    std::array<std::optional<Token>, 2> tokens{};\n    bool i{};\n\n   public:\n    void push_back(Token t);\n    void pop_front();\n    const Token& at(size_t n) const;\n    const Token& front() const;\n    bool empty() const;\n    size_t size() const;\n  };\n\n  TokenQueue tokens_{};\n};\n\nResult ParseWatModule(WastLexer* lexer,\n                      std::unique_ptr<Module>* out_module,\n                      Errors*,\n                      WastParseOptions* options);\n\nResult ParseWastScript(WastLexer* lexer,\n                       std::unique_ptr<Script>* out_script,\n                       Errors*,\n                       WastParseOptions* options);\n\n}  // namespace wabt\n\n#endif /* WABT_WAST_PARSER_H_ */\n"
  },
  {
    "path": "include/wabt/wat-writer.h",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_WAT_WRITER_H_\n#define WABT_WAT_WRITER_H_\n\n#include \"wabt/common.h\"\n#include \"wabt/feature.h\"\n\nnamespace wabt {\n\nstruct Module;\nclass Stream;\n\nstruct WriteWatOptions {\n  WriteWatOptions() = default;\n  WriteWatOptions(const Features& features) : features(features) {}\n  Features features;\n  bool fold_exprs = false;  // Write folded expressions.\n  bool inline_export = false;\n  bool inline_import = false;\n};\n\nResult WriteWat(Stream*, const Module*, const WriteWatOptions&);\n\n}  // namespace wabt\n\n#endif /* WABT_WAT_WRITER_H_ */\n"
  },
  {
    "path": "man/spectest-interp.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm spectest-interp\n.Nd read a Spectest JSON file, and run its tests in the interpreter\n.Sh SYNOPSIS\n.Nm spectest-interp\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nReads a Spectest JSON file, and runs its tests in the interpreter.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint a help message\n.It Fl Fl version\nPrint version information\n.It Fl v , Fl Fl verbose\nUse multiple times for more info\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl V , Fl Fl value-stack-size=SIZE\nSize in elements of the value stack\n.It Fl C , Fl Fl call-stack-size=SIZE\nSize in elements of the call stack\n.It Fl t , Fl Fl trace\nTrace execution\n.El\n.Sh EXAMPLES\nParse test.json and run the spec tests\n.Pp\n.Dl $ spectest-interp test.json\n.Pp\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wasm-decompile.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wasm-decompile\n.Nd translate from the binary format to readable C-like syntax\n.Sh SYNOPSIS\n.Nm wasm-decompile\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nRead a file in the WebAssembly binary format, and convert it to a decompiled text file.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint a help message\n.It Fl Fl version\nPrint version information\n.It Fl o , Fl Fl output=FILENAME\nOutput file for the decompiled file, by default use stdout\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl Fl ignore-custom-section-errors\nIgnore errors in custom sections\n.El\n.Sh EXAMPLES\nParse binary file test.wasm and write text file test.dcmp\n.Pp\n.Dl $ wasm-decompile test.wasm -o test.dcmp\n.Sh SEE ALSO\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wasm-interp.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wasm-interp\n.Nd decode and run a WebAssembly binary file\n.Sh SYNOPSIS\n.Nm wasm-interp\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nRead a file in the wasm binary format, and run it in a stack-based interpreter.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint a help message\n.It Fl Fl version\nPrint version information\n.It Fl v , Fl Fl verbose\nUse multiple times for more info\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl V , Fl Fl value-stack-size=SIZE\nSize in elements of the value stack\n.It Fl C , Fl Fl call-stack-size=SIZE\nSize in elements of the call stack\n.It Fl t , Fl Fl trace\nTrace execution\n.It Fl Fl wasi\nAssume input module is WASI compliant (Export\nWASI API the the module and invoke _start function)\n.It Fl e , Fl Fl env=ENV\nPass the given environment string in the WASI runtime\n.It Fl d , Fl Fl dir=DIR\nPass the given directory the the WASI runtime\n.It Fl Fl run-all-exports\nRun all the exported functions, in order. Useful for testing\n.It Fl Fl host-print\nInclude an importable function named \"host.print\" for printing to stdout\n.It Fl Fl dummy-import-func\nProvide a dummy implementation of all imported functions. The function will log the call and return an appropriate zero value.\n.El\n.Sh EXAMPLES\nParse binary file test.wasm, and type-check it\n.Pp\n.Dl $ wasm-interp test.wasm\n.Pp\nParse test.wasm and run all its exported functions\n.Pp\n.Dl $ wasm-interp test.wasm --run-all-exports\n.Pp\nParse test.wasm, run the exported functions and trace the output\n.Pp\n.Dl $ wasm-interp test.wasm --run-all-exports --trace\n.Pp\nParse test.wasm and run all its exported functions, setting the value stack size to 100 elements\n.Pp\n.Dl $ wasm-interp test.wasm -V 100 --run-all-exports\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wasm-objdump.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wasm-objdump\n.Nd print information about a wasm binary\n.Sh SYNOPSIS\n.Nm wasm-objdump\n.Op options\n.Ar\n.Sh DESCRIPTION\n.Nm\nPrint information about the contents of wasm binaries.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint a help message\n.It Fl Fl version\nPrint version information\n.It Fl h , Fl Fl headers\nPrint headers\n.It Fl j , Fl Fl section=SECTION\nSelect just one section\n.It Fl s , Fl Fl full-contents\nPrint raw section contents\n.It Fl d , Fl Fl disassemble\nDisassemble function bodies\n.It Fl Fl debug\nPrint extra debug information\n.It Fl x , Fl Fl details\nShow section details\n.It Fl r , Fl Fl reloc\nShow relocations inline with disassembly\n.It Fl Fl section-offsets\nPrint section offsets instead of file offsets in code disassembly\n.El\n.Sh EXAMPLES\n.Dl $ wasm-objdump test.wasm\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wasm-stats.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wasm-stats\n.Nd show stats for a module\n.Sh SYNOPSIS\n.Nm wasm-stats\n.Op options\n.Ar\n.Sh DESCRIPTION\n.Nm\nRead a file in the wasm binary format, and show stats.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint a help message\n.It Fl Fl version\nPrint version information\n.It Fl v , Fl Fl verbose\nUse multiple times for more info\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl o , Fl Fl output=FILENAME\nOutput file for the opcode counts, by default use stdout\n.It Fl c , Fl Fl cutoff=N\nCutoff for reporting counts less than N\n.It Fl s , Fl Fl separator=SEPARATOR\nSeparator text between element and count when reporting counts\n.El\n.Sh EXAMPLES\nParse binary file test.wasm and write opcode dist file test.dist\n.Pp\n.Dl $ wasm-stats test.wasm -o test.dist\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wasm-strip.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wasm-strip\n.Nd remove sections of a WebAssembly binary file\n.Sh SYNOPSIS\n.Nm wasm-strip\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nRemove sections of a WebAssembly binary file.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint a help message\n.It Fl Fl version\nPrint version information\n.It Fl o , Fl Fl output=FILE\noutput wasm binary file\n.El\n.Sh EXAMPLES\nRemove all custom sections from test.wasm\n.Pp\n.Dl $ wasm-strip test.wasm\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wasm-validate.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wasm-validate\n.Nd validate a file in the WebAssembly binary format\n.Sh SYNOPSIS\n.Nm wasm-validate\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nRead a file in the WebAssembly binary format, and validate it.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint this help message\n.It Fl Fl version\nPrint version information\n.It Fl v , Fl Fl verbose\nUse multiple times for more info\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl Fl no-debug-names\nIgnore debug names in the binary file\n.It Fl Fl ignore-custom-section-errors\nIgnore errors in custom sections\n.El\n.Sh EXAMPLES\nValidate binary file test.wasm\n.Pp\n.Dl $ wasm-validate test.wasm\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wasm2c.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wasm2c\n.Nd convert a WebAssembly binary file to a C source and header\n.Sh SYNOPSIS\n.Nm wasm2c\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\ntakes a WebAssembly module and produces an equivalent C source and header.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint a help message\n.It Fl Fl version\nPrint version information\n.It Fl v , Fl Fl verbose\nUse multiple times for more info\n.It Fl o , Fl Fl output=FILENAME\nOutput file for the generated C source file, by default use stdout\n.It Fl n , Fl Fl module-name=MODNAME\nUnique name for the module being generated. This name is prefixed to each of the generaed C symbols. By default, the module name from the names section is used. If that is not present the name of the input file is used as the default.\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl Fl no-debug-names\nIgnore debug names in the binary file\n.El\n.Sh EXAMPLES\nParse binary file test.wasm and write test.c and test.h\n.Pp\n.Dl $ wasm2c test.wasm -o test.c\n.Pp\nParse test.wasm, write test.c and test.h, but ignore the debug names, if any\n.Pp\n.Dl $ wasm2c test.wasm --no-debug-names -o test.c\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wasm2wat.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wasm2wat\n.Nd translate from the binary format to the text format\n.Sh SYNOPSIS\n.Nm wasm2wat\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nRead a file in the WebAssembly binary format, and convert it to the WebAssembly text format.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint a help message\n.It Fl Fl version\nPrint version information\n.It Fl v , Fl Fl verbose\nUse multiple times for more info\n.It Fl o , Fl Fl output=FILENAME\nOutput file for the generated wast file, by default use stdout\n.It Fl f , Fl Fl fold-exprs\nWrite folded expressions where possible\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl Fl inline-exports\nWrite all exports inline\n.It Fl Fl inline-imports\nWrite all imports inline\n.It Fl Fl no-debug-names\nIgnore debug names in the binary file\n.It Fl Fl ignore-custom-section-errors\nIgnore errors in custom sections\n.It Fl Fl generate-names\nGive auto-generated names to non-named functions, types, etc.\n.It Fl Fl no-check\nDon't check for invalid modules\n.El\n.Sh EXAMPLES\nParse binary file test.wasm and write text file test.wast\n.Pp\n.Dl $ wasm2wat test.wasm -o test.wat\n.Pp\nParse test.wasm, write test.wat, but ignore the debug names, if any\n.Pp\n.Dl $ wasm2wat test.wasm --no-debug-names -o test.wat\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wast2json.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wast2json\n.Nd convert a file in the wasm spec test format to a JSON file and associated wasm binary files\n.Sh SYNOPSIS\n.Nm wast2json\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nRead a file in the wasm spec test format, check it for errors, and convert it to a JSON file and associated wasm binary files.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint this help message\n.It Fl Fl version\nPrint version information\n.It Fl v , Fl Fl verbose\nUse multiple times for more info\n.It Fl Fl debug-parser\nTurn on debugging the parser of wast files\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl o , Fl Fl output=FILE\noutput JSON file\n.It Fl r , Fl Fl relocatable\nCreate a relocatable wasm binary (suitable for linking with e.g. lld)\n.It Fl Fl no-canonicalize-leb128s\nWrite all LEB128 sizes as 5-bytes instead of their minimal size\n.It Fl Fl debug-names\nWrite debug names to the generated binary file\n.It Fl Fl no-check\nDon't check for invalid modules\n.El\n.Sh EXAMPLES\nParse spec-test.wast, and write files to spec-test.json.\nModules are written to spec-test.0.wasm, spec-test.1.wasm, etc.\n.Pp\n.Dl $ wast2json spec-test.wast -o spec-test.json\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wat-desugar 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wat-desugar.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wat-desugar\n.Nd parse .wat text form and print \"canonical\" flat format\n.Sh SYNOPSIS\n.Nm wat-desugar\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nParses .wat text form as supported by the spec interpreter (s-expressions, flat syntax, or mixed) and prints \"canonical\" flat format.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint this help message\n.It Fl Fl version\nPrint version information\n.It Fl o , Fl Fl output=FILE\nOutput file for the formatted file\n.It Fl Fl debug-parser\nTurn on debugging the parser of wat files\n.It Fl f , Fl Fl fold-exprs\nWrite folded expressions where possible\n.It Fl Fl inline-exports\nWrite all exports inline\n.It Fl Fl inline-imports\nWrite all imports inline\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl Fl generate-names\nGive auto-generated names to non-named functions, types, etc.\n.El\n.Sh EXAMPLES\nWrite output to stdout\n.Pp\n.Dl $ wat-desugar test.wat\n.Pp\nWrite output to test2.wat\n.Pp\n.Dl $ wat-desugar test.wat -o test2.wat\n.Pp\nGenerate names for indexed variables\n.Pp\n.Dl $ wat-desugar --generate-names test.wat\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat2wasm 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "man/wat2wasm.1",
    "content": ".Dd $Mdocdate$\n.Dt WABT 1\n.Os\n.Sh NAME\n.Nm wat2wasm\n.Nd translate from WebAssembly text format to the WebAssembly binary format\n.Sh SYNOPSIS\n.Nm wat2wasm\n.Op options\n.Ar file\n.Sh DESCRIPTION\n.Nm\nRead a file in the wasm text format, check it for errors, and convert it to the wasm binary format.\n.Pp\nThe options are as follows:\n.Bl -tag -width Ds\n.It Fl Fl help\nPrint this help message\n.It Fl Fl version\nPrint version information\n.It Fl v , Fl Fl verbose\nUse multiple times for more info\n.It Fl Fl debug-parser\nTurn on debugging the parser of wat files\n.It Fl d , Fl Fl dump-module\nPrint a hexdump of the module to stdout\n.It Fl Fl enable-exceptions\nEnable Experimental exception handling\n.It Fl Fl disable-mutable-globals\nDisable Import/export mutable globals\n.It Fl Fl disable-saturating-float-to-int\nDisable Saturating float-to-int operators\n.It Fl Fl disable-sign-extension\nDisable Sign-extension operators\n.It Fl Fl disable-simd\nDisable SIMD support\n.It Fl Fl enable-threads\nEnable Threading support\n.It Fl Fl enable-function-references\nEnable Typed function references\n.It Fl Fl disable-multi-value\nDisable Multi-value\n.It Fl Fl enable-tail-call\nEnable Tail-call support\n.It Fl Fl disable-bulk-memory\nDisable Bulk-memory operations\n.It Fl Fl disable-reference-types\nDisable Reference types (externref)\n.It Fl Fl enable-annotations\nEnable Custom annotation syntax\n.It Fl Fl enable-code-metadata\nEnable Code metadata\n.It Fl Fl enable-gc\nEnable Garbage collection\n.It Fl Fl enable-memory64\nEnable 64-bit memory\n.It Fl Fl enable-multi-memory\nEnable Multi-memory\n.It Fl Fl enable-extended-const\nEnable Extended constant expressions\n.It Fl Fl enable-all\nEnable all features\n.It Fl o , Fl Fl output=FILE\nOutput wasm binary file. Use \"-\" to write to stdout.\n.It Fl r , Fl Fl relocatable\nCreate a relocatable wasm binary (suitable for linking with e.g. lld)\n.It Fl Fl no-canonicalize-leb128s\nWrite all LEB128 sizes as 5-bytes instead of their minimal size\n.It Fl Fl debug-names\nWrite debug names to the generated binary file\n.It Fl Fl no-check\nDon't check for invalid modules\n.El\n.Sh EXAMPLES\nParse test.wat and write to .wasm binary file with the same name\n.Pp\n.Dl $ wat2wasm test.wat\n.Pp\nParse test.wat and write to binary file test.wasm\n.Pp\n.Dl $ wat2wasm test.wat -o test.wasm\n.Pp\nParse spec-test.wast, and write verbose output to stdout (including the meaning of every byte)\n.Pp\n.Dl $ wat2wasm spec-test.wast -v\n.Sh SEE ALSO\n.Xr wasm-decompile 1 ,\n.Xr wasm-interp 1 ,\n.Xr wasm-objdump 1 ,\n.Xr wasm-stats 1 ,\n.Xr wasm-strip 1 ,\n.Xr wasm-validate 1 ,\n.Xr wasm2c 1 ,\n.Xr wasm2wat 1 ,\n.Xr wast2json 1 ,\n.Xr wat-desugar 1 ,\n.Xr spectest-interp 1\n.Sh BUGS\nIf you find a bug, please report it at\n.br\n.Lk https://github.com/WebAssembly/wabt/issues .\n"
  },
  {
    "path": "scripts/TC-s390x.cmake",
    "content": "set(CMAKE_SYSTEM_NAME Linux)\n\nset(CMAKE_C_COMPILER /opt/bin/distcc_symlinks/s390x-linux-gnu-gcc)\nset(CMAKE_CXX_COMPILER s390x-linux-gnu-g++)\n\nset(CMAKE_FIND_ROOT_PATH /usr/s390x-linux-gnu)\n\nset(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\nset(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\nset(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n"
  },
  {
    "path": "scripts/check_clean.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n\"\"\"Check for clean checkout. This is run after tests during CI to ensure\nthe generated source code in src/prebuilt has been updated.\n\"\"\"\n\nimport os\nimport subprocess\nimport sys\n\n\ndef main():\n    print(\"Running 'git status --short'\")\n    print('')\n\n    here = os.path.dirname(__file__)\n    root = os.path.dirname(here)\n    output = subprocess.check_output(['git', 'status', '--short'], cwd=root)\n    output = output.decode('utf-8').strip()\n    if not output:\n        print('Tree is clean.')\n        return 0\n\n    print(output)\n    print('\\nCheckout is not clean.  See above for list of dirty/untracked files.')\n    return 1\n\n\nif __name__ == '__main__':\n    sys.exit(main())\n"
  },
  {
    "path": "scripts/clang-format-diff.sh",
    "content": "#!/bin/bash\n\nset -o errexit\nset -o pipefail\n\nif [ -n \"$1\" ]; then\n  BRANCH=\"$1\"\nelif [ \"$CI\" != \"true\" ]; then\n  echo \"Please specify a base branch in the command line\"\n  exit 1\nelif [ -n \"$GITHUB_EVENT_BEFORE\" ] && [ \"push\" = \"$GITHUB_EVENT_NAME\" ]; then\n  BRANCH=\"$GITHUB_EVENT_BEFORE\"\nelif [ -n \"$GITHUB_BASE_REF\" ]; then\n  BRANCH=\"origin/$GITHUB_BASE_REF\"\nelif git symbolic-ref -q HEAD; then # check if we're in a branch\n  BRANCH=\"@{upstream}\"\nelse\n  # in a detached HEAD.\n  # default to origin/main, this is a \"last resort\" to make this script do the\n  # right thing, and is only really here so it works when pushing a new branch,\n  # with the caveat that it assumes the base branch to be called \"main\".\n  # (this has been the case with wabt for a while. may fail if the repo lacks a\n  # \"main\" branch for some reason.)\n  BRANCH=\"origin/main\"\nfi\n\nMERGE_BASE=$(git merge-base $BRANCH HEAD)\nif ! git clang-format $MERGE_BASE -q --diff -- src/ 2>&1 >/dev/null; then\n  echo \"Please run git clang-format before committing, or apply this diff:\"\n  echo\n  # Run git clang-format again, this time with output.  This lets us add\n  # the above message.\n  git clang-format $MERGE_BASE -q --diff -- src/\n  exit 1\nfi\n"
  },
  {
    "path": "scripts/coverage.sh",
    "content": "#!/bin/bash\n#\n# Copyright 2017 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nset -o nounset\nset -o errexit\n\nCOMPILER=${1:-gcc}\nBUILD_TYPE=${2:-Debug}\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"$0\")\"; pwd -P)\"\nROOT_DIR=${SCRIPT_DIR}/..\nBIN_DIR=${ROOT_DIR}/out/${COMPILER}/${BUILD_TYPE}/cov\nLCOVRC_FILE=${ROOT_DIR}/lcovrc\nCOV_FILE=${BIN_DIR}/lcov.info\nCOV_HTML_DIR=${ROOT_DIR}/out/lcov\n\nlog_and_run() {\n  echo $*\n  (exec $*)\n}\n\nlog_and_run lcov --zerocounters -d ${BIN_DIR} --rc lcov_branch_coverage=1\nlog_and_run test/run-tests.py --bindir ${BIN_DIR}\nlog_and_run bin/wabt-unittests --bindir ${BIN_DIR}\nlog_and_run lcov -c -d ${BIN_DIR} -o ${COV_FILE} --rc lcov_branch_coverage=1\nlog_and_run genhtml --branch-coverage -o ${COV_HTML_DIR} ${COV_FILE}\n"
  },
  {
    "path": "scripts/example-project/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.16)\nproject(example CXX)\n\nenable_testing()\n\nfind_package(wabt REQUIRED)\n\nadd_executable(example example.cpp)\ntarget_link_libraries(example PRIVATE wabt::wabt)\n\nadd_test(NAME example COMMAND example)\n"
  },
  {
    "path": "scripts/example-project/example.cpp",
    "content": "#include <wabt/ir.h>\n\nint main () {}\n"
  },
  {
    "path": "scripts/fuzz-wasm-objdump.sh",
    "content": "#!/bin/bash\n#\n# Copyright 2019 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nset -o nounset\nset -o errexit\n\nSCRIPT_DIR=\"$(dirname \"$(readlink -f \"$0\")\")\"\nROOT_DIR=\"$(dirname \"${SCRIPT_DIR}\")\"\n\n${FUZZ_BIN_DIR}/afl-fuzz -i fuzz-in/wasm/ -o fuzz-out -- out/gcc-fuzz/Debug/wasm-objdump -shdxr @@\n"
  },
  {
    "path": "scripts/fuzz-wasm2wat.sh",
    "content": "#!/bin/bash\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nset -o nounset\nset -o errexit\n\nSCRIPT_DIR=\"$(dirname \"$(readlink -f \"$0\")\")\"\nROOT_DIR=\"$(dirname \"${SCRIPT_DIR}\")\"\n\nENABLE=\"--enable-except --enable-sat --enable-sign --enable-thread --enable-multi --enable-tail\"\n\n${FUZZ_BIN_DIR}/afl-fuzz -i fuzz-in/wasm/ -o fuzz-out -- out/gcc-fuzz/Debug/wasm2wat @@ ${ENABLE}\n"
  },
  {
    "path": "scripts/fuzz-wat2wasm.sh",
    "content": "#!/bin/bash\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nset -o nounset\nset -o errexit\n\nSCRIPT_DIR=\"$(dirname \"$(readlink -f \"$0\")\")\"\nROOT_DIR=\"$(dirname \"${SCRIPT_DIR}\")\"\n\nENABLE=\"--enable-except --enable-sat --enable-sign --enable-thread --enable-multi --enable-tail\"\n\n${FUZZ_BIN_DIR}/afl-fuzz -x fuzz-in/wast.dict -i fuzz-in/wast/ -o fuzz-out -- out/gcc-fuzz/Debug/wat2wasm @@ ${ENABLE}\n"
  },
  {
    "path": "scripts/gen-emscripten-exported-json.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport argparse\nimport json\nimport os\nimport re\nimport sys\n\nSCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = os.path.dirname(SCRIPT_DIR)\nTEST_DIR = os.path.join(ROOT_DIR, 'test')\nDEFAULT_EMSCRIPTEN_DIR = os.path.join(ROOT_DIR, 'emscripten')\n\nsys.path.append(TEST_DIR)\n\nfrom utils import Executable, Error  # noqa: E402\n\n\ndef FindFiles(cmake_build_dir):\n    result = []\n    for root, dirs, files in os.walk(cmake_build_dir):\n        for file_ in files:\n            path = os.path.join(root, file_)\n            if file_ == 'libwabt.a' or re.search(r'emscripten-helpers', file_):\n                result.append(path)\n    return result\n\n\ndef GetNM(emscripten_dir):\n    python = Executable(sys.executable)\n    stdout = python.RunWithArgsForStdout(\n        '-c', 'import tools.shared; print(tools.shared.LLVM_ROOT)',\n        cwd=emscripten_dir)\n    return Executable(os.path.join(stdout.strip(), 'llvm-nm'))\n\n\ndef ProcessFile(nm, file_):\n    names = []\n    for line in nm.RunWithArgsForStdout(file_).splitlines():\n        line = line.rstrip()\n        if not line.lstrip():\n            continue\n        if line.endswith(':'):\n            # displaying the archive name, e.g. \"foo.c.o:\"\n            continue\n        # line looks like:\n        #\n        # -------- d yycheck\n        # -------- t wabt_strndup_\n        #          U wabt_parse_int64\n        # -------- T wabt_offsetof_allocator_alloc\n        #\n        # we want to only keep the \"T\" names; the extern function symbols defined\n        # in the object.\n        type_ = line[9]\n        if type_ != 'T':\n            continue\n        name = line[11:]\n        names.append('_' + name)\n    return names\n\n\ndef main(args):\n    parser = argparse.ArgumentParser()\n    parser.add_argument('-o', '--output', metavar='PATH', help='output file.')\n    parser.add_argument('-v', '--verbose',\n                        help='print more diagnostic messages.',\n                        action='store_true')\n    parser.add_argument('--emscripten-dir', metavar='PATH',\n                        help='emscripten directory',\n                        default=DEFAULT_EMSCRIPTEN_DIR)\n    parser.add_argument('cmake_build_dir', metavar='cmake_build_dir')\n    options = parser.parse_args(args)\n    nm = GetNM(options.emscripten_dir)\n\n    names = []\n    for file_ in FindFiles(options.cmake_build_dir):\n        names.extend(ProcessFile(nm, file_))\n\n    out_data = json.dumps(sorted(names), separators=(',\\n', ':\\n'))\n    if options.output:\n        with open(options.output, 'w') as out_file:\n            out_file.write(out_data)\n    else:\n        print(out_data)\n    return 0\n\n\nif __name__ == '__main__':\n    try:\n        sys.exit(main(sys.argv[1:]))\n    except Error as e:\n        sys.stderr.write(str(e) + '\\n')\n        sys.exit(1)\n"
  },
  {
    "path": "scripts/gen-wasm2c-templates.cmake",
    "content": "# https://stackoverflow.com/a/47801116\nfile(READ ${in} content)\nstring(REGEX REPLACE \"(.[^\\n]*\\n)\" \"R\\\"w2c_template(\\\\1)w2c_template\\\"\\n\" content \"${content}\")\nset(content \"const char* ${symbol} = ${content};\\n\")\nfile(WRITE ${out} \"${content}\")\n"
  },
  {
    "path": "scripts/generate-html-docs.sh",
    "content": "#!/bin/bash\n#\n# Copyright 2020 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nset -o nounset\nset -o errexit\n\nSCRIPT_DIR=\"$(dirname \"$(readlink -f \"$0\")\")\"\nROOT_DIR=\"$(dirname \"${SCRIPT_DIR}\")\"\nMAN_DIR=\"$ROOT_DIR/man\"\nDOC_DIR=\"$ROOT_DIR/docs/doc\"\n\nif ! which mandoc > /dev/null; then\n  echo 'mandoc not found'\n  exit\nfi\n\nset -x\nfor file in \"$MAN_DIR\"/*.1; do\n  mandoc -T html -O man='%N.%S.html' \"$file\" > \"$DOC_DIR/$(basename \"$file\").html\"\ndone\nset +x\n\n"
  },
  {
    "path": "scripts/help2man.lua",
    "content": "#!/usr/bin/env lua\n\nlocal format_br = '\\n.br\\n'\nlocal tools = {\n\t\"wasm-decompile\",\t\"wasm-interp\",\t\"wasm-objdump\",\t\"wasm-stats\",\n\t\"wasm-strip\",\t\"wasm-validate\",\t\"wasm2c\",\t\"wasm2wat\",\n\t\"wast2json\",\t\"wat-desugar\",\t\"wat2wasm\",\t\"spectest-interp\"\n}\n\nlocal name, mainarg, argvs\nlocal usage\nlocal short = \"\"\nlocal full = {}\nlocal examples = {}\nlocal options = {}\n\nlocal last = { }\n\ndo -- parse usage\n\tlocal usage = io.read('*line');\n\tname, mainarg, argvs = usage:match(\"usage: ([^%s%c]+) %[options%] ([^%s%c]+) %[([^%s%c]+)%]%.%.%.\")\n\tif not argvs then\n\t\tname, mainarg = usage:match(\"usage: ([^%s%c]+) %[options%] ([^%s%c]+)\")\n\tend\nend\n\ndo -- read short description\n\trepeat line = io.read('*line');\n\t\tshort = short .. ' ' .. line\n\tuntil line == \"\"\nend\n\ndo -- read full description\n\trepeat line = io.read('*line');\n\t\ttable.insert(full, line)\n\tuntil line == \"examples:\"\n\tdo -- format full description\n\t\ttable.remove(full, #full) -- remove \"examples:\"\n\t\tfull = table.concat(full, \"\") -- concat everything with a space\n\t\tfull = full:gsub(\"^  \", \"\")\n\t\tfull = full:gsub(\"\\n  \", \"\")\n\t\t-- full = full:gsub(\"  +\", \"\\n\")\n\t\tfull:gsub('\\n', format_br)\n\tend\nend\n\n\ndo -- parse examples\n\tline = io.read('*line'); -- skip \"examples:\"\n\tlast = { descr = {} } -- prepare new example\n\twhile line ~= \"options:\" do\n\t\t-- empty lines are between examples\n\t\tif line:match(\"^%s*$\") then\n\t\t\t-- format last\n\t\t\tlocal descr = last.descr\n\t\t\tdescr = table.concat(descr, '\\n')\n\t\t\tlast.descr = descr\n\t\t\t-- push last\n\t\t\ttable.insert(examples, last)\n\t\t\t-- prepare new example\n\t\t\tlast = { descr = {} }\n\t\tend\n\t\t\n\t\t-- found the sample usage\n\t\tif line:match(\"^%s*%$ \") then\n\t\t\tlast.input = line:match(\"^ *%$ (.+)\")\n\t\tend\n\t\t-- found some description\n\t\tif line:match(\"^ *# \") then\n\t\t\ttable.insert(last.descr, (line:gsub(\"^ *# \", \"\")))\n\t\tend\n\t\t\n\t\tline = io.read('*line');\n\tend\nend\n\n\ndo -- parse options\n\tlast = { }\n\tfor line in io.stdin:lines() do\n\t\tif line:match(\"^ +%-\") then\n\t\t\ttable.insert(options, last)\n\t\t\t\n\t\t\tlocal short, long, descr = line:match(\"^  %-(%w), %-%-([^%s%c]+) +(.+)\")\n\t\t\tif not short then\n\t\t\t\tlong, descr = line:match(\"^      %-%-([^%s%c]+) +(.+)\")\n\t\t\tend\n\t\t\tlast = {\n\t\t\t\tshort = short,\n\t\t\t\tlong = long,\n\t\t\t\tdescr = descr,\n\t\t\t}\n\t\telse\n\t\t\tlast.descr = last.descr .. line:gsub(\"^ +\", \"\\n\")\n\t\tend\n\tend\n\ttable.remove(options, 1)\n\tlast = { }\nend\n\n\n-- remove this tool from the SEE ALSO section\nfor index, tool in pairs(tools) do\n\tif tool == name then\n\t\ttable.remove(tools, index)\n\t\tbreak\n\tend\nend\n\n\n\ndo -- print the man page\n\tprint(\".Dd $Mdocdate$\")\n\tprint(\".Os\")\n\tprint(\".Sh NAME\")\n\tprint((\".Nm %s\"):format(name))\n\tprint((\".Nd %s\"):format(short))\n\tprint(\".Sh SYNOPSIS\")\n\tprint((\".Nm %s\"):format(name))\n\tprint(\".Op options\")\n\tprint((\".Ar %s\"):format(mainarg))\n\tif argvs then\n\t\tprint((\".Ar [%s]...\"):format(argvs))\n\tend\n\tprint(\".Sh DESCRIPTION\")\n\tprint(\".Nm\")\n\tprint(full)\n\tprint(\".Pp\")\n\tprint(\"The options are as follows:\")\n\tprint(\".Bl -tag -width Ds\")\n\tfor index, option in pairs(options) do\n\t\tif option.short then\n\t\t\tprint((\".It Fl %s , Fl Fl %s\"):format(option.short, option.long))\n\t\telse\n\t\t\tprint((\".It Fl Fl %s\"):format(option.long))\n\t\tend\n\t\tprint(option.descr)\n\tend\n\tprint(\".El\")\n\tprint(\".Sh EXAMPLES\")\n\tfor index, example in pairs(examples) do\n\t\tprint(example.descr)\n\t\tprint(\".Pp\")\n\t\tprint((\".Dl $ %s\"):format(example.input))\n\tend\n\tprint(\".Sh SEE ALSO\")\n\tfor idx, tool in pairs(tools) do\n\t\tprint((\".Xr %s 1 %s\"):format(tool, idx == #tool and \"\" or \",\"))\n\tend\n\tprint(\".Sh BUGS\")\n\tprint(\"If you find a bug, please report it at\")\n\tprint(\".br\")\n\tprint(\".Lk https://github.com/WebAssembly/wabt/issues .\")\nend\n"
  },
  {
    "path": "scripts/sha256sum.py",
    "content": "#!/usr/bin/env python\n#\n# Copyright 2018 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport argparse\nimport hashlib\nimport sys\n\n\ndef main(args):\n    parser = argparse.ArgumentParser()\n    parser.add_argument('file', nargs='?')\n    options = parser.parse_args(args)\n\n    if options.file is None:\n        parser.error('Expected a file')\n\n    m = hashlib.sha256()\n    with open(options.file, 'rb') as f:\n        m.update(f.read())\n    print('%s  %s' % (m.hexdigest(), options.file))\n    return 0\n\n\nif __name__ == '__main__':\n    sys.exit(main(sys.argv[1:]))\n"
  },
  {
    "path": "scripts/wabt-config.cmake.in",
    "content": "cmake_minimum_required(VERSION 3.10)\n@PACKAGE_INIT@\n\nif (\"@HAVE_OPENSSL_SHA_H@\")\n    include(CMakeFindDependencyMacro)\n    find_dependency(OpenSSL)\nendif ()\n\ninclude(\"${CMAKE_CURRENT_LIST_DIR}/wabt-targets.cmake\")\ncheck_required_components(wabt)\n"
  },
  {
    "path": "src/apply-names.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/apply-names.h\"\n\n#include <cassert>\n#include <cstdio>\n#include <string_view>\n#include <vector>\n\n#include \"wabt/cast.h\"\n#include \"wabt/expr-visitor.h\"\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nnamespace {\n\nclass NameApplier : public ExprVisitor::DelegateNop {\n public:\n  NameApplier();\n\n  Result VisitModule(Module* module);\n\n  // Implementation of ExprVisitor::DelegateNop.\n  Result BeginBlockExpr(BlockExpr*) override;\n  Result EndBlockExpr(BlockExpr*) override;\n  Result OnBrExpr(BrExpr*) override;\n  Result OnBrIfExpr(BrIfExpr*) override;\n  Result OnBrOnNonNullExpr(BrOnNonNullExpr*) override;\n  Result OnBrOnNullExpr(BrOnNullExpr*) override;\n  Result OnBrTableExpr(BrTableExpr*) override;\n  Result OnCallExpr(CallExpr*) override;\n  Result OnRefFuncExpr(RefFuncExpr*) override;\n  Result OnCallIndirectExpr(CallIndirectExpr*) override;\n  Result OnReturnCallExpr(ReturnCallExpr*) override;\n  Result OnReturnCallIndirectExpr(ReturnCallIndirectExpr*) override;\n  Result OnGlobalGetExpr(GlobalGetExpr*) override;\n  Result OnGlobalSetExpr(GlobalSetExpr*) override;\n  Result BeginIfExpr(IfExpr*) override;\n  Result EndIfExpr(IfExpr*) override;\n  Result OnLoadExpr(LoadExpr*) override;\n  Result OnLocalGetExpr(LocalGetExpr*) override;\n  Result OnLocalSetExpr(LocalSetExpr*) override;\n  Result OnLocalTeeExpr(LocalTeeExpr*) override;\n  Result BeginLoopExpr(LoopExpr*) override;\n  Result EndLoopExpr(LoopExpr*) override;\n  Result OnMemoryCopyExpr(MemoryCopyExpr*) override;\n  Result OnDataDropExpr(DataDropExpr*) override;\n  Result OnMemoryFillExpr(MemoryFillExpr*) override;\n  Result OnMemoryGrowExpr(MemoryGrowExpr*) override;\n  Result OnMemoryInitExpr(MemoryInitExpr*) override;\n  Result OnMemorySizeExpr(MemorySizeExpr*) override;\n  Result OnElemDropExpr(ElemDropExpr*) override;\n  Result OnTableCopyExpr(TableCopyExpr*) override;\n  Result OnTableInitExpr(TableInitExpr*) override;\n  Result OnTableGetExpr(TableGetExpr*) override;\n  Result OnTableSetExpr(TableSetExpr*) override;\n  Result OnTableGrowExpr(TableGrowExpr*) override;\n  Result OnTableSizeExpr(TableSizeExpr*) override;\n  Result OnTableFillExpr(TableFillExpr*) override;\n  Result OnStoreExpr(StoreExpr*) override;\n  Result BeginTryExpr(TryExpr*) override;\n  Result EndTryExpr(TryExpr*) override;\n  Result BeginTryTableExpr(TryTableExpr*) override;\n  Result EndTryTableExpr(TryTableExpr*) override;\n  Result OnCatchExpr(TryExpr*, Catch*) override;\n  Result OnDelegateExpr(TryExpr*) override;\n  Result OnThrowExpr(ThrowExpr*) override;\n  Result OnRethrowExpr(RethrowExpr*) override;\n  Result OnSimdLoadLaneExpr(SimdLoadLaneExpr*) override;\n  Result OnSimdStoreLaneExpr(SimdStoreLaneExpr*) override;\n\n private:\n  void PushLabel(const std::string& label);\n  void PopLabel();\n  std::string_view FindLabelByVar(Var* var);\n  void UseNameForVar(std::string_view name, Var* var);\n  Result UseNameForFuncTypeVar(Var* var);\n  Result UseNameForFuncVar(Var* var);\n  Result UseNameForGlobalVar(Var* var);\n  Result UseNameForTableVar(Var* var);\n  Result UseNameForMemoryVar(Var* var);\n  Result UseNameForTagVar(Var* var);\n  Result UseNameForDataSegmentVar(Var* var);\n  Result UseNameForElemSegmentVar(Var* var);\n  Result UseNameForParamAndLocalVar(Func* func, Var* var);\n  Result UseNameForLabelVar(Var* var);\n  Result VisitFunc(Index func_index, Func* func);\n  Result VisitGlobal(Global* global);\n  Result VisitTag(Tag* tag);\n  Result VisitExport(Index export_index, Export* export_);\n  Result VisitTable(Table* table);\n  Result VisitElemSegment(Index elem_segment_index, ElemSegment* segment);\n  Result VisitDataSegment(Index data_segment_index, DataSegment* segment);\n  Result VisitStart(Var* start_var);\n\n  Module* module_ = nullptr;\n  Func* current_func_ = nullptr;\n  ExprVisitor visitor_;\n  std::vector<std::string> param_and_local_index_to_name_;\n  std::vector<std::string> labels_;\n};\n\nNameApplier::NameApplier() : visitor_(this) {}\n\nvoid NameApplier::PushLabel(const std::string& label) {\n  labels_.push_back(label);\n}\n\nvoid NameApplier::PopLabel() {\n  labels_.pop_back();\n}\n\nstd::string_view NameApplier::FindLabelByVar(Var* var) {\n  if (var->is_name()) {\n    for (int i = labels_.size() - 1; i >= 0; --i) {\n      const std::string& label = labels_[i];\n      if (label == var->name()) {\n        return label;\n      }\n    }\n    return std::string_view();\n  } else {\n    if (var->index() >= labels_.size()) {\n      return std::string_view();\n    }\n    return labels_[labels_.size() - 1 - var->index()];\n  }\n}\n\nvoid NameApplier::UseNameForVar(std::string_view name, Var* var) {\n  if (var->is_name()) {\n    assert(name == var->name());\n    return;\n  }\n\n  if (!name.empty()) {\n    var->set_name(name);\n  }\n}\n\nResult NameApplier::UseNameForFuncTypeVar(Var* var) {\n  FuncType* func_type = module_->GetFuncType(*var);\n  if (!func_type) {\n    return Result::Error;\n  }\n  UseNameForVar(func_type->name, var);\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForFuncVar(Var* var) {\n  Func* func = module_->GetFunc(*var);\n  if (!func) {\n    return Result::Error;\n  }\n  UseNameForVar(func->name, var);\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForGlobalVar(Var* var) {\n  Global* global = module_->GetGlobal(*var);\n  if (!global) {\n    return Result::Error;\n  }\n  UseNameForVar(global->name, var);\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForTableVar(Var* var) {\n  Table* table = module_->GetTable(*var);\n  if (!table) {\n    return Result::Error;\n  }\n  UseNameForVar(table->name, var);\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForMemoryVar(Var* var) {\n  Memory* memory = module_->GetMemory(*var);\n  if (!memory) {\n    return Result::Error;\n  }\n  UseNameForVar(memory->name, var);\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForTagVar(Var* var) {\n  Tag* tag = module_->GetTag(*var);\n  if (!tag) {\n    return Result::Error;\n  }\n  UseNameForVar(tag->name, var);\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForDataSegmentVar(Var* var) {\n  DataSegment* data_segment = module_->GetDataSegment(*var);\n  if (!data_segment) {\n    return Result::Error;\n  }\n  UseNameForVar(data_segment->name, var);\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForElemSegmentVar(Var* var) {\n  ElemSegment* elem_segment = module_->GetElemSegment(*var);\n  if (!elem_segment) {\n    return Result::Error;\n  }\n  UseNameForVar(elem_segment->name, var);\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForParamAndLocalVar(Func* func, Var* var) {\n  Index local_index = func->GetLocalIndex(*var);\n  if (local_index >= func->GetNumParamsAndLocals()) {\n    return Result::Error;\n  }\n\n  std::string name = param_and_local_index_to_name_[local_index];\n  if (var->is_name()) {\n    assert(name == var->name());\n    return Result::Ok;\n  }\n\n  if (!name.empty()) {\n    var->set_name(name);\n  }\n  return Result::Ok;\n}\n\nResult NameApplier::UseNameForLabelVar(Var* var) {\n  std::string_view label = FindLabelByVar(var);\n  UseNameForVar(label, var);\n  return Result::Ok;\n}\n\nResult NameApplier::BeginBlockExpr(BlockExpr* expr) {\n  PushLabel(expr->block.label);\n  return Result::Ok;\n}\n\nResult NameApplier::EndBlockExpr(BlockExpr* expr) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameApplier::BeginLoopExpr(LoopExpr* expr) {\n  PushLabel(expr->block.label);\n  return Result::Ok;\n}\n\nResult NameApplier::EndLoopExpr(LoopExpr* expr) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameApplier::OnDataDropExpr(DataDropExpr* expr) {\n  return UseNameForDataSegmentVar(&expr->var);\n}\n\nResult NameApplier::OnMemoryCopyExpr(MemoryCopyExpr* expr) {\n  CHECK_RESULT(UseNameForMemoryVar(&expr->destmemidx));\n  return UseNameForMemoryVar(&expr->srcmemidx);\n}\n\nResult NameApplier::OnMemoryFillExpr(MemoryFillExpr* expr) {\n  return UseNameForMemoryVar(&expr->memidx);\n}\n\nResult NameApplier::OnMemoryGrowExpr(MemoryGrowExpr* expr) {\n  return UseNameForMemoryVar(&expr->memidx);\n}\n\nResult NameApplier::OnMemoryInitExpr(MemoryInitExpr* expr) {\n  CHECK_RESULT(UseNameForDataSegmentVar(&expr->var));\n  return UseNameForMemoryVar(&expr->memidx);\n}\n\nResult NameApplier::OnMemorySizeExpr(MemorySizeExpr* expr) {\n  return UseNameForMemoryVar(&expr->memidx);\n}\n\nResult NameApplier::OnElemDropExpr(ElemDropExpr* expr) {\n  return UseNameForElemSegmentVar(&expr->var);\n}\n\nResult NameApplier::OnTableCopyExpr(TableCopyExpr* expr) {\n  CHECK_RESULT(UseNameForTableVar(&expr->dst_table));\n  return UseNameForTableVar(&expr->src_table);\n}\n\nResult NameApplier::OnTableInitExpr(TableInitExpr* expr) {\n  CHECK_RESULT(UseNameForElemSegmentVar(&expr->segment_index));\n  return UseNameForTableVar(&expr->table_index);\n}\n\nResult NameApplier::OnTableGetExpr(TableGetExpr* expr) {\n  return UseNameForTableVar(&expr->var);\n}\n\nResult NameApplier::OnTableSetExpr(TableSetExpr* expr) {\n  return UseNameForTableVar(&expr->var);\n}\n\nResult NameApplier::OnTableGrowExpr(TableGrowExpr* expr) {\n  return UseNameForTableVar(&expr->var);\n}\n\nResult NameApplier::OnTableSizeExpr(TableSizeExpr* expr) {\n  return UseNameForTableVar(&expr->var);\n}\n\nResult NameApplier::OnTableFillExpr(TableFillExpr* expr) {\n  return UseNameForTableVar(&expr->var);\n}\n\nResult NameApplier::OnStoreExpr(StoreExpr* expr) {\n  return UseNameForMemoryVar(&expr->memidx);\n}\n\nResult NameApplier::OnBrExpr(BrExpr* expr) {\n  return UseNameForLabelVar(&expr->var);\n}\n\nResult NameApplier::OnBrIfExpr(BrIfExpr* expr) {\n  return UseNameForLabelVar(&expr->var);\n}\n\nResult NameApplier::OnBrOnNonNullExpr(BrOnNonNullExpr* expr) {\n  return UseNameForLabelVar(&expr->var);\n}\n\nResult NameApplier::OnBrOnNullExpr(BrOnNullExpr* expr) {\n  return UseNameForLabelVar(&expr->var);\n}\n\nResult NameApplier::OnBrTableExpr(BrTableExpr* expr) {\n  for (Var& target : expr->targets) {\n    UseNameForLabelVar(&target);\n  }\n\n  return UseNameForLabelVar(&expr->default_target);\n}\n\nResult NameApplier::BeginTryExpr(TryExpr* expr) {\n  PushLabel(expr->block.label);\n  return Result::Ok;\n}\n\nResult NameApplier::EndTryExpr(TryExpr*) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameApplier::BeginTryTableExpr(TryTableExpr* expr) {\n  for (TableCatch& catch_ : expr->catches) {\n    if (!catch_.IsCatchAll()) {\n      CHECK_RESULT(UseNameForTagVar(&catch_.tag));\n    }\n    UseNameForLabelVar(&catch_.target);\n  }\n  PushLabel(expr->block.label);\n  return Result::Ok;\n}\n\nResult NameApplier::EndTryTableExpr(TryTableExpr*) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameApplier::OnCatchExpr(TryExpr*, Catch* expr) {\n  if (!expr->IsCatchAll()) {\n    CHECK_RESULT(UseNameForTagVar(&expr->var));\n  }\n  return Result::Ok;\n}\n\nResult NameApplier::OnDelegateExpr(TryExpr* expr) {\n  PopLabel();\n  return UseNameForLabelVar(&expr->delegate_target);\n}\n\nResult NameApplier::OnThrowExpr(ThrowExpr* expr) {\n  return UseNameForTagVar(&expr->var);\n}\n\nResult NameApplier::OnRethrowExpr(RethrowExpr* expr) {\n  return UseNameForLabelVar(&expr->var);\n}\n\nResult NameApplier::OnCallExpr(CallExpr* expr) {\n  return UseNameForFuncVar(&expr->var);\n}\n\nResult NameApplier::OnRefFuncExpr(RefFuncExpr* expr) {\n  return UseNameForFuncVar(&expr->var);\n}\n\nResult NameApplier::OnCallIndirectExpr(CallIndirectExpr* expr) {\n  if (expr->decl.has_func_type) {\n    CHECK_RESULT(UseNameForFuncTypeVar(&expr->decl.type_var));\n  }\n  return UseNameForTableVar(&expr->table);\n}\n\nResult NameApplier::OnReturnCallExpr(ReturnCallExpr* expr) {\n  return UseNameForFuncVar(&expr->var);\n}\n\nResult NameApplier::OnReturnCallIndirectExpr(ReturnCallIndirectExpr* expr) {\n  if (expr->decl.has_func_type) {\n    CHECK_RESULT(UseNameForFuncTypeVar(&expr->decl.type_var));\n  }\n  return UseNameForTableVar(&expr->table);\n}\n\nResult NameApplier::OnGlobalGetExpr(GlobalGetExpr* expr) {\n  return UseNameForGlobalVar(&expr->var);\n}\n\nResult NameApplier::OnLocalGetExpr(LocalGetExpr* expr) {\n  return UseNameForParamAndLocalVar(current_func_, &expr->var);\n}\n\nResult NameApplier::BeginIfExpr(IfExpr* expr) {\n  PushLabel(expr->true_.label);\n  return Result::Ok;\n}\n\nResult NameApplier::EndIfExpr(IfExpr* expr) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameApplier::OnLoadExpr(LoadExpr* expr) {\n  return UseNameForMemoryVar(&expr->memidx);\n}\n\nResult NameApplier::OnGlobalSetExpr(GlobalSetExpr* expr) {\n  return UseNameForGlobalVar(&expr->var);\n}\n\nResult NameApplier::OnLocalSetExpr(LocalSetExpr* expr) {\n  return UseNameForParamAndLocalVar(current_func_, &expr->var);\n}\n\nResult NameApplier::OnLocalTeeExpr(LocalTeeExpr* expr) {\n  return UseNameForParamAndLocalVar(current_func_, &expr->var);\n}\n\nResult NameApplier::OnSimdLoadLaneExpr(SimdLoadLaneExpr* expr) {\n  return UseNameForMemoryVar(&expr->memidx);\n}\n\nResult NameApplier::OnSimdStoreLaneExpr(SimdStoreLaneExpr* expr) {\n  return UseNameForMemoryVar(&expr->memidx);\n}\n\nResult NameApplier::VisitFunc(Index func_index, Func* func) {\n  current_func_ = func;\n  if (func->decl.has_func_type) {\n    CHECK_RESULT(UseNameForFuncTypeVar(&func->decl.type_var));\n  }\n\n  MakeTypeBindingReverseMapping(func->GetNumParamsAndLocals(), func->bindings,\n                                &param_and_local_index_to_name_);\n\n  CHECK_RESULT(visitor_.VisitFunc(func));\n  current_func_ = nullptr;\n  return Result::Ok;\n}\n\nResult NameApplier::VisitGlobal(Global* global) {\n  return visitor_.VisitExprList(global->init_expr);\n}\n\nResult NameApplier::VisitTag(Tag* tag) {\n  if (tag->decl.has_func_type) {\n    CHECK_RESULT(UseNameForFuncTypeVar(&tag->decl.type_var));\n  }\n  return Result::Ok;\n}\n\nResult NameApplier::VisitExport(Index export_index, Export* export_) {\n  switch (export_->kind) {\n    case ExternalKind::Func:\n      UseNameForFuncVar(&export_->var);\n      break;\n\n    case ExternalKind::Table:\n      UseNameForTableVar(&export_->var);\n      break;\n\n    case ExternalKind::Memory:\n      UseNameForMemoryVar(&export_->var);\n      break;\n\n    case ExternalKind::Global:\n      UseNameForGlobalVar(&export_->var);\n      break;\n\n    case ExternalKind::Tag:\n      UseNameForTagVar(&export_->var);\n      break;\n  }\n  return Result::Ok;\n}\n\nResult NameApplier::VisitTable(Table* table) {\n  return visitor_.VisitExprList(table->init_expr);\n}\n\nResult NameApplier::VisitElemSegment(Index elem_segment_index,\n                                     ElemSegment* segment) {\n  CHECK_RESULT(UseNameForTableVar(&segment->table_var));\n  CHECK_RESULT(visitor_.VisitExprList(segment->offset));\n  for (ExprList& elem_expr : segment->elem_exprs) {\n    Expr* expr = &elem_expr.front();\n    if (expr->type() == ExprType::RefFunc) {\n      CHECK_RESULT(UseNameForFuncVar(&cast<RefFuncExpr>(expr)->var));\n    }\n  }\n  return Result::Ok;\n}\n\nResult NameApplier::VisitDataSegment(Index data_segment_index,\n                                     DataSegment* segment) {\n  CHECK_RESULT(UseNameForMemoryVar(&segment->memory_var));\n  return visitor_.VisitExprList(segment->offset);\n}\n\nResult NameApplier::VisitStart(Var* start_var) {\n  return UseNameForFuncVar(start_var);\n}\n\nResult NameApplier::VisitModule(Module* module) {\n  module_ = module;\n  for (size_t i = 0; i < module->funcs.size(); ++i)\n    CHECK_RESULT(VisitFunc(i, module->funcs[i]));\n  for (size_t i = 0; i < module->globals.size(); ++i)\n    CHECK_RESULT(VisitGlobal(module->globals[i]));\n  for (size_t i = 0; i < module->tags.size(); ++i)\n    CHECK_RESULT(VisitTag(module->tags[i]));\n  for (size_t i = 0; i < module->exports.size(); ++i)\n    CHECK_RESULT(VisitExport(i, module->exports[i]));\n  for (size_t i = 0; i < module->tables.size(); ++i)\n    CHECK_RESULT(VisitTable(module->tables[i]));\n  for (size_t i = 0; i < module->elem_segments.size(); ++i)\n    CHECK_RESULT(VisitElemSegment(i, module->elem_segments[i]));\n  for (size_t i = 0; i < module->data_segments.size(); ++i)\n    CHECK_RESULT(VisitDataSegment(i, module->data_segments[i]));\n  for (size_t i = 0; i < module->starts.size(); ++i)\n    CHECK_RESULT(VisitStart(module->starts[i]));\n  module_ = nullptr;\n  return Result::Ok;\n}\n\n}  // end anonymous namespace\n\nResult ApplyNames(Module* module) {\n  NameApplier applier;\n  return applier.VisitModule(module);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binary-reader-ir.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binary-reader-ir.h\"\n\n#include <cassert>\n#include <cinttypes>\n#include <cstdarg>\n#include <cstdint>\n#include <cstdio>\n#include <deque>\n#include <vector>\n\n#include \"wabt/binary-reader-nop.h\"\n#include \"wabt/cast.h\"\n#include \"wabt/common.h\"\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nnamespace {\n\nstruct LabelNode {\n  LabelNode(LabelType, ExprList* exprs, Expr* context = nullptr);\n\n  LabelType label_type;\n  ExprList* exprs;\n  Expr* context;\n};\n\nLabelNode::LabelNode(LabelType label_type, ExprList* exprs, Expr* context)\n    : label_type(label_type), exprs(exprs), context(context) {}\n\nclass CodeMetadataExprQueue {\n private:\n  struct Entry {\n    Func* func;\n    std::deque<std::unique_ptr<CodeMetadataExpr>> func_queue;\n    Entry(Func* f) : func(f) {}\n  };\n  std::deque<Entry> entries;\n\n public:\n  CodeMetadataExprQueue() {}\n  void push_func(Func* f) { entries.emplace_back(f); }\n  void push_metadata(std::unique_ptr<CodeMetadataExpr> meta) {\n    assert(!entries.empty());\n    entries.back().func_queue.push_back(std::move(meta));\n  }\n\n  std::unique_ptr<CodeMetadataExpr> pop_match(Func* f, Offset offset) {\n    std::unique_ptr<CodeMetadataExpr> ret;\n    if (entries.empty()) {\n      return ret;\n    }\n\n    auto& current_entry = entries.front();\n\n    if (current_entry.func != f)\n      return ret;\n    if (current_entry.func_queue.empty()) {\n      entries.pop_front();\n      return ret;\n    }\n\n    auto& current_metadata = current_entry.func_queue.front();\n    if (current_metadata->loc.offset + current_entry.func->loc.offset !=\n        offset) {\n      return ret;\n    }\n\n    current_metadata->loc = Location(offset);\n    ret = std::move(current_metadata);\n    current_entry.func_queue.pop_front();\n\n    return ret;\n  }\n};\n\nclass BinaryReaderIR : public BinaryReaderNop {\n  static constexpr size_t kMaxNestingDepth = 16384;  // max depth of label stack\n  static constexpr size_t kMaxFunctionLocals = 50000;  // matches V8\n  static constexpr size_t kMaxFunctionParams = 1000;   // matches V8\n  static constexpr size_t kMaxFunctionResults = 1000;  // matches V8\n\n public:\n  BinaryReaderIR(Module* out_module, const char* filename, Errors* errors);\n\n  bool OnError(const Error&) override;\n\n  Result OnTypeCount(Index count) override;\n  Result OnFuncType(Index index,\n                    Index param_count,\n                    Type* param_types,\n                    Index result_count,\n                    Type* result_types) override;\n  Result OnStructType(Index index, Index field_count, TypeMut* fields) override;\n  Result OnArrayType(Index index, TypeMut field) override;\n\n  Result OnImportCount(Index count) override;\n  Result OnImportFunc(Index import_index,\n                      std::string_view module_name,\n                      std::string_view field_name,\n                      Index func_index,\n                      Index sig_index) override;\n  Result OnImportTable(Index import_index,\n                       std::string_view module_name,\n                       std::string_view field_name,\n                       Index table_index,\n                       Type elem_type,\n                       const Limits* elem_limits) override;\n  Result OnImportMemory(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index memory_index,\n                        const Limits* page_limits,\n                        uint32_t page_size) override;\n  Result OnImportGlobal(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index global_index,\n                        Type type,\n                        bool mutable_) override;\n  Result OnImportTag(Index import_index,\n                     std::string_view module_name,\n                     std::string_view field_name,\n                     Index tag_index,\n                     Index sig_index) override;\n\n  Result OnFunctionCount(Index count) override;\n  Result OnFunction(Index index, Index sig_index) override;\n\n  Result OnTableCount(Index count) override;\n  Result BeginTable(Index index,\n                    Type elem_type,\n                    const Limits* elem_limits,\n                    TableInitExprStatus init_provided) override;\n  Result BeginTableInitExpr(Index index) override;\n  Result EndTableInitExpr(Index index) override;\n\n  Result OnMemoryCount(Index count) override;\n  Result OnMemory(Index index,\n                  const Limits* limits,\n                  uint32_t page_size) override;\n\n  Result OnGlobalCount(Index count) override;\n  Result BeginGlobal(Index index, Type type, bool mutable_) override;\n  Result BeginGlobalInitExpr(Index index) override;\n  Result EndGlobalInitExpr(Index index) override;\n\n  Result OnExportCount(Index count) override;\n  Result OnExport(Index index,\n                  ExternalKind kind,\n                  Index item_index,\n                  std::string_view name) override;\n\n  Result OnStartFunction(Index func_index) override;\n\n  Result OnFunctionBodyCount(Index count) override;\n  Result BeginFunctionBody(Index index, Offset size) override;\n  Result OnLocalDecl(Index decl_index, Index count, Type type) override;\n\n  Result OnOpcode(Opcode opcode) override;\n  Result OnAtomicLoadExpr(Opcode opcode,\n                          Index memidx,\n                          Address alignment_log2,\n                          Address offset) override;\n  Result OnAtomicStoreExpr(Opcode opcode,\n                           Index memidx,\n                           Address alignment_log2,\n                           Address offset) override;\n  Result OnAtomicRmwExpr(Opcode opcode,\n                         Index memidx,\n                         Address alignment_log2,\n                         Address offset) override;\n  Result OnAtomicRmwCmpxchgExpr(Opcode opcode,\n                                Index memidx,\n                                Address alignment_log2,\n                                Address offset) override;\n  Result OnAtomicWaitExpr(Opcode opcode,\n                          Index memidx,\n                          Address alignment_log2,\n                          Address offset) override;\n  Result OnAtomicFenceExpr(uint32_t consistency_model) override;\n  Result OnAtomicNotifyExpr(Opcode opcode,\n                            Index memidx,\n                            Address alignment_log2,\n                            Address offset) override;\n  Result OnUnaryExpr(Opcode opcode) override;\n  Result OnBinaryExpr(Opcode opcode) override;\n  Result OnTernaryExpr(Opcode opcode) override;\n  Result OnQuaternaryExpr(Opcode opcode) override;\n  Result OnBlockExpr(Type sig_type) override;\n  Result OnBrExpr(Index depth) override;\n  Result OnBrIfExpr(Index depth) override;\n  Result OnBrOnNonNullExpr(Index depth) override;\n  Result OnBrOnNullExpr(Index depth) override;\n  Result OnBrTableExpr(Index num_targets,\n                       Index* target_depths,\n                       Index default_target_depth) override;\n  Result OnCallExpr(Index func_index) override;\n  Result OnCatchExpr(Index tag_index) override;\n  Result OnCatchAllExpr() override;\n  Result OnCallIndirectExpr(Index sig_index, Index table_index) override;\n  Result OnCallRefExpr(Type sig_type) override;\n  Result OnReturnCallExpr(Index func_index) override;\n  Result OnReturnCallIndirectExpr(Index sig_index, Index table_index) override;\n  Result OnReturnCallRefExpr(Type sig_type) override;\n  Result OnCompareExpr(Opcode opcode) override;\n  Result OnConvertExpr(Opcode opcode) override;\n  Result OnDelegateExpr(Index depth) override;\n  Result OnDropExpr() override;\n  Result OnElseExpr() override;\n  Result OnEndExpr() override;\n  Result OnF32ConstExpr(uint32_t value_bits) override;\n  Result OnF64ConstExpr(uint64_t value_bits) override;\n  Result OnV128ConstExpr(v128 value_bits) override;\n  Result OnGlobalGetExpr(Index global_index) override;\n  Result OnGlobalSetExpr(Index global_index) override;\n  Result OnI32ConstExpr(uint32_t value) override;\n  Result OnI64ConstExpr(uint64_t value) override;\n  Result OnIfExpr(Type sig_type) override;\n  Result OnLoadExpr(Opcode opcode,\n                    Index memidx,\n                    Address alignment_log2,\n                    Address offset) override;\n  Result OnLocalGetExpr(Index local_index) override;\n  Result OnLocalSetExpr(Index local_index) override;\n  Result OnLocalTeeExpr(Index local_index) override;\n  Result OnLoopExpr(Type sig_type) override;\n  Result OnMemoryCopyExpr(Index destmemidx, Index srcmemidx) override;\n  Result OnDataDropExpr(Index segment_index) override;\n  Result OnMemoryFillExpr(Index memidx) override;\n  Result OnMemoryGrowExpr(Index memidx) override;\n  Result OnMemoryInitExpr(Index segment_index, Index memidx) override;\n  Result OnMemorySizeExpr(Index memidx) override;\n  Result OnTableCopyExpr(Index dst_index, Index src_index) override;\n  Result OnElemDropExpr(Index segment_index) override;\n  Result OnTableInitExpr(Index segment_index, Index table_index) override;\n  Result OnTableGetExpr(Index table_index) override;\n  Result OnTableSetExpr(Index table_index) override;\n  Result OnTableGrowExpr(Index table_index) override;\n  Result OnTableSizeExpr(Index table_index) override;\n  Result OnTableFillExpr(Index table_index) override;\n  Result OnRefAsNonNullExpr() override;\n  Result OnRefFuncExpr(Index func_index) override;\n  Result OnRefNullExpr(Type type) override;\n  Result OnRefIsNullExpr() override;\n  Result OnNopExpr() override;\n  Result OnRethrowExpr(Index depth) override;\n  Result OnReturnExpr() override;\n  Result OnSelectExpr(Index result_count, Type* result_types) override;\n  Result OnStoreExpr(Opcode opcode,\n                     Index memidx,\n                     Address alignment_log2,\n                     Address offset) override;\n  Result OnThrowExpr(Index tag_index) override;\n  Result OnThrowRefExpr() override;\n  Result OnTryExpr(Type sig_type) override;\n  Result OnTryTableExpr(Type sig_type,\n                        const CatchClauseVector& catches) override;\n  Result OnUnreachableExpr() override;\n  Result EndFunctionBody(Index index) override;\n  Result OnSimdLaneOpExpr(Opcode opcode, uint64_t value) override;\n  Result OnSimdLoadLaneExpr(Opcode opcode,\n                            Index memidx,\n                            Address alignment_log2,\n                            Address offset,\n                            uint64_t value) override;\n  Result OnSimdStoreLaneExpr(Opcode opcode,\n                             Index memidx,\n                             Address alignment_log2,\n                             Address offset,\n                             uint64_t value) override;\n  Result OnSimdShuffleOpExpr(Opcode opcode, v128 value) override;\n  Result OnLoadSplatExpr(Opcode opcode,\n                         Index memidx,\n                         Address alignment_log2,\n                         Address offset) override;\n  Result OnLoadZeroExpr(Opcode opcode,\n                        Index memidx,\n                        Address alignment_log2,\n                        Address offset) override;\n\n  Result OnElemSegmentCount(Index count) override;\n  Result BeginElemSegment(Index index,\n                          Index table_index,\n                          uint8_t flags) override;\n  Result BeginElemSegmentInitExpr(Index index) override;\n  Result EndElemSegmentInitExpr(Index index) override;\n  Result OnElemSegmentElemType(Index index, Type elem_type) override;\n  Result OnElemSegmentElemExprCount(Index index, Index count) override;\n  Result BeginElemExpr(Index elem_index, Index expr_index) override;\n  Result EndElemExpr(Index elem_index, Index expr_index) override;\n\n  Result OnDataSegmentCount(Index count) override;\n  Result BeginDataSegment(Index index,\n                          Index memory_index,\n                          uint8_t flags) override;\n  Result BeginDataSegmentInitExpr(Index index) override;\n  Result EndDataSegmentInitExpr(Index index) override;\n  Result OnDataSegmentData(Index index,\n                           const void* data,\n                           Address size) override;\n\n  Result OnModuleName(std::string_view module_name) override;\n  Result OnFunctionNamesCount(Index num_functions) override;\n  Result OnFunctionName(Index function_index,\n                        std::string_view function_name) override;\n  Result OnLocalNameLocalCount(Index function_index, Index num_locals) override;\n  Result OnLocalName(Index function_index,\n                     Index local_index,\n                     std::string_view local_name) override;\n  Result OnNameEntry(NameSectionSubsection type,\n                     Index index,\n                     std::string_view name) override;\n\n  Result OnGenericCustomSection(std::string_view name,\n                                const void* data,\n                                Offset size) override;\n\n  Result BeginTagSection(Offset size) override { return Result::Ok; }\n  Result OnTagCount(Index count) override { return Result::Ok; }\n  Result OnTagType(Index index, Index sig_index) override;\n  Result EndTagSection() override { return Result::Ok; }\n\n  Result OnDataSymbol(Index index,\n                      uint32_t flags,\n                      std::string_view name,\n                      Index segment,\n                      uint32_t offset,\n                      uint32_t size) override;\n  Result OnFunctionSymbol(Index index,\n                          uint32_t flags,\n                          std::string_view name,\n                          Index func_index) override;\n  Result OnGlobalSymbol(Index index,\n                        uint32_t flags,\n                        std::string_view name,\n                        Index global_index) override;\n  Result OnSectionSymbol(Index index,\n                         uint32_t flags,\n                         Index section_index) override;\n  /* Code Metadata sections */\n  Result BeginCodeMetadataSection(std::string_view name, Offset size) override;\n  Result OnCodeMetadataFuncCount(Index count) override;\n  Result OnCodeMetadataCount(Index function_index, Index count) override;\n  Result OnCodeMetadata(Offset offset, const void* data, Address size) override;\n\n  Result OnTagSymbol(Index index,\n                     uint32_t flags,\n                     std::string_view name,\n                     Index tag_index) override;\n  Result OnTableSymbol(Index index,\n                       uint32_t flags,\n                       std::string_view name,\n                       Index table_index) override;\n\n private:\n  Location GetLocation() const;\n  void PrintError(const char* format, ...);\n  Result PushLabel(LabelType label_type,\n                   ExprList* first,\n                   Expr* context = nullptr);\n  Result BeginInitExpr(ExprList* init_expr);\n  Result EndInitExpr();\n  Result PopLabel();\n  Result GetLabelAt(LabelNode** label, Index depth);\n  Result TopLabel(LabelNode** label);\n  Result TopLabelExpr(LabelNode** label, Expr** expr);\n  Result AppendExpr(std::unique_ptr<Expr> expr);\n  Result AppendCatch(Catch&& catch_);\n  void SetFuncDeclaration(FuncDeclaration* decl, Var var);\n  void SetBlockDeclaration(BlockDeclaration* decl, Type sig_type);\n  Result SetMemoryName(Index index, std::string_view name);\n  Result SetTableName(Index index, std::string_view name);\n  Result SetFunctionName(Index index, std::string_view name);\n  Result SetTypeName(Index index, std::string_view name);\n  Result SetGlobalName(Index index, std::string_view name);\n  Result SetDataSegmentName(Index index, std::string_view name);\n  Result SetElemSegmentName(Index index, std::string_view name);\n  Result SetTagName(Index index, std::string_view name);\n\n  std::string GetUniqueName(BindingHash* bindings,\n                            const std::string& original_name);\n\n  Errors* errors_ = nullptr;\n  Module* module_ = nullptr;\n\n  Func* current_func_ = nullptr;\n  std::vector<LabelNode> label_stack_;\n  const char* filename_;\n\n  CodeMetadataExprQueue code_metadata_queue_;\n  std::string_view current_metadata_name_;\n};\n\nBinaryReaderIR::BinaryReaderIR(Module* out_module,\n                               const char* filename,\n                               Errors* errors)\n    : errors_(errors), module_(out_module), filename_(filename) {}\n\nLocation BinaryReaderIR::GetLocation() const {\n  Location loc;\n  loc.filename = filename_;\n  loc.offset = state->offset;\n  return loc;\n}\n\nvoid WABT_PRINTF_FORMAT(2, 3) BinaryReaderIR::PrintError(const char* format,\n                                                         ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  errors_->emplace_back(ErrorLevel::Error, Location(kInvalidOffset), buffer);\n}\n\nResult BinaryReaderIR::PushLabel(LabelType label_type,\n                                 ExprList* first,\n                                 Expr* context) {\n  if (label_stack_.size() >= kMaxNestingDepth) {\n    PrintError(\"label stack exceeds max nesting depth\");\n    return Result::Error;\n  }\n  label_stack_.emplace_back(label_type, first, context);\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::PopLabel() {\n  if (label_stack_.size() == 0) {\n    PrintError(\"popping empty label stack\");\n    return Result::Error;\n  }\n\n  label_stack_.pop_back();\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::GetLabelAt(LabelNode** label, Index depth) {\n  if (depth >= label_stack_.size()) {\n    PrintError(\"accessing stack depth: %\" PRIindex \" >= max: %\" PRIzd, depth,\n               label_stack_.size());\n    return Result::Error;\n  }\n\n  *label = &label_stack_[label_stack_.size() - depth - 1];\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::TopLabel(LabelNode** label) {\n  return GetLabelAt(label, 0);\n}\n\nResult BinaryReaderIR::TopLabelExpr(LabelNode** label, Expr** expr) {\n  CHECK_RESULT(TopLabel(label));\n  LabelNode* parent_label;\n  CHECK_RESULT(GetLabelAt(&parent_label, 1));\n  if (parent_label->exprs->empty()) {\n    PrintError(\"TopLabelExpr: parent label has empty expr list\");\n    return Result::Error;\n  }\n  *expr = &parent_label->exprs->back();\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::AppendExpr(std::unique_ptr<Expr> expr) {\n  expr->loc = GetLocation();\n  LabelNode* label;\n  CHECK_RESULT(TopLabel(&label));\n  label->exprs->push_back(std::move(expr));\n  return Result::Ok;\n}\n\nvoid BinaryReaderIR::SetFuncDeclaration(FuncDeclaration* decl, Var var) {\n  decl->has_func_type = true;\n  decl->type_var = var;\n  if (auto* func_type = module_->GetFuncType(var)) {\n    decl->sig = func_type->sig;\n  }\n}\n\nvoid BinaryReaderIR::SetBlockDeclaration(BlockDeclaration* decl,\n                                         Type sig_type) {\n  if (sig_type.IsIndex()) {\n    Index type_index = sig_type.GetIndex();\n    SetFuncDeclaration(decl, Var(type_index, GetLocation()));\n  } else {\n    decl->has_func_type = false;\n    decl->sig.param_types.clear();\n    decl->sig.result_types = sig_type.GetInlineVector();\n  }\n}\n\nstd::string BinaryReaderIR::GetUniqueName(BindingHash* bindings,\n                                          const std::string& orig_name) {\n  int counter = 1;\n  std::string unique_name = orig_name;\n  while (bindings->count(unique_name) != 0) {\n    unique_name = orig_name + \".\" + std::to_string(counter++);\n  }\n  return unique_name;\n}\n\nbool BinaryReaderIR::OnError(const Error& error) {\n  errors_->push_back(error);\n  return true;\n}\n\nResult BinaryReaderIR::OnTypeCount(Index count) {\n  WABT_TRY\n  module_->types.reserve(count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnFuncType(Index index,\n                                  Index param_count,\n                                  Type* param_types,\n                                  Index result_count,\n                                  Type* result_types) {\n  if (param_count > kMaxFunctionParams) {\n    PrintError(\"FuncType param count exceeds maximum value\");\n    return Result::Error;\n  }\n\n  if (result_count > kMaxFunctionResults) {\n    PrintError(\"FuncType result count exceeds maximum value\");\n    return Result::Error;\n  }\n\n  auto field = std::make_unique<TypeModuleField>(GetLocation());\n  auto func_type = std::make_unique<FuncType>();\n  func_type->sig.param_types.assign(param_types, param_types + param_count);\n  func_type->sig.result_types.assign(result_types, result_types + result_count);\n\n  module_->features_used.simd |=\n      std::any_of(func_type->sig.param_types.begin(),\n                  func_type->sig.param_types.end(),\n                  [](auto x) { return x == Type::V128; }) ||\n      std::any_of(func_type->sig.result_types.begin(),\n                  func_type->sig.result_types.end(),\n                  [](auto x) { return x == Type::V128; });\n  module_->features_used.exceptions |=\n      std::any_of(func_type->sig.param_types.begin(),\n                  func_type->sig.param_types.end(),\n                  [](auto x) { return x == Type::ExnRef; }) ||\n      std::any_of(func_type->sig.result_types.begin(),\n                  func_type->sig.result_types.end(),\n                  [](auto x) { return x == Type::ExnRef; });\n\n  field->type = std::move(func_type);\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnStructType(Index index,\n                                    Index field_count,\n                                    TypeMut* fields) {\n  auto field = std::make_unique<TypeModuleField>(GetLocation());\n  auto struct_type = std::make_unique<StructType>();\n  struct_type->fields.resize(field_count);\n  for (Index i = 0; i < field_count; ++i) {\n    struct_type->fields[i].type = fields[i].type;\n    struct_type->fields[i].mutable_ = fields[i].mutable_;\n    module_->features_used.simd |= (fields[i].type == Type::V128);\n    module_->features_used.exceptions |= (fields[i].type == Type::ExnRef);\n  }\n  field->type = std::move(struct_type);\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnArrayType(Index index, TypeMut type_mut) {\n  auto field = std::make_unique<TypeModuleField>(GetLocation());\n  auto array_type = std::make_unique<ArrayType>();\n  array_type->field.type = type_mut.type;\n  array_type->field.mutable_ = type_mut.mutable_;\n  module_->features_used.simd |= (type_mut.type == Type::V128);\n  module_->features_used.exceptions |= (type_mut.type == Type::ExnRef);\n  field->type = std::move(array_type);\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnImportCount(Index count) {\n  WABT_TRY\n  module_->imports.reserve(count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnImportFunc(Index import_index,\n                                    std::string_view module_name,\n                                    std::string_view field_name,\n                                    Index func_index,\n                                    Index sig_index) {\n  auto import = std::make_unique<FuncImport>();\n  import->module_name = module_name;\n  import->field_name = field_name;\n  SetFuncDeclaration(&import->func.decl, Var(sig_index, GetLocation()));\n  module_->AppendField(\n      std::make_unique<ImportModuleField>(std::move(import), GetLocation()));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnImportTable(Index import_index,\n                                     std::string_view module_name,\n                                     std::string_view field_name,\n                                     Index table_index,\n                                     Type elem_type,\n                                     const Limits* elem_limits) {\n  auto import = std::make_unique<TableImport>();\n  import->module_name = module_name;\n  import->field_name = field_name;\n  import->table.elem_limits = *elem_limits;\n  import->table.elem_type = elem_type;\n  module_->AppendField(\n      std::make_unique<ImportModuleField>(std::move(import), GetLocation()));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnImportMemory(Index import_index,\n                                      std::string_view module_name,\n                                      std::string_view field_name,\n                                      Index memory_index,\n                                      const Limits* page_limits,\n                                      uint32_t page_size) {\n  auto import = std::make_unique<MemoryImport>();\n  import->module_name = module_name;\n  import->field_name = field_name;\n  import->memory.page_limits = *page_limits;\n  import->memory.page_size = page_size;\n  if (import->memory.page_limits.is_shared) {\n    module_->features_used.threads = true;\n  }\n  module_->AppendField(\n      std::make_unique<ImportModuleField>(std::move(import), GetLocation()));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnImportGlobal(Index import_index,\n                                      std::string_view module_name,\n                                      std::string_view field_name,\n                                      Index global_index,\n                                      Type type,\n                                      bool mutable_) {\n  auto import = std::make_unique<GlobalImport>();\n  import->module_name = module_name;\n  import->field_name = field_name;\n  import->global.type = type;\n  import->global.mutable_ = mutable_;\n  module_->AppendField(\n      std::make_unique<ImportModuleField>(std::move(import), GetLocation()));\n  module_->features_used.simd |= (type == Type::V128);\n  module_->features_used.exceptions |= (type == Type::ExnRef);\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnImportTag(Index import_index,\n                                   std::string_view module_name,\n                                   std::string_view field_name,\n                                   Index tag_index,\n                                   Index sig_index) {\n  auto import = std::make_unique<TagImport>();\n  import->module_name = module_name;\n  import->field_name = field_name;\n  SetFuncDeclaration(&import->tag.decl, Var(sig_index, GetLocation()));\n  module_->AppendField(\n      std::make_unique<ImportModuleField>(std::move(import), GetLocation()));\n  module_->features_used.exceptions = true;\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnFunctionCount(Index count) {\n  WABT_TRY\n  module_->funcs.reserve(module_->num_func_imports + count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnFunction(Index index, Index sig_index) {\n  auto field = std::make_unique<FuncModuleField>(GetLocation());\n  Func& func = field->func;\n  SetFuncDeclaration(&func.decl, Var(sig_index, GetLocation()));\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnTableCount(Index count) {\n  WABT_TRY\n  module_->tables.reserve(module_->num_table_imports + count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginTable(Index index,\n                                  Type elem_type,\n                                  const Limits* elem_limits,\n                                  TableInitExprStatus) {\n  auto field = std::make_unique<TableModuleField>(GetLocation());\n  Table& table = field->table;\n  table.elem_limits = *elem_limits;\n  table.elem_type = elem_type;\n  module_->features_used.exceptions |= (elem_type == Type::ExnRef);\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginTableInitExpr(Index index) {\n  assert(index == module_->tables.size() - 1);\n  Table* table = module_->tables[index];\n  return BeginInitExpr(&table->init_expr);\n}\n\nResult BinaryReaderIR::EndTableInitExpr(Index index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderIR::OnMemoryCount(Index count) {\n  WABT_TRY\n  module_->memories.reserve(module_->num_memory_imports + count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnMemory(Index index,\n                                const Limits* page_limits,\n                                uint32_t page_size) {\n  auto field = std::make_unique<MemoryModuleField>(GetLocation());\n  Memory& memory = field->memory;\n  memory.page_limits = *page_limits;\n  memory.page_size = page_size;\n  if (memory.page_limits.is_shared) {\n    module_->features_used.threads = true;\n  }\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnGlobalCount(Index count) {\n  WABT_TRY\n  module_->globals.reserve(module_->num_global_imports + count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginGlobal(Index index, Type type, bool mutable_) {\n  auto field = std::make_unique<GlobalModuleField>(GetLocation());\n  Global& global = field->global;\n  global.type = type;\n  global.mutable_ = mutable_;\n  module_->AppendField(std::move(field));\n  module_->features_used.simd |= (type == Type::V128);\n  module_->features_used.exceptions |= (type == Type::ExnRef);\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginGlobalInitExpr(Index index) {\n  assert(index == module_->globals.size() - 1);\n  Global* global = module_->globals[index];\n  return BeginInitExpr(&global->init_expr);\n}\n\nResult BinaryReaderIR::EndGlobalInitExpr(Index index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderIR::OnExportCount(Index count) {\n  WABT_TRY\n  module_->exports.reserve(count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnExport(Index index,\n                                ExternalKind kind,\n                                Index item_index,\n                                std::string_view name) {\n  auto field = std::make_unique<ExportModuleField>(GetLocation());\n  Export& export_ = field->export_;\n  export_.name = name;\n  export_.var = Var(item_index, GetLocation());\n  export_.kind = kind;\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnStartFunction(Index func_index) {\n  Var start(func_index, GetLocation());\n  module_->AppendField(\n      std::make_unique<StartModuleField>(start, GetLocation()));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnFunctionBodyCount(Index count) {\n  // Can hit this case on a malformed module if we don't stop on first error.\n  if (module_->num_func_imports + count != module_->funcs.size()) {\n    PrintError(\n        \"number of imported func + func count in code section does not match \"\n        \"actual number of funcs in module\");\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginFunctionBody(Index index, Offset size) {\n  current_func_ = module_->funcs[index];\n  current_func_->loc = GetLocation();\n  return PushLabel(LabelType::Func, &current_func_->exprs);\n}\n\nResult BinaryReaderIR::OnLocalDecl(Index decl_index, Index count, Type type) {\n  current_func_->local_types.AppendDecl(type, count);\n\n  if (current_func_->GetNumLocals() > kMaxFunctionLocals) {\n    PrintError(\"function local count exceeds maximum value\");\n    return Result::Error;\n  }\n\n  module_->features_used.simd |= (type == Type::V128);\n  module_->features_used.exceptions |= (type == Type::ExnRef);\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnOpcode(Opcode opcode) {\n  std::unique_ptr<CodeMetadataExpr> metadata =\n      code_metadata_queue_.pop_match(current_func_, GetLocation().offset - 1);\n  if (metadata) {\n    return AppendExpr(std::move(metadata));\n  }\n  module_->features_used.simd |= (opcode.GetResultType() == Type::V128);\n  module_->features_used.threads |= (opcode.GetPrefix() == 0xfe);\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnAtomicLoadExpr(Opcode opcode,\n                                        Index memidx,\n                                        Address alignment_log2,\n                                        Address offset) {\n  return AppendExpr(std::make_unique<AtomicLoadExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnAtomicStoreExpr(Opcode opcode,\n                                         Index memidx,\n                                         Address alignment_log2,\n                                         Address offset) {\n  return AppendExpr(std::make_unique<AtomicStoreExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnAtomicRmwExpr(Opcode opcode,\n                                       Index memidx,\n                                       Address alignment_log2,\n                                       Address offset) {\n  return AppendExpr(std::make_unique<AtomicRmwExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnAtomicRmwCmpxchgExpr(Opcode opcode,\n                                              Index memidx,\n                                              Address alignment_log2,\n                                              Address offset) {\n  return AppendExpr(std::make_unique<AtomicRmwCmpxchgExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnAtomicWaitExpr(Opcode opcode,\n                                        Index memidx,\n                                        Address alignment_log2,\n                                        Address offset) {\n  return AppendExpr(std::make_unique<AtomicWaitExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnAtomicFenceExpr(uint32_t consistency_model) {\n  return AppendExpr(std::make_unique<AtomicFenceExpr>(consistency_model));\n}\n\nResult BinaryReaderIR::OnAtomicNotifyExpr(Opcode opcode,\n                                          Index memidx,\n                                          Address alignment_log2,\n                                          Address offset) {\n  return AppendExpr(std::make_unique<AtomicNotifyExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnBinaryExpr(Opcode opcode) {\n  return AppendExpr(std::make_unique<BinaryExpr>(opcode));\n}\n\nResult BinaryReaderIR::OnBlockExpr(Type sig_type) {\n  auto expr = std::make_unique<BlockExpr>();\n  SetBlockDeclaration(&expr->block.decl, sig_type);\n  ExprList* expr_list = &expr->block.exprs;\n  CHECK_RESULT(AppendExpr(std::move(expr)));\n  return PushLabel(LabelType::Block, expr_list);\n}\n\nResult BinaryReaderIR::OnBrExpr(Index depth) {\n  return AppendExpr(std::make_unique<BrExpr>(Var(depth, GetLocation())));\n}\n\nResult BinaryReaderIR::OnBrIfExpr(Index depth) {\n  return AppendExpr(std::make_unique<BrIfExpr>(Var(depth, GetLocation())));\n}\n\nResult BinaryReaderIR::OnBrOnNonNullExpr(Index depth) {\n  return AppendExpr(\n      std::make_unique<BrOnNonNullExpr>(Var(depth, GetLocation())));\n}\n\nResult BinaryReaderIR::OnBrOnNullExpr(Index depth) {\n  return AppendExpr(std::make_unique<BrOnNullExpr>(Var(depth, GetLocation())));\n}\n\nResult BinaryReaderIR::OnBrTableExpr(Index num_targets,\n                                     Index* target_depths,\n                                     Index default_target_depth) {\n  auto expr = std::make_unique<BrTableExpr>();\n  expr->default_target = Var(default_target_depth, GetLocation());\n  expr->targets.resize(num_targets);\n  for (Index i = 0; i < num_targets; ++i) {\n    expr->targets[i] = Var(target_depths[i], GetLocation());\n  }\n  return AppendExpr(std::move(expr));\n}\n\nResult BinaryReaderIR::OnCallExpr(Index func_index) {\n  return AppendExpr(std::make_unique<CallExpr>(Var(func_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnCallIndirectExpr(Index sig_index, Index table_index) {\n  auto expr = std::make_unique<CallIndirectExpr>();\n  SetFuncDeclaration(&expr->decl, Var(sig_index, GetLocation()));\n  expr->table = Var(table_index, GetLocation());\n  return AppendExpr(std::move(expr));\n}\n\nResult BinaryReaderIR::OnCallRefExpr(Type sig_type) {\n  auto expr = std::make_unique<CallRefExpr>();\n  expr->sig_type = Var(sig_type, GetLocation());\n  return AppendExpr(std::move(expr));\n}\n\nResult BinaryReaderIR::OnReturnCallExpr(Index func_index) {\n  if (current_func_) {\n    // syntactically, a return_call expr can occur in an init expression\n    // (outside a function)\n    current_func_->features_used.tailcall = true;\n  }\n  return AppendExpr(\n      std::make_unique<ReturnCallExpr>(Var(func_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnReturnCallIndirectExpr(Index sig_index,\n                                                Index table_index) {\n  if (current_func_) {\n    // syntactically, a return_call_indirect expr can occur in an init\n    // expression (outside a function)\n    current_func_->features_used.tailcall = true;\n  }\n  auto expr = std::make_unique<ReturnCallIndirectExpr>();\n  SetFuncDeclaration(&expr->decl, Var(sig_index, GetLocation()));\n  expr->table = Var(table_index, GetLocation());\n  FuncType* type = module_->GetFuncType(Var(sig_index, GetLocation()));\n  if (type) {\n    type->features_used.tailcall = true;\n  }\n  return AppendExpr(std::move(expr));\n}\n\nResult BinaryReaderIR::OnReturnCallRefExpr(Type sig_type) {\n  auto expr = std::make_unique<ReturnCallRefExpr>();\n  expr->sig_type = Var(sig_type, GetLocation());\n  return AppendExpr(std::move(expr));\n}\n\nResult BinaryReaderIR::OnCompareExpr(Opcode opcode) {\n  return AppendExpr(std::make_unique<CompareExpr>(opcode));\n}\n\nResult BinaryReaderIR::OnConvertExpr(Opcode opcode) {\n  return AppendExpr(std::make_unique<ConvertExpr>(opcode));\n}\n\nResult BinaryReaderIR::OnDropExpr() {\n  return AppendExpr(std::make_unique<DropExpr>());\n}\n\nResult BinaryReaderIR::OnElseExpr() {\n  LabelNode* label;\n  Expr* expr;\n  CHECK_RESULT(TopLabelExpr(&label, &expr));\n\n  if (label->label_type == LabelType::If) {\n    auto* if_expr = cast<IfExpr>(expr);\n    if_expr->true_.end_loc = GetLocation();\n    label->exprs = &if_expr->false_;\n    label->label_type = LabelType::Else;\n  } else {\n    PrintError(\"else expression without matching if\");\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnEndExpr() {\n  if (label_stack_.size() > 1) {\n    LabelNode* label;\n    Expr* expr;\n    CHECK_RESULT(TopLabelExpr(&label, &expr));\n    switch (label->label_type) {\n      case LabelType::Block:\n        cast<BlockExpr>(expr)->block.end_loc = GetLocation();\n        break;\n      case LabelType::Loop:\n        cast<LoopExpr>(expr)->block.end_loc = GetLocation();\n        break;\n      case LabelType::If:\n        cast<IfExpr>(expr)->true_.end_loc = GetLocation();\n        break;\n      case LabelType::Else:\n        cast<IfExpr>(expr)->false_end_loc = GetLocation();\n        break;\n      case LabelType::Try:\n        cast<TryExpr>(expr)->block.end_loc = GetLocation();\n        break;\n      case LabelType::TryTable:\n        cast<TryTableExpr>(expr)->block.end_loc = GetLocation();\n        break;\n\n      case LabelType::InitExpr:\n      case LabelType::Func:\n      case LabelType::Catch:\n        break;\n    }\n  }\n\n  return PopLabel();\n}\n\nResult BinaryReaderIR::OnF32ConstExpr(uint32_t value_bits) {\n  return AppendExpr(\n      std::make_unique<ConstExpr>(Const::F32(value_bits, GetLocation())));\n}\n\nResult BinaryReaderIR::OnF64ConstExpr(uint64_t value_bits) {\n  return AppendExpr(\n      std::make_unique<ConstExpr>(Const::F64(value_bits, GetLocation())));\n}\n\nResult BinaryReaderIR::OnV128ConstExpr(v128 value_bits) {\n  return AppendExpr(\n      std::make_unique<ConstExpr>(Const::V128(value_bits, GetLocation())));\n}\n\nResult BinaryReaderIR::OnGlobalGetExpr(Index global_index) {\n  return AppendExpr(\n      std::make_unique<GlobalGetExpr>(Var(global_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnLocalGetExpr(Index local_index) {\n  return AppendExpr(\n      std::make_unique<LocalGetExpr>(Var(local_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnI32ConstExpr(uint32_t value) {\n  return AppendExpr(\n      std::make_unique<ConstExpr>(Const::I32(value, GetLocation())));\n}\n\nResult BinaryReaderIR::OnI64ConstExpr(uint64_t value) {\n  return AppendExpr(\n      std::make_unique<ConstExpr>(Const::I64(value, GetLocation())));\n}\n\nResult BinaryReaderIR::OnIfExpr(Type sig_type) {\n  auto expr = std::make_unique<IfExpr>();\n  SetBlockDeclaration(&expr->true_.decl, sig_type);\n  ExprList* expr_list = &expr->true_.exprs;\n  CHECK_RESULT(AppendExpr(std::move(expr)));\n  return PushLabel(LabelType::If, expr_list);\n}\n\nResult BinaryReaderIR::OnLoadExpr(Opcode opcode,\n                                  Index memidx,\n                                  Address alignment_log2,\n                                  Address offset) {\n  return AppendExpr(std::make_unique<LoadExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnLoopExpr(Type sig_type) {\n  auto expr = std::make_unique<LoopExpr>();\n  SetBlockDeclaration(&expr->block.decl, sig_type);\n  ExprList* expr_list = &expr->block.exprs;\n  CHECK_RESULT(AppendExpr(std::move(expr)));\n  return PushLabel(LabelType::Loop, expr_list);\n}\n\nResult BinaryReaderIR::OnMemoryCopyExpr(Index destmemidx, Index srcmemidx) {\n  return AppendExpr(std::make_unique<MemoryCopyExpr>(\n      Var(destmemidx, GetLocation()), Var(srcmemidx, GetLocation())));\n}\n\nResult BinaryReaderIR::OnDataDropExpr(Index segment) {\n  return AppendExpr(\n      std::make_unique<DataDropExpr>(Var(segment, GetLocation())));\n}\n\nResult BinaryReaderIR::OnMemoryFillExpr(Index memidx) {\n  return AppendExpr(\n      std::make_unique<MemoryFillExpr>(Var(memidx, GetLocation())));\n}\n\nResult BinaryReaderIR::OnMemoryGrowExpr(Index memidx) {\n  return AppendExpr(\n      std::make_unique<MemoryGrowExpr>(Var(memidx, GetLocation())));\n}\n\nResult BinaryReaderIR::OnMemoryInitExpr(Index segment, Index memidx) {\n  return AppendExpr(std::make_unique<MemoryInitExpr>(\n      Var(segment, GetLocation()), Var(memidx, GetLocation())));\n}\n\nResult BinaryReaderIR::OnMemorySizeExpr(Index memidx) {\n  return AppendExpr(\n      std::make_unique<MemorySizeExpr>(Var(memidx, GetLocation())));\n}\n\nResult BinaryReaderIR::OnTableCopyExpr(Index dst_index, Index src_index) {\n  return AppendExpr(std::make_unique<TableCopyExpr>(\n      Var(dst_index, GetLocation()), Var(src_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnElemDropExpr(Index segment) {\n  return AppendExpr(\n      std::make_unique<ElemDropExpr>(Var(segment, GetLocation())));\n}\n\nResult BinaryReaderIR::OnTableInitExpr(Index segment, Index table_index) {\n  return AppendExpr(std::make_unique<TableInitExpr>(\n      Var(segment, GetLocation()), Var(table_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnTableGetExpr(Index table_index) {\n  return AppendExpr(\n      std::make_unique<TableGetExpr>(Var(table_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnTableSetExpr(Index table_index) {\n  return AppendExpr(\n      std::make_unique<TableSetExpr>(Var(table_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnTableGrowExpr(Index table_index) {\n  return AppendExpr(\n      std::make_unique<TableGrowExpr>(Var(table_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnTableSizeExpr(Index table_index) {\n  return AppendExpr(\n      std::make_unique<TableSizeExpr>(Var(table_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnTableFillExpr(Index table_index) {\n  return AppendExpr(\n      std::make_unique<TableFillExpr>(Var(table_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnRefAsNonNullExpr() {\n  return AppendExpr(\n      std::make_unique<RefAsNonNullExpr>(Opcode::RefAsNonNull, GetLocation()));\n}\n\nResult BinaryReaderIR::OnRefFuncExpr(Index func_index) {\n  module_->used_func_refs.insert(func_index);\n  return AppendExpr(\n      std::make_unique<RefFuncExpr>(Var(func_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnRefNullExpr(Type type) {\n  module_->features_used.exceptions |= (type == Type::ExnRef);\n  return AppendExpr(std::make_unique<RefNullExpr>(Var(type, GetLocation())));\n}\n\nResult BinaryReaderIR::OnRefIsNullExpr() {\n  return AppendExpr(std::make_unique<RefIsNullExpr>());\n}\n\nResult BinaryReaderIR::OnNopExpr() {\n  return AppendExpr(std::make_unique<NopExpr>());\n}\n\nResult BinaryReaderIR::OnRethrowExpr(Index depth) {\n  return AppendExpr(std::make_unique<RethrowExpr>(Var(depth, GetLocation())));\n}\n\nResult BinaryReaderIR::OnReturnExpr() {\n  return AppendExpr(std::make_unique<ReturnExpr>());\n}\n\nResult BinaryReaderIR::OnSelectExpr(Index result_count, Type* result_types) {\n  auto expr_ptr = std::make_unique<SelectExpr>();\n  expr_ptr->result_type.assign(result_types, result_types + result_count);\n  return AppendExpr(std::move(expr_ptr));\n}\n\nResult BinaryReaderIR::OnGlobalSetExpr(Index global_index) {\n  return AppendExpr(\n      std::make_unique<GlobalSetExpr>(Var(global_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnLocalSetExpr(Index local_index) {\n  return AppendExpr(\n      std::make_unique<LocalSetExpr>(Var(local_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnStoreExpr(Opcode opcode,\n                                   Index memidx,\n                                   Address alignment_log2,\n                                   Address offset) {\n  return AppendExpr(std::make_unique<StoreExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnThrowExpr(Index tag_index) {\n  module_->features_used.exceptions = true;\n  return AppendExpr(std::make_unique<ThrowExpr>(Var(tag_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnThrowRefExpr() {\n  module_->features_used.exceptions = true;\n  return AppendExpr(std::make_unique<ThrowRefExpr>());\n}\n\nResult BinaryReaderIR::OnLocalTeeExpr(Index local_index) {\n  return AppendExpr(\n      std::make_unique<LocalTeeExpr>(Var(local_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnTryExpr(Type sig_type) {\n  auto expr_ptr = std::make_unique<TryExpr>();\n  // Save expr so it can be used below, after expr_ptr has been moved.\n  TryExpr* expr = expr_ptr.get();\n  ExprList* expr_list = &expr->block.exprs;\n  SetBlockDeclaration(&expr->block.decl, sig_type);\n  CHECK_RESULT(AppendExpr(std::move(expr_ptr)));\n  module_->features_used.exceptions = true;\n  return PushLabel(LabelType::Try, expr_list, expr);\n}\n\nResult BinaryReaderIR::AppendCatch(Catch&& catch_) {\n  LabelNode* label = nullptr;\n  CHECK_RESULT(TopLabel(&label));\n\n  if (label->label_type != LabelType::Try) {\n    PrintError(\"catch not inside try block\");\n    return Result::Error;\n  }\n\n  auto* try_ = cast<TryExpr>(label->context);\n\n  if (catch_.IsCatchAll() && !try_->catches.empty() &&\n      try_->catches.back().IsCatchAll()) {\n    PrintError(\"only one catch_all allowed in try block\");\n    return Result::Error;\n  }\n\n  if (try_->kind == TryKind::Plain) {\n    try_->kind = TryKind::Catch;\n  } else if (try_->kind != TryKind::Catch) {\n    PrintError(\"catch not allowed in try-delegate\");\n    return Result::Error;\n  }\n\n  try_->catches.push_back(std::move(catch_));\n  label->exprs = &try_->catches.back().exprs;\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnCatchExpr(Index except_index) {\n  return AppendCatch(Catch(Var(except_index, GetLocation())));\n}\n\nResult BinaryReaderIR::OnCatchAllExpr() {\n  return AppendCatch(Catch(GetLocation()));\n}\n\nResult BinaryReaderIR::OnTryTableExpr(Type sig_type,\n                                      const CatchClauseVector& catches) {\n  auto expr_ptr = std::make_unique<TryTableExpr>();\n  TryTableExpr* expr = expr_ptr.get();\n  expr->catches.reserve(catches.size());\n  SetBlockDeclaration(&expr->block.decl, sig_type);\n  ExprList* expr_list = &expr->block.exprs;\n\n  for (auto& raw_catch : catches) {\n    TableCatch catch_;\n    catch_.kind = raw_catch.kind;\n    catch_.tag = Var(raw_catch.tag, GetLocation());\n    catch_.target = Var(raw_catch.depth, GetLocation());\n    expr->catches.push_back(std::move(catch_));\n  }\n\n  CHECK_RESULT(AppendExpr(std::move(expr_ptr)));\n  module_->features_used.exceptions = true;\n  return PushLabel(LabelType::TryTable, expr_list, expr);\n}\n\nResult BinaryReaderIR::OnDelegateExpr(Index depth) {\n  LabelNode* label = nullptr;\n  CHECK_RESULT(TopLabel(&label));\n\n  if (label->label_type != LabelType::Try) {\n    PrintError(\"delegate not inside try block\");\n    return Result::Error;\n  }\n\n  auto* try_ = cast<TryExpr>(label->context);\n\n  if (try_->kind == TryKind::Plain) {\n    try_->kind = TryKind::Delegate;\n  } else if (try_->kind != TryKind::Delegate) {\n    PrintError(\"delegate not allowed in try-catch\");\n    return Result::Error;\n  }\n\n  try_->delegate_target = Var(depth, GetLocation());\n\n  PopLabel();\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnUnaryExpr(Opcode opcode) {\n  return AppendExpr(std::make_unique<UnaryExpr>(opcode));\n}\n\nResult BinaryReaderIR::OnTernaryExpr(Opcode opcode) {\n  return AppendExpr(std::make_unique<TernaryExpr>(opcode));\n}\n\nResult BinaryReaderIR::OnQuaternaryExpr(Opcode opcode) {\n  return AppendExpr(std::make_unique<QuaternaryExpr>(opcode));\n}\n\nResult BinaryReaderIR::OnUnreachableExpr() {\n  return AppendExpr(std::make_unique<UnreachableExpr>());\n}\n\nResult BinaryReaderIR::EndFunctionBody(Index index) {\n  current_func_ = nullptr;\n  if (!label_stack_.empty()) {\n    PrintError(\"function %\" PRIindex \" missing end marker\", index);\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnSimdLaneOpExpr(Opcode opcode, uint64_t value) {\n  return AppendExpr(std::make_unique<SimdLaneOpExpr>(opcode, value));\n}\n\nResult BinaryReaderIR::OnSimdLoadLaneExpr(Opcode opcode,\n                                          Index memidx,\n                                          Address alignment_log2,\n                                          Address offset,\n                                          uint64_t value) {\n  return AppendExpr(std::make_unique<SimdLoadLaneExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset,\n      value));\n}\n\nResult BinaryReaderIR::OnSimdStoreLaneExpr(Opcode opcode,\n                                           Index memidx,\n                                           Address alignment_log2,\n                                           Address offset,\n                                           uint64_t value) {\n  return AppendExpr(std::make_unique<SimdStoreLaneExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset,\n      value));\n}\n\nResult BinaryReaderIR::OnSimdShuffleOpExpr(Opcode opcode, v128 value) {\n  return AppendExpr(std::make_unique<SimdShuffleOpExpr>(opcode, value));\n}\n\nResult BinaryReaderIR::OnLoadSplatExpr(Opcode opcode,\n                                       Index memidx,\n                                       Address alignment_log2,\n                                       Address offset) {\n  return AppendExpr(std::make_unique<LoadSplatExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnLoadZeroExpr(Opcode opcode,\n                                      Index memidx,\n                                      Address alignment_log2,\n                                      Address offset) {\n  return AppendExpr(std::make_unique<LoadZeroExpr>(\n      opcode, Var(memidx, GetLocation()), 1ull << alignment_log2, offset));\n}\n\nResult BinaryReaderIR::OnElemSegmentCount(Index count) {\n  WABT_TRY\n  module_->elem_segments.reserve(count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginElemSegment(Index index,\n                                        Index table_index,\n                                        uint8_t flags) {\n  auto field = std::make_unique<ElemSegmentModuleField>(GetLocation());\n  ElemSegment& elem_segment = field->elem_segment;\n  elem_segment.table_var = Var(table_index, GetLocation());\n  if ((flags & SegDeclared) == SegDeclared) {\n    elem_segment.kind = SegmentKind::Declared;\n  } else if ((flags & SegPassive) == SegPassive) {\n    elem_segment.kind = SegmentKind::Passive;\n  } else {\n    elem_segment.kind = SegmentKind::Active;\n  }\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginInitExpr(ExprList* expr) {\n  return PushLabel(LabelType::InitExpr, expr);\n}\n\nResult BinaryReaderIR::BeginElemSegmentInitExpr(Index index) {\n  assert(index == module_->elem_segments.size() - 1);\n  ElemSegment* segment = module_->elem_segments[index];\n  return BeginInitExpr(&segment->offset);\n}\n\nResult BinaryReaderIR::EndInitExpr() {\n  if (!label_stack_.empty()) {\n    PrintError(\"init expression missing end marker\");\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::EndElemSegmentInitExpr(Index index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderIR::OnElemSegmentElemType(Index index, Type elem_type) {\n  assert(index == module_->elem_segments.size() - 1);\n  ElemSegment* segment = module_->elem_segments[index];\n  segment->elem_type = elem_type;\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnElemSegmentElemExprCount(Index index, Index count) {\n  assert(index == module_->elem_segments.size() - 1);\n  ElemSegment* segment = module_->elem_segments[index];\n  WABT_TRY\n  segment->elem_exprs.reserve(count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginElemExpr(Index elem_index, Index expr_index) {\n  assert(elem_index == module_->elem_segments.size() - 1);\n  ElemSegment* segment = module_->elem_segments[elem_index];\n  assert(expr_index == segment->elem_exprs.size());\n  segment->elem_exprs.emplace_back();\n  return BeginInitExpr(&segment->elem_exprs.back());\n}\n\nResult BinaryReaderIR::EndElemExpr(Index elem_index, Index expr_index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderIR::OnDataSegmentCount(Index count) {\n  WABT_TRY\n  module_->data_segments.reserve(count);\n  WABT_CATCH_BAD_ALLOC\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginDataSegment(Index index,\n                                        Index memory_index,\n                                        uint8_t flags) {\n  auto field = std::make_unique<DataSegmentModuleField>(GetLocation());\n  DataSegment& data_segment = field->data_segment;\n  data_segment.memory_var = Var(memory_index, GetLocation());\n  if ((flags & SegPassive) == SegPassive) {\n    data_segment.kind = SegmentKind::Passive;\n  } else {\n    data_segment.kind = SegmentKind::Active;\n  }\n  module_->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginDataSegmentInitExpr(Index index) {\n  assert(index == module_->data_segments.size() - 1);\n  DataSegment* segment = module_->data_segments[index];\n  return BeginInitExpr(&segment->offset);\n}\n\nResult BinaryReaderIR::EndDataSegmentInitExpr(Index index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderIR::OnDataSegmentData(Index index,\n                                         const void* data,\n                                         Address size) {\n  assert(index == module_->data_segments.size() - 1);\n  DataSegment* segment = module_->data_segments[index];\n  segment->data.resize(size);\n  if (size > 0) {\n    memcpy(segment->data.data(), data, size);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnFunctionNamesCount(Index count) {\n  if (count > module_->funcs.size()) {\n    PrintError(\"expected function name count (%\" PRIindex\n               \") <= function count (%\" PRIzd \")\",\n               count, module_->funcs.size());\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nstatic std::string MakeDollarName(std::string_view name) {\n  return std::string(\"$\") + std::string(name);\n}\n\nResult BinaryReaderIR::OnModuleName(std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n\n  module_->name = MakeDollarName(name);\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::SetGlobalName(Index index, std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (index >= module_->globals.size()) {\n    PrintError(\"invalid global index: %\" PRIindex, index);\n    return Result::Error;\n  }\n  Global* glob = module_->globals[index];\n  std::string dollar_name =\n      GetUniqueName(&module_->global_bindings, MakeDollarName(name));\n  glob->name = dollar_name;\n  module_->global_bindings.emplace(dollar_name, Binding(index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::SetFunctionName(Index index, std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (index >= module_->funcs.size()) {\n    PrintError(\"invalid function index: %\" PRIindex, index);\n    return Result::Error;\n  }\n  Func* func = module_->funcs[index];\n  std::string dollar_name =\n      GetUniqueName(&module_->func_bindings, MakeDollarName(name));\n  func->name = dollar_name;\n  module_->func_bindings.emplace(dollar_name, Binding(index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::SetTypeName(Index index, std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (index >= module_->types.size()) {\n    PrintError(\"invalid type index: %\" PRIindex, index);\n    return Result::Error;\n  }\n  TypeEntry* type = module_->types[index];\n  std::string dollar_name =\n      GetUniqueName(&module_->type_bindings, MakeDollarName(name));\n  type->name = dollar_name;\n  module_->type_bindings.emplace(dollar_name, Binding(index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::SetTableName(Index index, std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (index >= module_->tables.size()) {\n    PrintError(\"invalid table index: %\" PRIindex, index);\n    return Result::Error;\n  }\n  Table* table = module_->tables[index];\n  std::string dollar_name =\n      GetUniqueName(&module_->table_bindings, MakeDollarName(name));\n  table->name = dollar_name;\n  module_->table_bindings.emplace(dollar_name, Binding(index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::SetDataSegmentName(Index index, std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (index >= module_->data_segments.size()) {\n    PrintError(\"invalid data segment index: %\" PRIindex, index);\n    return Result::Error;\n  }\n  DataSegment* segment = module_->data_segments[index];\n  std::string dollar_name =\n      GetUniqueName(&module_->data_segment_bindings, MakeDollarName(name));\n  segment->name = dollar_name;\n  module_->data_segment_bindings.emplace(dollar_name, Binding(index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::SetElemSegmentName(Index index, std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (index >= module_->elem_segments.size()) {\n    PrintError(\"invalid elem segment index: %\" PRIindex, index);\n    return Result::Error;\n  }\n  ElemSegment* segment = module_->elem_segments[index];\n  std::string dollar_name =\n      GetUniqueName(&module_->elem_segment_bindings, MakeDollarName(name));\n  segment->name = dollar_name;\n  module_->elem_segment_bindings.emplace(dollar_name, Binding(index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::SetMemoryName(Index index, std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (index >= module_->memories.size()) {\n    PrintError(\"invalid memory index: %\" PRIindex, index);\n    return Result::Error;\n  }\n  Memory* memory = module_->memories[index];\n  std::string dollar_name =\n      GetUniqueName(&module_->memory_bindings, MakeDollarName(name));\n  memory->name = dollar_name;\n  module_->memory_bindings.emplace(dollar_name, Binding(index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::SetTagName(Index index, std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (index >= module_->tags.size()) {\n    PrintError(\"invalid tag index: %\" PRIindex, index);\n    return Result::Error;\n  }\n  Tag* tag = module_->tags[index];\n  std::string dollar_name =\n      GetUniqueName(&module_->tag_bindings, MakeDollarName(name));\n  tag->name = dollar_name;\n  module_->tag_bindings.emplace(dollar_name, Binding(index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnFunctionName(Index index, std::string_view name) {\n  return SetFunctionName(index, name);\n}\n\nResult BinaryReaderIR::OnNameEntry(NameSectionSubsection type,\n                                   Index index,\n                                   std::string_view name) {\n  switch (type) {\n    // TODO(sbc): remove OnFunctionName in favor of just using\n    // OnNameEntry so that this works\n    case NameSectionSubsection::Function:\n    case NameSectionSubsection::Local:\n    case NameSectionSubsection::Module:\n    case NameSectionSubsection::Label:\n    case NameSectionSubsection::Field:\n      break;\n    case NameSectionSubsection::Type:\n      SetTypeName(index, name);\n      break;\n    case NameSectionSubsection::Tag:\n      SetTagName(index, name);\n      break;\n    case NameSectionSubsection::Global:\n      SetGlobalName(index, name);\n      break;\n    case NameSectionSubsection::Table:\n      SetTableName(index, name);\n      break;\n    case NameSectionSubsection::DataSegment:\n      SetDataSegmentName(index, name);\n      break;\n    case NameSectionSubsection::Memory:\n      SetMemoryName(index, name);\n      break;\n    case NameSectionSubsection::ElemSegment:\n      SetElemSegmentName(index, name);\n      break;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnLocalNameLocalCount(Index index, Index count) {\n  assert(index < module_->funcs.size());\n  Func* func = module_->funcs[index];\n  Index num_params_and_locals = func->GetNumParamsAndLocals();\n  if (count > num_params_and_locals) {\n    PrintError(\"expected local name count (%\" PRIindex\n               \") <= local count (%\" PRIindex \")\",\n               count, num_params_and_locals);\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::BeginCodeMetadataSection(std::string_view name,\n                                                Offset size) {\n  current_metadata_name_ = name;\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnCodeMetadataFuncCount(Index count) {\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnCodeMetadataCount(Index function_index, Index count) {\n  if (function_index < module_->funcs.size()) {\n    code_metadata_queue_.push_func(module_->funcs[function_index]);\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult BinaryReaderIR::OnCodeMetadata(Offset offset,\n                                      const void* data,\n                                      Address size) {\n  std::vector<uint8_t> data_(static_cast<const uint8_t*>(data),\n                             static_cast<const uint8_t*>(data) + size);\n  auto meta = std::make_unique<CodeMetadataExpr>(current_metadata_name_,\n                                                 std::move(data_));\n  meta->loc.offset = offset;\n  code_metadata_queue_.push_metadata(std::move(meta));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnLocalName(Index func_index,\n                                   Index local_index,\n                                   std::string_view name) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n\n  Func* func = module_->funcs[func_index];\n  func->bindings.emplace(GetUniqueName(&func->bindings, MakeDollarName(name)),\n                         Binding(local_index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnTagType(Index index, Index sig_index) {\n  auto field = std::make_unique<TagModuleField>(GetLocation());\n  Tag& tag = field->tag;\n  SetFuncDeclaration(&tag.decl, Var(sig_index, GetLocation()));\n  module_->AppendField(std::move(field));\n  module_->features_used.exceptions = true;\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnDataSymbol(Index index,\n                                    uint32_t flags,\n                                    std::string_view name,\n                                    Index segment,\n                                    uint32_t offset,\n                                    uint32_t size) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (flags & WABT_SYMBOL_FLAG_UNDEFINED) {\n    // Refers to data in another file, `segment` not valid.\n    return Result::Ok;\n  }\n  if (offset) {\n    // If it is pointing into the data segment, then it's not really naming\n    // the whole segment.\n    return Result::Ok;\n  }\n  if (segment >= module_->data_segments.size()) {\n    PrintError(\"invalid data segment index: %\" PRIindex, segment);\n    return Result::Error;\n  }\n  DataSegment* seg = module_->data_segments[segment];\n  std::string dollar_name =\n      GetUniqueName(&module_->data_segment_bindings, MakeDollarName(name));\n  seg->name = dollar_name;\n  module_->data_segment_bindings.emplace(dollar_name, Binding(segment));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnFunctionSymbol(Index index,\n                                        uint32_t flags,\n                                        std::string_view name,\n                                        Index func_index) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (func_index >= module_->funcs.size()) {\n    PrintError(\"invalid function index: %\" PRIindex, func_index);\n    return Result::Error;\n  }\n  Func* func = module_->funcs[func_index];\n  if (!func->name.empty()) {\n    // The name section has already named this function.\n    return Result::Ok;\n  }\n  std::string dollar_name =\n      GetUniqueName(&module_->func_bindings, MakeDollarName(name));\n  func->name = dollar_name;\n  module_->func_bindings.emplace(dollar_name, Binding(func_index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnGlobalSymbol(Index index,\n                                      uint32_t flags,\n                                      std::string_view name,\n                                      Index global_index) {\n  return SetGlobalName(global_index, name);\n}\n\nResult BinaryReaderIR::OnSectionSymbol(Index index,\n                                       uint32_t flags,\n                                       Index section_index) {\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnTagSymbol(Index index,\n                                   uint32_t flags,\n                                   std::string_view name,\n                                   Index tag_index) {\n  if (name.empty()) {\n    return Result::Ok;\n  }\n  if (tag_index >= module_->tags.size()) {\n    PrintError(\"invalid tag index: %\" PRIindex, tag_index);\n    return Result::Error;\n  }\n  Tag* tag = module_->tags[tag_index];\n  std::string dollar_name =\n      GetUniqueName(&module_->tag_bindings, MakeDollarName(name));\n  tag->name = dollar_name;\n  module_->tag_bindings.emplace(dollar_name, Binding(tag_index));\n  return Result::Ok;\n}\n\nResult BinaryReaderIR::OnTableSymbol(Index index,\n                                     uint32_t flags,\n                                     std::string_view name,\n                                     Index table_index) {\n  return SetTableName(table_index, name);\n}\n\nResult BinaryReaderIR::OnGenericCustomSection(std::string_view name,\n                                              const void* data,\n                                              Offset size) {\n  Custom custom = Custom(GetLocation(), name);\n  custom.data.resize(size);\n  if (size > 0) {\n    memcpy(custom.data.data(), data, size);\n  }\n  module_->customs.push_back(std::move(custom));\n  return Result::Ok;\n}\n\n}  // end anonymous namespace\n\nResult ReadBinaryIr(const char* filename,\n                    const void* data,\n                    size_t size,\n                    const ReadBinaryOptions& options,\n                    Errors* errors,\n                    Module* out_module) {\n  BinaryReaderIR reader(out_module, filename, errors);\n  return ReadBinary(data, size, &reader, options);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binary-reader-logging.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binary-reader-logging.h\"\n\n#include <cinttypes>\n\n#include \"wabt/stream.h\"\n\nnamespace wabt {\n\n#define INDENT_SIZE 2\n\n#define LOGF_NOINDENT(...) stream_->Writef(__VA_ARGS__)\n\n#define LOGF(...)               \\\n  do {                          \\\n    WriteIndent();              \\\n    LOGF_NOINDENT(__VA_ARGS__); \\\n  } while (0)\n\nnamespace {\n\nvoid SPrintLimits(char* dst, size_t size, const Limits* limits) {\n  int result;\n  if (limits->has_max) {\n    result = wabt_snprintf(dst, size, \"initial: %\" PRIu64 \", max: %\" PRIu64,\n                           limits->initial, limits->max);\n  } else {\n    result = wabt_snprintf(dst, size, \"initial: %\" PRIu64, limits->initial);\n  }\n  WABT_USE(result);\n  assert(static_cast<size_t>(result) < size);\n}\n\n}  // end anonymous namespace\n\nBinaryReaderLogging::BinaryReaderLogging(Stream* stream,\n                                         BinaryReaderDelegate* forward)\n    : stream_(stream), reader_(forward), indent_(0) {}\n\nvoid BinaryReaderLogging::Indent() {\n  indent_ += INDENT_SIZE;\n}\n\nvoid BinaryReaderLogging::Dedent() {\n  indent_ -= INDENT_SIZE;\n  assert(indent_ >= 0);\n}\n\nvoid BinaryReaderLogging::WriteIndent() {\n  static char s_indent[] =\n      \"                                                                       \"\n      \"                                                                       \";\n  static const size_t s_indent_len = sizeof(s_indent) - 1;\n  size_t i = indent_;\n  while (i > s_indent_len) {\n    stream_->WriteData(s_indent, s_indent_len);\n    i -= s_indent_len;\n  }\n  if (i > 0) {\n    stream_->WriteData(s_indent, indent_);\n  }\n}\n\nvoid BinaryReaderLogging::LogType(Type type) {\n  if (type.IsIndex()) {\n    LOGF_NOINDENT(\"typeidx[%d]\", type.GetIndex());\n  } else {\n    LOGF_NOINDENT(\"%s\", type.GetName().c_str());\n  }\n}\n\nvoid BinaryReaderLogging::LogTypes(Index type_count, Type* types) {\n  LOGF_NOINDENT(\"[\");\n  for (Index i = 0; i < type_count; ++i) {\n    LogType(types[i]);\n    if (i != type_count - 1) {\n      LOGF_NOINDENT(\", \");\n    }\n  }\n  LOGF_NOINDENT(\"]\");\n}\n\nvoid BinaryReaderLogging::LogTypes(TypeVector& types) {\n  LogTypes(types.size(), types.data());\n}\n\nvoid BinaryReaderLogging::LogField(TypeMut field) {\n  if (field.mutable_) {\n    LOGF_NOINDENT(\"(mut \");\n  }\n  LogType(field.type);\n  if (field.mutable_) {\n    LOGF_NOINDENT(\")\");\n  }\n}\n\nbool BinaryReaderLogging::OnError(const Error& error) {\n  return reader_->OnError(error);\n}\n\nvoid BinaryReaderLogging::OnSetState(const State* s) {\n  BinaryReaderDelegate::OnSetState(s);\n  reader_->OnSetState(s);\n}\n\nResult BinaryReaderLogging::BeginModule(uint32_t version) {\n  LOGF(\"BeginModule(version: %u)\\n\", version);\n  Indent();\n  return reader_->BeginModule(version);\n}\n\nResult BinaryReaderLogging::BeginSection(Index section_index,\n                                         BinarySection section_type,\n                                         Offset size) {\n  return reader_->BeginSection(section_index, section_type, size);\n}\n\nResult BinaryReaderLogging::BeginCustomSection(Index section_index,\n                                               Offset size,\n                                               std::string_view section_name) {\n  LOGF(\"BeginCustomSection('\" PRIstringview \"', size: %\" PRIzd \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(section_name), size);\n  Indent();\n  return reader_->BeginCustomSection(section_index, size, section_name);\n}\n\nResult BinaryReaderLogging::OnFuncType(Index index,\n                                       Index param_count,\n                                       Type* param_types,\n                                       Index result_count,\n                                       Type* result_types) {\n  LOGF(\"OnFuncType(index: %\" PRIindex \", params: \", index);\n  LogTypes(param_count, param_types);\n  LOGF_NOINDENT(\", results: \");\n  LogTypes(result_count, result_types);\n  LOGF_NOINDENT(\")\\n\");\n  return reader_->OnFuncType(index, param_count, param_types, result_count,\n                             result_types);\n}\n\nResult BinaryReaderLogging::OnStructType(Index index,\n                                         Index field_count,\n                                         TypeMut* fields) {\n  LOGF(\"OnStructType(index: %\" PRIindex \", fields: \", index);\n  LOGF_NOINDENT(\"[\");\n  for (Index i = 0; i < field_count; ++i) {\n    LogField(fields[i]);\n    if (i != field_count - 1) {\n      LOGF_NOINDENT(\", \");\n    }\n  }\n  LOGF_NOINDENT(\"])\\n\");\n  return reader_->OnStructType(index, field_count, fields);\n}\n\nResult BinaryReaderLogging::OnArrayType(Index index, TypeMut field) {\n  LOGF(\"OnArrayType(index: %\" PRIindex \", field: \", index);\n  LogField(field);\n  LOGF_NOINDENT(\")\\n\");\n  return reader_->OnArrayType(index, field);\n}\n\nResult BinaryReaderLogging::OnImport(Index index,\n                                     ExternalKind kind,\n                                     std::string_view module_name,\n                                     std::string_view field_name) {\n  LOGF(\"OnImport(index: %\" PRIindex \", kind: %s, module: \\\"\" PRIstringview\n       \"\\\", field: \\\"\" PRIstringview \"\\\")\\n\",\n       index, GetKindName(kind), WABT_PRINTF_STRING_VIEW_ARG(module_name),\n       WABT_PRINTF_STRING_VIEW_ARG(field_name));\n  return reader_->OnImport(index, kind, module_name, field_name);\n}\n\nResult BinaryReaderLogging::OnImportFunc(Index import_index,\n                                         std::string_view module_name,\n                                         std::string_view field_name,\n                                         Index func_index,\n                                         Index sig_index) {\n  LOGF(\"OnImportFunc(import_index: %\" PRIindex \", func_index: %\" PRIindex\n       \", sig_index: %\" PRIindex \")\\n\",\n       import_index, func_index, sig_index);\n  return reader_->OnImportFunc(import_index, module_name, field_name,\n                               func_index, sig_index);\n}\n\nResult BinaryReaderLogging::OnImportTable(Index import_index,\n                                          std::string_view module_name,\n                                          std::string_view field_name,\n                                          Index table_index,\n                                          Type elem_type,\n                                          const Limits* elem_limits) {\n  char buf[100];\n  SPrintLimits(buf, sizeof(buf), elem_limits);\n  LOGF(\"OnImportTable(import_index: %\" PRIindex \", table_index: %\" PRIindex\n       \", elem_type: %s, %s)\\n\",\n       import_index, table_index, elem_type.GetName().c_str(), buf);\n  return reader_->OnImportTable(import_index, module_name, field_name,\n                                table_index, elem_type, elem_limits);\n}\n\nResult BinaryReaderLogging::OnImportMemory(Index import_index,\n                                           std::string_view module_name,\n                                           std::string_view field_name,\n                                           Index memory_index,\n                                           const Limits* page_limits,\n                                           uint32_t page_size) {\n  char buf[100];\n  SPrintLimits(buf, sizeof(buf), page_limits);\n  LOGF(\"OnImportMemory(import_index: %\" PRIindex \", memory_index: %\" PRIindex\n       \", %s)\\n\",\n       import_index, memory_index, buf);\n  return reader_->OnImportMemory(import_index, module_name, field_name,\n                                 memory_index, page_limits, page_size);\n}\n\nResult BinaryReaderLogging::OnImportGlobal(Index import_index,\n                                           std::string_view module_name,\n                                           std::string_view field_name,\n                                           Index global_index,\n                                           Type type,\n                                           bool mutable_) {\n  LOGF(\"OnImportGlobal(import_index: %\" PRIindex \", global_index: %\" PRIindex\n       \", type: %s, mutable: \"\n       \"%s)\\n\",\n       import_index, global_index, type.GetName().c_str(),\n       mutable_ ? \"true\" : \"false\");\n  return reader_->OnImportGlobal(import_index, module_name, field_name,\n                                 global_index, type, mutable_);\n}\n\nResult BinaryReaderLogging::OnImportTag(Index import_index,\n                                        std::string_view module_name,\n                                        std::string_view field_name,\n                                        Index tag_index,\n                                        Index sig_index) {\n  LOGF(\"OnImportTag(import_index: %\" PRIindex \", tag_index: %\" PRIindex\n       \", sig_index: %\" PRIindex \")\\n\",\n       import_index, tag_index, sig_index);\n  return reader_->OnImportTag(import_index, module_name, field_name, tag_index,\n                              sig_index);\n}\n\nResult BinaryReaderLogging::BeginTable(Index index,\n                                       Type elem_type,\n                                       const Limits* elem_limits,\n                                       TableInitExprStatus init_provided) {\n  char buf[100];\n  SPrintLimits(buf, sizeof(buf), elem_limits);\n  LOGF(\"OnTable(index: %\" PRIindex \", elem_type: %s, %s)\\n\", index,\n       elem_type.GetName().c_str(), buf);\n  return reader_->BeginTable(index, elem_type, elem_limits, init_provided);\n}\n\nResult BinaryReaderLogging::OnMemory(Index index,\n                                     const Limits* page_limits,\n                                     uint32_t page_size) {\n  char buf[100];\n  SPrintLimits(buf, sizeof(buf), page_limits);\n  LOGF(\"OnMemory(index: %\" PRIindex \", %s)\\n\", index, buf);\n  return reader_->OnMemory(index, page_limits, page_size);\n}\n\nResult BinaryReaderLogging::BeginGlobal(Index index, Type type, bool mutable_) {\n  LOGF(\"BeginGlobal(index: %\" PRIindex \", type: %s, mutable: %s)\\n\", index,\n       type.GetName().c_str(), mutable_ ? \"true\" : \"false\");\n  return reader_->BeginGlobal(index, type, mutable_);\n}\n\nResult BinaryReaderLogging::OnExport(Index index,\n                                     ExternalKind kind,\n                                     Index item_index,\n                                     std::string_view name) {\n  LOGF(\"OnExport(index: %\" PRIindex \", kind: %s, item_index: %\" PRIindex\n       \", name: \\\"\" PRIstringview \"\\\")\\n\",\n       index, GetKindName(kind), item_index, WABT_PRINTF_STRING_VIEW_ARG(name));\n  return reader_->OnExport(index, kind, item_index, name);\n}\n\nResult BinaryReaderLogging::BeginFunctionBody(Index value, Offset size) {\n  LOGF(\"BeginFunctionBody(%\" PRIindex \", size:%\" PRIzd \")\\n\", value, size);\n  return reader_->BeginFunctionBody(value, size);\n}\n\nResult BinaryReaderLogging::OnLocalDecl(Index decl_index,\n                                        Index count,\n                                        Type type) {\n  LOGF(\"OnLocalDecl(index: %\" PRIindex \", count: %\" PRIindex \", type: %s)\\n\",\n       decl_index, count, type.GetName().c_str());\n  return reader_->OnLocalDecl(decl_index, count, type);\n}\n\nResult BinaryReaderLogging::OnBlockExpr(Type sig_type) {\n  LOGF(\"OnBlockExpr(sig: \");\n  LogType(sig_type);\n  LOGF_NOINDENT(\")\\n\");\n  return reader_->OnBlockExpr(sig_type);\n}\n\nResult BinaryReaderLogging::OnBrExpr(Index depth) {\n  LOGF(\"OnBrExpr(depth: %\" PRIindex \")\\n\", depth);\n  return reader_->OnBrExpr(depth);\n}\n\nResult BinaryReaderLogging::OnBrIfExpr(Index depth) {\n  LOGF(\"OnBrIfExpr(depth: %\" PRIindex \")\\n\", depth);\n  return reader_->OnBrIfExpr(depth);\n}\n\nResult BinaryReaderLogging::OnBrOnNonNullExpr(Index depth) {\n  LOGF(\"OnBrOnNonNullExpr(depth: %\" PRIindex \")\\n\", depth);\n  return reader_->OnBrOnNonNullExpr(depth);\n}\n\nResult BinaryReaderLogging::OnBrOnNullExpr(Index depth) {\n  LOGF(\"OnBrOnNullExpr(depth: %\" PRIindex \")\\n\", depth);\n  return reader_->OnBrOnNullExpr(depth);\n}\n\nResult BinaryReaderLogging::OnBrTableExpr(Index num_targets,\n                                          Index* target_depths,\n                                          Index default_target_depth) {\n  LOGF(\"OnBrTableExpr(num_targets: %\" PRIindex \", depths: [\", num_targets);\n  for (Index i = 0; i < num_targets; ++i) {\n    LOGF_NOINDENT(\"%\" PRIindex, target_depths[i]);\n    if (i != num_targets - 1) {\n      LOGF_NOINDENT(\", \");\n    }\n  }\n  LOGF_NOINDENT(\"], default: %\" PRIindex \")\\n\", default_target_depth);\n  return reader_->OnBrTableExpr(num_targets, target_depths,\n                                default_target_depth);\n}\n\nResult BinaryReaderLogging::OnF32ConstExpr(uint32_t value_bits) {\n  float value;\n  memcpy(&value, &value_bits, sizeof(value));\n  LOGF(\"OnF32ConstExpr(%g (0x%08x))\\n\", value, value_bits);\n  return reader_->OnF32ConstExpr(value_bits);\n}\n\nResult BinaryReaderLogging::OnF64ConstExpr(uint64_t value_bits) {\n  double value;\n  memcpy(&value, &value_bits, sizeof(value));\n  LOGF(\"OnF64ConstExpr(%g (0x%016\" PRIx64 \"))\\n\", value, value_bits);\n  return reader_->OnF64ConstExpr(value_bits);\n}\n\nResult BinaryReaderLogging::OnV128ConstExpr(v128 value_bits) {\n  LOGF(\"OnV128ConstExpr(0x%08x 0x%08x 0x%08x 0x%08x)\\n\", value_bits.u32(0),\n       value_bits.u32(1), value_bits.u32(2), value_bits.u32(3));\n  return reader_->OnV128ConstExpr(value_bits);\n}\n\nResult BinaryReaderLogging::OnI32ConstExpr(uint32_t value) {\n  LOGF(\"OnI32ConstExpr(%u (0x%x))\\n\", value, value);\n  return reader_->OnI32ConstExpr(value);\n}\n\nResult BinaryReaderLogging::OnI64ConstExpr(uint64_t value) {\n  LOGF(\"OnI64ConstExpr(%\" PRIu64 \" (0x%\" PRIx64 \"))\\n\", value, value);\n  return reader_->OnI64ConstExpr(value);\n}\n\nResult BinaryReaderLogging::OnIfExpr(Type sig_type) {\n  LOGF(\"OnIfExpr(sig: \");\n  LogType(sig_type);\n  LOGF_NOINDENT(\")\\n\");\n  return reader_->OnIfExpr(sig_type);\n}\n\nResult BinaryReaderLogging::OnLoopExpr(Type sig_type) {\n  LOGF(\"OnLoopExpr(sig: \");\n  LogType(sig_type);\n  LOGF_NOINDENT(\")\\n\");\n  return reader_->OnLoopExpr(sig_type);\n}\n\nResult BinaryReaderLogging::OnSelectExpr(Index result_count,\n                                         Type* result_types) {\n  LOGF(\"OnSelectExpr(return_type: \");\n  LogTypes(result_count, result_types);\n  LOGF_NOINDENT(\")\\n\");\n  return reader_->OnSelectExpr(result_count, result_types);\n}\n\nResult BinaryReaderLogging::OnTryExpr(Type sig_type) {\n  LOGF(\"OnTryExpr(sig: \");\n  LogType(sig_type);\n  LOGF_NOINDENT(\")\\n\");\n  return reader_->OnTryExpr(sig_type);\n}\n\nResult BinaryReaderLogging::OnTryTableExpr(Type sig_type,\n                                           const CatchClauseVector& catches) {\n  LOGF(\"OnTryTableExpr(sig: \");\n  LogType(sig_type);\n  Index count = catches.size();\n  LOGF_NOINDENT(\", n: %\" PRIindex \", catches: [\", count);\n\n  for (auto& catch_ : catches) {\n    auto tag = catch_.tag;\n    auto depth = catch_.depth;\n    switch (catch_.kind) {\n      case CatchKind::Catch:\n        LOGF_NOINDENT(\"catch %\" PRIindex \" %\" PRIindex, tag, depth);\n        break;\n      case CatchKind::CatchRef:\n        LOGF_NOINDENT(\"catch_ref %\" PRIindex \" %\" PRIindex, tag, depth);\n        break;\n      case CatchKind::CatchAll:\n        LOGF_NOINDENT(\"catch_all %\" PRIindex, depth);\n        break;\n      case CatchKind::CatchAllRef:\n        LOGF_NOINDENT(\"catch_all_ref %\" PRIindex, depth);\n        break;\n    }\n    if (--count != 0) {\n      LOGF_NOINDENT(\", \");\n    }\n  }\n  LOGF_NOINDENT(\"])\\n\");\n\n  return reader_->OnTryTableExpr(sig_type, catches);\n}\n\nResult BinaryReaderLogging::OnSimdLaneOpExpr(Opcode opcode, uint64_t value) {\n  LOGF(\"OnSimdLaneOpExpr (lane: %\" PRIu64 \")\\n\", value);\n  return reader_->OnSimdLaneOpExpr(opcode, value);\n}\n\nResult BinaryReaderLogging::OnSimdShuffleOpExpr(Opcode opcode, v128 value) {\n  LOGF(\"OnSimdShuffleOpExpr (lane: 0x%08x %08x %08x %08x)\\n\", value.u32(0),\n       value.u32(1), value.u32(2), value.u32(3));\n  return reader_->OnSimdShuffleOpExpr(opcode, value);\n}\n\nResult BinaryReaderLogging::BeginElemSegment(Index index,\n                                             Index table_index,\n                                             uint8_t flags) {\n  LOGF(\"BeginElemSegment(index: %\" PRIindex \", table_index: %\" PRIindex\n       \", flags: %d)\\n\",\n       index, table_index, flags);\n  return reader_->BeginElemSegment(index, table_index, flags);\n}\n\nResult BinaryReaderLogging::OnElemSegmentElemType(Index index, Type elem_type) {\n  LOGF(\"OnElemSegmentElemType(index: %\" PRIindex \", type: %s)\\n\", index,\n       elem_type.GetName().c_str());\n  return reader_->OnElemSegmentElemType(index, elem_type);\n}\n\nResult BinaryReaderLogging::OnDataSegmentData(Index index,\n                                              const void* data,\n                                              Address size) {\n  LOGF(\"OnDataSegmentData(index:%\" PRIindex \", size:%\" PRIaddress \")\\n\", index,\n       size);\n  return reader_->OnDataSegmentData(index, data, size);\n}\n\nResult BinaryReaderLogging::OnModuleNameSubsection(Index index,\n                                                   uint32_t name_type,\n                                                   Offset subsection_size) {\n  LOGF(\"OnModuleNameSubsection(index:%\" PRIindex \", nametype:%u, size:%\" PRIzd\n       \")\\n\",\n       index, name_type, subsection_size);\n  return reader_->OnModuleNameSubsection(index, name_type, subsection_size);\n}\n\nResult BinaryReaderLogging::OnModuleName(std::string_view name) {\n  LOGF(\"OnModuleName(name: \\\"\" PRIstringview \"\\\")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name));\n  return reader_->OnModuleName(name);\n}\n\nResult BinaryReaderLogging::OnFunctionNameSubsection(Index index,\n                                                     uint32_t name_type,\n                                                     Offset subsection_size) {\n  LOGF(\"OnFunctionNameSubsection(index:%\" PRIindex \", nametype:%u, size:%\" PRIzd\n       \")\\n\",\n       index, name_type, subsection_size);\n  return reader_->OnFunctionNameSubsection(index, name_type, subsection_size);\n}\n\nResult BinaryReaderLogging::OnFunctionName(Index index, std::string_view name) {\n  LOGF(\"OnFunctionName(index: %\" PRIindex \", name: \\\"\" PRIstringview \"\\\")\\n\",\n       index, WABT_PRINTF_STRING_VIEW_ARG(name));\n  return reader_->OnFunctionName(index, name);\n}\n\nResult BinaryReaderLogging::OnLocalNameSubsection(Index index,\n                                                  uint32_t name_type,\n                                                  Offset subsection_size) {\n  LOGF(\"OnLocalNameSubsection(index:%\" PRIindex \", nametype:%u, size:%\" PRIzd\n       \")\\n\",\n       index, name_type, subsection_size);\n  return reader_->OnLocalNameSubsection(index, name_type, subsection_size);\n}\n\nResult BinaryReaderLogging::OnLocalName(Index func_index,\n                                        Index local_index,\n                                        std::string_view name) {\n  LOGF(\"OnLocalName(func_index: %\" PRIindex \", local_index: %\" PRIindex\n       \", name: \\\"\" PRIstringview \"\\\")\\n\",\n       func_index, local_index, WABT_PRINTF_STRING_VIEW_ARG(name));\n  return reader_->OnLocalName(func_index, local_index, name);\n}\n\nResult BinaryReaderLogging::OnNameSubsection(\n    Index index,\n    NameSectionSubsection subsection_type,\n    Offset subsection_size) {\n  LOGF(\"OnNameSubsection(index: %\" PRIindex \", type: %s, size:%\" PRIzd \")\\n\",\n       index, GetNameSectionSubsectionName(subsection_type), subsection_size);\n  return reader_->OnNameSubsection(index, subsection_type, subsection_size);\n}\n\nResult BinaryReaderLogging::OnNameEntry(NameSectionSubsection type,\n                                        Index index,\n                                        std::string_view name) {\n  LOGF(\"OnNameEntry(type: %s, index: %\" PRIindex \", name: \\\"\" PRIstringview\n       \"\\\")\\n\",\n       GetNameSectionSubsectionName(type), index,\n       WABT_PRINTF_STRING_VIEW_ARG(name));\n  return reader_->OnNameEntry(type, index, name);\n}\n\nResult BinaryReaderLogging::OnDylinkInfo(uint32_t mem_size,\n                                         uint32_t mem_align,\n                                         uint32_t table_size,\n                                         uint32_t table_align) {\n  LOGF(\n      \"OnDylinkInfo(mem_size: %u, mem_align: %u, table_size: %u, table_align: \"\n      \"%u)\\n\",\n      mem_size, mem_align, table_size, table_align);\n  return reader_->OnDylinkInfo(mem_size, mem_align, table_size, table_align);\n}\n\nResult BinaryReaderLogging::OnDylinkNeeded(std::string_view so_name) {\n  LOGF(\"OnDylinkNeeded(name: \" PRIstringview \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(so_name));\n  return reader_->OnDylinkNeeded(so_name);\n}\n\nResult BinaryReaderLogging::OnDylinkExport(std::string_view name,\n                                           uint32_t flags) {\n  LOGF(\"OnDylinkExport(name: \" PRIstringview \", flags: 0x%x)\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), flags);\n  return reader_->OnDylinkExport(name, flags);\n}\n\nResult BinaryReaderLogging::OnDylinkImport(std::string_view module,\n                                           std::string_view name,\n                                           uint32_t flags) {\n  LOGF(\"OnDylinkImport(module: \" PRIstringview \", name: \" PRIstringview\n       \", flags: 0x%x)\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(module), WABT_PRINTF_STRING_VIEW_ARG(name),\n       flags);\n  return reader_->OnDylinkImport(module, name, flags);\n}\n\nResult BinaryReaderLogging::OnRelocCount(Index count, Index section_index) {\n  LOGF(\"OnRelocCount(count: %\" PRIindex \", section: %\" PRIindex \")\\n\", count,\n       section_index);\n  return reader_->OnRelocCount(count, section_index);\n}\n\nResult BinaryReaderLogging::OnReloc(RelocType type,\n                                    Offset offset,\n                                    Index index,\n                                    uint32_t addend) {\n  int32_t signed_addend = static_cast<int32_t>(addend);\n  LOGF(\"OnReloc(type: %s, offset: %\" PRIzd \", index: %\" PRIindex\n       \", addend: %d)\\n\",\n       GetRelocTypeName(type), offset, index, signed_addend);\n  return reader_->OnReloc(type, offset, index, addend);\n}\n\nResult BinaryReaderLogging::OnFeature(uint8_t prefix, std::string_view name) {\n  LOGF(\"OnFeature(prefix: '%c', name: '\" PRIstringview \"')\\n\", prefix,\n       WABT_PRINTF_STRING_VIEW_ARG(name));\n  return reader_->OnFeature(prefix, name);\n}\n\nResult BinaryReaderLogging::OnDataSymbol(Index index,\n                                         uint32_t flags,\n                                         std::string_view name,\n                                         Index segment,\n                                         uint32_t offset,\n                                         uint32_t size) {\n  LOGF(\"OnDataSymbol(name: \" PRIstringview \" flags: 0x%x)\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), flags);\n  return reader_->OnDataSymbol(index, flags, name, segment, offset, size);\n}\n\nResult BinaryReaderLogging::OnFunctionSymbol(Index index,\n                                             uint32_t flags,\n                                             std::string_view name,\n                                             Index func_index) {\n  LOGF(\"OnFunctionSymbol(name: \" PRIstringview \" flags: 0x%x index: %\" PRIindex\n       \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), flags, func_index);\n  return reader_->OnFunctionSymbol(index, flags, name, func_index);\n}\n\nResult BinaryReaderLogging::OnGlobalSymbol(Index index,\n                                           uint32_t flags,\n                                           std::string_view name,\n                                           Index global_index) {\n  LOGF(\"OnGlobalSymbol(name: \" PRIstringview \" flags: 0x%x index: %\" PRIindex\n       \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), flags, global_index);\n  return reader_->OnGlobalSymbol(index, flags, name, global_index);\n}\n\nResult BinaryReaderLogging::OnSectionSymbol(Index index,\n                                            uint32_t flags,\n                                            Index section_index) {\n  LOGF(\"OnSectionSymbol(flags: 0x%x index: %\" PRIindex \")\\n\", flags,\n       section_index);\n  return reader_->OnSectionSymbol(index, flags, section_index);\n}\n\nResult BinaryReaderLogging::OnTagSymbol(Index index,\n                                        uint32_t flags,\n                                        std::string_view name,\n                                        Index tag_index) {\n  LOGF(\"OnTagSymbol(name: \" PRIstringview \" flags: 0x%x index: %\" PRIindex\n       \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), flags, tag_index);\n  return reader_->OnTagSymbol(index, flags, name, tag_index);\n}\n\nResult BinaryReaderLogging::OnTableSymbol(Index index,\n                                          uint32_t flags,\n                                          std::string_view name,\n                                          Index table_index) {\n  LOGF(\"OnTableSymbol(name: \" PRIstringview \" flags: 0x%x index: %\" PRIindex\n       \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), flags, table_index);\n  return reader_->OnTableSymbol(index, flags, name, table_index);\n}\n\nResult BinaryReaderLogging::OnSegmentInfo(Index index,\n                                          std::string_view name,\n                                          Address alignment,\n                                          uint32_t flags) {\n  LOGF(\"OnSegmentInfo(%d name: \" PRIstringview \", alignment: %\" PRIaddress\n       \", flags: 0x%x)\\n\",\n       index, WABT_PRINTF_STRING_VIEW_ARG(name), alignment, flags);\n  return reader_->OnSegmentInfo(index, name, alignment, flags);\n}\n\nResult BinaryReaderLogging::OnInitFunction(uint32_t priority,\n                                           Index symbol_index) {\n  LOGF(\"OnInitFunction(%d priority: %d)\\n\", symbol_index, priority);\n  return reader_->OnInitFunction(priority, symbol_index);\n}\n\nResult BinaryReaderLogging::OnComdatBegin(std::string_view name,\n                                          uint32_t flags,\n                                          Index count) {\n  LOGF(\"OnComdatBegin(\" PRIstringview \", flags: %d, count: %\" PRIindex \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), flags, count);\n  return reader_->OnComdatBegin(name, flags, count);\n}\n\nResult BinaryReaderLogging::OnComdatEntry(ComdatType kind, Index index) {\n  LOGF(\"OnComdatEntry(kind: %d, index: %\" PRIindex \")\\n\",\n       static_cast<int>(kind), index);\n  return reader_->OnComdatEntry(kind, index);\n}\n\nResult BinaryReaderLogging::BeginCodeMetadataSection(std::string_view name,\n                                                     Offset size) {\n  LOGF(\"BeginCodeMetadataSection('\" PRIstringview \"', size:%\" PRIzd \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), size);\n  Indent();\n  return reader_->BeginCodeMetadataSection(name, size);\n}\nResult BinaryReaderLogging::OnCodeMetadata(Offset code_offset,\n                                           const void* data,\n                                           Address size) {\n  std::string_view content(static_cast<const char*>(data), size);\n  LOGF(\"OnCodeMetadata(offset: %\" PRIzd \", data: \\\"\" PRIstringview \"\\\")\\n\",\n       code_offset, WABT_PRINTF_STRING_VIEW_ARG(content));\n  return reader_->OnCodeMetadata(code_offset, data, size);\n}\n\nResult BinaryReaderLogging::OnGenericCustomSection(std::string_view name,\n                                                   const void* data,\n                                                   Offset size) {\n  LOGF(\"OnGenericCustomSection(name: \\\"\" PRIstringview \"\\\", size: %\" PRIzd\n       \")\\n\",\n       WABT_PRINTF_STRING_VIEW_ARG(name), size);\n  return reader_->OnGenericCustomSection(name, data, size);\n}\n\n#define DEFINE_BEGIN(name)                        \\\n  Result BinaryReaderLogging::name(Offset size) { \\\n    LOGF(#name \"(%\" PRIzd \")\\n\", size);           \\\n    Indent();                                     \\\n    return reader_->name(size);                   \\\n  }\n\n#define DEFINE_END(name)               \\\n  Result BinaryReaderLogging::name() { \\\n    Dedent();                          \\\n    LOGF(#name \"\\n\");                  \\\n    return reader_->name();            \\\n  }\n\n#define DEFINE_INDEX(name)                        \\\n  Result BinaryReaderLogging::name(Index value) { \\\n    LOGF(#name \"(%\" PRIindex \")\\n\", value);       \\\n    return reader_->name(value);                  \\\n  }\n\n#define DEFINE_TYPE(name)                         \\\n  Result BinaryReaderLogging::name(Type type) {   \\\n    LOGF(#name \"(%s)\\n\", type.GetName().c_str()); \\\n    return reader_->name(type);                   \\\n  }\n\n#define DEFINE_INDEX_DESC(name, desc)                 \\\n  Result BinaryReaderLogging::name(Index value) {     \\\n    LOGF(#name \"(\" desc \": %\" PRIindex \")\\n\", value); \\\n    return reader_->name(value);                      \\\n  }\n\n#define DEFINE_INDEX_TYPE(name)                              \\\n  Result BinaryReaderLogging::name(Index value, Type type) { \\\n    LOGF(#name \"(index: %\" PRIindex \", type: %s)\\n\", value,  \\\n         type.GetName().c_str());                            \\\n    return reader_->name(value, type);                       \\\n  }\n\n#define DEFINE_INDEX_INDEX(name, desc0, desc1)                           \\\n  Result BinaryReaderLogging::name(Index value0, Index value1) {         \\\n    LOGF(#name \"(\" desc0 \": %\" PRIindex \", \" desc1 \": %\" PRIindex \")\\n\", \\\n         value0, value1);                                                \\\n    return reader_->name(value0, value1);                                \\\n  }\n\n#define DEFINE_INDEX_INDEX_U8(name, desc0, desc1, desc2)                     \\\n  Result BinaryReaderLogging::name(Index value0, Index value1,               \\\n                                   uint8_t value2) {                         \\\n    LOGF(#name \"(\" desc0 \": %\" PRIindex \", \" desc1 \": %\" PRIindex \", \" desc2 \\\n               \": %d)\\n\",                                                    \\\n         value0, value1, value2);                                            \\\n    return reader_->name(value0, value1, value2);                            \\\n  }\n\n#define DEFINE_OPCODE(name)                                            \\\n  Result BinaryReaderLogging::name(Opcode opcode) {                    \\\n    LOGF(#name \"(\\\"%s\\\" (%u))\\n\", opcode.GetName(), opcode.GetCode()); \\\n    return reader_->name(opcode);                                      \\\n  }\n\n#define DEFINE_LOAD_STORE_OPCODE(name)                                        \\\n  Result BinaryReaderLogging::name(Opcode opcode, Index memidx,               \\\n                                   Address alignment_log2, Address offset) {  \\\n    LOGF(#name \"(opcode: \\\"%s\\\" (%u), memidx: %\" PRIindex                     \\\n               \", align log2: %\" PRIaddress \", offset: %\" PRIaddress \")\\n\",   \\\n         opcode.GetName(), opcode.GetCode(), memidx, alignment_log2, offset); \\\n    return reader_->name(opcode, memidx, alignment_log2, offset);             \\\n  }\n\n#define DEFINE_SIMD_LOAD_STORE_LANE_OPCODE(name)                             \\\n  Result BinaryReaderLogging::name(Opcode opcode, Index memidx,              \\\n                                   Address alignment_log2, Address offset,   \\\n                                   uint64_t value) {                         \\\n    LOGF(#name \"(opcode: \\\"%s\\\" (%u), memidx: %\" PRIindex                    \\\n               \", align log2: %\" PRIaddress \", offset: %\" PRIaddress         \\\n               \", lane: %\" PRIu64 \")\\n\",                                     \\\n         opcode.GetName(), opcode.GetCode(), memidx, alignment_log2, offset, \\\n         value);                                                             \\\n    return reader_->name(opcode, memidx, alignment_log2, offset, value);     \\\n  }\n\n#define DEFINE0(name)                  \\\n  Result BinaryReaderLogging::name() { \\\n    LOGF(#name \"\\n\");                  \\\n    return reader_->name();            \\\n  }\n\nDEFINE_END(EndModule)\n\nDEFINE_END(EndCustomSection)\n\nDEFINE_BEGIN(BeginTypeSection)\nDEFINE_INDEX(OnTypeCount)\nDEFINE_END(EndTypeSection)\n\nDEFINE_BEGIN(BeginImportSection)\nDEFINE_INDEX(OnImportCount)\nDEFINE_END(EndImportSection)\n\nDEFINE_BEGIN(BeginFunctionSection)\nDEFINE_INDEX(OnFunctionCount)\nDEFINE_INDEX_INDEX(OnFunction, \"index\", \"sig_index\")\nDEFINE_END(EndFunctionSection)\n\nDEFINE_BEGIN(BeginTableSection)\nDEFINE_INDEX(OnTableCount)\nDEFINE_INDEX(BeginTableInitExpr)\nDEFINE_INDEX(EndTableInitExpr)\nDEFINE_INDEX(EndTable)\nDEFINE_END(EndTableSection)\n\nDEFINE_BEGIN(BeginMemorySection)\nDEFINE_INDEX(OnMemoryCount)\nDEFINE_END(EndMemorySection)\n\nDEFINE_BEGIN(BeginGlobalSection)\nDEFINE_INDEX(OnGlobalCount)\nDEFINE_INDEX(BeginGlobalInitExpr)\nDEFINE_INDEX(EndGlobalInitExpr)\nDEFINE_INDEX(EndGlobal)\nDEFINE_END(EndGlobalSection)\n\nDEFINE_BEGIN(BeginExportSection)\nDEFINE_INDEX(OnExportCount)\nDEFINE_END(EndExportSection)\n\nDEFINE_BEGIN(BeginStartSection)\nDEFINE_INDEX(OnStartFunction)\nDEFINE_END(EndStartSection)\n\nDEFINE_BEGIN(BeginCodeSection)\nDEFINE_INDEX(OnFunctionBodyCount)\nDEFINE_INDEX(EndFunctionBody)\nDEFINE_INDEX(OnLocalDeclCount)\nDEFINE0(EndLocalDecls)\n\nDEFINE_OPCODE(OnUnaryExpr)\nDEFINE_OPCODE(OnBinaryExpr)\nDEFINE_OPCODE(OnTernaryExpr)\nDEFINE_OPCODE(OnQuaternaryExpr)\n\nDEFINE_LOAD_STORE_OPCODE(OnAtomicLoadExpr);\nDEFINE_LOAD_STORE_OPCODE(OnAtomicRmwExpr);\nDEFINE_LOAD_STORE_OPCODE(OnAtomicRmwCmpxchgExpr);\nDEFINE_LOAD_STORE_OPCODE(OnAtomicStoreExpr);\nDEFINE_LOAD_STORE_OPCODE(OnAtomicWaitExpr);\nDEFINE_INDEX_DESC(OnAtomicFenceExpr, \"consistency_model\");\nDEFINE_LOAD_STORE_OPCODE(OnAtomicNotifyExpr);\nDEFINE_INDEX_DESC(OnCallExpr, \"func_index\")\nDEFINE_INDEX_INDEX(OnCallIndirectExpr, \"sig_index\", \"table_index\")\nDEFINE_TYPE(OnCallRefExpr)\nDEFINE_INDEX_DESC(OnCatchExpr, \"tag_index\");\nDEFINE0(OnCatchAllExpr);\nDEFINE_OPCODE(OnCompareExpr)\nDEFINE_OPCODE(OnConvertExpr)\nDEFINE_INDEX_DESC(OnDelegateExpr, \"depth\");\nDEFINE0(OnDropExpr)\nDEFINE0(OnElseExpr)\nDEFINE0(OnEndExpr)\nDEFINE_INDEX_DESC(OnGlobalGetExpr, \"index\")\nDEFINE_INDEX_DESC(OnGlobalSetExpr, \"index\")\nDEFINE_LOAD_STORE_OPCODE(OnLoadExpr);\nDEFINE_INDEX_DESC(OnLocalGetExpr, \"index\")\nDEFINE_INDEX_DESC(OnLocalSetExpr, \"index\")\nDEFINE_INDEX_DESC(OnLocalTeeExpr, \"index\")\nDEFINE_INDEX_INDEX(OnMemoryCopyExpr, \"dest_memory_index\", \"src_memory_index\")\nDEFINE_INDEX(OnDataDropExpr)\nDEFINE_INDEX(OnMemoryFillExpr)\nDEFINE_INDEX(OnMemoryGrowExpr)\nDEFINE_INDEX_INDEX(OnMemoryInitExpr, \"segment_index\", \"memory_index\")\nDEFINE_INDEX(OnMemorySizeExpr)\nDEFINE_INDEX_INDEX(OnTableCopyExpr, \"dst_index\", \"src_index\")\nDEFINE_INDEX(OnElemDropExpr)\nDEFINE_INDEX_INDEX(OnTableInitExpr, \"segment_index\", \"table_index\")\nDEFINE_INDEX(OnTableSetExpr)\nDEFINE_INDEX(OnTableGetExpr)\nDEFINE_INDEX(OnTableGrowExpr)\nDEFINE_INDEX(OnTableSizeExpr)\nDEFINE_INDEX_DESC(OnTableFillExpr, \"table index\")\nDEFINE0(OnRefAsNonNullExpr)\nDEFINE_INDEX(OnRefFuncExpr)\nDEFINE_TYPE(OnRefNullExpr)\nDEFINE0(OnRefIsNullExpr)\nDEFINE0(OnNopExpr)\nDEFINE_INDEX_DESC(OnRethrowExpr, \"depth\");\nDEFINE_INDEX_DESC(OnReturnCallExpr, \"func_index\")\n\nDEFINE_INDEX_INDEX(OnReturnCallIndirectExpr, \"sig_index\", \"table_index\")\nDEFINE_TYPE(OnReturnCallRefExpr)\nDEFINE0(OnReturnExpr)\nDEFINE_LOAD_STORE_OPCODE(OnLoadSplatExpr);\nDEFINE_LOAD_STORE_OPCODE(OnLoadZeroExpr);\nDEFINE_LOAD_STORE_OPCODE(OnStoreExpr);\nDEFINE_INDEX_DESC(OnThrowExpr, \"tag_index\")\nDEFINE0(OnUnreachableExpr)\nDEFINE0(OnThrowRefExpr)\nDEFINE_SIMD_LOAD_STORE_LANE_OPCODE(OnSimdLoadLaneExpr);\nDEFINE_SIMD_LOAD_STORE_LANE_OPCODE(OnSimdStoreLaneExpr);\nDEFINE_END(EndCodeSection)\n\nDEFINE_BEGIN(BeginElemSection)\nDEFINE_INDEX(OnElemSegmentCount)\nDEFINE_INDEX(BeginElemSegmentInitExpr)\nDEFINE_INDEX(EndElemSegmentInitExpr)\nDEFINE_INDEX_INDEX(OnElemSegmentElemExprCount, \"index\", \"count\")\nDEFINE_INDEX_INDEX(BeginElemExpr, \"elem_index\", \"expr_index\")\nDEFINE_INDEX_INDEX(EndElemExpr, \"elem_index\", \"expr_index\")\nDEFINE_INDEX(EndElemSegment)\nDEFINE_END(EndElemSection)\n\nDEFINE_BEGIN(BeginDataSection)\nDEFINE_INDEX(OnDataSegmentCount)\nDEFINE_INDEX_INDEX_U8(BeginDataSegment, \"index\", \"memory_index\", \"flags\")\nDEFINE_INDEX(BeginDataSegmentInitExpr)\nDEFINE_INDEX(EndDataSegmentInitExpr)\nDEFINE_INDEX(EndDataSegment)\nDEFINE_END(EndDataSection)\n\nDEFINE_BEGIN(BeginDataCountSection)\nDEFINE_INDEX(OnDataCount)\nDEFINE_END(EndDataCountSection)\n\nDEFINE_BEGIN(BeginNamesSection)\nDEFINE_INDEX(OnFunctionNamesCount)\nDEFINE_INDEX(OnLocalNameFunctionCount)\nDEFINE_INDEX_INDEX(OnLocalNameLocalCount, \"index\", \"count\")\nDEFINE_INDEX(OnNameCount);\nDEFINE_END(EndNamesSection)\n\nDEFINE_BEGIN(BeginRelocSection)\nDEFINE_END(EndRelocSection)\n\nDEFINE_BEGIN(BeginDylinkSection)\nDEFINE_INDEX(OnDylinkNeededCount)\nDEFINE_INDEX(OnDylinkExportCount)\nDEFINE_INDEX(OnDylinkImportCount)\nDEFINE_END(EndDylinkSection)\n\nDEFINE_BEGIN(BeginTargetFeaturesSection)\nDEFINE_INDEX(OnFeatureCount)\nDEFINE_END(EndTargetFeaturesSection)\n\nDEFINE_BEGIN(BeginLinkingSection)\nDEFINE_INDEX(OnSymbolCount)\nDEFINE_INDEX(OnSegmentInfoCount)\nDEFINE_INDEX(OnInitFunctionCount)\nDEFINE_INDEX(OnComdatCount)\nDEFINE_END(EndLinkingSection)\n\nDEFINE_BEGIN(BeginGenericCustomSection);\nDEFINE_END(EndGenericCustomSection);\n\nDEFINE_BEGIN(BeginTagSection);\nDEFINE_INDEX(OnTagCount);\nDEFINE_INDEX_INDEX(OnTagType, \"index\", \"sig_index\")\nDEFINE_END(EndTagSection);\n\nDEFINE_INDEX(OnCodeMetadataFuncCount);\nDEFINE_INDEX_INDEX(OnCodeMetadataCount, \"func_index\", \"count\");\nDEFINE_END(EndCodeMetadataSection);\n\n// We don't need to log these (the individual opcodes are logged instead), but\n// we still need to forward the calls.\nResult BinaryReaderLogging::OnOpcode(Opcode opcode) {\n  return reader_->OnOpcode(opcode);\n}\n\nResult BinaryReaderLogging::OnOpcodeBare() {\n  return reader_->OnOpcodeBare();\n}\n\nResult BinaryReaderLogging::OnOpcodeIndex(Index value) {\n  return reader_->OnOpcodeIndex(value);\n}\n\nResult BinaryReaderLogging::OnOpcodeIndexIndex(Index value, Index value2) {\n  return reader_->OnOpcodeIndexIndex(value, value2);\n}\n\nResult BinaryReaderLogging::OnOpcodeUint32(uint32_t value) {\n  return reader_->OnOpcodeUint32(value);\n}\n\nResult BinaryReaderLogging::OnOpcodeUint32Uint32(uint32_t value,\n                                                 uint32_t value2) {\n  return reader_->OnOpcodeUint32Uint32(value, value2);\n}\n\nResult BinaryReaderLogging::OnOpcodeUint32Uint32Uint32(uint32_t value,\n                                                       uint32_t value2,\n                                                       uint32_t value3) {\n  return reader_->OnOpcodeUint32Uint32Uint32(value, value2, value3);\n}\n\nResult BinaryReaderLogging::OnOpcodeUint32Uint32Uint32Uint32(uint32_t value,\n                                                             uint32_t value2,\n                                                             uint32_t value3,\n                                                             uint32_t value4) {\n  return reader_->OnOpcodeUint32Uint32Uint32Uint32(value, value2, value3,\n                                                   value4);\n}\n\nResult BinaryReaderLogging::OnOpcodeUint64(uint64_t value) {\n  return reader_->OnOpcodeUint64(value);\n}\n\nResult BinaryReaderLogging::OnOpcodeF32(uint32_t value) {\n  return reader_->OnOpcodeF32(value);\n}\n\nResult BinaryReaderLogging::OnOpcodeF64(uint64_t value) {\n  return reader_->OnOpcodeF64(value);\n}\n\nResult BinaryReaderLogging::OnOpcodeV128(v128 value) {\n  return reader_->OnOpcodeV128(value);\n}\n\nResult BinaryReaderLogging::OnOpcodeBlockSig(Type sig_type) {\n  return reader_->OnOpcodeBlockSig(sig_type);\n}\n\nResult BinaryReaderLogging::OnOpcodeType(Type type) {\n  return reader_->OnOpcodeType(type);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binary-reader-objdump.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binary-reader-objdump.h\"\n\n#include <algorithm>\n#include <cassert>\n#include <cinttypes>\n#include <cstdio>\n#include <cstring>\n#include <vector>\n\n#if HAVE_STRCASECMP\n#include <strings.h>\n#endif\n\n#include \"wabt/binary-reader-nop.h\"\n#include \"wabt/filenames.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/string-util.h\"\n\nnamespace wabt {\n\nnamespace {\n\nclass BinaryReaderObjdumpBase : public BinaryReaderNop {\n public:\n  BinaryReaderObjdumpBase(const uint8_t* data,\n                          size_t size,\n                          ObjdumpOptions* options,\n                          ObjdumpState* state);\n\n  bool OnError(const Error&) override;\n\n  Result BeginModule(uint32_t version) override;\n  Result BeginSection(Index section_index,\n                      BinarySection section_type,\n                      Offset size) override;\n\n  Result OnOpcode(Opcode Opcode) override;\n  Result OnRelocCount(Index count, Index section_index) override;\n\n protected:\n  std::string_view GetTypeName(Index index) const;\n  std::string_view GetFunctionName(Index index) const;\n  std::string_view GetGlobalName(Index index) const;\n  std::string_view GetLocalName(Index function_index, Index local_index) const;\n  std::string_view GetSectionName(Index index) const;\n  std::string_view GetTagName(Index index) const;\n  std::string_view GetSymbolName(Index index) const;\n  std::string_view GetSegmentName(Index index) const;\n  std::string_view GetTableName(Index index) const;\n  void PrintRelocation(const Reloc& reloc, Offset offset) const;\n  Offset GetPrintOffset(Offset offset) const;\n  Offset GetSectionStart(BinarySection section_code) const {\n    return section_starts_[static_cast<size_t>(section_code)];\n  }\n\n  ObjdumpOptions* options_;\n  ObjdumpState* objdump_state_;\n  const uint8_t* data_;\n  size_t size_;\n  bool print_details_ = false;\n  bool in_function_body = false;\n  BinarySection reloc_section_ = BinarySection::Invalid;\n  Offset section_starts_[kBinarySectionCount];\n  // Map of section index to section type\n  std::vector<BinarySection> section_types_;\n  bool section_found_ = false;\n  std::string module_name_;\n  Opcode current_opcode = Opcode::Unreachable;\n\n  std::unique_ptr<FileStream> err_stream_;\n};\n\nBinaryReaderObjdumpBase::BinaryReaderObjdumpBase(const uint8_t* data,\n                                                 size_t size,\n                                                 ObjdumpOptions* options,\n                                                 ObjdumpState* objdump_state)\n    : options_(options),\n      objdump_state_(objdump_state),\n      data_(data),\n      size_(size),\n      err_stream_(FileStream::CreateStderr()) {\n  ZeroMemory(section_starts_);\n}\n\nResult BinaryReaderObjdumpBase::BeginSection(Index section_index,\n                                             BinarySection section_code,\n                                             Offset size) {\n  section_starts_[static_cast<size_t>(section_code)] = state->offset;\n  section_types_.push_back(section_code);\n  return Result::Ok;\n}\n\nbool BinaryReaderObjdumpBase::OnError(const Error&) {\n  // Tell the BinaryReader that this error is \"handled\" for all passes other\n  // than the prepass. When the error is handled the default message will be\n  // suppressed.\n  return options_->mode != ObjdumpMode::Prepass && !in_function_body;\n}\n\nResult BinaryReaderObjdumpBase::BeginModule(uint32_t version) {\n  switch (options_->mode) {\n    case ObjdumpMode::Headers:\n      printf(\"\\n\");\n      printf(\"Sections:\\n\\n\");\n      break;\n    case ObjdumpMode::Details:\n      printf(\"\\n\");\n      printf(\"Section Details:\\n\\n\");\n      break;\n    case ObjdumpMode::Disassemble:\n      printf(\"\\n\");\n      printf(\"Code Disassembly:\\n\\n\");\n      break;\n    case ObjdumpMode::Prepass: {\n      std::string_view basename = GetBasename(options_->filename);\n      if (basename == \"-\") {\n        basename = \"<stdin>\";\n      }\n      printf(\"%s:\\tfile format wasm %#x\\n\", std::string(basename).c_str(),\n             version);\n      break;\n    }\n    case ObjdumpMode::RawData:\n      break;\n  }\n\n  return Result::Ok;\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetTypeName(Index index) const {\n  return objdump_state_->type_names.Get(index);\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetFunctionName(Index index) const {\n  return objdump_state_->function_names.Get(index);\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetGlobalName(Index index) const {\n  return objdump_state_->global_names.Get(index);\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetLocalName(\n    Index function_index,\n    Index local_index) const {\n  return objdump_state_->local_names.Get(function_index, local_index);\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetSectionName(Index index) const {\n  return objdump_state_->section_names.Get(index);\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetTagName(Index index) const {\n  return objdump_state_->tag_names.Get(index);\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetSegmentName(Index index) const {\n  return objdump_state_->segment_names.Get(index);\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetTableName(Index index) const {\n  return objdump_state_->table_names.Get(index);\n}\n\nstd::string_view BinaryReaderObjdumpBase::GetSymbolName(\n    Index symbol_index) const {\n  if (symbol_index >= objdump_state_->symtab.size())\n    return \"<illegal_symbol_index>\";\n  ObjdumpSymbol& sym = objdump_state_->symtab[symbol_index];\n  switch (sym.kind) {\n    case SymbolType::Function:\n      return GetFunctionName(sym.index);\n    case SymbolType::Data:\n      return sym.name;\n    case SymbolType::Global:\n      return GetGlobalName(sym.index);\n    case SymbolType::Section:\n      return GetSectionName(sym.index);\n    case SymbolType::Tag:\n      return GetTagName(sym.index);\n    case SymbolType::Table:\n      return GetTableName(sym.index);\n  }\n  WABT_UNREACHABLE;\n}\n\nvoid BinaryReaderObjdumpBase::PrintRelocation(const Reloc& reloc,\n                                              Offset offset) const {\n  printf(\"           %06\" PRIzx \": %-18s %\" PRIindex, offset,\n         GetRelocTypeName(reloc.type), reloc.index);\n  if (reloc.addend) {\n    printf(\" + %d\", reloc.addend);\n  }\n  if (reloc.type != RelocType::TypeIndexLEB) {\n    printf(\" <\" PRIstringview \">\",\n           WABT_PRINTF_STRING_VIEW_ARG(GetSymbolName(reloc.index)));\n  }\n  printf(\"\\n\");\n}\n\nOffset BinaryReaderObjdumpBase::GetPrintOffset(Offset offset) const {\n  return options_->section_offsets\n             ? offset - GetSectionStart(BinarySection::Code)\n             : offset;\n}\n\nResult BinaryReaderObjdumpBase::OnOpcode(Opcode opcode) {\n  current_opcode = opcode;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpBase::OnRelocCount(Index count, Index section_index) {\n  if (section_index >= section_types_.size()) {\n    err_stream_->Writef(\"invalid relocation section index: %\" PRIindex \"\\n\",\n                        section_index);\n    reloc_section_ = BinarySection::Invalid;\n    return Result::Error;\n  }\n  reloc_section_ = section_types_[section_index];\n  return Result::Ok;\n}\n\nclass BinaryReaderObjdumpPrepass : public BinaryReaderObjdumpBase {\n public:\n  using BinaryReaderObjdumpBase::BinaryReaderObjdumpBase;\n\n  Result BeginSection(Index section_index,\n                      BinarySection section_code,\n                      Offset size) override {\n    BinaryReaderObjdumpBase::BeginSection(section_index, section_code, size);\n    if (section_code != BinarySection::Custom) {\n      objdump_state_->section_names.Set(section_index,\n                                        wabt::GetSectionName(section_code));\n    }\n    return Result::Ok;\n  }\n\n  Result BeginCustomSection(Index section_index,\n                            Offset size,\n                            std::string_view section_name) override {\n    objdump_state_->section_names.Set(section_index, section_name);\n    return Result::Ok;\n  }\n\n  Result OnFunctionName(Index index, std::string_view name) override {\n    SetFunctionName(index, name);\n    return Result::Ok;\n  }\n\n  Result OnFuncType(Index index,\n                    Index param_count,\n                    Type* param_types,\n                    Index result_count,\n                    Type* result_types) override {\n    objdump_state_->function_param_counts[index] = param_count;\n    return Result::Ok;\n  }\n\n  Result OnNameEntry(NameSectionSubsection type,\n                     Index index,\n                     std::string_view name) override {\n    switch (type) {\n      // TODO(sbc): remove OnFunctionName in favor of just using\n      // OnNameEntry so that this works\n      /*\n      case NameSectionSubsection::Function:\n        SetFunctionName(index, name);\n        break;\n      */\n      case NameSectionSubsection::Type:\n        SetTypeName(index, name);\n        break;\n      case NameSectionSubsection::Global:\n        SetGlobalName(index, name);\n        break;\n      case NameSectionSubsection::Table:\n        SetTableName(index, name);\n        break;\n      case NameSectionSubsection::DataSegment:\n        SetSegmentName(index, name);\n        break;\n      case NameSectionSubsection::Tag:\n        SetTagName(index, name);\n        break;\n      default:\n        break;\n    }\n    return Result::Ok;\n  }\n\n  Result OnLocalName(Index function_index,\n                     Index local_index,\n                     std::string_view local_name) override {\n    SetLocalName(function_index, local_index, local_name);\n    return Result::Ok;\n  }\n\n  Result OnSymbolCount(Index count) override {\n    objdump_state_->symtab.resize(count);\n    return Result::Ok;\n  }\n\n  Result OnDataSymbol(Index index,\n                      uint32_t flags,\n                      std::string_view name,\n                      Index segment,\n                      uint32_t offset,\n                      uint32_t size) override {\n    objdump_state_->symtab[index] = {SymbolType::Data, std::string(name), 0};\n    return Result::Ok;\n  }\n\n  Result OnFunctionSymbol(Index index,\n                          uint32_t flags,\n                          std::string_view name,\n                          Index func_index) override {\n    if (!name.empty()) {\n      SetFunctionName(func_index, name);\n    }\n    objdump_state_->symtab[index] = {SymbolType::Function, std::string(name),\n                                     func_index};\n    return Result::Ok;\n  }\n\n  Result OnGlobalSymbol(Index index,\n                        uint32_t flags,\n                        std::string_view name,\n                        Index global_index) override {\n    if (!name.empty()) {\n      SetGlobalName(global_index, name);\n    }\n    objdump_state_->symtab[index] = {SymbolType::Global, std::string(name),\n                                     global_index};\n    return Result::Ok;\n  }\n\n  Result OnSectionSymbol(Index index,\n                         uint32_t flags,\n                         Index section_index) override {\n    objdump_state_->symtab[index] = {SymbolType::Section,\n                                     std::string(GetSectionName(section_index)),\n                                     section_index};\n    return Result::Ok;\n  }\n\n  Result OnTagSymbol(Index index,\n                     uint32_t flags,\n                     std::string_view name,\n                     Index tag_index) override {\n    if (!name.empty()) {\n      SetTagName(tag_index, name);\n    }\n    objdump_state_->symtab[index] = {SymbolType::Tag, std::string(name),\n                                     tag_index};\n    return Result::Ok;\n  }\n\n  Result OnTableSymbol(Index index,\n                       uint32_t flags,\n                       std::string_view name,\n                       Index table_index) override {\n    if (!name.empty()) {\n      SetTableName(table_index, name);\n    }\n    objdump_state_->symtab[index] = {SymbolType::Table, std::string(name),\n                                     table_index};\n    return Result::Ok;\n  }\n\n  Result OnImportFunc(Index import_index,\n                      std::string_view module_name,\n                      std::string_view field_name,\n                      Index func_index,\n                      Index sig_index) override {\n    SetFunctionName(func_index, module_name + \".\" + field_name);\n    return Result::Ok;\n  }\n\n  Result OnImportTag(Index import_index,\n                     std::string_view module_name,\n                     std::string_view field_name,\n                     Index tag_index,\n                     Index sig_index) override {\n    SetTagName(tag_index, module_name + \".\" + field_name);\n    return Result::Ok;\n  }\n\n  Result OnImportGlobal(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index global_index,\n                        Type type,\n                        bool mutable_) override {\n    SetGlobalName(global_index, module_name + \".\" + field_name);\n    return Result::Ok;\n  }\n\n  Result OnImportTable(Index import_index,\n                       std::string_view module_name,\n                       std::string_view field_name,\n                       Index table_index,\n                       Type elem_type,\n                       const Limits* elem_limits) override {\n    SetTableName(table_index, module_name + \".\" + field_name);\n    return Result::Ok;\n  }\n\n  Result OnExport(Index index,\n                  ExternalKind kind,\n                  Index item_index,\n                  std::string_view name) override {\n    if (kind == ExternalKind::Func) {\n      SetFunctionName(item_index, name);\n    } else if (kind == ExternalKind::Global) {\n      SetGlobalName(item_index, name);\n    }\n    return Result::Ok;\n  }\n\n  Result OnReloc(RelocType type,\n                 Offset offset,\n                 Index index,\n                 uint32_t addend) override;\n\n  Result OnModuleName(std::string_view name) override {\n    if (options_->mode == ObjdumpMode::Prepass) {\n      printf(\"module name: <\" PRIstringview \">\\n\",\n             WABT_PRINTF_STRING_VIEW_ARG(name));\n    }\n    return Result::Ok;\n  }\n\n  Result OnSegmentInfo(Index index,\n                       std::string_view name,\n                       Address alignment_log2,\n                       uint32_t flags) override {\n    SetSegmentName(index, name);\n    return Result::Ok;\n  }\n\n protected:\n  void SetTypeName(Index index, std::string_view name);\n  void SetFunctionName(Index index, std::string_view name);\n  void SetGlobalName(Index index, std::string_view name);\n  void SetLocalName(Index function_index,\n                    Index local_index,\n                    std::string_view name);\n  void SetTagName(Index index, std::string_view name);\n  void SetTableName(Index index, std::string_view name);\n  void SetSegmentName(Index index, std::string_view name);\n};\n\nvoid BinaryReaderObjdumpPrepass::SetTypeName(Index index,\n                                             std::string_view name) {\n  objdump_state_->type_names.Set(index, name);\n}\n\nvoid BinaryReaderObjdumpPrepass::SetFunctionName(Index index,\n                                                 std::string_view name) {\n  objdump_state_->function_names.Set(index, name);\n}\n\nvoid BinaryReaderObjdumpPrepass::SetGlobalName(Index index,\n                                               std::string_view name) {\n  objdump_state_->global_names.Set(index, name);\n}\n\nvoid BinaryReaderObjdumpPrepass::SetLocalName(Index function_index,\n                                              Index local_index,\n                                              std::string_view name) {\n  objdump_state_->local_names.Set(function_index, local_index, name);\n}\n\nvoid BinaryReaderObjdumpPrepass::SetTagName(Index index,\n                                            std::string_view name) {\n  objdump_state_->tag_names.Set(index, name);\n}\n\nvoid BinaryReaderObjdumpPrepass::SetTableName(Index index,\n                                              std::string_view name) {\n  objdump_state_->table_names.Set(index, name);\n}\n\nvoid BinaryReaderObjdumpPrepass::SetSegmentName(Index index,\n                                                std::string_view name) {\n  objdump_state_->segment_names.Set(index, name);\n}\n\nResult BinaryReaderObjdumpPrepass::OnReloc(RelocType type,\n                                           Offset offset,\n                                           Index index,\n                                           uint32_t addend) {\n  BinaryReaderObjdumpBase::OnReloc(type, offset, index, addend);\n  if (reloc_section_ == BinarySection::Code) {\n    objdump_state_->code_relocations.emplace_back(type, offset, index, addend);\n  } else if (reloc_section_ == BinarySection::Data) {\n    objdump_state_->data_relocations.emplace_back(type, offset, index, addend);\n  }\n  return Result::Ok;\n}\n\nclass BinaryReaderObjdumpDisassemble : public BinaryReaderObjdumpBase {\n public:\n  using BinaryReaderObjdumpBase::BinaryReaderObjdumpBase;\n\n  std::string BlockSigToString(Type type) const;\n\n  Result OnFunction(Index index, Index sig_index) override;\n\n  Result BeginFunctionBody(Index index, Offset size) override;\n  Result EndFunctionBody(Index index) override;\n\n  Result OnLocalDeclCount(Index count) override;\n  Result OnLocalDecl(Index decl_index, Index count, Type type) override;\n\n  Result OnOpcode(Opcode Opcode) override;\n  Result OnOpcodeBare() override;\n  Result OnOpcodeIndex(Index value) override;\n  Result OnOpcodeIndexIndex(Index value, Index value2) override;\n  Result OnOpcodeUint32(uint32_t value) override;\n  Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) override;\n  Result OnCallIndirectExpr(uint32_t sig_indix, uint32_t table_index) override;\n  Result OnOpcodeUint32Uint32Uint32(uint32_t value,\n                                    uint32_t value2,\n                                    uint32_t value3) override;\n  Result OnOpcodeUint32Uint32Uint32Uint32(uint32_t value,\n                                          uint32_t value2,\n                                          uint32_t value3,\n                                          uint32_t value4) override;\n  Result OnOpcodeUint64(uint64_t value) override;\n  Result OnOpcodeF32(uint32_t value) override;\n  Result OnOpcodeF64(uint64_t value) override;\n  Result OnOpcodeV128(v128 value) override;\n  Result OnOpcodeBlockSig(Type sig_type) override;\n  Result OnOpcodeType(Type type) override;\n\n  Result OnTryTableExpr(Type sig_type,\n                        const CatchClauseVector& catches) override;\n  Result OnBrTableExpr(Index num_targets,\n                       Index* target_depths,\n                       Index default_target_depth) override;\n  Result OnDelegateExpr(Index) override;\n  Result OnEndExpr() override;\n\n private:\n  void LogOpcode(const char* fmt, ...);\n\n  Offset current_opcode_offset = 0;\n  Offset last_opcode_end = 0;\n  int indent_level = 0;\n  Index next_reloc = 0;\n  Index current_function_index = 0;\n  Index local_index_ = 0;\n  bool skip_next_opcode_ = false;\n};\n\nstd::string BinaryReaderObjdumpDisassemble::BlockSigToString(Type type) const {\n  if (type.IsIndex()) {\n    return StringPrintf(\"type[%d]\", type.GetIndex());\n  } else if (type == Type::Void) {\n    return \"\";\n  } else {\n    return type.GetName();\n  }\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcode(Opcode opcode) {\n  BinaryReaderObjdumpBase::OnOpcode(opcode);\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  if (options_->debug) {\n    const char* opcode_name = opcode.GetName();\n    err_stream_->Writef(\"on_opcode: %#\" PRIzx \": %s\\n\", state->offset,\n                        opcode_name);\n  }\n\n  if (last_opcode_end) {\n    // Takes care of cases where opcode's bytes was a non-canonical leb128\n    // encoding. In this case, opcode.GetLength() under-reports the length,\n    // since it canonicalizes the opcode.\n    if (state->offset < last_opcode_end + opcode.GetLength()) {\n      Opcode missing_opcode = Opcode::FromCode(data_[last_opcode_end]);\n      const char* opcode_name = missing_opcode.GetName();\n      fprintf(stderr,\n              \"error: %#\" PRIzx \" missing opcode callback at %#\" PRIzx\n              \" (%#02x=%s)\\n\",\n              state->offset, last_opcode_end + 1, data_[last_opcode_end],\n              opcode_name);\n      return Result::Error;\n    }\n  }\n\n  current_opcode_offset = state->offset;\n  return Result::Ok;\n}\n\n#define IMMEDIATE_OCTET_COUNT 9\n\nResult BinaryReaderObjdumpDisassemble::OnLocalDeclCount(Index count) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  current_opcode_offset = state->offset;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnLocalDecl(Index decl_index,\n                                                   Index count,\n                                                   Type type) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  Offset offset = current_opcode_offset;\n  size_t data_size = state->offset - offset;\n\n  printf(\" %06\" PRIzx \":\", GetPrintOffset(offset));\n  for (size_t i = 0; i < data_size && i < IMMEDIATE_OCTET_COUNT;\n       i++, offset++) {\n    printf(\" %02x\", data_[offset]);\n  }\n  for (size_t i = data_size; i < IMMEDIATE_OCTET_COUNT; i++) {\n    printf(\"   \");\n  }\n  printf(\" | local[\");\n  if (count > 0) {\n    printf(\"%\" PRIindex, local_index_);\n\n    if (count != 1) {\n      printf(\"..%\" PRIindex \"\", local_index_ + count - 1);\n    }\n    local_index_ += count;\n  }\n  printf(\"] type=%s\\n\", type.GetName().c_str());\n\n  last_opcode_end = current_opcode_offset + data_size;\n  current_opcode_offset = last_opcode_end;\n\n  return Result::Ok;\n}\n\nvoid BinaryReaderObjdumpDisassemble::LogOpcode(const char* fmt, ...) {\n  // BinaryReaderObjdumpDisassemble is only used to disassembly function bodies\n  // so this should never be called for instructions outside of function bodies\n  // (i.e. init expresions).\n  assert(in_function_body);\n  if (skip_next_opcode_) {\n    skip_next_opcode_ = false;\n    return;\n  }\n  const Offset immediate_len = state->offset - current_opcode_offset;\n  const Offset opcode_size = current_opcode.GetLength();\n  const Offset total_size = opcode_size + immediate_len;\n  // current_opcode_offset has already read past this opcode; rewind it by the\n  // size of this opcode, which may be more than one byte.\n  Offset offset = current_opcode_offset - opcode_size;\n  const Offset offset_end = offset + total_size;\n\n  bool first_line = true;\n  while (offset < offset_end) {\n    // Print bytes, but only display a maximum of IMMEDIATE_OCTET_COUNT on each\n    // line.\n    printf(\" %06\" PRIzx \":\", GetPrintOffset(offset));\n    size_t i;\n    for (i = 0; offset < offset_end && i < IMMEDIATE_OCTET_COUNT;\n         ++i, ++offset) {\n      printf(\" %02x\", data_[offset]);\n    }\n    // Fill the rest of the remaining space with spaces.\n    for (; i < IMMEDIATE_OCTET_COUNT; ++i) {\n      printf(\"   \");\n    }\n    printf(\" | \");\n\n    if (first_line) {\n      first_line = false;\n\n      // Print disassembly.\n      int indent_level = this->indent_level;\n      switch (current_opcode) {\n        case Opcode::Else:\n        case Opcode::Catch:\n        case Opcode::CatchAll:\n          indent_level--;\n          break;\n        default:\n          break;\n      }\n      for (int j = 0; j < indent_level; j++) {\n        printf(\"  \");\n      }\n\n      const char* opcode_name = current_opcode.GetName();\n      printf(\"%s\", opcode_name);\n      if (fmt) {\n        printf(\" \");\n        va_list args;\n        va_start(args, fmt);\n        vprintf(fmt, args);\n        va_end(args);\n      }\n    }\n\n    printf(\"\\n\");\n  }\n\n  last_opcode_end = state->offset;\n\n  // Print relocation after then full (potentially multi-line) instruction.\n  if (options_->relocs &&\n      next_reloc < objdump_state_->code_relocations.size()) {\n    const Reloc& reloc = objdump_state_->code_relocations[next_reloc];\n    Offset code_start = GetSectionStart(BinarySection::Code);\n    Offset abs_offset = code_start + reloc.offset;\n    if (last_opcode_end > abs_offset) {\n      PrintRelocation(reloc, abs_offset);\n      next_reloc++;\n    }\n  }\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeBare() {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  LogOpcode(0, nullptr);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeIndex(Index value) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  std::string_view name;\n  if (current_opcode == Opcode::Call &&\n      !(name = GetFunctionName(value)).empty()) {\n    LogOpcode(\"%d <\" PRIstringview \">\", value,\n              WABT_PRINTF_STRING_VIEW_ARG(name));\n  } else if (current_opcode == Opcode::Throw &&\n             !(name = GetTagName(value)).empty()) {\n    LogOpcode(\"%d <\" PRIstringview \">\", value,\n              WABT_PRINTF_STRING_VIEW_ARG(name));\n  } else if ((current_opcode == Opcode::GlobalGet ||\n              current_opcode == Opcode::GlobalSet) &&\n             !(name = GetGlobalName(value)).empty()) {\n    LogOpcode(\"%d <\" PRIstringview \">\", value,\n              WABT_PRINTF_STRING_VIEW_ARG(name));\n  } else if ((current_opcode == Opcode::LocalGet ||\n              current_opcode == Opcode::LocalSet) &&\n             !(name = GetLocalName(current_function_index, value)).empty()) {\n    LogOpcode(\"%d <\" PRIstringview \">\", value,\n              WABT_PRINTF_STRING_VIEW_ARG(name));\n  } else {\n    LogOpcode(\"%d\", value);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeIndexIndex(Index value,\n                                                          Index value2) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  LogOpcode(\"%\" PRIindex \" %\" PRIindex, value, value2);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeUint32(uint32_t value) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  std::string_view name;\n  if (current_opcode == Opcode::DataDrop &&\n      !(name = GetSegmentName(value)).empty()) {\n    LogOpcode(\"%d <\" PRIstringview \">\", value,\n              WABT_PRINTF_STRING_VIEW_ARG(name));\n  } else {\n    LogOpcode(\"%u\", value);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeUint32Uint32(uint32_t value,\n                                                            uint32_t value2) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  std::string_view name;\n  if (current_opcode == Opcode::MemoryInit &&\n      !(name = GetSegmentName(value)).empty()) {\n    LogOpcode(\"%u %u <\" PRIstringview \">\", value, value2,\n              WABT_PRINTF_STRING_VIEW_ARG(name));\n  } else {\n    LogOpcode(\"%u %u\", value, value2);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnCallIndirectExpr(\n    uint32_t sig_index,\n    uint32_t table_index) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  std::string_view table_name = GetTableName(table_index);\n  std::string_view type_name = GetTypeName(sig_index);\n  if (!type_name.empty() && !table_name.empty()) {\n    LogOpcode(\"%u <\" PRIstringview \"> (type %u <\" PRIstringview \">)\",\n              table_index, WABT_PRINTF_STRING_VIEW_ARG(table_name), sig_index,\n              WABT_PRINTF_STRING_VIEW_ARG(type_name));\n  } else if (!table_name.empty()) {\n    LogOpcode(\"%u <\" PRIstringview \"> (type %u)\", table_index,\n              WABT_PRINTF_STRING_VIEW_ARG(table_name), sig_index);\n  } else if (!type_name.empty()) {\n    LogOpcode(\"%u (type %u <\" PRIstringview \">)\", table_index, sig_index,\n              WABT_PRINTF_STRING_VIEW_ARG(type_name));\n  } else {\n    LogOpcode(\"%u (type %u)\", table_index, sig_index);\n  }\n  skip_next_opcode_ = true;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeUint32Uint32Uint32(\n    uint32_t value,\n    uint32_t value2,\n    uint32_t value3) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  LogOpcode(\"%u %u %u\", value, value2, value3);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeUint32Uint32Uint32Uint32(\n    uint32_t value,\n    uint32_t value2,\n    uint32_t value3,\n    uint32_t value4) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  LogOpcode(\"%u %u %u %u\", value, value2, value3, value4);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeUint64(uint64_t value) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  LogOpcode(\"%\" PRIu64, value);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeF32(uint32_t value) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  char buffer[WABT_MAX_FLOAT_HEX];\n  WriteFloatHex(buffer, sizeof(buffer), value);\n  LogOpcode(buffer);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeF64(uint64_t value) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  char buffer[WABT_MAX_DOUBLE_HEX];\n  WriteDoubleHex(buffer, sizeof(buffer), value);\n  LogOpcode(buffer);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeV128(v128 value) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  // v128 is always dumped as i32x4:\n  LogOpcode(\"0x%08x 0x%08x 0x%08x 0x%08x\", value.u32(0), value.u32(1),\n            value.u32(2), value.u32(3));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeType(Type type) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  if (current_opcode == Opcode::SelectT || current_opcode == Opcode::CallRef) {\n    LogOpcode(type.GetName().c_str());\n  } else {\n    LogOpcode(type.GetRefKindName());\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnTryTableExpr(\n    Type sig_type,\n    const CatchClauseVector& catches) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n\n  std::string buffer = std::string();\n\n  if (sig_type != Type::Void) {\n    buffer.append(BlockSigToString(sig_type).c_str()).append(\" \");\n  }\n\n  for (auto& catch_ : catches) {\n    switch (catch_.kind) {\n      case CatchKind::Catch:\n        buffer.append(\"catch \");\n        break;\n      case CatchKind::CatchRef:\n        buffer.append(\"catch_ref \");\n        break;\n      case CatchKind::CatchAll:\n        buffer.append(\"catch_all \");\n        break;\n      case CatchKind::CatchAllRef:\n        buffer.append(\"catch_all_ref \");\n        break;\n    }\n    if (catch_.kind == CatchKind::Catch || catch_.kind == CatchKind::CatchRef) {\n      buffer.append(std::to_string(catch_.tag));\n    }\n    buffer.append(\" \").append(std::to_string(catch_.depth)).append(\" \");\n  }\n\n  if (!buffer.empty()) {\n    // remove trailing space\n    buffer.pop_back();\n  }\n\n  LogOpcode(\"%s\", buffer.c_str());\n  indent_level++;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnBrTableExpr(\n    Index num_targets,\n    Index* target_depths,\n    Index default_target_depth) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n\n  std::string buffer = std::string();\n  for (Index i = 0; i < num_targets; i++) {\n    buffer.append(std::to_string(target_depths[i])).append(\" \");\n  }\n  buffer.append(std::to_string(default_target_depth));\n\n  LogOpcode(\"%s\", buffer.c_str());\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnDelegateExpr(Index depth) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  // Because `delegate` ends the block we need to dedent here, and\n  // we don't need to dedent it in LogOpcode.\n  if (indent_level > 0) {\n    indent_level--;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnEndExpr() {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  if (indent_level > 0) {\n    indent_level--;\n  }\n  LogOpcode(0, nullptr);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnFunction(Index index,\n                                                  Index sig_index) {\n  objdump_state_->function_types[index] = sig_index;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::BeginFunctionBody(Index index,\n                                                         Offset size) {\n  printf(\"%06\" PRIzx \" func[%\" PRIindex \"]\", GetPrintOffset(state->offset),\n         index);\n  auto name = GetFunctionName(index);\n  if (!name.empty()) {\n    printf(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  printf(\":\\n\");\n\n  last_opcode_end = 0;\n  in_function_body = true;\n  current_function_index = index;\n  auto type_index = objdump_state_->function_types[index];\n  local_index_ = objdump_state_->function_param_counts[type_index];\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::EndFunctionBody(Index index) {\n  assert(in_function_body);\n  in_function_body = false;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdumpDisassemble::OnOpcodeBlockSig(Type sig_type) {\n  if (!in_function_body) {\n    return Result::Ok;\n  }\n  if (sig_type != Type::Void) {\n    LogOpcode(\"%s\", BlockSigToString(sig_type).c_str());\n  } else {\n    LogOpcode(nullptr);\n  }\n  indent_level++;\n  return Result::Ok;\n}\n\nenum class InitExprType {\n  Invalid,\n  I32,\n  F32,\n  I64,\n  F64,\n  V128,\n  Global,\n  FuncRef,\n  // TODO: There isn't a nullref anymore, this just represents ref.null of some\n  // type T.\n  NullRef,\n};\n\nstruct InitInst {\n  Opcode opcode;\n  union {\n    Index index;\n    uint32_t i32;\n    uint32_t f32;\n    uint64_t i64;\n    uint64_t f64;\n    v128 v128_v;\n    Type type;\n  } imm;\n};\n\nstruct InitExpr {\n  InitExprType type;\n  std::vector<InitInst> insts;\n};\n\nclass BinaryReaderObjdump : public BinaryReaderObjdumpBase {\n public:\n  BinaryReaderObjdump(const uint8_t* data,\n                      size_t size,\n                      ObjdumpOptions* options,\n                      ObjdumpState* state);\n\n  Result EndModule() override;\n  Result BeginSection(Index section_index,\n                      BinarySection section_type,\n                      Offset size) override;\n  Result BeginCustomSection(Index section_index,\n                            Offset size,\n                            std::string_view section_name) override;\n\n  Result OnTypeCount(Index count) override;\n  Result OnFuncType(Index index,\n                    Index param_count,\n                    Type* param_types,\n                    Index result_count,\n                    Type* result_types) override;\n  Result OnStructType(Index index, Index field_count, TypeMut* fields) override;\n  Result OnArrayType(Index index, TypeMut field) override;\n\n  Result OnImportCount(Index count) override;\n  Result OnImportFunc(Index import_index,\n                      std::string_view module_name,\n                      std::string_view field_name,\n                      Index func_index,\n                      Index sig_index) override;\n  Result OnImportTable(Index import_index,\n                       std::string_view module_name,\n                       std::string_view field_name,\n                       Index table_index,\n                       Type elem_type,\n                       const Limits* elem_limits) override;\n  Result OnImportMemory(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index memory_index,\n                        const Limits* page_limits,\n                        uint32_t page_size) override;\n  Result OnImportGlobal(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index global_index,\n                        Type type,\n                        bool mutable_) override;\n  Result OnImportTag(Index import_index,\n                     std::string_view module_name,\n                     std::string_view field_name,\n                     Index tag_index,\n                     Index sig_index) override;\n\n  Result OnFunctionCount(Index count) override;\n  Result OnFunction(Index index, Index sig_index) override;\n\n  Result OnTableCount(Index count) override;\n  Result BeginTable(Index index,\n                    Type elem_type,\n                    const Limits* elem_limits,\n                    TableInitExprStatus init_provided) override;\n\n  Result OnMemoryCount(Index count) override;\n  Result OnMemory(Index index,\n                  const Limits* limits,\n                  uint32_t page_size) override;\n\n  Result OnGlobalCount(Index count) override;\n  Result BeginGlobal(Index index, Type type, bool mutable_) override;\n\n  Result OnExportCount(Index count) override;\n  Result OnExport(Index index,\n                  ExternalKind kind,\n                  Index item_index,\n                  std::string_view name) override;\n\n  Result OnStartFunction(Index func_index) override;\n  Result OnDataCount(Index count) override;\n\n  Result OnFunctionBodyCount(Index count) override;\n  Result BeginFunctionBody(Index index, Offset size) override;\n\n  Result OnElemSegmentCount(Index count) override;\n  Result BeginElemSegment(Index index,\n                          Index table_index,\n                          uint8_t flags) override;\n  Result OnElemSegmentElemType(Index index, Type elem_type) override;\n  Result OnElemSegmentElemExprCount(Index index, Index count) override;\n\n  void BeginInitExpr() { current_init_expr_.insts.clear(); }\n\n  Result BeginElemSegmentInitExpr(Index index) override {\n    reading_elem_init_expr_ = true;\n    BeginInitExpr();\n    return Result::Ok;\n  }\n\n  Result EndElemSegmentInitExpr(Index index) override { return EndInitExpr(); }\n\n  Result BeginDataSegmentInitExpr(Index index) override {\n    reading_data_init_expr_ = true;\n    BeginInitExpr();\n    return Result::Ok;\n  }\n\n  Result EndDataSegmentInitExpr(Index index) override { return EndInitExpr(); }\n\n  Result BeginTableInitExpr(Index index) override {\n    reading_table_init_expr_ = true;\n    BeginInitExpr();\n    return Result::Ok;\n  }\n\n  Result EndTableInitExpr(Index index) override { return EndInitExpr(); }\n\n  Result BeginGlobalInitExpr(Index index) override {\n    reading_global_init_expr_ = true;\n    BeginInitExpr();\n    return Result::Ok;\n  }\n\n  Result EndGlobalInitExpr(Index index) override { return EndInitExpr(); }\n\n  Result BeginElemExpr(Index elem_index, Index expr_index) override {\n    reading_elem_expr_ = true;\n    elem_index_ = expr_index;\n    BeginInitExpr();\n    return Result::Ok;\n  }\n\n  Result EndElemExpr(Index elem_index, Index expr_index) override {\n    assert(expr_index == elem_index_);\n    return EndInitExpr();\n  }\n\n  Result OnDataSegmentCount(Index count) override;\n  Result BeginDataSegment(Index index,\n                          Index memory_index,\n                          uint8_t flags) override;\n  Result OnDataSegmentData(Index index,\n                           const void* data,\n                           Address size) override;\n\n  Result OnModuleName(std::string_view name) override;\n  Result OnFunctionName(Index function_index,\n                        std::string_view function_name) override;\n  Result OnLocalName(Index function_index,\n                     Index local_index,\n                     std::string_view local_name) override;\n  Result OnNameEntry(NameSectionSubsection type,\n                     Index index,\n                     std::string_view name) override;\n\n  Result OnDylinkInfo(uint32_t mem_size,\n                      uint32_t mem_align_log2,\n                      uint32_t table_size,\n                      uint32_t table_align_log2) override;\n  Result OnDylinkNeededCount(Index count) override;\n  Result OnDylinkNeeded(std::string_view so_name) override;\n  Result OnDylinkImportCount(Index count) override;\n  Result OnDylinkExportCount(Index count) override;\n  Result OnDylinkImport(std::string_view module,\n                        std::string_view name,\n                        uint32_t flags) override;\n  Result OnDylinkExport(std::string_view name, uint32_t flags) override;\n\n  Result OnRelocCount(Index count, Index section_index) override;\n  Result OnReloc(RelocType type,\n                 Offset offset,\n                 Index index,\n                 uint32_t addend) override;\n\n  Result OnFeature(uint8_t prefix, std::string_view name) override;\n\n  Result OnSymbolCount(Index count) override;\n  Result OnDataSymbol(Index index,\n                      uint32_t flags,\n                      std::string_view name,\n                      Index segment,\n                      uint32_t offset,\n                      uint32_t size) override;\n  Result OnFunctionSymbol(Index index,\n                          uint32_t flags,\n                          std::string_view name,\n                          Index func_index) override;\n  Result OnGlobalSymbol(Index index,\n                        uint32_t flags,\n                        std::string_view name,\n                        Index global_index) override;\n  Result OnSectionSymbol(Index index,\n                         uint32_t flags,\n                         Index section_index) override;\n  Result OnTagSymbol(Index index,\n                     uint32_t flags,\n                     std::string_view name,\n                     Index tag_index) override;\n  Result OnTableSymbol(Index index,\n                       uint32_t flags,\n                       std::string_view name,\n                       Index table_index) override;\n  Result OnSegmentInfoCount(Index count) override;\n  Result OnSegmentInfo(Index index,\n                       std::string_view name,\n                       Address alignment_log2,\n                       uint32_t flags) override;\n  Result OnInitFunctionCount(Index count) override;\n  Result OnInitFunction(uint32_t priority, Index symbol_index) override;\n  Result OnComdatCount(Index count) override;\n  Result OnComdatBegin(std::string_view name,\n                       uint32_t flags,\n                       Index count) override;\n  Result OnComdatEntry(ComdatType kind, Index index) override;\n\n  Result OnTagCount(Index count) override;\n  Result OnTagType(Index index, Index sig_index) override;\n\n  Result OnOpcode(Opcode Opcode) override;\n  Result OnI32ConstExpr(uint32_t value) override;\n  Result OnI64ConstExpr(uint64_t value) override;\n  Result OnF32ConstExpr(uint32_t value) override;\n  Result OnF64ConstExpr(uint64_t value) override;\n  Result OnRefFuncExpr(Index func_index) override;\n  Result OnRefNullExpr(Type type) override;\n  Result OnGlobalGetExpr(Index global_index) override;\n  Result OnCodeMetadataCount(Index function_index, Index count) override;\n  Result OnCodeMetadata(Offset code_offset,\n                        const void* data,\n                        Address size) override;\n\n private:\n  Result EndInitExpr();\n  bool ShouldPrintDetails();\n  void PrintDetails(const char* fmt, ...);\n  Result PrintSymbolFlags(uint32_t flags);\n  Result PrintSegmentFlags(uint32_t flags);\n  void PrintInitExpr(const InitExpr& expr,\n                     bool as_unsigned = false,\n                     bool with_prefix = true);\n  Result OnCount(Index count);\n\n  std::unique_ptr<FileStream> out_stream_;\n  Index elem_index_ = 0;\n  Index table_index_ = 0;\n  Index next_data_reloc_ = 0;\n  bool reading_table_init_expr_ = false;\n  bool reading_elem_init_expr_ = false;\n  bool reading_data_init_expr_ = false;\n  bool reading_global_init_expr_ = false;\n  bool reading_elem_expr_ = false;\n  InitExpr current_init_expr_{};\n  uint8_t data_flags_ = 0;\n  uint8_t elem_flags_ = 0;\n  Index data_mem_index_ = 0;\n  uint64_t data_offset_ = 0;\n  uint64_t elem_offset_ = 0;\n\n  bool ReadingInitExpr() {\n    return reading_table_init_expr_ || reading_elem_init_expr_ ||\n           reading_data_init_expr_ || reading_global_init_expr_ ||\n           reading_elem_expr_;\n  }\n};\n\nBinaryReaderObjdump::BinaryReaderObjdump(const uint8_t* data,\n                                         size_t size,\n                                         ObjdumpOptions* options,\n                                         ObjdumpState* objdump_state)\n    : BinaryReaderObjdumpBase(data, size, options, objdump_state),\n      out_stream_(FileStream::CreateStdout()) {}\n\nResult BinaryReaderObjdump::BeginCustomSection(Index section_index,\n                                               Offset size,\n                                               std::string_view section_name) {\n  PrintDetails(\" - name: \\\"\" PRIstringview \"\\\"\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(section_name));\n  if (options_->mode == ObjdumpMode::Headers) {\n    printf(\"\\\"\" PRIstringview \"\\\"\\n\",\n           WABT_PRINTF_STRING_VIEW_ARG(section_name));\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::BeginSection(Index section_index,\n                                         BinarySection section_code,\n                                         Offset size) {\n  BinaryReaderObjdumpBase::BeginSection(section_index, section_code, size);\n\n  // |section_name| and |match_name| are identical for known sections. For\n  // custom sections, |section_name| is \"Custom\", but |match_name| is the name\n  // of the custom section.\n  const char* section_name = wabt::GetSectionName(section_code);\n  std::string match_name(GetSectionName(section_index));\n\n  bool section_match = !options_->section_name ||\n                       !strcasecmp(options_->section_name, match_name.c_str());\n  if (section_match) {\n    section_found_ = true;\n  }\n\n  switch (options_->mode) {\n    case ObjdumpMode::Headers:\n      printf(\"%9s start=%#010\" PRIzx \" end=%#010\" PRIzx \" (size=%#010\" PRIoffset\n             \") \",\n             section_name, state->offset, state->offset + size, size);\n      break;\n    case ObjdumpMode::Details:\n      if (section_match) {\n        printf(\"%s\", section_name);\n        // All known section types except the Start and DataCount sections have\n        // a count in which case this line gets completed in OnCount().\n        if (section_code == BinarySection::Start ||\n            section_code == BinarySection::DataCount ||\n            section_code == BinarySection::Custom) {\n          printf(\":\\n\");\n        }\n        print_details_ = true;\n      } else {\n        print_details_ = false;\n      }\n      break;\n    case ObjdumpMode::RawData:\n      if (section_match) {\n        printf(\"\\nContents of section %s:\\n\", section_name);\n        out_stream_->WriteMemoryDump(data_ + state->offset, size, state->offset,\n                                     PrintChars::Yes);\n      }\n      break;\n    case ObjdumpMode::Prepass:\n    case ObjdumpMode::Disassemble:\n      break;\n  }\n  return Result::Ok;\n}\n\nbool BinaryReaderObjdump::ShouldPrintDetails() {\n  if (options_->mode != ObjdumpMode::Details) {\n    return false;\n  }\n  return print_details_;\n}\n\nvoid WABT_PRINTF_FORMAT(2, 3) BinaryReaderObjdump::PrintDetails(const char* fmt,\n                                                                ...) {\n  if (!ShouldPrintDetails()) {\n    return;\n  }\n  va_list args;\n  va_start(args, fmt);\n  vprintf(fmt, args);\n  va_end(args);\n}\n\nResult BinaryReaderObjdump::OnCount(Index count) {\n  if (options_->mode == ObjdumpMode::Headers) {\n    printf(\"count: %\" PRIindex \"\\n\", count);\n  } else if (options_->mode == ObjdumpMode::Details && print_details_) {\n    printf(\"[%\" PRIindex \"]:\\n\", count);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::EndModule() {\n  if (options_->section_name && !section_found_) {\n    err_stream_->Writef(\"Section not found: %s\\n\", options_->section_name);\n    return Result::Error;\n  }\n\n  if (options_->relocs && ShouldPrintDetails()) {\n    if (next_data_reloc_ != objdump_state_->data_relocations.size()) {\n      err_stream_->Writef(\"Data reloctions outside of segments!:\\n\");\n      for (size_t i = next_data_reloc_;\n           i < objdump_state_->data_relocations.size(); i++) {\n        const Reloc& reloc = objdump_state_->data_relocations[i];\n        PrintRelocation(reloc, reloc.offset);\n      }\n\n      return Result::Error;\n    }\n  }\n\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnTypeCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::OnFuncType(Index index,\n                                       Index param_count,\n                                       Type* param_types,\n                                       Index result_count,\n                                       Type* result_types) {\n  if (!ShouldPrintDetails()) {\n    return Result::Ok;\n  }\n  printf(\" - type[%\" PRIindex \"] (\", index);\n  for (Index i = 0; i < param_count; i++) {\n    if (i != 0) {\n      printf(\", \");\n    }\n    printf(\"%s\", param_types[i].GetName().c_str());\n  }\n  printf(\") -> \");\n  switch (result_count) {\n    case 0:\n      printf(\"nil\");\n      break;\n    case 1:\n      printf(\"%s\", result_types[0].GetName().c_str());\n      break;\n    default:\n      printf(\"(\");\n      for (Index i = 0; i < result_count; i++) {\n        if (i != 0) {\n          printf(\", \");\n        }\n        printf(\"%s\", result_types[i].GetName().c_str());\n      }\n      printf(\")\");\n      break;\n  }\n  printf(\"\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnStructType(Index index,\n                                         Index field_count,\n                                         TypeMut* fields) {\n  if (!ShouldPrintDetails()) {\n    return Result::Ok;\n  }\n  printf(\" - type[%\" PRIindex \"] (struct\", index);\n  for (Index i = 0; i < field_count; i++) {\n    if (fields[i].mutable_) {\n      printf(\" (mut\");\n    }\n    printf(\" %s\", fields[i].type.GetName().c_str());\n    if (fields[i].mutable_) {\n      printf(\")\");\n    }\n  }\n  printf(\")\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnArrayType(Index index, TypeMut field) {\n  if (!ShouldPrintDetails()) {\n    return Result::Ok;\n  }\n  printf(\" - type[%\" PRIindex \"] (array\", index);\n  if (field.mutable_) {\n    printf(\" (mut\");\n  }\n  printf(\" %s\", field.type.GetName().c_str());\n  if (field.mutable_) {\n    printf(\")\");\n  }\n  printf(\")\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnFunctionCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::OnFunction(Index index, Index sig_index) {\n  PrintDetails(\" - func[%\" PRIindex \"] sig=%\" PRIindex, index, sig_index);\n  auto name = GetFunctionName(index);\n  if (!name.empty()) {\n    PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  PrintDetails(\"\\n\");\n  objdump_state_->function_types[index] = sig_index;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnFunctionBodyCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::BeginFunctionBody(Index index, Offset size) {\n  PrintDetails(\" - func[%\" PRIindex \"] size=%\" PRIzd, index, size);\n  auto name = GetFunctionName(index);\n  if (!name.empty()) {\n    PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  PrintDetails(\"\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnStartFunction(Index func_index) {\n  if (options_->mode == ObjdumpMode::Headers) {\n    printf(\"start: %\" PRIindex \"\\n\", func_index);\n  } else {\n    PrintDetails(\" - start function: %\" PRIindex, func_index);\n    auto name = GetFunctionName(func_index);\n    if (!name.empty()) {\n      PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n    }\n    PrintDetails(\"\\n\");\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDataCount(Index count) {\n  if (options_->mode == ObjdumpMode::Headers) {\n    printf(\"count: %\" PRIindex \"\\n\", count);\n  } else {\n    PrintDetails(\" - data count: %\" PRIindex \"\\n\", count);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnImportCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::OnImportFunc(Index import_index,\n                                         std::string_view module_name,\n                                         std::string_view field_name,\n                                         Index func_index,\n                                         Index sig_index) {\n  PrintDetails(\" - func[%\" PRIindex \"] sig=%\" PRIindex, func_index, sig_index);\n  auto name = GetFunctionName(func_index);\n  if (!name.empty()) {\n    PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  PrintDetails(\" <- \" PRIstringview \".\" PRIstringview \"\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(module_name),\n               WABT_PRINTF_STRING_VIEW_ARG(field_name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnImportTable(Index import_index,\n                                          std::string_view module_name,\n                                          std::string_view field_name,\n                                          Index table_index,\n                                          Type elem_type,\n                                          const Limits* elem_limits) {\n  PrintDetails(\" - table[%\" PRIindex \"] type=%s initial=%\" PRId64, table_index,\n               elem_type.GetName().c_str(), elem_limits->initial);\n  if (elem_limits->has_max) {\n    PrintDetails(\" max=%\" PRId64, elem_limits->max);\n  }\n  if (elem_limits->is_64) {\n    PrintDetails(\" i64\");\n  }\n  PrintDetails(\" <- \" PRIstringview \".\" PRIstringview \"\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(module_name),\n               WABT_PRINTF_STRING_VIEW_ARG(field_name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnImportMemory(Index import_index,\n                                           std::string_view module_name,\n                                           std::string_view field_name,\n                                           Index memory_index,\n                                           const Limits* page_limits,\n                                           uint32_t page_size) {\n  PrintDetails(\" - memory[%\" PRIindex \"] pages: initial=%\" PRId64, memory_index,\n               page_limits->initial);\n  if (page_limits->has_max) {\n    PrintDetails(\" max=%\" PRId64, page_limits->max);\n  }\n  if (page_limits->is_shared) {\n    PrintDetails(\" shared\");\n  }\n  if (page_limits->is_64) {\n    PrintDetails(\" i64\");\n  }\n  if (page_size != WABT_DEFAULT_PAGE_SIZE) {\n    PrintDetails(\" (pagesize %u)\", page_size);\n  }\n  PrintDetails(\" <- \" PRIstringview \".\" PRIstringview \"\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(module_name),\n               WABT_PRINTF_STRING_VIEW_ARG(field_name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnImportGlobal(Index import_index,\n                                           std::string_view module_name,\n                                           std::string_view field_name,\n                                           Index global_index,\n                                           Type type,\n                                           bool mutable_) {\n  PrintDetails(\" - global[%\" PRIindex \"] %s mutable=%d\", global_index,\n               type.GetName().c_str(), mutable_);\n  PrintDetails(\" <- \" PRIstringview \".\" PRIstringview \"\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(module_name),\n               WABT_PRINTF_STRING_VIEW_ARG(field_name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnImportTag(Index import_index,\n                                        std::string_view module_name,\n                                        std::string_view field_name,\n                                        Index tag_index,\n                                        Index sig_index) {\n  PrintDetails(\" - tag[%\" PRIindex \"] sig=%\" PRIindex, tag_index, sig_index);\n  auto name = GetTagName(tag_index);\n  if (!name.empty()) {\n    PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  PrintDetails(\" <- \" PRIstringview \".\" PRIstringview \"\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(module_name),\n               WABT_PRINTF_STRING_VIEW_ARG(field_name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnMemoryCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::OnMemory(Index index,\n                                     const Limits* page_limits,\n                                     uint32_t page_size) {\n  PrintDetails(\" - memory[%\" PRIindex \"] pages: initial=%\" PRId64, index,\n               page_limits->initial);\n  if (page_limits->has_max) {\n    PrintDetails(\" max=%\" PRId64, page_limits->max);\n  }\n  if (page_limits->is_shared) {\n    PrintDetails(\" shared\");\n  }\n  if (page_limits->is_64) {\n    PrintDetails(\" i64\");\n  }\n  if (page_size != WABT_DEFAULT_PAGE_SIZE) {\n    PrintDetails(\" (pagesize %u)\", page_size);\n  }\n  PrintDetails(\"\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnTableCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::BeginTable(Index index,\n                                       Type elem_type,\n                                       const Limits* elem_limits,\n                                       TableInitExprStatus) {\n  PrintDetails(\" - table[%\" PRIindex \"] type=%s initial=%\" PRId64, index,\n               elem_type.GetName().c_str(), elem_limits->initial);\n  if (elem_limits->has_max) {\n    PrintDetails(\" max=%\" PRId64, elem_limits->max);\n  }\n  auto name = GetTableName(index);\n  if (!name.empty()) {\n    PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  if (elem_limits->is_64) {\n    PrintDetails(\" i64\");\n  }\n  PrintDetails(\"\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnExportCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::OnExport(Index index,\n                                     ExternalKind kind,\n                                     Index item_index,\n                                     std::string_view name) {\n  PrintDetails(\" - %s[%\" PRIindex \"]\", GetKindName(kind), item_index);\n  if (kind == ExternalKind::Func) {\n    auto name = GetFunctionName(item_index);\n    if (!name.empty()) {\n      PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n    }\n  }\n\n  PrintDetails(\" -> \\\"\" PRIstringview \"\\\"\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnElemSegmentCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::BeginElemSegment(Index index,\n                                             Index table_index,\n                                             uint8_t flags) {\n  table_index_ = table_index;\n  elem_index_ = 0;\n  elem_flags_ = flags;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnElemSegmentElemType(Index index, Type elem_type) {\n  // TODO: Add support for this.\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnElemSegmentElemExprCount(Index index,\n                                                       Index count) {\n  PrintDetails(\" - segment[%\" PRIindex \"] flags=%d table=%\" PRIindex\n               \" count=%\" PRIindex,\n               index, elem_flags_, table_index_, count);\n  if (elem_flags_ & SegPassive) {\n    PrintDetails(\"\\n\");\n  } else {\n    PrintInitExpr(current_init_expr_, /*as_unsigned=*/true);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnGlobalCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::BeginGlobal(Index index, Type type, bool mutable_) {\n  PrintDetails(\" - global[%\" PRIindex \"] %s mutable=%d\", index,\n               type.GetName().c_str(), mutable_);\n  std::string_view name = GetGlobalName(index);\n  if (!name.empty()) {\n    PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  return Result::Ok;\n}\n\nvoid BinaryReaderObjdump::PrintInitExpr(const InitExpr& expr,\n                                        bool as_unsigned,\n                                        bool with_prefix) {\n  if (with_prefix) {\n    PrintDetails(\" - init \");\n  }\n\n  if (expr.insts.empty()) {\n    PrintDetails(\"<EMPTY>\\n\");\n    return;\n  }\n\n  // We have two different way to print init expressions.  One for\n  // extended expressions involving more than one instruction, and\n  // a short form for the more traditional single instruction form.\n  if (expr.insts.size() > 1) {\n    PrintDetails(\"(\");\n    bool first = true;\n    for (auto& inst : expr.insts) {\n      if (!first) {\n        PrintDetails(\", \");\n      }\n      first = false;\n      PrintDetails(\"%s\", inst.opcode.GetName());\n      switch (inst.opcode) {\n        case Opcode::I32Const:\n          PrintDetails(\" %d\", inst.imm.i32);\n          break;\n        case Opcode::I64Const:\n          PrintDetails(\" %\" PRId64, inst.imm.i64);\n          break;\n        case Opcode::F32Const: {\n          char buffer[WABT_MAX_FLOAT_HEX];\n          WriteFloatHex(buffer, sizeof(buffer), inst.imm.f32);\n          PrintDetails(\" %s\\n\", buffer);\n          break;\n        }\n        case Opcode::F64Const: {\n          char buffer[WABT_MAX_DOUBLE_HEX];\n          WriteDoubleHex(buffer, sizeof(buffer), inst.imm.f64);\n          PrintDetails(\" %s\\n\", buffer);\n          break;\n        }\n        case Opcode::GlobalGet: {\n          PrintDetails(\" %\" PRIindex, inst.imm.index);\n          std::string_view name = GetGlobalName(inst.imm.index);\n          if (!name.empty()) {\n            PrintDetails(\" <\" PRIstringview \">\",\n                         WABT_PRINTF_STRING_VIEW_ARG(name));\n          }\n          break;\n        }\n        default:\n          break;\n      }\n    }\n    PrintDetails(\")\\n\");\n    return;\n  }\n\n  switch (expr.type) {\n    case InitExprType::I32:\n      if (as_unsigned) {\n        PrintDetails(\"i32=%u\\n\", expr.insts[0].imm.i32);\n      } else {\n        PrintDetails(\"i32=%d\\n\", expr.insts[0].imm.i32);\n      }\n      break;\n    case InitExprType::I64:\n      if (as_unsigned) {\n        PrintDetails(\"i64=%\" PRIu64 \"\\n\", expr.insts[0].imm.i64);\n      } else {\n        PrintDetails(\"i64=%\" PRId64 \"\\n\", expr.insts[0].imm.i64);\n      }\n      break;\n    case InitExprType::F64: {\n      char buffer[WABT_MAX_DOUBLE_HEX];\n      WriteDoubleHex(buffer, sizeof(buffer), expr.insts[0].imm.f64);\n      PrintDetails(\"f64=%s\\n\", buffer);\n      break;\n    }\n    case InitExprType::F32: {\n      char buffer[WABT_MAX_FLOAT_HEX];\n      WriteFloatHex(buffer, sizeof(buffer), expr.insts[0].imm.f32);\n      PrintDetails(\"f32=%s\\n\", buffer);\n      break;\n    }\n    case InitExprType::V128: {\n      PrintDetails(\n          \"v128=0x%08x 0x%08x 0x%08x 0x%08x \\n\",\n          expr.insts[0].imm.v128_v.u32(0), expr.insts[0].imm.v128_v.u32(1),\n          expr.insts[0].imm.v128_v.u32(2), expr.insts[0].imm.v128_v.u32(3));\n      break;\n    }\n    case InitExprType::Global: {\n      PrintDetails(\"global=%\" PRIindex, expr.insts[0].imm.index);\n      std::string_view name = GetGlobalName(expr.insts[0].imm.index);\n      if (!name.empty()) {\n        PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n      }\n      PrintDetails(\"\\n\");\n      break;\n    }\n    case InitExprType::FuncRef: {\n      PrintDetails(\"ref.func:%\" PRIindex, expr.insts[0].imm.index);\n      std::string_view name = GetFunctionName(expr.insts[0].imm.index);\n      if (!name.empty()) {\n        PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n      }\n      PrintDetails(\"\\n\");\n      break;\n    }\n    case InitExprType::NullRef:\n      PrintDetails(\"ref.null %s\\n\", expr.insts[0].imm.type.GetName().c_str());\n      break;\n    case InitExprType::Invalid:\n      PrintDetails(\"<INVALID>\\n\");\n      break;\n  }\n}\n\nstatic void InitExprToConstOffset(const InitExpr& expr, uint64_t* out_offset) {\n  if (expr.insts.size() == 1) {\n    switch (expr.type) {\n      case InitExprType::I32:\n        *out_offset = expr.insts[0].imm.i32;\n        break;\n      case InitExprType::I64:\n        *out_offset = expr.insts[0].imm.i64;\n        break;\n      default:\n        break;\n    }\n  }\n}\n\nResult BinaryReaderObjdump::EndInitExpr() {\n  if (reading_data_init_expr_) {\n    reading_data_init_expr_ = false;\n    InitExprToConstOffset(current_init_expr_, &data_offset_);\n  } else if (reading_table_init_expr_) {\n    reading_table_init_expr_ = false;\n    InitExprToConstOffset(current_init_expr_, &elem_offset_);\n  } else if (reading_elem_init_expr_) {\n    reading_elem_init_expr_ = false;\n    InitExprToConstOffset(current_init_expr_, &elem_offset_);\n  } else if (reading_global_init_expr_) {\n    reading_global_init_expr_ = false;\n    PrintInitExpr(current_init_expr_);\n  } else if (reading_elem_expr_) {\n    reading_elem_expr_ = false;\n    PrintDetails(\"  - elem[%\" PRIu64 \"] = \", elem_offset_ + elem_index_);\n    PrintInitExpr(current_init_expr_, /*as_unsigned=*/false,\n                  /*with_prefix=*/false);\n  } else {\n    WABT_UNREACHABLE;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnI32ConstExpr(uint32_t value) {\n  if (ReadingInitExpr()) {\n    current_init_expr_.type = InitExprType::I32;\n    current_init_expr_.insts.back().imm.i32 = value;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnI64ConstExpr(uint64_t value) {\n  if (ReadingInitExpr()) {\n    current_init_expr_.type = InitExprType::I64;\n    current_init_expr_.insts.back().imm.i64 = value;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnF32ConstExpr(uint32_t value) {\n  if (ReadingInitExpr()) {\n    current_init_expr_.type = InitExprType::F32;\n    current_init_expr_.insts.back().imm.f32 = value;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnF64ConstExpr(uint64_t value) {\n  if (ReadingInitExpr()) {\n    current_init_expr_.type = InitExprType::F64;\n    current_init_expr_.insts.back().imm.f64 = value;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnRefFuncExpr(Index func_index) {\n  if (ReadingInitExpr()) {\n    current_init_expr_.type = InitExprType::FuncRef;\n    current_init_expr_.insts.back().imm.index = func_index;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnRefNullExpr(Type type) {\n  if (ReadingInitExpr()) {\n    current_init_expr_.type = InitExprType::NullRef;\n    current_init_expr_.insts.back().imm.type = type;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnOpcode(Opcode opcode) {\n  BinaryReaderObjdumpBase::OnOpcode(opcode);\n  if (ReadingInitExpr() && opcode != Opcode::End) {\n    InitInst i;\n    i.opcode = current_opcode;\n    current_init_expr_.insts.push_back(i);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnGlobalGetExpr(Index global_index) {\n  if (ReadingInitExpr()) {\n    current_init_expr_.type = InitExprType::Global;\n    current_init_expr_.insts.back().imm.index = global_index;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnModuleName(std::string_view name) {\n  PrintDetails(\" - module <\" PRIstringview \">\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnFunctionName(Index index, std::string_view name) {\n  PrintDetails(\" - func[%\" PRIindex \"] <\" PRIstringview \">\\n\", index,\n               WABT_PRINTF_STRING_VIEW_ARG(name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnNameEntry(NameSectionSubsection type,\n                                        Index index,\n                                        std::string_view name) {\n  PrintDetails(\" - %s[%\" PRIindex \"] <\" PRIstringview \">\\n\",\n               GetNameSectionSubsectionName(type), index,\n               WABT_PRINTF_STRING_VIEW_ARG(name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnLocalName(Index func_index,\n                                        Index local_index,\n                                        std::string_view name) {\n  if (!name.empty()) {\n    PrintDetails(\" - func[%\" PRIindex \"] local[%\" PRIindex \"] <\" PRIstringview\n                 \">\\n\",\n                 func_index, local_index, WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDataSegmentCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::BeginDataSegment(Index index,\n                                             Index memory_index,\n                                             uint8_t flags) {\n  data_mem_index_ = memory_index;\n  data_flags_ = flags;\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDataSegmentData(Index index,\n                                              const void* src_data,\n                                              Address size) {\n  if (!ShouldPrintDetails()) {\n    return Result::Ok;\n  }\n\n  PrintDetails(\" - segment[%\" PRIindex \"]\", index);\n  auto name = GetSegmentName(index);\n  if (!name.empty()) {\n    PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  if (data_flags_ & SegPassive) {\n    PrintDetails(\" passive\");\n  } else {\n    PrintDetails(\" memory=%\" PRIindex, data_mem_index_);\n  }\n  PrintDetails(\" size=%\" PRIaddress, size);\n  if (data_flags_ & SegPassive) {\n    PrintDetails(\"\\n\");\n  } else {\n    PrintInitExpr(current_init_expr_, /*as_unsigned=*/true);\n  }\n\n  out_stream_->WriteMemoryDump(src_data, size, data_offset_, PrintChars::Yes,\n                               \"  - \");\n\n  // Print relocations from this segment.\n  if (!options_->relocs) {\n    return Result::Ok;\n  }\n\n  Offset data_start = GetSectionStart(BinarySection::Data);\n  Offset segment_start = state->offset - size;\n  Offset segment_offset = segment_start - data_start;\n  while (next_data_reloc_ < objdump_state_->data_relocations.size()) {\n    const Reloc& reloc = objdump_state_->data_relocations[next_data_reloc_];\n    Offset abs_offset = data_start + reloc.offset;\n    if (abs_offset > state->offset) {\n      break;\n    }\n    PrintRelocation(reloc, reloc.offset - segment_offset + data_offset_);\n    next_data_reloc_++;\n  }\n\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDylinkInfo(uint32_t mem_size,\n                                         uint32_t mem_align_log2,\n                                         uint32_t table_size,\n                                         uint32_t table_align_log2) {\n  PrintDetails(\" - mem_size     : %u\\n\", mem_size);\n  PrintDetails(\" - mem_p2align  : %u\\n\", mem_align_log2);\n  PrintDetails(\" - table_size   : %u\\n\", table_size);\n  PrintDetails(\" - table_p2align: %u\\n\", table_align_log2);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDylinkNeededCount(Index count) {\n  if (count) {\n    PrintDetails(\" - needed_dynlibs[%u]:\\n\", count);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDylinkImportCount(Index count) {\n  PrintDetails(\" - imports[%u]:\\n\", count);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDylinkExportCount(Index count) {\n  PrintDetails(\" - exports[%u]:\\n\", count);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDylinkExport(std::string_view name,\n                                           uint32_t flags) {\n  PrintDetails(\"  - \" PRIstringview, WABT_PRINTF_STRING_VIEW_ARG(name));\n  return PrintSymbolFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnDylinkImport(std::string_view module,\n                                           std::string_view name,\n                                           uint32_t flags) {\n  PrintDetails(\"  - \" PRIstringview \".\" PRIstringview,\n               WABT_PRINTF_STRING_VIEW_ARG(module),\n               WABT_PRINTF_STRING_VIEW_ARG(name));\n  return PrintSymbolFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnDylinkNeeded(std::string_view so_name) {\n  PrintDetails(\"  - \" PRIstringview \"\\n\", WABT_PRINTF_STRING_VIEW_ARG(so_name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnRelocCount(Index count, Index section_index) {\n  BinaryReaderObjdumpBase::OnRelocCount(count, section_index);\n  PrintDetails(\"  - relocations for section: %d (\" PRIstringview \") [%d]\\n\",\n               section_index,\n               WABT_PRINTF_STRING_VIEW_ARG(GetSectionName(section_index)),\n               count);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnReloc(RelocType type,\n                                    Offset offset,\n                                    Index index,\n                                    uint32_t addend) {\n  Offset total_offset = GetSectionStart(reloc_section_) + offset;\n  PrintDetails(\"   - %-18s offset=%#08\" PRIoffset \"(file=%#08\" PRIoffset \") \",\n               GetRelocTypeName(type), offset, total_offset);\n  if (type == RelocType::TypeIndexLEB) {\n    PrintDetails(\"type=%\" PRIindex, index);\n  } else {\n    PrintDetails(\"symbol=%\" PRIindex \" <\" PRIstringview \">\", index,\n                 WABT_PRINTF_STRING_VIEW_ARG(GetSymbolName(index)));\n  }\n\n  if (addend) {\n    int32_t signed_addend = static_cast<int32_t>(addend);\n    if (signed_addend < 0) {\n      PrintDetails(\"-\");\n      signed_addend = -signed_addend;\n    } else {\n      PrintDetails(\"+\");\n    }\n    PrintDetails(\"%#x\", signed_addend);\n  }\n  PrintDetails(\"\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnFeature(uint8_t prefix, std::string_view name) {\n  PrintDetails(\"  - [%c] \" PRIstringview \"\\n\", prefix,\n               WABT_PRINTF_STRING_VIEW_ARG(name));\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnSymbolCount(Index count) {\n  PrintDetails(\"  - symbol table [count=%d]\\n\", count);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::PrintSymbolFlags(uint32_t flags) {\n  if (flags > WABT_SYMBOL_FLAG_MAX) {\n    err_stream_->Writef(\"Unknown symbols flags: %x\\n\", flags);\n    return Result::Error;\n  }\n\n  const char* binding_name = nullptr;\n  SymbolBinding binding =\n      static_cast<SymbolBinding>(flags & WABT_SYMBOL_MASK_BINDING);\n  switch (binding) {\n    case SymbolBinding::Global:\n      binding_name = \"global\";\n      break;\n    case SymbolBinding::Local:\n      binding_name = \"local\";\n      break;\n    case SymbolBinding::Weak:\n      binding_name = \"weak\";\n      break;\n  }\n  flags &= ~WABT_SYMBOL_MASK_BINDING;\n\n  const char* vis_name = nullptr;\n  SymbolVisibility vis =\n      static_cast<SymbolVisibility>(flags & WABT_SYMBOL_MASK_VISIBILITY);\n  switch (vis) {\n    case SymbolVisibility::Hidden:\n      vis_name = \"hidden\";\n      break;\n    case SymbolVisibility::Default:\n      vis_name = \"default\";\n      break;\n  }\n  flags &= ~WABT_SYMBOL_MASK_VISIBILITY;\n\n  PrintDetails(\" [\");\n  if (flags & WABT_SYMBOL_FLAG_UNDEFINED) {\n    PrintDetails(\" undefined\");\n    flags &= ~WABT_SYMBOL_FLAG_UNDEFINED;\n  }\n  if (flags & WABT_SYMBOL_FLAG_EXPORTED) {\n    PrintDetails(\" exported\");\n    flags &= ~WABT_SYMBOL_FLAG_EXPORTED;\n  }\n  if (flags & WABT_SYMBOL_FLAG_EXPLICIT_NAME) {\n    PrintDetails(\" explicit_name\");\n    flags &= ~WABT_SYMBOL_FLAG_EXPLICIT_NAME;\n  }\n  if (flags & WABT_SYMBOL_FLAG_NO_STRIP) {\n    PrintDetails(\" no_strip\");\n    flags &= ~WABT_SYMBOL_FLAG_NO_STRIP;\n  }\n  if (flags & WABT_SYMBOL_FLAG_TLS) {\n    PrintDetails(\" tls\");\n    flags &= ~WABT_SYMBOL_FLAG_TLS;\n  }\n  if (flags & WABT_SYMBOL_FLAG_ABS) {\n    PrintDetails(\" abs\");\n    flags &= ~WABT_SYMBOL_FLAG_ABS;\n  }\n  if (flags != 0) {\n    PrintDetails(\" unknown_flags=%#x\", flags);\n  }\n  PrintDetails(\" binding=%s vis=%s ]\\n\", binding_name, vis_name);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::PrintSegmentFlags(uint32_t flags) {\n  if (flags > WABT_SYMBOL_FLAG_MAX) {\n    err_stream_->Writef(\"Unknown symbols flags: %x\\n\", flags);\n    return Result::Error;\n  }\n  PrintDetails(\" [\");\n  if (flags & WABT_SEGMENT_FLAG_STRINGS) {\n    PrintDetails(\" STRINGS\");\n    flags &= ~WABT_SEGMENT_FLAG_STRINGS;\n  }\n  if (flags & WABT_SEGMENT_FLAG_TLS) {\n    PrintDetails(\" TLS\");\n    flags &= ~WABT_SEGMENT_FLAG_TLS;\n  }\n  if (flags & WASM_SEGMENT_FLAG_RETAIN) {\n    PrintDetails(\" RETAIN\");\n    flags &= ~WASM_SEGMENT_FLAG_RETAIN;\n  }\n  if (flags != 0) {\n    PrintDetails(\" unknown_flags=%#x\", flags);\n  }\n  PrintDetails(\" ]\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnDataSymbol(Index index,\n                                         uint32_t flags,\n                                         std::string_view name,\n                                         Index segment,\n                                         uint32_t offset,\n                                         uint32_t size) {\n  PrintDetails(\"   - %d: D <\" PRIstringview \">\", index,\n               WABT_PRINTF_STRING_VIEW_ARG(name));\n  if (!(flags & WABT_SYMBOL_FLAG_UNDEFINED)) {\n    if (flags & WABT_SYMBOL_FLAG_ABS) {\n      PrintDetails(\" address=%d size=%d\", offset, size);\n    } else {\n      PrintDetails(\" segment=%\" PRIindex \" offset=%d size=%d\", segment, offset,\n                   size);\n    }\n  }\n  return PrintSymbolFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnFunctionSymbol(Index index,\n                                             uint32_t flags,\n                                             std::string_view name,\n                                             Index func_index) {\n  if (name.empty()) {\n    name = GetFunctionName(func_index);\n  }\n  PrintDetails(\"   - %d: F <\" PRIstringview \"> func=%\" PRIindex, index,\n               WABT_PRINTF_STRING_VIEW_ARG(name), func_index);\n  return PrintSymbolFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnGlobalSymbol(Index index,\n                                           uint32_t flags,\n                                           std::string_view name,\n                                           Index global_index) {\n  if (name.empty()) {\n    name = GetGlobalName(global_index);\n  }\n  PrintDetails(\"   - %d: G <\" PRIstringview \"> global=%\" PRIindex, index,\n               WABT_PRINTF_STRING_VIEW_ARG(name), global_index);\n  return PrintSymbolFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnSectionSymbol(Index index,\n                                            uint32_t flags,\n                                            Index section_index) {\n  auto sym_name = GetSectionName(section_index);\n  assert(!sym_name.empty());\n  PrintDetails(\"   - %d: S <\" PRIstringview \"> section=%\" PRIindex, index,\n               WABT_PRINTF_STRING_VIEW_ARG(sym_name), section_index);\n  return PrintSymbolFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnTagSymbol(Index index,\n                                        uint32_t flags,\n                                        std::string_view name,\n                                        Index tag_index) {\n  if (name.empty()) {\n    name = GetTagName(tag_index);\n  }\n  PrintDetails(\"   - %d: E <\" PRIstringview \"> tag=%\" PRIindex, index,\n               WABT_PRINTF_STRING_VIEW_ARG(name), tag_index);\n  return PrintSymbolFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnTableSymbol(Index index,\n                                          uint32_t flags,\n                                          std::string_view name,\n                                          Index table_index) {\n  if (name.empty()) {\n    name = GetTableName(table_index);\n  }\n  PrintDetails(\"   - %d: T <\" PRIstringview \"> table=%\" PRIindex, index,\n               WABT_PRINTF_STRING_VIEW_ARG(name), table_index);\n  return PrintSymbolFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnSegmentInfoCount(Index count) {\n  PrintDetails(\"  - segment info [count=%d]\\n\", count);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnSegmentInfo(Index index,\n                                          std::string_view name,\n                                          Address alignment_log2,\n                                          uint32_t flags) {\n  PrintDetails(\"   - %d: \" PRIstringview \" p2align=%\" PRIaddress, index,\n               WABT_PRINTF_STRING_VIEW_ARG(name), alignment_log2);\n  return PrintSegmentFlags(flags);\n}\n\nResult BinaryReaderObjdump::OnInitFunctionCount(Index count) {\n  PrintDetails(\"  - init functions [count=%d]\\n\", count);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnInitFunction(uint32_t priority,\n                                           Index symbol_index) {\n  PrintDetails(\"   - %d: priority=%d\", symbol_index, priority);\n  auto name = GetSymbolName(symbol_index);\n  if (!name.empty()) {\n    PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  PrintDetails(\"\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnComdatCount(Index count) {\n  PrintDetails(\"  - comdat groups [count=%d]\\n\", count);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnComdatBegin(std::string_view name,\n                                          uint32_t flags,\n                                          Index count) {\n  PrintDetails(\"   - \" PRIstringview \": [count=%d]\\n\",\n               WABT_PRINTF_STRING_VIEW_ARG(name), count);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnComdatEntry(ComdatType kind, Index index) {\n  switch (kind) {\n    case ComdatType::Data: {\n      PrintDetails(\"    - segment[%\" PRIindex \"]\", index);\n      auto name = GetSegmentName(index);\n      if (!name.empty()) {\n        PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n      }\n      break;\n    }\n    case ComdatType::Function: {\n      PrintDetails(\"    - func[%\" PRIindex \"]\", index);\n      auto name = GetFunctionName(index);\n      if (!name.empty()) {\n        PrintDetails(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n      }\n      break;\n    }\n  }\n  PrintDetails(\"\\n\");\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnTagCount(Index count) {\n  return OnCount(count);\n}\n\nResult BinaryReaderObjdump::OnTagType(Index index, Index sig_index) {\n  if (!ShouldPrintDetails()) {\n    return Result::Ok;\n  }\n  printf(\" - tag[%\" PRIindex \"] sig=%\" PRIindex \"\\n\", index, sig_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderObjdump::OnCodeMetadataCount(Index function_index,\n                                                Index count) {\n  if (!ShouldPrintDetails()) {\n    return Result::Ok;\n  }\n  printf(\"   - func[%\" PRIindex \"]\", function_index);\n  auto name = GetFunctionName(function_index);\n  if (!name.empty()) {\n    printf(\" <\" PRIstringview \">\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  printf(\":\\n\");\n  return Result::Ok;\n}\nResult BinaryReaderObjdump::OnCodeMetadata(Offset code_offset,\n                                           const void* data,\n                                           Address size) {\n  if (!ShouldPrintDetails()) {\n    return Result::Ok;\n  }\n  printf(\"    - meta[%\" PRIzx \"]:\\n\", code_offset);\n\n  out_stream_->WriteMemoryDump(data, size, 0, PrintChars::Yes, \"     - \");\n  return Result::Ok;\n}\n\n}  // end anonymous namespace\n\nstd::string_view ObjdumpNames::Get(Index index) const {\n  auto iter = names.find(index);\n  if (iter == names.end())\n    return std::string_view();\n  return iter->second;\n}\n\nvoid ObjdumpNames::Set(Index index, std::string_view name) {\n  names[index] = std::string(name);\n}\n\nstd::string_view ObjdumpLocalNames::Get(Index function_index,\n                                        Index local_index) const {\n  auto iter = names.find(std::pair<Index, Index>(function_index, local_index));\n  if (iter == names.end())\n    return std::string_view();\n  return iter->second;\n}\n\nvoid ObjdumpLocalNames::Set(Index function_index,\n                            Index local_index,\n                            std::string_view name) {\n  names[std::pair<Index, Index>(function_index, local_index)] =\n      std::string(name);\n}\n\nResult ReadBinaryObjdump(const uint8_t* data,\n                         size_t size,\n                         ObjdumpOptions* options,\n                         ObjdumpState* state) {\n  Features features;\n  features.EnableAll();\n  const bool kReadDebugNames = true;\n  const bool kStopOnFirstError = false;\n  const bool kFailOnCustomSectionError = false;\n  ReadBinaryOptions read_options(features, options->log_stream, kReadDebugNames,\n                                 kStopOnFirstError, kFailOnCustomSectionError);\n\n  switch (options->mode) {\n    case ObjdumpMode::Prepass: {\n      read_options.skip_function_bodies = true;\n      BinaryReaderObjdumpPrepass reader(data, size, options, state);\n      return ReadBinary(data, size, &reader, read_options);\n    }\n    case ObjdumpMode::Disassemble: {\n      BinaryReaderObjdumpDisassemble reader(data, size, options, state);\n      return ReadBinary(data, size, &reader, read_options);\n    }\n    default: {\n      read_options.skip_function_bodies = true;\n      BinaryReaderObjdump reader(data, size, options, state);\n      return ReadBinary(data, size, &reader, read_options);\n    }\n  }\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binary-reader-stats.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binary-reader-stats.h\"\n\n#include <cassert>\n#include <cinttypes>\n#include <cstdarg>\n#include <cstdint>\n#include <cstdio>\n\n#include \"wabt/binary-reader-nop.h\"\n#include \"wabt/common.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/stream.h\"\n\nnamespace wabt {\n\nOpcodeInfo::OpcodeInfo(Opcode opcode, Kind kind)\n    : opcode_(opcode), kind_(kind) {}\n\ntemplate <typename T>\nOpcodeInfo::OpcodeInfo(Opcode opcode, Kind kind, T* data, size_t count)\n    : OpcodeInfo(opcode, kind) {\n  if (count > 0) {\n    data_.resize(sizeof(T) * count);\n    memcpy(data_.data(), data, data_.size());\n  }\n}\n\ntemplate <typename T>\nOpcodeInfo::OpcodeInfo(Opcode opcode, Kind kind, T* data, size_t count, T extra)\n    : OpcodeInfo(opcode, kind, data, count) {\n  data_.resize(data_.size() + sizeof(T));\n  memcpy(data_.data() + data_.size() - sizeof(T), &extra, sizeof(T));\n}\n\ntemplate <typename T>\nstd::pair<const T*, size_t> OpcodeInfo::GetDataArray() const {\n  if (data_.empty()) {\n    return std::pair<const T*, size_t>(nullptr, 0);\n  }\n\n  assert(data_.size() % sizeof(T) == 0);\n  return std::make_pair(reinterpret_cast<const T*>(data_.data()),\n                        data_.size() / sizeof(T));\n}\n\ntemplate <typename T>\nconst T* OpcodeInfo::GetData(size_t expected_size) const {\n  auto [data, size] = GetDataArray<T>();\n  assert(size == expected_size);\n  return data;\n}\n\ntemplate <typename T, typename F>\nvoid OpcodeInfo::WriteArray(Stream& stream, F&& write_func) {\n  auto [data, size] = GetDataArray<T>();\n  for (size_t i = 0; i < size; ++i) {\n    // Write an initial space (to separate from the opcode name) first, then\n    // comma-separate.\n    stream.Writef(\"%s\", i == 0 ? \" \" : \", \");\n    write_func(data[i]);\n  }\n}\n\nvoid OpcodeInfo::Write(Stream& stream) {\n  stream.Writef(\"%s\", opcode_.GetName());\n\n  switch (kind_) {\n    case Kind::Bare:\n      break;\n\n    case Kind::Uint32:\n      stream.Writef(\" %u (0x%x)\", *GetData<uint32_t>(), *GetData<uint32_t>());\n      break;\n\n    case Kind::Uint64:\n      stream.Writef(\" %\" PRIu64 \" (0x%\" PRIx64 \")\", *GetData<uint64_t>(),\n                    *GetData<uint64_t>());\n      break;\n\n    case Kind::Index:\n      stream.Writef(\" %\" PRIindex, *GetData<Index>());\n      break;\n\n    case Kind::Float32: {\n      stream.Writef(\" %g\", *GetData<float>());\n      char buffer[WABT_MAX_FLOAT_HEX + 1];\n      WriteFloatHex(buffer, sizeof(buffer), *GetData<uint32_t>());\n      stream.Writef(\" (%s)\", buffer);\n      break;\n    }\n\n    case Kind::Float64: {\n      stream.Writef(\" %g\", *GetData<double>());\n      char buffer[WABT_MAX_DOUBLE_HEX + 1];\n      WriteDoubleHex(buffer, sizeof(buffer), *GetData<uint64_t>());\n      stream.Writef(\" (%s)\", buffer);\n      break;\n    }\n\n    case Kind::V128: {\n      auto data = *GetData<v128>();\n      auto l0 = data.u32(0);\n      auto l1 = data.u32(1);\n      auto l2 = data.u32(2);\n      auto l3 = data.u32(3);\n      stream.Writef(\" %u %u %u %u (0x%x 0x%x 0x%x 0x%x)\", l0, l1, l2, l3, l0,\n                    l1, l2, l3);\n      break;\n    }\n\n    case Kind::Uint32Uint32:\n    case Kind::Uint32Uint32Uint32:\n    case Kind::Uint32Uint32Uint32Uint32:\n      WriteArray<uint32_t>(\n          stream, [&stream](uint32_t value) { stream.Writef(\"%u\", value); });\n      break;\n\n    case Kind::BlockSig: {\n      auto type = *GetData<Type>();\n      if (type.IsIndex()) {\n        stream.Writef(\" type:%d\", type.GetIndex());\n      } else if (type != Type::Void) {\n        stream.Writef(\" %s\", type.GetName().c_str());\n      }\n      break;\n    }\n\n    case Kind::BrTable: {\n      WriteArray<Index>(stream, [&stream](Index index) {\n        stream.Writef(\"%\" PRIindex, index);\n      });\n      break;\n    }\n  }\n}\n\nbool operator==(const OpcodeInfo& lhs, const OpcodeInfo& rhs) {\n  return lhs.opcode_ == rhs.opcode_ && lhs.kind_ == rhs.kind_ &&\n         lhs.data_ == rhs.data_;\n}\n\nbool operator!=(const OpcodeInfo& lhs, const OpcodeInfo& rhs) {\n  return !(lhs == rhs);\n}\n\nbool operator<(const OpcodeInfo& lhs, const OpcodeInfo& rhs) {\n  if (lhs.opcode_ < rhs.opcode_) {\n    return true;\n  }\n  if (lhs.opcode_ > rhs.opcode_) {\n    return false;\n  }\n  if (lhs.kind_ < rhs.kind_) {\n    return true;\n  }\n  if (lhs.kind_ > rhs.kind_) {\n    return false;\n  }\n  if (lhs.data_ < rhs.data_) {\n    return true;\n  }\n  if (lhs.data_ > rhs.data_) {\n    return false;\n  }\n  return false;\n}\n\nbool operator<=(const OpcodeInfo& lhs, const OpcodeInfo& rhs) {\n  return lhs < rhs || lhs == rhs;\n}\n\nbool operator>(const OpcodeInfo& lhs, const OpcodeInfo& rhs) {\n  return !(lhs <= rhs);\n}\n\nbool operator>=(const OpcodeInfo& lhs, const OpcodeInfo& rhs) {\n  return !(lhs < rhs);\n}\n\nnamespace {\n\nclass BinaryReaderOpcnt : public BinaryReaderNop {\n public:\n  explicit BinaryReaderOpcnt(OpcodeInfoCounts* counts);\n\n  Result OnOpcode(Opcode opcode) override;\n  Result OnOpcodeBare() override;\n  Result OnOpcodeUint32(uint32_t value) override;\n  Result OnOpcodeIndex(Index value) override;\n  Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) override;\n  Result OnOpcodeUint32Uint32Uint32(uint32_t value,\n                                    uint32_t value2,\n                                    uint32_t value3) override;\n  Result OnOpcodeUint64(uint64_t value) override;\n  Result OnOpcodeF32(uint32_t value) override;\n  Result OnOpcodeF64(uint64_t value) override;\n  Result OnOpcodeV128(v128 value) override;\n  Result OnOpcodeBlockSig(Type sig_type) override;\n  Result OnBrTableExpr(Index num_targets,\n                       Index* target_depths,\n                       Index default_target_depth) override;\n  Result OnEndExpr() override;\n\n private:\n  template <typename... Args>\n  Result Emplace(Args&&... args);\n\n  OpcodeInfoCounts* opcode_counts_;\n  Opcode current_opcode_;\n};\n\ntemplate <typename... Args>\nResult BinaryReaderOpcnt::Emplace(Args&&... args) {\n  auto pair = opcode_counts_->emplace(\n      std::piecewise_construct, std::make_tuple(std::forward<Args>(args)...),\n      std::make_tuple(0));\n\n  auto& count = pair.first->second;\n  count++;\n  return Result::Ok;\n}\n\nBinaryReaderOpcnt::BinaryReaderOpcnt(OpcodeInfoCounts* counts)\n    : opcode_counts_(counts) {}\n\nResult BinaryReaderOpcnt::OnOpcode(Opcode opcode) {\n  current_opcode_ = opcode;\n  return Result::Ok;\n}\n\nResult BinaryReaderOpcnt::OnOpcodeBare() {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::Bare);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeUint32(uint32_t value) {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::Uint32, &value);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeIndex(Index value) {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::Index, &value);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeUint32Uint32(uint32_t value0,\n                                               uint32_t value1) {\n  uint32_t array[2] = {value0, value1};\n  return Emplace(current_opcode_, OpcodeInfo::Kind::Uint32Uint32, array, 2);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeUint32Uint32Uint32(uint32_t value0,\n                                                     uint32_t value1,\n                                                     uint32_t value2) {\n  uint32_t array[3] = {value0, value1, value2};\n  return Emplace(current_opcode_, OpcodeInfo::Kind::Uint32Uint32Uint32, array,\n                 3);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeUint64(uint64_t value) {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::Uint64, &value);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeF32(uint32_t value) {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::Float32, &value);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeF64(uint64_t value) {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::Float64, &value);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeV128(v128 value) {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::V128, &value);\n}\n\nResult BinaryReaderOpcnt::OnOpcodeBlockSig(Type sig_type) {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::BlockSig, &sig_type);\n}\n\nResult BinaryReaderOpcnt::OnBrTableExpr(Index num_targets,\n                                        Index* target_depths,\n                                        Index default_target_depth) {\n  return Emplace(current_opcode_, OpcodeInfo::Kind::BrTable, target_depths,\n                 num_targets, default_target_depth);\n}\n\nResult BinaryReaderOpcnt::OnEndExpr() {\n  return Emplace(Opcode::End, OpcodeInfo::Kind::Bare);\n}\n\n}  // end anonymous namespace\n\nResult ReadBinaryOpcnt(const void* data,\n                       size_t size,\n                       const ReadBinaryOptions& options,\n                       OpcodeInfoCounts* counts) {\n  BinaryReaderOpcnt reader(counts);\n  return ReadBinary(data, size, &reader, options);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binary-reader.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binary-reader.h\"\n\n#include <cassert>\n#include <cinttypes>\n#include <cstdarg>\n#include <cstdint>\n#include <cstdio>\n#include <cstring>\n#include <stack>\n#include <vector>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/binary-reader-logging.h\"\n#include \"wabt/binary.h\"\n#include \"wabt/leb128.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/utf8.h\"\n\n#if HAVE_ALLOCA\n#include <alloca.h>\n#endif\n\n#define ERROR(...)           \\\n  do {                       \\\n    PrintError(__VA_ARGS__); \\\n    return Result::Error;    \\\n  } while (0)\n\n#define ERROR_IF(expr, ...) \\\n  do {                      \\\n    if (expr) {             \\\n      ERROR(__VA_ARGS__);   \\\n    }                       \\\n  } while (0)\n\n#define ERROR_UNLESS(expr, ...) ERROR_IF(!(expr), __VA_ARGS__)\n\n#define ERROR_UNLESS_OPCODE_ENABLED(opcode)     \\\n  do {                                          \\\n    if (!opcode.IsEnabled(options_.features)) { \\\n      return ReportUnexpectedOpcode(opcode);    \\\n    }                                           \\\n  } while (0)\n\n#define CALLBACK0(member) \\\n  ERROR_UNLESS(Succeeded(delegate_->member()), #member \" callback failed\")\n\n#define CALLBACK(member, ...)                             \\\n  ERROR_UNLESS(Succeeded(delegate_->member(__VA_ARGS__)), \\\n               #member \" callback failed\")\n\nnamespace wabt {\n\nnamespace {\n\nclass BinaryReader {\n public:\n  struct ReadModuleOptions {\n    bool stop_on_first_error;\n  };\n\n  BinaryReader(const void* data,\n               size_t size,\n               BinaryReaderDelegate* delegate,\n               const ReadBinaryOptions& options);\n\n  Result ReadModule(const ReadModuleOptions& options);\n\n private:\n  template <typename T, T BinaryReader::*member>\n  struct ValueRestoreGuard {\n    explicit ValueRestoreGuard(BinaryReader* this_)\n        : this_(this_), previous_value_(this_->*member) {}\n    ~ValueRestoreGuard() { this_->*member = previous_value_; }\n\n    BinaryReader* this_;\n    T previous_value_;\n  };\n\n  struct ReadSectionsOptions {\n    bool stop_on_first_error;\n  };\n\n  void WABT_PRINTF_FORMAT(2, 3) PrintError(const char* format, ...);\n  [[nodiscard]] Result ReadOpcode(Opcode* out_value, const char* desc);\n  template <typename T>\n  [[nodiscard]] Result ReadT(T* out_value,\n                             const char* type_name,\n                             const char* desc);\n  [[nodiscard]] Result ReadU8(uint8_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadU16(uint16_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadU32(uint32_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadF32(uint32_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadF64(uint64_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadV128(v128* out_value, const char* desc);\n  [[nodiscard]] Result ReadU32Leb128(uint32_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadU64Leb128(uint64_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadS32Leb128(uint32_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadS64Leb128(uint64_t* out_value, const char* desc);\n  [[nodiscard]] Result ReadType(Type* out_value, const char* desc);\n  [[nodiscard]] Result ReadRefType(Type* out_value, const char* desc);\n  [[nodiscard]] Result ReadExternalKind(ExternalKind* out_value,\n                                        const char* desc,\n                                        const char* type);\n  [[nodiscard]] Result ReadStr(std::string_view* out_str, const char* desc);\n  [[nodiscard]] Result ReadBytes(const void** out_data,\n                                 Address* out_data_size,\n                                 const char* desc);\n  [[nodiscard]] Result ReadBytesWithSize(const void** out_data,\n                                         Offset size,\n                                         const char* desc);\n  [[nodiscard]] Result ReadIndex(Index* index, const char* desc);\n  [[nodiscard]] Result ReadOffset(Offset* offset, const char* desc);\n  [[nodiscard]] Result ReadAlignment(Address* align_log2, const char* desc);\n  [[nodiscard]] Result CheckAlignment(Address* align_log2, const char* desc);\n  [[nodiscard]] Result TakeHasMemidx(Address* align_log2, bool* has_memidx);\n  [[nodiscard]] Result ReadMemidx(Index* memidx, const char* desc);\n  [[nodiscard]] Result ReadMemLocation(Address* alignment_log2,\n                                       Index* memidx,\n                                       Address* offset,\n                                       const char* desc_align,\n                                       const char* desc_memidx,\n                                       const char* desc_offset,\n                                       uint8_t* lane_val = nullptr);\n  [[nodiscard]] Result CallbackMemLocation(const Address* alignment_log2,\n                                           const Index* memidx,\n                                           const Address* offset,\n                                           const uint8_t* lane_val = nullptr);\n  [[nodiscard]] Result ReadCount(Index* index, const char* desc);\n  [[nodiscard]] Result ReadField(TypeMut* out_value);\n\n  bool IsConcreteReferenceType(Type::Enum);\n  bool IsConcreteType(Type);\n  bool IsBlockType(Type);\n\n  Index NumTotalFuncs();\n\n  [[nodiscard]] Result ReadInitExpr(Index index);\n  [[nodiscard]] Result ReadTable(Limits* out_elem_limits);\n  [[nodiscard]] Result ReadMemory(Limits* out_page_limits,\n                                  uint32_t* out_page_size);\n  [[nodiscard]] Result ReadGlobalHeader(Type* out_type, bool* out_mutable);\n  [[nodiscard]] Result ReadTagType(Index* out_sig_index);\n  [[nodiscard]] Result ReadAddress(Address* out_value,\n                                   Index memory,\n                                   const char* desc);\n  [[nodiscard]] Result ReadFunctionBody(Offset end_offset);\n  // ReadInstructions reads until end_offset or the nesting depth reaches zero.\n  [[nodiscard]] Result ReadInstructions(Offset end_offset, const char* context);\n  [[nodiscard]] Result ReadNameSection(Offset section_size);\n  [[nodiscard]] Result ReadRelocSection(Offset section_size);\n  [[nodiscard]] Result ReadDylinkSection(Offset section_size);\n  [[nodiscard]] Result ReadGenericCustomSection(std::string_view name,\n                                                Offset section_size);\n  [[nodiscard]] Result ReadDylink0Section(Offset section_size);\n  [[nodiscard]] Result ReadTargetFeaturesSections(Offset section_size);\n  [[nodiscard]] Result ReadLinkingSection(Offset section_size);\n  [[nodiscard]] Result ReadCodeMetadataSection(std::string_view name,\n                                               Offset section_size);\n  [[nodiscard]] Result ReadCustomSection(Index section_index,\n                                         Offset section_size);\n  [[nodiscard]] Result ReadTypeSection(Offset section_size);\n  [[nodiscard]] Result ReadImport(Index i,\n                                  std::string_view module_name,\n                                  std::string_view field_name,\n                                  ExternalKind kind);\n  [[nodiscard]] Result ReadImportSection(Offset section_size);\n  [[nodiscard]] Result ReadFunctionSection(Offset section_size);\n  [[nodiscard]] Result ReadTableSection(Offset section_size);\n  [[nodiscard]] Result ReadMemorySection(Offset section_size);\n  [[nodiscard]] Result ReadGlobalSection(Offset section_size);\n  [[nodiscard]] Result ReadExportSection(Offset section_size);\n  [[nodiscard]] Result ReadStartSection(Offset section_size);\n  [[nodiscard]] Result ReadElemSection(Offset section_size);\n  [[nodiscard]] Result ReadCodeSection(Offset section_size);\n  [[nodiscard]] Result ReadDataSection(Offset section_size);\n  [[nodiscard]] Result ReadDataCountSection(Offset section_size);\n  [[nodiscard]] Result ReadTagSection(Offset section_size);\n  [[nodiscard]] Result ReadSections(const ReadSectionsOptions& options);\n  Result ReportUnexpectedOpcode(Opcode opcode, const char* message = nullptr);\n\n  size_t read_end_ = 0;  // Either the section end or data_size.\n  BinaryReaderDelegate::State state_;\n  BinaryReaderLogging logging_delegate_;\n  BinaryReaderDelegate* delegate_ = nullptr;\n  TypeVector param_types_;\n  TypeVector result_types_;\n  TypeMutVector fields_;\n  std::vector<Index> target_depths_;\n  CatchClauseVector catches_;\n  const ReadBinaryOptions& options_;\n  BinarySection last_known_section_ = BinarySection::Invalid;\n  bool did_read_names_section_ = false;\n  bool reading_custom_section_ = false;\n  Index num_func_imports_ = 0;\n  Index num_table_imports_ = 0;\n  Index num_memory_imports_ = 0;\n  Index num_global_imports_ = 0;\n  Index num_tag_imports_ = 0;\n  Index num_function_signatures_ = 0;\n  Index num_function_bodies_ = 0;\n  Index num_data_segments_ = 0;\n  Index data_count_ = kInvalidIndex;\n\n  using ReadEndRestoreGuard =\n      ValueRestoreGuard<size_t, &BinaryReader::read_end_>;\n};\n\nBinaryReader::BinaryReader(const void* data,\n                           size_t size,\n                           BinaryReaderDelegate* delegate,\n                           const ReadBinaryOptions& options)\n    : read_end_(size),\n      state_(static_cast<const uint8_t*>(data), size),\n      logging_delegate_(options.log_stream, delegate),\n      delegate_(options.log_stream ? &logging_delegate_ : delegate),\n      options_(options),\n      last_known_section_(BinarySection::Invalid) {\n  delegate->OnSetState(&state_);\n}\n\nvoid WABT_PRINTF_FORMAT(2, 3) BinaryReader::PrintError(const char* format,\n                                                       ...) {\n  ErrorLevel error_level =\n      reading_custom_section_ && !options_.fail_on_custom_section_error\n          ? ErrorLevel::Warning\n          : ErrorLevel::Error;\n\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  Error error(error_level, Location(state_.offset), buffer);\n  bool handled = delegate_->OnError(error);\n\n  if (!handled) {\n    // Not great to just print, but we don't want to eat the error either.\n    fprintf(stderr, \"%07\" PRIzx \": %s: %s\\n\", state_.offset,\n            GetErrorLevelName(error_level), buffer);\n  }\n}\n\nResult BinaryReader::ReportUnexpectedOpcode(Opcode opcode, const char* where) {\n  std::string message = \"unexpected opcode\";\n  if (where) {\n    message += ' ';\n    message += where;\n  }\n\n  message += \":\";\n\n  std::vector<uint8_t> bytes = opcode.GetBytes();\n  assert(bytes.size() > 0);\n\n  for (uint8_t byte : bytes) {\n    message += StringPrintf(\" 0x%x\", byte);\n  }\n\n  PrintError(\"%s\", message.c_str());\n  return Result::Error;\n}\n\nResult BinaryReader::ReadOpcode(Opcode* out_value, const char* desc) {\n  uint8_t value = 0;\n  CHECK_RESULT(ReadU8(&value, desc));\n\n  if (Opcode::IsPrefixByte(value)) {\n    uint32_t code;\n    CHECK_RESULT(ReadU32Leb128(&code, desc));\n    *out_value = Opcode::FromCode(value, code);\n  } else {\n    *out_value = Opcode::FromCode(value);\n  }\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult BinaryReader::ReadT(T* out_value,\n                           const char* type_name,\n                           const char* desc) {\n  if (state_.offset + sizeof(T) > read_end_) {\n    PrintError(\"unable to read %s: %s\", type_name, desc);\n    return Result::Error;\n  }\n#if WABT_BIG_ENDIAN\n  uint8_t tmp[sizeof(T)];\n  memcpy(tmp, state_.data + state_.offset, sizeof(tmp));\n  SwapBytesSized(tmp, sizeof(tmp));\n  memcpy(out_value, tmp, sizeof(T));\n#else\n  memcpy(out_value, state_.data + state_.offset, sizeof(T));\n#endif\n  state_.offset += sizeof(T);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadU8(uint8_t* out_value, const char* desc) {\n  return ReadT(out_value, \"uint8_t\", desc);\n}\n\nResult BinaryReader::ReadU16(uint16_t* out_value, const char* desc) {\n  return ReadT(out_value, \"uint16_t\", desc);\n}\n\nResult BinaryReader::ReadU32(uint32_t* out_value, const char* desc) {\n  return ReadT(out_value, \"uint32_t\", desc);\n}\n\nResult BinaryReader::ReadF32(uint32_t* out_value, const char* desc) {\n  return ReadT(out_value, \"float\", desc);\n}\n\nResult BinaryReader::ReadF64(uint64_t* out_value, const char* desc) {\n  return ReadT(out_value, \"double\", desc);\n}\n\nResult BinaryReader::ReadV128(v128* out_value, const char* desc) {\n  return ReadT(out_value, \"v128\", desc);\n}\n\nResult BinaryReader::ReadU32Leb128(uint32_t* out_value, const char* desc) {\n  const uint8_t* p = state_.data + state_.offset;\n  const uint8_t* end = state_.data + read_end_;\n  size_t bytes_read = wabt::ReadU32Leb128(p, end, out_value);\n  ERROR_UNLESS(bytes_read > 0, \"unable to read u32 leb128: %s\", desc);\n  state_.offset += bytes_read;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadU64Leb128(uint64_t* out_value, const char* desc) {\n  const uint8_t* p = state_.data + state_.offset;\n  const uint8_t* end = state_.data + read_end_;\n  size_t bytes_read = wabt::ReadU64Leb128(p, end, out_value);\n  ERROR_UNLESS(bytes_read > 0, \"unable to read u64 leb128: %s\", desc);\n  state_.offset += bytes_read;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadS32Leb128(uint32_t* out_value, const char* desc) {\n  const uint8_t* p = state_.data + state_.offset;\n  const uint8_t* end = state_.data + read_end_;\n  size_t bytes_read = wabt::ReadS32Leb128(p, end, out_value);\n  ERROR_UNLESS(bytes_read > 0, \"unable to read i32 leb128: %s\", desc);\n  state_.offset += bytes_read;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadS64Leb128(uint64_t* out_value, const char* desc) {\n  const uint8_t* p = state_.data + state_.offset;\n  const uint8_t* end = state_.data + read_end_;\n  size_t bytes_read = wabt::ReadS64Leb128(p, end, out_value);\n  ERROR_UNLESS(bytes_read > 0, \"unable to read i64 leb128: %s\", desc);\n  state_.offset += bytes_read;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadType(Type* out_value, const char* desc) {\n  uint32_t type = 0;\n  CHECK_RESULT(ReadS32Leb128(&type, desc));\n  if (options_.features.reference_types_enabled() &&\n      Type::EnumIsReferenceWithIndex(static_cast<Type::Enum>(type))) {\n    uint64_t heap_type = 0;\n    CHECK_RESULT(ReadS64Leb128(&heap_type, desc));\n\n    if (static_cast<int64_t>(heap_type) < 0 ||\n        static_cast<int64_t>(heap_type) >= kInvalidIndex) {\n      Type::Enum heap_type_code = static_cast<Type::Enum>(heap_type);\n      ERROR_UNLESS(\n          heap_type_code == Type::FuncRef || heap_type_code == Type::ExternRef,\n          \"Reference type is limited to func and extern: %s\", desc);\n      type = (static_cast<Type::Enum>(type) == Type::Ref)\n                 ? Type::ReferenceNonNull\n                 : Type::ReferenceOrNull;\n      *out_value = Type(heap_type_code, type);\n    } else {\n      *out_value =\n          Type(static_cast<Type::Enum>(type), static_cast<Index>(heap_type));\n    }\n  } else {\n    *out_value = static_cast<Type>(type);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadRefType(Type* out_value, const char* desc) {\n  CHECK_RESULT(ReadType(out_value, desc));\n  ERROR_UNLESS(out_value->IsRef(), \"%s must be a reference type\", desc);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadExternalKind(ExternalKind* out_value,\n                                      const char* desc,\n                                      const char* type) {\n  uint8_t value = 0;\n  CHECK_RESULT(ReadU8(&value, desc));\n  ERROR_UNLESS(value < kExternalKindCount, \"invalid %s external kind: %d\", type,\n               value);\n  *out_value = static_cast<ExternalKind>(value);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadStr(std::string_view* out_str, const char* desc) {\n  uint32_t str_len = 0;\n  CHECK_RESULT(ReadU32Leb128(&str_len, \"string length\"));\n\n  ERROR_UNLESS(str_len <= read_end_ - state_.offset,\n               \"unable to read string: %s\", desc);\n\n  *out_str = std::string_view(\n      reinterpret_cast<const char*>(state_.data) + state_.offset, str_len);\n  state_.offset += str_len;\n\n  ERROR_UNLESS(IsValidUtf8(out_str->data(), out_str->length()),\n               \"invalid utf-8 encoding: %s\", desc);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadBytes(const void** out_data,\n                               Address* out_data_size,\n                               const char* desc) {\n  uint32_t data_size = 0;\n  CHECK_RESULT(ReadU32Leb128(&data_size, \"data size\"));\n  CHECK_RESULT(ReadBytesWithSize(out_data, data_size, desc));\n  *out_data_size = data_size;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadBytesWithSize(const void** out_data,\n                                       Offset size,\n                                       const char* desc) {\n  ERROR_UNLESS(size <= read_end_ - state_.offset, \"unable to read data: %s\",\n               desc);\n\n  *out_data = static_cast<const uint8_t*>(state_.data) + state_.offset;\n  state_.offset += size;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadIndex(Index* index, const char* desc) {\n  uint32_t value;\n  CHECK_RESULT(ReadU32Leb128(&value, desc));\n  *index = value;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadOffset(Offset* offset, const char* desc) {\n  uint32_t value;\n  CHECK_RESULT(ReadU32Leb128(&value, desc));\n  *offset = value;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadAlignment(Address* alignment_log2, const char* desc) {\n  uint32_t value;\n  CHECK_RESULT(ReadU32Leb128(&value, desc));\n  *alignment_log2 = value;\n  return Result::Ok;\n}\n\nResult BinaryReader::CheckAlignment(Address* align_log2, const char* desc) {\n  uint32_t value = *align_log2;\n  if (value >= 32) {\n    PrintError(\"invalid %s: %\" PRIu32, desc, value);\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReader::TakeHasMemidx(Address* align_log2, bool* has_memidx) {\n  // extract the has_memidx flag\n  *has_memidx = (*align_log2 >> 6) & 1;\n  // then clear it\n  *align_log2 &= ~(1 << 6);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadMemidx(Index* memidx, const char* desc) {\n  CHECK_RESULT(ReadIndex(memidx, desc));\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadMemLocation(Address* alignment_log2,\n                                     Index* memidx,\n                                     Address* offset,\n                                     const char* desc_align,\n                                     const char* desc_memidx,\n                                     const char* desc_offset,\n                                     uint8_t* lane_val) {\n  bool has_memidx = false;\n  CHECK_RESULT(ReadAlignment(alignment_log2, desc_align));\n  CHECK_RESULT(TakeHasMemidx(alignment_log2, &has_memidx));\n  CHECK_RESULT(CheckAlignment(alignment_log2, desc_align));\n  *memidx = 0;\n  if (has_memidx) {\n    ERROR_IF(!options_.features.multi_memory_enabled(),\n             \"multi_memory not allowed\");\n    CHECK_RESULT(ReadMemidx(memidx, desc_memidx));\n  }\n  CHECK_RESULT(ReadAddress(offset, 0, desc_offset));\n\n  if (lane_val) {\n    CHECK_RESULT(ReadU8(lane_val, \"Lane idx\"));\n  }\n\n  return Result::Ok;\n}\n\nResult BinaryReader::CallbackMemLocation(const Address* alignment_log2,\n                                         const Index* memidx,\n                                         const Address* offset,\n                                         const uint8_t* lane_val) {\n  if (lane_val) {\n    if (*memidx) {\n      CALLBACK(OnOpcodeUint32Uint32Uint32Uint32, *alignment_log2, *memidx,\n               *offset, *lane_val);\n    } else {\n      CALLBACK(OnOpcodeUint32Uint32Uint32, *alignment_log2, *offset, *lane_val);\n    }\n  } else {\n    if (*memidx) {\n      CALLBACK(OnOpcodeUint32Uint32Uint32, *alignment_log2, *memidx, *offset);\n    } else {\n      CALLBACK(OnOpcodeUint32Uint32, *alignment_log2, *offset);\n    }\n  }\n\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadCount(Index* count, const char* desc) {\n  CHECK_RESULT(ReadIndex(count, desc));\n\n  // This check assumes that each item follows in this section, and takes at\n  // least 1 byte. It's possible that this check passes but reading fails\n  // later. It is still useful to check here, though, because it early-outs\n  // when an erroneous large count is used, before allocating memory for it.\n  size_t section_remaining = read_end_ - state_.offset;\n  if (*count > section_remaining) {\n    PrintError(\"invalid %s %\" PRIindex \", only %\" PRIzd\n               \" bytes left in section\",\n               desc, *count, section_remaining);\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadField(TypeMut* out_value) {\n  // TODO: Reuse for global header too?\n  Type field_type;\n  CHECK_RESULT(ReadType(&field_type, \"field type\"));\n  ERROR_UNLESS(IsConcreteType(field_type),\n               \"expected valid field type (got \" PRItypecode \")\",\n               WABT_PRINTF_TYPE_CODE(field_type));\n\n  uint8_t mutable_ = 0;\n  CHECK_RESULT(ReadU8(&mutable_, \"field mutability\"));\n  ERROR_UNLESS(mutable_ <= 1, \"field mutability must be 0 or 1\");\n  out_value->type = field_type;\n  out_value->mutable_ = mutable_;\n  return Result::Ok;\n}\n\nbool BinaryReader::IsConcreteReferenceType(Type::Enum type) {\n  switch (type) {\n    case Type::FuncRef:\n    case Type::ExternRef:\n      return options_.features.reference_types_enabled();\n\n    case Type::ExnRef:\n      return options_.features.exceptions_enabled();\n\n    default:\n      return false;\n  }\n}\n\nbool BinaryReader::IsConcreteType(Type type) {\n  switch (type) {\n    case Type::I32:\n    case Type::I64:\n    case Type::F32:\n    case Type::F64:\n      return true;\n\n    case Type::V128:\n      return options_.features.simd_enabled();\n\n    case Type::Reference:\n    case Type::Ref:\n    case Type::RefNull:\n      return options_.features.function_references_enabled();\n\n    default:\n      return IsConcreteReferenceType(type);\n  }\n}\n\nbool BinaryReader::IsBlockType(Type type) {\n  if (IsConcreteType(type) || type == Type::Void) {\n    return true;\n  }\n\n  if (!(options_.features.multi_value_enabled() && type.IsIndex())) {\n    return false;\n  }\n\n  return true;\n}\n\nIndex BinaryReader::NumTotalFuncs() {\n  return num_func_imports_ + num_function_signatures_;\n}\n\nResult BinaryReader::ReadInitExpr(Index index) {\n  CHECK_RESULT(ReadInstructions(read_end_, \"init expression\"));\n  assert(state_.offset <= read_end_);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadTable(Limits* out_elem_limits) {\n  uint8_t flags;\n  uint32_t initial;\n  uint32_t max = 0;\n  CHECK_RESULT(ReadU8(&flags, \"table flags\"));\n  bool has_max = flags & WABT_BINARY_LIMITS_HAS_MAX_FLAG;\n  bool is_shared = flags & WABT_BINARY_LIMITS_IS_SHARED_FLAG;\n  bool is_64 = flags & WABT_BINARY_LIMITS_IS_64_FLAG;\n  const uint8_t unknown_flags = flags & ~WABT_BINARY_LIMITS_ALL_TABLE_FLAGS;\n  ERROR_IF(is_shared, \"tables may not be shared\");\n  ERROR_IF(is_64 && !options_.features.memory64_enabled(),\n           \"memory64 not allowed\");\n  ERROR_UNLESS(unknown_flags == 0, \"malformed table limits flag: %d\", flags);\n  CHECK_RESULT(ReadU32Leb128(&initial, \"table initial elem count\"));\n  if (has_max) {\n    CHECK_RESULT(ReadU32Leb128(&max, \"table max elem count\"));\n  }\n\n  out_elem_limits->has_max = has_max;\n  out_elem_limits->is_64 = is_64;\n  out_elem_limits->initial = initial;\n  out_elem_limits->max = max;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadMemory(Limits* out_page_limits,\n                                uint32_t* out_page_size) {\n  uint8_t flags;\n  uint64_t initial;\n  uint64_t max = 0;\n  CHECK_RESULT(ReadU8(&flags, \"memory flags\"));\n  bool has_max = flags & WABT_BINARY_LIMITS_HAS_MAX_FLAG;\n  bool is_shared = flags & WABT_BINARY_LIMITS_IS_SHARED_FLAG;\n  bool is_64 = flags & WABT_BINARY_LIMITS_IS_64_FLAG;\n  bool has_custom_page_size =\n      flags & WABT_BINARY_LIMITS_HAS_CUSTOM_PAGE_SIZE_FLAG;\n  const uint8_t unknown_flags = flags & ~WABT_BINARY_LIMITS_ALL_MEMORY_FLAGS;\n  ERROR_UNLESS(unknown_flags == 0, \"malformed memory limits flag: %d\", flags);\n  ERROR_IF(is_shared && !options_.features.threads_enabled(),\n           \"memory may not be shared: threads not allowed\");\n  ERROR_IF(is_64 && !options_.features.memory64_enabled(),\n           \"memory64 not allowed\");\n  ERROR_IF(\n      has_custom_page_size && !options_.features.custom_page_sizes_enabled(),\n      \"custom page sizes not allowed\");\n  if (options_.features.memory64_enabled()) {\n    CHECK_RESULT(ReadU64Leb128(&initial, \"memory initial page count\"));\n    if (has_max) {\n      CHECK_RESULT(ReadU64Leb128(&max, \"memory max page count\"));\n    }\n  } else {\n    uint32_t initial32;\n    CHECK_RESULT(ReadU32Leb128(&initial32, \"memory initial page count\"));\n    initial = initial32;\n    if (has_max) {\n      uint32_t max32;\n      CHECK_RESULT(ReadU32Leb128(&max32, \"memory max page count\"));\n      max = max32;\n    }\n  }\n  if (has_custom_page_size) {\n    uint32_t page_size_log2;\n    CHECK_RESULT(ReadU32Leb128(&page_size_log2, \"memory page size\"));\n    ERROR_IF(page_size_log2 > 16, \"malformed memory page size\");\n    *out_page_size = 1 << page_size_log2;\n  } else {\n    *out_page_size = WABT_DEFAULT_PAGE_SIZE;\n  }\n\n  out_page_limits->has_max = has_max;\n  out_page_limits->is_shared = is_shared;\n  out_page_limits->is_64 = is_64;\n  out_page_limits->initial = initial;\n  out_page_limits->max = max;\n\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadGlobalHeader(Type* out_type, bool* out_mutable) {\n  Type global_type = Type::Void;\n  uint8_t mutable_ = 0;\n  CHECK_RESULT(ReadType(&global_type, \"global type\"));\n  ERROR_UNLESS(IsConcreteType(global_type), \"invalid global type: %#x\",\n               static_cast<int>(global_type));\n\n  CHECK_RESULT(ReadU8(&mutable_, \"global mutability\"));\n  ERROR_UNLESS(mutable_ <= 1, \"global mutability must be 0 or 1\");\n\n  *out_type = global_type;\n  *out_mutable = mutable_;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadAddress(Address* out_value,\n                                 Index memory,\n                                 const char* desc) {\n  if (options_.features.memory64_enabled()) {\n    return ReadU64Leb128(out_value, desc);\n  } else {\n    uint32_t val;\n    Result res = ReadU32Leb128(&val, desc);\n    *out_value = val;\n    return res;\n  }\n}\n\nResult BinaryReader::ReadFunctionBody(Offset end_offset) {\n  uint64_t total_locals = 0;\n  Index num_local_decls;\n  CHECK_RESULT(ReadCount(&num_local_decls, \"local declaration count\"));\n  CALLBACK(OnLocalDeclCount, num_local_decls);\n  for (Index k = 0; k < num_local_decls; ++k) {\n    Index num_local_types;\n    CHECK_RESULT(ReadIndex(&num_local_types, \"local type count\"));\n    total_locals += num_local_types;\n    ERROR_UNLESS(total_locals <= UINT32_MAX, \"local count must be <= 0x%x\",\n                 UINT32_MAX);\n    Type local_type;\n    CHECK_RESULT(ReadType(&local_type, \"local type\"));\n    ERROR_UNLESS(IsConcreteType(local_type), \"expected valid local type\");\n    CALLBACK(OnLocalDecl, k, num_local_types, local_type);\n  }\n  CALLBACK(EndLocalDecls);\n  CHECK_RESULT(ReadInstructions(end_offset, \"function body\"));\n  ERROR_UNLESS(state_.offset == end_offset,\n               \"function body shorter than given size\");\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadInstructions(Offset end_offset, const char* context) {\n  std::stack<Opcode> nested_blocks;\n  while (state_.offset < end_offset) {\n    Opcode opcode;\n    CHECK_RESULT(ReadOpcode(&opcode, \"opcode\"));\n    CALLBACK(OnOpcode, opcode);\n    ERROR_UNLESS_OPCODE_ENABLED(opcode);\n\n    switch (opcode) {\n      case Opcode::Unreachable:\n        CALLBACK0(OnUnreachableExpr);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::Block: {\n        nested_blocks.push(opcode);\n        Type sig_type;\n        CHECK_RESULT(ReadType(&sig_type, \"block signature type\"));\n        ERROR_UNLESS(IsBlockType(sig_type),\n                     \"expected valid block signature type\");\n        CALLBACK(OnBlockExpr, sig_type);\n        CALLBACK(OnOpcodeBlockSig, sig_type);\n        break;\n      }\n\n      case Opcode::Loop: {\n        nested_blocks.push(opcode);\n        Type sig_type;\n        CHECK_RESULT(ReadType(&sig_type, \"loop signature type\"));\n        ERROR_UNLESS(IsBlockType(sig_type),\n                     \"expected valid block signature type\");\n        CALLBACK(OnLoopExpr, sig_type);\n        CALLBACK(OnOpcodeBlockSig, sig_type);\n        break;\n      }\n\n      case Opcode::If: {\n        nested_blocks.push(opcode);\n        Type sig_type;\n        CHECK_RESULT(ReadType(&sig_type, \"if signature type\"));\n        ERROR_UNLESS(IsBlockType(sig_type),\n                     \"expected valid block signature type\");\n        CALLBACK(OnIfExpr, sig_type);\n        CALLBACK(OnOpcodeBlockSig, sig_type);\n        break;\n      }\n\n      case Opcode::Else:\n        ERROR_IF(nested_blocks.empty() || (nested_blocks.top() != Opcode::If),\n                 \"else outside if block\");\n        CALLBACK0(OnElseExpr);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::SelectT: {\n        Index num_results;\n        CHECK_RESULT(ReadCount(&num_results, \"num result types\"));\n\n        result_types_.resize(num_results);\n        for (Index i = 0; i < num_results; ++i) {\n          Type result_type;\n          CHECK_RESULT(ReadType(&result_type, \"select result type\"));\n          ERROR_UNLESS(IsConcreteType(result_type),\n                       \"expected valid select result type (got \" PRItypecode\n                       \")\",\n                       WABT_PRINTF_TYPE_CODE(result_type));\n          result_types_[i] = result_type;\n        }\n\n        if (num_results) {\n          CALLBACK(OnSelectExpr, num_results, result_types_.data());\n          CALLBACK(OnOpcodeType, result_types_[0]);\n        } else {\n          CALLBACK(OnSelectExpr, 0, NULL);\n          CALLBACK0(OnOpcodeBare);\n        }\n        break;\n      }\n\n      case Opcode::Select:\n        CALLBACK(OnSelectExpr, 0, nullptr);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::Br: {\n        Index depth;\n        CHECK_RESULT(ReadIndex(&depth, \"br depth\"));\n        CALLBACK(OnBrExpr, depth);\n        CALLBACK(OnOpcodeIndex, depth);\n        break;\n      }\n\n      case Opcode::BrIf: {\n        Index depth;\n        CHECK_RESULT(ReadIndex(&depth, \"br_if depth\"));\n        CALLBACK(OnBrIfExpr, depth);\n        CALLBACK(OnOpcodeIndex, depth);\n        break;\n      }\n\n      case Opcode::BrOnNonNull: {\n        Index depth;\n        CHECK_RESULT(ReadIndex(&depth, \"br_on_non_null depth\"));\n        CALLBACK(OnBrOnNonNullExpr, depth);\n        CALLBACK(OnOpcodeIndex, depth);\n        break;\n      }\n\n      case Opcode::BrOnNull: {\n        Index depth;\n        CHECK_RESULT(ReadIndex(&depth, \"br_on_null depth\"));\n        CALLBACK(OnBrOnNullExpr, depth);\n        CALLBACK(OnOpcodeIndex, depth);\n        break;\n      }\n\n      case Opcode::BrTable: {\n        Index num_targets;\n        CHECK_RESULT(ReadCount(&num_targets, \"br_table target count\"));\n        target_depths_.resize(num_targets);\n\n        for (Index i = 0; i < num_targets; ++i) {\n          Index target_depth;\n          CHECK_RESULT(ReadIndex(&target_depth, \"br_table target depth\"));\n          target_depths_[i] = target_depth;\n        }\n\n        Index default_target_depth;\n        CHECK_RESULT(\n            ReadIndex(&default_target_depth, \"br_table default target depth\"));\n\n        Index* target_depths = num_targets ? target_depths_.data() : nullptr;\n\n        CALLBACK(OnBrTableExpr, num_targets, target_depths,\n                 default_target_depth);\n        break;\n      }\n\n      case Opcode::Return:\n        CALLBACK0(OnReturnExpr);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::Nop:\n        CALLBACK0(OnNopExpr);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::Drop:\n        CALLBACK0(OnDropExpr);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::End:\n        CALLBACK0(OnEndExpr);\n        if (nested_blocks.empty()) {\n          return Result::Ok;\n        }\n        nested_blocks.pop();\n        break;\n\n      case Opcode::I32Const: {\n        uint32_t value;\n        CHECK_RESULT(ReadS32Leb128(&value, \"i32.const value\"));\n        CALLBACK(OnI32ConstExpr, value);\n        CALLBACK(OnOpcodeUint32, value);\n        break;\n      }\n\n      case Opcode::I64Const: {\n        uint64_t value;\n        CHECK_RESULT(ReadS64Leb128(&value, \"i64.const value\"));\n        CALLBACK(OnI64ConstExpr, value);\n        CALLBACK(OnOpcodeUint64, value);\n        break;\n      }\n\n      case Opcode::F32Const: {\n        uint32_t value_bits = 0;\n        CHECK_RESULT(ReadF32(&value_bits, \"f32.const value\"));\n        CALLBACK(OnF32ConstExpr, value_bits);\n        CALLBACK(OnOpcodeF32, value_bits);\n        break;\n      }\n\n      case Opcode::F64Const: {\n        uint64_t value_bits = 0;\n        CHECK_RESULT(ReadF64(&value_bits, \"f64.const value\"));\n        CALLBACK(OnF64ConstExpr, value_bits);\n        CALLBACK(OnOpcodeF64, value_bits);\n        break;\n      }\n\n      case Opcode::V128Const: {\n        v128 value_bits;\n        ZeroMemory(value_bits);\n        CHECK_RESULT(ReadV128(&value_bits, \"v128.const value\"));\n        CALLBACK(OnV128ConstExpr, value_bits);\n        CALLBACK(OnOpcodeV128, value_bits);\n        break;\n      }\n\n      case Opcode::GlobalGet: {\n        Index global_index;\n        CHECK_RESULT(ReadIndex(&global_index, \"global.get global index\"));\n        CALLBACK(OnGlobalGetExpr, global_index);\n        CALLBACK(OnOpcodeIndex, global_index);\n        break;\n      }\n\n      case Opcode::LocalGet: {\n        Index local_index;\n        CHECK_RESULT(ReadIndex(&local_index, \"local.get local index\"));\n        CALLBACK(OnLocalGetExpr, local_index);\n        CALLBACK(OnOpcodeIndex, local_index);\n        break;\n      }\n\n      case Opcode::GlobalSet: {\n        Index global_index;\n        CHECK_RESULT(ReadIndex(&global_index, \"global.set global index\"));\n        CALLBACK(OnGlobalSetExpr, global_index);\n        CALLBACK(OnOpcodeIndex, global_index);\n        break;\n      }\n\n      case Opcode::LocalSet: {\n        Index local_index;\n        CHECK_RESULT(ReadIndex(&local_index, \"local.set local index\"));\n        CALLBACK(OnLocalSetExpr, local_index);\n        CALLBACK(OnOpcodeIndex, local_index);\n        break;\n      }\n\n      case Opcode::Call: {\n        Index func_index;\n        CHECK_RESULT(ReadIndex(&func_index, \"call function index\"));\n        CALLBACK(OnCallExpr, func_index);\n        CALLBACK(OnOpcodeIndex, func_index);\n        break;\n      }\n\n      case Opcode::CallIndirect: {\n        Index sig_index;\n        CHECK_RESULT(ReadIndex(&sig_index, \"call_indirect signature index\"));\n        Index table_index = 0;\n        if (options_.features.reference_types_enabled()) {\n          CHECK_RESULT(ReadIndex(&table_index, \"call_indirect table index\"));\n        } else {\n          uint8_t reserved;\n          CHECK_RESULT(ReadU8(&reserved, \"call_indirect reserved\"));\n          ERROR_UNLESS(reserved == 0, \"call_indirect reserved value must be 0\");\n        }\n        CALLBACK(OnCallIndirectExpr, sig_index, table_index);\n        CALLBACK(OnOpcodeUint32Uint32, sig_index, table_index);\n        break;\n      }\n\n      case Opcode::ReturnCall: {\n        Index func_index;\n        CHECK_RESULT(ReadIndex(&func_index, \"return_call\"));\n        CALLBACK(OnReturnCallExpr, func_index);\n        CALLBACK(OnOpcodeIndex, func_index);\n        break;\n      }\n\n      case Opcode::ReturnCallIndirect: {\n        Index sig_index;\n        CHECK_RESULT(ReadIndex(&sig_index, \"return_call_indirect\"));\n        Index table_index = 0;\n        if (options_.features.reference_types_enabled()) {\n          CHECK_RESULT(\n              ReadIndex(&table_index, \"return_call_indirect table index\"));\n        } else {\n          uint8_t reserved;\n          CHECK_RESULT(ReadU8(&reserved, \"return_call_indirect reserved\"));\n          ERROR_UNLESS(reserved == 0,\n                       \"return_call_indirect reserved value must be 0\");\n        }\n        CALLBACK(OnReturnCallIndirectExpr, sig_index, table_index);\n        CALLBACK(OnOpcodeUint32Uint32, sig_index, table_index);\n        break;\n      }\n\n      case Opcode::LocalTee: {\n        Index local_index;\n        CHECK_RESULT(ReadIndex(&local_index, \"local.tee local index\"));\n        CALLBACK(OnLocalTeeExpr, local_index);\n        CALLBACK(OnOpcodeIndex, local_index);\n        break;\n      }\n\n      case Opcode::I32Load8S:\n      case Opcode::I32Load8U:\n      case Opcode::I32Load16S:\n      case Opcode::I32Load16U:\n      case Opcode::I64Load8S:\n      case Opcode::I64Load8U:\n      case Opcode::I64Load16S:\n      case Opcode::I64Load16U:\n      case Opcode::I64Load32S:\n      case Opcode::I64Load32U:\n      case Opcode::I32Load:\n      case Opcode::I64Load:\n      case Opcode::F32Load:\n      case Opcode::F64Load:\n      case Opcode::V128Load:\n      case Opcode::V128Load8X8S:\n      case Opcode::V128Load8X8U:\n      case Opcode::V128Load16X4S:\n      case Opcode::V128Load16X4U:\n      case Opcode::V128Load32X2S:\n      case Opcode::V128Load32X2U: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"load alignment\", \"load memidx\",\n                                     \"load offset\"));\n        CALLBACK(OnLoadExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n\n      case Opcode::I32Store8:\n      case Opcode::I32Store16:\n      case Opcode::I64Store8:\n      case Opcode::I64Store16:\n      case Opcode::I64Store32:\n      case Opcode::I32Store:\n      case Opcode::I64Store:\n      case Opcode::F32Store:\n      case Opcode::F64Store:\n      case Opcode::V128Store: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"store alignment\", \"store memidx\",\n                                     \"store offset\"));\n        CALLBACK(OnStoreExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n\n      case Opcode::MemorySize: {\n        Index memidx = 0;\n        if (!options_.features.multi_memory_enabled()) {\n          uint8_t reserved;\n          CHECK_RESULT(ReadU8(&reserved, \"memory.size reserved\"));\n          ERROR_UNLESS(reserved == 0, \"memory.size reserved value must be 0\");\n        } else {\n          CHECK_RESULT(ReadMemidx(&memidx, \"memory.size memidx\"));\n        }\n        CALLBACK(OnMemorySizeExpr, memidx);\n        CALLBACK(OnOpcodeUint32, memidx);\n        break;\n      }\n\n      case Opcode::MemoryGrow: {\n        Index memidx = 0;\n        if (!options_.features.multi_memory_enabled()) {\n          uint8_t reserved;\n          CHECK_RESULT(ReadU8(&reserved, \"memory.grow reserved\"));\n          ERROR_UNLESS(reserved == 0, \"memory.grow reserved value must be 0\");\n        } else {\n          CHECK_RESULT(ReadMemidx(&memidx, \"memory.grow memidx\"));\n        }\n        CALLBACK(OnMemoryGrowExpr, memidx);\n        CALLBACK(OnOpcodeUint32, memidx);\n        break;\n      }\n\n      case Opcode::I32Add:\n      case Opcode::I32Sub:\n      case Opcode::I32Mul:\n      case Opcode::I32DivS:\n      case Opcode::I32DivU:\n      case Opcode::I32RemS:\n      case Opcode::I32RemU:\n      case Opcode::I32And:\n      case Opcode::I32Or:\n      case Opcode::I32Xor:\n      case Opcode::I32Shl:\n      case Opcode::I32ShrU:\n      case Opcode::I32ShrS:\n      case Opcode::I32Rotr:\n      case Opcode::I32Rotl:\n      case Opcode::I64Add:\n      case Opcode::I64Sub:\n      case Opcode::I64Mul:\n      case Opcode::I64DivS:\n      case Opcode::I64DivU:\n      case Opcode::I64RemS:\n      case Opcode::I64RemU:\n      case Opcode::I64And:\n      case Opcode::I64Or:\n      case Opcode::I64Xor:\n      case Opcode::I64Shl:\n      case Opcode::I64ShrU:\n      case Opcode::I64ShrS:\n      case Opcode::I64Rotr:\n      case Opcode::I64Rotl:\n      case Opcode::F32Add:\n      case Opcode::F32Sub:\n      case Opcode::F32Mul:\n      case Opcode::F32Div:\n      case Opcode::F32Min:\n      case Opcode::F32Max:\n      case Opcode::F32Copysign:\n      case Opcode::F64Add:\n      case Opcode::F64Sub:\n      case Opcode::F64Mul:\n      case Opcode::F64Div:\n      case Opcode::F64Min:\n      case Opcode::F64Max:\n      case Opcode::F64Copysign:\n      case Opcode::I8X16Add:\n      case Opcode::I16X8Add:\n      case Opcode::I32X4Add:\n      case Opcode::I64X2Add:\n      case Opcode::I8X16Sub:\n      case Opcode::I16X8Sub:\n      case Opcode::I32X4Sub:\n      case Opcode::I64X2Sub:\n      case Opcode::I16X8Mul:\n      case Opcode::I32X4Mul:\n      case Opcode::I64X2Mul:\n      case Opcode::I8X16AddSatS:\n      case Opcode::I8X16AddSatU:\n      case Opcode::I16X8AddSatS:\n      case Opcode::I16X8AddSatU:\n      case Opcode::I8X16SubSatS:\n      case Opcode::I8X16SubSatU:\n      case Opcode::I16X8SubSatS:\n      case Opcode::I16X8SubSatU:\n      case Opcode::I8X16MinS:\n      case Opcode::I16X8MinS:\n      case Opcode::I32X4MinS:\n      case Opcode::I8X16MinU:\n      case Opcode::I16X8MinU:\n      case Opcode::I32X4MinU:\n      case Opcode::I8X16MaxS:\n      case Opcode::I16X8MaxS:\n      case Opcode::I32X4MaxS:\n      case Opcode::I8X16MaxU:\n      case Opcode::I16X8MaxU:\n      case Opcode::I32X4MaxU:\n      case Opcode::I8X16Shl:\n      case Opcode::I16X8Shl:\n      case Opcode::I32X4Shl:\n      case Opcode::I64X2Shl:\n      case Opcode::I8X16ShrS:\n      case Opcode::I8X16ShrU:\n      case Opcode::I16X8ShrS:\n      case Opcode::I16X8ShrU:\n      case Opcode::I32X4ShrS:\n      case Opcode::I32X4ShrU:\n      case Opcode::I64X2ShrS:\n      case Opcode::I64X2ShrU:\n      case Opcode::V128And:\n      case Opcode::V128Or:\n      case Opcode::V128Xor:\n      case Opcode::F32X4Min:\n      case Opcode::F32X4PMin:\n      case Opcode::F64X2Min:\n      case Opcode::F64X2PMin:\n      case Opcode::F32X4Max:\n      case Opcode::F32X4PMax:\n      case Opcode::F64X2Max:\n      case Opcode::F64X2PMax:\n      case Opcode::F32X4Add:\n      case Opcode::F64X2Add:\n      case Opcode::F32X4Sub:\n      case Opcode::F64X2Sub:\n      case Opcode::F32X4Div:\n      case Opcode::F64X2Div:\n      case Opcode::F32X4Mul:\n      case Opcode::F64X2Mul:\n      case Opcode::I8X16Swizzle:\n      case Opcode::I8X16NarrowI16X8S:\n      case Opcode::I8X16NarrowI16X8U:\n      case Opcode::I16X8NarrowI32X4S:\n      case Opcode::I16X8NarrowI32X4U:\n      case Opcode::V128Andnot:\n      case Opcode::I8X16AvgrU:\n      case Opcode::I16X8AvgrU:\n      case Opcode::I16X8ExtmulLowI8X16S:\n      case Opcode::I16X8ExtmulHighI8X16S:\n      case Opcode::I16X8ExtmulLowI8X16U:\n      case Opcode::I16X8ExtmulHighI8X16U:\n      case Opcode::I32X4ExtmulLowI16X8S:\n      case Opcode::I32X4ExtmulHighI16X8S:\n      case Opcode::I32X4ExtmulLowI16X8U:\n      case Opcode::I32X4ExtmulHighI16X8U:\n      case Opcode::I64X2ExtmulLowI32X4S:\n      case Opcode::I64X2ExtmulHighI32X4S:\n      case Opcode::I64X2ExtmulLowI32X4U:\n      case Opcode::I64X2ExtmulHighI32X4U:\n      case Opcode::I16X8Q15mulrSatS:\n      case Opcode::I32X4DotI16X8S:\n      case Opcode::I8X16RelaxedSwizzle:\n      case Opcode::F32X4RelaxedMin:\n      case Opcode::F32X4RelaxedMax:\n      case Opcode::F64X2RelaxedMin:\n      case Opcode::F64X2RelaxedMax:\n      case Opcode::I16X8RelaxedQ15mulrS:\n      case Opcode::I16X8DotI8X16I7X16S:\n      case Opcode::I64MulWideS:\n      case Opcode::I64MulWideU:\n        CALLBACK(OnBinaryExpr, opcode);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::I64Add128:\n      case Opcode::I64Sub128:\n        CALLBACK(OnQuaternaryExpr, opcode);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::I32Eq:\n      case Opcode::I32Ne:\n      case Opcode::I32LtS:\n      case Opcode::I32LeS:\n      case Opcode::I32LtU:\n      case Opcode::I32LeU:\n      case Opcode::I32GtS:\n      case Opcode::I32GeS:\n      case Opcode::I32GtU:\n      case Opcode::I32GeU:\n      case Opcode::I64Eq:\n      case Opcode::I64Ne:\n      case Opcode::I64LtS:\n      case Opcode::I64LeS:\n      case Opcode::I64LtU:\n      case Opcode::I64LeU:\n      case Opcode::I64GtS:\n      case Opcode::I64GeS:\n      case Opcode::I64GtU:\n      case Opcode::I64GeU:\n      case Opcode::F32Eq:\n      case Opcode::F32Ne:\n      case Opcode::F32Lt:\n      case Opcode::F32Le:\n      case Opcode::F32Gt:\n      case Opcode::F32Ge:\n      case Opcode::F64Eq:\n      case Opcode::F64Ne:\n      case Opcode::F64Lt:\n      case Opcode::F64Le:\n      case Opcode::F64Gt:\n      case Opcode::F64Ge:\n      case Opcode::I8X16Eq:\n      case Opcode::I16X8Eq:\n      case Opcode::I32X4Eq:\n      case Opcode::I64X2Eq:\n      case Opcode::F32X4Eq:\n      case Opcode::F64X2Eq:\n      case Opcode::I8X16Ne:\n      case Opcode::I16X8Ne:\n      case Opcode::I32X4Ne:\n      case Opcode::I64X2Ne:\n      case Opcode::F32X4Ne:\n      case Opcode::F64X2Ne:\n      case Opcode::I8X16LtS:\n      case Opcode::I8X16LtU:\n      case Opcode::I16X8LtS:\n      case Opcode::I16X8LtU:\n      case Opcode::I32X4LtS:\n      case Opcode::I32X4LtU:\n      case Opcode::I64X2LtS:\n      case Opcode::F32X4Lt:\n      case Opcode::F64X2Lt:\n      case Opcode::I8X16LeS:\n      case Opcode::I8X16LeU:\n      case Opcode::I16X8LeS:\n      case Opcode::I16X8LeU:\n      case Opcode::I32X4LeS:\n      case Opcode::I32X4LeU:\n      case Opcode::I64X2LeS:\n      case Opcode::F32X4Le:\n      case Opcode::F64X2Le:\n      case Opcode::I8X16GtS:\n      case Opcode::I8X16GtU:\n      case Opcode::I16X8GtS:\n      case Opcode::I16X8GtU:\n      case Opcode::I32X4GtS:\n      case Opcode::I32X4GtU:\n      case Opcode::I64X2GtS:\n      case Opcode::F32X4Gt:\n      case Opcode::F64X2Gt:\n      case Opcode::I8X16GeS:\n      case Opcode::I8X16GeU:\n      case Opcode::I16X8GeS:\n      case Opcode::I16X8GeU:\n      case Opcode::I32X4GeS:\n      case Opcode::I32X4GeU:\n      case Opcode::I64X2GeS:\n      case Opcode::F32X4Ge:\n      case Opcode::F64X2Ge:\n        CALLBACK(OnCompareExpr, opcode);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::I32Clz:\n      case Opcode::I32Ctz:\n      case Opcode::I32Popcnt:\n      case Opcode::I64Clz:\n      case Opcode::I64Ctz:\n      case Opcode::I64Popcnt:\n      case Opcode::F32Abs:\n      case Opcode::F32Neg:\n      case Opcode::F32Ceil:\n      case Opcode::F32Floor:\n      case Opcode::F32Trunc:\n      case Opcode::F32Nearest:\n      case Opcode::F32Sqrt:\n      case Opcode::F64Abs:\n      case Opcode::F64Neg:\n      case Opcode::F64Ceil:\n      case Opcode::F64Floor:\n      case Opcode::F64Trunc:\n      case Opcode::F64Nearest:\n      case Opcode::F64Sqrt:\n      case Opcode::I8X16Splat:\n      case Opcode::I16X8Splat:\n      case Opcode::I32X4Splat:\n      case Opcode::I64X2Splat:\n      case Opcode::F32X4Splat:\n      case Opcode::F64X2Splat:\n      case Opcode::I8X16Neg:\n      case Opcode::I16X8Neg:\n      case Opcode::I32X4Neg:\n      case Opcode::I64X2Neg:\n      case Opcode::V128Not:\n      case Opcode::V128AnyTrue:\n      case Opcode::I8X16Bitmask:\n      case Opcode::I16X8Bitmask:\n      case Opcode::I32X4Bitmask:\n      case Opcode::I64X2Bitmask:\n      case Opcode::I8X16AllTrue:\n      case Opcode::I16X8AllTrue:\n      case Opcode::I32X4AllTrue:\n      case Opcode::I64X2AllTrue:\n      case Opcode::F32X4Ceil:\n      case Opcode::F64X2Ceil:\n      case Opcode::F32X4Floor:\n      case Opcode::F64X2Floor:\n      case Opcode::F32X4Trunc:\n      case Opcode::F64X2Trunc:\n      case Opcode::F32X4Nearest:\n      case Opcode::F64X2Nearest:\n      case Opcode::F32X4Neg:\n      case Opcode::F64X2Neg:\n      case Opcode::F32X4Abs:\n      case Opcode::F64X2Abs:\n      case Opcode::F32X4Sqrt:\n      case Opcode::F64X2Sqrt:\n      case Opcode::I16X8ExtendLowI8X16S:\n      case Opcode::I16X8ExtendHighI8X16S:\n      case Opcode::I16X8ExtendLowI8X16U:\n      case Opcode::I16X8ExtendHighI8X16U:\n      case Opcode::I32X4ExtendLowI16X8S:\n      case Opcode::I32X4ExtendHighI16X8S:\n      case Opcode::I32X4ExtendLowI16X8U:\n      case Opcode::I32X4ExtendHighI16X8U:\n      case Opcode::I64X2ExtendLowI32X4S:\n      case Opcode::I64X2ExtendHighI32X4S:\n      case Opcode::I64X2ExtendLowI32X4U:\n      case Opcode::I64X2ExtendHighI32X4U:\n      case Opcode::I8X16Abs:\n      case Opcode::I16X8Abs:\n      case Opcode::I32X4Abs:\n      case Opcode::I64X2Abs:\n      case Opcode::I8X16Popcnt:\n      case Opcode::I16X8ExtaddPairwiseI8X16S:\n      case Opcode::I16X8ExtaddPairwiseI8X16U:\n      case Opcode::I32X4ExtaddPairwiseI16X8S:\n      case Opcode::I32X4ExtaddPairwiseI16X8U:\n      case Opcode::I32X4RelaxedTruncF32X4S:\n      case Opcode::I32X4RelaxedTruncF32X4U:\n      case Opcode::I32X4RelaxedTruncF64X2SZero:\n      case Opcode::I32X4RelaxedTruncF64X2UZero:\n        CALLBACK(OnUnaryExpr, opcode);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::V128BitSelect:\n      case Opcode::F32X4RelaxedMadd:\n      case Opcode::F32X4RelaxedNmadd:\n      case Opcode::F64X2RelaxedMadd:\n      case Opcode::F64X2RelaxedNmadd:\n      case Opcode::I8X16RelaxedLaneSelect:\n      case Opcode::I16X8RelaxedLaneSelect:\n      case Opcode::I32X4RelaxedLaneSelect:\n      case Opcode::I64X2RelaxedLaneSelect:\n      case Opcode::I32X4DotI8X16I7X16AddS:\n        CALLBACK(OnTernaryExpr, opcode);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::I8X16ExtractLaneS:\n      case Opcode::I8X16ExtractLaneU:\n      case Opcode::I16X8ExtractLaneS:\n      case Opcode::I16X8ExtractLaneU:\n      case Opcode::I32X4ExtractLane:\n      case Opcode::I64X2ExtractLane:\n      case Opcode::F32X4ExtractLane:\n      case Opcode::F64X2ExtractLane:\n      case Opcode::I8X16ReplaceLane:\n      case Opcode::I16X8ReplaceLane:\n      case Opcode::I32X4ReplaceLane:\n      case Opcode::I64X2ReplaceLane:\n      case Opcode::F32X4ReplaceLane:\n      case Opcode::F64X2ReplaceLane: {\n        uint8_t lane_val;\n        CHECK_RESULT(ReadU8(&lane_val, \"Lane idx\"));\n        CALLBACK(OnSimdLaneOpExpr, opcode, lane_val);\n        CALLBACK(OnOpcodeUint64, lane_val);\n        break;\n      }\n\n      case Opcode::I8X16Shuffle: {\n        v128 value;\n        CHECK_RESULT(ReadV128(&value, \"Lane idx [16]\"));\n        CALLBACK(OnSimdShuffleOpExpr, opcode, value);\n        CALLBACK(OnOpcodeV128, value);\n        break;\n      }\n\n      case Opcode::V128Load8Splat:\n      case Opcode::V128Load16Splat:\n      case Opcode::V128Load32Splat:\n      case Opcode::V128Load64Splat: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"load alignment\", \"load memidx\",\n                                     \"load offset\"));\n        CALLBACK(OnLoadSplatExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n      case Opcode::V128Load8Lane:\n      case Opcode::V128Load16Lane:\n      case Opcode::V128Load32Lane:\n      case Opcode::V128Load64Lane: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        uint8_t lane_val;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"load alignment\", \"load memidx\",\n                                     \"load offset\", &lane_val));\n        CALLBACK(OnSimdLoadLaneExpr, opcode, memidx, alignment_log2, offset,\n                 lane_val);\n        CHECK_RESULT(\n            CallbackMemLocation(&alignment_log2, &memidx, &offset, &lane_val));\n        break;\n      }\n      case Opcode::V128Store8Lane:\n      case Opcode::V128Store16Lane:\n      case Opcode::V128Store32Lane:\n      case Opcode::V128Store64Lane: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        uint8_t lane_val;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"store alignment\", \"store memidx\",\n                                     \"store offset\", &lane_val));\n        CALLBACK(OnSimdStoreLaneExpr, opcode, memidx, alignment_log2, offset,\n                 lane_val);\n        CHECK_RESULT(\n            CallbackMemLocation(&alignment_log2, &memidx, &offset, &lane_val));\n        break;\n      }\n      case Opcode::V128Load32Zero:\n      case Opcode::V128Load64Zero: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"load alignment\", \"load memidx\",\n                                     \"load offset\"));\n        CALLBACK(OnLoadZeroExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n      case Opcode::I32TruncF32S:\n      case Opcode::I32TruncF64S:\n      case Opcode::I32TruncF32U:\n      case Opcode::I32TruncF64U:\n      case Opcode::I32WrapI64:\n      case Opcode::I64TruncF32S:\n      case Opcode::I64TruncF64S:\n      case Opcode::I64TruncF32U:\n      case Opcode::I64TruncF64U:\n      case Opcode::I64ExtendI32S:\n      case Opcode::I64ExtendI32U:\n      case Opcode::F32ConvertI32S:\n      case Opcode::F32ConvertI32U:\n      case Opcode::F32ConvertI64S:\n      case Opcode::F32ConvertI64U:\n      case Opcode::F32DemoteF64:\n      case Opcode::F32ReinterpretI32:\n      case Opcode::F64ConvertI32S:\n      case Opcode::F64ConvertI32U:\n      case Opcode::F64ConvertI64S:\n      case Opcode::F64ConvertI64U:\n      case Opcode::F64PromoteF32:\n      case Opcode::F64ReinterpretI64:\n      case Opcode::I32ReinterpretF32:\n      case Opcode::I64ReinterpretF64:\n      case Opcode::I32Eqz:\n      case Opcode::I64Eqz:\n      case Opcode::F32X4ConvertI32X4S:\n      case Opcode::F32X4ConvertI32X4U:\n      case Opcode::I32X4TruncSatF32X4S:\n      case Opcode::I32X4TruncSatF32X4U:\n      case Opcode::F32X4DemoteF64X2Zero:\n      case Opcode::F64X2PromoteLowF32X4:\n      case Opcode::I32X4TruncSatF64X2SZero:\n      case Opcode::I32X4TruncSatF64X2UZero:\n      case Opcode::F64X2ConvertLowI32X4S:\n      case Opcode::F64X2ConvertLowI32X4U:\n        CALLBACK(OnConvertExpr, opcode);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::Try: {\n        nested_blocks.push(opcode);\n        Type sig_type;\n        CHECK_RESULT(ReadType(&sig_type, \"try signature type\"));\n        ERROR_UNLESS(IsBlockType(sig_type),\n                     \"expected valid block signature type\");\n        CALLBACK(OnTryExpr, sig_type);\n        CALLBACK(OnOpcodeBlockSig, sig_type);\n        break;\n      }\n\n      case Opcode::TryTable: {\n        nested_blocks.push(opcode);\n        Type sig_type;\n        CHECK_RESULT(ReadType(&sig_type, \"try_table signature type\"));\n        ERROR_UNLESS(IsBlockType(sig_type),\n                     \"expected valid block signature type\");\n        Index count;\n        CHECK_RESULT(ReadCount(&count, \"catch count\"));\n\n        catches_.resize(count);\n        for (Index i = 0; i < count; i++) {\n          uint8_t handler;\n          CHECK_RESULT(ReadU8(&handler, \"catch handler\"));\n          ERROR_UNLESS(handler < 4, \"expected valid catch handler\");\n          bool is_catch_all = handler & 2;\n          Index tag = kInvalidIndex;\n          if (!(is_catch_all)) {\n            CHECK_RESULT(ReadIndex(&tag, \"catch tag\"));\n          }\n          Index depth;\n          CHECK_RESULT(ReadIndex(&depth, \"catch depth\"));\n          CatchClause catch_;\n          catch_.kind = CatchKind(handler);\n          catch_.tag = tag;\n          catch_.depth = depth;\n          catches_[i] = catch_;\n        }\n\n        CALLBACK(OnTryTableExpr, sig_type, catches_);\n        break;\n      }\n\n      case Opcode::Catch: {\n        Index index;\n        CHECK_RESULT(ReadIndex(&index, \"tag index\"));\n        CALLBACK(OnCatchExpr, index);\n        CALLBACK(OnOpcodeIndex, index);\n        break;\n      }\n\n      case Opcode::CatchAll: {\n        CALLBACK(OnCatchAllExpr);\n        CALLBACK(OnOpcodeBare);\n        break;\n      }\n\n      case Opcode::Delegate: {\n        ERROR_IF(nested_blocks.empty() || (nested_blocks.top() != Opcode::Try),\n                 \"delegate outside try block\");\n        nested_blocks.pop();\n        Index index;\n        CHECK_RESULT(ReadIndex(&index, \"depth\"));\n        CALLBACK(OnDelegateExpr, index);\n        CALLBACK(OnOpcodeIndex, index);\n        break;\n      }\n\n      case Opcode::Rethrow: {\n        Index depth;\n        CHECK_RESULT(ReadIndex(&depth, \"catch depth\"));\n        CALLBACK(OnRethrowExpr, depth);\n        CALLBACK(OnOpcodeIndex, depth);\n        break;\n      }\n\n      case Opcode::Throw: {\n        Index index;\n        CHECK_RESULT(ReadIndex(&index, \"tag index\"));\n        CALLBACK(OnThrowExpr, index);\n        CALLBACK(OnOpcodeIndex, index);\n        break;\n      }\n\n      case Opcode::ThrowRef: {\n        CALLBACK(OnThrowRefExpr);\n        CALLBACK(OnOpcodeBare);\n        break;\n      }\n\n      case Opcode::I32Extend8S:\n      case Opcode::I32Extend16S:\n      case Opcode::I64Extend8S:\n      case Opcode::I64Extend16S:\n      case Opcode::I64Extend32S:\n        CALLBACK(OnUnaryExpr, opcode);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::I32TruncSatF32S:\n      case Opcode::I32TruncSatF32U:\n      case Opcode::I32TruncSatF64S:\n      case Opcode::I32TruncSatF64U:\n      case Opcode::I64TruncSatF32S:\n      case Opcode::I64TruncSatF32U:\n      case Opcode::I64TruncSatF64S:\n      case Opcode::I64TruncSatF64U:\n        CALLBACK(OnConvertExpr, opcode);\n        CALLBACK0(OnOpcodeBare);\n        break;\n\n      case Opcode::MemoryAtomicNotify: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"notify alignment\", \"notify memidx\",\n                                     \"notify offset\"));\n        CALLBACK(OnAtomicNotifyExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n\n      case Opcode::MemoryAtomicWait32:\n      case Opcode::MemoryAtomicWait64: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"wait alignment\", \"wait memidx\",\n                                     \"wait offset\"));\n        CALLBACK(OnAtomicWaitExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n\n      case Opcode::AtomicFence: {\n        uint8_t consistency_model;\n        CHECK_RESULT(ReadU8(&consistency_model, \"consistency model\"));\n        ERROR_UNLESS(consistency_model == 0,\n                     \"atomic.fence consistency model must be 0\");\n        CALLBACK(OnAtomicFenceExpr, consistency_model);\n        CALLBACK(OnOpcodeUint32, consistency_model);\n        break;\n      }\n\n      case Opcode::I32AtomicLoad8U:\n      case Opcode::I32AtomicLoad16U:\n      case Opcode::I64AtomicLoad8U:\n      case Opcode::I64AtomicLoad16U:\n      case Opcode::I64AtomicLoad32U:\n      case Opcode::I32AtomicLoad:\n      case Opcode::I64AtomicLoad: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"load alignment\", \"load memidx\",\n                                     \"load offset\"));\n        CALLBACK(OnAtomicLoadExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n\n      case Opcode::I32AtomicStore8:\n      case Opcode::I32AtomicStore16:\n      case Opcode::I64AtomicStore8:\n      case Opcode::I64AtomicStore16:\n      case Opcode::I64AtomicStore32:\n      case Opcode::I32AtomicStore:\n      case Opcode::I64AtomicStore: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"store alignment\", \"store memidx\",\n                                     \"store offset\"));\n        CALLBACK(OnAtomicStoreExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n\n      case Opcode::I32AtomicRmwAdd:\n      case Opcode::I64AtomicRmwAdd:\n      case Opcode::I32AtomicRmw8AddU:\n      case Opcode::I32AtomicRmw16AddU:\n      case Opcode::I64AtomicRmw8AddU:\n      case Opcode::I64AtomicRmw16AddU:\n      case Opcode::I64AtomicRmw32AddU:\n      case Opcode::I32AtomicRmwSub:\n      case Opcode::I64AtomicRmwSub:\n      case Opcode::I32AtomicRmw8SubU:\n      case Opcode::I32AtomicRmw16SubU:\n      case Opcode::I64AtomicRmw8SubU:\n      case Opcode::I64AtomicRmw16SubU:\n      case Opcode::I64AtomicRmw32SubU:\n      case Opcode::I32AtomicRmwAnd:\n      case Opcode::I64AtomicRmwAnd:\n      case Opcode::I32AtomicRmw8AndU:\n      case Opcode::I32AtomicRmw16AndU:\n      case Opcode::I64AtomicRmw8AndU:\n      case Opcode::I64AtomicRmw16AndU:\n      case Opcode::I64AtomicRmw32AndU:\n      case Opcode::I32AtomicRmwOr:\n      case Opcode::I64AtomicRmwOr:\n      case Opcode::I32AtomicRmw8OrU:\n      case Opcode::I32AtomicRmw16OrU:\n      case Opcode::I64AtomicRmw8OrU:\n      case Opcode::I64AtomicRmw16OrU:\n      case Opcode::I64AtomicRmw32OrU:\n      case Opcode::I32AtomicRmwXor:\n      case Opcode::I64AtomicRmwXor:\n      case Opcode::I32AtomicRmw8XorU:\n      case Opcode::I32AtomicRmw16XorU:\n      case Opcode::I64AtomicRmw8XorU:\n      case Opcode::I64AtomicRmw16XorU:\n      case Opcode::I64AtomicRmw32XorU:\n      case Opcode::I32AtomicRmwXchg:\n      case Opcode::I64AtomicRmwXchg:\n      case Opcode::I32AtomicRmw8XchgU:\n      case Opcode::I32AtomicRmw16XchgU:\n      case Opcode::I64AtomicRmw8XchgU:\n      case Opcode::I64AtomicRmw16XchgU:\n      case Opcode::I64AtomicRmw32XchgU: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"memory alignment\", \"memory memidx\",\n                                     \"memory offset\"));\n        CALLBACK(OnAtomicRmwExpr, opcode, memidx, alignment_log2, offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n\n      case Opcode::I32AtomicRmwCmpxchg:\n      case Opcode::I64AtomicRmwCmpxchg:\n      case Opcode::I32AtomicRmw8CmpxchgU:\n      case Opcode::I32AtomicRmw16CmpxchgU:\n      case Opcode::I64AtomicRmw8CmpxchgU:\n      case Opcode::I64AtomicRmw16CmpxchgU:\n      case Opcode::I64AtomicRmw32CmpxchgU: {\n        Address alignment_log2;\n        Index memidx;\n        Address offset;\n        CHECK_RESULT(ReadMemLocation(&alignment_log2, &memidx, &offset,\n                                     \"memory alignment\", \"memory memidx\",\n                                     \"memory offset\"));\n        CALLBACK(OnAtomicRmwCmpxchgExpr, opcode, memidx, alignment_log2,\n                 offset);\n        CHECK_RESULT(CallbackMemLocation(&alignment_log2, &memidx, &offset));\n        break;\n      }\n\n      case Opcode::TableInit: {\n        Index segment;\n        CHECK_RESULT(ReadIndex(&segment, \"elem segment index\"));\n        Index table_index;\n        CHECK_RESULT(ReadIndex(&table_index, \"reserved table index\"));\n        CALLBACK(OnTableInitExpr, segment, table_index);\n        CALLBACK(OnOpcodeUint32Uint32, segment, table_index);\n        break;\n      }\n\n      case Opcode::MemoryInit: {\n        Index segment;\n        ERROR_IF(data_count_ == kInvalidIndex,\n                 \"memory.init requires data count section\");\n        CHECK_RESULT(ReadIndex(&segment, \"elem segment index\"));\n        Index memidx = 0;\n        if (!options_.features.multi_memory_enabled()) {\n          uint8_t reserved;\n          CHECK_RESULT(ReadU8(&reserved, \"reserved memory index\"));\n          ERROR_UNLESS(reserved == 0, \"reserved value must be 0\");\n        } else {\n          CHECK_RESULT(ReadMemidx(&memidx, \"memory.init memidx\"));\n        }\n        CALLBACK(OnMemoryInitExpr, segment, memidx);\n        CALLBACK(OnOpcodeUint32Uint32, segment, memidx);\n        break;\n      }\n\n      case Opcode::DataDrop:\n        ERROR_IF(data_count_ == kInvalidIndex,\n                 \"data.drop requires data count section\");\n        [[fallthrough]];\n      case Opcode::ElemDrop: {\n        Index segment;\n        CHECK_RESULT(ReadIndex(&segment, \"segment index\"));\n        if (opcode == Opcode::DataDrop) {\n          CALLBACK(OnDataDropExpr, segment);\n        } else {\n          CALLBACK(OnElemDropExpr, segment);\n        }\n        CALLBACK(OnOpcodeUint32, segment);\n        break;\n      }\n\n      case Opcode::MemoryFill: {\n        Index memidx = 0;\n        if (!options_.features.multi_memory_enabled()) {\n          uint8_t reserved;\n          CHECK_RESULT(ReadU8(&reserved, \"memory.fill reserved\"));\n          ERROR_UNLESS(reserved == 0, \"memory.fill reserved value must be 0\");\n        } else {\n          CHECK_RESULT(ReadMemidx(&memidx, \"memory.fill memidx\"));\n        }\n        CALLBACK(OnMemoryFillExpr, memidx);\n        CALLBACK(OnOpcodeUint32, memidx);\n        break;\n      }\n\n      case Opcode::MemoryCopy: {\n        Index destmemidx = 0;\n        Index srcmemidx = 0;\n        if (!options_.features.multi_memory_enabled()) {\n          uint8_t reserved;\n          CHECK_RESULT(ReadU8(&reserved, \"reserved memory index\"));\n          ERROR_UNLESS(reserved == 0, \"reserved value must be 0\");\n          CHECK_RESULT(ReadU8(&reserved, \"reserved memory index\"));\n          ERROR_UNLESS(reserved == 0, \"reserved value must be 0\");\n        } else {\n          CHECK_RESULT(ReadMemidx(&destmemidx, \"memory.copy destmemindex\"));\n          CHECK_RESULT(ReadMemidx(&srcmemidx, \"memory.copy srcmemidx\"));\n        }\n        CALLBACK(OnMemoryCopyExpr, destmemidx, srcmemidx);\n        CALLBACK(OnOpcodeUint32Uint32, destmemidx, srcmemidx);\n        break;\n      }\n\n      case Opcode::TableCopy: {\n        Index table_dst;\n        Index table_src;\n        CHECK_RESULT(ReadIndex(&table_dst, \"reserved table index\"));\n        CHECK_RESULT(ReadIndex(&table_src, \"table src\"));\n        CALLBACK(OnTableCopyExpr, table_dst, table_src);\n        CALLBACK(OnOpcodeUint32Uint32, table_dst, table_src);\n        break;\n      }\n\n      case Opcode::TableGet: {\n        Index table;\n        CHECK_RESULT(ReadIndex(&table, \"table index\"));\n        CALLBACK(OnTableGetExpr, table);\n        CALLBACK(OnOpcodeUint32, table);\n        break;\n      }\n\n      case Opcode::TableSet: {\n        Index table;\n        CHECK_RESULT(ReadIndex(&table, \"table index\"));\n        CALLBACK(OnTableSetExpr, table);\n        CALLBACK(OnOpcodeUint32, table);\n        break;\n      }\n\n      case Opcode::TableGrow: {\n        Index table;\n        CHECK_RESULT(ReadIndex(&table, \"table index\"));\n        CALLBACK(OnTableGrowExpr, table);\n        CALLBACK(OnOpcodeUint32, table);\n        break;\n      }\n\n      case Opcode::TableSize: {\n        Index table;\n        CHECK_RESULT(ReadIndex(&table, \"table index\"));\n        CALLBACK(OnTableSizeExpr, table);\n        CALLBACK(OnOpcodeUint32, table);\n        break;\n      }\n\n      case Opcode::TableFill: {\n        Index table;\n        CHECK_RESULT(ReadIndex(&table, \"table index\"));\n        CALLBACK(OnTableFillExpr, table);\n        CALLBACK(OnOpcodeUint32, table);\n        break;\n      }\n\n      case Opcode::RefAsNonNull:\n        CALLBACK(OnRefAsNonNullExpr);\n        CALLBACK(OnOpcodeBare);\n        break;\n\n      case Opcode::RefFunc: {\n        Index func;\n        CHECK_RESULT(ReadIndex(&func, \"func index\"));\n        CALLBACK(OnRefFuncExpr, func);\n        CALLBACK(OnOpcodeUint32, func);\n        break;\n      }\n\n      case Opcode::RefNull: {\n        uint64_t heap_type;\n        Type type;\n        CHECK_RESULT(ReadS64Leb128(&heap_type, \"ref.null type\"));\n\n        if (static_cast<int64_t>(heap_type) < 0 ||\n            static_cast<int64_t>(heap_type) >= kInvalidIndex) {\n          Type::Enum type_code = static_cast<Type::Enum>(heap_type);\n          ERROR_UNLESS(IsConcreteReferenceType(type_code),\n                       \"expected valid ref.null type (got \" PRItypecode \")\",\n                       WABT_PRINTF_TYPE_CODE(type_code));\n          type = Type(type_code);\n        } else {\n          ERROR_UNLESS(options_.features.function_references_enabled(),\n                       \"function references are not enabled for ref.null\");\n          type = Type(Type::RefNull, static_cast<Index>(heap_type));\n        }\n\n        CALLBACK(OnRefNullExpr, type);\n        CALLBACK(OnOpcodeType, type);\n        break;\n      }\n\n      case Opcode::RefIsNull:\n        CALLBACK(OnRefIsNullExpr);\n        CALLBACK(OnOpcodeBare);\n        break;\n\n      case Opcode::CallRef: {\n        uint32_t type;\n        CHECK_RESULT(ReadU32Leb128(&type, \"call_ref type\"));\n\n        Type sig_type(Type::RefNull, type);\n        CALLBACK(OnCallRefExpr, sig_type);\n        CALLBACK(OnOpcodeType, sig_type);\n        break;\n      }\n\n      case Opcode::ReturnCallRef: {\n        uint32_t type;\n        CHECK_RESULT(ReadU32Leb128(&type, \"return_call_ref type\"));\n\n        Type sig_type(Type::RefNull, type);\n        CALLBACK(OnReturnCallRefExpr, sig_type);\n        CALLBACK(OnOpcodeType, sig_type);\n        break;\n      }\n\n      default:\n        return ReportUnexpectedOpcode(opcode);\n    }\n  }\n\n  PrintError(\"%s must end with END opcode\", context);\n  return Result::Error;\n}\n\nResult BinaryReader::ReadNameSection(Offset section_size) {\n  CALLBACK(BeginNamesSection, section_size);\n  Index i = 0;\n  uint32_t previous_subsection_type = 0;\n  while (state_.offset < read_end_) {\n    uint32_t name_type;\n    Offset subsection_size;\n    CHECK_RESULT(ReadU32Leb128(&name_type, \"name type\"));\n    if (i != 0) {\n      ERROR_UNLESS(name_type != previous_subsection_type,\n                   \"duplicate sub-section\");\n      ERROR_UNLESS(name_type >= previous_subsection_type,\n                   \"out-of-order sub-section\");\n    }\n    previous_subsection_type = name_type;\n    CHECK_RESULT(ReadOffset(&subsection_size, \"subsection size\"));\n    ERROR_UNLESS(subsection_size <= read_end_ - state_.offset,\n                 \"invalid sub-section size: extends past end\");\n    size_t subsection_end = state_.offset + subsection_size;\n    ReadEndRestoreGuard guard(this);\n    read_end_ = subsection_end;\n\n    NameSectionSubsection type = static_cast<NameSectionSubsection>(name_type);\n    if (type <= NameSectionSubsection::Last) {\n      CALLBACK(OnNameSubsection, i, type, subsection_size);\n    }\n\n    switch (type) {\n      case NameSectionSubsection::Module:\n        CALLBACK(OnModuleNameSubsection, i, name_type, subsection_size);\n        if (subsection_size) {\n          std::string_view name;\n          CHECK_RESULT(ReadStr(&name, \"module name\"));\n          CALLBACK(OnModuleName, name);\n        }\n        break;\n      case NameSectionSubsection::Function:\n        CALLBACK(OnFunctionNameSubsection, i, name_type, subsection_size);\n        if (subsection_size) {\n          Index num_names;\n          CHECK_RESULT(ReadCount(&num_names, \"name count\"));\n          CALLBACK(OnFunctionNamesCount, num_names);\n          Index last_function_index = kInvalidIndex;\n\n          for (Index j = 0; j < num_names; ++j) {\n            Index function_index;\n            std::string_view function_name;\n\n            CHECK_RESULT(ReadIndex(&function_index, \"function index\"));\n            ERROR_UNLESS(function_index != last_function_index,\n                         \"duplicate function name: %u\", function_index);\n            ERROR_UNLESS(last_function_index == kInvalidIndex ||\n                             function_index > last_function_index,\n                         \"function index out of order: %u\", function_index);\n            last_function_index = function_index;\n            ERROR_UNLESS(function_index < NumTotalFuncs(),\n                         \"invalid function index: %\" PRIindex, function_index);\n            CHECK_RESULT(ReadStr(&function_name, \"function name\"));\n            CALLBACK(OnFunctionName, function_index, function_name);\n          }\n        }\n        break;\n      case NameSectionSubsection::Local:\n        CALLBACK(OnLocalNameSubsection, i, name_type, subsection_size);\n        if (subsection_size) {\n          Index num_funcs;\n          CHECK_RESULT(ReadCount(&num_funcs, \"function count\"));\n          CALLBACK(OnLocalNameFunctionCount, num_funcs);\n          Index last_function_index = kInvalidIndex;\n          for (Index j = 0; j < num_funcs; ++j) {\n            Index function_index;\n            CHECK_RESULT(ReadIndex(&function_index, \"function index\"));\n            ERROR_UNLESS(function_index < NumTotalFuncs(),\n                         \"invalid function index: %u\", function_index);\n            ERROR_UNLESS(last_function_index == kInvalidIndex ||\n                             function_index > last_function_index,\n                         \"locals function index out of order: %u\",\n                         function_index);\n            last_function_index = function_index;\n            Index num_locals;\n            CHECK_RESULT(ReadCount(&num_locals, \"local count\"));\n            CALLBACK(OnLocalNameLocalCount, function_index, num_locals);\n            Index last_local_index = kInvalidIndex;\n            for (Index k = 0; k < num_locals; ++k) {\n              Index local_index;\n              std::string_view local_name;\n\n              CHECK_RESULT(ReadIndex(&local_index, \"named index\"));\n              ERROR_UNLESS(local_index != last_local_index,\n                           \"duplicate local index: %u\", local_index);\n              ERROR_UNLESS(last_local_index == kInvalidIndex ||\n                               local_index > last_local_index,\n                           \"local index out of order: %u\", local_index);\n              last_local_index = local_index;\n              CHECK_RESULT(ReadStr(&local_name, \"name\"));\n              CALLBACK(OnLocalName, function_index, local_index, local_name);\n            }\n          }\n        }\n        break;\n      case NameSectionSubsection::Label:\n        // TODO(sbc): Implement label names. These are slightly more complicated\n        // since they refer to offsets in the code section / instruction stream.\n        state_.offset = subsection_end;\n        break;\n      case NameSectionSubsection::Type:\n      case NameSectionSubsection::Table:\n      case NameSectionSubsection::Memory:\n      case NameSectionSubsection::Global:\n      case NameSectionSubsection::ElemSegment:\n      case NameSectionSubsection::DataSegment:\n      case NameSectionSubsection::Tag:\n        if (subsection_size) {\n          Index num_names;\n          CHECK_RESULT(ReadCount(&num_names, \"name count\"));\n          CALLBACK(OnNameCount, num_names);\n          for (Index j = 0; j < num_names; ++j) {\n            Index index;\n            std::string_view name;\n\n            CHECK_RESULT(ReadIndex(&index, \"index\"));\n            CHECK_RESULT(ReadStr(&name, \"name\"));\n            CALLBACK(OnNameEntry, type, index, name);\n          }\n        }\n        state_.offset = subsection_end;\n        break;\n      default:\n        // Unknown subsection, skip it.\n        state_.offset = subsection_end;\n        break;\n    }\n    ++i;\n    ERROR_UNLESS(state_.offset == subsection_end,\n                 \"unfinished sub-section (expected end: 0x%\" PRIzx \")\",\n                 subsection_end);\n  }\n  CALLBACK0(EndNamesSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadRelocSection(Offset section_size) {\n  CALLBACK(BeginRelocSection, section_size);\n  uint32_t section_index;\n  CHECK_RESULT(ReadU32Leb128(&section_index, \"section index\"));\n  Index num_relocs;\n  CHECK_RESULT(ReadCount(&num_relocs, \"relocation count\"));\n  CALLBACK(OnRelocCount, num_relocs, section_index);\n  for (Index i = 0; i < num_relocs; ++i) {\n    Offset offset;\n    Index index;\n    uint32_t reloc_type, addend = 0;\n    CHECK_RESULT(ReadU32Leb128(&reloc_type, \"relocation type\"));\n    CHECK_RESULT(ReadOffset(&offset, \"offset\"));\n    CHECK_RESULT(ReadIndex(&index, \"index\"));\n    RelocType type = static_cast<RelocType>(reloc_type);\n    switch (type) {\n      case RelocType::MemoryAddressLEB:\n      case RelocType::MemoryAddressLEB64:\n      case RelocType::MemoryAddressSLEB:\n      case RelocType::MemoryAddressSLEB64:\n      case RelocType::MemoryAddressRelSLEB:\n      case RelocType::MemoryAddressRelSLEB64:\n      case RelocType::MemoryAddressI32:\n      case RelocType::MemoryAddressI64:\n      case RelocType::MemoryAddressLocRelI32:\n      case RelocType::FunctionOffsetI32:\n      case RelocType::FunctionOffsetI64:\n      case RelocType::SectionOffsetI32:\n      case RelocType::MemoryAddressTLSSLEB:\n      case RelocType::MemoryAddressTLSSLEB64:\n        CHECK_RESULT(ReadS32Leb128(&addend, \"addend\"));\n        break;\n\n      case RelocType::FuncIndexLEB:\n      case RelocType::FuncIndexI32:\n      case RelocType::TableIndexSLEB:\n      case RelocType::TableIndexSLEB64:\n      case RelocType::TableIndexI32:\n      case RelocType::TableIndexI64:\n      case RelocType::TypeIndexLEB:\n      case RelocType::GlobalIndexLEB:\n      case RelocType::GlobalIndexI32:\n      case RelocType::TagIndexLEB:\n      case RelocType::TableIndexRelSLEB:\n      case RelocType::TableIndexRelSLEB64:\n      case RelocType::TableNumberLEB:\n        break;\n\n      default:\n        PrintError(\"unknown reloc type: %s\", GetRelocTypeName(type));\n        return Result::Error;\n    }\n    CALLBACK(OnReloc, type, offset, index, addend);\n  }\n  CALLBACK0(EndRelocSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadDylink0Section(Offset section_size) {\n  CALLBACK(BeginDylinkSection, section_size);\n\n  while (state_.offset < read_end_) {\n    uint32_t dylink_type;\n    Offset subsection_size;\n    CHECK_RESULT(ReadU32Leb128(&dylink_type, \"type\"));\n    CHECK_RESULT(ReadOffset(&subsection_size, \"subsection size\"));\n    ERROR_UNLESS(subsection_size <= read_end_ - state_.offset,\n                 \"invalid sub-section size: extends past end\");\n    size_t subsection_end = state_.offset + subsection_size;\n    ReadEndRestoreGuard guard(this);\n    read_end_ = subsection_end;\n\n    uint32_t count;\n    switch (static_cast<DylinkEntryType>(dylink_type)) {\n      case DylinkEntryType::MemInfo: {\n        uint32_t mem_size;\n        uint32_t mem_align;\n        uint32_t table_size;\n        uint32_t table_align;\n\n        CHECK_RESULT(ReadU32Leb128(&mem_size, \"mem_size\"));\n        CHECK_RESULT(ReadU32Leb128(&mem_align, \"mem_align\"));\n        CHECK_RESULT(ReadU32Leb128(&table_size, \"table_size\"));\n        CHECK_RESULT(ReadU32Leb128(&table_align, \"table_align\"));\n        CALLBACK(OnDylinkInfo, mem_size, mem_align, table_size, table_align);\n        break;\n      }\n      case DylinkEntryType::Needed:\n        CHECK_RESULT(ReadU32Leb128(&count, \"needed_dynlibs\"));\n        CALLBACK(OnDylinkNeededCount, count);\n        while (count--) {\n          std::string_view so_name;\n          CHECK_RESULT(ReadStr(&so_name, \"dylib so_name\"));\n          CALLBACK(OnDylinkNeeded, so_name);\n        }\n        break;\n      case DylinkEntryType::ImportInfo:\n        CHECK_RESULT(ReadU32Leb128(&count, \"count\"));\n        CALLBACK(OnDylinkImportCount, count);\n        for (Index i = 0; i < count; ++i) {\n          uint32_t flags = 0;\n          std::string_view module;\n          std::string_view field;\n          CHECK_RESULT(ReadStr(&module, \"module\"));\n          CHECK_RESULT(ReadStr(&field, \"field\"));\n          CHECK_RESULT(ReadU32Leb128(&flags, \"flags\"));\n          CALLBACK(OnDylinkImport, module, field, flags);\n        }\n        break;\n      case DylinkEntryType::ExportInfo:\n        CHECK_RESULT(ReadU32Leb128(&count, \"count\"));\n        CALLBACK(OnDylinkExportCount, count);\n        for (Index i = 0; i < count; ++i) {\n          uint32_t flags = 0;\n          std::string_view name;\n          CHECK_RESULT(ReadStr(&name, \"name\"));\n          CHECK_RESULT(ReadU32Leb128(&flags, \"flags\"));\n          CALLBACK(OnDylinkExport, name, flags);\n        }\n        break;\n      default:\n        // Unknown subsection, skip it.\n        state_.offset = subsection_end;\n        break;\n    }\n    ERROR_UNLESS(state_.offset == subsection_end,\n                 \"unfinished sub-section (expected end: 0x%\" PRIzx \")\",\n                 subsection_end);\n  }\n\n  CALLBACK0(EndDylinkSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadDylinkSection(Offset section_size) {\n  CALLBACK(BeginDylinkSection, section_size);\n  uint32_t mem_size;\n  uint32_t mem_align;\n  uint32_t table_size;\n  uint32_t table_align;\n\n  CHECK_RESULT(ReadU32Leb128(&mem_size, \"mem_size\"));\n  CHECK_RESULT(ReadU32Leb128(&mem_align, \"mem_align\"));\n  CHECK_RESULT(ReadU32Leb128(&table_size, \"table_size\"));\n  CHECK_RESULT(ReadU32Leb128(&table_align, \"table_align\"));\n  CALLBACK(OnDylinkInfo, mem_size, mem_align, table_size, table_align);\n\n  uint32_t count;\n  CHECK_RESULT(ReadU32Leb128(&count, \"needed_dynlibs\"));\n  CALLBACK(OnDylinkNeededCount, count);\n  while (count--) {\n    std::string_view so_name;\n    CHECK_RESULT(ReadStr(&so_name, \"dylib so_name\"));\n    CALLBACK(OnDylinkNeeded, so_name);\n  }\n\n  CALLBACK0(EndDylinkSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadTargetFeaturesSections(Offset section_size) {\n  CALLBACK(BeginTargetFeaturesSection, section_size);\n  uint32_t count;\n  CHECK_RESULT(ReadU32Leb128(&count, \"sym count\"));\n  CALLBACK(OnFeatureCount, count);\n  while (count--) {\n    uint8_t prefix;\n    std::string_view name;\n    CHECK_RESULT(ReadU8(&prefix, \"prefix\"));\n    CHECK_RESULT(ReadStr(&name, \"feature name\"));\n    CALLBACK(OnFeature, prefix, name);\n  }\n  CALLBACK0(EndTargetFeaturesSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadGenericCustomSection(std::string_view name,\n                                              Offset section_size) {\n  CALLBACK(BeginGenericCustomSection, section_size);\n  const void* data;\n  Offset custom_data_size = read_end_ - state_.offset;\n  CHECK_RESULT(\n      ReadBytesWithSize(&data, custom_data_size, \"custom section data\"));\n  CALLBACK(OnGenericCustomSection, name, data, custom_data_size);\n  CALLBACK0(EndGenericCustomSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadLinkingSection(Offset section_size) {\n  CALLBACK(BeginLinkingSection, section_size);\n  uint32_t version;\n  CHECK_RESULT(ReadU32Leb128(&version, \"version\"));\n  ERROR_UNLESS(version == 2, \"invalid linking metadata version: %u\", version);\n  while (state_.offset < read_end_) {\n    uint32_t linking_type;\n    Offset subsection_size;\n    CHECK_RESULT(ReadU32Leb128(&linking_type, \"type\"));\n    CHECK_RESULT(ReadOffset(&subsection_size, \"subsection size\"));\n    ERROR_UNLESS(subsection_size <= read_end_ - state_.offset,\n                 \"invalid sub-section size: extends past end\");\n    size_t subsection_end = state_.offset + subsection_size;\n    ReadEndRestoreGuard guard(this);\n    read_end_ = subsection_end;\n\n    uint32_t count;\n    switch (static_cast<LinkingEntryType>(linking_type)) {\n      case LinkingEntryType::SymbolTable:\n        CHECK_RESULT(ReadU32Leb128(&count, \"sym count\"));\n        CALLBACK(OnSymbolCount, count);\n        for (Index i = 0; i < count; ++i) {\n          std::string_view name;\n          uint32_t flags = 0;\n          uint32_t kind = 0;\n          CHECK_RESULT(ReadU32Leb128(&kind, \"sym type\"));\n          CHECK_RESULT(ReadU32Leb128(&flags, \"sym flags\"));\n          SymbolType sym_type = static_cast<SymbolType>(kind);\n          switch (sym_type) {\n            case SymbolType::Function:\n            case SymbolType::Global:\n            case SymbolType::Tag:\n            case SymbolType::Table: {\n              uint32_t index = 0;\n              CHECK_RESULT(ReadU32Leb128(&index, \"index\"));\n              if ((flags & WABT_SYMBOL_FLAG_UNDEFINED) == 0 ||\n                  (flags & WABT_SYMBOL_FLAG_EXPLICIT_NAME) != 0)\n                CHECK_RESULT(ReadStr(&name, \"symbol name\"));\n              switch (sym_type) {\n                case SymbolType::Function:\n                  CALLBACK(OnFunctionSymbol, i, flags, name, index);\n                  break;\n                case SymbolType::Global:\n                  CALLBACK(OnGlobalSymbol, i, flags, name, index);\n                  break;\n                case SymbolType::Tag:\n                  CALLBACK(OnTagSymbol, i, flags, name, index);\n                  break;\n                case SymbolType::Table:\n                  CALLBACK(OnTableSymbol, i, flags, name, index);\n                  break;\n                default:\n                  WABT_UNREACHABLE;\n              }\n              break;\n            }\n            case SymbolType::Data: {\n              uint32_t segment = 0;\n              uint32_t offset = 0;\n              uint32_t size = 0;\n              CHECK_RESULT(ReadStr(&name, \"symbol name\"));\n              if ((flags & WABT_SYMBOL_FLAG_UNDEFINED) == 0) {\n                CHECK_RESULT(ReadU32Leb128(&segment, \"segment\"));\n                CHECK_RESULT(ReadU32Leb128(&offset, \"offset\"));\n                CHECK_RESULT(ReadU32Leb128(&size, \"size\"));\n              }\n              CALLBACK(OnDataSymbol, i, flags, name, segment, offset, size);\n              break;\n            }\n            case SymbolType::Section: {\n              uint32_t index = 0;\n              CHECK_RESULT(ReadU32Leb128(&index, \"index\"));\n              CALLBACK(OnSectionSymbol, i, flags, index);\n              break;\n            }\n          }\n        }\n        break;\n      case LinkingEntryType::SegmentInfo:\n        CHECK_RESULT(ReadU32Leb128(&count, \"info count\"));\n        CALLBACK(OnSegmentInfoCount, count);\n        for (Index i = 0; i < count; i++) {\n          std::string_view name;\n          Address alignment_log2;\n          uint32_t flags;\n          CHECK_RESULT(ReadStr(&name, \"segment name\"));\n          CHECK_RESULT(ReadAlignment(&alignment_log2, \"segment alignment\"));\n          CHECK_RESULT(CheckAlignment(&alignment_log2, \"segment alignment\"));\n          CHECK_RESULT(ReadU32Leb128(&flags, \"segment flags\"));\n          CALLBACK(OnSegmentInfo, i, name, alignment_log2, flags);\n        }\n        break;\n      case LinkingEntryType::InitFunctions:\n        CHECK_RESULT(ReadU32Leb128(&count, \"info count\"));\n        CALLBACK(OnInitFunctionCount, count);\n        while (count--) {\n          uint32_t priority;\n          uint32_t symbol;\n          CHECK_RESULT(ReadU32Leb128(&priority, \"priority\"));\n          CHECK_RESULT(ReadU32Leb128(&symbol, \"symbol index\"));\n          CALLBACK(OnInitFunction, priority, symbol);\n        }\n        break;\n      case LinkingEntryType::ComdatInfo:\n        CHECK_RESULT(ReadU32Leb128(&count, \"count\"));\n        CALLBACK(OnComdatCount, count);\n        while (count--) {\n          uint32_t flags;\n          uint32_t entry_count;\n          std::string_view name;\n          CHECK_RESULT(ReadStr(&name, \"comdat name\"));\n          CHECK_RESULT(ReadU32Leb128(&flags, \"flags\"));\n          CHECK_RESULT(ReadU32Leb128(&entry_count, \"entry count\"));\n          CALLBACK(OnComdatBegin, name, flags, entry_count);\n          while (entry_count--) {\n            uint32_t kind;\n            uint32_t index;\n            CHECK_RESULT(ReadU32Leb128(&kind, \"kind\"));\n            CHECK_RESULT(ReadU32Leb128(&index, \"index\"));\n            ComdatType comdat_type = static_cast<ComdatType>(kind);\n            CALLBACK(OnComdatEntry, comdat_type, index);\n          }\n        }\n        break;\n      default:\n        // Unknown subsection, skip it.\n        state_.offset = subsection_end;\n        break;\n    }\n    ERROR_UNLESS(state_.offset == subsection_end,\n                 \"unfinished sub-section (expected end: 0x%\" PRIzx \")\",\n                 subsection_end);\n  }\n  CALLBACK0(EndLinkingSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadTagType(Index* out_sig_index) {\n  uint8_t attribute;\n  CHECK_RESULT(ReadU8(&attribute, \"tag attribute\"));\n  ERROR_UNLESS(attribute == 0, \"tag attribute must be 0\");\n  CHECK_RESULT(ReadIndex(out_sig_index, \"tag signature index\"));\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadTagSection(Offset section_size) {\n  CALLBACK(BeginTagSection, section_size);\n  Index num_tags;\n  CHECK_RESULT(ReadCount(&num_tags, \"tag count\"));\n  CALLBACK(OnTagCount, num_tags);\n\n  for (Index i = 0; i < num_tags; ++i) {\n    Index tag_index = num_tag_imports_ + i;\n    Index sig_index;\n    CHECK_RESULT(ReadTagType(&sig_index));\n    CALLBACK(OnTagType, tag_index, sig_index);\n  }\n\n  CALLBACK(EndTagSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadCodeMetadataSection(std::string_view name,\n                                             Offset section_size) {\n  CALLBACK(BeginCodeMetadataSection, name, section_size);\n\n  Index num_functions;\n  CHECK_RESULT(ReadCount(&num_functions, \"function count\"));\n  CALLBACK(OnCodeMetadataFuncCount, num_functions);\n\n  Index last_function_index = kInvalidIndex;\n  for (Index i = 0; i < num_functions; ++i) {\n    Index function_index;\n    CHECK_RESULT(ReadIndex(&function_index, \"function index\"));\n    ERROR_UNLESS(function_index >= num_func_imports_,\n                 \"function import can't have metadata (got %\" PRIindex \")\",\n                 function_index);\n    ERROR_UNLESS(function_index < NumTotalFuncs(),\n                 \"invalid function index: %\" PRIindex, function_index);\n    ERROR_UNLESS(function_index != last_function_index,\n                 \"duplicate function index: %\" PRIindex, function_index);\n    ERROR_UNLESS(last_function_index == kInvalidIndex ||\n                     function_index > last_function_index,\n                 \"function index out of order: %\" PRIindex, function_index);\n    last_function_index = function_index;\n\n    Index num_metadata;\n    CHECK_RESULT(ReadCount(&num_metadata, \"metadata instances count\"));\n\n    CALLBACK(OnCodeMetadataCount, function_index, num_metadata);\n\n    Offset last_code_offset = kInvalidOffset;\n    for (Index j = 0; j < num_metadata; ++j) {\n      Offset code_offset;\n      CHECK_RESULT(ReadOffset(&code_offset, \"code offset\"));\n      ERROR_UNLESS(code_offset != last_code_offset,\n                   \"duplicate code offset: %\" PRIzx, code_offset);\n      ERROR_UNLESS(\n          last_code_offset == kInvalidOffset || code_offset > last_code_offset,\n          \"code offset out of order: %\" PRIzx, code_offset);\n      last_code_offset = code_offset;\n\n      Address data_size;\n      const void* data;\n      CHECK_RESULT(ReadBytes(&data, &data_size, \"instance data\"));\n      CALLBACK(OnCodeMetadata, code_offset, data, data_size);\n    }\n  }\n\n  CALLBACK(EndCodeMetadataSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadCustomSection(Index section_index,\n                                       Offset section_size) {\n  std::string_view section_name;\n  CHECK_RESULT(ReadStr(&section_name, \"section name\"));\n  CALLBACK(BeginCustomSection, section_index, section_size, section_name);\n  ValueRestoreGuard<bool, &BinaryReader::reading_custom_section_> guard(this);\n  reading_custom_section_ = true;\n\n  {\n    // Backtrack parser when scope ends\n    ValueRestoreGuard<BinaryReaderDelegate::State, &BinaryReader::state_> guard(\n        this);\n    CHECK_RESULT(ReadGenericCustomSection(section_name, section_size));\n  }\n\n  if (options_.read_debug_names && section_name == WABT_BINARY_SECTION_NAME) {\n    CHECK_RESULT(ReadNameSection(section_size));\n    did_read_names_section_ = true;\n  } else if (section_name == WABT_BINARY_SECTION_DYLINK0) {\n    CHECK_RESULT(ReadDylink0Section(section_size));\n  } else if (section_name == WABT_BINARY_SECTION_DYLINK) {\n    CHECK_RESULT(ReadDylinkSection(section_size));\n  } else if (section_name.rfind(WABT_BINARY_SECTION_RELOC, 0) == 0) {\n    // Reloc sections always begin with \"reloc.\"\n    CHECK_RESULT(ReadRelocSection(section_size));\n  } else if (section_name == WABT_BINARY_SECTION_TARGET_FEATURES) {\n    CHECK_RESULT(ReadTargetFeaturesSections(section_size));\n  } else if (section_name == WABT_BINARY_SECTION_LINKING) {\n    CHECK_RESULT(ReadLinkingSection(section_size));\n  } else if (options_.features.code_metadata_enabled() &&\n             section_name.find(WABT_BINARY_SECTION_CODE_METADATA) == 0) {\n    std::string_view metadata_name = section_name;\n    metadata_name.remove_prefix(sizeof(WABT_BINARY_SECTION_CODE_METADATA) - 1);\n    CHECK_RESULT(ReadCodeMetadataSection(metadata_name, section_size));\n  } else {\n    // Skip. This is a generic custom section, and is handled above.\n    state_.offset = read_end_;\n  }\n  CALLBACK0(EndCustomSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadTypeSection(Offset section_size) {\n  CALLBACK(BeginTypeSection, section_size);\n  Index num_signatures;\n  CHECK_RESULT(ReadCount(&num_signatures, \"type count\"));\n  CALLBACK(OnTypeCount, num_signatures);\n\n  for (Index i = 0; i < num_signatures; ++i) {\n    Type form;\n    if (options_.features.gc_enabled()) {\n      CHECK_RESULT(ReadType(&form, \"type form\"));\n    } else {\n      uint8_t type;\n      CHECK_RESULT(ReadU8(&type, \"type form\"));\n      ERROR_UNLESS(type == 0x60, \"unexpected type form (got %#x)\", type);\n      form = Type::Func;\n    }\n\n    switch (form) {\n      case Type::Func: {\n        Index num_params;\n        CHECK_RESULT(ReadCount(&num_params, \"function param count\"));\n\n        param_types_.resize(num_params);\n\n        for (Index j = 0; j < num_params; ++j) {\n          Type param_type;\n          CHECK_RESULT(ReadType(&param_type, \"function param type\"));\n          ERROR_UNLESS(IsConcreteType(param_type),\n                       \"expected valid param type (got \" PRItypecode \")\",\n                       WABT_PRINTF_TYPE_CODE(param_type));\n          param_types_[j] = param_type;\n        }\n\n        Index num_results;\n        CHECK_RESULT(ReadCount(&num_results, \"function result count\"));\n\n        result_types_.resize(num_results);\n\n        for (Index j = 0; j < num_results; ++j) {\n          Type result_type;\n          CHECK_RESULT(ReadType(&result_type, \"function result type\"));\n          ERROR_UNLESS(IsConcreteType(result_type),\n                       \"expected valid result type (got \" PRItypecode \")\",\n                       WABT_PRINTF_TYPE_CODE(result_type));\n          result_types_[j] = result_type;\n        }\n\n        Type* param_types = num_params ? param_types_.data() : nullptr;\n        Type* result_types = num_results ? result_types_.data() : nullptr;\n\n        CALLBACK(OnFuncType, i, num_params, param_types, num_results,\n                 result_types);\n        break;\n      }\n\n      case Type::Struct: {\n        ERROR_UNLESS(options_.features.gc_enabled(),\n                     \"invalid type form: struct not allowed\");\n        Index num_fields;\n        CHECK_RESULT(ReadCount(&num_fields, \"field count\"));\n\n        fields_.resize(num_fields);\n        for (Index j = 0; j < num_fields; ++j) {\n          CHECK_RESULT(ReadField(&fields_[j]));\n        }\n\n        CALLBACK(OnStructType, i, fields_.size(), fields_.data());\n        break;\n      }\n\n      case Type::Array: {\n        ERROR_UNLESS(options_.features.gc_enabled(),\n                     \"invalid type form: array not allowed\");\n\n        TypeMut field;\n        CHECK_RESULT(ReadField(&field));\n        CALLBACK(OnArrayType, i, field);\n        break;\n      };\n\n      default:\n        PrintError(\"unexpected type form (got \" PRItypecode \")\",\n                   WABT_PRINTF_TYPE_CODE(form));\n        return Result::Error;\n    }\n  }\n  CALLBACK0(EndTypeSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadImport(Index i,\n                                std::string_view module_name,\n                                std::string_view field_name,\n                                ExternalKind kind) {\n  CALLBACK(OnImport, i, kind, module_name, field_name);\n  switch (kind) {\n    case ExternalKind::Func: {\n      Index sig_index;\n      CHECK_RESULT(ReadIndex(&sig_index, \"import signature index\"));\n      CALLBACK(OnImportFunc, i, module_name, field_name, num_func_imports_,\n               sig_index);\n      num_func_imports_++;\n      break;\n    }\n\n    case ExternalKind::Table: {\n      Limits elem_limits;\n      Type elem_type;\n      CHECK_RESULT(ReadRefType(&elem_type, \"table elem type\"));\n      CHECK_RESULT(ReadTable(&elem_limits));\n      CALLBACK(OnImportTable, i, module_name, field_name, num_table_imports_,\n               elem_type, &elem_limits);\n      num_table_imports_++;\n      break;\n    }\n\n    case ExternalKind::Memory: {\n      Limits page_limits;\n      uint32_t page_size;\n      CHECK_RESULT(ReadMemory(&page_limits, &page_size));\n      CALLBACK(OnImportMemory, i, module_name, field_name, num_memory_imports_,\n               &page_limits, page_size);\n      num_memory_imports_++;\n      break;\n    }\n\n    case ExternalKind::Global: {\n      Type type;\n      bool mutable_;\n      CHECK_RESULT(ReadGlobalHeader(&type, &mutable_));\n      CALLBACK(OnImportGlobal, i, module_name, field_name, num_global_imports_,\n               type, mutable_);\n      num_global_imports_++;\n      break;\n    }\n\n    case ExternalKind::Tag: {\n      Index sig_index;\n      ERROR_UNLESS(options_.features.exceptions_enabled(),\n                   \"invalid import tag kind: exceptions not allowed\");\n      CHECK_RESULT(ReadTagType(&sig_index));\n      CALLBACK(OnImportTag, i, module_name, field_name, num_tag_imports_,\n               sig_index);\n      num_tag_imports_++;\n      break;\n    }\n  }\n\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadImportSection(Offset section_size) {\n  CALLBACK(BeginImportSection, section_size);\n  Index num_imports;\n  CHECK_RESULT(ReadCount(&num_imports, \"import count\"));\n  CALLBACK(OnImportCount, num_imports);\n  Index i = 0;\n  while (i < num_imports) {\n    std::string_view module_name;\n    CHECK_RESULT(ReadStr(&module_name, \"import module name\"));\n    std::string_view field_name;\n    CHECK_RESULT(ReadStr(&field_name, \"import field name\"));\n\n    uint8_t kind_u8;\n    CHECK_RESULT(ReadU8(&kind_u8, \"import kind\"));\n\n    ExternalKind kind;\n    if (field_name == \"\" && (kind_u8 == 0x7F || kind_u8 == 0x7E)) {\n      ERROR_UNLESS(options_.features.compact_imports_enabled(),\n                   \"module uses compact imports, but feature not enabled\");\n      Index num_compact_imports;\n      if (kind_u8 == 0x7E) {\n        // Read the import kind once and re-used for each of num_compact_imports\n        CHECK_RESULT(ReadExternalKind(&kind, \"compact import kind\", \"import\"));\n        CHECK_RESULT(ReadCount(&num_compact_imports, \"compact import count\"));\n        for (Index j = 0; j < num_compact_imports; ++j) {\n          CHECK_RESULT(ReadStr(&field_name, \"compact import field name\"));\n          CHECK_RESULT(ReadImport(i++, module_name, field_name, kind));\n        }\n      } else {\n        CHECK_RESULT(ReadCount(&num_compact_imports, \"compact import count\"));\n        for (Index j = 0; j < num_compact_imports; ++j) {\n          CHECK_RESULT(ReadStr(&field_name, \"compact import field name\"));\n          CHECK_RESULT(\n              ReadExternalKind(&kind, \"compact import kind\", \"import\"));\n          CHECK_RESULT(ReadImport(i++, module_name, field_name, kind));\n        }\n      }\n    } else {\n      // Normal non-compact import\n      // kind_u8 was not one of the special values above so rewind one\n      // byte so we can read it with ReadExternalKind\n      state_.offset--;\n      CHECK_RESULT(ReadExternalKind(&kind, \"import kind\", \"import\"));\n      CHECK_RESULT(ReadImport(i++, module_name, field_name, kind));\n    }\n  }\n\n  CALLBACK0(EndImportSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadFunctionSection(Offset section_size) {\n  CALLBACK(BeginFunctionSection, section_size);\n  CHECK_RESULT(\n      ReadCount(&num_function_signatures_, \"function signature count\"));\n  CALLBACK(OnFunctionCount, num_function_signatures_);\n  for (Index i = 0; i < num_function_signatures_; ++i) {\n    Index func_index = num_func_imports_ + i;\n    Index sig_index;\n    CHECK_RESULT(ReadIndex(&sig_index, \"function signature index\"));\n    CALLBACK(OnFunction, func_index, sig_index);\n  }\n  CALLBACK0(EndFunctionSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadTableSection(Offset section_size) {\n  CALLBACK(BeginTableSection, section_size);\n  Index num_tables;\n  CHECK_RESULT(ReadCount(&num_tables, \"table count\"));\n  CALLBACK(OnTableCount, num_tables);\n  for (Index i = 0; i < num_tables; ++i) {\n    Index table_index = num_table_imports_ + i;\n    Type elem_type;\n    Limits elem_limits;\n    TableInitExprStatus init_provided =\n        TableInitExprStatus::TableWithoutInitExpression;\n\n    CHECK_RESULT(ReadType(&elem_type, \"table elem type\"));\n\n    // Type::Void will never represent a valid type, so it was\n    // choosen to represent the availability of the init expression.\n    if (options_.features.function_references_enabled() &&\n        elem_type == Type::Void) {\n      init_provided = TableInitExprStatus::TableWithInitExpression;\n\n      uint8_t value;\n      CHECK_RESULT(ReadU8(&value, \"table init\"));\n      // This zero value is reserved for future\n      // extensions, and currently unused.\n      if (value != 0) {\n        PrintError(\"unsupported table intializer: 0x%x\\n\",\n                   static_cast<int>(value));\n        return Result::Error;\n      }\n\n      CHECK_RESULT(ReadType(&elem_type, \"table elem type\"));\n    }\n\n    ERROR_UNLESS(elem_type.IsRef(), \"table elem type must be a reference type\");\n\n    CHECK_RESULT(ReadTable(&elem_limits));\n    CALLBACK(BeginTable, table_index, elem_type, &elem_limits, init_provided);\n\n    if (init_provided == TableInitExprStatus::TableWithInitExpression) {\n      CALLBACK(BeginTableInitExpr, table_index);\n      CHECK_RESULT(ReadInitExpr(table_index));\n      CALLBACK(EndTableInitExpr, table_index);\n    }\n\n    CALLBACK(EndTable, table_index);\n  }\n  CALLBACK0(EndTableSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadMemorySection(Offset section_size) {\n  CALLBACK(BeginMemorySection, section_size);\n  Index num_memories;\n  CHECK_RESULT(ReadCount(&num_memories, \"memory count\"));\n  CALLBACK(OnMemoryCount, num_memories);\n  for (Index i = 0; i < num_memories; ++i) {\n    Index memory_index = num_memory_imports_ + i;\n    Limits page_limits;\n    uint32_t page_size;\n    CHECK_RESULT(ReadMemory(&page_limits, &page_size));\n    CALLBACK(OnMemory, memory_index, &page_limits, page_size);\n  }\n  CALLBACK0(EndMemorySection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadGlobalSection(Offset section_size) {\n  CALLBACK(BeginGlobalSection, section_size);\n  Index num_globals;\n  CHECK_RESULT(ReadCount(&num_globals, \"global count\"));\n  CALLBACK(OnGlobalCount, num_globals);\n  for (Index i = 0; i < num_globals; ++i) {\n    Index global_index = num_global_imports_ + i;\n    Type global_type;\n    bool mutable_;\n    CHECK_RESULT(ReadGlobalHeader(&global_type, &mutable_));\n    CALLBACK(BeginGlobal, global_index, global_type, mutable_);\n    CALLBACK(BeginGlobalInitExpr, global_index);\n    CHECK_RESULT(ReadInitExpr(global_index));\n    CALLBACK(EndGlobalInitExpr, global_index);\n    CALLBACK(EndGlobal, global_index);\n  }\n  CALLBACK0(EndGlobalSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadExportSection(Offset section_size) {\n  CALLBACK(BeginExportSection, section_size);\n  Index num_exports;\n  CHECK_RESULT(ReadCount(&num_exports, \"export count\"));\n  CALLBACK(OnExportCount, num_exports);\n  for (Index i = 0; i < num_exports; ++i) {\n    std::string_view name;\n    CHECK_RESULT(ReadStr(&name, \"export item name\"));\n\n    ExternalKind kind;\n    CHECK_RESULT(ReadExternalKind(&kind, \"export kind\", \"export\"));\n\n    Index item_index;\n    CHECK_RESULT(ReadIndex(&item_index, \"export item index\"));\n    if (kind == ExternalKind::Tag) {\n      ERROR_UNLESS(options_.features.exceptions_enabled(),\n                   \"invalid export tag kind: exceptions not allowed\");\n    }\n\n    CALLBACK(OnExport, i, static_cast<ExternalKind>(kind), item_index, name);\n  }\n  CALLBACK0(EndExportSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadStartSection(Offset section_size) {\n  CALLBACK(BeginStartSection, section_size);\n  Index func_index;\n  CHECK_RESULT(ReadIndex(&func_index, \"start function index\"));\n  CALLBACK(OnStartFunction, func_index);\n  CALLBACK0(EndStartSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadElemSection(Offset section_size) {\n  CALLBACK(BeginElemSection, section_size);\n  Index num_elem_segments;\n  CHECK_RESULT(ReadCount(&num_elem_segments, \"elem segment count\"));\n  CALLBACK(OnElemSegmentCount, num_elem_segments);\n  for (Index i = 0; i < num_elem_segments; ++i) {\n    uint32_t flags;\n    CHECK_RESULT(ReadU32Leb128(&flags, \"elem segment flags\"));\n    ERROR_IF(flags > SegFlagMax, \"invalid elem segment flags: %#x\", flags);\n    Index table_index(0);\n    if ((flags & (SegPassive | SegExplicitIndex)) == SegExplicitIndex) {\n      CHECK_RESULT(ReadIndex(&table_index, \"elem segment table index\"));\n    }\n    Type elem_type = Type::FuncRef;\n\n    if (options_.features.function_references_enabled() &&\n        !(flags & SegUseElemExprs)) {\n      elem_type = Type(Type::FuncRef, Type::ReferenceNonNull);\n    }\n\n    CALLBACK(BeginElemSegment, i, table_index, flags);\n\n    if (!(flags & SegPassive)) {\n      CALLBACK(BeginElemSegmentInitExpr, i);\n      CHECK_RESULT(ReadInitExpr(i));\n      CALLBACK(EndElemSegmentInitExpr, i);\n    }\n\n    // For backwards compat we support not declaring the element kind.\n    if (flags & (SegPassive | SegExplicitIndex)) {\n      if (flags & SegUseElemExprs) {\n        CHECK_RESULT(ReadRefType(&elem_type, \"table elem type\"));\n      } else {\n        ExternalKind kind;\n        CHECK_RESULT(ReadExternalKind(&kind, \"export kind\", \"export\"));\n        ERROR_UNLESS(kind == ExternalKind::Func,\n                     \"segment elem type must be func (%s)\",\n                     elem_type.GetName().c_str());\n      }\n    }\n\n    CALLBACK(OnElemSegmentElemType, i, elem_type);\n\n    Index num_elem_exprs;\n    CHECK_RESULT(ReadCount(&num_elem_exprs, \"elem count\"));\n\n    CALLBACK(OnElemSegmentElemExprCount, i, num_elem_exprs);\n    for (Index j = 0; j < num_elem_exprs; ++j) {\n      CALLBACK(BeginElemExpr, i, j);\n      if (flags & SegUseElemExprs) {\n        CHECK_RESULT(ReadInitExpr(j));\n      } else {\n        Index func_index;\n        CHECK_RESULT(ReadIndex(&func_index, \"elem expr func index\"));\n        CALLBACK(OnOpcode, Opcode::RefFunc);\n        CALLBACK(OnRefFuncExpr, func_index);\n        CALLBACK(OnOpcodeUint32, func_index);\n        CALLBACK0(OnEndExpr);\n      }\n      CALLBACK(EndElemExpr, i, j);\n    }\n    CALLBACK(EndElemSegment, i);\n  }\n  CALLBACK0(EndElemSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadCodeSection(Offset section_size) {\n  CALLBACK(BeginCodeSection, section_size);\n  CHECK_RESULT(ReadCount(&num_function_bodies_, \"function body count\"));\n  ERROR_UNLESS(num_function_signatures_ == num_function_bodies_,\n               \"function signature count != function body count\");\n  CALLBACK(OnFunctionBodyCount, num_function_bodies_);\n  for (Index i = 0; i < num_function_bodies_; ++i) {\n    Index func_index = num_func_imports_ + i;\n    Offset func_offset = state_.offset;\n    state_.offset = func_offset;\n    uint32_t body_size;\n    CHECK_RESULT(ReadU32Leb128(&body_size, \"function body size\"));\n    Offset body_start_offset = state_.offset;\n    Offset end_offset = body_start_offset + body_size;\n    ERROR_UNLESS(end_offset >= body_start_offset && end_offset <= read_end_,\n                 \"invalid function body size: extends past end\");\n    CALLBACK(BeginFunctionBody, func_index, body_size);\n\n    if (options_.skip_function_bodies) {\n      state_.offset = end_offset;\n    } else {\n      CHECK_RESULT(ReadFunctionBody(end_offset));\n    }\n\n    CALLBACK(EndFunctionBody, func_index);\n  }\n  CALLBACK0(EndCodeSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadDataSection(Offset section_size) {\n  CALLBACK(BeginDataSection, section_size);\n  CHECK_RESULT(ReadCount(&num_data_segments_, \"data segment count\"));\n  CALLBACK(OnDataSegmentCount, num_data_segments_);\n  // If the DataCount section is not present, then data_count_ will be invalid.\n  ERROR_UNLESS(\n      data_count_ == kInvalidIndex || data_count_ == num_data_segments_,\n      \"data segment count does not equal count in DataCount section\");\n  for (Index i = 0; i < num_data_segments_; ++i) {\n    uint32_t flags;\n    CHECK_RESULT(ReadU32Leb128(&flags, \"data segment flags\"));\n    ERROR_IF(flags != 0 && !options_.features.bulk_memory_enabled(),\n             \"invalid memory index %d: bulk memory not allowed\", flags);\n    ERROR_IF(flags > SegFlagMax, \"invalid data segment flags: %#x\", flags);\n    Index memory_index(0);\n    if (flags & SegExplicitIndex) {\n      CHECK_RESULT(ReadIndex(&memory_index, \"data segment memory index\"));\n    }\n    CALLBACK(BeginDataSegment, i, memory_index, flags);\n    if (!(flags & SegPassive)) {\n      CALLBACK(BeginDataSegmentInitExpr, i);\n      CHECK_RESULT(ReadInitExpr(i));\n      CALLBACK(EndDataSegmentInitExpr, i);\n    }\n\n    Address data_size;\n    const void* data;\n    CHECK_RESULT(ReadBytes(&data, &data_size, \"data segment data\"));\n    CALLBACK(OnDataSegmentData, i, data, data_size);\n    CALLBACK(EndDataSegment, i);\n  }\n  CALLBACK0(EndDataSection);\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadDataCountSection(Offset section_size) {\n  CALLBACK(BeginDataCountSection, section_size);\n  Index data_count;\n  CHECK_RESULT(ReadIndex(&data_count, \"data count\"));\n  CALLBACK(OnDataCount, data_count);\n  CALLBACK0(EndDataCountSection);\n  data_count_ = data_count;\n  return Result::Ok;\n}\n\nResult BinaryReader::ReadSections(const ReadSectionsOptions& options) {\n  Result result = Result::Ok;\n  Index section_index = 0;\n  bool seen_section_code[static_cast<int>(BinarySection::Last) + 1] = {false};\n\n  for (; state_.offset < state_.size; ++section_index) {\n    uint8_t section_code;\n    Offset section_size;\n    CHECK_RESULT(ReadU8(&section_code, \"section code\"));\n    CHECK_RESULT(ReadOffset(&section_size, \"section size\"));\n    ERROR_UNLESS(section_size <= state_.size - state_.offset,\n                 \"invalid section size: extends past end\");\n    ReadEndRestoreGuard guard(this);\n    read_end_ = state_.offset + section_size;\n    if (section_code >= kBinarySectionCount) {\n      PrintError(\"invalid section code: %u\", section_code);\n      if (options.stop_on_first_error) {\n        return Result::Error;\n      }\n      // If we don't have to stop on first error, continue reading\n      // sections, because although we could not understand the\n      // current section, we can continue and correctly parse\n      // subsequent sections, so we can give back as much information\n      // as we can understand.\n      result = Result::Error;\n      state_.offset = read_end_;\n      continue;\n    }\n\n    BinarySection section = static_cast<BinarySection>(section_code);\n    if (section != BinarySection::Custom) {\n      if (seen_section_code[section_code]) {\n        PrintError(\"multiple %s sections\", GetSectionName(section));\n        return Result::Error;\n      }\n      seen_section_code[section_code] = true;\n    }\n\n    ERROR_UNLESS(read_end_ <= state_.size,\n                 \"invalid section size: extends past end\");\n\n    ERROR_UNLESS(\n        last_known_section_ == BinarySection::Invalid ||\n            section == BinarySection::Custom ||\n            GetSectionOrder(section) > GetSectionOrder(last_known_section_),\n        \"section %s out of order\", GetSectionName(section));\n\n    ERROR_UNLESS(!did_read_names_section_ || section == BinarySection::Custom,\n                 \"%s section can not occur after Name section\",\n                 GetSectionName(section));\n\n    CALLBACK(BeginSection, section_index, section, section_size);\n\n    bool stop_on_first_error = options_.stop_on_first_error;\n    Result section_result = Result::Error;\n    switch (section) {\n      case BinarySection::Custom:\n        section_result = ReadCustomSection(section_index, section_size);\n        if (options_.fail_on_custom_section_error) {\n          result |= section_result;\n        } else {\n          stop_on_first_error = false;\n        }\n        break;\n      case BinarySection::Type:\n        section_result = ReadTypeSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Import:\n        section_result = ReadImportSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Function:\n        section_result = ReadFunctionSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Table:\n        section_result = ReadTableSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Memory:\n        section_result = ReadMemorySection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Global:\n        section_result = ReadGlobalSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Export:\n        section_result = ReadExportSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Start:\n        section_result = ReadStartSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Elem:\n        section_result = ReadElemSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Code:\n        section_result = ReadCodeSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Data:\n        section_result = ReadDataSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Tag:\n        ERROR_UNLESS(options_.features.exceptions_enabled(),\n                     \"invalid section code: %u\",\n                     static_cast<unsigned int>(section));\n        section_result = ReadTagSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::DataCount:\n        ERROR_UNLESS(options_.features.bulk_memory_enabled(),\n                     \"invalid section code: %u\",\n                     static_cast<unsigned int>(section));\n        section_result = ReadDataCountSection(section_size);\n        result |= section_result;\n        break;\n      case BinarySection::Invalid:\n        WABT_UNREACHABLE;\n    }\n\n    if (Succeeded(section_result) && state_.offset != read_end_) {\n      PrintError(\"unfinished section (expected end: 0x%\" PRIzx \")\", read_end_);\n      section_result = Result::Error;\n      result |= section_result;\n    }\n\n    if (Failed(section_result)) {\n      if (stop_on_first_error) {\n        return Result::Error;\n      }\n\n      // If we're continuing after failing to read this section, move the\n      // offset to the expected section end. This way we may be able to read\n      // further sections.\n      state_.offset = read_end_;\n    }\n\n    if (section != BinarySection::Custom) {\n      last_known_section_ = section;\n    }\n  }\n\n  return result;\n}\n\nResult BinaryReader::ReadModule(const ReadModuleOptions& options) {\n  uint32_t magic = 0;\n  CHECK_RESULT(ReadU32(&magic, \"magic\"));\n  ERROR_UNLESS(magic == WABT_BINARY_MAGIC, \"bad magic value\");\n\n  uint16_t version = 0, layer = 0;\n  CHECK_RESULT(ReadU16(&version, \"version\"));\n  CHECK_RESULT(ReadU16(&layer, \"layer\"));\n\n  switch (layer) {\n    case WABT_BINARY_LAYER_MODULE:\n      ERROR_UNLESS(version == WABT_BINARY_VERSION,\n                   \"bad wasm file version: %#x (expected %#x)\", version,\n                   WABT_BINARY_VERSION);\n      break;\n    case WABT_BINARY_LAYER_COMPONENT:\n      ERROR(\"wasm components are not yet supported in this tool\");\n      break;\n    default:\n      ERROR(\"unsupported wasm layer: %#x\", layer);\n      break;\n  }\n\n  CALLBACK(BeginModule, version);\n  CHECK_RESULT(ReadSections(ReadSectionsOptions{options.stop_on_first_error}));\n  // This is checked in ReadCodeSection, but it must be checked at the end too,\n  // in case the code section was omitted.\n  ERROR_UNLESS(num_function_signatures_ == num_function_bodies_,\n               \"function signature count != function body count\");\n  // This is checked in ReadDataSection, but it must be checked at the end too,\n  // in case the data section was omitted.\n  ERROR_IF(num_data_segments_ == 0 && data_count_ != kInvalidIndex &&\n               data_count_ != 0,\n           \"Data section missing but DataCount non-zero\");\n  CALLBACK0(EndModule);\n\n  return Result::Ok;\n}\n\n}  // end anonymous namespace\n\nResult ReadBinary(const void* data,\n                  size_t size,\n                  BinaryReaderDelegate* delegate,\n                  const ReadBinaryOptions& options) {\n  BinaryReader reader(data, size, delegate, options);\n  return reader.ReadModule(\n      BinaryReader::ReadModuleOptions{options.stop_on_first_error});\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binary-writer-spec.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binary-writer-spec.h\"\n\n#include <cassert>\n#include <cinttypes>\n#include <string_view>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/binary-writer.h\"\n#include \"wabt/binary.h\"\n#include \"wabt/cast.h\"\n#include \"wabt/filenames.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/stream.h\"\n\nnamespace wabt {\n\nnamespace {\n\nclass BinaryWriterSpec {\n public:\n  BinaryWriterSpec(Stream* json_stream,\n                   WriteBinarySpecStreamFactory module_stream_factory,\n                   std::string_view source_filename,\n                   std::string_view module_filename_noext,\n                   const WriteBinaryOptions& options);\n\n  Result WriteScript(const Script& script);\n\n private:\n  std::string GetModuleFilename(const char* extension);\n  void WriteString(const char* s);\n  void WriteKey(const char* key);\n  void WriteSeparator();\n  void WriteEscapedString(std::string_view);\n  void WriteCommandType(const Command& command);\n  void WriteLocation(const Location& loc);\n  void WriteVar(const Var& var);\n  void WriteTypeObject(Type type);\n  void WriteF32(uint32_t, ExpectedNan);\n  void WriteF64(uint64_t, ExpectedNan);\n  void WriteRefBits(uintptr_t ref_bits);\n  void WriteConst(const Const& const_);\n  void WriteConstVector(const ConstVector& consts);\n  void WriteAction(const Action& action);\n  void WriteActionResultType(const Action& action);\n  void WriteModule(std::string_view filename, const Module& module);\n  void WriteScriptModule(std::string_view filename,\n                         const ScriptModule& script_module);\n  void WriteInvalidModule(const ScriptModule& module, std::string_view text);\n  void WriteCommands();\n\n  const Script* script_ = nullptr;\n  Stream* json_stream_ = nullptr;\n  WriteBinarySpecStreamFactory module_stream_factory_;\n  std::string source_filename_;\n  std::string module_filename_noext_;\n  const WriteBinaryOptions& options_;\n  Result result_ = Result::Ok;\n  size_t num_modules_ = 0;\n};\n\nBinaryWriterSpec::BinaryWriterSpec(\n    Stream* json_stream,\n    WriteBinarySpecStreamFactory module_stream_factory,\n    std::string_view source_filename,\n    std::string_view module_filename_noext,\n    const WriteBinaryOptions& options)\n    : json_stream_(json_stream),\n      module_stream_factory_(module_stream_factory),\n      source_filename_(source_filename),\n      module_filename_noext_(module_filename_noext),\n      options_(options) {}\n\nstd::string BinaryWriterSpec::GetModuleFilename(const char* extension) {\n  std::string result = module_filename_noext_;\n  result += '.';\n  result += std::to_string(num_modules_);\n  result += extension;\n  ConvertBackslashToSlash(&result);\n  return result;\n}\n\nvoid BinaryWriterSpec::WriteString(const char* s) {\n  json_stream_->Writef(\"\\\"%s\\\"\", s);\n}\n\nvoid BinaryWriterSpec::WriteKey(const char* key) {\n  json_stream_->Writef(\"\\\"%s\\\": \", key);\n}\n\nvoid BinaryWriterSpec::WriteSeparator() {\n  json_stream_->Writef(\", \");\n}\n\nvoid BinaryWriterSpec::WriteEscapedString(std::string_view s) {\n  json_stream_->WriteChar('\"');\n  for (size_t i = 0; i < s.length(); ++i) {\n    uint8_t c = s[i];\n    if (c < 0x20 || c == '\\\\' || c == '\"') {\n      json_stream_->Writef(\"\\\\u%04x\", c);\n    } else {\n      json_stream_->WriteChar(c);\n    }\n  }\n  json_stream_->WriteChar('\"');\n}\n\nvoid BinaryWriterSpec::WriteCommandType(const Command& command) {\n  static const char* s_command_names[] = {\n      \"module\",\n      \"module\",\n      \"action\",\n      \"register\",\n      \"assert_malformed\",\n      \"assert_invalid\",\n      \"assert_unlinkable\",\n      \"assert_uninstantiable\",\n      \"assert_return\",\n      \"assert_trap\",\n      \"assert_exhaustion\",\n      \"assert_exception\",\n  };\n  WABT_STATIC_ASSERT(WABT_ARRAY_SIZE(s_command_names) == kCommandTypeCount);\n\n  WriteKey(\"type\");\n  assert(s_command_names[static_cast<size_t>(command.type)]);\n  WriteString(s_command_names[static_cast<size_t>(command.type)]);\n}\n\nvoid BinaryWriterSpec::WriteLocation(const Location& loc) {\n  WriteKey(\"line\");\n  json_stream_->Writef(\"%d\", loc.line);\n}\n\nvoid BinaryWriterSpec::WriteVar(const Var& var) {\n  if (var.is_index()) {\n    json_stream_->Writef(\"\\\"%\" PRIindex \"\\\"\", var.index());\n  } else {\n    WriteEscapedString(var.name());\n  }\n}\n\nvoid BinaryWriterSpec::WriteTypeObject(Type type) {\n  json_stream_->Writef(\"{\");\n  WriteKey(\"type\");\n  WriteString(type.GetName().c_str());\n  json_stream_->Writef(\"}\");\n}\n\nvoid BinaryWriterSpec::WriteF32(uint32_t f32_bits, ExpectedNan expected) {\n  switch (expected) {\n    case ExpectedNan::None:\n      json_stream_->Writef(\"\\\"%u\\\"\", f32_bits);\n      break;\n\n    case ExpectedNan::Arithmetic:\n      WriteString(\"nan:arithmetic\");\n      break;\n\n    case ExpectedNan::Canonical:\n      WriteString(\"nan:canonical\");\n      break;\n  }\n}\n\nvoid BinaryWriterSpec::WriteF64(uint64_t f64_bits, ExpectedNan expected) {\n  switch (expected) {\n    case ExpectedNan::None:\n      json_stream_->Writef(\"\\\"%\" PRIu64 \"\\\"\", f64_bits);\n      break;\n\n    case ExpectedNan::Arithmetic:\n      WriteString(\"nan:arithmetic\");\n      break;\n\n    case ExpectedNan::Canonical:\n      WriteString(\"nan:canonical\");\n      break;\n  }\n}\n\nvoid BinaryWriterSpec::WriteRefBits(uintptr_t ref_bits) {\n  if (ref_bits == Const::kRefNullBits) {\n    json_stream_->Writef(\"\\\"null\\\"\");\n  } else {\n    json_stream_->Writef(\"\\\"%\" PRIuPTR \"\\\"\", ref_bits);\n  }\n}\n\nvoid BinaryWriterSpec::WriteConst(const Const& const_) {\n  json_stream_->Writef(\"{\");\n  WriteKey(\"type\");\n\n  /* Always write the values as strings, even though they may be representable\n   * as JSON numbers. This way the formatting is consistent. */\n  switch (const_.type()) {\n    case Type::I32:\n      WriteString(\"i32\");\n      WriteSeparator();\n      WriteKey(\"value\");\n      json_stream_->Writef(\"\\\"%u\\\"\", const_.u32());\n      break;\n\n    case Type::I64:\n      WriteString(\"i64\");\n      WriteSeparator();\n      WriteKey(\"value\");\n      json_stream_->Writef(\"\\\"%\" PRIu64 \"\\\"\", const_.u64());\n      break;\n\n    case Type::F32:\n      WriteString(\"f32\");\n      WriteSeparator();\n      WriteKey(\"value\");\n      WriteF32(const_.f32_bits(), const_.expected_nan());\n      break;\n\n    case Type::F64:\n      WriteString(\"f64\");\n      WriteSeparator();\n      WriteKey(\"value\");\n      WriteF64(const_.f64_bits(), const_.expected_nan());\n      break;\n\n    case Type::FuncRef: {\n      WriteString(\"funcref\");\n      WriteSeparator();\n      WriteKey(\"value\");\n      WriteRefBits(const_.ref_bits());\n      break;\n    }\n\n    case Type::ExternRef: {\n      WriteString(\"externref\");\n      WriteSeparator();\n      WriteKey(\"value\");\n      WriteRefBits(const_.ref_bits());\n      break;\n    }\n\n    case Type::ExnRef: {\n      WriteString(\"exnref\");\n      WriteSeparator();\n      WriteKey(\"value\");\n      WriteRefBits(const_.ref_bits());\n      break;\n    }\n\n    case Type::V128: {\n      WriteString(\"v128\");\n      WriteSeparator();\n      WriteKey(\"lane_type\");\n      WriteString(const_.lane_type().GetName().c_str());\n      WriteSeparator();\n      WriteKey(\"value\");\n      json_stream_->Writef(\"[\");\n\n      for (int lane = 0; lane < const_.lane_count(); ++lane) {\n        switch (const_.lane_type()) {\n          case Type::I8:\n            json_stream_->Writef(\"\\\"%u\\\"\", const_.v128_lane<uint8_t>(lane));\n            break;\n\n          case Type::I16:\n            json_stream_->Writef(\"\\\"%u\\\"\", const_.v128_lane<uint16_t>(lane));\n            break;\n\n          case Type::I32:\n            json_stream_->Writef(\"\\\"%u\\\"\", const_.v128_lane<uint32_t>(lane));\n            break;\n\n          case Type::I64:\n            json_stream_->Writef(\"\\\"%\" PRIu64 \"\\\"\",\n                                 const_.v128_lane<uint64_t>(lane));\n            break;\n\n          case Type::F32:\n            WriteF32(const_.v128_lane<uint32_t>(lane),\n                     const_.expected_nan(lane));\n            break;\n\n          case Type::F64:\n            WriteF64(const_.v128_lane<uint64_t>(lane),\n                     const_.expected_nan(lane));\n            break;\n\n          default:\n            WABT_UNREACHABLE;\n        }\n\n        if (lane != const_.lane_count() - 1) {\n          WriteSeparator();\n        }\n      }\n\n      json_stream_->Writef(\"]\");\n\n      break;\n    }\n\n    default:\n      WABT_UNREACHABLE;\n  }\n\n  json_stream_->Writef(\"}\");\n}\n\nvoid BinaryWriterSpec::WriteConstVector(const ConstVector& consts) {\n  json_stream_->Writef(\"[\");\n  for (size_t i = 0; i < consts.size(); ++i) {\n    const Const& const_ = consts[i];\n    WriteConst(const_);\n    if (i != consts.size() - 1) {\n      WriteSeparator();\n    }\n  }\n  json_stream_->Writef(\"]\");\n}\n\nvoid BinaryWriterSpec::WriteAction(const Action& action) {\n  WriteKey(\"action\");\n  json_stream_->Writef(\"{\");\n  WriteKey(\"type\");\n  if (action.type() == ActionType::Invoke) {\n    WriteString(\"invoke\");\n  } else {\n    assert(action.type() == ActionType::Get);\n    WriteString(\"get\");\n  }\n  WriteSeparator();\n  if (action.module_var.is_name()) {\n    WriteKey(\"module\");\n    WriteVar(action.module_var);\n    WriteSeparator();\n  }\n  if (action.type() == ActionType::Invoke) {\n    WriteKey(\"field\");\n    WriteEscapedString(action.name);\n    WriteSeparator();\n    WriteKey(\"args\");\n    WriteConstVector(cast<InvokeAction>(&action)->args);\n  } else {\n    WriteKey(\"field\");\n    WriteEscapedString(action.name);\n  }\n  json_stream_->Writef(\"}\");\n}\n\nvoid BinaryWriterSpec::WriteActionResultType(const Action& action) {\n  const Module* module = script_->GetModule(action.module_var);\n  const Export* export_;\n  json_stream_->Writef(\"[\");\n  switch (action.type()) {\n    case ActionType::Invoke: {\n      export_ = module->GetExport(action.name);\n      assert(export_->kind == ExternalKind::Func);\n      const Func* func = module->GetFunc(export_->var);\n      Index num_results = func->GetNumResults();\n      for (Index i = 0; i < num_results; ++i)\n        WriteTypeObject(func->GetResultType(i));\n      break;\n    }\n\n    case ActionType::Get: {\n      export_ = module->GetExport(action.name);\n      assert(export_->kind == ExternalKind::Global);\n      const Global* global = module->GetGlobal(export_->var);\n      WriteTypeObject(global->type);\n      break;\n    }\n  }\n  json_stream_->Writef(\"]\");\n}\n\nvoid BinaryWriterSpec::WriteModule(std::string_view filename,\n                                   const Module& module) {\n  result_ |=\n      WriteBinaryModule(module_stream_factory_(filename), &module, options_);\n}\n\nvoid BinaryWriterSpec::WriteScriptModule(std::string_view filename,\n                                         const ScriptModule& script_module) {\n  switch (script_module.type()) {\n    case ScriptModuleType::Text:\n      WriteModule(filename, cast<TextScriptModule>(&script_module)->module);\n      break;\n\n    case ScriptModuleType::Binary:\n      module_stream_factory_(filename)->WriteData(\n          cast<BinaryScriptModule>(&script_module)->data, \"\");\n      break;\n\n    case ScriptModuleType::Quoted:\n      module_stream_factory_(filename)->WriteData(\n          cast<QuotedScriptModule>(&script_module)->data, \"\");\n      break;\n  }\n}\n\nvoid BinaryWriterSpec::WriteInvalidModule(const ScriptModule& module,\n                                          std::string_view text) {\n  const char* extension = \"\";\n  const char* module_type = \"\";\n  switch (module.type()) {\n    case ScriptModuleType::Text:\n      extension = kWasmExtension;\n      module_type = \"binary\";\n      break;\n\n    case ScriptModuleType::Binary:\n      extension = kWasmExtension;\n      module_type = \"binary\";\n      break;\n\n    case ScriptModuleType::Quoted:\n      extension = kWatExtension;\n      module_type = \"text\";\n      break;\n  }\n\n  WriteLocation(module.location());\n  WriteSeparator();\n  std::string filename = GetModuleFilename(extension);\n  WriteKey(\"filename\");\n  WriteEscapedString(GetBasename(filename));\n  WriteSeparator();\n  WriteKey(\"text\");\n  WriteEscapedString(text);\n  WriteSeparator();\n  WriteKey(\"module_type\");\n  WriteString(module_type);\n  WriteScriptModule(filename, module);\n}\n\nvoid BinaryWriterSpec::WriteCommands() {\n  json_stream_->Writef(\"{\\\"source_filename\\\": \");\n  WriteEscapedString(source_filename_);\n  json_stream_->Writef(\",\\n \\\"commands\\\": [\\n\");\n  Index last_module_index = kInvalidIndex;\n  for (size_t i = 0; i < script_->commands.size(); ++i) {\n    const Command* command = script_->commands[i].get();\n\n    if (i != 0) {\n      WriteSeparator();\n      json_stream_->Writef(\"\\n\");\n    }\n\n    json_stream_->Writef(\"  {\");\n    WriteCommandType(*command);\n    WriteSeparator();\n\n    switch (command->type) {\n      case CommandType::Module: {\n        const Module& module = cast<ModuleCommand>(command)->module;\n        std::string filename = GetModuleFilename(kWasmExtension);\n        WriteLocation(module.loc);\n        WriteSeparator();\n        if (!module.name.empty()) {\n          WriteKey(\"name\");\n          WriteEscapedString(module.name);\n          WriteSeparator();\n        }\n        WriteKey(\"filename\");\n        WriteEscapedString(GetBasename(filename));\n        WriteModule(filename, module);\n        num_modules_++;\n        last_module_index = i;\n        break;\n      }\n\n      case CommandType::ScriptModule: {\n        auto* script_module_command = cast<ScriptModuleCommand>(command);\n        const auto& module = script_module_command->module;\n        std::string filename = GetModuleFilename(kWasmExtension);\n        WriteLocation(module.loc);\n        WriteSeparator();\n        if (!module.name.empty()) {\n          WriteKey(\"name\");\n          WriteEscapedString(module.name);\n          WriteSeparator();\n        }\n        WriteKey(\"filename\");\n        WriteEscapedString(GetBasename(filename));\n        WriteScriptModule(filename, *script_module_command->script_module);\n        num_modules_++;\n        last_module_index = i;\n        break;\n      }\n\n      case CommandType::Action: {\n        const Action& action = *cast<ActionCommand>(command)->action;\n        WriteLocation(action.loc);\n        WriteSeparator();\n        WriteAction(action);\n        WriteSeparator();\n        WriteKey(\"expected\");\n        WriteActionResultType(action);\n        break;\n      }\n\n      case CommandType::Register: {\n        auto* register_command = cast<RegisterCommand>(command);\n        const Var& var = register_command->var;\n        WriteLocation(var.loc);\n        WriteSeparator();\n        if (var.is_name()) {\n          WriteKey(\"name\");\n          WriteVar(var);\n          WriteSeparator();\n        } else {\n          /* If we're not registering by name, then we should only be\n           * registering the last module. */\n          WABT_USE(last_module_index);\n          assert(var.index() == last_module_index);\n        }\n        WriteKey(\"as\");\n        WriteEscapedString(register_command->module_name);\n        break;\n      }\n\n      case CommandType::AssertMalformed: {\n        auto* assert_malformed_command = cast<AssertMalformedCommand>(command);\n        WriteInvalidModule(*assert_malformed_command->module,\n                           assert_malformed_command->text);\n        num_modules_++;\n        break;\n      }\n\n      case CommandType::AssertInvalid: {\n        auto* assert_invalid_command = cast<AssertInvalidCommand>(command);\n        WriteInvalidModule(*assert_invalid_command->module,\n                           assert_invalid_command->text);\n        num_modules_++;\n        break;\n      }\n\n      case CommandType::AssertUnlinkable: {\n        auto* assert_unlinkable_command =\n            cast<AssertUnlinkableCommand>(command);\n        WriteInvalidModule(*assert_unlinkable_command->module,\n                           assert_unlinkable_command->text);\n        num_modules_++;\n        break;\n      }\n\n      case CommandType::AssertUninstantiable: {\n        auto* assert_uninstantiable_command =\n            cast<AssertUninstantiableCommand>(command);\n        WriteInvalidModule(*assert_uninstantiable_command->module,\n                           assert_uninstantiable_command->text);\n        num_modules_++;\n        break;\n      }\n\n      case CommandType::AssertReturn: {\n        auto* assert_return_command = cast<AssertReturnCommand>(command);\n        WriteLocation(assert_return_command->action->loc);\n        WriteSeparator();\n        WriteAction(*assert_return_command->action);\n        WriteSeparator();\n        const Expectation* expectation = assert_return_command->expected.get();\n        switch (expectation->type()) {\n          case ExpectationType::Values:\n            WriteKey(\"expected\");\n            break;\n\n          case ExpectationType::Either:\n            WriteKey(\"either\");\n            break;\n        }\n        WriteConstVector(expectation->expected);\n        break;\n      }\n\n      case CommandType::AssertTrap: {\n        auto* assert_trap_command = cast<AssertTrapCommand>(command);\n        WriteLocation(assert_trap_command->action->loc);\n        WriteSeparator();\n        WriteAction(*assert_trap_command->action);\n        WriteSeparator();\n        WriteKey(\"text\");\n        WriteEscapedString(assert_trap_command->text);\n        WriteSeparator();\n        WriteKey(\"expected\");\n        WriteActionResultType(*assert_trap_command->action);\n        break;\n      }\n\n      case CommandType::AssertExhaustion: {\n        auto* assert_exhaustion_command =\n            cast<AssertExhaustionCommand>(command);\n        WriteLocation(assert_exhaustion_command->action->loc);\n        WriteSeparator();\n        WriteAction(*assert_exhaustion_command->action);\n        WriteSeparator();\n        WriteKey(\"text\");\n        WriteEscapedString(assert_exhaustion_command->text);\n        WriteSeparator();\n        WriteKey(\"expected\");\n        WriteActionResultType(*assert_exhaustion_command->action);\n        break;\n      }\n\n      case CommandType::AssertException: {\n        auto* assert_exception_command = cast<AssertExceptionCommand>(command);\n        WriteLocation(assert_exception_command->action->loc);\n        WriteSeparator();\n        WriteAction(*assert_exception_command->action);\n        WriteSeparator();\n        WriteKey(\"expected\");\n        WriteActionResultType(*assert_exception_command->action);\n        break;\n      }\n    }\n\n    json_stream_->Writef(\"}\");\n  }\n  json_stream_->Writef(\"]}\\n\");\n}\n\nResult BinaryWriterSpec::WriteScript(const Script& script) {\n  script_ = &script;\n  WriteCommands();\n  return result_;\n}\n\n}  // end anonymous namespace\n\nResult WriteBinarySpecScript(Stream* json_stream,\n                             WriteBinarySpecStreamFactory module_stream_factory,\n                             Script* script,\n                             std::string_view source_filename,\n                             std::string_view module_filename_noext,\n                             const WriteBinaryOptions& options) {\n  BinaryWriterSpec binary_writer_spec(json_stream, module_stream_factory,\n                                      source_filename, module_filename_noext,\n                                      options);\n  return binary_writer_spec.WriteScript(*script);\n}\n\nResult WriteBinarySpecScript(\n    Stream* json_stream,\n    Script* script,\n    std::string_view source_filename,\n    std::string_view module_filename_noext,\n    const WriteBinaryOptions& options,\n    std::vector<FilenameMemoryStreamPair>* out_module_streams,\n    Stream* log_stream) {\n  WriteBinarySpecStreamFactory module_stream_factory =\n      [&](std::string_view filename) {\n        out_module_streams->emplace_back(\n            filename, std::make_unique<MemoryStream>(log_stream));\n        return out_module_streams->back().stream.get();\n      };\n\n  BinaryWriterSpec binary_writer_spec(json_stream, module_stream_factory,\n                                      source_filename, module_filename_noext,\n                                      options);\n  return binary_writer_spec.WriteScript(*script);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binary-writer.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binary-writer.h\"\n\n#include <cassert>\n#include <cmath>\n#include <cstdarg>\n#include <cstdint>\n#include <cstdio>\n#include <set>\n#include <string_view>\n#include <vector>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/binary.h\"\n#include \"wabt/cast.h\"\n#include \"wabt/expr-visitor.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/leb128.h\"\n#include \"wabt/stream.h\"\n\n#define PRINT_HEADER_NO_INDEX -1\n#define MAX_U32_LEB128_BYTES 5\n\nnamespace wabt {\n\nvoid WriteStr(Stream* stream,\n              std::string_view s,\n              const char* desc,\n              PrintChars print_chars) {\n  WriteU32Leb128(stream, s.length(), \"string length\");\n  stream->WriteData(s.data(), s.length(), desc, print_chars);\n}\n\nvoid WriteOpcode(Stream* stream, Opcode opcode) {\n  if (opcode.HasPrefix()) {\n    stream->WriteU8(opcode.GetPrefix(), \"prefix\");\n    WriteU32Leb128(stream, opcode.GetCode(), opcode.GetName());\n  } else {\n    stream->WriteU8(opcode.GetCode(), opcode.GetName());\n  }\n}\n\nvoid WriteType(Stream* stream, Type type, const char* desc) {\n  if (type.IsNonTypedRef() && !type.IsNullableNonTypedRef()) {\n    WriteS32Leb128(stream, Type::Ref, \"type prefix\");\n  }\n  WriteS32Leb128(stream, type, desc ? desc : type.GetName().c_str());\n  if (type.IsReferenceWithIndex()) {\n    WriteU32Leb128(stream, type.GetReferenceIndex(),\n                   desc ? desc : type.GetName().c_str());\n  }\n}\n\nvoid WriteLimitsFlags(Stream* stream, uint32_t flags) {\n  WriteU32Leb128(stream, flags, \"limits: flags\");\n}\n\nuint32_t ComputeLimitsFlags(const Limits* limits) {\n  uint32_t flags = limits->has_max ? WABT_BINARY_LIMITS_HAS_MAX_FLAG : 0;\n  flags |= limits->is_shared ? WABT_BINARY_LIMITS_IS_SHARED_FLAG : 0;\n  flags |= limits->is_64 ? WABT_BINARY_LIMITS_IS_64_FLAG : 0;\n  return flags;\n}\n\nvoid WriteLimitsData(Stream* stream, const Limits* limits) {\n  if (limits->is_64) {\n    WriteU64Leb128(stream, limits->initial, \"limits: initial\");\n    if (limits->has_max) {\n      WriteU64Leb128(stream, limits->max, \"limits: max\");\n    }\n  } else {\n    WriteU32Leb128(stream, limits->initial, \"limits: initial\");\n    if (limits->has_max) {\n      WriteU32Leb128(stream, limits->max, \"limits: max\");\n    }\n  }\n}\n\nvoid WriteDebugName(Stream* stream, std::string_view name, const char* desc) {\n  std::string_view stripped_name = name;\n  if (!stripped_name.empty()) {\n    // Strip leading $ from name\n    assert(stripped_name.front() == '$');\n    stripped_name.remove_prefix(1);\n  }\n  WriteStr(stream, stripped_name, desc, PrintChars::Yes);\n}\n\nnamespace {\n\n/* TODO(binji): better leb size guess. Some sections we know will only be 1\n byte, but others we can be fairly certain will be larger. */\nconstexpr size_t LEB_SECTION_SIZE_GUESS = 1;\n\n#define ALLOC_FAILURE \\\n  fprintf(stderr, \"%s:%d: allocation failed\\n\", __FILE__, __LINE__)\n\nstruct RelocSection {\n  RelocSection(const char* name, Index index)\n      : name(name), section_index(index) {}\n\n  const char* name;\n  Index section_index;\n  std::vector<Reloc> relocations;\n};\n\nclass Symbol {\n public:\n  struct Function {\n    static const SymbolType type = SymbolType::Function;\n    Index index;\n  };\n  struct Data {\n    static const SymbolType type = SymbolType::Data;\n    Index index;\n    Offset offset;\n    Address size;\n  };\n  struct Global {\n    static const SymbolType type = SymbolType::Global;\n    Index index;\n  };\n  struct Section {\n    static const SymbolType type = SymbolType::Section;\n    Index section;\n  };\n  struct Tag {\n    static const SymbolType type = SymbolType::Tag;\n    Index index;\n  };\n  struct Table {\n    static const SymbolType type = SymbolType::Table;\n    Index index;\n  };\n\n private:\n  SymbolType type_;\n  std::string_view name_;\n  uint8_t flags_;\n  union {\n    Function function_;\n    Data data_;\n    Global global_;\n    Section section_;\n    Tag tag_;\n    Table table_;\n  };\n\n public:\n  Symbol(const std::string_view& name, uint8_t flags, const Function& f)\n      : type_(Function::type), name_(name), flags_(flags), function_(f) {}\n  Symbol(const std::string_view& name, uint8_t flags, const Data& d)\n      : type_(Data::type), name_(name), flags_(flags), data_(d) {}\n  Symbol(const std::string_view& name, uint8_t flags, const Global& g)\n      : type_(Global::type), name_(name), flags_(flags), global_(g) {}\n  Symbol(const std::string_view& name, uint8_t flags, const Section& s)\n      : type_(Section::type), name_(name), flags_(flags), section_(s) {}\n  Symbol(const std::string_view& name, uint8_t flags, const Tag& e)\n      : type_(Tag::type), name_(name), flags_(flags), tag_(e) {}\n  Symbol(const std::string_view& name, uint8_t flags, const Table& t)\n      : type_(Table::type), name_(name), flags_(flags), table_(t) {}\n\n  SymbolType type() const { return type_; }\n  const std::string_view& name() const { return name_; }\n  uint8_t flags() const { return flags_; }\n\n  SymbolVisibility visibility() const {\n    return static_cast<SymbolVisibility>(flags() & WABT_SYMBOL_MASK_VISIBILITY);\n  }\n  SymbolBinding binding() const {\n    return static_cast<SymbolBinding>(flags() & WABT_SYMBOL_MASK_BINDING);\n  }\n  bool undefined() const { return flags() & WABT_SYMBOL_FLAG_UNDEFINED; }\n  bool defined() const { return !undefined(); }\n  bool exported() const { return flags() & WABT_SYMBOL_FLAG_EXPORTED; }\n  bool explicit_name() const {\n    return flags() & WABT_SYMBOL_FLAG_EXPLICIT_NAME;\n  }\n  bool no_strip() const { return flags() & WABT_SYMBOL_FLAG_NO_STRIP; }\n\n  bool IsFunction() const { return type() == Function::type; }\n  bool IsData() const { return type() == Data::type; }\n  bool IsGlobal() const { return type() == Global::type; }\n  bool IsSection() const { return type() == Section::type; }\n  bool IsTag() const { return type() == Tag::type; }\n  bool IsTable() const { return type() == Table::type; }\n\n  const Function& AsFunction() const {\n    assert(IsFunction());\n    return function_;\n  }\n  const Data& AsData() const {\n    assert(IsData());\n    return data_;\n  }\n  const Global& AsGlobal() const {\n    assert(IsGlobal());\n    return global_;\n  }\n  const Section& AsSection() const {\n    assert(IsSection());\n    return section_;\n  }\n  const Tag& AsTag() const {\n    assert(IsTag());\n    return tag_;\n  }\n  const Table& AsTable() const {\n    assert(IsTable());\n    return table_;\n  }\n};\n\nclass SymbolTable {\n  WABT_DISALLOW_COPY_AND_ASSIGN(SymbolTable);\n\n  std::vector<Symbol> symbols_;\n\n  std::vector<Index> functions_;\n  std::vector<Index> tables_;\n  std::vector<Index> globals_;\n\n  std::set<std::string_view> seen_names_;\n\n  Result EnsureUnique(const std::string_view& name) {\n    if (seen_names_.count(name)) {\n      fprintf(stderr,\n              \"error: duplicate symbol when writing relocatable \"\n              \"binary: %s\\n\",\n              &name[0]);\n      return Result::Error;\n    }\n    seen_names_.insert(name);\n    return Result::Ok;\n  };\n\n  template <typename T>\n  Result AddSymbol(std::vector<Index>* map,\n                   std::string_view name,\n                   bool imported,\n                   bool exported,\n                   T&& sym) {\n    uint8_t flags = 0;\n    if (imported) {\n      flags |= WABT_SYMBOL_FLAG_UNDEFINED;\n      // Wabt currently has no way for a user to explicitly specify the name of\n      // an import, so never set the EXPLICIT_NAME flag, and ignore any display\n      // name fabricated by wabt.\n      name = std::string_view();\n    } else {\n      if (name.empty()) {\n        // Definitions without a name are local.\n        flags |= uint8_t(SymbolBinding::Local);\n        flags |= uint8_t(SymbolVisibility::Hidden);\n      } else {\n        // Otherwise, strip the dollar off the name; a definition $foo is\n        // available for linking as \"foo\".\n        assert(name[0] == '$');\n        name.remove_prefix(1);\n      }\n\n      if (exported) {\n        CHECK_RESULT(EnsureUnique(name));\n        flags |= uint8_t(SymbolVisibility::Hidden);\n        flags |= WABT_SYMBOL_FLAG_NO_STRIP;\n      }\n    }\n    if (exported) {\n      flags |= WABT_SYMBOL_FLAG_EXPORTED;\n    }\n\n    map->push_back(symbols_.size());\n    symbols_.emplace_back(name, flags, sym);\n    return Result::Ok;\n  };\n\n  Index SymbolIndex(const std::vector<Index>& table, Index index) const {\n    // For well-formed modules, an index into (e.g.) functions_ will always be\n    // within bounds; the out-of-bounds case here is just to allow --relocatable\n    // to write known-invalid modules.\n    return index < table.size() ? table[index] : kInvalidIndex;\n  }\n\n public:\n  SymbolTable() {}\n\n  Result Populate(const Module* module) {\n    std::set<Index> exported_funcs;\n    std::set<Index> exported_globals;\n    std::set<Index> exported_tags;\n    std::set<Index> exported_tables;\n\n    for (const Export* export_ : module->exports) {\n      switch (export_->kind) {\n        case ExternalKind::Func:\n          exported_funcs.insert(module->GetFuncIndex(export_->var));\n          break;\n        case ExternalKind::Table:\n          exported_tables.insert(module->GetTableIndex(export_->var));\n          break;\n        case ExternalKind::Memory:\n          break;\n        case ExternalKind::Global:\n          exported_globals.insert(module->GetGlobalIndex(export_->var));\n          break;\n        case ExternalKind::Tag:\n          exported_tags.insert(module->GetTagIndex(export_->var));\n          break;\n      }\n    }\n\n    // We currently only create symbol table entries for function, table, and\n    // global symbols.\n    for (size_t i = 0; i < module->funcs.size(); ++i) {\n      const Func* func = module->funcs[i];\n      bool imported = i < module->num_func_imports;\n      bool exported = exported_funcs.count(i);\n      CHECK_RESULT(AddSymbol(&functions_, func->name, imported, exported,\n                             Symbol::Function{Index(i)}));\n    }\n\n    for (size_t i = 0; i < module->tables.size(); ++i) {\n      const Table* table = module->tables[i];\n      bool imported = i < module->num_table_imports;\n      bool exported = exported_tables.count(i);\n      CHECK_RESULT(AddSymbol(&tables_, table->name, imported, exported,\n                             Symbol::Table{Index(i)}));\n    }\n\n    for (size_t i = 0; i < module->globals.size(); ++i) {\n      const Global* global = module->globals[i];\n      bool imported = i < module->num_global_imports;\n      bool exported = exported_globals.count(i);\n      CHECK_RESULT(AddSymbol(&globals_, global->name, imported, exported,\n                             Symbol::Global{Index(i)}));\n    }\n\n    return Result::Ok;\n  }\n\n  const std::vector<Symbol>& symbols() const { return symbols_; }\n  Index FunctionSymbolIndex(Index index) const {\n    return SymbolIndex(functions_, index);\n  }\n  Index TableSymbolIndex(Index index) const {\n    return SymbolIndex(tables_, index);\n  }\n  Index GlobalSymbolIndex(Index index) const {\n    return SymbolIndex(globals_, index);\n  }\n};\n\nstruct CodeMetadata {\n  Offset offset;\n  std::vector<uint8_t> data;\n  CodeMetadata(Offset offset, std::vector<uint8_t> data)\n      : offset(offset), data(std::move(data)) {}\n};\nstruct FuncCodeMetadata {\n  Index func_idx;\n  std::vector<CodeMetadata> entries;\n  FuncCodeMetadata(Index func_idx) : func_idx(func_idx) {}\n};\nstruct CodeMetadataSection {\n  std::vector<FuncCodeMetadata> entries;\n};\nusing CodeMetadataSections =\n    std::unordered_map<std::string_view, CodeMetadataSection>;\n\nclass BinaryWriter {\n  WABT_DISALLOW_COPY_AND_ASSIGN(BinaryWriter);\n\n public:\n  BinaryWriter(Stream*,\n               const WriteBinaryOptions& options,\n               const Module* module);\n\n  Result WriteModule();\n\n private:\n  void WriteHeader(const char* name, int index);\n  Offset WriteU32Leb128Space(Offset leb_size_guess, const char* desc);\n  Offset WriteFixupU32Leb128Size(Offset offset,\n                                 Offset leb_size_guess,\n                                 const char* desc);\n  void BeginKnownSection(BinarySection section_code);\n  void BeginCustomSection(const char* name);\n  void WriteSectionHeader(const char* desc, BinarySection section_code);\n  void EndSection();\n  void BeginSubsection(const char* name);\n  void EndSubsection();\n  Index GetLabelVarDepth(const Var* var);\n  Index GetTagVarDepth(const Var* var);\n  Index GetLocalIndex(const Func* func, const Var& var);\n  Index GetSymbolIndex(RelocType reloc_type, Index index);\n  void AddReloc(RelocType reloc_type, Index index);\n  void WriteBlockDecl(const BlockDeclaration& decl);\n  void WriteU32Leb128WithReloc(Index index,\n                               const char* desc,\n                               RelocType reloc_type);\n  void WriteS32Leb128WithReloc(int32_t value,\n                               const char* desc,\n                               RelocType reloc_type);\n  void WriteTableNumberWithReloc(Index table_number, const char* desc);\n  template <typename T>\n  void WriteLoadStoreExpr(const Func* func, const Expr* expr, const char* desc);\n  template <typename T>\n  void WriteSimdLoadStoreLaneExpr(const Func* func,\n                                  const Expr* expr,\n                                  const char* desc);\n  void WriteExpr(const Func* func, const Expr* expr);\n  void WriteExprList(const Func* func, const ExprList& exprs);\n  void WriteInitExpr(const ExprList& expr);\n  void WriteFuncLocals(const Func* func, const LocalTypes& local_types);\n  void WriteFunc(const Func* func);\n  void WriteTable(const Table* table);\n  void WriteMemory(const Memory* memory);\n  void WriteGlobalHeader(const Global* global);\n  void WriteTagType(const Tag* tag);\n  void WriteRelocSection(const RelocSection* reloc_section);\n  void WriteLinkingSection();\n  void WriteImport(const Import* import);\n  template <typename T>\n  void WriteNames(const std::vector<T*>& elems, NameSectionSubsection type);\n  void WriteCodeMetadataSections();\n\n  Stream* stream_;\n  const WriteBinaryOptions& options_;\n  const Module* module_;\n\n  SymbolTable symtab_;\n  std::vector<RelocSection> reloc_sections_;\n  RelocSection* current_reloc_section_ = nullptr;\n\n  Index section_count_ = 0;\n  size_t last_section_offset_ = 0;\n  size_t last_section_leb_size_guess_ = 0;\n  BinarySection last_section_type_ = BinarySection::Invalid;\n  size_t last_section_payload_offset_ = 0;\n\n  size_t last_subsection_offset_ = 0;\n  size_t last_subsection_leb_size_guess_ = 0;\n  size_t last_subsection_payload_offset_ = 0;\n\n  // Information about the data count section, so it can be removed if it is\n  // not needed, and relocs relative to the code section patched up.\n  size_t code_start_ = 0;\n  size_t data_count_start_ = 0;\n  size_t data_count_end_ = 0;\n  bool has_data_segment_instruction_ = false;\n\n  CodeMetadataSections code_metadata_sections_;\n  Offset cur_func_start_offset_;\n  Index cur_func_index_;\n};\n\nstatic uint8_t log2_u32(uint32_t x) {\n  uint8_t result = 0;\n  while (x > 1) {\n    x >>= 1;\n    result++;\n  }\n  return result;\n}\n\nBinaryWriter::BinaryWriter(Stream* stream,\n                           const WriteBinaryOptions& options,\n                           const Module* module)\n    : stream_(stream), options_(options), module_(module) {}\n\nvoid BinaryWriter::WriteHeader(const char* name, int index) {\n  if (stream_->has_log_stream()) {\n    if (index == PRINT_HEADER_NO_INDEX) {\n      stream_->log_stream().Writef(\"; %s\\n\", name);\n    } else {\n      stream_->log_stream().Writef(\"; %s %d\\n\", name, index);\n    }\n  }\n}\n\n/* returns offset of leb128 */\nOffset BinaryWriter::WriteU32Leb128Space(Offset leb_size_guess,\n                                         const char* desc) {\n  assert(leb_size_guess <= MAX_U32_LEB128_BYTES);\n  uint8_t data[MAX_U32_LEB128_BYTES] = {0};\n  Offset result = stream_->offset();\n  Offset bytes_to_write =\n      options_.canonicalize_lebs ? leb_size_guess : MAX_U32_LEB128_BYTES;\n  stream_->WriteData(data, bytes_to_write, desc);\n  return result;\n}\n\nOffset BinaryWriter::WriteFixupU32Leb128Size(Offset offset,\n                                             Offset leb_size_guess,\n                                             const char* desc) {\n  if (options_.canonicalize_lebs) {\n    Offset size = stream_->offset() - offset - leb_size_guess;\n    Offset leb_size = U32Leb128Length(size);\n    Offset delta = leb_size - leb_size_guess;\n    if (delta != 0) {\n      Offset src_offset = offset + leb_size_guess;\n      Offset dst_offset = offset + leb_size;\n      stream_->MoveData(dst_offset, src_offset, size);\n    }\n    WriteU32Leb128At(stream_, offset, size, desc);\n    stream_->AddOffset(delta);\n    return delta;\n  } else {\n    Offset size = stream_->offset() - offset - MAX_U32_LEB128_BYTES;\n    WriteFixedU32Leb128At(stream_, offset, size, desc);\n    return 0;\n  }\n}\n\nvoid BinaryWriter::WriteBlockDecl(const BlockDeclaration& decl) {\n  if (decl.sig.GetNumParams() == 0 && decl.sig.GetNumResults() <= 1) {\n    if (decl.sig.GetNumResults() == 0) {\n      WriteType(stream_, Type::Void);\n    } else if (decl.sig.GetNumResults() == 1) {\n      WriteType(stream_, decl.sig.GetResultType(0));\n    }\n    return;\n  }\n\n  Index index = decl.has_func_type ? module_->GetFuncTypeIndex(decl.type_var)\n                                   : module_->GetFuncTypeIndex(decl.sig);\n  assert(index != kInvalidIndex);\n  WriteS32Leb128WithReloc(index, \"block type function index\",\n                          RelocType::TypeIndexLEB);\n}\n\nvoid BinaryWriter::WriteSectionHeader(const char* desc,\n                                      BinarySection section_code) {\n  assert(last_section_leb_size_guess_ == 0);\n  WriteHeader(desc, PRINT_HEADER_NO_INDEX);\n  stream_->WriteU8Enum(section_code, \"section code\");\n  last_section_type_ = section_code;\n  last_section_leb_size_guess_ = LEB_SECTION_SIZE_GUESS;\n  last_section_offset_ =\n      WriteU32Leb128Space(LEB_SECTION_SIZE_GUESS, \"section size (guess)\");\n  last_section_payload_offset_ = stream_->offset();\n}\n\nvoid BinaryWriter::BeginKnownSection(BinarySection section_code) {\n  char desc[100];\n  wabt_snprintf(desc, sizeof(desc), \"section \\\"%s\\\" (%u)\",\n                GetSectionName(section_code),\n                static_cast<unsigned>(section_code));\n  WriteSectionHeader(desc, section_code);\n}\n\nvoid BinaryWriter::BeginCustomSection(const char* name) {\n  char desc[100];\n  wabt_snprintf(desc, sizeof(desc), \"section \\\"%s\\\"\", name);\n  WriteSectionHeader(desc, BinarySection::Custom);\n  WriteStr(stream_, name, \"custom section name\", PrintChars::Yes);\n}\n\nvoid BinaryWriter::EndSection() {\n  assert(last_section_leb_size_guess_ != 0);\n  WriteFixupU32Leb128Size(last_section_offset_, last_section_leb_size_guess_,\n                          \"FIXUP section size\");\n  last_section_leb_size_guess_ = 0;\n  section_count_++;\n}\n\nvoid BinaryWriter::BeginSubsection(const char* name) {\n  assert(last_subsection_leb_size_guess_ == 0);\n  last_subsection_leb_size_guess_ = LEB_SECTION_SIZE_GUESS;\n  last_subsection_offset_ =\n      WriteU32Leb128Space(LEB_SECTION_SIZE_GUESS, \"subsection size (guess)\");\n  last_subsection_payload_offset_ = stream_->offset();\n}\n\nvoid BinaryWriter::EndSubsection() {\n  assert(last_subsection_leb_size_guess_ != 0);\n  WriteFixupU32Leb128Size(last_subsection_offset_,\n                          last_subsection_leb_size_guess_,\n                          \"FIXUP subsection size\");\n  last_subsection_leb_size_guess_ = 0;\n}\n\nIndex BinaryWriter::GetLabelVarDepth(const Var* var) {\n  return var->index();\n}\n\nIndex BinaryWriter::GetTagVarDepth(const Var* var) {\n  return var->index();\n}\n\nIndex BinaryWriter::GetSymbolIndex(RelocType reloc_type, Index index) {\n  switch (reloc_type) {\n    case RelocType::FuncIndexLEB:\n      return symtab_.FunctionSymbolIndex(index);\n    case RelocType::TableNumberLEB:\n      return symtab_.TableSymbolIndex(index);\n    case RelocType::GlobalIndexLEB:\n      return symtab_.GlobalSymbolIndex(index);\n    case RelocType::TypeIndexLEB:\n      // Type indexes don't create entries in the symbol table; instead their\n      // index is used directly.\n      return index;\n    default:\n      fprintf(stderr, \"warning: unsupported relocation type: %s\\n\",\n              GetRelocTypeName(reloc_type));\n      return kInvalidIndex;\n  }\n}\n\nvoid BinaryWriter::AddReloc(RelocType reloc_type, Index index) {\n  // Add a new reloc section if needed\n  if (!current_reloc_section_ ||\n      current_reloc_section_->section_index != section_count_) {\n    reloc_sections_.emplace_back(GetSectionName(last_section_type_),\n                                 section_count_);\n    current_reloc_section_ = &reloc_sections_.back();\n  }\n\n  // Add a new relocation to the curent reloc section\n  size_t offset = stream_->offset() - last_section_payload_offset_;\n  Index symbol_index = GetSymbolIndex(reloc_type, index);\n  if (symbol_index == kInvalidIndex) {\n    // The file is invalid, for example a reference to function 42 where only 10\n    // functions are defined.  The user must have already passed --no-check, so\n    // no extra warning here is needed.\n    return;\n  }\n  current_reloc_section_->relocations.emplace_back(reloc_type, offset,\n                                                   symbol_index);\n}\n\nvoid BinaryWriter::WriteU32Leb128WithReloc(Index index,\n                                           const char* desc,\n                                           RelocType reloc_type) {\n  if (options_.relocatable) {\n    AddReloc(reloc_type, index);\n    WriteFixedU32Leb128(stream_, index, desc);\n  } else {\n    WriteU32Leb128(stream_, index, desc);\n  }\n}\n\nvoid BinaryWriter::WriteS32Leb128WithReloc(int32_t value,\n                                           const char* desc,\n                                           RelocType reloc_type) {\n  if (options_.relocatable) {\n    AddReloc(reloc_type, value);\n    WriteFixedS32Leb128(stream_, value, desc);\n  } else {\n    WriteS32Leb128(stream_, value, desc);\n  }\n}\n\nvoid BinaryWriter::WriteTableNumberWithReloc(Index value, const char* desc) {\n  // Unless reference types are enabled, all references to tables refer to table\n  // 0, so no relocs need be emitted when making relocatable binaries.\n  if (options_.relocatable && options_.features.reference_types_enabled()) {\n    AddReloc(RelocType::TableNumberLEB, value);\n    WriteFixedS32Leb128(stream_, value, desc);\n  } else {\n    WriteS32Leb128(stream_, value, desc);\n  }\n}\n\nIndex BinaryWriter::GetLocalIndex(const Func* func, const Var& var) {\n  // func can be nullptr when using local.get/local.set/local.tee in an\n  // init_expr.\n  if (func) {\n    return func->GetLocalIndex(var);\n  } else if (var.is_index()) {\n    return var.index();\n  } else {\n    return kInvalidIndex;\n  }\n}\n\n// TODO(binji): Rename this, it is used for more than loads/stores now.\ntemplate <typename T>\nvoid BinaryWriter::WriteLoadStoreExpr(const Func* func,\n                                      const Expr* expr,\n                                      const char* desc) {\n  auto* typed_expr = cast<T>(expr);\n  WriteOpcode(stream_, typed_expr->opcode);\n  Address align = typed_expr->opcode.GetAlignment(typed_expr->align);\n  Index memidx = module_->GetMemoryIndex(typed_expr->memidx);\n  if (memidx != 0) {\n    stream_->WriteU8(log2_u32(align) | (1 << 6), \"alignment\");\n    WriteU32Leb128(stream_, memidx, \"memidx\");\n  } else {\n    stream_->WriteU8(log2_u32(align), \"alignment\");\n  }\n  WriteU64Leb128(stream_, typed_expr->offset, desc);\n}\n\ntemplate <typename T>\nvoid BinaryWriter::WriteSimdLoadStoreLaneExpr(const Func* func,\n                                              const Expr* expr,\n                                              const char* desc) {\n  WriteLoadStoreExpr<T>(func, expr, desc);\n  auto* typed_expr = cast<T>(expr);\n  stream_->WriteU8(static_cast<uint8_t>(typed_expr->val), \"Simd Lane literal\");\n}\n\nvoid BinaryWriter::WriteExpr(const Func* func, const Expr* expr) {\n  switch (expr->type()) {\n    case ExprType::AtomicLoad:\n      WriteLoadStoreExpr<AtomicLoadExpr>(func, expr, \"memory offset\");\n      break;\n    case ExprType::AtomicRmw:\n      WriteLoadStoreExpr<AtomicRmwExpr>(func, expr, \"memory offset\");\n      break;\n    case ExprType::AtomicRmwCmpxchg:\n      WriteLoadStoreExpr<AtomicRmwCmpxchgExpr>(func, expr, \"memory offset\");\n      break;\n    case ExprType::AtomicStore:\n      WriteLoadStoreExpr<AtomicStoreExpr>(func, expr, \"memory offset\");\n      break;\n    case ExprType::AtomicWait:\n      WriteLoadStoreExpr<AtomicWaitExpr>(func, expr, \"memory offset\");\n      break;\n    case ExprType::AtomicFence: {\n      auto* fence_expr = cast<AtomicFenceExpr>(expr);\n      WriteOpcode(stream_, Opcode::AtomicFence);\n      WriteU32Leb128(stream_, fence_expr->consistency_model,\n                     \"consistency model\");\n      break;\n    }\n    case ExprType::AtomicNotify:\n      WriteLoadStoreExpr<AtomicNotifyExpr>(func, expr, \"memory offset\");\n      break;\n    case ExprType::Unary:\n      WriteOpcode(stream_, cast<UnaryExpr>(expr)->opcode);\n      break;\n    case ExprType::Binary:\n      WriteOpcode(stream_, cast<BinaryExpr>(expr)->opcode);\n      break;\n    case ExprType::Ternary:\n      WriteOpcode(stream_, cast<TernaryExpr>(expr)->opcode);\n      break;\n    case ExprType::Quaternary:\n      WriteOpcode(stream_, cast<QuaternaryExpr>(expr)->opcode);\n      break;\n    case ExprType::Block:\n      WriteOpcode(stream_, Opcode::Block);\n      WriteBlockDecl(cast<BlockExpr>(expr)->block.decl);\n      WriteExprList(func, cast<BlockExpr>(expr)->block.exprs);\n      WriteOpcode(stream_, Opcode::End);\n      break;\n    case ExprType::Br:\n      WriteOpcode(stream_, Opcode::Br);\n      WriteU32Leb128(stream_, GetLabelVarDepth(&cast<BrExpr>(expr)->var),\n                     \"break depth\");\n      break;\n    case ExprType::BrIf:\n      WriteOpcode(stream_, Opcode::BrIf);\n      WriteU32Leb128(stream_, GetLabelVarDepth(&cast<BrIfExpr>(expr)->var),\n                     \"break depth\");\n      break;\n    case ExprType::BrOnNonNull:\n      WriteOpcode(stream_, Opcode::BrOnNonNull);\n      WriteU32Leb128(stream_,\n                     GetLabelVarDepth(&cast<BrOnNonNullExpr>(expr)->var),\n                     \"break depth\");\n      break;\n    case ExprType::BrOnNull:\n      WriteOpcode(stream_, Opcode::BrOnNull);\n      WriteU32Leb128(stream_, GetLabelVarDepth(&cast<BrOnNullExpr>(expr)->var),\n                     \"break depth\");\n      break;\n    case ExprType::BrTable: {\n      auto* br_table_expr = cast<BrTableExpr>(expr);\n      WriteOpcode(stream_, Opcode::BrTable);\n      WriteU32Leb128(stream_, br_table_expr->targets.size(), \"num targets\");\n      Index depth;\n      for (const Var& var : br_table_expr->targets) {\n        depth = GetLabelVarDepth(&var);\n        WriteU32Leb128(stream_, depth, \"break depth\");\n      }\n      depth = GetLabelVarDepth(&br_table_expr->default_target);\n      WriteU32Leb128(stream_, depth, \"break depth for default\");\n      break;\n    }\n    case ExprType::Call: {\n      Index index = module_->GetFuncIndex(cast<CallExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::Call);\n      WriteU32Leb128WithReloc(index, \"function index\", RelocType::FuncIndexLEB);\n      break;\n    }\n    case ExprType::ReturnCall: {\n      Index index = module_->GetFuncIndex(cast<ReturnCallExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::ReturnCall);\n      WriteU32Leb128WithReloc(index, \"function index\", RelocType::FuncIndexLEB);\n      break;\n    }\n    case ExprType::CallIndirect: {\n      Index sig_index =\n          module_->GetFuncTypeIndex(cast<CallIndirectExpr>(expr)->decl);\n      Index table_index =\n          module_->GetTableIndex(cast<CallIndirectExpr>(expr)->table);\n      WriteOpcode(stream_, Opcode::CallIndirect);\n      WriteU32Leb128WithReloc(sig_index, \"signature index\",\n                              RelocType::TypeIndexLEB);\n      WriteTableNumberWithReloc(table_index, \"table index\");\n      break;\n    }\n    case ExprType::ReturnCallIndirect: {\n      Index sig_index =\n          module_->GetFuncTypeIndex(cast<ReturnCallIndirectExpr>(expr)->decl);\n      Index table_index =\n          module_->GetTableIndex(cast<ReturnCallIndirectExpr>(expr)->table);\n      WriteOpcode(stream_, Opcode::ReturnCallIndirect);\n      WriteU32Leb128WithReloc(sig_index, \"signature index\",\n                              RelocType::TypeIndexLEB);\n      WriteTableNumberWithReloc(table_index, \"table index\");\n      break;\n    }\n    case ExprType::CallRef: {\n      WriteOpcode(stream_, Opcode::CallRef);\n      assert(cast<CallRefExpr>(expr)->sig_type.opt_type() == Type::RefNull);\n      Index sig_index = cast<CallRefExpr>(expr)->sig_type.index();\n      WriteU32Leb128WithReloc(sig_index, \"signature index\",\n                              RelocType::TypeIndexLEB);\n      break;\n    }\n    case ExprType::ReturnCallRef: {\n      WriteOpcode(stream_, Opcode::ReturnCallRef);\n      assert(cast<ReturnCallRefExpr>(expr)->sig_type.opt_type() ==\n             Type::RefNull);\n      Index sig_index = cast<ReturnCallRefExpr>(expr)->sig_type.index();\n      WriteU32Leb128WithReloc(sig_index, \"signature index\",\n                              RelocType::TypeIndexLEB);\n      break;\n    }\n    case ExprType::Compare:\n      WriteOpcode(stream_, cast<CompareExpr>(expr)->opcode);\n      break;\n    case ExprType::Const: {\n      const Const& const_ = cast<ConstExpr>(expr)->const_;\n      switch (const_.type()) {\n        case Type::I32: {\n          WriteOpcode(stream_, Opcode::I32Const);\n          WriteS32Leb128(stream_, const_.u32(), \"i32 literal\");\n          break;\n        }\n        case Type::I64:\n          WriteOpcode(stream_, Opcode::I64Const);\n          WriteS64Leb128(stream_, const_.u64(), \"i64 literal\");\n          break;\n        case Type::F32:\n          WriteOpcode(stream_, Opcode::F32Const);\n          stream_->WriteU32(const_.f32_bits(), \"f32 literal\");\n          break;\n        case Type::F64:\n          WriteOpcode(stream_, Opcode::F64Const);\n          stream_->WriteU64(const_.f64_bits(), \"f64 literal\");\n          break;\n        case Type::V128:\n          WriteOpcode(stream_, Opcode::V128Const);\n          stream_->WriteU128(const_.vec128(), \"v128 literal\");\n          break;\n        default:\n          assert(0);\n      }\n      break;\n    }\n    case ExprType::Convert:\n      WriteOpcode(stream_, cast<ConvertExpr>(expr)->opcode);\n      break;\n    case ExprType::Drop:\n      WriteOpcode(stream_, Opcode::Drop);\n      break;\n    case ExprType::GlobalGet: {\n      Index index = module_->GetGlobalIndex(cast<GlobalGetExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::GlobalGet);\n      WriteU32Leb128WithReloc(index, \"global index\", RelocType::GlobalIndexLEB);\n      break;\n    }\n    case ExprType::GlobalSet: {\n      Index index = module_->GetGlobalIndex(cast<GlobalSetExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::GlobalSet);\n      WriteU32Leb128WithReloc(index, \"global index\", RelocType::GlobalIndexLEB);\n      break;\n    }\n    case ExprType::If: {\n      auto* if_expr = cast<IfExpr>(expr);\n      WriteOpcode(stream_, Opcode::If);\n      WriteBlockDecl(if_expr->true_.decl);\n      WriteExprList(func, if_expr->true_.exprs);\n      if (!if_expr->false_.empty()) {\n        WriteOpcode(stream_, Opcode::Else);\n        WriteExprList(func, if_expr->false_);\n      }\n      WriteOpcode(stream_, Opcode::End);\n      break;\n    }\n    case ExprType::Load:\n      WriteLoadStoreExpr<LoadExpr>(func, expr, \"load offset\");\n      break;\n    case ExprType::LocalGet: {\n      Index index = GetLocalIndex(func, cast<LocalGetExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::LocalGet);\n      WriteU32Leb128(stream_, index, \"local index\");\n      break;\n    }\n    case ExprType::LocalSet: {\n      Index index = GetLocalIndex(func, cast<LocalSetExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::LocalSet);\n      WriteU32Leb128(stream_, index, \"local index\");\n      break;\n    }\n    case ExprType::LocalTee: {\n      Index index = GetLocalIndex(func, cast<LocalTeeExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::LocalTee);\n      WriteU32Leb128(stream_, index, \"local index\");\n      break;\n    }\n    case ExprType::Loop:\n      WriteOpcode(stream_, Opcode::Loop);\n      WriteBlockDecl(cast<LoopExpr>(expr)->block.decl);\n      WriteExprList(func, cast<LoopExpr>(expr)->block.exprs);\n      WriteOpcode(stream_, Opcode::End);\n      break;\n    case ExprType::MemoryCopy: {\n      Index destmemidx =\n          module_->GetMemoryIndex(cast<MemoryCopyExpr>(expr)->destmemidx);\n      Index srcmemidx =\n          module_->GetMemoryIndex(cast<MemoryCopyExpr>(expr)->srcmemidx);\n      WriteOpcode(stream_, Opcode::MemoryCopy);\n      WriteU32Leb128(stream_, destmemidx, \"memory.copy destmemidx\");\n      WriteU32Leb128(stream_, srcmemidx, \"memory.copy srcmemidx\");\n      break;\n    }\n    case ExprType::DataDrop: {\n      Index index = module_->GetDataSegmentIndex(cast<DataDropExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::DataDrop);\n      WriteU32Leb128(stream_, index, \"data.drop segment\");\n      has_data_segment_instruction_ = true;\n      break;\n    }\n    case ExprType::MemoryFill: {\n      Index memidx =\n          module_->GetMemoryIndex(cast<MemoryFillExpr>(expr)->memidx);\n      WriteOpcode(stream_, Opcode::MemoryFill);\n      WriteU32Leb128(stream_, memidx, \"memory.fill memidx\");\n      break;\n    }\n    case ExprType::MemoryGrow: {\n      Index memidx =\n          module_->GetMemoryIndex(cast<MemoryGrowExpr>(expr)->memidx);\n      WriteOpcode(stream_, Opcode::MemoryGrow);\n      WriteU32Leb128(stream_, memidx, \"memory.grow memidx\");\n      break;\n    }\n    case ExprType::MemoryInit: {\n      Index index =\n          module_->GetDataSegmentIndex(cast<MemoryInitExpr>(expr)->var);\n      Index memidx =\n          module_->GetMemoryIndex(cast<MemoryInitExpr>(expr)->memidx);\n      WriteOpcode(stream_, Opcode::MemoryInit);\n      WriteU32Leb128(stream_, index, \"memory.init segment\");\n      WriteU32Leb128(stream_, memidx, \"memory.init memidx\");\n      has_data_segment_instruction_ = true;\n      break;\n    }\n    case ExprType::MemorySize: {\n      Index memidx =\n          module_->GetMemoryIndex(cast<MemorySizeExpr>(expr)->memidx);\n      WriteOpcode(stream_, Opcode::MemorySize);\n      WriteU32Leb128(stream_, memidx, \"memory.size memidx\");\n      break;\n    }\n    case ExprType::TableCopy: {\n      auto* copy_expr = cast<TableCopyExpr>(expr);\n      Index dst = module_->GetTableIndex(copy_expr->dst_table);\n      Index src = module_->GetTableIndex(copy_expr->src_table);\n      WriteOpcode(stream_, Opcode::TableCopy);\n      WriteTableNumberWithReloc(dst, \"table.copy dst_table\");\n      WriteTableNumberWithReloc(src, \"table.copy src_table\");\n      break;\n    }\n    case ExprType::ElemDrop: {\n      Index index = module_->GetElemSegmentIndex(cast<ElemDropExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::ElemDrop);\n      WriteU32Leb128(stream_, index, \"elem.drop segment\");\n      break;\n    }\n    case ExprType::TableInit: {\n      auto* init_expr = cast<TableInitExpr>(expr);\n      Index table_index = module_->GetTableIndex(init_expr->table_index);\n      Index segment_index =\n          module_->GetElemSegmentIndex(init_expr->segment_index);\n      WriteOpcode(stream_, Opcode::TableInit);\n      WriteU32Leb128(stream_, segment_index, \"table.init segment\");\n      WriteTableNumberWithReloc(table_index, \"table.init table\");\n      break;\n    }\n    case ExprType::TableGet: {\n      Index index = module_->GetTableIndex(cast<TableGetExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::TableGet);\n      WriteTableNumberWithReloc(index, \"table.get table index\");\n      break;\n    }\n    case ExprType::TableSet: {\n      Index index = module_->GetTableIndex(cast<TableSetExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::TableSet);\n      WriteTableNumberWithReloc(index, \"table.set table index\");\n      break;\n    }\n    case ExprType::TableGrow: {\n      Index index = module_->GetTableIndex(cast<TableGrowExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::TableGrow);\n      WriteTableNumberWithReloc(index, \"table.grow table index\");\n      break;\n    }\n    case ExprType::TableSize: {\n      Index index = module_->GetTableIndex(cast<TableSizeExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::TableSize);\n      WriteTableNumberWithReloc(index, \"table.size table index\");\n      break;\n    }\n    case ExprType::TableFill: {\n      Index index = module_->GetTableIndex(cast<TableFillExpr>(expr)->var);\n      WriteOpcode(stream_, Opcode::TableFill);\n      WriteTableNumberWithReloc(index, \"table.fill table index\");\n      break;\n    }\n    case ExprType::RefAsNonNull: {\n      WriteOpcode(stream_, Opcode::RefAsNonNull);\n      break;\n    }\n    case ExprType::RefFunc: {\n      WriteOpcode(stream_, Opcode::RefFunc);\n      Index index = module_->GetFuncIndex(cast<RefFuncExpr>(expr)->var);\n      WriteU32Leb128WithReloc(index, \"function index\", RelocType::FuncIndexLEB);\n      break;\n    }\n    case ExprType::RefNull: {\n      WriteOpcode(stream_, Opcode::RefNull);\n      const RefNullExpr* ref_null_expr = cast<RefNullExpr>(expr);\n      Type::Enum type = ref_null_expr->type.opt_type();\n\n      if (type != Type::RefNull) {\n        WriteType(stream_, type, \"ref.null type\");\n        break;\n      }\n\n      Index index = module_->GetFuncTypeIndex(ref_null_expr->type);\n      WriteU32Leb128WithReloc(index, \"heap type index\",\n                              RelocType::FuncIndexLEB);\n      break;\n    }\n    case ExprType::RefIsNull:\n      WriteOpcode(stream_, Opcode::RefIsNull);\n      break;\n    case ExprType::Nop:\n      WriteOpcode(stream_, Opcode::Nop);\n      break;\n    case ExprType::Rethrow:\n      WriteOpcode(stream_, Opcode::Rethrow);\n      WriteU32Leb128(stream_, GetLabelVarDepth(&cast<RethrowExpr>(expr)->var),\n                     \"rethrow depth\");\n      break;\n    case ExprType::Return:\n      WriteOpcode(stream_, Opcode::Return);\n      break;\n    case ExprType::Select: {\n      auto* select_expr = cast<SelectExpr>(expr);\n      if (select_expr->result_type.empty()) {\n        WriteOpcode(stream_, Opcode::Select);\n      } else {\n        WriteOpcode(stream_, Opcode::SelectT);\n        WriteU32Leb128(stream_, select_expr->result_type.size(),\n                       \"num result types\");\n        for (Type t : select_expr->result_type) {\n          WriteType(stream_, t, \"result type\");\n        }\n      }\n      break;\n    }\n    case ExprType::Store:\n      WriteLoadStoreExpr<StoreExpr>(func, expr, \"store offset\");\n      break;\n    case ExprType::Throw:\n      WriteOpcode(stream_, Opcode::Throw);\n      WriteU32Leb128(stream_, GetTagVarDepth(&cast<ThrowExpr>(expr)->var),\n                     \"throw tag\");\n      break;\n    case ExprType::ThrowRef:\n      WriteOpcode(stream_, Opcode::ThrowRef);\n      break;\n    case ExprType::Try: {\n      auto* try_expr = cast<TryExpr>(expr);\n      WriteOpcode(stream_, Opcode::Try);\n      WriteBlockDecl(try_expr->block.decl);\n      WriteExprList(func, try_expr->block.exprs);\n      switch (try_expr->kind) {\n        case TryKind::Catch:\n          for (const Catch& catch_ : try_expr->catches) {\n            if (catch_.IsCatchAll()) {\n              WriteOpcode(stream_, Opcode::CatchAll);\n            } else {\n              WriteOpcode(stream_, Opcode::Catch);\n              WriteU32Leb128(stream_, GetTagVarDepth(&catch_.var), \"catch tag\");\n            }\n            WriteExprList(func, catch_.exprs);\n          }\n          WriteOpcode(stream_, Opcode::End);\n          break;\n        case TryKind::Delegate:\n          WriteOpcode(stream_, Opcode::Delegate);\n          WriteU32Leb128(stream_, GetLabelVarDepth(&try_expr->delegate_target),\n                         \"delegate depth\");\n          break;\n        case TryKind::Plain:\n          WriteOpcode(stream_, Opcode::End);\n          break;\n      }\n      break;\n    }\n    case ExprType::TryTable: {\n      auto* try_table_expr = cast<TryTableExpr>(expr);\n      WriteOpcode(stream_, Opcode::TryTable);\n      WriteBlockDecl(try_table_expr->block.decl);\n      WriteU32Leb128(stream_, try_table_expr->catches.size(), \"num catches\");\n      for (const TableCatch& catch_ : try_table_expr->catches) {\n        uint8_t catch_type =\n            (catch_.IsCatchAll() ? 2 : 0) | (catch_.IsRef() ? 1 : 0);\n        stream_->WriteU8(catch_type, \"catch handler\");\n        if (!catch_.IsCatchAll()) {\n          Index tag = GetTagVarDepth(&catch_.tag);\n          WriteU32Leb128(stream_, tag, \"catch tag\");\n        }\n        Index depth = GetLabelVarDepth(&catch_.target);\n        WriteU32Leb128(stream_, depth, \"catch depth\");\n      }\n      WriteExprList(func, try_table_expr->block.exprs);\n      WriteOpcode(stream_, Opcode::End);\n      break;\n    }\n    case ExprType::SimdLaneOp: {\n      const Opcode opcode = cast<SimdLaneOpExpr>(expr)->opcode;\n      WriteOpcode(stream_, opcode);\n      stream_->WriteU8(static_cast<uint8_t>(cast<SimdLaneOpExpr>(expr)->val),\n                       \"Simd Lane literal\");\n      break;\n    }\n    case ExprType::SimdLoadLane: {\n      WriteSimdLoadStoreLaneExpr<SimdLoadLaneExpr>(func, expr, \"load offset\");\n      break;\n    }\n    case ExprType::SimdStoreLane: {\n      WriteSimdLoadStoreLaneExpr<SimdStoreLaneExpr>(func, expr, \"store offset\");\n      break;\n    }\n    case ExprType::SimdShuffleOp: {\n      const Opcode opcode = cast<SimdShuffleOpExpr>(expr)->opcode;\n      WriteOpcode(stream_, opcode);\n      stream_->WriteU128(cast<SimdShuffleOpExpr>(expr)->val,\n                         \"Simd Lane[16] literal\");\n      break;\n    }\n    case ExprType::LoadSplat:\n      WriteLoadStoreExpr<LoadSplatExpr>(func, expr, \"load offset\");\n      break;\n    case ExprType::LoadZero:\n      WriteLoadStoreExpr<LoadZeroExpr>(func, expr, \"load offset\");\n      break;\n    case ExprType::Unreachable:\n      WriteOpcode(stream_, Opcode::Unreachable);\n      break;\n    case ExprType::CodeMetadata: {\n      auto* meta_expr = cast<CodeMetadataExpr>(expr);\n      auto& s = code_metadata_sections_[meta_expr->name];\n      if (s.entries.empty() || s.entries.back().func_idx != cur_func_index_) {\n        s.entries.emplace_back(cur_func_index_);\n      }\n      auto& a = s.entries.back();\n      Offset code_offset = stream_->offset() - cur_func_start_offset_;\n      a.entries.emplace_back(code_offset, meta_expr->data);\n      break;\n    }\n  }\n}\n\nvoid BinaryWriter::WriteExprList(const Func* func, const ExprList& exprs) {\n  for (const Expr& expr : exprs) {\n    WriteExpr(func, &expr);\n  }\n}\n\nvoid BinaryWriter::WriteInitExpr(const ExprList& expr) {\n  WriteExprList(nullptr, expr);\n  WriteOpcode(stream_, Opcode::End);\n}\n\nvoid BinaryWriter::WriteFuncLocals(const Func* func,\n                                   const LocalTypes& local_types) {\n  if (local_types.size() == 0) {\n    WriteU32Leb128(stream_, 0, \"local decl count\");\n    return;\n  }\n\n  Index local_decl_count = local_types.decls().size();\n  WriteU32Leb128(stream_, local_decl_count, \"local decl count\");\n  for (auto decl : local_types.decls()) {\n    WriteU32Leb128(stream_, decl.second, \"local type count\");\n    WriteType(stream_, decl.first);\n  }\n}\n\nvoid BinaryWriter::WriteFunc(const Func* func) {\n  WriteFuncLocals(func, func->local_types);\n  WriteExprList(func, func->exprs);\n  WriteOpcode(stream_, Opcode::End);\n}\n\nvoid BinaryWriter::WriteTable(const Table* table) {\n  if (!table->init_expr.empty()) {\n    // BinaryReader::ReadTableSection provides information about these values.\n    WriteType(stream_, Type::Void, \"initialized table prefix\");\n    stream_->WriteU8(0x0, \"initialized table prefix\");\n  }\n  WriteType(stream_, table->elem_type);\n  WriteLimitsFlags(stream_, ComputeLimitsFlags(&table->elem_limits));\n  WriteLimitsData(stream_, &table->elem_limits);\n\n  if (!table->init_expr.empty()) {\n    WriteInitExpr(table->init_expr);\n  }\n}\n\nvoid BinaryWriter::WriteMemory(const Memory* memory) {\n  uint32_t flags = ComputeLimitsFlags(&memory->page_limits);\n  const bool custom_page_size = memory->page_size != WABT_DEFAULT_PAGE_SIZE;\n  flags |= custom_page_size ? WABT_BINARY_LIMITS_HAS_CUSTOM_PAGE_SIZE_FLAG : 0;\n  WriteLimitsFlags(stream_, flags);\n  WriteLimitsData(stream_, &memory->page_limits);\n  if (custom_page_size) {\n    WriteU32Leb128(stream_, log2_u32(memory->page_size), \"memory page size\");\n  }\n}\n\nvoid BinaryWriter::WriteGlobalHeader(const Global* global) {\n  WriteType(stream_, global->type);\n  stream_->WriteU8(global->mutable_, \"global mutability\");\n}\n\nvoid BinaryWriter::WriteTagType(const Tag* tag) {\n  stream_->WriteU8(0, \"tag attribute\");\n  WriteU32Leb128(stream_, module_->GetFuncTypeIndex(tag->decl),\n                 \"tag signature index\");\n}\n\nvoid BinaryWriter::WriteRelocSection(const RelocSection* reloc_section) {\n  char section_name[128];\n  wabt_snprintf(section_name, sizeof(section_name), \"%s.%s\",\n                WABT_BINARY_SECTION_RELOC, reloc_section->name);\n  BeginCustomSection(section_name);\n  WriteU32Leb128(stream_, reloc_section->section_index, \"reloc section index\");\n  const std::vector<Reloc>& relocs = reloc_section->relocations;\n  WriteU32Leb128(stream_, relocs.size(), \"num relocs\");\n\n  for (const Reloc& reloc : relocs) {\n    WriteU32Leb128(stream_, reloc.type, \"reloc type\");\n    WriteU32Leb128(stream_, reloc.offset, \"reloc offset\");\n    WriteU32Leb128(stream_, reloc.index, \"reloc index\");\n    switch (reloc.type) {\n      case RelocType::MemoryAddressLEB:\n      case RelocType::MemoryAddressLEB64:\n      case RelocType::MemoryAddressSLEB:\n      case RelocType::MemoryAddressSLEB64:\n      case RelocType::MemoryAddressRelSLEB:\n      case RelocType::MemoryAddressRelSLEB64:\n      case RelocType::MemoryAddressI32:\n      case RelocType::MemoryAddressI64:\n      case RelocType::MemoryAddressLocRelI32:\n      case RelocType::FunctionOffsetI32:\n      case RelocType::FunctionOffsetI64:\n      case RelocType::SectionOffsetI32:\n      case RelocType::MemoryAddressTLSSLEB:\n      case RelocType::MemoryAddressTLSSLEB64:\n        WriteU32Leb128(stream_, reloc.addend, \"reloc addend\");\n        break;\n      case RelocType::FuncIndexLEB:\n      case RelocType::FuncIndexI32:\n      case RelocType::TableIndexSLEB:\n      case RelocType::TableIndexSLEB64:\n      case RelocType::TableIndexI32:\n      case RelocType::TableIndexI64:\n      case RelocType::TypeIndexLEB:\n      case RelocType::GlobalIndexLEB:\n      case RelocType::TagIndexLEB:\n      case RelocType::TableIndexRelSLEB:\n      case RelocType::TableIndexRelSLEB64:\n      case RelocType::TableNumberLEB:\n        break;\n      default:\n        fprintf(stderr, \"warning: unsupported relocation type: %s\\n\",\n                GetRelocTypeName(reloc.type));\n    }\n  }\n\n  EndSection();\n}\n\nvoid BinaryWriter::WriteLinkingSection() {\n  BeginCustomSection(WABT_BINARY_SECTION_LINKING);\n  WriteU32Leb128(stream_, 2, \"metadata version\");\n  const std::vector<Symbol>& symbols = symtab_.symbols();\n  if (symbols.size()) {\n    stream_->WriteU8Enum(LinkingEntryType::SymbolTable, \"symbol table\");\n    BeginSubsection(\"symbol table\");\n    WriteU32Leb128(stream_, symbols.size(), \"num symbols\");\n\n    for (const Symbol& sym : symbols) {\n      stream_->WriteU8Enum(sym.type(), \"symbol type\");\n      WriteU32Leb128(stream_, sym.flags(), \"symbol flags\");\n      switch (sym.type()) {\n        case SymbolType::Function:\n          WriteU32Leb128(stream_, sym.AsFunction().index, \"function index\");\n          if (sym.defined() || sym.explicit_name()) {\n            WriteStr(stream_, sym.name(), \"function name\", PrintChars::Yes);\n          }\n          break;\n        case SymbolType::Data:\n          WriteStr(stream_, sym.name(), \"data name\", PrintChars::Yes);\n          if (sym.defined()) {\n            WriteU32Leb128(stream_, sym.AsData().index, \"data index\");\n            WriteU32Leb128(stream_, sym.AsData().offset, \"data offset\");\n            WriteU32Leb128(stream_, sym.AsData().size, \"data size\");\n          }\n          break;\n        case SymbolType::Global:\n          WriteU32Leb128(stream_, sym.AsGlobal().index, \"global index\");\n          if (sym.defined() || sym.explicit_name()) {\n            WriteStr(stream_, sym.name(), \"global name\", PrintChars::Yes);\n          }\n          break;\n        case SymbolType::Section:\n          WriteU32Leb128(stream_, sym.AsSection().section, \"section index\");\n          break;\n        case SymbolType::Tag:\n          WriteU32Leb128(stream_, sym.AsTag().index, \"tag index\");\n          if (sym.defined() || sym.explicit_name()) {\n            WriteStr(stream_, sym.name(), \"tag name\", PrintChars::Yes);\n          }\n          break;\n        case SymbolType::Table:\n          WriteU32Leb128(stream_, sym.AsTable().index, \"table index\");\n          if (sym.defined() || sym.explicit_name()) {\n            WriteStr(stream_, sym.name(), \"table name\", PrintChars::Yes);\n          }\n          break;\n      }\n    }\n    EndSubsection();\n  }\n  EndSection();\n}\n\ntemplate <typename T>\nvoid BinaryWriter::WriteNames(const std::vector<T*>& elems,\n                              NameSectionSubsection type) {\n  size_t num_named_elems = 0;\n  for (const T* elem : elems) {\n    if (!elem->name.empty()) {\n      num_named_elems++;\n    }\n  }\n\n  if (!num_named_elems) {\n    return;\n  }\n\n  WriteU32Leb128(stream_, type, \"name subsection type\");\n  BeginSubsection(\"name subsection\");\n\n  char desc[100];\n  WriteU32Leb128(stream_, num_named_elems, \"num names\");\n  for (size_t i = 0; i < elems.size(); ++i) {\n    const T* elem = elems[i];\n    if (elem->name.empty()) {\n      continue;\n    }\n    WriteU32Leb128(stream_, i, \"elem index\");\n    wabt_snprintf(desc, sizeof(desc), \"elem name %\" PRIzd, i);\n    WriteDebugName(stream_, elem->name, desc);\n  }\n  EndSubsection();\n}\n\nvoid BinaryWriter::WriteImport(const Import* import) {\n  switch (import->kind()) {\n    case ExternalKind::Func:\n      WriteU32Leb128(\n          stream_,\n          module_->GetFuncTypeIndex(cast<FuncImport>(import)->func.decl),\n          \"import signature index\");\n      break;\n\n    case ExternalKind::Table:\n      WriteTable(&cast<TableImport>(import)->table);\n      break;\n\n    case ExternalKind::Memory:\n      WriteMemory(&cast<MemoryImport>(import)->memory);\n      break;\n\n    case ExternalKind::Global:\n      WriteGlobalHeader(&cast<GlobalImport>(import)->global);\n      break;\n\n    case ExternalKind::Tag:\n      WriteTagType(&cast<TagImport>(import)->tag);\n      break;\n  }\n}\n\nResult BinaryWriter::WriteModule() {\n  stream_->WriteU32(WABT_BINARY_MAGIC, \"WASM_BINARY_MAGIC\");\n  stream_->WriteU32(WABT_BINARY_VERSION, \"WASM_BINARY_VERSION\");\n\n  if (options_.relocatable) {\n    CHECK_RESULT(symtab_.Populate(module_));\n  }\n\n  if (module_->types.size()) {\n    BeginKnownSection(BinarySection::Type);\n    WriteU32Leb128(stream_, module_->types.size(), \"num types\");\n    for (size_t i = 0; i < module_->types.size(); ++i) {\n      const TypeEntry* type = module_->types[i];\n      switch (type->kind()) {\n        case TypeEntryKind::Func: {\n          const FuncType* func_type = cast<FuncType>(type);\n          const FuncSignature* sig = &func_type->sig;\n          WriteHeader(\"func type\", i);\n          WriteType(stream_, Type::Func);\n\n          Index num_params = sig->param_types.size();\n          Index num_results = sig->result_types.size();\n          WriteU32Leb128(stream_, num_params, \"num params\");\n          for (size_t j = 0; j < num_params; ++j) {\n            WriteType(stream_, sig->param_types[j]);\n          }\n\n          WriteU32Leb128(stream_, num_results, \"num results\");\n          for (size_t j = 0; j < num_results; ++j) {\n            WriteType(stream_, sig->result_types[j]);\n          }\n          break;\n        }\n\n        case TypeEntryKind::Struct: {\n          const StructType* struct_type = cast<StructType>(type);\n          WriteHeader(\"struct type\", i);\n          WriteType(stream_, Type::Struct);\n          Index num_fields = struct_type->fields.size();\n          WriteU32Leb128(stream_, num_fields, \"num fields\");\n          for (size_t j = 0; j < num_fields; ++j) {\n            const Field& field = struct_type->fields[j];\n            WriteType(stream_, field.type);\n            stream_->WriteU8(field.mutable_, \"field mutability\");\n          }\n          break;\n        }\n\n        case TypeEntryKind::Array: {\n          const ArrayType* array_type = cast<ArrayType>(type);\n          WriteHeader(\"array type\", i);\n          WriteType(stream_, Type::Array);\n          WriteType(stream_, array_type->field.type);\n          stream_->WriteU8(array_type->field.mutable_, \"field mutability\");\n          break;\n        }\n      }\n    }\n    EndSection();\n  }\n\n  if (module_->imports.size()) {\n    BeginKnownSection(BinarySection::Import);\n    WriteU32Leb128(stream_, module_->imports.size(), \"num imports\");\n\n    size_t i = 0;\n    while (i < module_->imports.size()) {\n      const Import* import = module_->imports[i];\n      WriteHeader(\"import header\", i);\n      WriteStr(stream_, import->module_name, \"import module name\",\n               PrintChars::Yes);\n      bool compact = false;\n      if (options_.features.compact_imports_enabled()) {\n        // Write compact imports when they are available.\n        // Currently we only support grouping by module name (0x7F mode)\n        // and not the module name + kind grouping (0x7E mode).\n        size_t group_size = 1;\n        size_t j = i + 1;\n        while (j < module_->imports.size() &&\n               import->module_name == module_->imports[j]->module_name) {\n          group_size++;\n          j++;\n        }\n        // Use compact imports iff we have a continuous sequence of more than\n        // one import with the same module name.\n        if (group_size > 1) {\n          compact = true;\n          WriteStr(stream_, \"\", \"empty field name\", PrintChars::Yes);\n          stream_->WriteU8(0x7F, \"compact import marker\");\n          WriteU32Leb128(stream_, group_size, \"import group size\");\n          while (group_size--) {\n            WriteHeader(\"compact import header\", i);\n            const Import* import = module_->imports[i];\n            WriteStr(stream_, import->field_name, \"import field name\",\n                     PrintChars::Yes);\n            stream_->WriteU8Enum(import->kind(), \"import kind\");\n            WriteImport(import);\n            i++;\n          }\n        }\n      }\n      if (!compact) {\n        WriteStr(stream_, import->field_name, \"import field name\",\n                 PrintChars::Yes);\n        stream_->WriteU8Enum(import->kind(), \"import kind\");\n        WriteImport(import);\n        i++;\n      }\n    }\n    EndSection();\n  }\n\n  assert(module_->funcs.size() >= module_->num_func_imports);\n  Index num_funcs = module_->funcs.size() - module_->num_func_imports;\n  if (num_funcs) {\n    BeginKnownSection(BinarySection::Function);\n    WriteU32Leb128(stream_, num_funcs, \"num functions\");\n\n    for (size_t i = 0; i < num_funcs; ++i) {\n      const Func* func = module_->funcs[i + module_->num_func_imports];\n      char desc[100];\n      wabt_snprintf(desc, sizeof(desc), \"function %\" PRIzd \" signature index\",\n                    i);\n      WriteU32Leb128(stream_, module_->GetFuncTypeIndex(func->decl), desc);\n    }\n    EndSection();\n  }\n\n  assert(module_->tables.size() >= module_->num_table_imports);\n  Index num_tables = module_->tables.size() - module_->num_table_imports;\n  if (num_tables) {\n    BeginKnownSection(BinarySection::Table);\n    WriteU32Leb128(stream_, num_tables, \"num tables\");\n    for (size_t i = 0; i < num_tables; ++i) {\n      const Table* table = module_->tables[i + module_->num_table_imports];\n      WriteHeader(\"table\", i);\n      WriteTable(table);\n    }\n    EndSection();\n  }\n\n  assert(module_->memories.size() >= module_->num_memory_imports);\n  Index num_memories = module_->memories.size() - module_->num_memory_imports;\n  if (num_memories) {\n    BeginKnownSection(BinarySection::Memory);\n    WriteU32Leb128(stream_, num_memories, \"num memories\");\n    for (size_t i = 0; i < num_memories; ++i) {\n      const Memory* memory = module_->memories[i + module_->num_memory_imports];\n      WriteHeader(\"memory\", i);\n      WriteMemory(memory);\n    }\n    EndSection();\n  }\n\n  assert(module_->tags.size() >= module_->num_tag_imports);\n  Index num_tags = module_->tags.size() - module_->num_tag_imports;\n  if (num_tags) {\n    BeginKnownSection(BinarySection::Tag);\n    WriteU32Leb128(stream_, num_tags, \"tag count\");\n    for (size_t i = 0; i < num_tags; ++i) {\n      WriteHeader(\"tag\", i);\n      const Tag* tag = module_->tags[i + module_->num_tag_imports];\n      WriteTagType(tag);\n    }\n    EndSection();\n  }\n\n  assert(module_->globals.size() >= module_->num_global_imports);\n  Index num_globals = module_->globals.size() - module_->num_global_imports;\n  if (num_globals) {\n    BeginKnownSection(BinarySection::Global);\n    WriteU32Leb128(stream_, num_globals, \"num globals\");\n\n    for (size_t i = 0; i < num_globals; ++i) {\n      const Global* global = module_->globals[i + module_->num_global_imports];\n      WriteGlobalHeader(global);\n      WriteInitExpr(global->init_expr);\n    }\n    EndSection();\n  }\n\n  if (module_->exports.size()) {\n    BeginKnownSection(BinarySection::Export);\n    WriteU32Leb128(stream_, module_->exports.size(), \"num exports\");\n\n    for (const Export* export_ : module_->exports) {\n      WriteStr(stream_, export_->name, \"export name\", PrintChars::Yes);\n      stream_->WriteU8Enum(export_->kind, \"export kind\");\n      switch (export_->kind) {\n        case ExternalKind::Func: {\n          Index index = module_->GetFuncIndex(export_->var);\n          WriteU32Leb128(stream_, index, \"export func index\");\n          break;\n        }\n        case ExternalKind::Table: {\n          Index index = module_->GetTableIndex(export_->var);\n          WriteU32Leb128(stream_, index, \"export table index\");\n          break;\n        }\n        case ExternalKind::Memory: {\n          Index index = module_->GetMemoryIndex(export_->var);\n          WriteU32Leb128(stream_, index, \"export memory index\");\n          break;\n        }\n        case ExternalKind::Global: {\n          Index index = module_->GetGlobalIndex(export_->var);\n          WriteU32Leb128(stream_, index, \"export global index\");\n          break;\n        }\n        case ExternalKind::Tag: {\n          Index index = module_->GetTagIndex(export_->var);\n          WriteU32Leb128(stream_, index, \"export tag index\");\n          break;\n        }\n      }\n    }\n    EndSection();\n  }\n\n  if (module_->starts.size()) {\n    Index start_func_index = module_->GetFuncIndex(*module_->starts[0]);\n    if (start_func_index != kInvalidIndex) {\n      BeginKnownSection(BinarySection::Start);\n      WriteU32Leb128(stream_, start_func_index, \"start func index\");\n      EndSection();\n    }\n  }\n\n  if (module_->elem_segments.size()) {\n    BeginKnownSection(BinarySection::Elem);\n    WriteU32Leb128(stream_, module_->elem_segments.size(), \"num elem segments\");\n    for (size_t i = 0; i < module_->elem_segments.size(); ++i) {\n      ElemSegment* segment = module_->elem_segments[i];\n      WriteHeader(\"elem segment header\", i);\n      // 1. flags\n      uint8_t flags = segment->GetFlags(\n          module_, options_.features.function_references_enabled());\n      stream_->WriteU8(flags, \"segment flags\");\n      // 2. optional target table\n      if (flags & SegExplicitIndex && segment->kind != SegmentKind::Declared) {\n        WriteU32Leb128(stream_, module_->GetTableIndex(segment->table_var),\n                       \"table index\");\n      }\n      // 3. optional target location within the table (active segments only)\n      if (!(flags & SegPassive)) {\n        WriteInitExpr(segment->offset);\n      }\n      // 4. type of item in the following list (omitted for \"legacy\" segments)\n      if (flags & (SegPassive | SegExplicitIndex)) {\n        if (flags & SegUseElemExprs) {\n          WriteType(stream_, segment->elem_type, \"elem expr list type\");\n        } else {\n          stream_->WriteU8Enum(ExternalKind::Func, \"elem list type\");\n        }\n      }\n      // 5. actual list of elements (with extern indexes or elem expr's)\n      // preceeded by length\n      WriteU32Leb128(stream_, segment->elem_exprs.size(), \"num elems\");\n      if (flags & SegUseElemExprs) {\n        for (const ExprList& elem_expr : segment->elem_exprs) {\n          WriteInitExpr(elem_expr);\n        }\n      } else {\n        for (const ExprList& elem_expr : segment->elem_exprs) {\n          assert(elem_expr.size() == 1);\n          const Expr* expr = &elem_expr.front();\n          assert(expr->type() == ExprType::RefFunc);\n          WriteU32Leb128(stream_,\n                         module_->GetFuncIndex(cast<RefFuncExpr>(expr)->var),\n                         \"elem function index\");\n        }\n      }\n    }\n    EndSection();\n  }\n\n  if (options_.features.bulk_memory_enabled() &&\n      module_->data_segments.size()) {\n    // Keep track of the data count section offset so it can be removed if\n    // it isn't needed.\n    data_count_start_ = stream_->offset();\n    BeginKnownSection(BinarySection::DataCount);\n    WriteU32Leb128(stream_, module_->data_segments.size(), \"data count\");\n    EndSection();\n    data_count_end_ = stream_->offset();\n  }\n\n  if (num_funcs) {\n    code_start_ = stream_->offset();\n    BeginKnownSection(BinarySection::Code);\n    WriteU32Leb128(stream_, num_funcs, \"num functions\");\n\n    for (size_t i = 0; i < num_funcs; ++i) {\n      cur_func_index_ = i + module_->num_func_imports;\n      WriteHeader(\"function body\", i);\n      const Func* func = module_->funcs[cur_func_index_];\n\n      /* TODO(binji): better guess of the size of the function body section */\n      const Offset leb_size_guess = 1;\n      Offset body_size_offset =\n          WriteU32Leb128Space(leb_size_guess, \"func body size (guess)\");\n      cur_func_start_offset_ = stream_->offset();\n      WriteFunc(func);\n      auto func_start_offset = body_size_offset - last_section_payload_offset_;\n      auto func_end_offset = stream_->offset() - last_section_payload_offset_;\n      auto delta = WriteFixupU32Leb128Size(body_size_offset, leb_size_guess,\n                                           \"FIXUP func body size\");\n      if (current_reloc_section_ && delta != 0) {\n        for (Reloc& reloc : current_reloc_section_->relocations) {\n          if (reloc.offset >= func_start_offset &&\n              reloc.offset <= func_end_offset) {\n            reloc.offset += delta;\n          }\n        }\n      }\n    }\n    EndSection();\n  }\n\n  // Remove the DataCount section if there are no instructions that require it.\n  if (options_.features.bulk_memory_enabled() &&\n      module_->data_segments.size() && !has_data_segment_instruction_) {\n    Offset size = stream_->offset() - data_count_end_;\n    if (size) {\n      // If the DataCount section was followed by anything, assert that it's\n      // only the Code section.  This limits the amount of fixing-up that we\n      // need to do.\n      assert(data_count_end_ == code_start_);\n      assert(last_section_type_ == BinarySection::Code);\n      stream_->MoveData(data_count_start_, data_count_end_, size);\n      code_start_ = data_count_start_;\n    }\n    stream_->Truncate(data_count_start_ + size);\n\n    --section_count_;\n\n    // We just effectively decremented the code section's index; adjust anything\n    // that might have captured it.\n    for (RelocSection& section : reloc_sections_) {\n      if (section.section_index == section_count_) {\n        assert(last_section_type_ == BinarySection::Code);\n        --section.section_index;\n      }\n    }\n  }\n\n  WriteCodeMetadataSections();\n\n  if (module_->data_segments.size()) {\n    BeginKnownSection(BinarySection::Data);\n    WriteU32Leb128(stream_, module_->data_segments.size(), \"num data segments\");\n    for (size_t i = 0; i < module_->data_segments.size(); ++i) {\n      const DataSegment* segment = module_->data_segments[i];\n      WriteHeader(\"data segment header\", i);\n      uint8_t flags = segment->GetFlags(module_);\n      stream_->WriteU8(flags, \"segment flags\");\n      if (!(flags & SegPassive)) {\n        if (options_.features.multi_memory_enabled() &&\n            (flags & SegExplicitIndex)) {\n          WriteU32Leb128(stream_, module_->GetMemoryIndex(segment->memory_var),\n                         \"memidx\");\n        } else {\n          assert(module_->GetMemoryIndex(segment->memory_var) == 0);\n        }\n        WriteInitExpr(segment->offset);\n      }\n      WriteU32Leb128(stream_, segment->data.size(), \"data segment size\");\n      WriteHeader(\"data segment data\", i);\n      stream_->WriteData(segment->data, \"data segment data\");\n    }\n    EndSection();\n  }\n\n  for (const Custom& custom : module_->customs) {\n    // These custom sections are already specially handled by BinaryWriter, so\n    // we don't want to double-write.\n    if ((custom.name == WABT_BINARY_SECTION_NAME &&\n         options_.write_debug_names) ||\n        (custom.name.rfind(WABT_BINARY_SECTION_RELOC) == 0 &&\n         options_.relocatable) ||\n        (custom.name == WABT_BINARY_SECTION_LINKING && options_.relocatable) ||\n        (custom.name.find(WABT_BINARY_SECTION_CODE_METADATA) == 0 &&\n         options_.features.code_metadata_enabled())) {\n      continue;\n    }\n    BeginCustomSection(custom.name.data());\n    stream_->WriteData(custom.data, \"custom data\");\n    EndSection();\n  }\n\n  if (options_.write_debug_names) {\n    std::vector<std::string> index_to_name;\n\n    char desc[100];\n    BeginCustomSection(WABT_BINARY_SECTION_NAME);\n\n    if (!module_->name.empty()) {\n      WriteU32Leb128(stream_, NameSectionSubsection::Module,\n                     \"module name type\");\n      BeginSubsection(\"module name subsection\");\n      WriteDebugName(stream_, module_->name, \"module name\");\n      EndSubsection();\n    }\n\n    WriteNames<Func>(module_->funcs, NameSectionSubsection::Function);\n\n    WriteU32Leb128(stream_, 2, \"local name type\");\n\n    BeginSubsection(\"local name subsection\");\n    WriteU32Leb128(stream_, module_->funcs.size(), \"num functions\");\n    for (size_t i = 0; i < module_->funcs.size(); ++i) {\n      const Func* func = module_->funcs[i];\n      Index num_params_and_locals = func->GetNumParamsAndLocals();\n      MakeTypeBindingReverseMapping(num_params_and_locals, func->bindings,\n                                    &index_to_name);\n      Index num_named = 0;\n      for (auto s : index_to_name) {\n        if (!s.empty()) {\n          num_named++;\n        }\n      }\n\n      WriteU32Leb128(stream_, i, \"function index\");\n      WriteU32Leb128(stream_, num_named, \"num locals\");\n\n      for (size_t j = 0; j < num_params_and_locals; ++j) {\n        const std::string& name = index_to_name[j];\n        if (!name.empty()) {\n          wabt_snprintf(desc, sizeof(desc), \"local name %\" PRIzd, j);\n          WriteU32Leb128(stream_, j, \"local index\");\n          WriteDebugName(stream_, name, desc);\n        }\n      }\n    }\n    EndSubsection();\n\n    WriteNames<TypeEntry>(module_->types, NameSectionSubsection::Type);\n    WriteNames<Table>(module_->tables, NameSectionSubsection::Table);\n    WriteNames<Memory>(module_->memories, NameSectionSubsection::Memory);\n    WriteNames<Global>(module_->globals, NameSectionSubsection::Global);\n    WriteNames<ElemSegment>(module_->elem_segments,\n                            NameSectionSubsection::ElemSegment);\n    WriteNames<DataSegment>(module_->data_segments,\n                            NameSectionSubsection::DataSegment);\n    WriteNames<Tag>(module_->tags, NameSectionSubsection::Tag);\n\n    EndSection();\n  }\n\n  if (options_.relocatable) {\n    WriteLinkingSection();\n    for (RelocSection& section : reloc_sections_) {\n      WriteRelocSection(&section);\n    }\n  }\n\n  return stream_->result();\n}\n\nvoid BinaryWriter::WriteCodeMetadataSections() {\n  if (code_metadata_sections_.empty())\n    return;\n\n  section_count_ -= 1;\n  // We have to increment the code section's index; adjust anything\n  // that might have captured it.\n  for (RelocSection& section : reloc_sections_) {\n    if (section.section_index == section_count_) {\n      assert(last_section_type_ == BinarySection::Code);\n      section.section_index += code_metadata_sections_.size();\n    }\n  }\n\n  MemoryStream tmp_stream;\n  Stream* main_stream = stream_;\n  stream_ = &tmp_stream;\n  for (auto& s : code_metadata_sections_) {\n    std::string name = \"metadata.code.\";\n    name.append(s.first);\n    auto& section = s.second;\n    BeginCustomSection(name.c_str());\n    WriteU32Leb128(stream_, section.entries.size(), \"function count\");\n    for (auto& f : section.entries) {\n      WriteU32Leb128WithReloc(f.func_idx, \"function index\",\n                              RelocType::FuncIndexLEB);\n      WriteU32Leb128(stream_, f.entries.size(), \"instances count\");\n      for (auto& a : f.entries) {\n        WriteU32Leb128(stream_, a.offset, \"code offset\");\n        WriteU32Leb128(stream_, a.data.size(), \"data length\");\n        stream_->WriteData(a.data.data(), a.data.size(), \"data\",\n                           PrintChars::Yes);\n      }\n    }\n    EndSection();\n  }\n  stream_ = main_stream;\n  auto buf = tmp_stream.ReleaseOutputBuffer();\n  stream_->MoveData(code_start_ + buf->data.size(), code_start_,\n                    stream_->offset() - code_start_);\n  stream_->WriteDataAt(code_start_, buf->data.data(), buf->data.size());\n  stream_->AddOffset(buf->data.size());\n  code_start_ += buf->data.size();\n  section_count_ += 1;\n  last_section_type_ = BinarySection::Code;\n}\n\n}  // end anonymous namespace\n\nResult WriteBinaryModule(Stream* stream,\n                         const Module* module,\n                         const WriteBinaryOptions& options) {\n  BinaryWriter binary_writer(stream, options, module);\n  return binary_writer.WriteModule();\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binary.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binary.h\"\n\nnamespace wabt {\n\nBinarySectionOrder GetSectionOrder(BinarySection sec) {\n  switch (sec) {\n#define V(Name, name, code) \\\n  case BinarySection::Name: \\\n    return BinarySectionOrder::Name;\n    WABT_FOREACH_BINARY_SECTION(V)\n#undef V\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nconst char* GetSectionName(BinarySection sec) {\n  switch (sec) {\n#define V(Name, name, code) \\\n  case BinarySection::Name: \\\n    return #Name;\n    WABT_FOREACH_BINARY_SECTION(V)\n#undef V\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\n// clang-format off\nconst char* NameSubsectionName[] = {\n    \"module\",\n    \"function\",\n    \"local\",\n    \"label\",\n    \"type\",\n    \"table\",\n    \"memory\",\n    \"global\",\n    \"elemseg\",\n    \"dataseg\",\n    \"field\",\n    \"tag\",\n};\n// clang-format on\n\nconst char* GetNameSectionSubsectionName(NameSectionSubsection subsec) {\n  static_assert(WABT_ENUM_COUNT(NameSectionSubsection) ==\n                    WABT_ARRAY_SIZE(NameSubsectionName),\n                \"Malformed ExprTypeName array\");\n  return NameSubsectionName[size_t(subsec)];\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/binding-hash.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/binding-hash.h\"\n\n#include <algorithm>\n#include <vector>\n\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nvoid BindingHash::FindDuplicates(DuplicateCallback callback) const {\n  if (size() > 0) {\n    ValueTypeVector duplicates;\n    CreateDuplicatesVector(&duplicates);\n    SortDuplicatesVectorByLocation(&duplicates);\n    CallCallbacks(duplicates, callback);\n  }\n}\n\nIndex BindingHash::FindIndex(const Var& var) const {\n  if (var.is_name()) {\n    return FindIndex(var.name());\n  }\n  return var.index();\n}\n\nvoid BindingHash::CreateDuplicatesVector(\n    ValueTypeVector* out_duplicates) const {\n  // This relies on the fact that in an unordered_multimap, all values with the\n  // same key are adjacent in iteration order.\n  auto first = begin();\n  bool is_first = true;\n  for (auto iter = std::next(first); iter != end(); ++iter) {\n    if (first->first == iter->first) {\n      if (is_first) {\n        out_duplicates->push_back(&*first);\n      }\n      out_duplicates->push_back(&*iter);\n      is_first = false;\n    } else {\n      is_first = true;\n      first = iter;\n    }\n  }\n}\n\nvoid BindingHash::SortDuplicatesVectorByLocation(\n    ValueTypeVector* duplicates) const {\n  std::sort(\n      duplicates->begin(), duplicates->end(),\n      [](const value_type* lhs, const value_type* rhs) -> bool {\n        return lhs->second.loc.line < rhs->second.loc.line ||\n               (lhs->second.loc.line == rhs->second.loc.line &&\n                lhs->second.loc.first_column < rhs->second.loc.first_column);\n      });\n}\n\nvoid BindingHash::CallCallbacks(const ValueTypeVector& duplicates,\n                                DuplicateCallback callback) const {\n  // Loop through all duplicates in order, and call callback with first\n  // occurrence.\n  for (auto iter = duplicates.begin(), end = duplicates.end(); iter != end;\n       ++iter) {\n    auto first = std::find_if(duplicates.begin(), duplicates.end(),\n                              [iter](const value_type* x) -> bool {\n                                return x->first == (*iter)->first;\n                              });\n    if (first == iter) {\n      continue;\n    }\n    assert(first != duplicates.end());\n    callback(**first, **iter);\n  }\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/c-writer.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/c-writer.h\"\n\n#include <cctype>\n#include <cinttypes>\n#include <iterator>\n#include <limits>\n#include <map>\n#include <set>\n#include <string_view>\n#include <vector>\n\n#include \"wabt/cast.h\"\n#include \"wabt/common.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/sha256.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/string-util.h\"\n\n#define INDENT_SIZE 2\n\n#define UNIMPLEMENTED(x) printf(\"unimplemented: %s\\n\", (x)), abort()\n\n// code to be inserted into the generated output\nextern const char* s_header_top;\nextern const char* s_header_bottom;\nextern const char* s_source_includes;\nextern const char* s_source_declarations;\nextern const char* s_simd_source_declarations;\nextern const char* s_atomicops_source_declarations;\n\nnamespace wabt {\n\nnamespace {\n\nstruct Label {\n  Label(LabelType label_type,\n        const std::string& name,\n        const TypeVector& sig,\n        size_t type_stack_size,\n        size_t try_catch_stack_size,\n        bool used = false)\n      : label_type(label_type),\n        name(name),\n        sig(sig),\n        type_stack_size(type_stack_size),\n        try_catch_stack_size(try_catch_stack_size),\n        used(used) {}\n\n  bool HasValue() const { return !sig.empty(); }\n\n  LabelType label_type;\n  const std::string& name;\n  const TypeVector& sig;\n  size_t type_stack_size;\n  size_t try_catch_stack_size;\n  bool used = false;\n};\n\nstruct LocalName {\n  explicit LocalName(const std::string& name) : name(name) {}\n  const std::string& name;\n};\n\nstruct ParamName : LocalName {\n  using LocalName::LocalName;\n  ParamName(const Var& var) : LocalName(var.name()) {}\n};\n\nstruct LabelName : LocalName {\n  using LocalName::LocalName;\n};\n\nstruct GlobalName {\n  GlobalName(ModuleFieldType type, const std::string& name)\n      : type(type), name(name) {}\n  ModuleFieldType type;\n  const std::string& name;\n};\n\nstruct TagSymbol : GlobalName {\n  explicit TagSymbol(const std::string& name)\n      : GlobalName(ModuleFieldType::Tag, name) {}\n};\n\nstruct ExternalRef : GlobalName {\n  using GlobalName::GlobalName;\n};\n\nstruct WrapperRef : GlobalName {\n  explicit WrapperRef(const std::string& name)\n      : GlobalName(ModuleFieldType::Func, name) {}\n};\n\nstruct TailCallRef : GlobalName {\n  explicit TailCallRef(const std::string& name)\n      : GlobalName(ModuleFieldType::Func, name) {}\n};\n\nstruct ExternalInstancePtr : GlobalName {\n  using GlobalName::GlobalName;\n};\n\nstruct ExternalInstanceRef : GlobalName {\n  using GlobalName::GlobalName;\n};\n\nstruct GotoLabel {\n  explicit GotoLabel(const Var& var) : var(var) {}\n  const Var& var;\n};\n\nstruct LabelDecl {\n  explicit LabelDecl(const std::string& name) : name(name) {}\n  std::string name;\n};\n\nstruct GlobalInstanceVar {\n  explicit GlobalInstanceVar(const Var& var) : var(var) {}\n  const Var& var;\n};\n\nstruct StackVar {\n  explicit StackVar(Index index, Type type = Type::Any)\n      : index(index), type(type) {}\n  Index index;\n  Type type;\n};\n\nstruct TypeEnum {\n  explicit TypeEnum(Type type) : type(type) {}\n  Type type;\n};\n\nstruct SignedType {\n  explicit SignedType(Type type) : type(type) {}\n  Type type;\n};\n\nstruct TryCatchLabel {\n  TryCatchLabel(const std::string& name, size_t try_catch_stack_size)\n      : name(name), try_catch_stack_size(try_catch_stack_size), used(false) {}\n  std::string name;\n  size_t try_catch_stack_size;\n  bool used;\n};\n\nstruct FuncTypeExpr {\n  const FuncType* func_type;\n  FuncTypeExpr(const FuncType* f) : func_type(f) {}\n};\n\nstruct Newline {};\nstruct OpenBrace {};\nstruct CloseBrace {};\n\nint GetShiftMask(Type type) {\n  // clang-format off\n  switch (type) {\n    case Type::I32: return 31;\n    case Type::I64: return 63;\n    default: WABT_UNREACHABLE; return 0;\n  }\n  // clang-format on\n}\n\n/*\n * This function is the default behavior for name_to_output_file_index_. For\n * single .c output, this function returns a vector filled with 0. For multiple\n * .c outputs, this function sorts all non-imported functions in the module by\n * their names, and then divides all non-imported functions into equal-sized\n * buckets (# of non-imported functions / # of .c outputs) based on the sorting.\n */\nstatic std::vector<size_t> default_name_to_output_file_index(\n    std::vector<Func*>::const_iterator func_begin,\n    std::vector<Func*>::const_iterator func_end,\n    size_t num_imports,\n    size_t num_streams) {\n  std::vector<size_t> result;\n  result.resize(std::distance(func_begin, func_end));\n  if (num_streams == 1) {\n    return result;\n  }\n\n  std::map<std::string, Index> sorted_functions;\n  size_t non_imported_funcs = result.size() - num_imports;\n  size_t bucket_size = non_imported_funcs / num_streams +\n                       (non_imported_funcs % num_streams ? 1 : 0);\n  Index func_index = 0;\n  for (auto func = func_begin; func != func_end; func++) {\n    sorted_functions.insert({(*func)->name, func_index});\n    ++func_index;\n  }\n  Index sorted_func_index = 0;\n  for (const auto& [func_name, index] : sorted_functions) {\n    bool is_import = index < num_imports;\n    if (!is_import) {\n      result.at(index) = sorted_func_index / bucket_size;\n      ++sorted_func_index;\n    }\n  }\n  return result;\n}\n\nclass CWriter {\n public:\n  CWriter(std::vector<Stream*>&& c_streams,\n          Stream* h_stream,\n          Stream* h_impl_stream,\n          const char* header_name,\n          const char* header_impl_name,\n          const WriteCOptions& options)\n      : options_(options),\n        c_streams_(std::move(c_streams)),\n        h_stream_(h_stream),\n        h_impl_stream_(h_impl_stream),\n        header_name_(header_name),\n        header_impl_name_(header_impl_name) {\n    module_prefix_ = MangleModuleName(options_.module_name);\n    if (c_streams_.size() != 1 && options.name_to_output_file_index) {\n      name_to_output_file_index_ = options.name_to_output_file_index;\n    } else {\n      name_to_output_file_index_ = default_name_to_output_file_index;\n    }\n  }\n\n  Result WriteModule(const Module&);\n\n private:\n  using SymbolSet = std::set<std::string>;\n  using SymbolMap = std::map<std::string, std::string>;\n  using StackTypePair = std::pair<Index, Type>;\n  using StackVarSymbolMap = std::map<StackTypePair, std::string>;\n\n  void WriteCHeader();\n  void WriteCSource();\n\n  size_t MarkTypeStack() const;\n  void ResetTypeStack(size_t mark);\n  Type StackType(Index) const;\n  void PushType(Type);\n  void PushTypes(const TypeVector&);\n  void DropTypes(size_t count);\n\n  void PushLabel(LabelType,\n                 const std::string& name,\n                 const FuncSignature&,\n                 bool used = false);\n  const Label* FindLabel(const Var& var, bool mark_used = true);\n  bool IsTopLabelUsed() const;\n  void PopLabel();\n\n  static constexpr bool AreInitializersAlwaysNull(Type);\n  static constexpr char MangleType(Type);\n  static constexpr char MangleField(ModuleFieldType);\n  static std::string MangleTypes(const TypeVector&);\n  static std::string Mangle(std::string_view name, bool double_underscores);\n  static std::string MangleName(std::string_view);\n  static std::string MangleModuleName(std::string_view);\n  static std::string ExportName(std::string_view module_name,\n                                std::string_view export_name);\n  std::string ExportName(std::string_view export_name) const;\n  static std::string TailCallExportName(std::string_view module_name,\n                                        std::string_view export_name);\n  std::string TailCallExportName(std::string_view export_name) const;\n  std::string ModuleInstanceTypeName() const;\n  static std::string ModuleInstanceTypeName(std::string_view module_name);\n  void ClaimName(SymbolSet& set,\n                 SymbolMap& map,\n                 char type_suffix,\n                 std::string_view wasm_name,\n                 const std::string& c_name);\n  std::string FindUniqueName(SymbolSet& set,\n                             std::string_view proposed_name) const;\n  std::string ClaimUniqueName(SymbolSet& set,\n                              SymbolMap& map,\n                              char type_suffix,\n                              std::string_view wasm_name,\n                              const std::string& proposed_c_name);\n  void DefineImportName(const Import* import,\n                        std::string_view module_name,\n                        std::string_view field_name);\n  void ReserveExportNames();\n  void ReserveExportName(std::string_view);\n  std::string DefineImportedModuleInstanceName(std::string_view name);\n  std::string DefineInstanceMemberName(ModuleFieldType, std::string_view);\n  std::string DefineGlobalScopeName(ModuleFieldType, std::string_view);\n  std::string DefineLocalScopeName(std::string_view name, bool is_label);\n  std::string DefineParamName(std::string_view);\n  std::string DefineLabelName(std::string_view);\n  std::string DefineStackVarName(Index, Type, std::string_view);\n\n  static void SerializeFuncType(const FuncType&, std::string&);\n\n  std::string GetGlobalName(ModuleFieldType, const std::string&) const;\n  std::string GetLocalName(const std::string&, bool is_label) const;\n  std::string GetTailCallRef(const std::string&) const;\n\n  void Indent(int size = INDENT_SIZE);\n  void Dedent(int size = INDENT_SIZE);\n  void NonIndented(std::function<void()> func);\n  void WriteIndent();\n  void WriteData(const char* src, size_t size);\n  void Writef(const char* format, ...);\n\n  template <typename T, typename U, typename... Args>\n  void Write(T&& t, U&& u, Args&&... args) {\n    Write(std::forward<T>(t));\n    Write(std::forward<U>(u));\n    Write(std::forward<Args>(args)...);\n  }\n\n  static const char* GetReferenceTypeName(const Type& type);\n  static const char* GetReferenceNullValue(const Type& type);\n  static const char* GetCTypeName(const Type& type);\n\n  const char* InternalSymbolScope() const;\n\n  enum class CWriterPhase {\n    Declarations,\n    Definitions,\n  };\n\n  void Write() {}\n  void Write(Newline);\n  void Write(OpenBrace);\n  void Write(CloseBrace);\n  void Write(uint64_t);\n  void Write(std::string_view);\n  void Write(const ParamName&);\n  void Write(const LabelName&);\n  void Write(const GlobalName&);\n  void Write(const TagSymbol&);\n  void Write(const ExternalRef&);\n  void Write(const WrapperRef&);\n  void Write(const TailCallRef&);\n  void Write(const ExternalInstancePtr&);\n  void Write(const ExternalInstanceRef&);\n  void Write(Type);\n  void Write(SignedType);\n  void Write(TypeEnum);\n  void Write(const GotoLabel&);\n  void Write(const LabelDecl&);\n  void Write(const GlobalInstanceVar&);\n  void Write(const StackVar&);\n  void Write(const TypeVector&);\n  void Write(const Const&);\n  void WriteInitExpr(const ExprList&);\n  void WriteInitExprTerminal(const Expr*);\n  std::string GenerateHeaderGuard() const;\n  void WriteSourceTop();\n  void WriteMultiCTop();\n  void WriteMultiCTopEmpty();\n  void DeclareStruct(const TypeVector&);\n  void WriteTailcalleeParamTypes();\n  void WriteMultivalueResultTypes();\n  void WriteTagTypes();\n  void WriteFuncTypeDecls();\n  void WriteFuncTypes();\n  void Write(const FuncTypeExpr&);\n  void WriteTagDecls();\n  void WriteTags();\n  void ComputeUniqueImports();\n  void BeginInstance();\n  void WriteImports();\n  void WriteTailCallWeakImports();\n  void WriteFuncDeclarations();\n  void WriteFuncDeclaration(const FuncDeclaration&, const std::string&);\n  void WriteTailCallFuncDeclaration(const std::string&);\n  void WriteImportFuncDeclaration(const FuncDeclaration&,\n                                  const std::string& module_name,\n                                  const std::string&);\n  void WriteFuncRefWrapper(const Func* func);\n  void WriteCallIndirectFuncDeclaration(const FuncDeclaration&,\n                                        const std::string&);\n  void ComputeSimdScope();\n  void WriteHeaderIncludes();\n  void WriteV128Decl();\n  void WriteModuleInstance();\n  void WriteGlobals();\n  void WriteGlobal(const Global&, const std::string&);\n  void WriteGlobalPtr(const Global&, const std::string&);\n  void WriteMemories();\n  void WriteMemory(const std::string&, const Memory& memory);\n  void WriteMemoryPtr(const std::string&, const Memory& memory);\n  void WriteTables();\n  void WriteTable(const std::string&, const wabt::Type&);\n  void WriteTablePtr(const std::string&, const Table&);\n  void WriteTableType(const wabt::Type&);\n  void WriteDataInstances();\n  void WriteElemInstances();\n  void WriteGlobalInitializers();\n  void WriteDataInitializerDecls();\n  void WriteDataInitializers();\n  void WriteElemInitializerDecls();\n  void WriteElemInitializers();\n  void WriteFuncRefWrappers();\n  void WriteElemTableInit(bool, const ElemSegment*, const Table*);\n  bool IsSingleUnsharedMemory();\n  void InstallSegueBase(Memory* memory, bool save_old_value);\n  void RestoreSegueBase();\n  void WriteExports(CWriterPhase);\n  void WriteTailCallExports(CWriterPhase);\n  void WriteInitDecl();\n  void WriteFreeDecl();\n  void WriteGetFuncTypeDecl();\n  void WriteInit();\n  void WriteFree();\n  void WriteGetFuncType();\n  void WriteInitInstanceImport();\n  void WriteImportProperties(CWriterPhase);\n  void WriteFuncs();\n  void BeginFunction(const Func&);\n  void FinishFunction(size_t);\n  void Write(const Func&);\n  void WriteTailCallee(const Func&);\n  void WriteParamsAndLocals();\n  void WriteParams(const std::vector<std::string>& index_to_name,\n                   bool setjmp_safe = false);\n  void WriteParamSymbols(const std::vector<std::string>& index_to_name);\n  void WriteParamTypes(const FuncDeclaration& decl);\n  void WriteLocals(const std::vector<std::string>& index_to_name);\n  void WriteStackVarDeclarations();\n  void Write(const ExprList&);\n  void WriteTailCallAsserts(const FuncSignature&);\n  void WriteTailCallStack();\n  void WriteUnwindTryCatchStack(const Label*);\n  void FinishReturnCall();\n  void Spill(const TypeVector&);\n  void Unspill(const TypeVector&);\n\n  template <typename Vars, typename TypeOf, typename ToDo>\n  void WriteVarsByType(const Vars&, const TypeOf&, const ToDo&, bool);\n\n  template <typename sources>\n  void Spill(const TypeVector&, const sources& src);\n  template <typename targets>\n  void Unspill(const TypeVector&, const targets& tgt);\n\n  enum class AssignOp {\n    Disallowed,\n    Allowed,\n  };\n\n  void WriteSimpleUnaryExpr(Opcode, const char* op);\n  void WriteInfixBinaryExpr(Opcode,\n                            const char* op,\n                            AssignOp = AssignOp::Allowed);\n  void WritePrefixBinaryExpr(Opcode, const char* op);\n  void WriteSignedBinaryExpr(Opcode, const char* op);\n  void Write(const BinaryExpr&);\n  void Write(const CompareExpr&);\n  void Write(const ConvertExpr&);\n  void Write(const LoadExpr&);\n  void Write(const StoreExpr&);\n  void Write(const UnaryExpr&);\n  void Write(const TernaryExpr&);\n  void Write(const SimdLaneOpExpr&);\n  void Write(const SimdLoadLaneExpr&);\n  void Write(const SimdStoreLaneExpr&);\n  void Write(const SimdShuffleOpExpr&);\n  void Write(const LoadSplatExpr&);\n  void Write(const LoadZeroExpr&);\n  void Write(const Block&);\n\n  void Write(const AtomicLoadExpr& expr);\n  void Write(const AtomicStoreExpr& expr);\n  void Write(const AtomicRmwExpr& expr);\n  void Write(const AtomicRmwCmpxchgExpr& expr);\n\n  size_t BeginTry(const Block& block);\n  void WriteTryCatch(const TryExpr& tryexpr);\n  void WriteTryDelegate(const TryExpr& tryexpr);\n  void Write(const TryTableExpr& try_table_expr);\n  void Write(const Catch& c);\n  void Write(const TableCatch& c);\n  void WriteThrow();\n\n  void PushTryCatch(const std::string& name);\n  void PopTryCatch();\n\n  void PushFuncSection(std::string_view include_condition = \"\");\n\n  bool IsImport(const std::string& name) const;\n\n  const WriteCOptions& options_;\n  const Module* module_ = nullptr;\n  const Func* func_ = nullptr;\n  Stream* stream_ = nullptr;\n  std::vector<Stream*> c_streams_;\n  Stream* h_stream_ = nullptr;\n  Stream* h_impl_stream_ = nullptr;\n  std::string header_name_;\n  std::string header_impl_name_;\n  Result result_ = Result::Ok;\n  int indent_ = 0;\n  bool should_write_indent_next_ = false;\n  int consecutive_newline_count_ = 0;\n\n  SymbolMap global_sym_map_;\n  SymbolMap local_sym_map_;\n  SymbolMap import_module_sym_map_;\n  StackVarSymbolMap stack_var_sym_map_;\n  SymbolSet global_syms_;\n  SymbolSet local_syms_;\n  TypeVector type_stack_;\n  std::vector<Label> label_stack_;\n  std::vector<TryCatchLabel> try_catch_stack_;\n  std::string module_prefix_;\n  SymbolSet typevector_structs_;\n\n  std::vector<const Import*> unique_imports_;\n  SymbolSet import_module_set_;       // modules that are imported from\n  SymbolSet import_func_module_set_;  // modules that funcs are imported from\n  SymbolMap import_func_module_map_;  // mapping between imported functions and\n                                      // their modules\n\n  std::vector<std::pair<std::string, MemoryStream>> func_sections_;\n  SymbolSet func_includes_;\n\n  std::vector<std::string> unique_func_type_names_;\n\n  std::function<std::vector<size_t>(std::vector<Func*>::const_iterator,\n                                    std::vector<Func*>::const_iterator,\n                                    size_t,\n                                    size_t)>\n      name_to_output_file_index_;\n\n  bool simd_used_in_header_;\n\n  bool in_tail_callee_;\n};\n\n// TODO: if WABT begins supporting debug names for labels,\n// will need to avoid conflict between a label named \"$Bfunc\" and\n// the implicit func label\nstatic constexpr char kImplicitFuncLabel[] = \"$Bfunc\";\n\n// These should be greater than any ModuleFieldType (used for MangleField).\nstatic constexpr char kParamSuffix =\n    'a' + static_cast<char>(ModuleFieldType::Tag) + 1;\nstatic constexpr char kLabelSuffix = kParamSuffix + 1;\n\nstatic constexpr char kGlobalSymbolPrefix[] = \"w2c_\";\nstatic constexpr char kWrapperSymbolPrefix[] = \"wrap_\";\nstatic constexpr char kLocalSymbolPrefix[] = \"var_\";\nstatic constexpr char kAdminSymbolPrefix[] = \"wasm2c_\";\nstatic constexpr char kTailCallSymbolPrefix[] = \"wasm_tailcall_\";\nstatic constexpr char kTailCallFallbackPrefix[] = \"wasm_fallback_\";\nstatic constexpr unsigned int kTailCallStackSize = 1024;\n\nsize_t CWriter::MarkTypeStack() const {\n  return type_stack_.size();\n}\n\nvoid CWriter::ResetTypeStack(size_t mark) {\n  assert(mark <= type_stack_.size());\n  type_stack_.erase(type_stack_.begin() + mark, type_stack_.end());\n}\n\nType CWriter::StackType(Index index) const {\n  assert(index < type_stack_.size());\n  return *(type_stack_.rbegin() + index);\n}\n\nvoid CWriter::PushType(Type type) {\n  type_stack_.push_back(type);\n}\n\nvoid CWriter::PushTypes(const TypeVector& types) {\n  type_stack_.insert(type_stack_.end(), types.begin(), types.end());\n}\n\nvoid CWriter::DropTypes(size_t count) {\n  assert(count <= type_stack_.size());\n  type_stack_.erase(type_stack_.end() - count, type_stack_.end());\n}\n\nvoid CWriter::PushLabel(LabelType label_type,\n                        const std::string& name,\n                        const FuncSignature& sig,\n                        bool used) {\n  if (label_type == LabelType::Loop)\n    label_stack_.emplace_back(label_type, name, sig.param_types,\n                              type_stack_.size(), try_catch_stack_.size(),\n                              used);\n  else\n    label_stack_.emplace_back(label_type, name, sig.result_types,\n                              type_stack_.size(), try_catch_stack_.size(),\n                              used);\n}\n\nconst Label* CWriter::FindLabel(const Var& var, bool mark_used) {\n  Label* label = nullptr;\n\n  if (var.is_index()) {\n    // We've generated names for all labels, so we should only be using an\n    // index when branching to the implicit function label, which can't be\n    // named.\n    assert(var.index() + 1 == label_stack_.size());\n    label = &label_stack_[0];\n  } else {\n    assert(var.is_name());\n    for (Index i = label_stack_.size(); i > 0; --i) {\n      label = &label_stack_[i - 1];\n      if (label->name == var.name())\n        break;\n    }\n  }\n\n  assert(label);\n  if (mark_used) {\n    label->used = true;\n  }\n  return label;\n}\n\nbool CWriter::IsTopLabelUsed() const {\n  assert(!label_stack_.empty());\n  return label_stack_.back().used;\n}\n\nvoid CWriter::PopLabel() {\n  label_stack_.pop_back();\n}\n\n// static\nconstexpr bool CWriter::AreInitializersAlwaysNull(Type type) {\n  // clang-format off\n  switch (type) {\n    case Type::FuncRef: return false;\n    case Type::ExternRef: return true;\n    case Type::ExnRef: return true;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n}\n\n// static\nconstexpr char CWriter::MangleType(Type type) {\n  // clang-format off\n  switch (type) {\n    case Type::I32: return 'i';\n    case Type::I64: return 'j';\n    case Type::F32: return 'f';\n    case Type::F64: return 'd';\n    case Type::V128: return 'o';\n    case Type::FuncRef: return 'r';\n    case Type::ExternRef: return 'e';\n    case Type::ExnRef: return 'x';\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n}\n\n// static\nconstexpr char CWriter::MangleField(ModuleFieldType type) {\n  assert(static_cast<std::underlying_type<ModuleFieldType>::type>(type) <\n         std::numeric_limits<char>::max());\n  return 'a' + static_cast<char>(type);\n}\n\n// remove risky characters for pasting into a C-style comment\nstatic std::string SanitizeForComment(std::string_view str) {\n  std::string result;\n\n  for (const uint8_t ch : str) {\n    // escape control chars, DEL, >7-bit chars, trigraphs, and end of comment\n    if (ch < ' ' || ch > '~' || ch == '?' || ch == '/') {\n      result += \"\\\\\" + StringPrintf(\"%02X\", ch);\n    } else {\n      result += ch;\n    }\n  }\n\n  return result;\n}\n\n// static\nstd::string CWriter::MangleTypes(const TypeVector& types) {\n  assert(types.size() >= 2);\n  std::string result = \"wasm_multi_\";\n  for (auto type : types) {\n    result += MangleType(type);\n  }\n  return result;\n}\n\n/* The C symbol for an export from this module. */\nstd::string CWriter::ExportName(std::string_view export_name) const {\n  return kGlobalSymbolPrefix + module_prefix_ + '_' + MangleName(export_name);\n}\n\n/* The C symbol for an export from an arbitrary module. */\n// static\nstd::string CWriter::ExportName(std::string_view module_name,\n                                std::string_view export_name) {\n  return kGlobalSymbolPrefix + MangleModuleName(module_name) + '_' +\n         MangleName(export_name);\n}\n\n/* The C symbol for a tail-callee export from this module. */\nstd::string CWriter::TailCallExportName(std::string_view export_name) const {\n  return kTailCallSymbolPrefix + ExportName(export_name);\n}\n\n/* The C symbol for a tail-callee export from an arbitrary module. */\n// static\nstd::string CWriter::TailCallExportName(std::string_view module_name,\n                                        std::string_view export_name) {\n  return kTailCallSymbolPrefix + ExportName(module_name, export_name);\n}\n\n/* The type name of an instance of this module. */\nstd::string CWriter::ModuleInstanceTypeName() const {\n  return kGlobalSymbolPrefix + module_prefix_;\n}\n\n/* The type name of an instance of an arbitrary module. */\n// static\nstd::string CWriter::ModuleInstanceTypeName(std::string_view module_name) {\n  return kGlobalSymbolPrefix + MangleModuleName(module_name);\n}\n\n/*\n * Hardcoded \"C\"-locale versions of isalpha/isdigit/isalnum/isxdigit for use\n * in CWriter::Mangle(). We don't use the standard isalpha/isdigit/isalnum\n * because the caller might have changed the current locale.\n */\nstatic bool internal_isalpha(uint8_t ch) {\n  return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');\n}\n\nstatic bool internal_isdigit(uint8_t ch) {\n  return (ch >= '0' && ch <= '9');\n}\n\nstatic bool internal_isalnum(uint8_t ch) {\n  return internal_isalpha(ch) || internal_isdigit(ch);\n}\n\nstatic bool internal_ishexdigit(uint8_t ch) {\n  return internal_isdigit(ch) || (ch >= 'A' && ch <= 'F');  // capitals only\n}\n\n// static\nstd::string CWriter::Mangle(std::string_view name, bool double_underscores) {\n  /*\n   * Name mangling transforms arbitrary Wasm names into \"safe\" C names\n   * in a deterministic way. To avoid collisions, distinct Wasm names must be\n   * transformed into distinct C names.\n   *\n   * The rules implemented here are:\n   * 1) any hex digit ('A' through 'F') that follows the sequence \"0x\"\n   *    is escaped\n   * 2) any underscore at the beginning, at the end, or following another\n   *    underscore, is escaped\n   * 3) if double_underscores is set, underscores are replaced with\n   *    two underscores.\n   * 4) otherwise, any alphanumeric character is kept as-is,\n   *    and any other character is escaped\n   *\n   * \"Escaped\" means the character is represented with the sequence \"0xAB\",\n   * where A B are hex digits ('0'-'9' or 'A'-'F') representing the character's\n   * numeric value.\n   *\n   * Module names are mangled with double_underscores=true to prevent\n   * collisions between, e.g., a module \"alfa\" with export\n   * \"bravo_charlie\" vs. a module \"alfa_bravo\" with export \"charlie\".\n   */\n\n  enum State { Any, Zero, ZeroX, ZeroXHexDigit } state{Any};\n  bool last_was_underscore = false;\n\n  std::string result;\n  auto append_escaped = [&](const uint8_t ch) {\n    result += \"0x\" + StringPrintf(\"%02X\", ch);\n    last_was_underscore = false;\n    state = Any;\n  };\n\n  auto append_verbatim = [&](const uint8_t ch) {\n    result += ch;\n    last_was_underscore = (ch == '_');\n  };\n\n  for (auto it = name.begin(); it != name.end(); ++it) {\n    const uint8_t ch = *it;\n    switch (state) {\n      case Any:\n        state = (ch == '0') ? Zero : Any;\n        break;\n      case Zero:\n        state = (ch == 'x') ? ZeroX : Any;\n        break;\n      case ZeroX:\n        state = internal_ishexdigit(ch) ? ZeroXHexDigit : Any;\n        break;\n      case ZeroXHexDigit:\n        WABT_UNREACHABLE;\n        break;\n    }\n\n    /* rule 1 */\n    if (state == ZeroXHexDigit) {\n      append_escaped(ch);\n      continue;\n    }\n\n    /* rule 2 */\n    if ((ch == '_') && ((it == name.begin()) || (std::next(it) == name.end()) ||\n                        last_was_underscore)) {\n      append_escaped(ch);\n      continue;\n    }\n\n    /* rule 3 */\n    if (double_underscores && ch == '_') {\n      append_verbatim(ch);\n      append_verbatim(ch);\n      continue;\n    }\n\n    /* rule 4 */\n    if (internal_isalnum(ch) || (ch == '_')) {\n      append_verbatim(ch);\n    } else {\n      append_escaped(ch);\n    }\n  }\n\n  return result;\n}\n\n// static\nstd::string CWriter::MangleName(std::string_view name) {\n  return Mangle(name, false);\n}\n\n// static\nstd::string CWriter::MangleModuleName(std::string_view name) {\n  return Mangle(name, true);\n}\n\n/*\n * Allocate a C symbol (must be unused) in the SymbolSet,\n * and a mapping from the Wasm name (tagged with\n * the index space of the name) to that C symbol.\n */\nvoid CWriter::ClaimName(SymbolSet& set,\n                        SymbolMap& map,\n                        char type_suffix,\n                        std::string_view wasm_name,\n                        const std::string& c_name) {\n  const std::string type_tagged_wasm_name =\n      std::string(wasm_name) + type_suffix;\n\n  [[maybe_unused]] bool success;\n  success = set.insert(c_name).second;\n  assert(success);\n\n  success = map.emplace(type_tagged_wasm_name, c_name).second;\n  assert(success);\n}\n\n/*\n * Make a proposed C symbol unique in a given symbol set by appending\n * an integer to the symbol if necessary.\n */\nstd::string CWriter::FindUniqueName(SymbolSet& set,\n                                    std::string_view proposed_name) const {\n  std::string unique{proposed_name};\n  if (set.find(unique) != set.end()) {\n    std::string base = unique + \"_\";\n    size_t count = 0;\n    do {\n      unique = base + std::to_string(count++);\n    } while (set.find(unique) != set.end());\n  }\n  return unique;\n}\n\n/*\n * Find a unique C symbol in the symbol set and claim it (mapping the\n * type-tagged Wasm name to it).\n */\nstd::string CWriter::ClaimUniqueName(SymbolSet& set,\n                                     SymbolMap& map,\n                                     char type_suffix,\n                                     std::string_view wasm_name,\n                                     const std::string& proposed_c_name) {\n  const std::string unique = FindUniqueName(set, proposed_c_name);\n  ClaimName(set, map, type_suffix, wasm_name, unique);\n  return unique;\n}\n\nstd::string_view StripLeadingDollar(std::string_view name) {\n  assert(!name.empty());\n  assert(name.front() == '$');\n  name.remove_prefix(1);\n  return name;\n}\n\nvoid CWriter::DefineImportName(const Import* import,\n                               std::string_view module,\n                               std::string_view field_name) {\n  std::string name;\n  ModuleFieldType type{};\n\n  switch (import->kind()) {\n    case ExternalKind::Func:\n      type = ModuleFieldType::Func;\n      name = cast<FuncImport>(import)->func.name;\n      break;\n    case ExternalKind::Tag:\n      type = ModuleFieldType::Tag;\n      name = cast<TagImport>(import)->tag.name;\n      break;\n    case ExternalKind::Global:\n      type = ModuleFieldType::Global;\n      name = cast<GlobalImport>(import)->global.name;\n      break;\n    case ExternalKind::Memory:\n      type = ModuleFieldType::Memory;\n      name = cast<MemoryImport>(import)->memory.name;\n      break;\n    case ExternalKind::Table:\n      type = ModuleFieldType::Table;\n      name = cast<TableImport>(import)->table.name;\n      break;\n  }\n\n  import_module_sym_map_.emplace(name, import->module_name);\n\n  const std::string mangled = ExportName(module, field_name);\n  global_syms_.erase(mangled);  // duplicate imports are allowed\n  ClaimName(global_syms_, global_sym_map_, MangleField(type), name, mangled);\n}\n\n/*\n * Reserve a C symbol for the public name of a module's export.  The\n * format of these is \"w2c_\" + the module prefix + \"_\" + the mangled\n * export name. Reserving the symbol prevents internal functions and\n * other names from shadowing/overlapping the exports.\n */\nvoid CWriter::ReserveExportName(std::string_view name) {\n  ClaimName(global_syms_, global_sym_map_, MangleField(ModuleFieldType::Export),\n            name, ExportName(name));\n}\n\n/*\n * Names for functions, function types, tags, and segments are globally unique\n * across modules (formatted the same as an export, as \"w2c_\" + module prefix +\n * \"_\" + the name, made unique if necessary).\n */\nstd::string CWriter::DefineGlobalScopeName(ModuleFieldType type,\n                                           std::string_view name) {\n  return ClaimUniqueName(global_syms_, global_sym_map_, MangleField(type), name,\n                         ExportName(StripLeadingDollar(name)));\n}\n\nstd::string CWriter::GetGlobalName(ModuleFieldType type,\n                                   const std::string& name) const {\n  std::string mangled = name + MangleField(type);\n  assert(global_sym_map_.count(mangled) == 1);\n  return global_sym_map_.at(mangled);\n}\n\n/* Names for params, locals, and stack vars are formatted as \"var_\" + name. */\nstd::string CWriter::DefineLocalScopeName(std::string_view name,\n                                          bool is_label) {\n  return ClaimUniqueName(\n      local_syms_, local_sym_map_, is_label ? kLabelSuffix : kParamSuffix, name,\n      kLocalSymbolPrefix + MangleName(StripLeadingDollar(name)));\n}\n\nstd::string CWriter::GetLocalName(const std::string& name,\n                                  bool is_label) const {\n  std::string mangled = name + (is_label ? kLabelSuffix : kParamSuffix);\n  assert(local_sym_map_.count(mangled) == 1);\n  return local_sym_map_.at(mangled);\n}\n\nstd::string CWriter::GetTailCallRef(const std::string& name) const {\n  return kTailCallSymbolPrefix + GetGlobalName(ModuleFieldType::Func, name);\n}\n\nstd::string CWriter::DefineParamName(std::string_view name) {\n  return DefineLocalScopeName(name, false);\n}\n\nstd::string CWriter::DefineLabelName(std::string_view name) {\n  return DefineLocalScopeName(name, true);\n}\n\nstd::string CWriter::DefineStackVarName(Index index,\n                                        Type type,\n                                        std::string_view name) {\n  std::string unique =\n      FindUniqueName(local_syms_, kLocalSymbolPrefix + MangleName(name));\n  StackTypePair stp = {index, type};\n  [[maybe_unused]] bool success =\n      stack_var_sym_map_.emplace(stp, unique).second;\n  assert(success);\n  return unique;\n}\n\n/*\n * Members of the module instance (globals, tables, and memories) are formatted\n * as \"w2c_\" + the mangled name of the element (made unique if necessary).\n */\nstd::string CWriter::DefineInstanceMemberName(ModuleFieldType type,\n                                              std::string_view name) {\n  return ClaimUniqueName(\n      global_syms_, global_sym_map_, MangleField(type), name,\n      kGlobalSymbolPrefix + MangleName(StripLeadingDollar(name)));\n}\n\n/*\n * The name of a module-instance member that points to the originating\n * instance of an imported function is formatted as \"w2c_\" + originating\n * module prefix + \"_instance\".\n */\nstd::string CWriter::DefineImportedModuleInstanceName(std::string_view name) {\n  return ClaimUniqueName(global_syms_, global_sym_map_,\n                         MangleField(ModuleFieldType::Import), name,\n                         ExportName(name, \"instance\"));\n}\n\nvoid CWriter::Indent(int size) {\n  indent_ += size;\n}\n\nvoid CWriter::Dedent(int size) {\n  indent_ -= size;\n  assert(indent_ >= 0);\n}\n\nvoid CWriter::NonIndented(std::function<void()> func) {\n  int copy = indent_;\n  indent_ = 0;\n  func();\n  indent_ = copy;\n}\n\nvoid CWriter::WriteIndent() {\n  static char s_indent[] =\n      \"                                                                       \"\n      \"                                                                       \";\n  static size_t s_indent_len = sizeof(s_indent) - 1;\n  size_t to_write = indent_;\n  while (to_write >= s_indent_len) {\n    stream_->WriteData(s_indent, s_indent_len);\n    to_write -= s_indent_len;\n  }\n  if (to_write > 0) {\n    stream_->WriteData(s_indent, to_write);\n  }\n}\n\nvoid CWriter::WriteData(const char* src, size_t size) {\n  if (should_write_indent_next_) {\n    WriteIndent();\n    should_write_indent_next_ = false;\n  }\n  if (size > 0 && src[0] != '\\n') {\n    consecutive_newline_count_ = 0;\n  }\n  stream_->WriteData(src, size);\n}\n\nvoid WABT_PRINTF_FORMAT(2, 3) CWriter::Writef(const char* format, ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  WriteData(buffer, length);\n}\n\nvoid CWriter::Write(Newline) {\n  // Allow maximum one blank line between sections\n  if (consecutive_newline_count_ < 2) {\n    Write(\"\\n\");\n    consecutive_newline_count_++;\n  }\n  should_write_indent_next_ = true;\n}\n\nvoid CWriter::Write(OpenBrace) {\n  Write(\"{\");\n  Indent();\n  Write(Newline());\n}\n\nvoid CWriter::Write(CloseBrace) {\n  Dedent();\n  Write(\"}\");\n}\n\nvoid CWriter::Write(uint64_t val) {\n  Writef(\"%\" PRIu64, val);\n}\n\nvoid CWriter::Write(std::string_view s) {\n  WriteData(s.data(), s.size());\n}\n\nvoid CWriter::Write(const ParamName& name) {\n  Write(GetLocalName(name.name, false));\n}\n\nvoid CWriter::Write(const LabelName& name) {\n  Write(GetLocalName(name.name, true));\n}\n\nvoid CWriter::Write(const GlobalName& name) {\n  Write(GetGlobalName(name.type, name.name));\n}\n\nvoid CWriter::Write(const TagSymbol& name) {\n  if (!IsImport(name.name)) {\n    Write(\"&\");\n  }\n  Write(GlobalName(name));\n}\n\nvoid CWriter::Write(const ExternalInstancePtr& name) {\n  if (!IsImport(name.name)) {\n    Write(\"&\");\n  }\n  Write(\"instance->\", GlobalName(name));\n}\n\nvoid CWriter::Write(const ExternalRef& name) {\n  if (name.type == ModuleFieldType::Func || !IsImport(name.name)) {\n    Write(GlobalName(name));\n  } else {\n    Write(\"(*\", GlobalName(name), \")\");\n  }\n}\n\nvoid CWriter::Write(const WrapperRef& name) {\n  Write(kWrapperSymbolPrefix, GlobalName(name));\n}\n\nvoid CWriter::Write(const TailCallRef& name) {\n  Write(GetTailCallRef(name.name));\n}\n\nvoid CWriter::Write(const ExternalInstanceRef& name) {\n  if (IsImport(name.name)) {\n    Write(\"(*instance->\", GlobalName(name), \")\");\n  } else {\n    Write(\"instance->\", GlobalName(name));\n  }\n}\n\nvoid CWriter::Write(const GotoLabel& goto_label) {\n  const Label* label = FindLabel(goto_label.var);\n  if (label->HasValue()) {\n    size_t amount = label->sig.size();\n    assert(type_stack_.size() >= label->type_stack_size);\n    assert(type_stack_.size() >= amount);\n    assert(type_stack_.size() - amount >= label->type_stack_size);\n    Index offset = type_stack_.size() - label->type_stack_size - amount;\n    if (offset != 0) {\n      for (Index i = 0; i < amount; ++i) {\n        Write(StackVar(amount - i - 1 + offset, label->sig[i]), \" = \",\n              StackVar(amount - i - 1), \"; \");\n      }\n    }\n  }\n\n  WriteUnwindTryCatchStack(label);\n\n  if (goto_label.var.is_name()) {\n    Write(\"goto \", LabelName(goto_label.var.name()), \";\");\n  } else {\n    // We've generated names for all labels, so we should only be using an\n    // index when branching to the implicit function label, which can't be\n    // named.\n    Write(\"goto \", LabelName(kImplicitFuncLabel), \";\");\n  }\n}\n\nvoid CWriter::Write(const LabelDecl& label) {\n  if (IsTopLabelUsed())\n    Write(label.name, \":;\", Newline());\n}\n\nvoid CWriter::Write(const GlobalInstanceVar& var) {\n  assert(var.var.is_name());\n  Write(ExternalInstanceRef(ModuleFieldType::Global, var.var.name()));\n}\n\nvoid CWriter::Write(const StackVar& sv) {\n  Index index = type_stack_.size() - 1 - sv.index;\n  Type type = sv.type;\n  if (type == Type::Any) {\n    assert(index < type_stack_.size());\n    type = type_stack_[index];\n  }\n\n  StackTypePair stp = {index, type};\n  auto iter = stack_var_sym_map_.find(stp);\n  if (iter == stack_var_sym_map_.end()) {\n    std::string name = MangleType(type) + std::to_string(index);\n    Write(DefineStackVarName(index, type, name));\n  } else {\n    Write(iter->second);\n  }\n}\n\n// static\nconst char* CWriter::GetCTypeName(const Type& type) {\n  // clang-format off\n  switch (type) {\n  case Type::I32: return \"u32\";\n  case Type::I64: return \"u64\";\n  case Type::F32: return \"f32\";\n  case Type::F64: return \"f64\";\n  case Type::V128: return \"v128\";\n  case Type::FuncRef: return \"wasm_rt_funcref_t\";\n  case Type::ExternRef: return \"wasm_rt_externref_t\";\n  case Type::ExnRef: return \"wasm_rt_exnref_t\";\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n}\n\nvoid CWriter::Write(Type type) {\n  Write(GetCTypeName(type));\n}\n\nvoid CWriter::Write(TypeEnum type) {\n  // clang-format off\n  switch (type.type) {\n    case Type::I32: Write(\"WASM_RT_I32\"); break;\n    case Type::I64: Write(\"WASM_RT_I64\"); break;\n    case Type::F32: Write(\"WASM_RT_F32\"); break;\n    case Type::F64: Write(\"WASM_RT_F64\"); break;\n    case Type::V128: Write(\"WASM_RT_V128\"); break;\n    case Type::FuncRef: Write(\"WASM_RT_FUNCREF\"); break;\n    case Type::ExternRef: Write(\"WASM_RT_EXTERNREF\"); break;\n    case Type::ExnRef: Write(\"WASM_RT_EXNREF\"); break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n}\n\nvoid CWriter::Write(SignedType type) {\n  // clang-format off\n  switch (type.type) {\n    case Type::I32: Write(\"s32\"); break;\n    case Type::I64: Write(\"s64\"); break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n}\n\nvoid CWriter::Write(const TypeVector& types) {\n  if (types.empty()) {\n    Write(\"void\");\n  } else if (types.size() == 1) {\n    Write(types[0]);\n  } else {\n    Write(\"struct \", MangleTypes(types));\n  }\n}\n\nvoid CWriter::Write(const Const& const_) {\n  switch (const_.type()) {\n    case Type::I32:\n      Writef(\"%uu\", static_cast<int32_t>(const_.u32()));\n      break;\n\n    case Type::I64:\n      Writef(\"%\" PRIu64 \"ull\", static_cast<int64_t>(const_.u64()));\n      break;\n\n    case Type::F32: {\n      uint32_t f32_bits = const_.f32_bits();\n      // TODO(binji): Share with similar float info in interp.cc and literal.cc\n      if ((f32_bits & 0x7f800000u) == 0x7f800000u) {\n        const char* sign = (f32_bits & 0x80000000) ? \"-\" : \"\";\n        uint32_t significand = f32_bits & 0x7fffffu;\n        if (significand == 0) {\n          // Infinity.\n          Writef(\"%sINFINITY\", sign);\n        } else {\n          // Nan.\n          Writef(\"f32_reinterpret_i32(0x%08x) /* %snan:0x%06x */\", f32_bits,\n                 sign, significand);\n        }\n      } else if (f32_bits == 0x80000000) {\n        // Negative zero. Special-cased so it isn't written as -0 below.\n        Writef(\"-0.f\");\n      } else {\n        Writef(\"%.9g\", Bitcast<float>(f32_bits));\n      }\n      break;\n    }\n\n    case Type::F64: {\n      uint64_t f64_bits = const_.f64_bits();\n      // TODO(binji): Share with similar float info in interp.cc and literal.cc\n      if ((f64_bits & 0x7ff0000000000000ull) == 0x7ff0000000000000ull) {\n        const char* sign = (f64_bits & 0x8000000000000000ull) ? \"-\" : \"\";\n        uint64_t significand = f64_bits & 0xfffffffffffffull;\n        if (significand == 0) {\n          // Infinity.\n          Writef(\"%sINFINITY\", sign);\n        } else {\n          // Nan.\n          Writef(\"f64_reinterpret_i64(0x%016\" PRIx64 \") /* %snan:0x%013\" PRIx64\n                 \" */\",\n                 f64_bits, sign, significand);\n        }\n      } else if (f64_bits == 0x8000000000000000ull) {\n        // Negative zero. Special-cased so it isn't written as -0 below.\n        Writef(\"-0.0\");\n      } else {\n        char buf[128];\n        snprintf(buf, sizeof(buf), \"%.17g\", Bitcast<double>(f64_bits));\n        // Append .0 if sprint didn't include a decimal point or use the\n        // exponent ('e') form.  This is a workaround for an MSVC parsing\n        // issue: https://github.com/WebAssembly/wabt/issues/2422\n        if (!strchr(buf, '.') && !strchr(buf, 'e')) {\n          strcat(buf, \".0\");\n        }\n        Writef(\"%s\", buf);\n      }\n      break;\n    }\n    case Type::V128: {\n      Writef(\"v128_const(0x%02x\", const_.vec128().u8(0));\n      for (int i = 1; i < 16; i++) {\n        Writef(\", 0x%02x\", const_.vec128().u8(i));\n      }\n      Write(\")\");\n      break;\n    }\n\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nvoid CWriter::WriteInitDecl() {\n  Write(\"void \", kAdminSymbolPrefix, module_prefix_, \"_instantiate(\",\n        ModuleInstanceTypeName(), \"*\");\n  for (const auto& import_module_name : import_module_set_) {\n    Write(\", struct \", ModuleInstanceTypeName(import_module_name), \"*\");\n  }\n  Write(\");\", Newline());\n}\n\nvoid CWriter::WriteFreeDecl() {\n  Write(\"void \", kAdminSymbolPrefix, module_prefix_, \"_free(\",\n        ModuleInstanceTypeName(), \"*);\", Newline());\n}\n\nvoid CWriter::WriteGetFuncTypeDecl() {\n  Write(\"wasm_rt_func_type_t \", kAdminSymbolPrefix, module_prefix_,\n        \"_get_func_type(uint32_t param_count, uint32_t result_count, ...);\",\n        Newline());\n}\n\nstatic std::string GetMemoryTypeString(const Memory& memory) {\n  return memory.page_limits.is_shared ? \"wasm_rt_shared_memory_t\"\n                                      : \"wasm_rt_memory_t\";\n}\n\nstatic std::string GetMemoryAPIString(const Memory& memory, std::string api) {\n  std::string suffix;\n  if (memory.page_limits.is_shared) {\n    suffix += \"_shared\";\n  }\n\n  // Memory load and store routines can be optimized for default-page-size,\n  // 32-bit memories (by using hardware to bounds-check memory access).\n  // Append \"_default32\" to these function names to choose the (possibly) fast\n  // path.\n  //\n  // We don't need to do this for runtime routines; those can check the\n  // wasm_rt_memory_t structure.\n  if (api.substr(0, 8) != \"wasm_rt_\" &&\n      memory.page_size == WABT_DEFAULT_PAGE_SIZE &&\n      memory.page_limits.is_64 == false) {\n    suffix += \"_default32\";\n  }\n  return api + suffix;\n}\n\nvoid CWriter::WriteInitExpr(const ExprList& expr_list) {\n  if (expr_list.empty()) {\n    WABT_UNREACHABLE;\n  }\n\n  std::vector<std::string> mini_stack;\n\n  for (const auto& expr : expr_list) {\n    if (expr.type() == ExprType::Binary) {\n      // Extended const expressions include at least one binary op.\n      // This builds a C expression from the operands.\n      if (mini_stack.size() < 2) {\n        WABT_UNREACHABLE;\n      }\n\n      const auto binexpr = cast<BinaryExpr>(&expr);\n      char op;\n      switch (binexpr->opcode) {\n        case Opcode::I32Add:\n        case Opcode::I64Add:\n        case Opcode::F32Add:\n        case Opcode::F64Add:\n          op = '+';\n          break;\n\n        case Opcode::I32Sub:\n        case Opcode::I64Sub:\n        case Opcode::F32Sub:\n        case Opcode::F64Sub:\n          op = '-';\n          break;\n\n        case Opcode::I32Mul:\n        case Opcode::I64Mul:\n        case Opcode::F32Mul:\n        case Opcode::F64Mul:\n          op = '*';\n          break;\n\n        default:\n          WABT_UNREACHABLE;\n      }\n\n      std::string combination =\n          \"((\" + std::string(GetCTypeName(binexpr->opcode.GetParamType1())) +\n          \")\" + mini_stack.at(mini_stack.size() - 2) + \")\" + op + \"((\" +\n          std::string(GetCTypeName(binexpr->opcode.GetParamType2())) + \")\" +\n          mini_stack.at(mini_stack.size() - 1) + \")\";\n      mini_stack.resize(mini_stack.size() - 2);\n      mini_stack.push_back(std::move(combination));\n    } else {\n      // Leaf node (nullary const expression)\n      Stream* existing_stream = stream_;\n      MemoryStream terminal_stream;\n      stream_ = &terminal_stream;\n      WriteInitExprTerminal(&expr);\n      const auto& buf = terminal_stream.output_buffer();\n      mini_stack.emplace_back(reinterpret_cast<const char*>(buf.data.data()),\n                              buf.data.size());\n      stream_ = existing_stream;\n    }\n  }\n\n  if (mini_stack.size() != 1) {\n    WABT_UNREACHABLE;\n  }\n\n  Write(mini_stack.front());\n}\n\nvoid CWriter::WriteInitExprTerminal(const Expr* expr) {\n  switch (expr->type()) {\n    case ExprType::Const:\n      Write(cast<ConstExpr>(expr)->const_);\n      break;\n\n    case ExprType::GlobalGet:\n      Write(GlobalInstanceVar(cast<GlobalGetExpr>(expr)->var));\n      break;\n\n    case ExprType::RefFunc: {\n      const Func* func = module_->GetFunc(cast<RefFuncExpr>(expr)->var);\n      const FuncDeclaration& decl = func->decl;\n\n      assert(decl.has_func_type);\n      const FuncType* func_type = module_->GetFuncType(decl.type_var);\n\n      Write(\"(wasm_rt_funcref_t){\", FuncTypeExpr(func_type), \", \",\n            \"(wasm_rt_function_ptr_t)\", WrapperRef(func->name), \", {\");\n      if (options_.features.tail_call_enabled() &&\n          (IsImport(func->name) || func->features_used.tailcall)) {\n        Write(TailCallRef(func->name));\n      } else {\n        Write(\"NULL\");\n      }\n      Write(\"}, \");\n\n      if (IsImport(func->name)) {\n        Write(\"instance->\", GlobalName(ModuleFieldType::Import,\n                                       import_module_sym_map_[func->name]));\n      } else {\n        Write(\"instance\");\n      }\n      Write(\"}\");\n    } break;\n\n    case ExprType::RefNull:\n      Write(GetReferenceNullValue(cast<RefNullExpr>(expr)->type.opt_type()));\n      break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nstd::string CWriter::GenerateHeaderGuard() const {\n  std::string result;\n  for (char c : header_name_) {\n    if (isalnum(c) || c == '_') {\n      result += toupper(c);\n    } else {\n      result += '_';\n    }\n  }\n  result += \"_GENERATED_\";\n  return result;\n}\n\nvoid CWriter::WriteSourceTop() {\n  Write(s_source_includes);\n  Write(Newline(), \"#include \\\"\", header_name_, \"\\\"\", Newline());\n\n  if (IsSingleUnsharedMemory()) {\n    Write(\"#define IS_SINGLE_UNSHARED_MEMORY 1\", Newline());\n  }\n\n  Write(s_source_declarations, Newline());\n\n  if (module_->features_used.simd) {\n    if (!simd_used_in_header_) {\n      WriteV128Decl();\n    }\n    Write(s_simd_source_declarations);\n  }\n\n  if (module_->features_used.threads) {\n    Write(s_atomicops_source_declarations);\n  }\n}\n\nvoid CWriter::WriteMultiCTop() {\n  if (c_streams_.size() > 1) {\n    assert(header_impl_name_.size() > 0);\n    Write(\"/* Automatically generated by wasm2c */\", Newline());\n    Write(\"#include \\\"\", header_impl_name_, \"\\\"\", Newline());\n  }\n}\n\nvoid CWriter::WriteMultiCTopEmpty() {\n  for (auto& stream : c_streams_) {\n    if (stream->offset() == 0) {\n      stream_ = stream;\n      Write(\"/* Empty wasm2c generated file */\\n\");\n      Write(\"typedef int dummy_def;\");\n    }\n  }\n}\n\nvoid CWriter::DeclareStruct(const TypeVector& types) {\n  const std::string name = MangleTypes(types);\n  if (!typevector_structs_.insert(name).second) {\n    return;\n  }\n\n  Write(Newline(), \"#ifndef \", name, Newline());\n  Write(\"#define \", name, \" \", name, Newline());\n  Write(\"struct \", name, \" \", OpenBrace());\n  for (Index i = 0; i < types.size(); ++i) {\n    const Type type = types[i];\n    Write(type);\n    Writef(\" %c%d;\", MangleType(type), i);\n    Write(Newline());\n  }\n  Write(CloseBrace(), \";\", Newline(), \"#endif  /* \", name, \" */\", Newline());\n}\n\nvoid CWriter::WriteTailcalleeParamTypes() {\n  // A structure for the spilled parameters of a tail-callee is needed in\n  // three cases: for a function that makes a tail-call (and therefore\n  // will have a tail-callee version generated), for any imported function\n  // (for which wasm2c generates a weak import that presents the tail-callee\n  // interface, in case the exporting module doesn't generate one itself), and\n  // for any type entry referenced in a return_call_indirect instruction.\n\n  for (const Func* func : module_->funcs) {\n    if (IsImport(func->name) || func->features_used.tailcall) {\n      if (func->decl.sig.GetNumParams() > 1) {\n        DeclareStruct(func->decl.sig.param_types);\n      }\n    }\n  }\n\n  for (TypeEntry* type : module_->types) {\n    FuncType* func_type = cast<FuncType>(type);\n    if (func_type->GetNumParams() > 1 && func_type->features_used.tailcall) {\n      DeclareStruct(func_type->sig.param_types);\n    }\n  }\n}\n\nvoid CWriter::WriteMultivalueResultTypes() {\n  for (TypeEntry* type : module_->types) {\n    FuncType* func_type = cast<FuncType>(type);\n    if (func_type->GetNumResults() > 1) {\n      DeclareStruct(func_type->sig.result_types);\n    }\n  }\n}\n\nvoid CWriter::WriteTagTypes() {\n  for (const Tag* tag : module_->tags) {\n    const FuncDeclaration& tag_type = tag->decl;\n    Index num_params = tag_type.GetNumParams();\n    if (num_params <= 1) {\n      continue;\n    }\n    DeclareStruct(tag_type.sig.param_types);\n  }\n}\n\nvoid CWriter::WriteFuncTypeDecls() {\n  if (module_->types.empty()) {\n    return;\n  }\n\n  Write(Newline());\n\n  std::string serialized_type;\n  for (const TypeEntry* type : module_->types) {\n    const std::string name =\n        DefineGlobalScopeName(ModuleFieldType::Type, type->name);\n\n    if (c_streams_.size() > 1) {\n      Write(\"FUNC_TYPE_DECL_EXTERN_T(\", name, \");\", Newline());\n    }\n  }\n}\n\nvoid CWriter::WriteFuncTypes() {\n  if (module_->types.empty()) {\n    return;\n  }\n\n  Write(Newline());\n\n  std::unordered_map<std::string, std::string> type_hash;\n\n  std::string serialized_type;\n  for (const TypeEntry* type : module_->types) {\n    const std::string name = GetGlobalName(ModuleFieldType::Type, type->name);\n    SerializeFuncType(*cast<FuncType>(type), serialized_type);\n\n    auto prior_type = type_hash.find(serialized_type);\n    if (prior_type != type_hash.end()) {\n      /* duplicate function type */\n      unique_func_type_names_.push_back(prior_type->second);\n    } else {\n      unique_func_type_names_.push_back(name);\n      type_hash.emplace(serialized_type, name);\n      if (c_streams_.size() > 1) {\n        Write(\"FUNC_TYPE_EXTERN_T(\");\n      } else {\n        Write(\"FUNC_TYPE_T(\");\n      }\n      Write(name, \") = \\\"\");\n      for (uint8_t x : serialized_type) {\n        Writef(\"\\\\x%02x\", x);\n      }\n      Write(\"\\\";\", Newline());\n    }\n  }\n}\n\nvoid CWriter::Write(const FuncTypeExpr& expr) {\n  Index func_type_index = module_->GetFuncTypeIndex(expr.func_type->sig);\n  Write(unique_func_type_names_.at(func_type_index));\n}\n\n// static\nvoid CWriter::SerializeFuncType(const FuncType& func_type,\n                                std::string& serialized_type) {\n  unsigned int len = func_type.GetNumParams() + func_type.GetNumResults() + 1;\n\n  char* const mangled_signature = static_cast<char*>(alloca(len));\n  char* next_byte = mangled_signature;\n\n  // step 1: serialize each param type\n  for (Index i = 0; i < func_type.GetNumParams(); ++i) {\n    *next_byte++ = MangleType(func_type.GetParamType(i));\n  }\n\n  // step 2: separate params and results with a space\n  *next_byte++ = ' ';\n\n  // step 3: serialize each result type\n  for (Index i = 0; i < func_type.GetNumResults(); ++i) {\n    *next_byte++ = MangleType(func_type.GetResultType(i));\n  }\n\n  assert(next_byte - mangled_signature == static_cast<ptrdiff_t>(len));\n\n  // step 4: SHA-256 the whole string\n  sha256({mangled_signature, len}, serialized_type);\n}\n\nvoid CWriter::WriteTagDecls() {\n  Index tag_index = 0;\n  for (const Tag* tag : module_->tags) {\n    bool is_import = tag_index < module_->num_tag_imports;\n    if (!is_import) {\n      // Tags are identified and compared solely by their (unique) address.\n      // The data stored in this variable is never read.\n      if (tag_index == module_->num_tag_imports) {\n        Write(Newline());\n        Write(\"typedef char wasm_tag_placeholder_t;\", Newline());\n      }\n      DefineGlobalScopeName(ModuleFieldType::Tag, tag->name);\n      if (c_streams_.size() > 1) {\n        Write(\"extern const wasm_tag_placeholder_t \",\n              GlobalName(ModuleFieldType::Tag, tag->name), \";\", Newline());\n      }\n    }\n    tag_index++;\n  }\n}\n\nvoid CWriter::WriteTags() {\n  Write(Newline());\n  Index tag_index = 0;\n  for (const Tag* tag : module_->tags) {\n    bool is_import = tag_index < module_->num_tag_imports;\n    if (!is_import) {\n      Write(InternalSymbolScope(), \"const wasm_tag_placeholder_t \",\n            GlobalName(ModuleFieldType::Tag, tag->name), \";\", Newline());\n    }\n    tag_index++;\n  }\n}\n\nvoid CWriter::ComputeUniqueImports() {\n  using modname_name_pair = std::pair<std::string, std::string>;\n  std::map<modname_name_pair, const Import*> import_map;\n  for (const Import* import : module_->imports) {\n    // After emplacing, the returned bool says whether the insert happened;\n    // i.e., was there already an import with the same modname and name?\n    // If there was, make sure it was at least the same kind of import.\n    const auto iterator_and_insertion_bool = import_map.emplace(\n        modname_name_pair(import->module_name, import->field_name), import);\n    if (!iterator_and_insertion_bool.second) {\n      if (iterator_and_insertion_bool.first->second->kind() != import->kind()) {\n        UNIMPLEMENTED(\"contradictory import declaration\");\n      } else {\n        fprintf(stderr, \"warning: duplicate import declaration \\\"%s\\\" \\\"%s\\\"\\n\",\n                import->module_name.c_str(), import->field_name.c_str());\n      }\n    }\n    import_module_set_.insert(import->module_name);\n    if (import->kind() == ExternalKind::Func) {\n      import_func_module_set_.insert(import->module_name);\n      import_func_module_map_.emplace(cast<FuncImport>(import)->func.name,\n                                      import->module_name);\n    }\n  }\n\n  for (const auto& node : import_map) {\n    unique_imports_.push_back(node.second);\n  }\n}\n\nvoid CWriter::BeginInstance() {\n  if (module_->imports.empty()) {\n    Write(\"typedef struct \", ModuleInstanceTypeName(), \" \", OpenBrace());\n    return;\n  }\n\n  ComputeUniqueImports();\n\n  // define names of per-instance imports\n  for (const Import* import : module_->imports) {\n    DefineImportName(import, import->module_name, import->field_name);\n  }\n\n  // Forward declaring module instance types\n  for (const auto& import_module : import_module_set_) {\n    DefineImportedModuleInstanceName(import_module);\n    Write(\"struct \", ModuleInstanceTypeName(import_module), \";\", Newline());\n  }\n\n  // Forward declaring module imports\n  for (const Import* import : unique_imports_) {\n    if ((import->kind() == ExternalKind::Func) ||\n        (import->kind() == ExternalKind::Tag)) {\n      continue;\n    }\n\n    Write(\"extern \");\n    switch (import->kind()) {\n      case ExternalKind::Global: {\n        const Global& global = cast<GlobalImport>(import)->global;\n        Write(global.type);\n        break;\n      }\n\n      case ExternalKind::Memory: {\n        Write(GetMemoryTypeString(cast<MemoryImport>(import)->memory));\n        break;\n      }\n\n      case ExternalKind::Table:\n        WriteTableType(cast<TableImport>(import)->table.elem_type);\n        break;\n\n      default:\n        WABT_UNREACHABLE;\n    }\n    Write(\"* \", ExportName(import->module_name, import->field_name), \"(struct \",\n          ModuleInstanceTypeName(import->module_name), \"*);\", Newline());\n  }\n  Write(Newline());\n\n  // Add pointers to module instances that any func is imported from,\n  // so that imported functions can be given their own module instances\n  // when invoked\n  Write(\"typedef struct \", ModuleInstanceTypeName(), \" \", OpenBrace());\n  for (const auto& import_module : import_func_module_set_) {\n    Write(\"struct \", ModuleInstanceTypeName(import_module), \"* \",\n          GlobalName(ModuleFieldType::Import, import_module), \";\", Newline());\n  }\n\n  for (const Import* import : unique_imports_) {\n    if ((import->kind() == ExternalKind::Func) ||\n        (import->kind() == ExternalKind::Tag)) {\n      continue;\n    }\n\n    Write(\"/* import: '\", SanitizeForComment(import->module_name), \"' '\",\n          SanitizeForComment(import->field_name), \"' */\", Newline());\n\n    switch (import->kind()) {\n      case ExternalKind::Global:\n        WriteGlobal(cast<GlobalImport>(import)->global,\n                    std::string(\"*\") +\n                        ExportName(import->module_name, import->field_name));\n        break;\n\n      case ExternalKind::Memory:\n        WriteMemory(std::string(\"*\") +\n                        ExportName(import->module_name, import->field_name),\n                    cast<MemoryImport>(import)->memory);\n        break;\n\n      case ExternalKind::Table: {\n        const Table& table = cast<TableImport>(import)->table;\n        WriteTable(std::string(\"*\") +\n                       ExportName(import->module_name, import->field_name),\n                   table.elem_type);\n      } break;\n\n      default:\n        WABT_UNREACHABLE;\n    }\n\n    Write(Newline());\n  }\n}\n\n// Write module-wide imports (funcs & tags), which aren't tied to an instance.\nvoid CWriter::WriteImports() {\n  if (unique_imports_.empty())\n    return;\n\n  Write(Newline());\n\n  for (const Import* import : unique_imports_) {\n    if (import->kind() == ExternalKind::Func) {\n      Write(Newline(), \"/* import: '\", SanitizeForComment(import->module_name),\n            \"' '\", SanitizeForComment(import->field_name), \"' */\", Newline());\n      const Func& func = cast<FuncImport>(import)->func;\n      WriteImportFuncDeclaration(\n          func.decl, import->module_name,\n          ExportName(import->module_name, import->field_name));\n      Write(\";\", Newline());\n      if (options_.features.tail_call_enabled()) {\n        WriteTailCallFuncDeclaration(GetTailCallRef(func.name));\n        Write(\";\", Newline());\n      }\n    } else if (import->kind() == ExternalKind::Tag) {\n      Write(Newline(), \"/* import: '\", SanitizeForComment(import->module_name),\n            \"' '\", SanitizeForComment(import->field_name), \"' */\", Newline());\n      Write(\"extern const wasm_rt_tag_t \",\n            ExportName(import->module_name, import->field_name), \";\",\n            Newline());\n    }\n  }\n}\n\nvoid CWriter::WriteTailCallWeakImports() {\n  for (const Import* import : unique_imports_) {\n    if (import->kind() != ExternalKind::Func) {\n      continue;\n    }\n    const Func& func = cast<FuncImport>(import)->func;\n    Write(Newline(), \"/* handler for missing tail-call on import: '\",\n          SanitizeForComment(import->module_name), \"' '\",\n          SanitizeForComment(import->field_name), \"' */\", Newline());\n    Write(\"WEAK_FUNC_DECL(\",\n          TailCallExportName(import->module_name, import->field_name), \", \",\n          kTailCallFallbackPrefix, module_prefix_, \"_\",\n          ExportName(import->module_name, import->field_name), \")\", Newline());\n    Write(OpenBrace(), \"next->fn = NULL;\", Newline());\n\n    Index num_params = func.GetNumParams();\n    Index num_results = func.GetNumResults();\n    if (num_params >= 1) {\n      Write(func.decl.sig.param_types, \" params;\", Newline());\n      Write(\"wasm_rt_memcpy(&params, tail_call_stack, sizeof(params));\",\n            Newline());\n    }\n\n    if (num_results >= 1) {\n      Write(func.decl.sig.result_types, \" result = \");\n    }\n\n    Write(ExportName(import->module_name, import->field_name),\n          \"(*instance_ptr\");\n\n    if (num_params == 1) {\n      Write(\", params\");\n    } else {\n      for (Index i = 0; i < num_params; ++i) {\n        Writef(\", params.%c%d\", MangleType(func.GetParamType(i)), i);\n      }\n    }\n\n    Write(\");\", Newline());\n\n    if (num_results >= 1) {\n      Write(\"wasm_rt_memcpy(tail_call_stack, &result, sizeof(result));\",\n            Newline());\n    }\n\n    Write(CloseBrace(), Newline());\n  }\n}\n\nvoid CWriter::WriteFuncDeclarations() {\n  if (module_->funcs.size() == module_->num_func_imports)\n    return;\n\n  Write(Newline());\n\n  Index func_index = 0;\n  for (const Func* func : module_->funcs) {\n    bool is_import = func_index < module_->num_func_imports;\n    if (!is_import) {\n      Write(InternalSymbolScope());\n      WriteFuncDeclaration(\n          func->decl, DefineGlobalScopeName(ModuleFieldType::Func, func->name));\n      Write(\";\", Newline());\n\n      if (func->features_used.tailcall) {\n        Write(InternalSymbolScope());\n        WriteTailCallFuncDeclaration(GetTailCallRef(func->name));\n        Write(\";\", Newline());\n      }\n    }\n    ++func_index;\n  }\n}\n\nvoid CWriter::WriteFuncDeclaration(const FuncDeclaration& decl,\n                                   const std::string& name) {\n  Write(decl.sig.result_types, \" \", name, \"(\");\n  Write(ModuleInstanceTypeName(), \"*\");\n  WriteParamTypes(decl);\n  Write(\")\");\n}\n\nvoid CWriter::WriteTailCallFuncDeclaration(const std::string& mangled_name) {\n  Write(\"void \", mangled_name,\n        \"(void **instance_ptr, void *tail_call_stack, wasm_rt_tailcallee_t \"\n        \"*next)\");\n}\n\nvoid CWriter::WriteImportFuncDeclaration(const FuncDeclaration& decl,\n                                         const std::string& module_name,\n                                         const std::string& name) {\n  Write(decl.sig.result_types, \" \", name, \"(\");\n  Write(\"struct \", ModuleInstanceTypeName(module_name), \"*\");\n  WriteParamTypes(decl);\n  Write(\")\");\n}\n\nvoid CWriter::WriteCallIndirectFuncDeclaration(const FuncDeclaration& decl,\n                                               const std::string& name) {\n  Write(decl.sig.result_types, \" \", name, \"(void*\");\n  WriteParamTypes(decl);\n  Write(\")\");\n}\n\nstatic bool func_uses_simd(const FuncSignature& sig) {\n  return std::any_of(sig.param_types.begin(), sig.param_types.end(),\n                     [](auto x) { return x == Type::V128; }) ||\n         std::any_of(sig.result_types.begin(), sig.result_types.end(),\n                     [](auto x) { return x == Type::V128; });\n}\n\nvoid CWriter::ComputeSimdScope() {\n  simd_used_in_header_ =\n      module_->features_used.simd &&\n      (std::any_of(module_->globals.begin(), module_->globals.end(),\n                   [](const auto& x) { return x->type == Type::V128; }) ||\n       std::any_of(module_->imports.begin(), module_->imports.end(),\n                   [](const auto& x) {\n                     return x->kind() == ExternalKind::Func &&\n                            func_uses_simd(cast<FuncImport>(x)->func.decl.sig);\n                   }) ||\n       std::any_of(module_->exports.begin(), module_->exports.end(),\n                   [&](const auto& x) {\n                     return x->kind == ExternalKind::Func &&\n                            func_uses_simd(module_->GetFunc(x->var)->decl.sig);\n                   }));\n}\n\nvoid CWriter::WriteHeaderIncludes() {\n  Write(\"#include \\\"wasm-rt.h\\\"\", Newline());\n\n  if (module_->features_used.exceptions) {\n    Write(\"#include \\\"wasm-rt-exceptions.h\\\"\", Newline(), Newline());\n  }\n\n  if (simd_used_in_header_) {\n    WriteV128Decl();\n  }\n\n  Write(Newline());\n}\n\nvoid CWriter::WriteV128Decl() {\n  Write(\"#include <simde/wasm/simd128.h>\", Newline(), Newline());\n  Write(\"#ifndef WASM_RT_SIMD_TYPE_DEFINED\", Newline(),\n        \"#define WASM_RT_SIMD_TYPE_DEFINED\", Newline(),\n        \"typedef simde_v128_t v128;\", Newline(), \"#endif\", Newline(),\n        Newline());\n}\n\nvoid CWriter::WriteModuleInstance() {\n  BeginInstance();\n  WriteGlobals();\n  WriteMemories();\n  WriteTables();\n  WriteDataInstances();\n  WriteElemInstances();\n\n  // C forbids an empty struct\n  if (module_->globals.empty() && module_->memories.empty() &&\n      module_->tables.empty() && import_func_module_set_.empty()) {\n    Write(\"char dummy_member;\", Newline());\n  }\n\n  Write(CloseBrace(), \" \", ModuleInstanceTypeName(), \";\", Newline());\n  Write(Newline());\n}\n\nvoid CWriter::WriteGlobals() {\n  Index global_index = 0;\n  if (module_->globals.size() != module_->num_global_imports) {\n    for (const Global* global : module_->globals) {\n      bool is_import = global_index < module_->num_global_imports;\n      if (!is_import) {\n        WriteGlobal(*global, DefineInstanceMemberName(ModuleFieldType::Global,\n                                                      global->name));\n        Write(Newline());\n      }\n      ++global_index;\n    }\n  }\n}\n\nvoid CWriter::WriteGlobal(const Global& global, const std::string& name) {\n  Write(global.type, \" \", name, \";\");\n}\n\nvoid CWriter::WriteGlobalPtr(const Global& global, const std::string& name) {\n  Write(global.type, \"* \", name, \"(\", ModuleInstanceTypeName(), \"* instance)\");\n}\n\nvoid CWriter::WriteMemories() {\n  if (module_->memories.size() == module_->num_memory_imports)\n    return;\n\n  Index memory_index = 0;\n  for (const Memory* memory : module_->memories) {\n    bool is_import = memory_index < module_->num_memory_imports;\n    if (!is_import) {\n      WriteMemory(\n          DefineInstanceMemberName(ModuleFieldType::Memory, memory->name),\n          *memory);\n      Write(Newline());\n    }\n    ++memory_index;\n  }\n}\n\nvoid CWriter::WriteMemory(const std::string& name, const Memory& memory) {\n  Write(GetMemoryTypeString(memory), \" \", name, \";\");\n}\n\nvoid CWriter::WriteMemoryPtr(const std::string& name, const Memory& memory) {\n  Write(GetMemoryTypeString(memory), \"* \", name, \"(\", ModuleInstanceTypeName(),\n        \"* instance)\");\n}\n\nvoid CWriter::WriteTables() {\n  if (module_->tables.size() == module_->num_table_imports) {\n    return;\n  }\n\n  Index table_index = 0;\n  for (const Table* table : module_->tables) {\n    bool is_import = table_index < module_->num_table_imports;\n    if (!is_import) {\n      WriteTable(DefineInstanceMemberName(ModuleFieldType::Table, table->name),\n                 table->elem_type);\n      Write(Newline());\n    }\n    ++table_index;\n  }\n}\n\nvoid CWriter::WriteTable(const std::string& name, const wabt::Type& type) {\n  WriteTableType(type);\n  Write(\" \", name, \";\");\n}\n\nvoid CWriter::WriteTablePtr(const std::string& name, const Table& table) {\n  WriteTableType(table.elem_type);\n  Write(\"* \", name, \"(\", ModuleInstanceTypeName(), \"* instance)\");\n}\n\nvoid CWriter::WriteTableType(const wabt::Type& type) {\n  Write(\"wasm_rt_\", GetReferenceTypeName(type), \"_table_t\");\n}\n\nvoid CWriter::WriteGlobalInitializers() {\n  if (module_->globals.empty())\n    return;\n\n  Write(Newline(), \"static void init_globals(\", ModuleInstanceTypeName(),\n        \"* instance) \", OpenBrace());\n  Index global_index = 0;\n  for (const Global* global : module_->globals) {\n    bool is_import = global_index < module_->num_global_imports;\n    if (!is_import) {\n      assert(!global->init_expr.empty());\n      Write(ExternalInstanceRef(ModuleFieldType::Global, global->name), \" = \");\n      WriteInitExpr(global->init_expr);\n      Write(\";\", Newline());\n    }\n    ++global_index;\n  }\n  Write(CloseBrace(), Newline());\n}\n\nstatic inline bool is_droppable(const DataSegment* data_segment) {\n  return (data_segment->kind == SegmentKind::Passive) &&\n         (!data_segment->data.empty());\n}\n\nstatic inline bool is_droppable(const ElemSegment* elem_segment) {\n  return (elem_segment->kind == SegmentKind::Passive) &&\n         (!elem_segment->elem_exprs.empty());\n}\n\nvoid CWriter::WriteDataInstances() {\n  for (const DataSegment* data_segment : module_->data_segments) {\n    std::string name =\n        DefineGlobalScopeName(ModuleFieldType::DataSegment, data_segment->name);\n    if (is_droppable(data_segment)) {\n      Write(\"bool \", \"data_segment_dropped_\", name, \" : 1;\", Newline());\n    }\n  }\n}\n\nvoid CWriter::WriteDataInitializerDecls() {\n  if (module_->memories.empty()) {\n    return;\n  }\n\n  for (const DataSegment* data_segment : module_->data_segments) {\n    if (data_segment->data.empty()) {\n      continue;\n    }\n\n    if (c_streams_.size() > 1) {\n      Write(Newline(), \"extern const u8 data_segment_data_\",\n            GlobalName(ModuleFieldType::DataSegment, data_segment->name), \"[];\",\n            Newline());\n    }\n  }\n}\n\nvoid CWriter::WriteDataInitializers() {\n  if (module_->memories.empty()) {\n    return;\n  }\n\n  for (const DataSegment* data_segment : module_->data_segments) {\n    if (data_segment->data.empty()) {\n      continue;\n    }\n\n    Write(Newline(), InternalSymbolScope(), \"const u8 data_segment_data_\",\n          GlobalName(ModuleFieldType::DataSegment, data_segment->name),\n          \"[] = \", OpenBrace());\n    size_t i = 0;\n    for (uint8_t x : data_segment->data) {\n      Writef(\"0x%02x, \", x);\n      if ((++i % 12) == 0)\n        Write(Newline());\n    }\n    if (i > 0)\n      Write(Newline());\n    Write(CloseBrace(), \";\", Newline());\n  }\n\n  Write(Newline(), \"static void init_memories(\", ModuleInstanceTypeName(),\n        \"* instance) \", OpenBrace());\n  if (module_->memories.size() > module_->num_memory_imports) {\n    Index memory_idx = module_->num_memory_imports;\n    for (Index i = memory_idx; i < module_->memories.size(); i++) {\n      const Memory* memory = module_->memories[i];\n      const uint64_t max =\n          memory->page_limits.has_max\n              ? memory->page_limits.max\n              : WABT_BYTES_TO_MIN_PAGES(\n                    (memory->page_limits.is_64 ? UINT64_MAX : UINT32_MAX),\n                    memory->page_size);\n      std::string func = GetMemoryAPIString(*memory, \"wasm_rt_allocate_memory\");\n      Write(\n          func, \"(\", ExternalInstancePtr(ModuleFieldType::Memory, memory->name),\n          \", \", memory->page_limits.initial, \", \", max, \", \",\n          memory->page_limits.is_64, \", \", memory->page_size, \");\", Newline());\n    }\n  }\n\n  for (const DataSegment* data_segment : module_->data_segments) {\n    if (data_segment->kind != SegmentKind::Active) {\n      continue;\n    }\n    const Memory* memory =\n        module_->memories[module_->GetMemoryIndex(data_segment->memory_var)];\n    Write(\"LOAD_DATA(\",\n          ExternalInstanceRef(ModuleFieldType::Memory, memory->name), \", \");\n    WriteInitExpr(data_segment->offset);\n    if (data_segment->data.empty()) {\n      Write(\", NULL, 0\");\n    } else {\n      Write(\", data_segment_data_\",\n            GlobalName(ModuleFieldType::DataSegment, data_segment->name), \", \",\n            data_segment->data.size());\n    }\n    Write(\");\", Newline());\n  }\n\n  Write(CloseBrace(), Newline());\n\n  if (!module_->data_segments.empty()) {\n    Write(Newline(), \"static void init_data_instances(\",\n          ModuleInstanceTypeName(), \" *instance) \", OpenBrace());\n\n    for (const DataSegment* data_segment : module_->data_segments) {\n      if (is_droppable(data_segment)) {\n        Write(\"instance->data_segment_dropped_\",\n              GlobalName(ModuleFieldType::DataSegment, data_segment->name),\n              \" = false;\", Newline());\n      }\n    }\n\n    Write(CloseBrace(), Newline());\n  }\n}\n\nvoid CWriter::WriteElemInstances() {\n  for (const ElemSegment* elem_segment : module_->elem_segments) {\n    std::string name =\n        DefineGlobalScopeName(ModuleFieldType::ElemSegment, elem_segment->name);\n    if (is_droppable(elem_segment)) {\n      Write(\"bool \", \"elem_segment_dropped_\", name, \" : 1;\", Newline());\n    }\n  }\n}\n\nvoid CWriter::WriteElemInitializerDecls() {\n  if (module_->tables.empty()) {\n    return;\n  }\n\n  for (const ElemSegment* elem_segment : module_->elem_segments) {\n    if (elem_segment->elem_exprs.empty()) {\n      continue;\n    }\n\n    if (AreInitializersAlwaysNull(elem_segment->elem_type)) {\n      // no need to store these initializers because only ref.null is possible\n      continue;\n    }\n\n    if (c_streams_.size() > 1) {\n      Write(Newline(),\n            \"extern const wasm_elem_segment_expr_t elem_segment_exprs_\",\n            GlobalName(ModuleFieldType::ElemSegment, elem_segment->name), \"[];\",\n            Newline());\n    }\n  }\n}\n\nvoid CWriter::WriteFuncRefWrapper(const Func* func) {\n  Write(\"static \", func->decl.sig.result_types, \" \", WrapperRef(func->name));\n  Write(\"(void *instance\");\n  if (func->GetNumParams() != 0) {\n    Indent(4);\n    for (Index i = 0; i < func->GetNumParams(); ++i) {\n      Write(\", \");\n      if (i != 0 && (i % 8) == 0) {\n        Write(Newline());\n      }\n      Write(func->GetParamType(i), \" \", kLocalSymbolPrefix);\n      Writef(\"%d\", i);\n    }\n    Dedent(4);\n  }\n  Write(\") \", OpenBrace());\n  Write(\"return \");\n  Write(ExternalRef(ModuleFieldType::Func, func->name));\n\n  std::string target_module_name;\n  if (IsImport(func->name)) {\n    std::string external_module = import_func_module_map_[func->name];\n    assert(external_module != \"\");\n    target_module_name = ModuleInstanceTypeName(external_module);\n  } else {\n    target_module_name = ModuleInstanceTypeName();\n  }\n\n  Write(\"((struct \", target_module_name, \"*) instance\");\n  if (func->GetNumParams() != 0) {\n    Indent(4);\n    for (Index i = 0; i < func->GetNumParams(); ++i) {\n      Write(\", \");\n      if (i != 0 && (i % 8) == 0) {\n        Write(Newline());\n      }\n      Write(kLocalSymbolPrefix);\n      Writef(\"%d\", i);\n    }\n    Dedent(4);\n  }\n  Write(\");\", Newline(), CloseBrace(), Newline());\n}\n\nvoid CWriter::WriteFuncRefWrappers() {\n  std::set<std::string> unique_func_wrappers;\n\n  for (Index index : module_->used_func_refs) {\n    assert(index < module_->funcs.size());\n    const Func* func = module_->funcs[index];\n    if (unique_func_wrappers.count(func->name) == 0) {\n      WriteFuncRefWrapper(func);\n      unique_func_wrappers.insert(func->name);\n    }\n  }\n}\n\nvoid CWriter::WriteElemInitializers() {\n  if (module_->tables.empty()) {\n    return;\n  }\n\n  for (const ElemSegment* elem_segment : module_->elem_segments) {\n    if (elem_segment->elem_exprs.empty()) {\n      continue;\n    }\n\n    if (AreInitializersAlwaysNull(elem_segment->elem_type)) {\n      // no need to store these initializers because only ref.null is possible\n      continue;\n    }\n\n    Write(Newline(), InternalSymbolScope(),\n          \"const wasm_elem_segment_expr_t elem_segment_exprs_\",\n          GlobalName(ModuleFieldType::ElemSegment, elem_segment->name),\n          \"[] = \", OpenBrace());\n\n    for (const ExprList& elem_expr : elem_segment->elem_exprs) {\n      assert(elem_expr.size() == 1);\n      const Expr& expr = elem_expr.front();\n      switch (expr.type()) {\n        case ExprType::RefFunc: {\n          const Func* func = module_->GetFunc(cast<RefFuncExpr>(&expr)->var);\n          const FuncType* func_type = module_->GetFuncType(func->decl.type_var);\n          Write(\"{RefFunc, \", FuncTypeExpr(func_type),\n                \", (wasm_rt_function_ptr_t)\", WrapperRef(func->name), \", {\");\n          if (options_.features.tail_call_enabled() &&\n              (IsImport(func->name) || func->features_used.tailcall)) {\n            Write(TailCallRef(func->name));\n          } else {\n            Write(\"NULL\");\n          }\n          Write(\"}, \");\n\n          if (IsImport(func->name)) {\n            Write(\"offsetof(\", ModuleInstanceTypeName(), \", \",\n                  GlobalName(ModuleFieldType::Import,\n                             import_module_sym_map_[func->name]),\n                  \")\");\n          } else {\n            Write(\"0\");\n          }\n          Write(\"},\", Newline());\n        } break;\n        case ExprType::RefNull:\n          Write(\"{RefNull, NULL, NULL, {NULL}, 0},\", Newline());\n          break;\n        case ExprType::GlobalGet: {\n          const Global* global =\n              module_->GetGlobal(cast<GlobalGetExpr>(&expr)->var);\n          assert(IsImport(global->name));\n          Write(\"{GlobalGet, NULL, NULL, {NULL}, offsetof(\",\n                ModuleInstanceTypeName(), \", \",\n                GlobalName(ModuleFieldType::Global, global->name), \")},\",\n                Newline());\n        } break;\n        default:\n          WABT_UNREACHABLE;\n      }\n    }\n    Write(CloseBrace(), \";\", Newline());\n  }\n\n  Write(Newline(), \"static void init_tables(\", ModuleInstanceTypeName(),\n        \"* instance) \", OpenBrace());\n\n  if (module_->tables.size() > module_->num_table_imports) {\n    Index table_idx = module_->num_table_imports;\n    for (Index i = table_idx; i < module_->tables.size(); i++) {\n      const Table* table = module_->tables[i];\n      uint32_t max =\n          table->elem_limits.has_max ? table->elem_limits.max : UINT32_MAX;\n      Write(\"wasm_rt_allocate_\", GetReferenceTypeName(table->elem_type),\n            \"_table(\", ExternalInstancePtr(ModuleFieldType::Table, table->name),\n            \", \", table->elem_limits.initial, \", \", max, \");\", Newline());\n    }\n  }\n\n  for (const ElemSegment* elem_segment : module_->elem_segments) {\n    if (elem_segment->kind != SegmentKind::Active) {\n      continue;\n    }\n\n    const Table* table = module_->GetTable(elem_segment->table_var);\n\n    WriteElemTableInit(true, elem_segment, table);\n  }\n\n  Write(CloseBrace(), Newline());\n\n  if (!module_->elem_segments.empty()) {\n    Write(Newline(), \"static void init_elem_instances(\",\n          ModuleInstanceTypeName(), \" *instance) \", OpenBrace());\n\n    for (const ElemSegment* elem_segment : module_->elem_segments) {\n      if (is_droppable(elem_segment)) {\n        Write(\"instance->elem_segment_dropped_\",\n              GlobalName(ModuleFieldType::ElemSegment, elem_segment->name),\n              \" = false;\", Newline());\n      }\n    }\n\n    Write(CloseBrace(), Newline());\n  }\n}\n\nvoid CWriter::WriteElemTableInit(bool active_initialization,\n                                 const ElemSegment* src_segment,\n                                 const Table* dst_table) {\n  Type elem_type = dst_table->elem_type;\n\n  assert(elem_type.IsRef() && !elem_type.IsReferenceWithIndex());\n  assert(elem_type == src_segment->elem_type);\n\n  Write(GetReferenceTypeName(elem_type), \"_table_init(\",\n        ExternalInstancePtr(ModuleFieldType::Table, dst_table->name), \", \");\n\n  // elem segment exprs needed only for funcref tables\n  // because externref and exnref tables can only be initialized with ref.null\n  if (elem_type == Type::FuncRef) {\n    if (src_segment->elem_exprs.empty()) {\n      Write(\"NULL, \");\n    } else {\n      Write(\"elem_segment_exprs_\",\n            GlobalName(ModuleFieldType::ElemSegment, src_segment->name), \", \");\n    }\n  }\n\n  // src_size, dest_addr, src_addr, N\n  if (active_initialization) {\n    Write(src_segment->elem_exprs.size(), \", \");\n    WriteInitExpr(src_segment->offset);\n    Write(\", 0, \", src_segment->elem_exprs.size());\n  } else {\n    if (is_droppable(src_segment)) {\n      Write(\"(instance->elem_segment_dropped_\",\n            GlobalName(ModuleFieldType::ElemSegment, src_segment->name),\n            \" ? 0 : \", src_segment->elem_exprs.size(), \"), \");\n    } else {\n      Write(\"0, \");\n    }\n    Write(StackVar(2), \", \", StackVar(1), \", \", StackVar(0));\n  }\n\n  if (elem_type == Type::FuncRef) {\n    Write(\", instance\");\n  }\n\n  Write(\");\", Newline());\n}\n\nbool CWriter::IsSingleUnsharedMemory() {\n  return module_->memories.size() == 1 &&\n         !module_->memories[0]->page_limits.is_shared;\n}\n\nvoid CWriter::InstallSegueBase(Memory* memory, bool save_old_value) {\n  NonIndented(\n      [&] { Write(\"#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\", Newline()); });\n  if (save_old_value) {\n    NonIndented([&] { Write(\"#if !WASM_RT_SEGUE_FREE_SEGMENT\", Newline()); });\n    Write(\"void* segue_saved_base = wasm_rt_segue_read_base();\", Newline());\n    NonIndented([&] { Write(\"#endif\", Newline()); });\n  }\n  auto primary_memory =\n      ExternalInstanceRef(ModuleFieldType::Memory, memory->name);\n  Write(\"wasm_rt_segue_write_base(\", primary_memory, \".data);\", Newline());\n  NonIndented([&] { Write(\"#endif\", Newline()); });\n}\n\nvoid CWriter::RestoreSegueBase() {\n  NonIndented([&] {\n    Write(\n        \"#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\",\n        Newline());\n  });\n  Write(\"wasm_rt_segue_write_base(segue_saved_base);\", Newline());\n  NonIndented([&] { Write(\"#endif\", Newline()); });\n}\n\nvoid CWriter::WriteExports(CWriterPhase kind) {\n  if (module_->exports.empty())\n    return;\n\n  for (const Export* export_ : module_->exports) {\n    Write(Newline(), \"/* export: '\", SanitizeForComment(export_->name), \"' */\",\n          Newline());\n\n    const std::string mangled_name = ExportName(export_->name);\n    std::string internal_name;\n    std::vector<std::string> index_to_name;\n\n    switch (export_->kind) {\n      case ExternalKind::Func: {\n        const Func* func = module_->GetFunc(export_->var);\n        internal_name = func->name;\n        if (kind == CWriterPhase::Declarations) {\n          WriteFuncDeclaration(func->decl, mangled_name);\n        } else {\n          func_ = func;\n          local_syms_ = global_syms_;\n          local_sym_map_.clear();\n          stack_var_sym_map_.clear();\n          Write(func_->decl.sig.result_types, \" \", mangled_name, \"(\");\n          MakeTypeBindingReverseMapping(func_->GetNumParamsAndLocals(),\n                                        func_->bindings, &index_to_name);\n          WriteParams(index_to_name);\n        }\n        break;\n      }\n\n      case ExternalKind::Global: {\n        const Global* global = module_->GetGlobal(export_->var);\n        internal_name = global->name;\n        WriteGlobalPtr(*global, mangled_name);\n        break;\n      }\n\n      case ExternalKind::Memory: {\n        const Memory* memory = module_->GetMemory(export_->var);\n        internal_name = memory->name;\n        WriteMemoryPtr(mangled_name, *memory);\n        break;\n      }\n\n      case ExternalKind::Table: {\n        const Table* table = module_->GetTable(export_->var);\n        internal_name = table->name;\n        WriteTablePtr(mangled_name, *table);\n        break;\n      }\n\n      case ExternalKind::Tag: {\n        const Tag* tag = module_->GetTag(export_->var);\n        internal_name = tag->name;\n        if (kind == CWriterPhase::Declarations) {\n          Write(\"extern \");\n        }\n        Write(\"const wasm_rt_tag_t \", mangled_name);\n        break;\n      }\n\n      default:\n        WABT_UNREACHABLE;\n    }\n\n    if (kind == CWriterPhase::Declarations) {\n      Write(\";\", Newline());\n      continue;\n    }\n\n    Write(\" \");\n    switch (export_->kind) {\n      case ExternalKind::Func: {\n        Write(OpenBrace());\n        if (IsSingleUnsharedMemory()) {\n          InstallSegueBase(module_->memories[0], true /* save_old_value */);\n        }\n        auto num_results = func_->GetNumResults();\n        if (num_results > 1) {\n          Write(func_->decl.sig.result_types, \" ret = \");\n        } else if (num_results == 1) {\n          Write(func_->GetResultType(0), \" ret = \");\n        }\n        Write(ExternalRef(ModuleFieldType::Func, internal_name), \"(\");\n\n        if (IsImport(internal_name)) {\n          Write(\"instance->\",\n                GlobalName(ModuleFieldType::Import,\n                           import_module_sym_map_[internal_name]));\n        } else {\n          Write(\"instance\");\n        }\n        WriteParamSymbols(index_to_name);\n        if (IsSingleUnsharedMemory()) {\n          RestoreSegueBase();\n        }\n        if (num_results > 0) {\n          Write(\"return ret;\", Newline());\n        }\n        Write(CloseBrace(), Newline());\n\n        local_sym_map_.clear();\n        stack_var_sym_map_.clear();\n        func_ = nullptr;\n        break;\n      }\n\n      case ExternalKind::Global:\n        Write(OpenBrace());\n        Write(\"return \",\n              ExternalInstancePtr(ModuleFieldType::Global, internal_name), \";\",\n              Newline());\n        Write(CloseBrace(), Newline());\n        break;\n\n      case ExternalKind::Memory:\n        Write(OpenBrace());\n        Write(\"return \",\n              ExternalInstancePtr(ModuleFieldType::Memory, internal_name), \";\",\n              Newline());\n        Write(CloseBrace(), Newline());\n        break;\n\n      case ExternalKind::Table:\n        Write(OpenBrace());\n        Write(\"return \",\n              ExternalInstancePtr(ModuleFieldType::Table, internal_name), \";\",\n              Newline());\n        Write(CloseBrace(), Newline());\n        break;\n\n      case ExternalKind::Tag:\n        Write(\"= \", TagSymbol(internal_name), \";\", Newline());\n        break;\n\n      default:\n        WABT_UNREACHABLE;\n    }\n  }\n}\n\nvoid CWriter::WriteTailCallExports(CWriterPhase kind) {\n  for (const Export* export_ : module_->exports) {\n    if (export_->kind != ExternalKind::Func) {\n      continue;\n    }\n\n    const Func* func = module_->GetFunc(export_->var);\n\n    if (!IsImport(func->name) && !func->features_used.tailcall) {\n      continue;\n    }\n\n    const std::string mangled_name = TailCallExportName(export_->name);\n\n    Write(Newline(), \"/* export for tail-call of '\",\n          SanitizeForComment(export_->name), \"' */\", Newline());\n    if (kind == CWriterPhase::Declarations) {\n      WriteTailCallFuncDeclaration(mangled_name);\n      Write(\";\", Newline());\n    } else {\n      WriteTailCallFuncDeclaration(mangled_name);\n      Write(\" \", OpenBrace());\n      const Func* func = module_->GetFunc(export_->var);\n      Write(TailCallRef(func->name), \"(instance_ptr, tail_call_stack, next);\",\n            Newline(), CloseBrace(), Newline());\n    }\n  }\n}\n\nvoid CWriter::WriteInit() {\n  Write(Newline(), \"void \", kAdminSymbolPrefix, module_prefix_, \"_instantiate(\",\n        ModuleInstanceTypeName(), \"* instance\");\n  for (const auto& import_module_name : import_module_set_) {\n    Write(\", struct \", ModuleInstanceTypeName(import_module_name), \"* \",\n          GlobalName(ModuleFieldType::Import, import_module_name));\n  }\n  Write(\") \", OpenBrace());\n\n  Write(\"assert(wasm_rt_is_initialized());\", Newline());\n\n  if (!import_module_set_.empty()) {\n    Write(\"init_instance_import(instance\");\n    for (const auto& import_module_name : import_module_set_) {\n      Write(\", \", GlobalName(ModuleFieldType::Import, import_module_name));\n    }\n    Write(\");\", Newline());\n  }\n\n  if (!module_->globals.empty()) {\n    Write(\"init_globals(instance);\", Newline());\n  }\n  if (!module_->tables.empty()) {\n    Write(\"init_tables(instance);\", Newline());\n  }\n  if (!module_->memories.empty()) {\n    Write(\"init_memories(instance);\", Newline());\n    if (IsSingleUnsharedMemory()) {\n      InstallSegueBase(module_->memories[0], true /* save_old_value */);\n    }\n  }\n  if (!module_->tables.empty() && !module_->elem_segments.empty()) {\n    Write(\"init_elem_instances(instance);\", Newline());\n  }\n  if (!module_->memories.empty() && !module_->data_segments.empty()) {\n    Write(\"init_data_instances(instance);\", Newline());\n  }\n\n  for (Var* var : module_->starts) {\n    Write(ExternalRef(ModuleFieldType::Func, module_->GetFunc(*var)->name));\n    if (IsImport(module_->GetFunc(*var)->name)) {\n      Write(\"(instance->\",\n            GlobalName(ModuleFieldType::Import,\n                       import_module_sym_map_[module_->GetFunc(*var)->name]),\n            \");\");\n    } else {\n      Write(\"(instance);\");\n    }\n    Write(Newline());\n  }\n\n  if (IsSingleUnsharedMemory()) {\n    RestoreSegueBase();\n  }\n  Write(CloseBrace(), Newline());\n}\n\nvoid CWriter::WriteGetFuncType() {\n  Write(Newline(), \"wasm_rt_func_type_t \", kAdminSymbolPrefix, module_prefix_,\n        \"_get_func_type(uint32_t param_count, uint32_t result_count, \"\n        \"...) \",\n        OpenBrace());\n\n  Write(\"va_list args;\", Newline());\n\n  for (const TypeEntry* type : module_->types) {\n    const FuncType* func_type = cast<FuncType>(type);\n    const FuncSignature& signature = func_type->sig;\n\n    Write(Newline(), \"if (param_count == \", signature.GetNumParams(),\n          \" && result_count == \", signature.GetNumResults(), \") \", OpenBrace());\n    Write(\"va_start(args, result_count);\", Newline());\n    Write(\"if (true\");\n    for (const auto& t : signature.param_types) {\n      Write(\" && va_arg(args, int) == \", TypeEnum(t));\n    }\n    for (const auto& t : signature.result_types) {\n      Write(\" && va_arg(args, int) == \", TypeEnum(t));\n    }\n    Write(\") \", OpenBrace());\n    Write(\"va_end(args);\", Newline());\n    Write(\"return \", FuncTypeExpr(func_type), \";\", Newline());\n    Write(CloseBrace(), Newline());\n    Write(\"va_end(args);\", Newline());\n    Write(CloseBrace(), Newline());\n  }\n\n  Write(Newline(), \"return NULL;\", Newline());\n  Write(CloseBrace(), Newline());\n}\n\nvoid CWriter::WriteInitInstanceImport() {\n  if (import_module_set_.empty())\n    return;\n\n  Write(Newline(), \"static void init_instance_import(\",\n        ModuleInstanceTypeName(), \"* instance\");\n  for (const auto& import_module_name : import_module_set_) {\n    Write(\", struct \", ModuleInstanceTypeName(import_module_name), \"* \",\n          GlobalName(ModuleFieldType::Import, import_module_name));\n  }\n  Write(\") \", OpenBrace());\n\n  for (const auto& import_module : import_func_module_set_) {\n    Write(\"instance->\", GlobalName(ModuleFieldType::Import, import_module),\n          \" = \", GlobalName(ModuleFieldType::Import, import_module), \";\",\n          Newline());\n  }\n\n  for (const Import* import : unique_imports_) {\n    switch (import->kind()) {\n      case ExternalKind::Func:\n      case ExternalKind::Tag:\n        break;\n\n      case ExternalKind::Global:\n      case ExternalKind::Memory:\n      case ExternalKind::Table: {\n        Write(\"instance->\", ExportName(import->module_name, import->field_name),\n              \" = \", ExportName(import->module_name, import->field_name), \"(\",\n              GlobalName(ModuleFieldType::Import, import->module_name), \");\",\n              Newline());\n        break;\n      }\n\n      default:\n        WABT_UNREACHABLE;\n    }\n  }\n  Write(CloseBrace(), Newline());\n}\n\nvoid CWriter::WriteImportProperties(CWriterPhase kind) {\n  if (import_module_set_.empty())\n    return;\n\n  Write(Newline());\n\n  auto write_import_prop = [&](const Import* import, std::string prop,\n                               std::string type, uint64_t value) {\n    if (kind == CWriterPhase::Declarations) {\n      Write(\"extern \");\n    }\n    Write(\"const \", type, \" \", kAdminSymbolPrefix, module_prefix_, \"_\", prop,\n          \"_\", MangleModuleName(import->module_name), \"_\",\n          MangleName(import->field_name));\n    if (kind == CWriterPhase::Definitions) {\n      Write(\" = \", value);\n    }\n\n    Write(\";\", Newline());\n  };\n\n  for (const Import* import : unique_imports_) {\n    if (import->kind() == ExternalKind::Memory) {\n      const Limits* limits = &(cast<MemoryImport>(import)->memory.page_limits);\n      // We use u64 so we can handle both 32-bit and 64-bit memories\n      const uint64_t default_max = limits->is_64\n                                       ? (static_cast<uint64_t>(1) << 48)\n                                       : (static_cast<uint64_t>(1) << 16);\n      write_import_prop(import, \"min\", \"u64\", limits->initial);\n      write_import_prop(import, \"max\", \"u64\",\n                        limits->has_max ? limits->max : default_max);\n      write_import_prop(import, \"is64\", \"u8\", limits->is_64);\n      write_import_prop(import, \"pagesize\", \"u32\",\n                        cast<MemoryImport>(import)->memory.page_size);\n    } else if (import->kind() == ExternalKind::Table) {\n      const Limits* limits = &(cast<TableImport>(import)->table.elem_limits);\n      const uint64_t default_max = std::numeric_limits<uint32_t>::max();\n      write_import_prop(import, \"min\", \"u32\", limits->initial);\n      write_import_prop(import, \"max\", \"u32\",\n                        limits->has_max ? limits->max : default_max);\n    } else {\n      continue;\n    }\n  }\n}\n\nvoid CWriter::WriteFree() {\n  Write(Newline(), \"void \", kAdminSymbolPrefix, module_prefix_, \"_free(\",\n        ModuleInstanceTypeName(), \"* instance) \", OpenBrace());\n\n  {\n    Index table_index = 0;\n    for (const Table* table : module_->tables) {\n      bool is_import = table_index < module_->num_table_imports;\n      if (!is_import) {\n        Write(\"wasm_rt_free_\", GetReferenceTypeName(table->elem_type),\n              \"_table(\",\n              ExternalInstancePtr(ModuleFieldType::Table, table->name), \");\",\n              Newline());\n      }\n      ++table_index;\n    }\n  }\n\n  {\n    Index memory_index = 0;\n    for (const Memory* memory : module_->memories) {\n      bool is_import = memory_index < module_->num_memory_imports;\n      if (!is_import) {\n        std::string func = GetMemoryAPIString(*memory, \"wasm_rt_free_memory\");\n        Write(func, \"(\",\n              ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \");\",\n              Newline());\n      }\n      ++memory_index;\n    }\n  }\n\n  Write(CloseBrace(), Newline());\n}\n\nvoid CWriter::WriteFuncs() {\n  std::vector<size_t> c_stream_assignment =\n      name_to_output_file_index_(module_->funcs.begin(), module_->funcs.end(),\n                                 module_->num_func_imports, c_streams_.size());\n  Index func_index = 0;\n  for (const Func* func : module_->funcs) {\n    bool is_import = func_index < module_->num_func_imports;\n    if (!is_import) {\n      stream_ = c_streams_.at(c_stream_assignment.at(func_index));\n      Write(*func);\n      if (func->features_used.tailcall) {\n        WriteTailCallee(*func);\n      }\n    }\n    ++func_index;\n  }\n}\n\nvoid CWriter::PushFuncSection(std::string_view include_condition) {\n  func_sections_.emplace_back(include_condition, MemoryStream{});\n  stream_ = &func_sections_.back().second;\n}\n\nbool CWriter::IsImport(const std::string& name) const {\n  return import_module_sym_map_.count(name);\n}\n\ntemplate <typename sources>\nvoid CWriter::Spill(const TypeVector& types, const sources& src) {\n  assert(types.size() > 0);\n\n  if (types.size() == 1) {\n    Write(\"tmp = \", src(0), \";\", Newline());\n    return;\n  }\n\n  for (Index i = 0; i < types.size(); ++i) {\n    Writef(\"tmp.%c%d = \", MangleType(types.at(i)), i);\n    Write(src(i), \";\", Newline());\n  }\n}\n\nvoid CWriter::Spill(const TypeVector& types) {\n  Spill(types, [&](auto i) { return StackVar(types.size() - i - 1); });\n}\n\ntemplate <typename targets>\nvoid CWriter::Unspill(const TypeVector& types, const targets& tgt) {\n  assert(types.size() > 0);\n\n  if (types.size() == 1) {\n    Write(tgt(0), \" = tmp;\", Newline());\n    return;\n  }\n\n  for (Index i = 0; i < types.size(); ++i) {\n    Write(tgt(i));\n    Writef(\" = tmp.%c%d;\", MangleType(types.at(i)), i);\n    Write(Newline());\n  }\n}\n\nvoid CWriter::Unspill(const TypeVector& types) {\n  Unspill(types, [&](auto i) { return StackVar(types.size() - i - 1); });\n}\n\nvoid CWriter::WriteTailCallAsserts(const FuncSignature& sig) {\n  if (sig.param_types.size()) {\n    Write(\"static_assert(sizeof(\", sig.param_types, \") <= \", kTailCallStackSize,\n          \");\", Newline());\n  }\n  if (sig.result_types.size() && sig.result_types != sig.param_types) {\n    Write(\"static_assert(sizeof(\", sig.result_types,\n          \") <= \", kTailCallStackSize, \");\", Newline());\n  }\n}\n\nvoid CWriter::WriteTailCallStack() {\n  Write(\"void *instance_ptr_storage;\", Newline());\n  Write(\"void **instance_ptr = &instance_ptr_storage;\", Newline());\n  Write(\"char tail_call_stack[\", std::to_string(kTailCallStackSize), \"];\",\n        Newline());\n  Write(\"wasm_rt_tailcallee_t next_storage;\", Newline());\n  Write(\"wasm_rt_tailcallee_t *next = &next_storage;\", Newline());\n}\n\nvoid CWriter::WriteUnwindTryCatchStack(const Label* label) {\n  assert(try_catch_stack_.size() >= label->try_catch_stack_size);\n\n  if (try_catch_stack_.size() != label->try_catch_stack_size) {\n    const std::string& name =\n        try_catch_stack_.at(label->try_catch_stack_size).name;\n\n    Write(\"wasm_rt_set_unwind_target(\", name, \"_outer_target);\", Newline());\n  }\n}\n\nvoid CWriter::FinishReturnCall() {\n  if (in_tail_callee_) {\n    Write(CloseBrace(), Newline(), \"return;\", Newline());\n    return;\n  }\n\n  Write(\"while (next->fn) { next->fn(instance_ptr, tail_call_stack, next); }\",\n        Newline());\n  PushTypes(func_->decl.sig.result_types);\n  if (!func_->decl.sig.result_types.empty()) {\n    Write(OpenBrace(), func_->decl.sig.result_types, \" tmp;\", Newline(),\n          \"wasm_rt_memcpy(&tmp, tail_call_stack, sizeof(tmp));\", Newline());\n    Unspill(func_->decl.sig.result_types);\n    Write(CloseBrace(), Newline());\n  }\n\n  Write(CloseBrace(), Newline(), \"goto \", LabelName(kImplicitFuncLabel), \";\",\n        Newline());\n}\n\nvoid CWriter::BeginFunction(const Func& func) {\n  func_ = &func;\n  in_tail_callee_ = false;\n  local_syms_.clear();\n  local_sym_map_.clear();\n  stack_var_sym_map_.clear();\n  func_sections_.clear();\n  func_includes_.clear();\n\n  /*\n   * If offset of stream_ is 0, this is the first time some function is written\n   * to this stream, then write multi c top.\n   */\n  if (stream_->offset() == 0) {\n    WriteMultiCTop();\n  }\n  Write(Newline());\n}\n\nvoid CWriter::FinishFunction(size_t stack_var_section) {\n  for (size_t i = 0; i < func_sections_.size(); ++i) {\n    auto& [condition, stream] = func_sections_.at(i);\n    std::unique_ptr<OutputBuffer> buf = stream.ReleaseOutputBuffer();\n    if (condition.empty() || func_includes_.count(condition)) {\n      stream_->WriteData(buf->data.data(), buf->data.size());\n    }\n\n    if (i == stack_var_section) {\n      WriteStackVarDeclarations();  // these come immediately after section #0\n                                    // (return type/name/params/locals)\n    }\n  }\n\n  Write(CloseBrace(), Newline());\n\n  func_ = nullptr;\n}\n\nvoid CWriter::Write(const Func& func) {\n  Stream* prev_stream = stream_;\n  BeginFunction(func);\n  PushFuncSection();\n  Write(func.decl.sig.result_types, \" \",\n        GlobalName(ModuleFieldType::Func, func.name), \"(\");\n  WriteParamsAndLocals();\n  Write(\"FUNC_PROLOGUE;\", Newline());\n\n  size_t stack_vars_section = func_sections_.size() - 1;\n  PushFuncSection();\n\n  std::string label = DefineLabelName(kImplicitFuncLabel);\n  ResetTypeStack(0);\n  std::string empty;  // Must not be temporary, since address is taken by Label.\n  PushLabel(LabelType::Func, empty, func.decl.sig);\n  Write(func.exprs, LabelDecl(label));\n  PopLabel();\n  ResetTypeStack(0);\n  PushTypes(func.decl.sig.result_types);\n  Write(\"FUNC_EPILOGUE;\", Newline());\n\n  // Return the top of the stack implicitly.\n  Index num_results = func.GetNumResults();\n  if (num_results == 1) {\n    Write(\"return \", StackVar(0), \";\", Newline());\n  } else if (num_results >= 2) {\n    Write(OpenBrace(), func.decl.sig.result_types, \" tmp;\", Newline());\n    Spill(func.decl.sig.result_types);\n    Write(\"return tmp;\", Newline(), CloseBrace(), Newline());\n  }\n\n  stream_ = prev_stream;\n  FinishFunction(stack_vars_section);\n}\n\ntemplate <typename Vars, typename TypeOf, typename ToDo>\nvoid CWriter::WriteVarsByType(const Vars& vars,\n                              const TypeOf& typeoffunc,\n                              const ToDo& todo,\n                              bool setjmp_safe) {\n  for (Type type : {Type::I32, Type::I64, Type::F32, Type::F64, Type::V128,\n                    Type::FuncRef, Type::ExternRef, Type::ExnRef}) {\n    Index var_index = 0;\n    size_t count = 0;\n    for (const auto& var : vars) {\n      if (typeoffunc(var) == type) {\n        if (count == 0) {\n          Write(type, \" \");\n          if (setjmp_safe) {\n            PushFuncSection(\"exceptions\");\n            Write(\"volatile \");\n            PushFuncSection();\n          }\n          Indent(4);\n        } else {\n          Write(\", \");\n          if ((count % 8) == 0)\n            Write(Newline());\n        }\n\n        todo(var_index, var);\n        ++count;\n      }\n      ++var_index;\n    }\n    if (count != 0) {\n      Dedent(4);\n      Write(\";\", Newline());\n    }\n  }\n}\n\nvoid CWriter::WriteTailCallee(const Func& func) {\n  Stream* prev_stream = stream_;\n  BeginFunction(func);\n  in_tail_callee_ = true;\n  PushFuncSection();\n  WriteTailCallFuncDeclaration(GetTailCallRef(func.name));\n  Write(\" \", OpenBrace());\n  WriteTailCallAsserts(func.decl.sig);\n  Write(ModuleInstanceTypeName(), \"* instance = *instance_ptr;\", Newline());\n\n  std::vector<std::string> index_to_name;\n  MakeTypeBindingReverseMapping(func.GetNumParamsAndLocals(), func.bindings,\n                                &index_to_name);\n  if (func.GetNumParams()) {\n    WriteVarsByType(\n        func.decl.sig.param_types, [](auto x) { return x; },\n        [&](Index i, Type) { Write(DefineParamName(index_to_name[i])); }, true);\n    Write(OpenBrace(), func.decl.sig.param_types, \" tmp;\", Newline(),\n          \"wasm_rt_memcpy(&tmp, tail_call_stack, sizeof(tmp));\", Newline());\n    Unspill(func.decl.sig.param_types,\n            [&](auto i) { return ParamName(index_to_name[i]); });\n    Write(CloseBrace(), Newline());\n  }\n\n  size_t stack_vars_section = func_sections_.size() - 1;\n  WriteLocals(index_to_name);\n\n  PushFuncSection();\n\n  std::string label = DefineLabelName(kImplicitFuncLabel);\n  ResetTypeStack(0);\n  std::string empty;  // Must not be temporary, since address is taken by Label.\n  PushLabel(LabelType::Func, empty, func.decl.sig);\n  Write(func.exprs, LabelDecl(label));\n  PopLabel();\n  ResetTypeStack(0);\n  PushTypes(func.decl.sig.result_types);\n\n  // Return the top of the stack implicitly.\n  if (func.GetNumResults()) {\n    Write(OpenBrace(), func.decl.sig.result_types, \" tmp;\", Newline());\n    Spill(func.decl.sig.result_types);\n    Write(\"wasm_rt_memcpy(tail_call_stack, &tmp, sizeof(tmp));\", Newline());\n    Write(CloseBrace(), Newline());\n  }\n  Write(\"next->fn = NULL;\", Newline());\n\n  stream_ = prev_stream;\n  FinishFunction(stack_vars_section);\n}\n\nvoid CWriter::WriteParamsAndLocals() {\n  std::vector<std::string> index_to_name;\n  MakeTypeBindingReverseMapping(func_->GetNumParamsAndLocals(), func_->bindings,\n                                &index_to_name);\n  WriteParams(index_to_name, true);\n  Write(\" \", OpenBrace());\n  WriteLocals(index_to_name);\n}\n\nvoid CWriter::WriteParams(const std::vector<std::string>& index_to_name,\n                          bool setjmp_safe) {\n  Write(ModuleInstanceTypeName(), \"* instance\");\n  if (func_->GetNumParams() != 0) {\n    Indent(4);\n    for (Index i = 0; i < func_->GetNumParams(); ++i) {\n      Write(\", \");\n      if (i != 0 && (i % 8) == 0) {\n        Write(Newline());\n      }\n      Write(func_->GetParamType(i), \" \");\n      if (setjmp_safe) {\n        PushFuncSection(\"exceptions\");\n        Write(\"volatile \");\n        PushFuncSection();\n      }\n      Write(DefineParamName(index_to_name[i]));\n    }\n    Dedent(4);\n  }\n  Write(\")\");\n}\n\nvoid CWriter::WriteParamSymbols(const std::vector<std::string>& index_to_name) {\n  if (func_->GetNumParams() != 0) {\n    Indent(4);\n    for (Index i = 0; i < func_->GetNumParams(); ++i) {\n      Write(\", \");\n      if (i != 0 && (i % 8) == 0) {\n        Write(Newline());\n      }\n      Write(ParamName(index_to_name[i]));\n    }\n    Dedent(4);\n  }\n  Write(\");\", Newline());\n}\n\nvoid CWriter::WriteParamTypes(const FuncDeclaration& decl) {\n  if (decl.GetNumParams() != 0) {\n    for (Index i = 0; i < decl.GetNumParams(); ++i) {\n      Write(\", \");\n      Write(decl.GetParamType(i));\n    }\n  }\n}\n\nvoid CWriter::WriteLocals(const std::vector<std::string>& index_to_name) {\n  Index num_params = func_->GetNumParams();\n  WriteVarsByType(\n      func_->local_types, [](auto x) { return x; },\n      [&](Index local_index, Type local_type) {\n        Write(DefineParamName(index_to_name[num_params + local_index]), \" = \");\n        if (local_type.IsRef()) {\n          Write(GetReferenceNullValue(local_type));\n        } else if (local_type == Type::V128) {\n          Write(\"simde_wasm_i64x2_make(0, 0)\");\n        } else {\n          Write(\"0\");\n        }\n      },\n      true);\n}\n\nvoid CWriter::WriteStackVarDeclarations() {\n  // NOTE: setjmp_safe must be false, can't push func sections in here because\n  // this is called from FinishFunction.\n  // (luckily, we don't need setjmp_safe for these.)\n  WriteVarsByType(\n      stack_var_sym_map_, [](auto stp_name) { return stp_name.first.second; },\n      [&](Index, auto& stp_name) { Write(stp_name.second); }, false);\n}\n\nvoid CWriter::Write(const Block& block) {\n  std::string label = DefineLabelName(block.label);\n  DropTypes(block.decl.GetNumParams());\n  size_t mark = MarkTypeStack();\n  PushLabel(LabelType::Block, block.label, block.decl.sig);\n  PushTypes(block.decl.sig.param_types);\n  Write(block.exprs, LabelDecl(label));\n  ResetTypeStack(mark);\n  PopLabel();\n  PushTypes(block.decl.sig.result_types);\n}\n\nsize_t CWriter::BeginTry(const Block& block) {\n  func_includes_.insert(\"exceptions\");\n  Write(OpenBrace()); /* beginning of try-catch or try_table */\n  const std::string tlabel = DefineLabelName(block.label);\n  Write(\"WASM_RT_UNWIND_TARGET *\", tlabel,\n        \"_outer_target = wasm_rt_get_unwind_target();\", Newline());\n  Write(\"WASM_RT_UNWIND_TARGET \", tlabel, \"_unwind_target;\", Newline());\n  Write(\"if (!wasm_rt_try(\", tlabel, \"_unwind_target)) \");\n  Write(OpenBrace()); /* beginning of try or try_table block */\n  DropTypes(block.decl.GetNumParams());\n  const size_t mark = MarkTypeStack();\n  PushLabel(LabelType::Try, block.label, block.decl.sig);\n  PushTypes(block.decl.sig.param_types);\n  Write(\"wasm_rt_set_unwind_target(&\", tlabel, \"_unwind_target);\", Newline());\n  PushTryCatch(tlabel);\n  Write(block.exprs);\n  ResetTypeStack(mark);\n  Write(\"wasm_rt_set_unwind_target(\", tlabel, \"_outer_target);\", Newline());\n  Write(CloseBrace());          /* end of try or try_table block */\n  Write(\" else \", OpenBrace()); /* beginning of catch blocks or delegate */\n  assert(label_stack_.back().name == block.label);\n  assert(label_stack_.back().label_type == LabelType::Try);\n  label_stack_.back().label_type = LabelType::Catch;\n  if (try_catch_stack_.back().used) {\n    Write(tlabel, \"_catch:;\", Newline());\n  }\n\n  return mark;\n}\n\nvoid CWriter::WriteTryCatch(const TryExpr& tryexpr) {\n  const size_t mark = BeginTry(tryexpr.block);\n\n  /* exception has been thrown -- do we catch it? */\n\n  const LabelName tlabel = LabelName(tryexpr.block.label);\n\n  Write(\"wasm_rt_set_unwind_target(\", tlabel, \"_outer_target);\", Newline());\n  PopTryCatch();\n\n  /* save the thrown exception to the stack if it might be rethrown later */\n  PushFuncSection(tryexpr.block.label);\n  Write(\"/* save exception \", tlabel, \" for rethrow */\", Newline());\n  Write(\"const wasm_rt_tag_t \", tlabel, \"_tag = wasm_rt_exception_tag();\",\n        Newline());\n  Write(\"uint32_t \", tlabel, \"_size = wasm_rt_exception_size();\", Newline());\n  Write(\"void *\", tlabel, \" = alloca(\", tlabel, \"_size);\", Newline());\n  Write(\"wasm_rt_memcpy(\", tlabel, \", wasm_rt_exception(), \", tlabel, \"_size);\",\n        Newline());\n  PushFuncSection();\n\n  assert(!tryexpr.catches.empty());\n  bool has_catch_all{};\n  for (auto it = tryexpr.catches.cbegin(); it != tryexpr.catches.cend(); ++it) {\n    if (it == tryexpr.catches.cbegin()) {\n      Write(Newline());\n    } else {\n      Write(\" else \");\n    }\n    ResetTypeStack(mark);\n    Write(*it);\n    if (it->IsCatchAll()) {\n      has_catch_all = true;\n      break;\n    }\n  }\n  if (!has_catch_all) {\n    /* if not caught, rethrow */\n    Write(\" else \", OpenBrace());\n    WriteThrow();\n    Write(CloseBrace(), Newline());\n  }\n  Write(CloseBrace(), Newline()); /* end of catch blocks */\n  Write(CloseBrace(), Newline()); /* end of try-catch */\n\n  ResetTypeStack(mark);\n  assert(!label_stack_.empty());\n  assert(label_stack_.back().name == tryexpr.block.label);\n  Write(LabelDecl(GetLocalName(tryexpr.block.label, true)));\n  PopLabel();\n  PushTypes(tryexpr.block.decl.sig.result_types);\n}\n\nvoid CWriter::Write(const Catch& c) {\n  if (c.IsCatchAll()) {\n    Write(c.exprs);\n    return;\n  }\n\n  Write(\"if (wasm_rt_exception_tag() == \",\n        TagSymbol(module_->GetTag(c.var)->name), \") \", OpenBrace());\n\n  const Tag* tag = module_->GetTag(c.var);\n  const FuncDeclaration& tag_type = tag->decl;\n  const Index num_params = tag_type.GetNumParams();\n  PushTypes(tag_type.sig.param_types);\n  if (num_params == 1) {\n    Write(\"wasm_rt_memcpy(&\", StackVar(0), \", wasm_rt_exception(), sizeof(\",\n          tag_type.GetParamType(0), \"));\", Newline());\n  } else if (num_params > 1) {\n    Write(OpenBrace(), tag_type.sig.param_types, \" tmp;\", Newline());\n    Write(\"wasm_rt_memcpy(&tmp, wasm_rt_exception(), sizeof(tmp));\", Newline());\n    Unspill(tag_type.sig.param_types);\n    Write(CloseBrace(), Newline());\n  }\n\n  Write(c.exprs);\n  Write(CloseBrace());\n}\n\nvoid CWriter::WriteThrow() {\n  if (try_catch_stack_.empty()) {\n    Write(\"wasm_rt_throw();\", Newline());\n  } else {\n    Write(\"goto \", try_catch_stack_.back().name, \"_catch;\", Newline());\n    try_catch_stack_.back().used = true;\n  }\n}\n\nvoid CWriter::PushTryCatch(const std::string& name) {\n  try_catch_stack_.emplace_back(name, try_catch_stack_.size());\n}\n\nvoid CWriter::PopTryCatch() {\n  assert(!try_catch_stack_.empty());\n  try_catch_stack_.pop_back();\n}\n\nvoid CWriter::WriteTryDelegate(const TryExpr& tryexpr) {\n  const size_t mark = BeginTry(tryexpr.block);\n\n  /* exception has been thrown -- where do we delegate it? */\n\n  if (tryexpr.delegate_target.is_index()) {\n    /* must be the implicit function label */\n    assert(!try_catch_stack_.empty());\n    const std::string& unwind_name = try_catch_stack_.at(0).name;\n    Write(\"wasm_rt_set_unwind_target(\", unwind_name, \"_outer_target);\",\n          Newline());\n\n    Write(\"wasm_rt_throw();\", Newline());\n  } else {\n    const Label* label = FindLabel(tryexpr.delegate_target, false);\n\n    assert(try_catch_stack_.size() >= label->try_catch_stack_size);\n\n    if (label->label_type == LabelType::Try) {\n      Write(\"goto \", LabelName(label->name), \"_catch;\", Newline());\n      try_catch_stack_.at(label->try_catch_stack_size).used = true;\n    } else if (label->try_catch_stack_size == 0) {\n      assert(!try_catch_stack_.empty());\n      const std::string& unwind_name = try_catch_stack_.at(0).name;\n      Write(\"wasm_rt_set_unwind_target(\", unwind_name, \"_outer_target);\",\n            Newline());\n\n      Write(\"wasm_rt_throw();\", Newline());\n    } else {\n      const std::string label_target =\n          try_catch_stack_.at(label->try_catch_stack_size - 1).name + \"_catch\";\n      Write(\"goto \", label_target, \";\", Newline());\n      try_catch_stack_.at(label->try_catch_stack_size - 1).used = true;\n    }\n  }\n\n  Write(CloseBrace(), Newline());\n  Write(CloseBrace(), Newline());\n\n  PopTryCatch();\n  ResetTypeStack(mark);\n  assert(!label_stack_.empty());\n  assert(label_stack_.back().name == tryexpr.block.label);\n  Write(LabelDecl(GetLocalName(tryexpr.block.label, true)));\n  PopLabel();\n  PushTypes(tryexpr.block.decl.sig.result_types);\n}\n\nvoid CWriter::Write(const TryTableExpr& try_table_expr) {\n  const size_t mark = BeginTry(try_table_expr.block);\n\n  /* exception has been thrown -- do we catch it? */\n\n  const LabelName tlabel = LabelName(try_table_expr.block.label);\n\n  Write(\"wasm_rt_set_unwind_target(\", tlabel, \"_outer_target);\", Newline());\n  PopTryCatch();\n\n  ResetTypeStack(mark);\n  assert(!label_stack_.empty());\n  assert(label_stack_.back().name == try_table_expr.block.label);\n  Write(LabelDecl(GetLocalName(try_table_expr.block.label, true)));\n  PopLabel();\n\n  assert(!try_table_expr.catches.empty());\n  bool has_catch_all{};\n  for (auto it = try_table_expr.catches.cbegin();\n       it != try_table_expr.catches.cend(); ++it) {\n    if (it == try_table_expr.catches.cbegin()) {\n      Write(Newline());\n    } else {\n      Write(\" else \");\n    }\n    ResetTypeStack(mark);\n    Write(*it);\n    if (it->IsCatchAll()) {\n      has_catch_all = true;\n      break;\n    }\n  }\n  if (!has_catch_all) {\n    /* if not caught, rethrow */\n    Write(\" else \", OpenBrace());\n    WriteThrow();\n    Write(CloseBrace(), Newline());\n  }\n  Write(CloseBrace(), Newline()); /* end of catch blocks */\n  Write(CloseBrace(), Newline()); /* end of try-catch */\n\n  ResetTypeStack(mark);\n  PushTypes(try_table_expr.block.decl.sig.result_types);\n}\n\nvoid CWriter::Write(const TableCatch& c) {\n  if (!c.IsCatchAll()) {\n    Write(\"if (wasm_rt_exception_tag() == \",\n          TagSymbol(module_->GetTag(c.tag)->name), \") \", OpenBrace());\n\n    const Tag* tag = module_->GetTag(c.tag);\n    const FuncDeclaration& tag_type = tag->decl;\n    const Index num_params = tag_type.GetNumParams();\n    PushTypes(tag_type.sig.param_types);\n    if (num_params == 1) {\n      Write(\"wasm_rt_memcpy(&\", StackVar(0), \", wasm_rt_exception(), sizeof(\",\n            tag_type.GetParamType(0), \"));\", Newline());\n    } else if (num_params > 1) {\n      Write(OpenBrace(), tag_type.sig.param_types, \" tmp;\", Newline());\n      Write(\"wasm_rt_memcpy(&tmp, wasm_rt_exception(), sizeof(tmp));\",\n            Newline());\n      Unspill(tag_type.sig.param_types);\n      Write(CloseBrace(), Newline());\n    }\n  }\n  if (c.IsRef()) {\n    PushType(Type::ExnRef);\n    Write(StackVar(0), \".tag = wasm_rt_exception_tag();\", Newline());\n    Write(StackVar(0), \".size = wasm_rt_exception_size();\", Newline());\n    Write(\"wasm_rt_memcpy(&\", StackVar(0),\n          \".data, wasm_rt_exception(), wasm_rt_exception_size());\", Newline());\n  }\n\n  Write(GotoLabel(c.target), Newline());\n  if (!c.IsCatchAll()) {\n    Write(CloseBrace());\n  }\n}\n\nvoid CWriter::Write(const ExprList& exprs) {\n  for (const Expr& expr : exprs) {\n    switch (expr.type()) {\n      case ExprType::Binary:\n        Write(*cast<BinaryExpr>(&expr));\n        break;\n\n      case ExprType::Block:\n        Write(cast<BlockExpr>(&expr)->block);\n        break;\n\n      case ExprType::Br:\n        Write(GotoLabel(cast<BrExpr>(&expr)->var), Newline());\n        // Stop processing this ExprList, since the following are unreachable.\n        return;\n\n      case ExprType::BrIf:\n        Write(\"if (\", StackVar(0), \") {\");\n        DropTypes(1);\n        Write(GotoLabel(cast<BrIfExpr>(&expr)->var), \"}\", Newline());\n        break;\n\n      case ExprType::BrOnNonNull:\n        Write(\"if (\", StackVar(0), \".func != NULL) {\");\n        Write(GotoLabel(cast<BrOnNonNullExpr>(&expr)->var), \"}\", Newline());\n        DropTypes(1);\n        break;\n\n      case ExprType::BrOnNull: {\n        Write(\"if (\", StackVar(0), \".func == NULL) {\");\n        Type type = StackType(0);\n        DropTypes(1);\n        Write(GotoLabel(cast<BrOnNullExpr>(&expr)->var), \"}\", Newline());\n        PushType(type);\n        break;\n      }\n\n      case ExprType::BrTable: {\n        const auto* bt_expr = cast<BrTableExpr>(&expr);\n        Write(\"switch (\", StackVar(0), \") \", OpenBrace());\n        DropTypes(1);\n        Index i = 0;\n        for (const Var& var : bt_expr->targets) {\n          Write(\"case \", i++, \": \", GotoLabel(var), Newline());\n        }\n        Write(\"default: \");\n        Write(GotoLabel(bt_expr->default_target), Newline(), CloseBrace(),\n              Newline());\n        // Stop processing this ExprList, since the following are unreachable.\n        return;\n      }\n\n      case ExprType::Call: {\n        const Var& var = cast<CallExpr>(&expr)->var;\n        const Func& func = *module_->GetFunc(var);\n        Index num_params = func.GetNumParams();\n        Index num_results = func.GetNumResults();\n        assert(type_stack_.size() >= num_params);\n        if (num_results > 1) {\n          Write(OpenBrace(), func.decl.sig.result_types, \" tmp = \");\n        } else if (num_results == 1) {\n          Write(StackVar(num_params - 1, func.GetResultType(0)), \" = \");\n        }\n\n        assert(var.is_name());\n        Write(ExternalRef(ModuleFieldType::Func, var.name()), \"(\");\n        if (IsImport(func.name)) {\n          Write(\"instance->\", GlobalName(ModuleFieldType::Import,\n                                         import_module_sym_map_[func.name]));\n        } else {\n          Write(\"instance\");\n        }\n        for (Index i = 0; i < num_params; ++i) {\n          Write(\", \");\n          Write(StackVar(num_params - i - 1));\n        }\n        Write(\");\", Newline());\n        DropTypes(num_params);\n        PushTypes(func.decl.sig.result_types);\n        if (num_results > 1) {\n          Unspill(func.decl.sig.result_types);\n          Write(CloseBrace(), Newline());\n        }\n        break;\n      }\n\n      case ExprType::CallIndirect: {\n        const FuncDeclaration& decl = cast<CallIndirectExpr>(&expr)->decl;\n        Index num_params = decl.GetNumParams();\n        Index num_results = decl.GetNumResults();\n        assert(type_stack_.size() > num_params);\n        if (num_results > 1) {\n          Write(OpenBrace(), decl.sig.result_types, \" tmp = \");\n        } else if (num_results == 1) {\n          Write(StackVar(num_params, decl.GetResultType(0)), \" = \");\n        }\n\n        const Table* table =\n            module_->GetTable(cast<CallIndirectExpr>(&expr)->table);\n\n        assert(decl.has_func_type);\n        const FuncType* func_type = module_->GetFuncType(decl.type_var);\n\n        Write(\"CALL_INDIRECT(\",\n              ExternalInstanceRef(ModuleFieldType::Table, table->name), \", \");\n        WriteCallIndirectFuncDeclaration(decl, \"(*)\");\n        Write(\", \", FuncTypeExpr(func_type), \", \", StackVar(0));\n        Write(\", \", ExternalInstanceRef(ModuleFieldType::Table, table->name),\n              \".data[\", StackVar(0), \"].module_instance\");\n        for (Index i = 0; i < num_params; ++i) {\n          Write(\", \", StackVar(num_params - i));\n        }\n        Write(\");\", Newline());\n        if (IsSingleUnsharedMemory()) {\n          InstallSegueBase(module_->memories[0], false /* save_old_value */);\n        }\n        DropTypes(num_params + 1);\n        PushTypes(decl.sig.result_types);\n        if (num_results > 1) {\n          Unspill(decl.sig.result_types);\n          Write(CloseBrace(), Newline());\n        }\n        break;\n      }\n\n      case ExprType::CodeMetadata:\n        break;\n\n      case ExprType::Compare:\n        Write(*cast<CompareExpr>(&expr));\n        break;\n\n      case ExprType::Const: {\n        const Const& const_ = cast<ConstExpr>(&expr)->const_;\n        PushType(const_.type());\n        Write(StackVar(0), \" = \", const_, \";\", Newline());\n        break;\n      }\n\n      case ExprType::Convert:\n        Write(*cast<ConvertExpr>(&expr));\n        break;\n\n      case ExprType::Drop:\n        DropTypes(1);\n        break;\n\n      case ExprType::GlobalGet: {\n        const Var& var = cast<GlobalGetExpr>(&expr)->var;\n        PushType(module_->GetGlobal(var)->type);\n        Write(StackVar(0), \" = \", GlobalInstanceVar(var), \";\", Newline());\n        break;\n      }\n\n      case ExprType::GlobalSet: {\n        const Var& var = cast<GlobalSetExpr>(&expr)->var;\n        Write(GlobalInstanceVar(var), \" = \", StackVar(0), \";\", Newline());\n        DropTypes(1);\n        break;\n      }\n\n      case ExprType::If: {\n        const IfExpr& if_ = *cast<IfExpr>(&expr);\n        Write(\"if (\", StackVar(0), \") \", OpenBrace());\n        DropTypes(1);\n        std::string label = DefineLabelName(if_.true_.label);\n        DropTypes(if_.true_.decl.GetNumParams());\n        size_t mark = MarkTypeStack();\n        PushLabel(LabelType::If, if_.true_.label, if_.true_.decl.sig);\n        PushTypes(if_.true_.decl.sig.param_types);\n        Write(if_.true_.exprs, CloseBrace());\n        if (!if_.false_.empty()) {\n          ResetTypeStack(mark);\n          PushTypes(if_.true_.decl.sig.param_types);\n          Write(\" else \", OpenBrace(), if_.false_, CloseBrace());\n        }\n        ResetTypeStack(mark);\n        Write(Newline(), LabelDecl(label));\n        PopLabel();\n        PushTypes(if_.true_.decl.sig.result_types);\n        break;\n      }\n\n      case ExprType::Load:\n        Write(*cast<LoadExpr>(&expr));\n        break;\n\n      case ExprType::LocalGet: {\n        const Var& var = cast<LocalGetExpr>(&expr)->var;\n        PushType(func_->GetLocalType(var));\n        Write(StackVar(0), \" = \", var, \";\", Newline());\n        break;\n      }\n\n      case ExprType::LocalSet: {\n        const Var& var = cast<LocalSetExpr>(&expr)->var;\n        Write(var, \" = \", StackVar(0), \";\", Newline());\n        DropTypes(1);\n        break;\n      }\n\n      case ExprType::LocalTee: {\n        const Var& var = cast<LocalTeeExpr>(&expr)->var;\n        Write(var, \" = \", StackVar(0), \";\", Newline());\n        break;\n      }\n\n      case ExprType::Loop: {\n        const Block& block = cast<LoopExpr>(&expr)->block;\n        if (!block.exprs.empty()) {\n          Write(DefineLabelName(block.label), \": \");\n          Indent();\n          DropTypes(block.decl.GetNumParams());\n          size_t mark = MarkTypeStack();\n          PushLabel(LabelType::Loop, block.label, block.decl.sig);\n          PushTypes(block.decl.sig.param_types);\n          Write(Newline(), block.exprs);\n          ResetTypeStack(mark);\n          PopLabel();\n          PushTypes(block.decl.sig.result_types);\n          Dedent();\n        }\n        break;\n      }\n\n      case ExprType::MemoryFill: {\n        const auto inst = cast<MemoryFillExpr>(&expr);\n        Memory* memory =\n            module_->memories[module_->GetMemoryIndex(inst->memidx)];\n        Write(\"memory_fill(\",\n              ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", \",\n              StackVar(2), \", \", StackVar(1), \", \", StackVar(0), \");\",\n              Newline());\n        DropTypes(3);\n      } break;\n\n      case ExprType::MemoryCopy: {\n        const auto inst = cast<MemoryCopyExpr>(&expr);\n        Memory* dest_memory =\n            module_->memories[module_->GetMemoryIndex(inst->destmemidx)];\n        const Memory* src_memory = module_->GetMemory(inst->srcmemidx);\n        Write(\"memory_copy(\",\n              ExternalInstancePtr(ModuleFieldType::Memory, dest_memory->name),\n              \", \",\n              ExternalInstancePtr(ModuleFieldType::Memory, src_memory->name),\n              \", \", StackVar(2), \", \", StackVar(1), \", \", StackVar(0), \");\",\n              Newline());\n        DropTypes(3);\n      } break;\n\n      case ExprType::MemoryInit: {\n        const auto inst = cast<MemoryInitExpr>(&expr);\n        Memory* dest_memory =\n            module_->memories[module_->GetMemoryIndex(inst->memidx)];\n        const DataSegment* src_data = module_->GetDataSegment(inst->var);\n        Write(\"memory_init(\",\n              ExternalInstancePtr(ModuleFieldType::Memory, dest_memory->name),\n              \", \");\n        if (src_data->data.empty()) {\n          Write(\"NULL, 0\");\n        } else {\n          Write(\"data_segment_data_\",\n                GlobalName(ModuleFieldType::DataSegment, src_data->name), \", \");\n          if (is_droppable(src_data)) {\n            Write(\"(\", \"instance->data_segment_dropped_\",\n                  GlobalName(ModuleFieldType::DataSegment, src_data->name),\n                  \" ? 0 : \", src_data->data.size(), \")\");\n          } else {\n            Write(\"0\");\n          }\n        }\n\n        Write(\", \", StackVar(2), \", \", StackVar(1), \", \", StackVar(0), \");\",\n              Newline());\n        DropTypes(3);\n      } break;\n\n      case ExprType::TableInit: {\n        const auto inst = cast<TableInitExpr>(&expr);\n        Table* dest_table =\n            module_->tables[module_->GetTableIndex(inst->table_index)];\n        const ElemSegment* src_segment =\n            module_->GetElemSegment(inst->segment_index);\n\n        WriteElemTableInit(false, src_segment, dest_table);\n        DropTypes(3);\n      } break;\n\n      case ExprType::DataDrop: {\n        const auto inst = cast<DataDropExpr>(&expr);\n        const DataSegment* data = module_->GetDataSegment(inst->var);\n        if (is_droppable(data)) {\n          Write(\"instance->data_segment_dropped_\",\n                GlobalName(ModuleFieldType::DataSegment, data->name),\n                \" = true;\", Newline());\n        }\n      } break;\n\n      case ExprType::ElemDrop: {\n        const auto inst = cast<ElemDropExpr>(&expr);\n        const ElemSegment* seg = module_->GetElemSegment(inst->var);\n        if (is_droppable(seg)) {\n          Write(\"instance->elem_segment_dropped_\",\n                GlobalName(ModuleFieldType::ElemSegment, seg->name), \" = true;\",\n                Newline());\n        }\n      } break;\n\n      case ExprType::TableCopy: {\n        const auto inst = cast<TableCopyExpr>(&expr);\n        Table* dest_table =\n            module_->tables[module_->GetTableIndex(inst->dst_table)];\n        const Table* src_table = module_->GetTable(inst->src_table);\n        if (dest_table->elem_type != src_table->elem_type) {\n          WABT_UNREACHABLE;\n        }\n\n        Write(\n            GetReferenceTypeName(dest_table->elem_type), \"_table_copy(\",\n            ExternalInstancePtr(ModuleFieldType::Table, dest_table->name), \", \",\n            ExternalInstancePtr(ModuleFieldType::Table, src_table->name), \", \",\n            StackVar(2), \", \", StackVar(1), \", \", StackVar(0), \");\", Newline());\n        DropTypes(3);\n      } break;\n\n      case ExprType::TableGet: {\n        const Table* table = module_->GetTable(cast<TableGetExpr>(&expr)->var);\n        Write(StackVar(0, table->elem_type), \" = \",\n              GetReferenceTypeName(table->elem_type), \"_table_get(\",\n              ExternalInstancePtr(ModuleFieldType::Table, table->name), \", \",\n              StackVar(0), \");\", Newline());\n        DropTypes(1);\n        PushType(table->elem_type);\n      } break;\n\n      case ExprType::TableSet: {\n        const Table* table = module_->GetTable(cast<TableSetExpr>(&expr)->var);\n        Write(GetReferenceTypeName(table->elem_type), \"_table_set(\",\n              ExternalInstancePtr(ModuleFieldType::Table, table->name), \", \",\n              StackVar(1), \", \", StackVar(0), \");\", Newline());\n        DropTypes(2);\n      } break;\n\n      case ExprType::TableGrow: {\n        const Table* table = module_->GetTable(cast<TableGrowExpr>(&expr)->var);\n        Write(StackVar(1, table->elem_limits.IndexType()), \" = wasm_rt_grow_\",\n              GetReferenceTypeName(table->elem_type), \"_table(\",\n              ExternalInstancePtr(ModuleFieldType::Table, table->name), \", \",\n              StackVar(0), \", \", StackVar(1), \");\", Newline());\n        DropTypes(2);\n        PushType(table->elem_limits.IndexType());\n      } break;\n\n      case ExprType::TableSize: {\n        const Table* table = module_->GetTable(cast<TableSizeExpr>(&expr)->var);\n\n        PushType(table->elem_limits.IndexType());\n        Write(StackVar(0), \" = \",\n              ExternalInstanceRef(ModuleFieldType::Table, table->name),\n              \".size;\", Newline());\n      } break;\n\n      case ExprType::TableFill: {\n        const Table* table = module_->GetTable(cast<TableFillExpr>(&expr)->var);\n        Write(GetReferenceTypeName(table->elem_type), \"_table_fill(\",\n              ExternalInstancePtr(ModuleFieldType::Table, table->name), \", \",\n              StackVar(2), \", \", StackVar(1), \", \", StackVar(0), \");\",\n              Newline());\n        DropTypes(3);\n      } break;\n\n      case ExprType::RefAsNonNull:\n        Write(\"if (\", StackVar(0), \".func == NULL) { TRAP(NULL_REF); }\");\n        break;\n\n      case ExprType::RefFunc: {\n        const Func* func = module_->GetFunc(cast<RefFuncExpr>(&expr)->var);\n        PushType(Type::FuncRef);\n        const FuncDeclaration& decl = func->decl;\n\n        assert(decl.has_func_type);\n        const FuncType* func_type = module_->GetFuncType(decl.type_var);\n\n        Write(StackVar(0), \" = (wasm_rt_funcref_t){\", FuncTypeExpr(func_type),\n              \", (wasm_rt_function_ptr_t)\", WrapperRef(func->name), \", {\");\n        if (options_.features.tail_call_enabled() &&\n            (IsImport(func->name) || func->features_used.tailcall)) {\n          Write(TailCallRef(func->name));\n        } else {\n          Write(\"NULL\");\n        }\n        Write(\"}, \");\n\n        if (IsImport(func->name)) {\n          Write(\"instance->\", GlobalName(ModuleFieldType::Import,\n                                         import_module_sym_map_[func->name]));\n        } else {\n          Write(\"instance\");\n        }\n\n        Write(\"};\", Newline());\n      } break;\n\n      case ExprType::RefNull:\n        PushType(cast<RefNullExpr>(&expr)->type.opt_type());\n        Write(StackVar(0), \" = \",\n              GetReferenceNullValue(cast<RefNullExpr>(&expr)->type.opt_type()),\n              \";\", Newline());\n        break;\n\n      case ExprType::RefIsNull:\n        switch (StackType(0)) {\n          case Type::FuncRef:\n            Write(StackVar(0, Type::I32), \" = (\", StackVar(0), \".func == NULL\",\n                  \");\", Newline());\n            break;\n          case Type::ExternRef:\n            Write(StackVar(0, Type::I32), \" = (\", StackVar(0),\n                  \" == \", GetReferenceNullValue(Type::ExternRef), \");\",\n                  Newline());\n            break;\n          case Type::ExnRef:\n            Write(StackVar(0, Type::I32), \" = (\", StackVar(0), \".tag == NULL\",\n                  \");\", Newline());\n            break;\n          default:\n            WABT_UNREACHABLE;\n        }\n\n        DropTypes(1);\n        PushType(Type::I32);\n        break;\n\n      case ExprType::MemoryGrow: {\n        Memory* memory = module_->memories[module_->GetMemoryIndex(\n            cast<MemoryGrowExpr>(&expr)->memidx)];\n\n        std::string func = GetMemoryAPIString(*memory, \"wasm_rt_grow_memory\");\n        Write(StackVar(0), \" = \", func, \"(\",\n              ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", \",\n              StackVar(0), \");\", Newline());\n        if (IsSingleUnsharedMemory()) {\n          InstallSegueBase(module_->memories[0], false /* save_old_value */);\n        }\n        break;\n      }\n\n      case ExprType::MemorySize: {\n        Memory* memory = module_->memories[module_->GetMemoryIndex(\n            cast<MemorySizeExpr>(&expr)->memidx)];\n\n        PushType(memory->page_limits.IndexType());\n        Write(StackVar(0), \" = \",\n              ExternalInstanceRef(ModuleFieldType::Memory, memory->name),\n              \".pages;\", Newline());\n        break;\n      }\n\n      case ExprType::Nop:\n        break;\n\n      case ExprType::Return:\n        // Goto the function label instead; this way we can do shared function\n        // cleanup code in one place.\n        Write(GotoLabel(Var(label_stack_.size() - 1, {})), Newline());\n        // Stop processing this ExprList, since the following are unreachable.\n        return;\n\n      case ExprType::Select: {\n        Type type = StackType(1);\n        Write(StackVar(2), \" = \", StackVar(0), \" ? \", StackVar(2), \" : \",\n              StackVar(1), \";\", Newline());\n        DropTypes(3);\n        PushType(type);\n        break;\n      }\n\n      case ExprType::Store:\n        Write(*cast<StoreExpr>(&expr));\n        break;\n\n      case ExprType::Unary:\n        Write(*cast<UnaryExpr>(&expr));\n        break;\n\n      case ExprType::Ternary:\n        Write(*cast<TernaryExpr>(&expr));\n        break;\n\n      case ExprType::SimdLaneOp: {\n        Write(*cast<SimdLaneOpExpr>(&expr));\n        break;\n      }\n\n      case ExprType::SimdLoadLane: {\n        Write(*cast<SimdLoadLaneExpr>(&expr));\n        break;\n      }\n\n      case ExprType::SimdStoreLane: {\n        Write(*cast<SimdStoreLaneExpr>(&expr));\n        break;\n      }\n\n      case ExprType::SimdShuffleOp: {\n        Write(*cast<SimdShuffleOpExpr>(&expr));\n        break;\n      }\n\n      case ExprType::LoadSplat:\n        Write(*cast<LoadSplatExpr>(&expr));\n        break;\n\n      case ExprType::LoadZero:\n        Write(*cast<LoadZeroExpr>(&expr));\n        break;\n\n      case ExprType::Unreachable:\n        Write(\"UNREACHABLE;\", Newline());\n        return;\n\n      case ExprType::Throw: {\n        const Var& var = cast<ThrowExpr>(&expr)->var;\n        const Tag* tag = module_->GetTag(var);\n\n        Index num_params = tag->decl.GetNumParams();\n        if (num_params == 0) {\n          Write(\"wasm_rt_load_exception(\", TagSymbol(tag->name), \", 0, NULL);\",\n                Newline());\n        } else if (num_params == 1) {\n          Write(\"wasm_rt_load_exception(\", TagSymbol(tag->name), \", sizeof(\",\n                tag->decl.GetParamType(0), \"), &\", StackVar(0), \");\",\n                Newline());\n        } else {\n          Write(OpenBrace(), tag->decl.sig.param_types, \" tmp;\", Newline());\n          Spill(tag->decl.sig.param_types);\n          Write(\"wasm_rt_load_exception(\", TagSymbol(tag->name),\n                \", sizeof(tmp), &tmp);\", Newline(), CloseBrace(), Newline());\n        }\n\n        WriteThrow();\n        // Stop processing this ExprList, since the following are unreachable.\n        return;\n      }\n\n      case ExprType::ThrowRef: {\n        Write(\"if (\", StackVar(0), \".tag == NULL) { TRAP(NULL_REF); }\");\n        Write(\"wasm_rt_load_exception(\", StackVar(0), \".tag, \", StackVar(0),\n              \".size, \", StackVar(0), \".data);\", Newline());\n        DropTypes(1);\n        WriteThrow();\n        // Stop processing this ExprList, since the following are unreachable.\n        return;\n      }\n\n      case ExprType::Rethrow: {\n        const RethrowExpr* rethrow = cast<RethrowExpr>(&expr);\n        assert(rethrow->var.is_name());\n        const LabelName ex{rethrow->var.name()};\n        func_includes_.insert(rethrow->var.name());\n        Write(\"wasm_rt_load_exception(\", ex, \"_tag, \", ex, \"_size, \", ex, \");\",\n              Newline());\n        WriteThrow();\n      } break;\n\n      case ExprType::Try: {\n        const TryExpr& tryexpr = *cast<TryExpr>(&expr);\n        switch (tryexpr.kind) {\n          case TryKind::Plain:\n            Write(tryexpr.block);\n            break;\n          case TryKind::Catch:\n            WriteTryCatch(tryexpr);\n            break;\n          case TryKind::Delegate:\n            WriteTryDelegate(tryexpr);\n            break;\n        }\n      } break;\n\n      case ExprType::TryTable: {\n        const TryTableExpr& try_table = *cast<TryTableExpr>(&expr);\n        if (try_table.catches.empty()) {\n          Write(try_table.block);\n        } else {\n          Write(try_table);\n        }\n      } break;\n\n      case ExprType::AtomicLoad: {\n        Write(*cast<AtomicLoadExpr>(&expr));\n        break;\n      }\n\n      case ExprType::AtomicStore: {\n        Write(*cast<AtomicStoreExpr>(&expr));\n        break;\n      }\n\n      case ExprType::AtomicRmw: {\n        Write(*cast<AtomicRmwExpr>(&expr));\n        break;\n      }\n\n      case ExprType::AtomicRmwCmpxchg: {\n        Write(*cast<AtomicRmwCmpxchgExpr>(&expr));\n        break;\n      }\n\n      case ExprType::AtomicFence: {\n        Write(\"atomic_fence();\", Newline());\n        break;\n      }\n\n      case ExprType::ReturnCall: {\n        const auto inst = cast<ReturnCallExpr>(&expr);\n        const Func& func = *module_->GetFunc(inst->var);\n\n        const FuncDeclaration& decl = func.decl;\n        assert(decl.sig.result_types == func_->decl.sig.result_types);\n        WriteUnwindTryCatchStack(FindLabel(Var(label_stack_.size() - 1, {})));\n\n        if (!IsImport(func.name) && !func.features_used.tailcall) {\n          // make normal call, then return\n          Write(ExprList{std::make_unique<CallExpr>(inst->var, inst->loc)});\n          Write(\"goto \", LabelName(kImplicitFuncLabel), \";\", Newline());\n          return;\n        }\n\n        WriteTailCallAsserts(decl.sig);\n        Write(OpenBrace());\n        if (!in_tail_callee_) {\n          WriteTailCallStack();\n        }\n\n        const Index num_params = decl.GetNumParams();\n        if (decl.GetNumParams()) {\n          Write(OpenBrace(), decl.sig.param_types, \" tmp;\", Newline());\n          Spill(decl.sig.param_types);\n          Write(\"wasm_rt_memcpy(tail_call_stack, &tmp, sizeof(tmp));\",\n                Newline());\n          Write(CloseBrace(), Newline());\n        }\n\n        Write(\"next->fn = \", TailCallRef(func.name), \";\", Newline());\n        if (IsImport(func.name)) {\n          Write(\"*instance_ptr = instance->\",\n                GlobalName(ModuleFieldType::Import,\n                           import_module_sym_map_.at(func.name)),\n                \";\", Newline());\n        }\n        DropTypes(num_params);\n        FinishReturnCall();\n        return;\n      }\n\n      case ExprType::ReturnCallIndirect: {\n        const auto inst = cast<ReturnCallIndirectExpr>(&expr);\n        const FuncDeclaration& decl = inst->decl;\n        assert(decl.sig.result_types == func_->decl.sig.result_types);\n        assert(decl.has_func_type);\n        const Index num_params = decl.GetNumParams();\n        WriteTailCallAsserts(decl.sig);\n        WriteUnwindTryCatchStack(FindLabel(Var(label_stack_.size() - 1, {})));\n        const Table* table = module_->GetTable(inst->table);\n        Write(\"CHECK_CALL_INDIRECT(\",\n              ExternalInstanceRef(ModuleFieldType::Table, table->name), \", \",\n              FuncTypeExpr(module_->GetFuncType(decl.type_var)), \", \",\n              StackVar(0), \");\", Newline());\n\n        Write(\"if (!\", ExternalInstanceRef(ModuleFieldType::Table, table->name),\n              \".data[\", StackVar(0), \"].func_tailcallee.fn) \", OpenBrace());\n        auto ci = std::make_unique<CallIndirectExpr>(inst->loc);\n        std::tie(ci->decl, ci->table) = std::make_pair(inst->decl, inst->table);\n        Write(ExprList{std::move(ci)});\n        if (in_tail_callee_) {\n          Write(\"next->fn = NULL;\", Newline());\n        }\n        Write(CloseBrace(), \" else \", OpenBrace());\n\n        DropTypes(decl.GetNumResults());\n        PushTypes(decl.sig.param_types);\n        PushType(Type::I32);\n\n        if (!in_tail_callee_) {\n          WriteTailCallStack();\n        }\n\n        if (num_params) {\n          Write(OpenBrace(), decl.sig.param_types, \" tmp;\", Newline());\n          Spill(decl.sig.param_types,\n                [&](auto i) { return StackVar(num_params - i); });\n          Write(\"wasm_rt_memcpy(tail_call_stack, &tmp, sizeof(tmp));\",\n                Newline());\n          Write(CloseBrace(), Newline());\n        }\n\n        assert(decl.has_func_type);\n        Write(\"next->fn = \",\n              ExternalInstanceRef(ModuleFieldType::Table, table->name),\n              \".data[\", StackVar(0), \"].func_tailcallee.fn;\", Newline());\n        Write(\"*instance_ptr = \",\n              ExternalInstanceRef(ModuleFieldType::Table, table->name),\n              \".data[\", StackVar(0), \"].module_instance;\", Newline());\n\n        DropTypes(num_params + 1);\n        FinishReturnCall();\n        return;\n      }\n\n      case ExprType::AtomicWait:\n      case ExprType::AtomicNotify:\n      case ExprType::CallRef:\n      case ExprType::ReturnCallRef:\n      case ExprType::Quaternary:\n        UNIMPLEMENTED(\"...\");\n        break;\n    }\n  }\n}\n\nvoid CWriter::WriteSimpleUnaryExpr(Opcode opcode, const char* op) {\n  Type result_type = opcode.GetResultType();\n  Write(StackVar(0, result_type), \" = \", op, \"(\", StackVar(0), \");\", Newline());\n  DropTypes(1);\n  PushType(opcode.GetResultType());\n}\n\nvoid CWriter::WriteInfixBinaryExpr(Opcode opcode,\n                                   const char* op,\n                                   AssignOp assign_op) {\n  Type result_type = opcode.GetResultType();\n  Write(StackVar(1, result_type));\n  if (assign_op == AssignOp::Allowed) {\n    Write(\" \", op, \"= \", StackVar(0));\n  } else {\n    Write(\" = \", StackVar(1), \" \", op, \" \", StackVar(0));\n  }\n  Write(\";\", Newline());\n  DropTypes(2);\n  PushType(result_type);\n}\n\nvoid CWriter::WritePrefixBinaryExpr(Opcode opcode, const char* op) {\n  Type result_type = opcode.GetResultType();\n  Write(StackVar(1, result_type), \" = \", op, \"(\", StackVar(1), \", \",\n        StackVar(0), \");\", Newline());\n  DropTypes(2);\n  PushType(result_type);\n}\n\nvoid CWriter::WriteSignedBinaryExpr(Opcode opcode, const char* op) {\n  Type result_type = opcode.GetResultType();\n  Type type = opcode.GetParamType1();\n  assert(opcode.GetParamType2() == type);\n  Write(StackVar(1, result_type), \" = (\", type, \")((\", SignedType(type), \")\",\n        StackVar(1), \" \", op, \" (\", SignedType(type), \")\", StackVar(0), \");\",\n        Newline());\n  DropTypes(2);\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const BinaryExpr& expr) {\n  switch (expr.opcode) {\n    case Opcode::I32Add:\n    case Opcode::I64Add:\n    case Opcode::F32Add:\n    case Opcode::F64Add:\n      WriteInfixBinaryExpr(expr.opcode, \"+\");\n      break;\n\n    case Opcode::I32Sub:\n    case Opcode::I64Sub:\n    case Opcode::F32Sub:\n    case Opcode::F64Sub:\n      WriteInfixBinaryExpr(expr.opcode, \"-\");\n      break;\n\n    case Opcode::I32Mul:\n    case Opcode::I64Mul:\n    case Opcode::F32Mul:\n    case Opcode::F64Mul:\n      WriteInfixBinaryExpr(expr.opcode, \"*\");\n      break;\n\n    case Opcode::I32DivS:\n      WritePrefixBinaryExpr(expr.opcode, \"I32_DIV_S\");\n      break;\n\n    case Opcode::I64DivS:\n      WritePrefixBinaryExpr(expr.opcode, \"I64_DIV_S\");\n      break;\n\n    case Opcode::I32DivU:\n    case Opcode::I64DivU:\n      WritePrefixBinaryExpr(expr.opcode, \"DIV_U\");\n      break;\n\n    case Opcode::F32Div:\n    case Opcode::F64Div:\n      WriteInfixBinaryExpr(expr.opcode, \"/\");\n      break;\n\n    case Opcode::I32RemS:\n      WritePrefixBinaryExpr(expr.opcode, \"I32_REM_S\");\n      break;\n\n    case Opcode::I64RemS:\n      WritePrefixBinaryExpr(expr.opcode, \"I64_REM_S\");\n      break;\n\n    case Opcode::I32RemU:\n    case Opcode::I64RemU:\n      WritePrefixBinaryExpr(expr.opcode, \"REM_U\");\n      break;\n\n    case Opcode::I32And:\n    case Opcode::I64And:\n      WriteInfixBinaryExpr(expr.opcode, \"&\");\n      break;\n\n    case Opcode::I32Or:\n    case Opcode::I64Or:\n      WriteInfixBinaryExpr(expr.opcode, \"|\");\n      break;\n\n    case Opcode::I32Xor:\n    case Opcode::I64Xor:\n      WriteInfixBinaryExpr(expr.opcode, \"^\");\n      break;\n\n    case Opcode::I32Shl:\n    case Opcode::I64Shl:\n      Write(StackVar(1), \" <<= (\", StackVar(0), \" & \",\n            GetShiftMask(expr.opcode.GetResultType()), \");\", Newline());\n      DropTypes(1);\n      break;\n\n    case Opcode::I32ShrS:\n    case Opcode::I64ShrS: {\n      Type type = expr.opcode.GetResultType();\n      Write(StackVar(1), \" = (\", type, \")((\", SignedType(type), \")\",\n            StackVar(1), \" >> (\", StackVar(0), \" & \", GetShiftMask(type), \"));\",\n            Newline());\n      DropTypes(1);\n      break;\n    }\n\n    case Opcode::I32ShrU:\n    case Opcode::I64ShrU:\n      Write(StackVar(1), \" >>= (\", StackVar(0), \" & \",\n            GetShiftMask(expr.opcode.GetResultType()), \");\", Newline());\n      DropTypes(1);\n      break;\n\n    case Opcode::I32Rotl:\n      WritePrefixBinaryExpr(expr.opcode, \"I32_ROTL\");\n      break;\n\n    case Opcode::I64Rotl:\n      WritePrefixBinaryExpr(expr.opcode, \"I64_ROTL\");\n      break;\n\n    case Opcode::I32Rotr:\n      WritePrefixBinaryExpr(expr.opcode, \"I32_ROTR\");\n      break;\n\n    case Opcode::I64Rotr:\n      WritePrefixBinaryExpr(expr.opcode, \"I64_ROTR\");\n      break;\n\n    case Opcode::F32Min:\n    case Opcode::F64Min:\n      WritePrefixBinaryExpr(expr.opcode, \"FMIN\");\n      break;\n\n    case Opcode::F32Max:\n    case Opcode::F64Max:\n      WritePrefixBinaryExpr(expr.opcode, \"FMAX\");\n      break;\n\n    case Opcode::F32Copysign:\n      WritePrefixBinaryExpr(expr.opcode, \"copysignf\");\n      break;\n\n    case Opcode::F64Copysign:\n      WritePrefixBinaryExpr(expr.opcode, \"copysign\");\n      break;\n\n    case Opcode::I8X16Add:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_add\");\n      break;\n\n    case Opcode::I8X16AddSatS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_add_sat\");\n      break;\n\n    case Opcode::I8X16AddSatU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_add_sat\");\n      break;\n\n    case Opcode::I8X16AvgrU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_avgr\");\n      break;\n\n    case Opcode::I8X16MaxS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_max\");\n      break;\n\n    case Opcode::I8X16MaxU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_max\");\n      break;\n\n    case Opcode::I8X16MinS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_min\");\n      break;\n\n    case Opcode::I8X16MinU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_min\");\n      break;\n\n    case Opcode::I8X16NarrowI16X8S:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i8x16_narrow_i16x8\");\n      break;\n\n    case Opcode::I8X16NarrowI16X8U:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_u8x16_narrow_i16x8\");\n      break;\n\n    case Opcode::I8X16Shl:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_shl\");\n      break;\n\n    case Opcode::I8X16ShrS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_shr\");\n      break;\n\n    case Opcode::I8X16ShrU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_shr\");\n      break;\n\n    case Opcode::I8X16Sub:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_sub\");\n      break;\n\n    case Opcode::I8X16SubSatS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_sub_sat\");\n      break;\n\n    case Opcode::I8X16SubSatU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_sub_sat\");\n      break;\n\n    case Opcode::I8X16Swizzle:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i8x16_swizzle\");\n      break;\n\n    case Opcode::I16X8Add:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_add\");\n      break;\n\n    case Opcode::I16X8AvgrU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_avgr\");\n      break;\n\n    case Opcode::I16X8AddSatS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_add_sat\");\n      break;\n\n    case Opcode::I16X8AddSatU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_add_sat\");\n      break;\n\n    case Opcode::I16X8ExtmulHighI8X16S:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i16x8_extmul_high_i8x16\");\n      break;\n\n    case Opcode::I16X8ExtmulHighI8X16U:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_u16x8_extmul_high_u8x16\");\n      break;\n\n    case Opcode::I16X8ExtmulLowI8X16S:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i16x8_extmul_low_i8x16\");\n      break;\n\n    case Opcode::I16X8ExtmulLowI8X16U:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_u16x8_extmul_low_u8x16\");\n      break;\n\n    case Opcode::I16X8MaxS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_max\");\n      break;\n\n    case Opcode::I16X8MaxU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_max\");\n      break;\n\n    case Opcode::I16X8MinS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_min\");\n      break;\n\n    case Opcode::I16X8MinU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_min\");\n      break;\n\n    case Opcode::I16X8Mul:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_mul\");\n      break;\n\n    case Opcode::I16X8NarrowI32X4S:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i16x8_narrow_i32x4\");\n      break;\n\n    case Opcode::I16X8NarrowI32X4U:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_u16x8_narrow_i32x4\");\n      break;\n\n    case Opcode::I16X8Q15mulrSatS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_q15mulr_sat\");\n      break;\n\n    case Opcode::I16X8Shl:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_shl\");\n      break;\n\n    case Opcode::I16X8ShrS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_shr\");\n      break;\n\n    case Opcode::I16X8ShrU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_shr\");\n      break;\n\n    case Opcode::I16X8Sub:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_sub\");\n      break;\n\n    case Opcode::I16X8SubSatS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_sub_sat\");\n      break;\n\n    case Opcode::I16X8SubSatU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_sub_sat\");\n      break;\n\n    case Opcode::I32X4Add:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_add\");\n      break;\n\n    case Opcode::I32X4DotI16X8S:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_dot_i16x8\");\n      break;\n\n    case Opcode::I32X4ExtmulHighI16X8S:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i32x4_extmul_high_i16x8\");\n      break;\n\n    case Opcode::I32X4ExtmulHighI16X8U:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_u32x4_extmul_high_u16x8\");\n      break;\n\n    case Opcode::I32X4ExtmulLowI16X8S:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i32x4_extmul_low_i16x8\");\n      break;\n\n    case Opcode::I32X4ExtmulLowI16X8U:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_u32x4_extmul_low_u16x8\");\n      break;\n\n    case Opcode::I32X4MaxS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_max\");\n      break;\n\n    case Opcode::I32X4MaxU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u32x4_max\");\n      break;\n\n    case Opcode::I32X4MinS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_min\");\n      break;\n\n    case Opcode::I32X4MinU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u32x4_min\");\n      break;\n\n    case Opcode::I32X4Mul:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_mul\");\n      break;\n\n    case Opcode::I32X4Shl:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_shl\");\n      break;\n\n    case Opcode::I32X4ShrS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_shr\");\n      break;\n\n    case Opcode::I32X4ShrU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u32x4_shr\");\n      break;\n\n    case Opcode::I32X4Sub:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_sub\");\n      break;\n\n    case Opcode::I64X2Add:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_add\");\n      break;\n\n    case Opcode::I64X2ExtmulHighI32X4S:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i64x2_extmul_high_i32x4\");\n      break;\n\n    case Opcode::I64X2ExtmulHighI32X4U:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_u64x2_extmul_high_u32x4\");\n      break;\n\n    case Opcode::I64X2ExtmulLowI32X4S:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_i64x2_extmul_low_i32x4\");\n      break;\n\n    case Opcode::I64X2ExtmulLowI32X4U:\n      WritePrefixBinaryExpr(expr.opcode, \"v128_u64x2_extmul_low_u32x4\");\n      break;\n\n    case Opcode::I64X2Mul:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_mul\");\n      break;\n\n    case Opcode::I64X2Shl:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_shl\");\n      break;\n\n    case Opcode::I64X2ShrS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_shr\");\n      break;\n\n    case Opcode::I64X2ShrU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u64x2_shr\");\n      break;\n\n    case Opcode::I64X2Sub:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_sub\");\n      break;\n\n    case Opcode::F32X4Add:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_add\");\n      break;\n\n    case Opcode::F32X4Div:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_div\");\n      break;\n\n    case Opcode::F32X4Max:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_max\");\n      break;\n\n    case Opcode::F32X4Mul:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_mul\");\n      break;\n\n    case Opcode::F32X4Min:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_min\");\n      break;\n\n    case Opcode::F32X4PMax:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_pmax\");\n      break;\n\n    case Opcode::F32X4PMin:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_pmin\");\n      break;\n\n    case Opcode::F32X4Sub:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_sub\");\n      break;\n\n    case Opcode::F64X2Add:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_add\");\n      break;\n\n    case Opcode::F64X2Div:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_div\");\n      break;\n\n    case Opcode::F64X2Max:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_max\");\n      break;\n\n    case Opcode::F64X2Mul:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_mul\");\n      break;\n\n    case Opcode::F64X2Min:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_min\");\n      break;\n\n    case Opcode::F64X2PMax:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_pmax\");\n      break;\n\n    case Opcode::F64X2PMin:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_pmin\");\n      break;\n\n    case Opcode::F64X2Sub:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_sub\");\n      break;\n\n    case Opcode::V128And:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_v128_and\");\n      break;\n\n    case Opcode::V128Andnot:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_v128_andnot\");\n      break;\n\n    case Opcode::V128Or:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_v128_or\");\n      break;\n\n    case Opcode::V128Xor:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_v128_xor\");\n      break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nvoid CWriter::Write(const CompareExpr& expr) {\n  switch (expr.opcode) {\n    case Opcode::I32Eq:\n    case Opcode::I64Eq:\n    case Opcode::F32Eq:\n    case Opcode::F64Eq:\n      WriteInfixBinaryExpr(expr.opcode, \"==\", AssignOp::Disallowed);\n      break;\n\n    case Opcode::I32Ne:\n    case Opcode::I64Ne:\n    case Opcode::F32Ne:\n    case Opcode::F64Ne:\n      WriteInfixBinaryExpr(expr.opcode, \"!=\", AssignOp::Disallowed);\n      break;\n\n    case Opcode::I32LtS:\n    case Opcode::I64LtS:\n      WriteSignedBinaryExpr(expr.opcode, \"<\");\n      break;\n\n    case Opcode::I32LtU:\n    case Opcode::I64LtU:\n    case Opcode::F32Lt:\n    case Opcode::F64Lt:\n      WriteInfixBinaryExpr(expr.opcode, \"<\", AssignOp::Disallowed);\n      break;\n\n    case Opcode::I32LeS:\n    case Opcode::I64LeS:\n      WriteSignedBinaryExpr(expr.opcode, \"<=\");\n      break;\n\n    case Opcode::I32LeU:\n    case Opcode::I64LeU:\n    case Opcode::F32Le:\n    case Opcode::F64Le:\n      WriteInfixBinaryExpr(expr.opcode, \"<=\", AssignOp::Disallowed);\n      break;\n\n    case Opcode::I32GtS:\n    case Opcode::I64GtS:\n      WriteSignedBinaryExpr(expr.opcode, \">\");\n      break;\n\n    case Opcode::I32GtU:\n    case Opcode::I64GtU:\n    case Opcode::F32Gt:\n    case Opcode::F64Gt:\n      WriteInfixBinaryExpr(expr.opcode, \">\", AssignOp::Disallowed);\n      break;\n\n    case Opcode::I32GeS:\n    case Opcode::I64GeS:\n      WriteSignedBinaryExpr(expr.opcode, \">=\");\n      break;\n\n    case Opcode::I32GeU:\n    case Opcode::I64GeU:\n    case Opcode::F32Ge:\n    case Opcode::F64Ge:\n      WriteInfixBinaryExpr(expr.opcode, \">=\", AssignOp::Disallowed);\n      break;\n\n    case Opcode::I8X16Eq:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_eq\");\n      break;\n\n    case Opcode::I8X16GeS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_ge\");\n      break;\n\n    case Opcode::I8X16GeU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_ge\");\n      break;\n\n    case Opcode::I8X16GtS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_gt\");\n      break;\n\n    case Opcode::I8X16GtU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_gt\");\n      break;\n\n    case Opcode::I8X16LeS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_le\");\n      break;\n\n    case Opcode::I8X16LeU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_le\");\n      break;\n\n    case Opcode::I8X16LtS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_lt\");\n      break;\n\n    case Opcode::I8X16LtU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u8x16_lt\");\n      break;\n\n    case Opcode::I8X16Ne:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i8x16_ne\");\n      break;\n\n    case Opcode::I16X8Eq:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_eq\");\n      break;\n\n    case Opcode::I16X8GeS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_ge\");\n      break;\n\n    case Opcode::I16X8GeU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_ge\");\n      break;\n\n    case Opcode::I16X8GtS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_gt\");\n      break;\n    case Opcode::I16X8GtU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_gt\");\n      break;\n\n    case Opcode::I16X8LeS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_le\");\n      break;\n\n    case Opcode::I16X8LeU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_le\");\n      break;\n\n    case Opcode::I16X8LtS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_lt\");\n      break;\n\n    case Opcode::I16X8LtU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u16x8_lt\");\n      break;\n\n    case Opcode::I16X8Ne:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i16x8_ne\");\n      break;\n\n    case Opcode::I32X4Eq:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_eq\");\n      break;\n\n    case Opcode::I32X4GeS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_ge\");\n      break;\n\n    case Opcode::I32X4GeU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u32x4_ge\");\n      break;\n\n    case Opcode::I32X4GtS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_gt\");\n      break;\n\n    case Opcode::I32X4GtU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u32x4_gt\");\n      break;\n\n    case Opcode::I32X4LeS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_le\");\n      break;\n\n    case Opcode::I32X4LeU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u32x4_le\");\n      break;\n\n    case Opcode::I32X4LtS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_lt\");\n      break;\n\n    case Opcode::I32X4LtU:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_u32x4_lt\");\n      break;\n\n    case Opcode::I32X4Ne:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i32x4_ne\");\n      break;\n\n    case Opcode::I64X2Eq:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_eq\");\n      break;\n\n    case Opcode::I64X2GeS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_ge\");\n      break;\n\n    case Opcode::I64X2GtS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_gt\");\n      break;\n\n    case Opcode::I64X2LeS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_le\");\n      break;\n\n    case Opcode::I64X2LtS:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_lt\");\n      break;\n\n    case Opcode::I64X2Ne:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_i64x2_ne\");\n      break;\n\n    case Opcode::F32X4Eq:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_eq\");\n      break;\n\n    case Opcode::F32X4Ge:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_ge\");\n      break;\n\n    case Opcode::F32X4Gt:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_gt\");\n      break;\n\n    case Opcode::F32X4Le:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_le\");\n      break;\n\n    case Opcode::F32X4Lt:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_lt\");\n      break;\n\n    case Opcode::F32X4Ne:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f32x4_ne\");\n      break;\n\n    case Opcode::F64X2Eq:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_eq\");\n      break;\n\n    case Opcode::F64X2Ge:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_ge\");\n      break;\n\n    case Opcode::F64X2Gt:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_gt\");\n      break;\n\n    case Opcode::F64X2Le:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_le\");\n      break;\n\n    case Opcode::F64X2Lt:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_lt\");\n      break;\n\n    case Opcode::F64X2Ne:\n      WritePrefixBinaryExpr(expr.opcode, \"simde_wasm_f64x2_ne\");\n      break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nvoid CWriter::Write(const ConvertExpr& expr) {\n  switch (expr.opcode) {\n    case Opcode::I32Eqz:\n    case Opcode::I64Eqz:\n      WriteSimpleUnaryExpr(expr.opcode, \"!\");\n      break;\n\n    case Opcode::I64ExtendI32S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(u64)(s64)(s32)\");\n      break;\n\n    case Opcode::I64ExtendI32U:\n      WriteSimpleUnaryExpr(expr.opcode, \"(u64)\");\n      break;\n\n    case Opcode::I32WrapI64:\n      WriteSimpleUnaryExpr(expr.opcode, \"(u32)\");\n      break;\n\n    case Opcode::I32TruncF32S:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_TRUNC_S_F32\");\n      break;\n\n    case Opcode::I64TruncF32S:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_TRUNC_S_F32\");\n      break;\n\n    case Opcode::I32TruncF64S:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_TRUNC_S_F64\");\n      break;\n\n    case Opcode::I64TruncF64S:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_TRUNC_S_F64\");\n      break;\n\n    case Opcode::I32TruncF32U:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_TRUNC_U_F32\");\n      break;\n\n    case Opcode::I64TruncF32U:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_TRUNC_U_F32\");\n      break;\n\n    case Opcode::I32TruncF64U:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_TRUNC_U_F64\");\n      break;\n\n    case Opcode::I64TruncF64U:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_TRUNC_U_F64\");\n      break;\n\n    case Opcode::I32TruncSatF32S:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_TRUNC_SAT_S_F32\");\n      break;\n\n    case Opcode::I64TruncSatF32S:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_TRUNC_SAT_S_F32\");\n      break;\n\n    case Opcode::I32TruncSatF64S:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_TRUNC_SAT_S_F64\");\n      break;\n\n    case Opcode::I64TruncSatF64S:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_TRUNC_SAT_S_F64\");\n      break;\n\n    case Opcode::I32TruncSatF32U:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_TRUNC_SAT_U_F32\");\n      break;\n\n    case Opcode::I64TruncSatF32U:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_TRUNC_SAT_U_F32\");\n      break;\n\n    case Opcode::I32TruncSatF64U:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_TRUNC_SAT_U_F64\");\n      break;\n\n    case Opcode::I64TruncSatF64U:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_TRUNC_SAT_U_F64\");\n      break;\n\n    case Opcode::F32ConvertI32S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(f32)(s32)\");\n      break;\n\n    case Opcode::F32ConvertI64S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(f32)(s64)\");\n      break;\n\n    case Opcode::F32ConvertI32U:\n      WriteSimpleUnaryExpr(expr.opcode, \"(f32)\");\n      break;\n\n    case Opcode::F32DemoteF64:\n      WriteSimpleUnaryExpr(expr.opcode, \"(f32)wasm_quiet\");\n      break;\n\n    case Opcode::F32ConvertI64U:\n      // TODO(binji): This needs to be handled specially (see\n      // wabt_convert_uint64_to_float).\n      WriteSimpleUnaryExpr(expr.opcode, \"(f32)\");\n      break;\n\n    case Opcode::F64ConvertI32S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(f64)(s32)\");\n      break;\n\n    case Opcode::F64ConvertI64S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(f64)(s64)\");\n      break;\n\n    case Opcode::F64ConvertI32U:\n      WriteSimpleUnaryExpr(expr.opcode, \"(f64)\");\n      break;\n\n    case Opcode::F64PromoteF32:\n      WriteSimpleUnaryExpr(expr.opcode, \"(f64)wasm_quietf\");\n      break;\n\n    case Opcode::F64ConvertI64U:\n      // TODO(binji): This needs to be handled specially (see\n      // wabt_convert_uint64_to_double).\n      WriteSimpleUnaryExpr(expr.opcode, \"(f64)\");\n      break;\n\n    case Opcode::F32ReinterpretI32:\n      WriteSimpleUnaryExpr(expr.opcode, \"f32_reinterpret_i32\");\n      break;\n\n    case Opcode::I32ReinterpretF32:\n      WriteSimpleUnaryExpr(expr.opcode, \"i32_reinterpret_f32\");\n      break;\n\n    case Opcode::F64ReinterpretI64:\n      WriteSimpleUnaryExpr(expr.opcode, \"f64_reinterpret_i64\");\n      break;\n\n    case Opcode::I64ReinterpretF64:\n      WriteSimpleUnaryExpr(expr.opcode, \"i64_reinterpret_f64\");\n      break;\n\n    case Opcode::I32X4TruncSatF32X4S:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i32x4_trunc_sat_f32x4\");\n      break;\n\n    case Opcode::I32X4TruncSatF32X4U:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_u32x4_trunc_sat_f32x4\");\n      break;\n\n    case Opcode::I32X4TruncSatF64X2SZero:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i32x4_trunc_sat_f64x2_zero\");\n      break;\n\n    case Opcode::I32X4TruncSatF64X2UZero:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_u32x4_trunc_sat_f64x2_zero\");\n      break;\n\n    case Opcode::F32X4ConvertI32X4S:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_convert_i32x4\");\n      break;\n\n    case Opcode::F32X4ConvertI32X4U:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_convert_u32x4\");\n      break;\n\n    case Opcode::F32X4DemoteF64X2Zero:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_f32x4_demote_f64x2_zero\");\n      break;\n\n    case Opcode::F64X2ConvertLowI32X4S:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_f64x2_convert_low_i32x4\");\n      break;\n\n    case Opcode::F64X2ConvertLowI32X4U:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_f64x2_convert_low_u32x4\");\n      break;\n\n    case Opcode::F64X2PromoteLowF32X4:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_f64x2_promote_low_f32x4\");\n      break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nvoid CWriter::Write(const LoadExpr& expr) {\n  std::string func;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::I32Load: func = \"i32_load\"; break;\n    case Opcode::I64Load: func = \"i64_load\"; break;\n    case Opcode::F32Load: func = \"f32_load\"; break;\n    case Opcode::F64Load: func = \"f64_load\"; break;\n    case Opcode::I32Load8S: func = \"i32_load8_s\"; break;\n    case Opcode::I64Load8S: func = \"i64_load8_s\"; break;\n    case Opcode::I32Load8U: func = \"i32_load8_u\"; break;\n    case Opcode::I64Load8U: func = \"i64_load8_u\"; break;\n    case Opcode::I32Load16S: func = \"i32_load16_s\"; break;\n    case Opcode::I64Load16S: func = \"i64_load16_s\"; break;\n    case Opcode::I32Load16U: func = \"i32_load16_u\"; break;\n    case Opcode::I64Load16U: func = \"i64_load16_u\"; break;\n    case Opcode::I64Load32S: func = \"i64_load32_s\"; break;\n    case Opcode::I64Load32U: func = \"i64_load32_u\"; break;\n    case Opcode::V128Load: func = \"v128_load\"; break;\n    case Opcode::V128Load8X8S: func = \"i16x8_load8x8\"; break;\n    case Opcode::V128Load8X8U: func = \"u16x8_load8x8\"; break;\n    case Opcode::V128Load16X4S: func = \"i32x4_load16x4\"; break;\n    case Opcode::V128Load16X4U: func = \"u32x4_load16x4\"; break;\n    case Opcode::V128Load32X2S: func = \"i64x2_load32x2\"; break;\n    case Opcode::V128Load32X2U: func = \"u64x2_load32x2\"; break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n  func = GetMemoryAPIString(*memory, func);\n\n  Type result_type = expr.opcode.GetResultType();\n  Write(StackVar(0, result_type), \" = \", func, \"(\",\n        ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", (u64)(\",\n        StackVar(0), \")\");\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset, \"u\");\n  Write(\");\", Newline());\n  DropTypes(1);\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const StoreExpr& expr) {\n  std::string func;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::I32Store: func = \"i32_store\"; break;\n    case Opcode::I64Store: func = \"i64_store\"; break;\n    case Opcode::F32Store: func = \"f32_store\"; break;\n    case Opcode::F64Store: func = \"f64_store\"; break;\n    case Opcode::I32Store8: func = \"i32_store8\"; break;\n    case Opcode::I64Store8: func = \"i64_store8\"; break;\n    case Opcode::I32Store16: func = \"i32_store16\"; break;\n    case Opcode::I64Store16: func = \"i64_store16\"; break;\n    case Opcode::I64Store32: func = \"i64_store32\"; break;\n    case Opcode::V128Store: func = \"v128_store\"; break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n  func = GetMemoryAPIString(*memory, func);\n\n  Write(func, \"(\", ExternalInstancePtr(ModuleFieldType::Memory, memory->name),\n        \", (u64)(\", StackVar(1), \")\");\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset);\n  Write(\", \", StackVar(0), \");\", Newline());\n  DropTypes(2);\n}\n\nvoid CWriter::Write(const UnaryExpr& expr) {\n  switch (expr.opcode) {\n    case Opcode::I32Clz:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_CLZ\");\n      break;\n\n    case Opcode::I64Clz:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_CLZ\");\n      break;\n\n    case Opcode::I32Ctz:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_CTZ\");\n      break;\n\n    case Opcode::I64Ctz:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_CTZ\");\n      break;\n\n    case Opcode::I32Popcnt:\n      WriteSimpleUnaryExpr(expr.opcode, \"I32_POPCNT\");\n      break;\n\n    case Opcode::I64Popcnt:\n      WriteSimpleUnaryExpr(expr.opcode, \"I64_POPCNT\");\n      break;\n\n    case Opcode::F32Neg:\n    case Opcode::F64Neg:\n      WriteSimpleUnaryExpr(expr.opcode, \"-\");\n      break;\n\n    case Opcode::F32Abs:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_fabsf\");\n      break;\n\n    case Opcode::F64Abs:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_fabs\");\n      break;\n\n    case Opcode::F32Sqrt:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_sqrtf\");\n      break;\n\n    case Opcode::F64Sqrt:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_sqrt\");\n      break;\n\n    case Opcode::F32Ceil:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_ceilf\");\n      break;\n\n    case Opcode::F64Ceil:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_ceil\");\n      break;\n\n    case Opcode::F32Floor:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_floorf\");\n      break;\n\n    case Opcode::F64Floor:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_floor\");\n      break;\n\n    case Opcode::F32Trunc:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_truncf\");\n      break;\n\n    case Opcode::F64Trunc:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_trunc\");\n      break;\n\n    case Opcode::F32Nearest:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_nearbyintf\");\n      break;\n\n    case Opcode::F64Nearest:\n      WriteSimpleUnaryExpr(expr.opcode, \"wasm_nearbyint\");\n      break;\n\n    case Opcode::I32Extend8S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(u32)(s32)(s8)(u8)\");\n      break;\n\n    case Opcode::I32Extend16S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(u32)(s32)(s16)(u16)\");\n      break;\n\n    case Opcode::I64Extend8S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(u64)(s64)(s8)(u8)\");\n      break;\n\n    case Opcode::I64Extend16S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(u64)(s64)(s16)(u16)\");\n      break;\n\n    case Opcode::I64Extend32S:\n      WriteSimpleUnaryExpr(expr.opcode, \"(u64)(s64)(s32)(u32)\");\n      break;\n\n    case Opcode::I8X16Abs:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i8x16_abs\");\n      break;\n\n    case Opcode::I8X16AllTrue:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i8x16_all_true\");\n      break;\n\n    case Opcode::I8X16Bitmask:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i8x16_bitmask\");\n      break;\n\n    case Opcode::I8X16Neg:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i8x16_neg\");\n      break;\n\n    case Opcode::I8X16Popcnt:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i8x16_popcnt\");\n      break;\n\n    case Opcode::I8X16Splat:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i8x16_splat\");\n      break;\n\n    case Opcode::I16X8Abs:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i16x8_abs\");\n      break;\n\n    case Opcode::I16X8AllTrue:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i16x8_all_true\");\n      break;\n\n    case Opcode::I16X8Bitmask:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i16x8_bitmask\");\n      break;\n\n    case Opcode::I16X8ExtaddPairwiseI8X16S:\n      WriteSimpleUnaryExpr(expr.opcode,\n                           \"simde_wasm_i16x8_extadd_pairwise_i8x16\");\n      break;\n\n    case Opcode::I16X8ExtaddPairwiseI8X16U:\n      WriteSimpleUnaryExpr(expr.opcode,\n                           \"simde_wasm_u16x8_extadd_pairwise_u8x16\");\n      break;\n\n    case Opcode::I16X8ExtendHighI8X16S:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i16x8_extend_high_i8x16\");\n      break;\n\n    case Opcode::I16X8ExtendHighI8X16U:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_u16x8_extend_high_u8x16\");\n      break;\n\n    case Opcode::I16X8ExtendLowI8X16S:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i16x8_extend_low_i8x16\");\n      break;\n\n    case Opcode::I16X8ExtendLowI8X16U:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_u16x8_extend_low_u8x16\");\n      break;\n\n    case Opcode::I16X8Neg:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i16x8_neg\");\n      break;\n\n    case Opcode::I16X8Splat:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i16x8_splat\");\n      break;\n\n    case Opcode::I32X4Abs:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i32x4_abs\");\n      break;\n\n    case Opcode::I32X4AllTrue:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i32x4_all_true\");\n      break;\n\n    case Opcode::I32X4Bitmask:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i32x4_bitmask\");\n      break;\n\n    case Opcode::I32X4ExtaddPairwiseI16X8S:\n      WriteSimpleUnaryExpr(expr.opcode,\n                           \"simde_wasm_i32x4_extadd_pairwise_i16x8\");\n      break;\n\n    case Opcode::I32X4ExtaddPairwiseI16X8U:\n      WriteSimpleUnaryExpr(expr.opcode,\n                           \"simde_wasm_u32x4_extadd_pairwise_u16x8\");\n      break;\n\n    case Opcode::I32X4ExtendHighI16X8S:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i32x4_extend_high_i16x8\");\n      break;\n\n    case Opcode::I32X4ExtendHighI16X8U:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_u32x4_extend_high_u16x8\");\n      break;\n\n    case Opcode::I32X4ExtendLowI16X8S:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i32x4_extend_low_i16x8\");\n      break;\n\n    case Opcode::I32X4ExtendLowI16X8U:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_u32x4_extend_low_u16x8\");\n      break;\n\n    case Opcode::I32X4Neg:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i32x4_neg\");\n      break;\n\n    case Opcode::I32X4Splat:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i32x4_splat\");\n      break;\n\n    case Opcode::I64X2Abs:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i64x2_abs\");\n      break;\n\n    case Opcode::I64X2AllTrue:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i64x2_all_true\");\n      break;\n\n    case Opcode::I64X2Bitmask:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i64x2_bitmask\");\n      break;\n\n    case Opcode::I64X2ExtendHighI32X4S:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i64x2_extend_high_i32x4\");\n      break;\n\n    case Opcode::I64X2ExtendHighI32X4U:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_u64x2_extend_high_u32x4\");\n      break;\n\n    case Opcode::I64X2ExtendLowI32X4S:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_i64x2_extend_low_i32x4\");\n      break;\n\n    case Opcode::I64X2ExtendLowI32X4U:\n      WriteSimpleUnaryExpr(expr.opcode, \"v128_u64x2_extend_low_u32x4\");\n      break;\n\n    case Opcode::I64X2Neg:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i64x2_neg\");\n      break;\n\n    case Opcode::I64X2Splat:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_i64x2_splat\");\n      break;\n\n    case Opcode::F32X4Abs:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_abs\");\n      break;\n\n    case Opcode::F32X4Ceil:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_ceil\");\n      break;\n\n    case Opcode::F32X4Floor:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_floor\");\n      break;\n\n    case Opcode::F32X4Nearest:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_nearest\");\n      break;\n\n    case Opcode::F32X4Neg:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_neg\");\n      break;\n\n    case Opcode::F32X4Splat:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_splat\");\n      break;\n\n    case Opcode::F32X4Sqrt:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_sqrt\");\n      break;\n\n    case Opcode::F32X4Trunc:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f32x4_trunc\");\n      break;\n\n    case Opcode::F64X2Abs:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f64x2_abs\");\n      break;\n\n    case Opcode::F64X2Ceil:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f64x2_ceil\");\n      break;\n\n    case Opcode::F64X2Floor:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f64x2_floor\");\n      break;\n\n    case Opcode::F64X2Nearest:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f64x2_nearest\");\n      break;\n\n    case Opcode::F64X2Neg:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f64x2_neg\");\n      break;\n\n    case Opcode::F64X2Splat:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f64x2_splat\");\n      break;\n\n    case Opcode::F64X2Sqrt:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f64x2_sqrt\");\n      break;\n\n    case Opcode::F64X2Trunc:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_f64x2_trunc\");\n      break;\n\n    case Opcode::V128AnyTrue:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_v128_any_true\");\n      break;\n\n    case Opcode::V128Not:\n      WriteSimpleUnaryExpr(expr.opcode, \"simde_wasm_v128_not\");\n      break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nvoid CWriter::Write(const TernaryExpr& expr) {\n  switch (expr.opcode) {\n    case Opcode::V128BitSelect: {\n      Type result_type = expr.opcode.GetResultType();\n      Write(StackVar(2, result_type), \" = \", \"simde_wasm_v128_bitselect\", \"(\",\n            StackVar(2), \", \", StackVar(1), \", \", StackVar(0), \");\", Newline());\n      DropTypes(3);\n      PushType(result_type);\n      break;\n    }\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nvoid CWriter::Write(const SimdLaneOpExpr& expr) {\n  Type result_type = expr.opcode.GetResultType();\n\n  switch (expr.opcode) {\n    case Opcode::I8X16ExtractLaneS: {\n      Write(StackVar(0, result_type), \" = v128_i8x16_extract_lane(\",\n            StackVar(0), \", \", expr.val, \");\", Newline());\n      DropTypes(1);\n      break;\n    }\n    case Opcode::I8X16ExtractLaneU: {\n      Write(StackVar(0, result_type), \" = v128_u8x16_extract_lane(\",\n            StackVar(0), \", \", expr.val, \");\", Newline());\n      DropTypes(1);\n      break;\n    }\n    case Opcode::I16X8ExtractLaneS: {\n      Write(StackVar(0, result_type), \" = v128_i16x8_extract_lane(\",\n            StackVar(0), \", \", expr.val, \");\", Newline());\n      DropTypes(1);\n      break;\n    }\n    case Opcode::I16X8ExtractLaneU: {\n      Write(StackVar(0, result_type), \" = v128_u16x8_extract_lane(\",\n            StackVar(0), \", \", expr.val, \");\", Newline());\n      DropTypes(1);\n      break;\n    }\n    case Opcode::I32X4ExtractLane: {\n      Write(StackVar(0, result_type), \" = v128_i32x4_extract_lane(\",\n            StackVar(0), \", \", expr.val, \");\", Newline());\n      DropTypes(1);\n      break;\n    }\n    case Opcode::I64X2ExtractLane: {\n      Write(StackVar(0, result_type), \" = v128_i64x2_extract_lane(\",\n            StackVar(0), \", \", expr.val, \");\", Newline());\n      DropTypes(1);\n      break;\n    }\n    case Opcode::F32X4ExtractLane: {\n      Write(StackVar(0, result_type), \" = v128_f32x4_extract_lane(\",\n            StackVar(0), \", \", expr.val, \");\", Newline());\n      DropTypes(1);\n      break;\n    }\n    case Opcode::F64X2ExtractLane: {\n      Write(StackVar(0, result_type), \" = v128_f64x2_extract_lane(\",\n            StackVar(0), \", \", expr.val, \");\", Newline());\n      DropTypes(1);\n      break;\n    }\n    case Opcode::I8X16ReplaceLane: {\n      Write(StackVar(1, result_type), \" = v128_i8x16_replace_lane(\",\n            StackVar(1), \", \", expr.val, \", \", StackVar(0), \");\", Newline());\n      DropTypes(2);\n      break;\n    }\n    case Opcode::I16X8ReplaceLane: {\n      Write(StackVar(1, result_type), \" = v128_i16x8_replace_lane(\",\n            StackVar(1), \", \", expr.val, \", \", StackVar(0), \");\", Newline());\n      DropTypes(2);\n      break;\n    }\n    case Opcode::I32X4ReplaceLane: {\n      Write(StackVar(1, result_type), \" = v128_i32x4_replace_lane(\",\n            StackVar(1), \", \", expr.val, \", \", StackVar(0), \");\", Newline());\n      DropTypes(2);\n      break;\n    }\n    case Opcode::I64X2ReplaceLane: {\n      Write(StackVar(1, result_type), \" = v128_i64x2_replace_lane(\",\n            StackVar(1), \", \", expr.val, \", \", StackVar(0), \");\", Newline());\n      DropTypes(2);\n      break;\n    }\n    case Opcode::F32X4ReplaceLane: {\n      Write(StackVar(1, result_type), \" = v128_f32x4_replace_lane(\",\n            StackVar(1), \", \", expr.val, \", \", StackVar(0), \");\", Newline());\n      DropTypes(2);\n      break;\n    }\n    case Opcode::F64X2ReplaceLane: {\n      Write(StackVar(1, result_type), \" = v128_f64x2_replace_lane(\",\n            StackVar(1), \", \", expr.val, \", \", StackVar(0), \");\", Newline());\n      DropTypes(2);\n      break;\n    }\n    default:\n      WABT_UNREACHABLE;\n  }\n\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const SimdLoadLaneExpr& expr) {\n  const char* func = nullptr;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::V128Load8Lane: func = \"v128_load8_lane\"; break;\n    case Opcode::V128Load16Lane: func = \"v128_load16_lane\"; break;\n    case Opcode::V128Load32Lane: func = \"v128_load32_lane\"; break;\n    case Opcode::V128Load64Lane: func = \"v128_load64_lane\"; break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n  Type result_type = expr.opcode.GetResultType();\n  Write(StackVar(1, result_type), \" = \", func, expr.val, \"(\",\n        ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", (u64)(\",\n        StackVar(1), \")\");\n\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset, \"u\");\n  Write(\", \", StackVar(0));\n  Write(\");\", Newline());\n\n  DropTypes(2);\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const SimdStoreLaneExpr& expr) {\n  const char* func = nullptr;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::V128Store8Lane: func = \"v128_store8_lane\"; break;\n    case Opcode::V128Store16Lane: func = \"v128_store16_lane\"; break;\n    case Opcode::V128Store32Lane: func = \"v128_store32_lane\"; break;\n    case Opcode::V128Store64Lane: func = \"v128_store64_lane\"; break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n\n  Write(func, expr.val, \"(\",\n        ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", (u64)(\",\n        StackVar(1), \")\");\n\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset, \"u\");\n  Write(\", \", StackVar(0));\n  Write(\");\", Newline());\n\n  DropTypes(2);\n}\n\nvoid CWriter::Write(const SimdShuffleOpExpr& expr) {\n  Type result_type = expr.opcode.GetResultType();\n  switch (expr.opcode) {\n    case Opcode::I8X16Shuffle: {\n      Write(StackVar(1, result_type), \" = v128_i8x16_shuffle(\", StackVar(1),\n            \", \", StackVar(0));\n      for (int i = 0; i < 16; i++) {\n        Write(\", \", expr.val.u8(i));\n      }\n      Write(\");\", Newline());\n      DropTypes(2);\n      break;\n    }\n    default:\n      WABT_UNREACHABLE;\n  }\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const LoadSplatExpr& expr) {\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n\n  const char* func = nullptr;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::V128Load8Splat: func = \"v128_load8_splat\"; break;\n    case Opcode::V128Load16Splat: func = \"v128_load16_splat\"; break;\n    case Opcode::V128Load32Splat: func = \"v128_load32_splat\"; break;\n    case Opcode::V128Load64Splat: func = \"v128_load64_splat\"; break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n  Type result_type = expr.opcode.GetResultType();\n  Write(StackVar(0, result_type), \" = \", func, \"(\",\n        ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", (u64)(\",\n        StackVar(0), \")\");\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset);\n  Write(\");\", Newline());\n\n  DropTypes(1);\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const LoadZeroExpr& expr) {\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n\n  const char* func = nullptr;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::V128Load32Zero: func = \"v128_load32_zero\"; break;\n    case Opcode::V128Load64Zero: func = \"v128_load64_zero\"; break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n\n  Type result_type = expr.opcode.GetResultType();\n  Write(StackVar(0, result_type), \" = \", func, \"(\",\n        ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", (u64)(\",\n        StackVar(0), \")\");\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset);\n  Write(\");\", Newline());\n\n  DropTypes(1);\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const AtomicLoadExpr& expr) {\n  std::string func;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::I32AtomicLoad: func = \"i32_atomic_load\"; break;\n    case Opcode::I64AtomicLoad: func = \"i64_atomic_load\"; break;\n    case Opcode::I32AtomicLoad8U: func = \"i32_atomic_load8_u\"; break;\n    case Opcode::I64AtomicLoad8U: func = \"i64_atomic_load8_u\"; break;\n    case Opcode::I32AtomicLoad16U: func = \"i32_atomic_load16_u\"; break;\n    case Opcode::I64AtomicLoad16U: func = \"i64_atomic_load16_u\"; break;\n    case Opcode::I64AtomicLoad32U: func = \"i64_atomic_load32_u\"; break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n  func = GetMemoryAPIString(*memory, func);\n\n  Type result_type = expr.opcode.GetResultType();\n  Write(StackVar(0, result_type), \" = \", func, \"(\",\n        ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", (u64)(\",\n        StackVar(0), \")\");\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset, \"u\");\n  Write(\");\", Newline());\n  DropTypes(1);\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const AtomicStoreExpr& expr) {\n  std::string func;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::I32AtomicStore: func = \"i32_atomic_store\"; break;\n    case Opcode::I64AtomicStore: func = \"i64_atomic_store\"; break;\n    case Opcode::I32AtomicStore8: func = \"i32_atomic_store8\"; break;\n    case Opcode::I64AtomicStore8: func = \"i64_atomic_store8\"; break;\n    case Opcode::I32AtomicStore16: func = \"i32_atomic_store16\"; break;\n    case Opcode::I64AtomicStore16: func = \"i64_atomic_store16\"; break;\n    case Opcode::I64AtomicStore32: func = \"i64_atomic_store32\"; break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n  func = GetMemoryAPIString(*memory, func);\n\n  Write(func, \"(\", ExternalInstancePtr(ModuleFieldType::Memory, memory->name),\n        \", (u64)(\", StackVar(1), \")\");\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset);\n  Write(\", \", StackVar(0), \");\", Newline());\n  DropTypes(2);\n}\n\nvoid CWriter::Write(const AtomicRmwExpr& expr) {\n  std::string func;\n  // clang-format off\n  switch (expr.opcode) {\n    case Opcode::I32AtomicRmwAdd: func = \"i32_atomic_rmw_add\"; break;\n    case Opcode::I64AtomicRmwAdd: func = \"i64_atomic_rmw_add\"; break;\n    case Opcode::I32AtomicRmw8AddU: func = \"i32_atomic_rmw8_add_u\"; break;\n    case Opcode::I32AtomicRmw16AddU: func = \"i32_atomic_rmw16_add_u\"; break;\n    case Opcode::I64AtomicRmw8AddU: func = \"i64_atomic_rmw8_add_u\"; break;\n    case Opcode::I64AtomicRmw16AddU: func = \"i64_atomic_rmw16_add_u\"; break;\n    case Opcode::I64AtomicRmw32AddU: func = \"i64_atomic_rmw32_add_u\"; break;\n    case Opcode::I32AtomicRmwSub: func = \"i32_atomic_rmw_sub\"; break;\n    case Opcode::I64AtomicRmwSub: func = \"i64_atomic_rmw_sub\"; break;\n    case Opcode::I32AtomicRmw8SubU: func = \"i32_atomic_rmw8_sub_u\"; break;\n    case Opcode::I32AtomicRmw16SubU: func = \"i32_atomic_rmw16_sub_u\"; break;\n    case Opcode::I64AtomicRmw8SubU: func = \"i64_atomic_rmw8_sub_u\"; break;\n    case Opcode::I64AtomicRmw16SubU: func = \"i64_atomic_rmw16_sub_u\"; break;\n    case Opcode::I64AtomicRmw32SubU: func = \"i64_atomic_rmw32_sub_u\"; break;\n    case Opcode::I32AtomicRmwAnd: func = \"i32_atomic_rmw_and\"; break;\n    case Opcode::I64AtomicRmwAnd: func = \"i64_atomic_rmw_and\"; break;\n    case Opcode::I32AtomicRmw8AndU: func = \"i32_atomic_rmw8_and_u\"; break;\n    case Opcode::I32AtomicRmw16AndU: func = \"i32_atomic_rmw16_and_u\"; break;\n    case Opcode::I64AtomicRmw8AndU: func = \"i64_atomic_rmw8_and_u\"; break;\n    case Opcode::I64AtomicRmw16AndU: func = \"i64_atomic_rmw16_and_u\"; break;\n    case Opcode::I64AtomicRmw32AndU: func = \"i64_atomic_rmw32_and_u\"; break;\n    case Opcode::I32AtomicRmwOr: func = \"i32_atomic_rmw_or\"; break;\n    case Opcode::I64AtomicRmwOr: func = \"i64_atomic_rmw_or\"; break;\n    case Opcode::I32AtomicRmw8OrU: func = \"i32_atomic_rmw8_or_u\"; break;\n    case Opcode::I32AtomicRmw16OrU: func = \"i32_atomic_rmw16_or_u\"; break;\n    case Opcode::I64AtomicRmw8OrU: func = \"i64_atomic_rmw8_or_u\"; break;\n    case Opcode::I64AtomicRmw16OrU: func = \"i64_atomic_rmw16_or_u\"; break;\n    case Opcode::I64AtomicRmw32OrU: func = \"i64_atomic_rmw32_or_u\"; break;\n    case Opcode::I32AtomicRmwXor: func = \"i32_atomic_rmw_xor\"; break;\n    case Opcode::I64AtomicRmwXor: func = \"i64_atomic_rmw_xor\"; break;\n    case Opcode::I32AtomicRmw8XorU: func = \"i32_atomic_rmw8_xor_u\"; break;\n    case Opcode::I32AtomicRmw16XorU: func = \"i32_atomic_rmw16_xor_u\"; break;\n    case Opcode::I64AtomicRmw8XorU: func = \"i64_atomic_rmw8_xor_u\"; break;\n    case Opcode::I64AtomicRmw16XorU: func = \"i64_atomic_rmw16_xor_u\"; break;\n    case Opcode::I64AtomicRmw32XorU: func = \"i64_atomic_rmw32_xor_u\"; break;\n    case Opcode::I32AtomicRmwXchg: func = \"i32_atomic_rmw_xchg\"; break;\n    case Opcode::I64AtomicRmwXchg: func = \"i64_atomic_rmw_xchg\"; break;\n    case Opcode::I32AtomicRmw8XchgU: func = \"i32_atomic_rmw8_xchg_u\"; break;\n    case Opcode::I32AtomicRmw16XchgU: func = \"i32_atomic_rmw16_xchg_u\"; break;\n    case Opcode::I64AtomicRmw8XchgU: func = \"i64_atomic_rmw8_xchg_u\"; break;\n    case Opcode::I64AtomicRmw16XchgU: func = \"i64_atomic_rmw16_xchg_u\"; break;\n    case Opcode::I64AtomicRmw32XchgU: func = \"i64_atomic_rmw32_xchg_u\"; break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n  func = GetMemoryAPIString(*memory, func);\n\n  Type result_type = expr.opcode.GetResultType();\n\n  Write(StackVar(1, result_type), \" = \", func, \"(\",\n        ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", (u64)(\",\n        StackVar(1), \")\");\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset);\n  Write(\", \", StackVar(0), \");\", Newline());\n  DropTypes(2);\n  PushType(result_type);\n}\n\nvoid CWriter::Write(const AtomicRmwCmpxchgExpr& expr) {\n  std::string func;\n  // clang-format off\n  switch(expr.opcode) {\n    case Opcode::I32AtomicRmwCmpxchg: func = \"i32_atomic_rmw_cmpxchg\"; break;\n    case Opcode::I64AtomicRmwCmpxchg: func = \"i64_atomic_rmw_cmpxchg\"; break;\n    case Opcode::I32AtomicRmw8CmpxchgU: func = \"i32_atomic_rmw8_cmpxchg_u\"; break;\n    case Opcode::I32AtomicRmw16CmpxchgU: func = \"i32_atomic_rmw16_cmpxchg_u\"; break;\n    case Opcode::I64AtomicRmw8CmpxchgU: func = \"i64_atomic_rmw8_cmpxchg_u\"; break;\n    case Opcode::I64AtomicRmw16CmpxchgU: func = \"i64_atomic_rmw16_cmpxchg_u\"; break;\n    case Opcode::I64AtomicRmw32CmpxchgU: func = \"i64_atomic_rmw32_cmpxchg_u\"; break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  // clang-format on\n\n  Memory* memory = module_->memories[module_->GetMemoryIndex(expr.memidx)];\n  func = GetMemoryAPIString(*memory, func);\n\n  Type result_type = expr.opcode.GetResultType();\n\n  Write(StackVar(2, result_type), \" = \", func, \"(\",\n        ExternalInstancePtr(ModuleFieldType::Memory, memory->name), \", (u64)(\",\n        StackVar(2), \")\");\n  if (expr.offset != 0)\n    Write(\" + \", expr.offset);\n  Write(\", \", StackVar(1), \", \", StackVar(0), \");\", Newline());\n  DropTypes(3);\n  PushType(result_type);\n}\n\nvoid CWriter::ReserveExportNames() {\n  for (const Export* export_ : module_->exports) {\n    ReserveExportName(export_->name);\n  }\n}\n\nvoid CWriter::WriteCHeader() {\n  ReserveExportNames();\n\n  stream_ = h_stream_;\n  std::string guard = GenerateHeaderGuard();\n  Write(\"/* Automatically generated by wasm2c */\", Newline());\n  Write(\"#ifndef \", guard, Newline());\n  Write(\"#define \", guard, Newline());\n  Write(Newline());\n  ComputeSimdScope();\n  WriteHeaderIncludes();\n  Write(s_header_top);\n  Write(Newline());\n  WriteModuleInstance();\n  WriteInitDecl();\n  WriteFreeDecl();\n  WriteGetFuncTypeDecl();\n  WriteMultivalueResultTypes();\n  WriteImports();\n  WriteImportProperties(CWriterPhase::Declarations);\n  WriteExports(CWriterPhase::Declarations);\n  if (options_.features.tail_call_enabled()) {\n    WriteTailCallExports(CWriterPhase::Declarations);\n  }\n  Write(Newline());\n  Write(s_header_bottom);\n  Write(Newline(), \"#endif  /* \", guard, \" */\", Newline());\n}\n\nvoid CWriter::WriteCSource() {\n  /* Write the \"top\" to h_impl stream */\n  stream_ = h_impl_stream_;\n  Write(\"/* Automatically generated by wasm2c */\", Newline());\n  WriteSourceTop();\n\n  /* Write module-wide declarations to impl header */\n  WriteFuncTypeDecls();\n  WriteTagTypes();\n  WriteTagDecls();\n  WriteFuncDeclarations();\n  WriteDataInitializerDecls();\n  WriteElemInitializerDecls();\n  if (options_.features.tail_call_enabled()) {\n    WriteTailcalleeParamTypes();\n  }\n\n  /* Write the module-wide material to the first output stream */\n  stream_ = c_streams_.front();\n  WriteMultiCTop();\n  WriteFuncTypes();\n  WriteTags();\n  WriteFuncRefWrappers();\n  WriteGlobalInitializers();\n  WriteDataInitializers();\n  WriteElemInitializers();\n  WriteExports(CWriterPhase::Definitions);\n  if (options_.features.tail_call_enabled()) {\n    WriteTailCallExports(CWriterPhase::Definitions);\n    WriteTailCallWeakImports();\n  }\n  WriteInitInstanceImport();\n  WriteImportProperties(CWriterPhase::Definitions);\n  WriteInit();\n  WriteFree();\n  WriteGetFuncType();\n\n  /* Write function bodies across the different output streams */\n  WriteFuncs();\n\n  /* For any empty .c output, write a dummy typedef to avoid gcc warning */\n  WriteMultiCTopEmpty();\n}\n\nResult CWriter::WriteModule(const Module& module) {\n  WABT_USE(options_);\n  module_ = &module;\n  WriteCHeader();\n  WriteCSource();\n  return result_;\n}\n\n// static\nconst char* CWriter::GetReferenceTypeName(const Type& type) {\n  switch (type) {\n    case Type::FuncRef:\n      return \"funcref\";\n    case Type::ExternRef:\n      return \"externref\";\n    case Type::ExnRef:\n      return \"exnref\";\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\n// static\nconst char* CWriter::GetReferenceNullValue(const Type& type) {\n  switch (type) {\n    case Type::FuncRef:\n      return \"wasm_rt_funcref_null_value\";\n    case Type::ExternRef:\n      return \"wasm_rt_externref_null_value\";\n    case Type::ExnRef:\n      return \"wasm_rt_exnref_null_value\";\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nconst char* CWriter::InternalSymbolScope() const {\n  if (c_streams_.size() == 1) {\n    return \"static \";\n  } else {\n    return \"\";\n  }\n}\n\n}  // end anonymous namespace\n\nResult WriteC(std::vector<Stream*>&& c_streams,\n              Stream* h_stream,\n              Stream* h_impl_stream,\n              const char* header_name,\n              const char* header_impl_name,\n              const Module* module,\n              const WriteCOptions& options) {\n  CWriter c_writer(std::move(c_streams), h_stream, h_impl_stream, header_name,\n                   header_impl_name, options);\n  return c_writer.WriteModule(*module);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/color.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/color.h\"\n\n#include <cstdlib>\n\n#include \"wabt/common.h\"\n\n#if HAVE_WIN32_VT100\n#include <io.h>\n#include <windows.h>\n#elif HAVE_UNISTD_H\n#include <unistd.h>\n#endif\n\nnamespace wabt {\n\nColor::Color(FILE* file, bool enabled) : file_(file) {\n  enabled_ = enabled && SupportsColor(file_);\n}\n\n// static\nbool Color::SupportsColor(FILE* file) {\n  char* force = getenv(\"FORCE_COLOR\");\n  if (force) {\n    return atoi(force) != 0;\n  }\n\n#if HAVE_WIN32_VT100\n\n  HANDLE handle;\n  if (file == stdout) {\n    handle = GetStdHandle(STD_OUTPUT_HANDLE);\n  } else if (file == stderr) {\n    handle = GetStdHandle(STD_ERROR_HANDLE);\n  } else {\n    return false;\n  }\n  DWORD mode;\n  if (!_isatty(_fileno(file)) || !GetConsoleMode(handle, &mode) ||\n      !SetConsoleMode(handle, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING)) {\n    return false;\n  }\n  return true;\n  // TODO(binji): Support older Windows by using SetConsoleTextAttribute?\n\n#elif HAVE_UNISTD_H\n\n  return isatty(fileno(file));\n\n#else\n\n  return false;\n\n#endif\n}\n\nvoid Color::WriteCode(const char* code) const {\n  if (enabled_) {\n    fputs(code, file_);\n  }\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/common.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/common.h\"\n\n#include <cassert>\n#include <cerrno>\n#include <climits>\n#include <cstdint>\n#include <cstdio>\n#include <cstring>\n\n#include <sys/stat.h>\n#include <sys/types.h>\n\n#if COMPILER_IS_MSVC\n#include <fcntl.h>\n#include <io.h>\n#include <stdlib.h>\n#define PATH_MAX _MAX_PATH\n#define stat _stat\n#define S_IFREG _S_IFREG\n#endif\n\nnamespace wabt {\n\nReloc::Reloc(RelocType type, Offset offset, Index index, int32_t addend)\n    : type(type), offset(offset), index(index), addend(addend) {}\n\nconst char* g_kind_name[] = {\"func\", \"table\", \"memory\", \"global\", \"tag\"};\nWABT_STATIC_ASSERT(WABT_ARRAY_SIZE(g_kind_name) == kExternalKindCount);\n\n// clang-format off\nconst char* g_reloc_type_name[] = {\n    \"R_WASM_FUNCTION_INDEX_LEB\",\n    \"R_WASM_TABLE_INDEX_SLEB\",\n    \"R_WASM_TABLE_INDEX_I32\",\n    \"R_WASM_MEMORY_ADDR_LEB\",\n    \"R_WASM_MEMORY_ADDR_SLEB\",\n    \"R_WASM_MEMORY_ADDR_I32\",\n    \"R_WASM_TYPE_INDEX_LEB\",\n    \"R_WASM_GLOBAL_INDEX_LEB\",\n    \"R_WASM_FUNCTION_OFFSET_I32\",\n    \"R_WASM_SECTION_OFFSET_I32\",\n    \"R_WASM_TAG_INDEX_LEB\",\n    \"R_WASM_MEMORY_ADDR_REL_SLEB\",\n    \"R_WASM_TABLE_INDEX_REL_SLEB\",\n    \"R_WASM_GLOBAL_INDEX_I32\",\n    \"R_WASM_MEMORY_ADDR_LEB64\",\n    \"R_WASM_MEMORY_ADDR_SLEB64\",\n    \"R_WASM_MEMORY_ADDR_I64\",\n    \"R_WASM_MEMORY_ADDR_REL_SLEB64\",\n    \"R_WASM_TABLE_INDEX_SLEB64\",\n    \"R_WASM_TABLE_INDEX_I64\",\n    \"R_WASM_TABLE_NUMBER_LEB\",\n    \"R_WASM_MEMORY_ADDR_TLS_SLEB\",\n    \"R_WASM_FUNCTION_OFFSET_I64\",\n    \"R_WASM_MEMORY_ADDR_LOCREL_I32\",\n    \"R_WASM_TABLE_INDEX_REL_SLEB64\",\n    \"R_WASM_MEMORY_ADDR_TLS_SLEB64\",\n    \"R_WASM_FUNCTION_INDEX_I32\",\n};\nWABT_STATIC_ASSERT(WABT_ARRAY_SIZE(g_reloc_type_name) == kRelocTypeCount);\n// clang-format on\n\nstatic Result ReadAll(FILE* stream,\n                      const char* name,\n                      std::vector<uint8_t>* out_data) {\n  out_data->resize(0);\n  uint8_t buffer[4096];\n  while (true) {\n    size_t bytes_read = fread(buffer, 1, sizeof(buffer), stream);\n    if (bytes_read == 0) {\n      if (ferror(stream)) {\n        fprintf(stderr, \"error reading from %s: %s\\n\", name, strerror(errno));\n        return Result::Error;\n      }\n      return Result::Ok;\n    }\n    size_t old_size = out_data->size();\n    out_data->resize(old_size + bytes_read);\n    memcpy(out_data->data() + old_size, buffer, bytes_read);\n  }\n}\n\nResult ReadFile(std::string_view filename, std::vector<uint8_t>* out_data) {\n  std::string filename_str(filename);\n  const char* filename_cstr = filename_str.c_str();\n\n  if (filename == \"-\") {\n    return ReadAll(stdin, \"stdin\", out_data);\n  }\n\n  struct stat statbuf;\n  if (stat(filename_cstr, &statbuf) < 0) {\n    fprintf(stderr, \"%s: %s\\n\", filename_cstr, strerror(errno));\n    return Result::Error;\n  }\n\n  if (statbuf.st_mode & S_IFDIR) {\n    fprintf(stderr, \"%s: is a directory\\n\", filename_cstr);\n    return Result::Error;\n  }\n\n  FILE* infile = fopen(filename_cstr, \"rb\");\n  if (!infile) {\n    fprintf(stderr, \"%s: %s\\n\", filename_cstr, strerror(errno));\n    return Result::Error;\n  }\n\n  if (fseek(infile, 0, SEEK_END) < 0) {\n    // not seekable, so we can't pre-allocate out_data, but let's try and read\n    // it anyway (for pipes, sockets, etc.)\n    auto res = ReadAll(infile, filename_cstr, out_data);\n    fclose(infile);\n    return res;\n  }\n\n  long size = ftell(infile);\n  if (size < 0) {\n    perror(\"ftell failed\");\n    fclose(infile);\n    return Result::Error;\n  }\n\n  if (fseek(infile, 0, SEEK_SET) < 0) {\n    perror(\"fseek to beginning failed\");\n    fclose(infile);\n    return Result::Error;\n  }\n\n  out_data->resize(size);\n  if (size != 0 && fread(out_data->data(), size, 1, infile) != 1) {\n    fprintf(stderr, \"%s: fread failed: %s\\n\", filename_cstr, strerror(errno));\n    fclose(infile);\n    return Result::Error;\n  }\n\n  fclose(infile);\n  return Result::Ok;\n}\n\nvoid InitStdio() {\n#if COMPILER_IS_MSVC\n  int result = _setmode(_fileno(stdout), _O_BINARY);\n  if (result == -1) {\n    perror(\"Cannot set mode binary to stdout\");\n  }\n  result = _setmode(_fileno(stderr), _O_BINARY);\n  if (result == -1) {\n    perror(\"Cannot set mode binary to stderr\");\n  }\n#endif\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/config.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/config.h\"\n\n#include <cstdarg>\n#include <cstdio>\n\n#if COMPILER_IS_MSVC && _M_X64\n#include <emmintrin.h>\n#elif COMPILER_IS_MSVC && _M_IX86\n#include <float.h>\n#endif\n\n/* c99-style vsnprintf for MSVC < 2015. See http://stackoverflow.com/a/8712996\n using _snprintf or vsnprintf will not-properly null-terminate, and will return\n -1 instead of the number of characters needed on overflow. */\n#if COMPILER_IS_MSVC\nint wabt_vsnprintf(char* str, size_t size, const char* format, va_list ap) {\n  int result = -1;\n  if (size != 0) {\n    result = _vsnprintf_s(str, size, _TRUNCATE, format, ap);\n  }\n  if (result == -1) {\n    result = _vscprintf(format, ap);\n  }\n  return result;\n}\n\n#if !HAVE_SNPRINTF\nint wabt_snprintf(char* str, size_t size, const char* format, ...) {\n  va_list args;\n  va_start(args, format);\n  int result = wabt_vsnprintf(str, size, format, args);\n  va_end(args);\n  return result;\n}\n#endif\n#endif\n\n#if COMPILER_IS_MSVC && _M_IX86\n// Allow the following functions to change the floating-point environment (e.g.\n// update to 64-bit precision in the mantissa). This is only needed for x87\n// floats, which are only used on MSVC 32-bit.\n#pragma fenv_access(on)\nnamespace {\n\ntypedef unsigned int FPControl;\n\nFPControl Set64BitPrecisionControl() {\n  FPControl old_ctrl = _control87(0, 0);\n  _control87(_PC_64, _MCW_PC);\n  return old_ctrl;\n}\n\nvoid ResetPrecisionControl(FPControl old_ctrl) {\n  _control87(old_ctrl, _MCW_PC);\n}\n\n}  // end of anonymous namespace\n#endif\n\ndouble wabt_convert_uint64_to_double(uint64_t x) {\n#if COMPILER_IS_MSVC && _M_X64\n  // MSVC on x64 generates uint64 -> float conversions but doesn't do\n  // round-to-nearest-ties-to-even, which is required by WebAssembly.\n  __m128d result = _mm_setzero_pd();\n  if (x & 0x8000000000000000ULL) {\n    result = _mm_cvtsi64_sd(result, (x >> 1) | (x & 1));\n    result = _mm_add_sd(result, result);\n  } else {\n    result = _mm_cvtsi64_sd(result, x);\n  }\n  return _mm_cvtsd_f64(result);\n#elif COMPILER_IS_MSVC && _M_IX86\n  // MSVC on x86 converts from i64 -> double -> float, which causes incorrect\n  // rounding. Using the x87 float stack instead preserves the correct\n  // rounding.\n  FPControl old_ctrl = Set64BitPrecisionControl();\n  static const double c = 18446744073709551616.0;\n  double result;\n  __asm fild x;\n  if (x & 0x8000000000000000ULL) {\n    __asm fadd c;\n  }\n  __asm fstp result;\n  ResetPrecisionControl(old_ctrl);\n  return result;\n#else\n  return static_cast<double>(x);\n#endif\n}\n\nfloat wabt_convert_uint64_to_float(uint64_t x) {\n#if COMPILER_IS_MSVC && _M_X64\n  // MSVC on x64 generates uint64 -> float conversions but doesn't do\n  // round-to-nearest-ties-to-even, which is required by WebAssembly.\n  __m128 result = _mm_setzero_ps();\n  if (x & 0x8000000000000000ULL) {\n    result = _mm_cvtsi64_ss(result, (x >> 1) | (x & 1));\n    result = _mm_add_ss(result, result);\n  } else {\n    result = _mm_cvtsi64_ss(result, x);\n  }\n  return _mm_cvtss_f32(result);\n#elif COMPILER_IS_MSVC && _M_IX86\n  // MSVC on x86 converts from i64 -> double -> float, which causes incorrect\n  // rounding. Using the x87 float stack instead preserves the correct\n  // rounding.\n  FPControl old_ctrl = Set64BitPrecisionControl();\n  static const float c = 18446744073709551616.0f;\n  float result;\n  __asm fild x;\n  if (x & 0x8000000000000000ULL) {\n    __asm fadd c;\n  }\n  __asm fstp result;\n  ResetPrecisionControl(old_ctrl);\n  return result;\n#else\n  return static_cast<float>(x);\n#endif\n}\n\ndouble wabt_convert_int64_to_double(int64_t x) {\n#if COMPILER_IS_MSVC && _M_IX86\n  double result;\n  __asm fild x;\n  __asm fstp result;\n  return result;\n#else\n  return static_cast<double>(x);\n#endif\n}\n\nfloat wabt_convert_int64_to_float(int64_t x) {\n#if COMPILER_IS_MSVC && _M_IX86\n  float result;\n  __asm fild x;\n  __asm fstp result;\n  return result;\n#else\n  return static_cast<float>(x);\n#endif\n}\n\n#if COMPILER_IS_MSVC && _M_IX86\n#pragma fenv_access(off)\n#endif\n"
  },
  {
    "path": "src/config.h.in",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_CONFIG_H_\n#define WABT_CONFIG_H_\n\n#include <stdint.h>\n#include <stdlib.h>\n\n#cmakedefine WABT_VERSION_STRING \"@WABT_VERSION_STRING@\"\n\n#cmakedefine WABT_DEBUG @WABT_DEBUG@\n\n/* TODO(binji): nice way to define these with WABT_ prefix? */\n\n/* Whether <alloca.h> is available */\n#cmakedefine01 HAVE_ALLOCA_H\n\n/* Whether <unistd.h> is available */\n#cmakedefine01 HAVE_UNISTD_H\n\n/* Whether snprintf is defined by stdio.h */\n#cmakedefine01 HAVE_SNPRINTF\n\n/* Whether ssize_t is defined by stddef.h */\n#cmakedefine01 HAVE_SSIZE_T\n\n/* Whether strcasecmp is defined by strings.h */\n#cmakedefine01 HAVE_STRCASECMP\n\n/* Whether ENABLE_VIRTUAL_TERMINAL_PROCESSING is defined by windows.h */\n#cmakedefine01 HAVE_WIN32_VT100\n\n/* Whether the target architecture is big endian */\n#cmakedefine01 WABT_BIG_ENDIAN\n\n/* Whether <openssl/sha.h> is available */\n#cmakedefine01 HAVE_OPENSSL_SHA_H\n\n#cmakedefine01 COMPILER_IS_CLANG\n#cmakedefine01 COMPILER_IS_GNU\n#cmakedefine01 COMPILER_IS_MSVC\n\n#cmakedefine01 WITH_EXCEPTIONS\n\n#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@\n\n#if HAVE_ALLOCA_H\n#include <alloca.h>\n#elif COMPILER_IS_MSVC\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__MINGW32__)\n#include <malloc.h>\n#endif\n\n#if COMPILER_IS_CLANG || COMPILER_IS_GNU\n\n#define WABT_UNLIKELY(x) __builtin_expect(!!(x), 0)\n#define WABT_LIKELY(x) __builtin_expect(!!(x), 1)\n\n#define WABT_VECTORCALL\n\n#if __MINGW32__\n// mingw defaults to printf format specifier being ms_printf (which doesn't\n// understand 'llu', etc.) We always want gnu_printf, and force mingw to always\n// use mingw_printf, mingw_vprintf, etc.\n#define WABT_PRINTF_FORMAT(format_arg, first_arg) \\\n  __attribute__((format(gnu_printf, (format_arg), (first_arg))))\n#else\n#define WABT_PRINTF_FORMAT(format_arg, first_arg) \\\n  __attribute__((format(printf, (format_arg), (first_arg))))\n#endif\n\n#ifdef __cplusplus\n#define WABT_STATIC_ASSERT(x) static_assert((x), #x)\n#else\n#define WABT_STATIC_ASSERT(x) _Static_assert((x), #x)\n#endif\n\n#elif COMPILER_IS_MSVC\n\n#include <intrin.h>\n#include <string.h>\n\n#define WABT_STATIC_ASSERT(x) _STATIC_ASSERT(x)\n#define WABT_UNLIKELY(x) (x)\n#define WABT_LIKELY(x) (x)\n#define WABT_PRINTF_FORMAT(format_arg, first_arg)\n\n#define WABT_VECTORCALL __vectorcall\n\n#else\n\n#error unknown compiler\n\n#endif\n\n#define WABT_UNREACHABLE abort()\n\n#ifdef __cplusplus\n\nnamespace wabt {\n\n#if COMPILER_IS_CLANG || COMPILER_IS_GNU\n\ninline int Clz(unsigned x) { return x ? __builtin_clz(x) : sizeof(x) * 8; }\ninline int Clz(unsigned long x) { return x ? __builtin_clzl(x) : sizeof(x) * 8; }\ninline int Clz(unsigned long long x) { return x ? __builtin_clzll(x) : sizeof(x) * 8; }\n\ninline int Ctz(unsigned x) { return x ? __builtin_ctz(x) : sizeof(x) * 8; }\ninline int Ctz(unsigned long x) { return x ? __builtin_ctzl(x) : sizeof(x) * 8; }\ninline int Ctz(unsigned long long x) { return x ? __builtin_ctzll(x) : sizeof(x) * 8; }\n\ninline int Popcount(uint8_t x) { return __builtin_popcount(x); }\ninline int Popcount(unsigned x) { return __builtin_popcount(x); }\ninline int Popcount(unsigned long x) { return __builtin_popcountl(x); }\ninline int Popcount(unsigned long long x) { return __builtin_popcountll(x); }\n\n#elif COMPILER_IS_MSVC\n\n#if _M_IX86\ninline unsigned long LowDword(unsigned __int64 value) {\n  return (unsigned long)value;\n}\n\ninline unsigned long HighDword(unsigned __int64 value) {\n  unsigned long high;\n  memcpy(&high, (unsigned char*)&value + sizeof(high), sizeof(high));\n  return high;\n}\n#endif\n\ninline int Clz(unsigned long mask) {\n  if (mask == 0)\n    return 32;\n\n  unsigned long index;\n  _BitScanReverse(&index, mask);\n  return sizeof(unsigned long) * 8 - (index + 1);\n}\n\ninline int Clz(unsigned int mask) {\n  return Clz((unsigned long)mask);\n}\n\ninline int Clz(unsigned __int64 mask) {\n#if _M_X64 || _M_ARM64\n  if (mask == 0)\n    return 64;\n\n  unsigned long index;\n  _BitScanReverse64(&index, mask);\n  return sizeof(unsigned __int64) * 8 - (index + 1);\n#elif _M_IX86\n  int result = Clz(HighDword(mask));\n  if (result == 32)\n    result += Clz(LowDword(mask));\n\n  return result;\n#else\n#error unexpected architecture\n#endif\n}\n\ninline int Ctz(unsigned long mask) {\n  if (mask == 0)\n    return 32;\n\n  unsigned long index;\n  _BitScanForward(&index, mask);\n  return index;\n}\n\ninline int Ctz(unsigned int mask) {\n  return Ctz((unsigned long)mask);\n}\n\ninline int Ctz(unsigned __int64 mask) {\n#if _M_X64 || _M_ARM64\n  if (mask == 0)\n    return 64;\n\n  unsigned long index;\n  _BitScanForward64(&index, mask);\n  return index;\n#elif _M_IX86\n  int result = Ctz(LowDword(mask));\n  if (result == 32)\n    result += Ctz(HighDword(mask));\n\n  return result;\n#else\n#error unexpected architecture\n#endif\n}\n\ninline int Popcount(unsigned long value) {\n  #if _M_X64 || _M_IX86\n  return __popcnt(value);\n#elif _M_ARM64\n  return _CountOneBits(value);\n#else\n#error unexpected architecture\n#endif\n}\n\ninline int Popcount(uint8_t value) {\n  return Popcount((unsigned long)value);\n}\n\ninline int Popcount(unsigned int value) {\n  return Popcount((unsigned long)value);\n}\n\ninline int Popcount(unsigned __int64 value) {\n#if _M_X64\n  return __popcnt64(value);\n#elif _M_IX86\n  return Popcount(HighDword(value)) + Popcount(LowDword(value));\n#elif _M_ARM64\n  return _CountOneBits64(value);\n#else\n#error unexpected architecture\n#endif\n}\n\n#else\n\n#error unknown compiler\n\n#endif\n\n}  // namespace wabt\n\n#if COMPILER_IS_MSVC\n\n/* print format specifier for size_t */\n#if SIZEOF_SIZE_T == 4\n#define PRIzd \"d\"\n#define PRIzx \"x\"\n#elif SIZEOF_SIZE_T == 8\n#define PRIzd \"I64d\"\n#define PRIzx \"I64x\"\n#else\n#error \"weird sizeof size_t\"\n#endif\n\n#elif COMPILER_IS_CLANG || COMPILER_IS_GNU\n\n/* print format specifier for size_t */\n#define PRIzd \"zd\"\n#define PRIzx \"zx\"\n\n#else\n\n#error unknown compiler\n\n#endif\n\n#if HAVE_SNPRINTF\n#define wabt_snprintf snprintf\n#elif COMPILER_IS_MSVC\n/* can't just use _snprintf because it doesn't always null terminate */\n#include <cstdarg>\nint wabt_snprintf(char* str, size_t size, const char* format, ...);\n#else\n#error no snprintf\n#endif\n\n#if COMPILER_IS_MSVC\n/* can't just use vsnprintf because it doesn't always null terminate */\nint wabt_vsnprintf(char* str, size_t size, const char* format, va_list ap);\n#else\n#define wabt_vsnprintf vsnprintf\n#endif\n\n#if !HAVE_SSIZE_T\n#if COMPILER_IS_MSVC\n/* define ssize_t identically to how LLVM does, to avoid conflicts if including both */\n#if defined(_WIN64)\ntypedef signed __int64 ssize_t;\n#else\ntypedef signed int ssize_t;\n#endif /* _WIN64 */\n#else\ntypedef long ssize_t;\n#endif\n#endif\n\n#if !HAVE_STRCASECMP\n#if COMPILER_IS_MSVC\n#define strcasecmp _stricmp\n#else\n#error no strcasecmp\n#endif\n#endif\n\ndouble wabt_convert_uint64_to_double(uint64_t x);\nfloat wabt_convert_uint64_to_float(uint64_t x);\ndouble wabt_convert_int64_to_double(int64_t x);\nfloat wabt_convert_int64_to_float(int64_t x);\n\n#endif  // __cplusplus\n\n#endif /* WABT_CONFIG_H_ */\n"
  },
  {
    "path": "src/decompiler.cc",
    "content": "/*\n * Copyright 2019 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/decompiler.h\"\n\n#include \"wabt/decompiler-ast.h\"\n#include \"wabt/decompiler-ls.h\"\n#include \"wabt/decompiler-naming.h\"\n\n#include \"wabt/stream.h\"\n\n#define WABT_TRACING 0\n#include \"wabt/tracing.h\"\n\n#include <inttypes.h>\n\nnamespace wabt {\n\nstruct Decompiler {\n  Decompiler(const Module& module, const DecompileOptions& options)\n      : mc(module), options(options) {}\n\n  // Sorted such that \"greater precedence\" is also the bigger enum val.\n  enum Precedence {\n    // Low precedence.\n    None,      // precedence doesn't matter, since never nested.\n    Assign,    // =\n    OtherBin,  // min\n    Bit,       // & |\n    Equal,     // == != < > >= <=\n    Shift,     // << >>\n    Add,       // + -\n    Multiply,  // * / %\n    If,        // if{}\n    Indexing,  // []\n    Atomic,    // (), a, 1, a()\n    // High precedence.\n  };\n\n  // Anything besides these will get parentheses if used with equal precedence,\n  // for clarity.\n  bool Associative(Precedence p) {\n    return p == Precedence::Add || p == Precedence::Multiply;\n  }\n\n  struct Value {\n    std::vector<std::string> v;\n    // Lazily add bracketing only if the parent requires it.\n    // This is the precedence level of this value, for example, if this\n    // precedence is Add, and the parent is Multiply, bracketing is needed,\n    // but not if it is the reverse.\n    Precedence precedence;\n\n    Value(std::vector<std::string>&& v, Precedence p) : v(v), precedence(p) {}\n\n    size_t width() {\n      size_t w = 0;\n      for (auto& s : v) {\n        w = std::max(w, s.size());\n      }\n      return w;\n    }\n\n    // This value should really never be copied, only moved.\n    Value(Value&& rhs) = default;\n    Value(const Value& rhs) = delete;\n    Value& operator=(Value&& rhs) = default;\n    Value& operator=(const Value& rhs) = delete;\n  };\n\n  std::string to_string(double d) {\n    auto s = std::to_string(d);\n    // Remove redundant trailing '0's that to_string produces.\n    while (s.size() > 2 && s.back() == '0' && s[s.size() - 2] != '.')\n      s.pop_back();\n    return s;\n  }\n\n  std::string Indent(size_t amount) { return std::string(amount, ' '); }\n\n  std::string OpcodeToToken(Opcode opcode) {\n    std::string s = opcode.GetDecomp();\n    std::replace(s.begin(), s.end(), '.', '_');\n    return s;\n  }\n\n  void IndentValue(Value& val, size_t amount, std::string_view first_indent) {\n    auto indent = Indent(amount);\n    for (auto& stat : val.v) {\n      auto is = (&stat != &val.v[0] || first_indent.empty())\n                    ? std::string_view(indent)\n                    : first_indent;\n      stat.insert(0, is.data(), is.size());\n    }\n  }\n\n  Value WrapChild(Value& child,\n                  std::string_view prefix,\n                  std::string_view postfix,\n                  Precedence precedence) {\n    auto width = prefix.size() + postfix.size() + child.width();\n    auto& v = child.v;\n    if (width < target_exp_width ||\n        (prefix.size() <= indent_amount && postfix.size() <= indent_amount)) {\n      if (v.size() == 1) {\n        // Fits in a single line.\n        v[0].insert(0, prefix.data(), prefix.size());\n        v[0].append(postfix.data(), postfix.size());\n      } else {\n        // Multiline, but with prefix on same line.\n        IndentValue(child, prefix.size(), prefix);\n        v.back().append(postfix.data(), postfix.size());\n      }\n    } else {\n      // Multiline with prefix on its own line.\n      IndentValue(child, indent_amount, {});\n      v.insert(v.begin(), std::string(prefix));\n      v.back().append(postfix.data(), postfix.size());\n    }\n    child.precedence = precedence;\n    return std::move(child);\n  }\n\n  void BracketIfNeeded(Value& val, Precedence parent_precedence) {\n    if (parent_precedence < val.precedence ||\n        (parent_precedence == val.precedence &&\n         Associative(parent_precedence))) {\n      return;\n    }\n    val = WrapChild(val, \"(\", \")\", Precedence::Atomic);\n  }\n\n  Value WrapBinary(std::vector<Value>& args,\n                   std::string_view infix,\n                   bool indent_right,\n                   Precedence precedence) {\n    assert(args.size() == 2);\n    auto& left = args[0];\n    auto& right = args[1];\n    BracketIfNeeded(left, precedence);\n    BracketIfNeeded(right, precedence);\n    auto width = infix.size() + left.width() + right.width() + 2;\n    if (width < target_exp_width && left.v.size() == 1 && right.v.size() == 1) {\n      return Value{{cat(left.v[0], \" \", infix, \" \", right.v[0])}, precedence};\n    } else {\n      Value bin{{}, precedence};\n      std::move(left.v.begin(), left.v.end(), std::back_inserter(bin.v));\n      bin.v.back().append(\" \", 1);\n      bin.v.back().append(infix.data(), infix.size());\n      if (indent_right) {\n        IndentValue(right, indent_amount, {});\n      }\n      std::move(right.v.begin(), right.v.end(), std::back_inserter(bin.v));\n      return bin;\n    }\n  }\n\n  Value WrapNAry(std::vector<Value>& args,\n                 std::string_view prefix,\n                 std::string_view postfix,\n                 Precedence precedence) {\n    size_t total_width = 0;\n    size_t max_width = 0;\n    bool multiline = false;\n    for (auto& child : args) {\n      auto w = child.width();\n      max_width = std::max(max_width, w);\n      total_width += w;\n      multiline = multiline || child.v.size() > 1;\n    }\n    if (!multiline &&\n        (total_width + prefix.size() + postfix.size() < target_exp_width ||\n         args.empty())) {\n      // Single line.\n      auto s = std::string(prefix);\n      for (auto& child : args) {\n        if (&child != &args[0])\n          s += \", \";\n        s += child.v[0];\n      }\n      s += postfix;\n      return Value{{std::move(s)}, precedence};\n    } else {\n      // Multi-line.\n      Value ml{{}, precedence};\n      auto ident_with_name = max_width + prefix.size() < target_exp_width;\n      size_t i = 0;\n      for (auto& child : args) {\n        IndentValue(child, ident_with_name ? prefix.size() : indent_amount,\n                    !i && ident_with_name ? prefix : std::string_view{});\n        if (i < args.size() - 1) {\n          child.v.back() += \",\";\n        }\n        std::move(child.v.begin(), child.v.end(), std::back_inserter(ml.v));\n        i++;\n      }\n      if (!ident_with_name) {\n        ml.v.insert(ml.v.begin(), std::string(prefix));\n      }\n      ml.v.back() += postfix;\n      return ml;\n    }\n  }\n\n  std::string_view VarName(std::string_view name) {\n    assert(!name.empty());\n    return name[0] == '$' ? name.substr(1) : name;\n  }\n\n  template <ExprType T>\n  Value Get(const VarExpr<T>& ve) {\n    return Value{{std::string(VarName(ve.var.name()))}, Precedence::Atomic};\n  }\n\n  template <ExprType T>\n  Value Set(Value& child, const VarExpr<T>& ve) {\n    return WrapChild(child, VarName(ve.var.name()) + \" = \", \"\",\n                     Precedence::Assign);\n  }\n\n  std::string TempVarName(Index n) {\n    // FIXME: this needs much better variable naming. Problem is, the code\n    // in generate-names.cc has allready run, its dictionaries deleted, so it\n    // is not easy to integrate with it.\n    return \"t\" + std::to_string(n);\n  }\n\n  std::string LocalDecl(const std::string& name, Type t) {\n    auto struc = lst.GenTypeDecl(name);\n    return cat(VarName(name), \":\",\n               struc.empty() ? GetDecompTypeName(t) : struc);\n  }\n\n  bool ConstIntVal(const Expr* e, uint64_t& dest) {\n    dest = 0;\n    if (!e || e->type() != ExprType::Const) {\n      return false;\n    }\n    auto& c = cast<ConstExpr>(e)->const_;\n    if (c.type() != Type::I32 && c.type() != Type::I64) {\n      return false;\n    }\n    dest = c.type() == Type::I32 ? c.u32() : c.u64();\n    return true;\n  }\n\n  void LoadStore(Value& val,\n                 const Node& addr_exp,\n                 uint64_t offset,\n                 Opcode opc,\n                 Address align,\n                 Type op_type) {\n    bool append_type = true;\n    auto access = lst.GenAccess(offset, addr_exp);\n    if (!access.empty()) {\n      if (access == \"*\") {\n        // The variable was declared as a typed pointer, so this access\n        // doesn't need a type.\n        append_type = false;\n      } else {\n        // We can do this load/store as a struct access.\n        BracketIfNeeded(val, Precedence::Indexing);\n        val.v.back() += \".\" + access;\n        return;\n      }\n    }\n    // Detect absolute addressing, which we try to turn into references to the\n    // data section when possible.\n    uint64_t abs_base;\n    if (ConstIntVal(addr_exp.e, abs_base)) {\n      // We don't care what part of the absolute address was stored where,\n      // 1[0] and 0[1] are the same.\n      abs_base += offset;\n      // FIXME: make this less expensive with a binary search or whatever.\n      for (auto dat : mc.module.data_segments) {\n        uint64_t dat_base;\n        if (dat->offset.size() == 1 &&\n            ConstIntVal(&dat->offset.front(), dat_base) &&\n            abs_base >= dat_base && abs_base < dat_base + dat->data.size()) {\n          // We are inside the range of this data segment!\n          // Turn expression into data_name[index]\n          val = Value{{dat->name}, Precedence::Atomic};\n          // The new offset is from the start of the data segment, instead of\n          // whatever it was.. this may be a different value from both the\n          // original const and offset!\n          offset = abs_base - dat_base;\n        }\n      }\n    }\n    // Do the load/store as a generalized indexing operation.\n    // The offset is divisible by the alignment in 99.99% of\n    // cases, but the spec doesn't guarantee it, so we must\n    // have a backup syntax.\n    auto index = offset % align == 0\n                     ? std::to_string(offset / align)\n                     : cat(std::to_string(offset), \"@\", std::to_string(align));\n    // Detect the very common case of (base + (index << 2))[0]:int etc.\n    // so we can instead do base[index]:int\n    // TODO: (index << 2) on the left of + occurs also.\n    // TODO: sadly this does not address cases where the shift amount > align.\n    // (which happens for arrays of structs or arrays of long (with align=4)).\n    // TODO: also very common is (v = base + (index << 2))[0]:int\n    if (addr_exp.etype == ExprType::Binary) {\n      auto& pe = *cast<BinaryExpr>(addr_exp.e);\n      auto& shift_exp = addr_exp.children[1];\n      if (pe.opcode == Opcode::I32Add && shift_exp.etype == ExprType::Binary) {\n        auto& se = *cast<BinaryExpr>(shift_exp.e);\n        auto& const_exp = shift_exp.children[1];\n        if (se.opcode == Opcode::I32Shl && const_exp.etype == ExprType::Const) {\n          auto& ce = *cast<ConstExpr>(const_exp.e);\n          if (ce.const_.type() == Type::I32 &&\n              (1ULL << ce.const_.u32()) == align) {\n            // Pfew, case detected :( Lets re-write this in Haskell.\n            // TODO: we're decompiling these twice.\n            // The thing to the left of << is going to be part of the index.\n            auto ival = DecompileExpr(shift_exp.children[0], &shift_exp);\n            if (ival.v.size() == 1) {  // Don't bother if huge.\n              if (offset == 0) {\n                index = ival.v[0];\n              } else {\n                BracketIfNeeded(ival, Precedence::Add);\n                index = cat(ival.v[0], \" + \", index);\n              }\n              // We're going to use the thing to the left of + as the new\n              // base address:\n              val = DecompileExpr(addr_exp.children[0], &addr_exp);\n            }\n          }\n        }\n      }\n    }\n    BracketIfNeeded(val, Precedence::Indexing);\n    val.v.back() += cat(\"[\", index, \"]\");\n    if (append_type) {\n      val.v.back() += cat(\":\", GetDecompTypeName(GetMemoryType(op_type, opc)),\n                          lst.GenAlign(align, opc));\n    }\n    val.precedence = Precedence::Indexing;\n  }\n\n  Value DecompileExpr(const Node& n, const Node* parent) {\n    std::vector<Value> args;\n    for (auto& c : n.children) {\n      args.push_back(DecompileExpr(c, &n));\n    }\n    // First deal with the specialized node types.\n    switch (n.ntype) {\n      case NodeType::FlushToVars: {\n        std::string decls = \"let \";\n        for (Index i = 0; i < n.u.var_count; i++) {\n          if (i) {\n            decls += \", \";\n          }\n          decls += TempVarName(n.u.var_start + i);\n        }\n        decls += \" = \";\n        return WrapNAry(args, decls, \"\", Precedence::Assign);\n      }\n      case NodeType::FlushedVar: {\n        return Value{{TempVarName(n.u.var_start)}, Precedence::Atomic};\n      }\n      case NodeType::Statements: {\n        Value stats{{}, Precedence::None};\n        for (size_t i = 0; i < n.children.size(); i++) {\n          auto& s = args[i].v.back();\n          if (s.back() != '}' && s.back() != ':') {\n            s += ';';\n          }\n          std::move(args[i].v.begin(), args[i].v.end(),\n                    std::back_inserter(stats.v));\n        }\n        return stats;\n      }\n      case NodeType::EndReturn: {\n        return WrapNAry(args, \"return \", \"\", Precedence::None);\n      }\n      case NodeType::Decl: {\n        cur_ast->vars_defined[n.u.var->name()].defined = true;\n        return Value{{\"var \" + LocalDecl(std::string(n.u.var->name()),\n                                         cur_func->GetLocalType(*n.u.var))},\n                     Precedence::None};\n      }\n      case NodeType::DeclInit: {\n        if (cur_ast->vars_defined[n.u.var->name()].defined) {\n          // This has already been pre-declared, output as assign.\n          return WrapChild(args[0], cat(VarName(n.u.var->name()), \" = \"), \"\",\n                           Precedence::None);\n        } else {\n          return WrapChild(args[0],\n                           cat(\"var \",\n                               LocalDecl(std::string(n.u.var->name()),\n                                         cur_func->GetLocalType(*n.u.var)),\n                               \" = \"),\n                           \"\", Precedence::None);\n        }\n      }\n      case NodeType::Expr:\n        // We're going to fall thru to the second switch to deal with ExprType.\n        break;\n      case NodeType::Uninitialized:\n        assert(false);\n        break;\n    }\n    // Existing ExprTypes.\n    switch (n.etype) {\n      case ExprType::Const: {\n        auto& c = cast<ConstExpr>(n.e)->const_;\n        switch (c.type()) {\n          case Type::I32:\n            return Value{{std::to_string(static_cast<int32_t>(c.u32()))},\n                         Precedence::Atomic};\n          case Type::I64:\n            return Value{{std::to_string(static_cast<int64_t>(c.u64())) + \"L\"},\n                         Precedence::Atomic};\n          case Type::F32: {\n            float f = Bitcast<float>(c.f32_bits());\n            return Value{{to_string(f) + \"f\"}, Precedence::Atomic};\n          }\n          case Type::F64: {\n            double d = Bitcast<double>(c.f64_bits());\n            return Value{{to_string(d)}, Precedence::Atomic};\n          }\n          case Type::V128:\n            return Value{{\"V128\"}, Precedence::Atomic};  // FIXME\n          default:\n            WABT_UNREACHABLE;\n        }\n      }\n      case ExprType::LocalGet: {\n        return Get(*cast<LocalGetExpr>(n.e));\n      }\n      case ExprType::GlobalGet: {\n        return Get(*cast<GlobalGetExpr>(n.e));\n      }\n      case ExprType::LocalSet: {\n        return Set(args[0], *cast<LocalSetExpr>(n.e));\n      }\n      case ExprType::GlobalSet: {\n        return Set(args[0], *cast<GlobalSetExpr>(n.e));\n      }\n      case ExprType::LocalTee: {\n        auto& te = *cast<LocalTeeExpr>(n.e);\n        return args.empty() ? Get(te) : Set(args[0], te);\n      }\n      case ExprType::Binary: {\n        auto& be = *cast<BinaryExpr>(n.e);\n        auto opcs = OpcodeToToken(be.opcode);\n        // TODO: Is this selection better done on Opcode values directly?\n        // What if new values get added and OtherBin doesn't make sense?\n        auto prec = Precedence::OtherBin;\n        if (opcs == \"*\" || opcs == \"/\" || opcs == \"%\") {\n          prec = Precedence::Multiply;\n        } else if (opcs == \"+\" || opcs == \"-\") {\n          prec = Precedence::Add;\n        } else if (opcs == \"&\" || opcs == \"|\" || opcs == \"^\") {\n          prec = Precedence::Bit;\n        } else if (opcs == \"<<\" || opcs == \">>\") {\n          prec = Precedence::Shift;\n        }\n        return WrapBinary(args, opcs, false, prec);\n      }\n      case ExprType::Compare: {\n        auto& ce = *cast<CompareExpr>(n.e);\n        return WrapBinary(args, OpcodeToToken(ce.opcode), false,\n                          Precedence::Equal);\n      }\n      case ExprType::Unary: {\n        auto& ue = *cast<UnaryExpr>(n.e);\n        // BracketIfNeeded(stack.back());\n        // TODO: also version without () depending on precedence.\n        return WrapChild(args[0], OpcodeToToken(ue.opcode) + \"(\", \")\",\n                         Precedence::Atomic);\n      }\n      case ExprType::Load: {\n        auto& le = *cast<LoadExpr>(n.e);\n        LoadStore(args[0], n.children[0], le.offset, le.opcode, le.align,\n                  le.opcode.GetResultType());\n        return std::move(args[0]);\n      }\n      case ExprType::Store: {\n        auto& se = *cast<StoreExpr>(n.e);\n        LoadStore(args[0], n.children[0], se.offset, se.opcode, se.align,\n                  se.opcode.GetParamType2());\n        return WrapBinary(args, \"=\", true, Precedence::Assign);\n      }\n      case ExprType::If: {\n        auto ife = cast<IfExpr>(n.e);\n        Value* elsep = nullptr;\n        if (!ife->false_.empty()) {\n          elsep = &args[2];\n        }\n        auto& thenp = args[1];\n        auto& ifs = args[0];\n        bool multiline = ifs.v.size() > 1 || thenp.v.size() > 1;\n        size_t width = ifs.width() + thenp.width();\n        if (elsep) {\n          width += elsep->width();\n          multiline = multiline || elsep->v.size() > 1;\n        }\n        multiline = multiline || width > target_exp_width;\n        if (multiline) {\n          auto if_start = std::string_view(\"if (\");\n          IndentValue(ifs, if_start.size(), if_start);\n          ifs.v.back() += \") {\";\n          IndentValue(thenp, indent_amount, {});\n          std::move(thenp.v.begin(), thenp.v.end(), std::back_inserter(ifs.v));\n          if (elsep) {\n            ifs.v.push_back(\"} else {\");\n            IndentValue(*elsep, indent_amount, {});\n            std::move(elsep->v.begin(), elsep->v.end(),\n                      std::back_inserter(ifs.v));\n          }\n          ifs.v.push_back(\"}\");\n          ifs.precedence = Precedence::If;\n          return std::move(ifs);\n        } else {\n          auto s = cat(\"if (\", ifs.v[0], \") {\");\n          if (!thenp.v.empty())\n            s += cat(\" \", thenp.v[0], \" \");\n          s += \"}\";\n          if (elsep)\n            s += cat(\" else { \", elsep->v[0], \" }\");\n          return Value{{std::move(s)}, Precedence::If};\n        }\n      }\n      case ExprType::Block: {\n        auto& val = args[0];\n        val.v.push_back(\n            cat(\"label \", VarName(cast<BlockExpr>(n.e)->block.label), \":\"));\n        // If this block is part of a larger statement scope, it doesn't\n        // need its own indenting, but if its part of an exp we wrap it in {}.\n        if (parent && parent->ntype != NodeType::Statements &&\n            parent->etype != ExprType::Block &&\n            parent->etype != ExprType::Loop &&\n            (parent->etype != ExprType::If || &parent->children[0] == &n)) {\n          IndentValue(val, indent_amount, {});\n          val.v.insert(val.v.begin(), \"{\");\n          val.v.push_back(\"}\");\n        }\n        val.precedence = Precedence::Atomic;\n        return std::move(val);\n      }\n      case ExprType::Loop: {\n        auto& val = args[0];\n        auto& block = cast<LoopExpr>(n.e)->block;\n        IndentValue(val, indent_amount, {});\n        val.v.insert(val.v.begin(), cat(\"loop \", VarName(block.label), \" {\"));\n        val.v.push_back(\"}\");\n        val.precedence = Precedence::Atomic;\n        return std::move(val);\n      }\n      case ExprType::Br: {\n        auto be = cast<BrExpr>(n.e);\n        return Value{{(n.u.lt == LabelType::Loop ? \"continue \" : \"goto \") +\n                      VarName(be->var.name())},\n                     Precedence::None};\n      }\n      case ExprType::BrIf: {\n        auto bie = cast<BrIfExpr>(n.e);\n        auto jmp = n.u.lt == LabelType::Loop ? \"continue\" : \"goto\";\n        return WrapChild(args[0], \"if (\",\n                         cat(\") \", jmp, \" \", VarName(bie->var.name())),\n                         Precedence::None);\n      }\n      case ExprType::Return: {\n        return WrapNAry(args, \"return \", \"\", Precedence::None);\n      }\n      case ExprType::Rethrow: {\n        return WrapNAry(args, \"rethrow \", \"\", Precedence::None);\n      }\n      case ExprType::Drop: {\n        // Silent dropping of return values is very common, so currently\n        // don't output this.\n        return std::move(args[0]);\n      }\n      case ExprType::Nop: {\n        return Value{{\"nop\"}, Precedence::None};\n      }\n      case ExprType::Unreachable: {\n        return Value{{\"unreachable\"}, Precedence::None};\n      }\n      case ExprType::RefNull: {\n        return Value{{\"null\"}, Precedence::Atomic};\n      }\n      case ExprType::BrTable: {\n        auto bte = cast<BrTableExpr>(n.e);\n        std::string ts = \"br_table[\";\n        for (auto& v : bte->targets) {\n          ts += VarName(v.name());\n          ts += \", \";\n        }\n        ts += \"..\";\n        ts += VarName(bte->default_target.name());\n        ts += \"](\";\n        return WrapChild(args[0], ts, \")\", Precedence::Atomic);\n      }\n      case ExprType::CodeMetadata: {\n        auto cme = cast<CodeMetadataExpr>(n.e);\n        std::string c = \"// @metadata.code.\" + cme->name + \" \";\n        c += BinaryToString(cme->data);\n        return Value{{std::move(c)}, Precedence::None};\n      }\n      default: {\n        // Everything that looks like a function call.\n        std::string name;\n        auto precedence = Precedence::Atomic;\n        switch (n.etype) {\n          case ExprType::Call:\n            name = cast<CallExpr>(n.e)->var.name();\n            break;\n          case ExprType::ReturnCall:\n            name = \"return_call \" + cast<ReturnCallExpr>(n.e)->var.name();\n            precedence = Precedence::None;\n            break;\n          case ExprType::Convert:\n            name = std::string(OpcodeToToken(cast<ConvertExpr>(n.e)->opcode));\n            break;\n          case ExprType::Ternary:\n            name = std::string(OpcodeToToken(cast<TernaryExpr>(n.e)->opcode));\n            break;\n          case ExprType::Select:\n            // This one looks like it could be translated to \"?:\" style ternary,\n            // but the arguments are NOT lazy, and side effects definitely do\n            // occur in the branches. So it has no clear equivalent in C-syntax.\n            // To emphasize that all args are being evaluated in order, we\n            // leave it as a function call.\n            name = \"select_if\";\n            break;\n          case ExprType::MemoryGrow:\n            name = \"memory_grow\";\n            break;\n          case ExprType::MemorySize:\n            name = \"memory_size\";\n            break;\n          case ExprType::MemoryCopy:\n            name = \"memory_copy\";\n            break;\n          case ExprType::MemoryFill:\n            name = \"memory_fill\";\n            break;\n          case ExprType::RefIsNull:\n            name = \"is_null\";\n            break;\n          case ExprType::CallIndirect:\n            name = \"call_indirect\";\n            break;\n          case ExprType::ReturnCallIndirect:\n            name = \"return_call call_indirect\";\n            break;\n          default:\n            name = GetExprTypeName(n.etype);\n            break;\n        }\n        return WrapNAry(args, name + \"(\", \")\", precedence);\n      }\n    }\n  }\n\n  bool CheckImportExport(std::string& s,\n                         ExternalKind kind,\n                         Index index,\n                         std::string_view name) {\n    // Figure out if this thing is imported, exported, or neither.\n    auto is_import = mc.module.IsImport(kind, Var(index, Location()));\n    // TODO: is this the best way to check for export?\n    // FIXME: this doesn't work for functions that get renamed in some way,\n    // as the export has the original name..\n    auto xport = mc.module.GetExport(name);\n    auto is_export = xport && xport->kind == kind;\n    if (is_export)\n      s += \"export \";\n    if (is_import)\n      s += \"import \";\n    return is_import;\n  }\n\n  std::string InitExp(const ExprList& el) {\n    assert(!el.empty());\n    AST ast(mc, nullptr);\n    ast.Construct(el, 1, 0, false);\n    auto val = DecompileExpr(ast.exp_stack[0], nullptr);\n    assert(ast.exp_stack.size() == 1 && val.v.size() == 1);\n    return std::move(val.v[0]);\n  }\n\n  // FIXME: Merge with WatWriter::WriteQuotedData somehow.\n  std::string BinaryToString(const std::vector<uint8_t>& in) {\n    std::string s = \"\\\"\";\n    size_t line_start = 0;\n    static const char s_hexdigits[] = \"0123456789abcdef\";\n    for (auto c : in) {\n      if (c >= ' ' && c <= '~' && c != '\"' && c != '\\\\') {\n        s += c;\n      } else {\n        s += '\\\\';\n        s += s_hexdigits[c >> 4];\n        s += s_hexdigits[c & 0xf];\n      }\n      if (s.size() - line_start > target_exp_width) {\n        if (line_start == 0) {\n          s = \"  \" + s;\n        }\n        s += \"\\\"\\n  \";\n        line_start = s.size();\n        s += \"\\\"\";\n      }\n    }\n    s += '\\\"';\n    return s;\n  }\n\n  std::string Decompile() {\n    std::string s;\n    // Memories.\n    Index memory_index = 0;\n    for (auto m : mc.module.memories) {\n      auto is_import =\n          CheckImportExport(s, ExternalKind::Memory, memory_index, m->name);\n      s += cat(\"memory \", m->name);\n      if (!is_import) {\n        s += cat(\"(initial: \", std::to_string(m->page_limits.initial),\n                 \", max: \", std::to_string(m->page_limits.max), \")\");\n      }\n      s += \";\\n\";\n      memory_index++;\n    }\n    if (!mc.module.memories.empty())\n      s += \"\\n\";\n\n    // Globals.\n    Index global_index = 0;\n    for (auto g : mc.module.globals) {\n      auto is_import =\n          CheckImportExport(s, ExternalKind::Global, global_index, g->name);\n      s += cat(\"global \", g->name, \":\", GetDecompTypeName(g->type));\n      if (!is_import) {\n        s += cat(\" = \", InitExp(g->init_expr));\n      }\n      s += \";\\n\";\n      global_index++;\n    }\n    if (!mc.module.globals.empty())\n      s += \"\\n\";\n\n    // Tables.\n    Index table_index = 0;\n    for (auto tab : mc.module.tables) {\n      auto is_import =\n          CheckImportExport(s, ExternalKind::Table, table_index, tab->name);\n      s += cat(\"table \", tab->name, \":\", GetDecompTypeName(tab->elem_type));\n      if (!is_import) {\n        s += cat(\"(min: \", std::to_string(tab->elem_limits.initial),\n                 \", max: \", std::to_string(tab->elem_limits.max), \")\");\n      }\n      s += \";\\n\";\n      table_index++;\n    }\n    if (!mc.module.tables.empty())\n      s += \"\\n\";\n\n    // Data.\n    for (auto dat : mc.module.data_segments) {\n      s += cat(\"data \", dat->name,\n               dat->kind != SegmentKind::Passive\n                   ? cat(\"(offset: \", InitExp(dat->offset))\n                   : \"(passive\",\n               \") =\");\n      auto ds = BinaryToString(dat->data);\n      if (ds.size() > target_exp_width / 2) {\n        s += \"\\n\";\n      } else {\n        s += \" \";\n      }\n      s += ds;\n      s += \";\\n\";\n    }\n    if (!mc.module.data_segments.empty())\n      s += \"\\n\";\n\n    // Code.\n    Index func_index = 0;\n    for (auto f : mc.module.funcs) {\n      cur_func = f;\n      auto is_import =\n          CheckImportExport(s, ExternalKind::Func, func_index, f->name);\n      AST ast(mc, f);\n      cur_ast = &ast;\n      if (!is_import) {\n        ast.Construct(f->exprs, f->GetNumResults(), 0, true);\n        lst.Track(ast.exp_stack[0]);\n        lst.CheckLayouts();\n      }\n      s += cat(\"function \", f->name, \"(\");\n      for (Index i = 0; i < f->GetNumParams(); i++) {\n        if (i)\n          s += \", \";\n        auto t = f->GetParamType(i);\n        auto name = \"$\" + IndexToAlphaName(i);\n        s += LocalDecl(name, t);\n      }\n      s += \")\";\n      if (f->GetNumResults()) {\n        if (f->GetNumResults() == 1) {\n          s += cat(\":\", GetDecompTypeName(f->GetResultType(0)));\n        } else {\n          s += \":(\";\n          for (Index i = 0; i < f->GetNumResults(); i++) {\n            if (i)\n              s += \", \";\n            s += GetDecompTypeName(f->GetResultType(i));\n          }\n          s += \")\";\n        }\n      }\n      if (is_import) {\n        s += cat(\"; // func\", std::to_string(func_index));\n      } else {\n        s += cat(\" { // func\", std::to_string(func_index), \"\\n\");\n        auto val = DecompileExpr(ast.exp_stack[0], nullptr);\n        IndentValue(val, indent_amount, {});\n        for (auto& stat : val.v) {\n          s += stat;\n          s += \"\\n\";\n        }\n        s += \"}\";\n      }\n      s += \"\\n\\n\";\n      mc.EndFunc();\n      lst.Clear();\n      func_index++;\n      cur_ast = nullptr;\n      cur_func = nullptr;\n    }\n    return s;\n  }\n\n  ModuleContext mc;\n  const DecompileOptions& options;\n  size_t indent_amount = 2;\n  size_t target_exp_width = 70;\n  const Func* cur_func = nullptr;\n  AST* cur_ast = nullptr;\n  LoadStoreTracking lst;\n};\n\nstd::string Decompile(const Module& module, const DecompileOptions& options) {\n  Decompiler decompiler(module, options);\n  return decompiler.Decompile();\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/emscripten-exports.txt",
    "content": "_free\n_malloc\n_wabt_annotations_enabled\n_wabt_apply_names_module\n_wabt_bulk_memory_enabled\n_wabt_code_metadata_enabled\n_wabt_compact_imports_enabled\n_wabt_custom_page_sizes_enabled\n_wabt_destroy_errors\n_wabt_destroy_features\n_wabt_destroy_module\n_wabt_destroy_output_buffer\n_wabt_destroy_parse_wat_result\n_wabt_destroy_read_binary_result\n_wabt_destroy_wast_lexer\n_wabt_destroy_write_module_result\n_wabt_exceptions_enabled\n_wabt_extended_const_enabled\n_wabt_format_binary_errors\n_wabt_format_text_errors\n_wabt_function_references_enabled\n_wabt_gc_enabled\n_wabt_generate_names_module\n_wabt_memory64_enabled\n_wabt_multi_memory_enabled\n_wabt_multi_value_enabled\n_wabt_mutable_globals_enabled\n_wabt_new_errors\n_wabt_new_features\n_wabt_new_wast_buffer_lexer\n_wabt_output_buffer_get_data\n_wabt_output_buffer_get_size\n_wabt_parse_wast\n_wabt_parse_wast_result_get_result\n_wabt_parse_wast_result_release_module\n_wabt_parse_wat\n_wabt_parse_wat_result_get_result\n_wabt_parse_wat_result_release_module\n_wabt_read_binary\n_wabt_read_binary_result_get_result\n_wabt_read_binary_result_release_module\n_wabt_reference_types_enabled\n_wabt_relaxed_simd_enabled\n_wabt_sat_float_to_int_enabled\n_wabt_set_annotations_enabled\n_wabt_set_bulk_memory_enabled\n_wabt_set_code_metadata_enabled\n_wabt_set_compact_imports_enabled\n_wabt_set_custom_page_sizes_enabled\n_wabt_set_exceptions_enabled\n_wabt_set_extended_const_enabled\n_wabt_set_function_references_enabled\n_wabt_set_gc_enabled\n_wabt_set_memory64_enabled\n_wabt_set_multi_memory_enabled\n_wabt_set_multi_value_enabled\n_wabt_set_mutable_globals_enabled\n_wabt_set_reference_types_enabled\n_wabt_set_relaxed_simd_enabled\n_wabt_set_sat_float_to_int_enabled\n_wabt_set_sign_extension_enabled\n_wabt_set_simd_enabled\n_wabt_set_tail_call_enabled\n_wabt_set_threads_enabled\n_wabt_set_wide_arithmetic_enabled\n_wabt_sign_extension_enabled\n_wabt_simd_enabled\n_wabt_tail_call_enabled\n_wabt_threads_enabled\n_wabt_validate_module\n_wabt_validate_script\n_wabt_wide_arithmetic_enabled\n_wabt_write_binary_module\n_wabt_write_binary_spec_script\n_wabt_write_module_result_get_result\n_wabt_write_module_result_release_log_output_buffer\n_wabt_write_module_result_release_output_buffer\n_wabt_write_text_module\n"
  },
  {
    "path": "src/emscripten-helpers.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WABT_EMSCRIPTEN_HELPERS_H_\n#define WABT_EMSCRIPTEN_HELPERS_H_\n\n#include <cstddef>\n\n#include <algorithm>\n#include <iterator>\n#include <memory>\n#include <utility>\n#include <vector>\n\n#include \"wabt/apply-names.h\"\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/binary-writer-spec.h\"\n#include \"wabt/binary-writer.h\"\n#include \"wabt/common.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/filenames.h\"\n#include \"wabt/generate-names.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/validator.h\"\n#include \"wabt/wast-lexer.h\"\n#include \"wabt/wast-parser.h\"\n#include \"wabt/wat-writer.h\"\n\nusing WabtOutputBufferPtr = std::unique_ptr<wabt::OutputBuffer>;\nusing WabtFilenameOutputBufferPair =\n    std::pair<std::string, WabtOutputBufferPtr>;\n\nstruct WabtParseWatResult {\n  wabt::Result result;\n  std::unique_ptr<wabt::Module> module;\n};\n\nstruct WabtReadBinaryResult {\n  wabt::Result result;\n  std::unique_ptr<wabt::Module> module;\n};\n\nstruct WabtWriteModuleResult {\n  wabt::Result result;\n  WabtOutputBufferPtr buffer;\n  WabtOutputBufferPtr log_buffer;\n};\n\nstruct WabtWriteScriptResult {\n  wabt::Result result;\n  WabtOutputBufferPtr json_buffer;\n  WabtOutputBufferPtr log_buffer;\n  std::vector<WabtFilenameOutputBufferPair> module_buffers;\n};\n\nstruct WabtParseWastResult {\n  wabt::Result result;\n  std::unique_ptr<wabt::Script> script;\n};\n\nextern \"C\" {\n\nwabt::Features* wabt_new_features(void) {\n  return new wabt::Features();\n}\n\nvoid wabt_destroy_features(wabt::Features* f) {\n  delete f;\n}\n\n#define WABT_FEATURE(variable, flag, default_, help)                   \\\n  bool wabt_##variable##_enabled(wabt::Features* f) {                  \\\n    return f->variable##_enabled();                                    \\\n  }                                                                    \\\n  void wabt_set_##variable##_enabled(wabt::Features* f, int enabled) { \\\n    f->set_##variable##_enabled(enabled);                              \\\n  }\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n\nwabt::WastLexer* wabt_new_wast_buffer_lexer(const char* filename,\n                                            const void* data,\n                                            size_t size,\n                                            wabt::Errors* errors) {\n  std::unique_ptr<wabt::WastLexer> lexer =\n      wabt::WastLexer::CreateBufferLexer(filename, data, size, errors);\n  return lexer.release();\n}\n\nWabtParseWatResult* wabt_parse_wat(wabt::WastLexer* lexer,\n                                   wabt::Features* features,\n                                   wabt::Errors* errors) {\n  wabt::WastParseOptions options(*features);\n  WabtParseWatResult* result = new WabtParseWatResult();\n  std::unique_ptr<wabt::Module> module;\n  result->result = wabt::ParseWatModule(lexer, &module, errors, &options);\n  result->module = std::move(module);\n  return result;\n}\n\nWabtParseWastResult* wabt_parse_wast(wabt::WastLexer* lexer,\n                                     wabt::Features* features,\n                                     wabt::Errors* errors) {\n  wabt::WastParseOptions options(*features);\n  WabtParseWastResult* result = new WabtParseWastResult();\n  std::unique_ptr<wabt::Script> script;\n  result->result = wabt::ParseWastScript(lexer, &script, errors, &options);\n  result->script = std::move(script);\n  return result;\n}\n\nWabtReadBinaryResult* wabt_read_binary(const void* data,\n                                       size_t size,\n                                       int read_debug_names,\n                                       wabt::Features* features,\n                                       wabt::Errors* errors) {\n  wabt::ReadBinaryOptions options;\n  options.features = *features;\n  options.read_debug_names = read_debug_names;\n\n  WabtReadBinaryResult* result = new WabtReadBinaryResult();\n  wabt::Module* module = new wabt::Module();\n  // TODO(binji): Pass through from wabt_read_binary parameter.\n  const char* filename = \"<binary>\";\n  result->result =\n      wabt::ReadBinaryIr(filename, data, size, options, errors, module);\n  result->module.reset(module);\n  return result;\n}\n\nwabt::Result::Enum wabt_validate_module(wabt::Module* module,\n                                        wabt::Features* features,\n                                        wabt::Errors* errors) {\n  wabt::ValidateOptions options;\n  options.features = *features;\n  return ValidateModule(module, errors, options);\n}\n\nwabt::Result::Enum wabt_validate_script(wabt::Script* script,\n                                        wabt::Features* features,\n                                        wabt::Errors* errors) {\n  wabt::ValidateOptions options;\n  options.features = *features;\n  return ValidateScript(script, errors, options);\n}\n\nWabtWriteScriptResult* wabt_write_binary_spec_script(\n    wabt::Script* script,\n    const char* source_filename,\n    const char* out_filename,\n    int log,\n    int canonicalize_lebs,\n    int relocatable,\n    int write_debug_names) {\n  wabt::MemoryStream log_stream;\n  wabt::MemoryStream* log_stream_p = log ? &log_stream : nullptr;\n\n  wabt::WriteBinaryOptions options;\n  options.canonicalize_lebs = canonicalize_lebs;\n  options.relocatable = relocatable;\n  options.write_debug_names = write_debug_names;\n\n  std::vector<wabt::FilenameMemoryStreamPair> module_streams;\n  wabt::MemoryStream json_stream(log_stream_p);\n\n  std::string module_filename_noext(\n      wabt::StripExtension(out_filename ? out_filename : source_filename));\n\n  WabtWriteScriptResult* result = new WabtWriteScriptResult();\n  result->result = WriteBinarySpecScript(&json_stream, script, source_filename,\n                                         module_filename_noext, options,\n                                         &module_streams, log_stream_p);\n\n  if (result->result == wabt::Result::Ok) {\n    result->json_buffer = json_stream.ReleaseOutputBuffer();\n    result->log_buffer = log ? log_stream.ReleaseOutputBuffer() : nullptr;\n    std::transform(module_streams.begin(), module_streams.end(),\n                   std::back_inserter(result->module_buffers),\n                   [](wabt::FilenameMemoryStreamPair& pair) {\n                     return WabtFilenameOutputBufferPair(\n                         pair.filename, pair.stream->ReleaseOutputBuffer());\n                   });\n  }\n  return result;\n}\n\nwabt::Result::Enum wabt_apply_names_module(wabt::Module* module) {\n  return ApplyNames(module);\n}\n\nwabt::Result::Enum wabt_generate_names_module(wabt::Module* module) {\n  return GenerateNames(module);\n}\n\nWabtWriteModuleResult* wabt_write_binary_module(wabt::Module* module,\n                                                int log,\n                                                int canonicalize_lebs,\n                                                int relocatable,\n                                                int write_debug_names) {\n  wabt::MemoryStream log_stream;\n  wabt::WriteBinaryOptions options;\n  options.canonicalize_lebs = canonicalize_lebs;\n  options.relocatable = relocatable;\n  options.write_debug_names = write_debug_names;\n\n  wabt::MemoryStream stream(log ? &log_stream : nullptr);\n  WabtWriteModuleResult* result = new WabtWriteModuleResult();\n  result->result = WriteBinaryModule(&stream, module, options);\n  if (result->result == wabt::Result::Ok) {\n    result->buffer = stream.ReleaseOutputBuffer();\n    result->log_buffer = log ? log_stream.ReleaseOutputBuffer() : nullptr;\n  }\n  return result;\n}\n\nWabtWriteModuleResult* wabt_write_text_module(wabt::Module* module,\n                                              int fold_exprs,\n                                              int inline_export) {\n  wabt::WriteWatOptions options;\n  options.fold_exprs = fold_exprs;\n  options.inline_export = inline_export;\n\n  wabt::MemoryStream stream;\n  WabtWriteModuleResult* result = new WabtWriteModuleResult();\n  result->result = WriteWat(&stream, module, options);\n  if (result->result == wabt::Result::Ok) {\n    result->buffer = stream.ReleaseOutputBuffer();\n  }\n  return result;\n}\n\nvoid wabt_destroy_module(wabt::Module* module) {\n  delete module;\n}\n\nvoid wabt_destroy_wast_lexer(wabt::WastLexer* lexer) {\n  delete lexer;\n}\n\n// Errors\nwabt::Errors* wabt_new_errors(void) {\n  return new wabt::Errors();\n}\n\nwabt::OutputBuffer* wabt_format_text_errors(wabt::Errors* errors,\n                                            wabt::WastLexer* lexer) {\n  auto line_finder = lexer->MakeLineFinder();\n  std::string string_result = FormatErrorsToString(\n      *errors, wabt::Location::Type::Text, line_finder.get());\n\n  wabt::OutputBuffer* result = new wabt::OutputBuffer();\n  std::copy(string_result.begin(), string_result.end(),\n            std::back_inserter(result->data));\n  return result;\n}\n\nwabt::OutputBuffer* wabt_format_binary_errors(wabt::Errors* errors) {\n  std::string string_result =\n      FormatErrorsToString(*errors, wabt::Location::Type::Binary);\n\n  wabt::OutputBuffer* result = new wabt::OutputBuffer();\n  std::copy(string_result.begin(), string_result.end(),\n            std::back_inserter(result->data));\n  return result;\n}\n\nvoid wabt_destroy_errors(wabt::Errors* errors) {\n  delete errors;\n}\n\n// WabtParseWatResult\nwabt::Result::Enum wabt_parse_wat_result_get_result(\n    WabtParseWatResult* result) {\n  return result->result;\n}\n\nwabt::Module* wabt_parse_wat_result_release_module(WabtParseWatResult* result) {\n  return result->module.release();\n}\n\nvoid wabt_destroy_parse_wat_result(WabtParseWatResult* result) {\n  delete result;\n}\n\n// WabtParseWastResult\nwabt::Result::Enum wabt_parse_wast_result_get_result(\n    WabtParseWastResult* result) {\n  return result->result;\n}\n\nwabt::Script* wabt_parse_wast_result_release_module(\n    WabtParseWastResult* result) {\n  return result->script.release();\n}\n\nvoid wabt_destroy_parse_wast_result(WabtParseWastResult* result) {\n  delete result;\n}\n\n// WabtReadBinaryResult\nwabt::Result::Enum wabt_read_binary_result_get_result(\n    WabtReadBinaryResult* result) {\n  return result->result;\n}\n\nwabt::Module* wabt_read_binary_result_release_module(\n    WabtReadBinaryResult* result) {\n  return result->module.release();\n}\n\nvoid wabt_destroy_read_binary_result(WabtReadBinaryResult* result) {\n  delete result;\n}\n\n// WabtWriteModuleResult\nwabt::Result::Enum wabt_write_module_result_get_result(\n    WabtWriteModuleResult* result) {\n  return result->result;\n}\n\nwabt::OutputBuffer* wabt_write_module_result_release_output_buffer(\n    WabtWriteModuleResult* result) {\n  return result->buffer.release();\n}\n\nwabt::OutputBuffer* wabt_write_module_result_release_log_output_buffer(\n    WabtWriteModuleResult* result) {\n  return result->log_buffer.release();\n}\n\nvoid wabt_destroy_write_module_result(WabtWriteModuleResult* result) {\n  delete result;\n}\n\n// WabtWriteScriptResult\nwabt::Result::Enum wabt_write_script_result_get_result(\n    WabtWriteScriptResult* result) {\n  return result->result;\n}\n\nwabt::OutputBuffer* wabt_write_script_result_release_json_output_buffer(\n    WabtWriteScriptResult* result) {\n  return result->json_buffer.release();\n}\n\nwabt::OutputBuffer* wabt_write_script_result_release_log_output_buffer(\n    WabtWriteScriptResult* result) {\n  return result->log_buffer.release();\n}\n\nsize_t wabt_write_script_result_get_module_count(\n    WabtWriteScriptResult* result) {\n  return result->module_buffers.size();\n}\n\nconst char* wabt_write_script_result_get_module_filename(\n    WabtWriteScriptResult* result,\n    size_t index) {\n  return result->module_buffers[index].first.c_str();\n}\n\nwabt::OutputBuffer* wabt_write_script_result_release_module_output_buffer(\n    WabtWriteScriptResult* result,\n    size_t index) {\n  return result->module_buffers[index].second.release();\n}\n\nvoid wabt_destroy_write_script_result(WabtWriteScriptResult* result) {\n  delete result;\n}\n\n// wabt::OutputBuffer*\nconst void* wabt_output_buffer_get_data(wabt::OutputBuffer* output_buffer) {\n  return output_buffer->data.data();\n}\n\nsize_t wabt_output_buffer_get_size(wabt::OutputBuffer* output_buffer) {\n  return output_buffer->data.size();\n}\n\nvoid wabt_destroy_output_buffer(wabt::OutputBuffer* output_buffer) {\n  delete output_buffer;\n}\n\n}  // extern \"C\"\n\n#endif /* WABT_EMSCRIPTEN_HELPERS_H_ */\n"
  },
  {
    "path": "src/error-formatter.cc",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/error-formatter.h\"\n\nnamespace wabt {\n\nnamespace {\n\nstd::string FormatError(const Error& error,\n                        Location::Type location_type,\n                        const Color& color,\n                        LexerSourceLineFinder* line_finder,\n                        int source_line_max_length,\n                        int indent) {\n  std::string indent_str(indent, ' ');\n  std::string result = indent_str;\n\n  result += color.MaybeBoldCode();\n\n  const Location& loc = error.loc;\n  if (!loc.filename.empty()) {\n    result += loc.filename;\n    result += \":\";\n  }\n\n  if (location_type == Location::Type::Text) {\n    result += StringPrintf(\"%d:%d: \", loc.line, loc.first_column);\n  } else if (loc.offset != kInvalidOffset) {\n    result += StringPrintf(\"%07\" PRIzx \": \", loc.offset);\n  }\n\n  result += color.MaybeRedCode();\n  result += GetErrorLevelName(error.error_level);\n  result += \": \";\n  result += color.MaybeDefaultCode();\n\n  result += error.message;\n  result += '\\n';\n\n  LexerSourceLineFinder::SourceLine source_line;\n  if (line_finder) {\n    line_finder->GetSourceLine(loc, source_line_max_length, &source_line);\n  }\n\n  if (!source_line.line.empty()) {\n    result += indent_str;\n    result += source_line.line;\n    result += '\\n';\n    result += indent_str;\n\n    size_t num_spaces = 0;\n    if (loc.first_column > source_line.column_offset) {\n      num_spaces = (loc.first_column - 1) - source_line.column_offset;\n    }\n    size_t num_carets = loc.last_column - loc.first_column;\n    num_carets = std::min(num_carets, source_line.line.size() - num_spaces);\n    num_carets = std::max<size_t>(num_carets, 1);\n    result.append(num_spaces, ' ');\n    result += color.MaybeBoldCode();\n    result += color.MaybeGreenCode();\n    result.append(num_carets, '^');\n    result += color.MaybeDefaultCode();\n    result += '\\n';\n  }\n\n  return result;\n}\n\n}  // End of anonymous namespace\n\nstd::string FormatErrorsToString(const Errors& errors,\n                                 Location::Type location_type,\n                                 LexerSourceLineFinder* line_finder,\n                                 const Color& color,\n                                 const std::string& header,\n                                 PrintHeader print_header,\n                                 int source_line_max_length) {\n  std::string result;\n  for (const auto& error : errors) {\n    if (!header.empty()) {\n      switch (print_header) {\n        case PrintHeader::Never:\n          break;\n        case PrintHeader::Once:\n          print_header = PrintHeader::Never;\n          [[fallthrough]];\n        case PrintHeader::Always:\n          result += header;\n          result += \":\\n\";\n          break;\n      }\n    }\n\n    int indent = header.empty() ? 0 : 2;\n\n    result += FormatError(error, location_type, color, line_finder,\n                          source_line_max_length, indent);\n  }\n  return result;\n}\n\nvoid FormatErrorsToFile(const Errors& errors,\n                        Location::Type location_type,\n                        LexerSourceLineFinder* line_finder,\n                        FILE* file,\n                        const std::string& header,\n                        PrintHeader print_header,\n                        int source_line_max_length) {\n  Color color(file);\n  std::string s =\n      FormatErrorsToString(errors, location_type, line_finder, color, header,\n                           print_header, source_line_max_length);\n  fwrite(s.data(), 1, s.size(), file);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/expr-visitor.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/expr-visitor.h\"\n\n#include \"wabt/cast.h\"\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nExprVisitor::ExprVisitor(Delegate* delegate) : delegate_(delegate) {}\n\nResult ExprVisitor::VisitExpr(Expr* root_expr) {\n  state_stack_.clear();\n  expr_stack_.clear();\n  expr_iter_stack_.clear();\n  catch_index_stack_.clear();\n\n  PushDefault(root_expr);\n\n  while (!state_stack_.empty()) {\n    State state = state_stack_.back();\n    auto* expr = expr_stack_.back();\n\n    switch (state) {\n      case State::Default:\n        PopDefault();\n        CHECK_RESULT(HandleDefaultState(expr));\n        break;\n\n      case State::Block: {\n        auto block_expr = cast<BlockExpr>(expr);\n        auto& iter = expr_iter_stack_.back();\n        if (iter != block_expr->block.exprs.end()) {\n          PushDefault(&*iter++);\n        } else {\n          CHECK_RESULT(delegate_->EndBlockExpr(block_expr));\n          PopExprlist();\n        }\n        break;\n      }\n\n      case State::IfTrue: {\n        auto if_expr = cast<IfExpr>(expr);\n        auto& iter = expr_iter_stack_.back();\n        if (iter != if_expr->true_.exprs.end()) {\n          PushDefault(&*iter++);\n        } else {\n          CHECK_RESULT(delegate_->AfterIfTrueExpr(if_expr));\n          PopExprlist();\n          PushExprlist(State::IfFalse, expr, if_expr->false_);\n        }\n        break;\n      }\n\n      case State::IfFalse: {\n        auto if_expr = cast<IfExpr>(expr);\n        auto& iter = expr_iter_stack_.back();\n        if (iter != if_expr->false_.end()) {\n          PushDefault(&*iter++);\n        } else {\n          CHECK_RESULT(delegate_->EndIfExpr(if_expr));\n          PopExprlist();\n        }\n        break;\n      }\n\n      case State::Loop: {\n        auto loop_expr = cast<LoopExpr>(expr);\n        auto& iter = expr_iter_stack_.back();\n        if (iter != loop_expr->block.exprs.end()) {\n          PushDefault(&*iter++);\n        } else {\n          CHECK_RESULT(delegate_->EndLoopExpr(loop_expr));\n          PopExprlist();\n        }\n        break;\n      }\n\n      case State::TryTable: {\n        auto try_table_expr = cast<TryTableExpr>(expr);\n        auto& iter = expr_iter_stack_.back();\n        if (iter != try_table_expr->block.exprs.end()) {\n          PushDefault(&*iter++);\n        } else {\n          CHECK_RESULT(delegate_->EndTryTableExpr(try_table_expr));\n          PopExprlist();\n        }\n        break;\n      }\n\n      case State::Try: {\n        auto try_expr = cast<TryExpr>(expr);\n        auto& iter = expr_iter_stack_.back();\n        if (iter != try_expr->block.exprs.end()) {\n          PushDefault(&*iter++);\n        } else {\n          PopExprlist();\n          switch (try_expr->kind) {\n            case TryKind::Catch:\n              if (!try_expr->catches.empty()) {\n                Catch& catch_ = try_expr->catches[0];\n                CHECK_RESULT(delegate_->OnCatchExpr(try_expr, &catch_));\n                PushCatch(expr, 0, catch_.exprs);\n              } else {\n                CHECK_RESULT(delegate_->EndTryExpr(try_expr));\n              }\n              break;\n            case TryKind::Delegate:\n              CHECK_RESULT(delegate_->OnDelegateExpr(try_expr));\n              break;\n            case TryKind::Plain:\n              CHECK_RESULT(delegate_->EndTryExpr(try_expr));\n              break;\n          }\n        }\n        break;\n      }\n\n      case State::Catch: {\n        auto try_expr = cast<TryExpr>(expr);\n        Index catch_index = catch_index_stack_.back();\n        auto& iter = expr_iter_stack_.back();\n        if (iter != try_expr->catches[catch_index].exprs.end()) {\n          PushDefault(&*iter++);\n        } else {\n          PopCatch();\n          catch_index++;\n          if (catch_index < try_expr->catches.size()) {\n            Catch& catch_ = try_expr->catches[catch_index];\n            CHECK_RESULT(delegate_->OnCatchExpr(try_expr, &catch_));\n            PushCatch(expr, catch_index, catch_.exprs);\n          } else {\n            CHECK_RESULT(delegate_->EndTryExpr(try_expr));\n          }\n        }\n        break;\n      }\n    }\n  }\n\n  return Result::Ok;\n}\n\nResult ExprVisitor::VisitExprList(ExprList& exprs) {\n  for (Expr& expr : exprs)\n    CHECK_RESULT(VisitExpr(&expr));\n  return Result::Ok;\n}\n\nResult ExprVisitor::VisitFunc(Func* func) {\n  return VisitExprList(func->exprs);\n}\n\nResult ExprVisitor::HandleDefaultState(Expr* expr) {\n  switch (expr->type()) {\n    case ExprType::AtomicLoad:\n      CHECK_RESULT(delegate_->OnAtomicLoadExpr(cast<AtomicLoadExpr>(expr)));\n      break;\n\n    case ExprType::AtomicStore:\n      CHECK_RESULT(delegate_->OnAtomicStoreExpr(cast<AtomicStoreExpr>(expr)));\n      break;\n\n    case ExprType::AtomicRmw:\n      CHECK_RESULT(delegate_->OnAtomicRmwExpr(cast<AtomicRmwExpr>(expr)));\n      break;\n\n    case ExprType::AtomicRmwCmpxchg:\n      CHECK_RESULT(\n          delegate_->OnAtomicRmwCmpxchgExpr(cast<AtomicRmwCmpxchgExpr>(expr)));\n      break;\n\n    case ExprType::AtomicWait:\n      CHECK_RESULT(delegate_->OnAtomicWaitExpr(cast<AtomicWaitExpr>(expr)));\n      break;\n\n    case ExprType::AtomicFence:\n      CHECK_RESULT(delegate_->OnAtomicFenceExpr(cast<AtomicFenceExpr>(expr)));\n      break;\n\n    case ExprType::AtomicNotify:\n      CHECK_RESULT(delegate_->OnAtomicNotifyExpr(cast<AtomicNotifyExpr>(expr)));\n      break;\n\n    case ExprType::Binary:\n      CHECK_RESULT(delegate_->OnBinaryExpr(cast<BinaryExpr>(expr)));\n      break;\n\n    case ExprType::Quaternary:\n      CHECK_RESULT(delegate_->OnQuaternaryExpr(cast<QuaternaryExpr>(expr)));\n      break;\n\n    case ExprType::Block: {\n      auto block_expr = cast<BlockExpr>(expr);\n      CHECK_RESULT(delegate_->BeginBlockExpr(block_expr));\n      PushExprlist(State::Block, expr, block_expr->block.exprs);\n      break;\n    }\n\n    case ExprType::Br:\n      CHECK_RESULT(delegate_->OnBrExpr(cast<BrExpr>(expr)));\n      break;\n\n    case ExprType::BrIf:\n      CHECK_RESULT(delegate_->OnBrIfExpr(cast<BrIfExpr>(expr)));\n      break;\n\n    case ExprType::BrOnNonNull:\n      CHECK_RESULT(delegate_->OnBrOnNonNullExpr(cast<BrOnNonNullExpr>(expr)));\n      break;\n\n    case ExprType::BrOnNull:\n      CHECK_RESULT(delegate_->OnBrOnNullExpr(cast<BrOnNullExpr>(expr)));\n      break;\n\n    case ExprType::BrTable:\n      CHECK_RESULT(delegate_->OnBrTableExpr(cast<BrTableExpr>(expr)));\n      break;\n\n    case ExprType::Call:\n      CHECK_RESULT(delegate_->OnCallExpr(cast<CallExpr>(expr)));\n      break;\n\n    case ExprType::CallIndirect:\n      CHECK_RESULT(delegate_->OnCallIndirectExpr(cast<CallIndirectExpr>(expr)));\n      break;\n\n    case ExprType::CallRef:\n      CHECK_RESULT(delegate_->OnCallRefExpr(cast<CallRefExpr>(expr)));\n      break;\n\n    case ExprType::CodeMetadata:\n      CHECK_RESULT(delegate_->OnCodeMetadataExpr(cast<CodeMetadataExpr>(expr)));\n      break;\n\n    case ExprType::Compare:\n      CHECK_RESULT(delegate_->OnCompareExpr(cast<CompareExpr>(expr)));\n      break;\n\n    case ExprType::Const:\n      CHECK_RESULT(delegate_->OnConstExpr(cast<ConstExpr>(expr)));\n      break;\n\n    case ExprType::Convert:\n      CHECK_RESULT(delegate_->OnConvertExpr(cast<ConvertExpr>(expr)));\n      break;\n\n    case ExprType::Drop:\n      CHECK_RESULT(delegate_->OnDropExpr(cast<DropExpr>(expr)));\n      break;\n\n    case ExprType::GlobalGet:\n      CHECK_RESULT(delegate_->OnGlobalGetExpr(cast<GlobalGetExpr>(expr)));\n      break;\n\n    case ExprType::GlobalSet:\n      CHECK_RESULT(delegate_->OnGlobalSetExpr(cast<GlobalSetExpr>(expr)));\n      break;\n\n    case ExprType::If: {\n      auto if_expr = cast<IfExpr>(expr);\n      CHECK_RESULT(delegate_->BeginIfExpr(if_expr));\n      PushExprlist(State::IfTrue, expr, if_expr->true_.exprs);\n      break;\n    }\n\n    case ExprType::Load:\n      CHECK_RESULT(delegate_->OnLoadExpr(cast<LoadExpr>(expr)));\n      break;\n\n    case ExprType::LoadSplat:\n      CHECK_RESULT(delegate_->OnLoadSplatExpr(cast<LoadSplatExpr>(expr)));\n      break;\n\n    case ExprType::LoadZero:\n      CHECK_RESULT(delegate_->OnLoadZeroExpr(cast<LoadZeroExpr>(expr)));\n      break;\n\n    case ExprType::LocalGet:\n      CHECK_RESULT(delegate_->OnLocalGetExpr(cast<LocalGetExpr>(expr)));\n      break;\n\n    case ExprType::LocalSet:\n      CHECK_RESULT(delegate_->OnLocalSetExpr(cast<LocalSetExpr>(expr)));\n      break;\n\n    case ExprType::LocalTee:\n      CHECK_RESULT(delegate_->OnLocalTeeExpr(cast<LocalTeeExpr>(expr)));\n      break;\n\n    case ExprType::Loop: {\n      auto loop_expr = cast<LoopExpr>(expr);\n      CHECK_RESULT(delegate_->BeginLoopExpr(loop_expr));\n      PushExprlist(State::Loop, expr, loop_expr->block.exprs);\n      break;\n    }\n\n    case ExprType::MemoryCopy:\n      CHECK_RESULT(delegate_->OnMemoryCopyExpr(cast<MemoryCopyExpr>(expr)));\n      break;\n\n    case ExprType::DataDrop:\n      CHECK_RESULT(delegate_->OnDataDropExpr(cast<DataDropExpr>(expr)));\n      break;\n\n    case ExprType::MemoryFill:\n      CHECK_RESULT(delegate_->OnMemoryFillExpr(cast<MemoryFillExpr>(expr)));\n      break;\n\n    case ExprType::MemoryGrow:\n      CHECK_RESULT(delegate_->OnMemoryGrowExpr(cast<MemoryGrowExpr>(expr)));\n      break;\n\n    case ExprType::MemoryInit:\n      CHECK_RESULT(delegate_->OnMemoryInitExpr(cast<MemoryInitExpr>(expr)));\n      break;\n\n    case ExprType::MemorySize:\n      CHECK_RESULT(delegate_->OnMemorySizeExpr(cast<MemorySizeExpr>(expr)));\n      break;\n\n    case ExprType::TableCopy:\n      CHECK_RESULT(delegate_->OnTableCopyExpr(cast<TableCopyExpr>(expr)));\n      break;\n\n    case ExprType::ElemDrop:\n      CHECK_RESULT(delegate_->OnElemDropExpr(cast<ElemDropExpr>(expr)));\n      break;\n\n    case ExprType::TableInit:\n      CHECK_RESULT(delegate_->OnTableInitExpr(cast<TableInitExpr>(expr)));\n      break;\n\n    case ExprType::TableGet:\n      CHECK_RESULT(delegate_->OnTableGetExpr(cast<TableGetExpr>(expr)));\n      break;\n\n    case ExprType::TableSet:\n      CHECK_RESULT(delegate_->OnTableSetExpr(cast<TableSetExpr>(expr)));\n      break;\n\n    case ExprType::TableGrow:\n      CHECK_RESULT(delegate_->OnTableGrowExpr(cast<TableGrowExpr>(expr)));\n      break;\n\n    case ExprType::TableSize:\n      CHECK_RESULT(delegate_->OnTableSizeExpr(cast<TableSizeExpr>(expr)));\n      break;\n\n    case ExprType::TableFill:\n      CHECK_RESULT(delegate_->OnTableFillExpr(cast<TableFillExpr>(expr)));\n      break;\n\n    case ExprType::RefAsNonNull:\n      CHECK_RESULT(delegate_->OnRefAsNonNullExpr(cast<RefAsNonNullExpr>(expr)));\n      break;\n\n    case ExprType::RefFunc:\n      CHECK_RESULT(delegate_->OnRefFuncExpr(cast<RefFuncExpr>(expr)));\n      break;\n\n    case ExprType::RefNull:\n      CHECK_RESULT(delegate_->OnRefNullExpr(cast<RefNullExpr>(expr)));\n      break;\n\n    case ExprType::RefIsNull:\n      CHECK_RESULT(delegate_->OnRefIsNullExpr(cast<RefIsNullExpr>(expr)));\n      break;\n\n    case ExprType::Nop:\n      CHECK_RESULT(delegate_->OnNopExpr(cast<NopExpr>(expr)));\n      break;\n\n    case ExprType::Rethrow:\n      CHECK_RESULT(delegate_->OnRethrowExpr(cast<RethrowExpr>(expr)));\n      break;\n\n    case ExprType::Return:\n      CHECK_RESULT(delegate_->OnReturnExpr(cast<ReturnExpr>(expr)));\n      break;\n\n    case ExprType::ReturnCall:\n      CHECK_RESULT(delegate_->OnReturnCallExpr(cast<ReturnCallExpr>(expr)));\n      break;\n\n    case ExprType::ReturnCallIndirect:\n      CHECK_RESULT(delegate_->OnReturnCallIndirectExpr(\n          cast<ReturnCallIndirectExpr>(expr)));\n      break;\n\n    case ExprType::ReturnCallRef:\n      CHECK_RESULT(\n          delegate_->OnReturnCallRefExpr(cast<ReturnCallRefExpr>(expr)));\n      break;\n\n    case ExprType::Select:\n      CHECK_RESULT(delegate_->OnSelectExpr(cast<SelectExpr>(expr)));\n      break;\n\n    case ExprType::Store:\n      CHECK_RESULT(delegate_->OnStoreExpr(cast<StoreExpr>(expr)));\n      break;\n\n    case ExprType::Throw:\n      CHECK_RESULT(delegate_->OnThrowExpr(cast<ThrowExpr>(expr)));\n      break;\n\n    case ExprType::ThrowRef:\n      CHECK_RESULT(delegate_->OnThrowRefExpr(cast<ThrowRefExpr>(expr)));\n      break;\n\n    case ExprType::TryTable: {\n      auto try_table_expr = cast<TryTableExpr>(expr);\n      CHECK_RESULT(delegate_->BeginTryTableExpr(try_table_expr));\n      PushExprlist(State::TryTable, expr, try_table_expr->block.exprs);\n      break;\n    }\n\n    case ExprType::Try: {\n      auto try_expr = cast<TryExpr>(expr);\n      CHECK_RESULT(delegate_->BeginTryExpr(try_expr));\n      PushExprlist(State::Try, expr, try_expr->block.exprs);\n      break;\n    }\n\n    case ExprType::Unary:\n      CHECK_RESULT(delegate_->OnUnaryExpr(cast<UnaryExpr>(expr)));\n      break;\n\n    case ExprType::Ternary:\n      CHECK_RESULT(delegate_->OnTernaryExpr(cast<TernaryExpr>(expr)));\n      break;\n\n    case ExprType::SimdLaneOp: {\n      CHECK_RESULT(delegate_->OnSimdLaneOpExpr(cast<SimdLaneOpExpr>(expr)));\n      break;\n    }\n\n    case ExprType::SimdLoadLane: {\n      CHECK_RESULT(delegate_->OnSimdLoadLaneExpr(cast<SimdLoadLaneExpr>(expr)));\n      break;\n    }\n\n    case ExprType::SimdStoreLane: {\n      CHECK_RESULT(\n          delegate_->OnSimdStoreLaneExpr(cast<SimdStoreLaneExpr>(expr)));\n      break;\n    }\n\n    case ExprType::SimdShuffleOp: {\n      CHECK_RESULT(\n          delegate_->OnSimdShuffleOpExpr(cast<SimdShuffleOpExpr>(expr)));\n      break;\n    }\n\n    case ExprType::Unreachable:\n      CHECK_RESULT(delegate_->OnUnreachableExpr(cast<UnreachableExpr>(expr)));\n      break;\n  }\n\n  return Result::Ok;\n}\n\nvoid ExprVisitor::PushDefault(Expr* expr) {\n  state_stack_.emplace_back(State::Default);\n  expr_stack_.emplace_back(expr);\n}\n\nvoid ExprVisitor::PopDefault() {\n  state_stack_.pop_back();\n  expr_stack_.pop_back();\n}\n\nvoid ExprVisitor::PushExprlist(State state, Expr* expr, ExprList& expr_list) {\n  state_stack_.emplace_back(state);\n  expr_stack_.emplace_back(expr);\n  expr_iter_stack_.emplace_back(expr_list.begin());\n}\n\nvoid ExprVisitor::PopExprlist() {\n  state_stack_.pop_back();\n  expr_stack_.pop_back();\n  expr_iter_stack_.pop_back();\n}\n\nvoid ExprVisitor::PushCatch(Expr* expr,\n                            Index catch_index,\n                            ExprList& expr_list) {\n  state_stack_.emplace_back(State::Catch);\n  expr_stack_.emplace_back(expr);\n  expr_iter_stack_.emplace_back(expr_list.begin());\n  catch_index_stack_.emplace_back(catch_index);\n}\n\nvoid ExprVisitor::PopCatch() {\n  state_stack_.pop_back();\n  expr_stack_.pop_back();\n  expr_iter_stack_.pop_back();\n  catch_index_stack_.pop_back();\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/feature.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/feature.h\"\n\n#include \"wabt/option-parser.h\"\n\nnamespace wabt {\n\nvoid Features::AddOptions(OptionParser* parser) {\n#define WABT_FEATURE(variable, flag, default_, help)       \\\n  if (default_ == true) {                                  \\\n    parser->AddOption(\"disable-\" flag, \"Disable \" help,    \\\n                      [this]() { disable_##variable(); }); \\\n  } else {                                                 \\\n    parser->AddOption(\"enable-\" flag, \"Enable \" help,      \\\n                      [this]() { enable_##variable(); });  \\\n  }\n\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n  parser->AddOption(\"enable-all\", \"Enable all features\",\n                    [this]() { EnableAll(); });\n}\n\nvoid Features::UpdateDependencies() {\n  // Exception handling requires reference types.\n  if (exceptions_enabled_) {\n    reference_types_enabled_ = true;\n  }\n\n  // Function references require reference types.\n  if (function_references_enabled_) {\n    reference_types_enabled_ = true;\n  }\n\n  // Reference types requires bulk memory.\n  if (!bulk_memory_enabled_) {\n    reference_types_enabled_ = false;\n  }\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/filenames.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/filenames.h\"\n\nnamespace wabt {\n\nconst char* kWasmExtension = \".wasm\";\n\nconst char* kWatExtension = \".wat\";\n\nstd::string_view StripExtension(std::string_view filename) {\n  return filename.substr(0, filename.find_last_of('.'));\n}\n\nstd::string_view GetBasename(std::string_view filename) {\n  size_t last_slash = filename.find_last_of('/');\n  size_t last_backslash = filename.find_last_of('\\\\');\n  if (last_slash == std::string_view::npos &&\n      last_backslash == std::string_view::npos) {\n    return filename;\n  }\n\n  if (last_slash == std::string_view::npos) {\n    if (last_backslash == std::string_view::npos) {\n      return filename;\n    }\n    last_slash = last_backslash;\n  } else if (last_backslash != std::string_view::npos) {\n    last_slash = std::max(last_slash, last_backslash);\n  }\n\n  return filename.substr(last_slash + 1);\n}\n\nstd::string_view GetExtension(std::string_view filename) {\n  size_t pos = filename.find_last_of('.');\n  if (pos == std::string_view::npos) {\n    return \"\";\n  }\n  return filename.substr(pos);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/generate-names.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/generate-names.h\"\n\n#include <cassert>\n#include <cstdio>\n#include <string>\n#include <vector>\n\n#include \"wabt/cast.h\"\n#include \"wabt/expr-visitor.h\"\n#include \"wabt/ir.h\"\n\nnamespace wabt {\n\nnamespace {\n\nclass NameGenerator : public ExprVisitor::DelegateNop {\n public:\n  NameGenerator(NameOpts opts);\n\n  Result VisitModule(Module* module);\n\n  // Implementation of ExprVisitor::DelegateNop.\n  Result BeginBlockExpr(BlockExpr* expr) override;\n  Result BeginTryExpr(TryExpr* expr) override;\n  Result BeginTryTableExpr(TryTableExpr* expr) override;\n  Result BeginLoopExpr(LoopExpr* expr) override;\n  Result BeginIfExpr(IfExpr* expr) override;\n\n private:\n  static bool HasName(const std::string& str);\n\n  // Generate a name with the given prefix, followed by the index and\n  // optionally a disambiguating number. If index == kInvalidIndex, the index\n  // is not appended.\n  void GenerateName(const char* prefix,\n                    Index index,\n                    unsigned disambiguator,\n                    std::string* out_str);\n\n  // Like GenerateName, but only generates a name if |out_str| is empty.\n  void MaybeGenerateName(const char* prefix, Index index, std::string* out_str);\n\n  // Generate a name via GenerateName and bind it to the given binding hash. If\n  // the name already exists, the name will be disambiguated until it can be\n  // added.\n  void GenerateAndBindName(BindingHash* bindings,\n                           const char* prefix,\n                           Index index,\n                           std::string* out_str);\n\n  // Like GenerateAndBindName, but only  generates a name if |out_str| is empty.\n  void MaybeGenerateAndBindName(BindingHash* bindings,\n                                const char* prefix,\n                                Index index,\n                                std::string* out_str);\n\n  // Like MaybeGenerateAndBindName but uses the name directly, without\n  // appending the index. If the name already exists, a disambiguating suffix\n  // is added.\n  void MaybeUseAndBindName(BindingHash* bindings,\n                           const char* name,\n                           Index index,\n                           std::string* out_str);\n\n  void GenerateAndBindLocalNames(Func* func);\n\n  template <typename T>\n  Result VisitAll(const std::vector<T*>& items,\n                  Result (NameGenerator::*func)(Index, T*));\n\n  Result VisitFunc(Index func_index, Func* func);\n  Result VisitGlobal(Index global_index, Global* global);\n  Result VisitType(Index func_type_index, TypeEntry* type);\n  Result VisitTable(Index table_index, Table* table);\n  Result VisitMemory(Index memory_index, Memory* memory);\n  Result VisitTag(Index tag_index, Tag* tag);\n  Result VisitDataSegment(Index data_segment_index, DataSegment* data_segment);\n  Result VisitElemSegment(Index elem_segment_index, ElemSegment* elem_segment);\n  Result VisitImport(Import* import);\n  Result VisitExport(Export* export_);\n\n  Module* module_ = nullptr;\n  ExprVisitor visitor_;\n  Index label_count_ = 0;\n\n  Index num_func_imports_ = 0;\n  Index num_table_imports_ = 0;\n  Index num_memory_imports_ = 0;\n  Index num_global_imports_ = 0;\n  Index num_tag_imports_ = 0;\n\n  NameOpts opts_;\n};\n\nNameGenerator::NameGenerator(NameOpts opts) : visitor_(this), opts_(opts) {}\n\n// static\nbool NameGenerator::HasName(const std::string& str) {\n  return !str.empty();\n}\n\nvoid NameGenerator::GenerateName(const char* prefix,\n                                 Index index,\n                                 unsigned disambiguator,\n                                 std::string* str) {\n  *str = \"$\";\n  *str += prefix;\n  if (index != kInvalidIndex) {\n    if (opts_ & NameOpts::AlphaNames) {\n      // For params and locals, do not use a prefix char.\n      if (!strcmp(prefix, \"p\") || !strcmp(prefix, \"l\")) {\n        str->pop_back();\n      } else {\n        *str += '_';\n      }\n      *str += IndexToAlphaName(index);\n    } else {\n      *str += std::to_string(index);\n    }\n  }\n  if (disambiguator != 0) {\n    *str += '_' + std::to_string(disambiguator);\n  }\n}\n\nvoid NameGenerator::MaybeGenerateName(const char* prefix,\n                                      Index index,\n                                      std::string* str) {\n  if (!HasName(*str)) {\n    // There's no bindings hash, so the name can't be a duplicate. Therefore it\n    // doesn't need a disambiguating number.\n    GenerateName(prefix, index, 0, str);\n  }\n}\n\nvoid NameGenerator::GenerateAndBindName(BindingHash* bindings,\n                                        const char* prefix,\n                                        Index index,\n                                        std::string* str) {\n  unsigned disambiguator = 0;\n  while (true) {\n    GenerateName(prefix, index, disambiguator, str);\n    if (bindings->find(*str) == bindings->end()) {\n      bindings->emplace(*str, Binding(index));\n      break;\n    }\n\n    disambiguator++;\n  }\n}\n\nvoid NameGenerator::MaybeGenerateAndBindName(BindingHash* bindings,\n                                             const char* prefix,\n                                             Index index,\n                                             std::string* str) {\n  if (!HasName(*str)) {\n    GenerateAndBindName(bindings, prefix, index, str);\n  }\n}\n\nvoid NameGenerator::MaybeUseAndBindName(BindingHash* bindings,\n                                        const char* name,\n                                        Index index,\n                                        std::string* str) {\n  if (!HasName(*str)) {\n    unsigned disambiguator = 0;\n    while (true) {\n      GenerateName(name, kInvalidIndex, disambiguator, str);\n      if (bindings->find(*str) == bindings->end()) {\n        bindings->emplace(*str, Binding(index));\n        break;\n      }\n\n      disambiguator++;\n    }\n  }\n}\n\nvoid NameGenerator::GenerateAndBindLocalNames(Func* func) {\n  std::vector<std::string> index_to_name;\n  MakeTypeBindingReverseMapping(func->GetNumParamsAndLocals(), func->bindings,\n                                &index_to_name);\n  for (size_t i = 0; i < index_to_name.size(); ++i) {\n    const std::string& old_name = index_to_name[i];\n    if (!old_name.empty()) {\n      continue;\n    }\n\n    const char* prefix = i < func->GetNumParams() ? \"p\" : \"l\";\n    std::string new_name;\n    GenerateAndBindName(&func->bindings, prefix, i, &new_name);\n    index_to_name[i] = new_name;\n  }\n}\n\nResult NameGenerator::BeginBlockExpr(BlockExpr* expr) {\n  MaybeGenerateName(\"B\", label_count_++, &expr->block.label);\n  return Result::Ok;\n}\n\nResult NameGenerator::BeginTryExpr(TryExpr* expr) {\n  MaybeGenerateName(\"T\", label_count_++, &expr->block.label);\n  return Result::Ok;\n}\n\nResult NameGenerator::BeginTryTableExpr(TryTableExpr* expr) {\n  MaybeGenerateName(\"T\", label_count_++, &expr->block.label);\n  return Result::Ok;\n}\n\nResult NameGenerator::BeginLoopExpr(LoopExpr* expr) {\n  MaybeGenerateName(\"L\", label_count_++, &expr->block.label);\n  return Result::Ok;\n}\n\nResult NameGenerator::BeginIfExpr(IfExpr* expr) {\n  MaybeGenerateName(\"I\", label_count_++, &expr->true_.label);\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitFunc(Index func_index, Func* func) {\n  MaybeGenerateAndBindName(&module_->func_bindings, \"f\", func_index,\n                           &func->name);\n  GenerateAndBindLocalNames(func);\n\n  label_count_ = 0;\n  CHECK_RESULT(visitor_.VisitFunc(func));\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitGlobal(Index global_index, Global* global) {\n  MaybeGenerateAndBindName(&module_->global_bindings, \"g\", global_index,\n                           &global->name);\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitType(Index type_index, TypeEntry* type) {\n  MaybeGenerateAndBindName(&module_->type_bindings, \"t\", type_index,\n                           &type->name);\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitTable(Index table_index, Table* table) {\n  MaybeGenerateAndBindName(&module_->table_bindings, \"T\", table_index,\n                           &table->name);\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitMemory(Index memory_index, Memory* memory) {\n  MaybeGenerateAndBindName(&module_->memory_bindings, \"M\", memory_index,\n                           &memory->name);\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitTag(Index tag_index, Tag* tag) {\n  MaybeGenerateAndBindName(&module_->tag_bindings, \"e\", tag_index, &tag->name);\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitDataSegment(Index data_segment_index,\n                                       DataSegment* data_segment) {\n  MaybeGenerateAndBindName(&module_->data_segment_bindings, \"d\",\n                           data_segment_index, &data_segment->name);\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitElemSegment(Index elem_segment_index,\n                                       ElemSegment* elem_segment) {\n  MaybeGenerateAndBindName(&module_->elem_segment_bindings, \"e\",\n                           elem_segment_index, &elem_segment->name);\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitImport(Import* import) {\n  BindingHash* bindings = nullptr;\n  std::string* name = nullptr;\n  Index index = kInvalidIndex;\n\n  switch (import->kind()) {\n    case ExternalKind::Func:\n      if (auto* func_import = cast<FuncImport>(import)) {\n        bindings = &module_->func_bindings;\n        name = &func_import->func.name;\n        index = num_func_imports_++;\n      }\n      break;\n\n    case ExternalKind::Table:\n      if (auto* table_import = cast<TableImport>(import)) {\n        bindings = &module_->table_bindings;\n        name = &table_import->table.name;\n        index = num_table_imports_++;\n      }\n      break;\n\n    case ExternalKind::Memory:\n      if (auto* memory_import = cast<MemoryImport>(import)) {\n        bindings = &module_->memory_bindings;\n        name = &memory_import->memory.name;\n        index = num_memory_imports_++;\n      }\n      break;\n\n    case ExternalKind::Global:\n      if (auto* global_import = cast<GlobalImport>(import)) {\n        bindings = &module_->global_bindings;\n        name = &global_import->global.name;\n        index = num_global_imports_++;\n      }\n      break;\n\n    case ExternalKind::Tag:\n      if (auto* tag_import = cast<TagImport>(import)) {\n        bindings = &module_->tag_bindings;\n        name = &tag_import->tag.name;\n        index = num_tag_imports_++;\n      }\n      break;\n  }\n\n  if (bindings && name) {\n    assert(index != kInvalidIndex);\n    std::string new_name = import->module_name + '.' + import->field_name;\n    MaybeUseAndBindName(bindings, new_name.c_str(), index, name);\n  }\n\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitExport(Export* export_) {\n  BindingHash* bindings = nullptr;\n  std::string* name = nullptr;\n  Index index = kInvalidIndex;\n\n  switch (export_->kind) {\n    case ExternalKind::Func:\n      if (Func* func = module_->GetFunc(export_->var)) {\n        index = module_->GetFuncIndex(export_->var);\n        bindings = &module_->func_bindings;\n        name = &func->name;\n      }\n      break;\n\n    case ExternalKind::Table:\n      if (Table* table = module_->GetTable(export_->var)) {\n        index = module_->GetTableIndex(export_->var);\n        bindings = &module_->table_bindings;\n        name = &table->name;\n      }\n      break;\n\n    case ExternalKind::Memory:\n      if (Memory* memory = module_->GetMemory(export_->var)) {\n        index = module_->GetMemoryIndex(export_->var);\n        bindings = &module_->memory_bindings;\n        name = &memory->name;\n      }\n      break;\n\n    case ExternalKind::Global:\n      if (Global* global = module_->GetGlobal(export_->var)) {\n        index = module_->GetGlobalIndex(export_->var);\n        bindings = &module_->global_bindings;\n        name = &global->name;\n      }\n      break;\n\n    case ExternalKind::Tag:\n      if (Tag* tag = module_->GetTag(export_->var)) {\n        index = module_->GetTagIndex(export_->var);\n        bindings = &module_->tag_bindings;\n        name = &tag->name;\n      }\n      break;\n  }\n\n  if (bindings && name) {\n    MaybeUseAndBindName(bindings, export_->name.c_str(), index, name);\n  }\n\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult NameGenerator::VisitAll(const std::vector<T*>& items,\n                               Result (NameGenerator::*func)(Index, T*)) {\n  for (Index i = 0; i < items.size(); ++i) {\n    CHECK_RESULT((this->*func)(i, items[i]));\n  }\n  return Result::Ok;\n}\n\nResult NameGenerator::VisitModule(Module* module) {\n  module_ = module;\n  // Visit imports and exports first to give better names, derived from the\n  // import/export name.\n  for (auto* import : module->imports) {\n    CHECK_RESULT(VisitImport(import));\n  }\n  for (auto* export_ : module->exports) {\n    CHECK_RESULT(VisitExport(export_));\n  }\n\n  VisitAll(module->globals, &NameGenerator::VisitGlobal);\n  VisitAll(module->types, &NameGenerator::VisitType);\n  VisitAll(module->funcs, &NameGenerator::VisitFunc);\n  VisitAll(module->tables, &NameGenerator::VisitTable);\n  VisitAll(module->memories, &NameGenerator::VisitMemory);\n  VisitAll(module->tags, &NameGenerator::VisitTag);\n  VisitAll(module->data_segments, &NameGenerator::VisitDataSegment);\n  VisitAll(module->elem_segments, &NameGenerator::VisitElemSegment);\n  module_ = nullptr;\n  return Result::Ok;\n}\n\n}  // end anonymous namespace\n\nResult GenerateNames(Module* module, NameOpts opts) {\n  NameGenerator generator(opts);\n  return generator.VisitModule(module);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/interp/binary-reader-interp.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/interp/binary-reader-interp.h\"\n\n#include <map>\n#include <set>\n\n#include \"wabt/binary-reader-nop.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/interp/interp.h\"\n#include \"wabt/shared-validator.h\"\n#include \"wabt/stream.h\"\n\nnamespace wabt {\nnamespace interp {\n\nnamespace {\n\nValueTypes ToInterp(Index count, Type* types) {\n  return ValueTypes(&types[0], &types[count]);\n}\n\nMutability ToMutability(bool mut) {\n  return mut ? Mutability::Var : Mutability::Const;\n}\n\nSegmentMode ToSegmentMode(uint8_t flags) {\n  if ((flags & SegDeclared) == SegDeclared) {\n    return SegmentMode::Declared;\n  } else if ((flags & SegPassive) == SegPassive) {\n    return SegmentMode::Passive;\n  } else {\n    return SegmentMode::Active;\n  }\n}\n\n// This is only used to distinguish try blocks and all other blocks,\n// so there are only two kinds.\nenum class LabelKind { Block, Try };\n\nstruct Label {\n  LabelKind kind;\n  Istream::Offset offset;\n  Istream::Offset fixup_offset;\n  // Only needs to be set for try blocks.\n  u32 handler_desc_index;\n};\n\nstruct FixupMap {\n  using Offset = Istream::Offset;\n  using Fixups = std::vector<Offset>;\n\n  void Clear();\n  void Append(Index, Offset);\n  void Resolve(Istream&, Index);\n\n  std::map<Index, Fixups> map;\n};\n\nclass BinaryReaderInterp : public BinaryReaderNop {\n public:\n  // Prevent too much memory allocation errors by fuzzers.\n  static constexpr Index kMaxPreallocatedBufferSize = 16384;\n\n  BinaryReaderInterp(ModuleDesc* module,\n                     std::string_view filename,\n                     Errors* errors,\n                     const Features& features);\n\n  // Implement BinaryReader.\n  bool OnError(const Error&) override;\n\n  Result EndModule() override;\n\n  Result OnTypeCount(Index count) override;\n  Result OnFuncType(Index index,\n                    Index param_count,\n                    Type* param_types,\n                    Index result_count,\n                    Type* result_types) override;\n\n  Result OnImportFunc(Index import_index,\n                      std::string_view module_name,\n                      std::string_view field_name,\n                      Index func_index,\n                      Index sig_index) override;\n  Result OnImportTable(Index import_index,\n                       std::string_view module_name,\n                       std::string_view field_name,\n                       Index table_index,\n                       Type elem_type,\n                       const Limits* elem_limits) override;\n  Result OnImportMemory(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index memory_index,\n                        const Limits* page_limits,\n                        uint32_t page_size) override;\n  Result OnImportGlobal(Index import_index,\n                        std::string_view module_name,\n                        std::string_view field_name,\n                        Index global_index,\n                        Type type,\n                        bool mutable_) override;\n  Result OnImportTag(Index import_index,\n                     std::string_view module_name,\n                     std::string_view field_name,\n                     Index tag_index,\n                     Index sig_index) override;\n\n  Result OnFunctionCount(Index count) override;\n  Result OnFunction(Index index, Index sig_index) override;\n\n  Result OnTableCount(Index count) override;\n  Result BeginTable(Index index,\n                    Type elem_type,\n                    const Limits* elem_limits,\n                    TableInitExprStatus init_provided) override;\n  Result BeginTableInitExpr(Index index) override;\n  Result EndTableInitExpr(Index index) override;\n\n  Result OnMemoryCount(Index count) override;\n  Result OnMemory(Index index,\n                  const Limits* limits,\n                  uint32_t page_size) override;\n\n  Result OnGlobalCount(Index count) override;\n  Result BeginGlobal(Index index, Type type, bool mutable_) override;\n  Result BeginGlobalInitExpr(Index index) override;\n  Result EndGlobalInitExpr(Index index) override;\n\n  Result OnTagCount(Index count) override;\n  Result OnTagType(Index index, Index sig_index) override;\n\n  Result OnExport(Index index,\n                  ExternalKind kind,\n                  Index item_index,\n                  std::string_view name) override;\n\n  Result OnStartFunction(Index func_index) override;\n\n  Result BeginFunctionBody(Index index, Offset size) override;\n  Result OnLocalDeclCount(Index count) override;\n  Result OnLocalDecl(Index decl_index, Index count, Type type) override;\n  Result EndLocalDecls() override;\n\n  Result OnOpcode(Opcode Opcode) override;\n  Result OnAtomicLoadExpr(Opcode opcode,\n                          Index memidx,\n                          Address alignment_log2,\n                          Address offset) override;\n  Result OnAtomicStoreExpr(Opcode opcode,\n                           Index memidx,\n                           Address alignment_log2,\n                           Address offset) override;\n  Result OnAtomicRmwExpr(Opcode opcode,\n                         Index memidx,\n                         Address alignment_log2,\n                         Address offset) override;\n  Result OnAtomicRmwCmpxchgExpr(Opcode opcode,\n                                Index memidx,\n                                Address alignment_log2,\n                                Address offset) override;\n  Result OnAtomicWaitExpr(Opcode opcode,\n                          Index memidx,\n                          Address alignment_log2,\n                          Address offset) override;\n  Result OnAtomicFenceExpr(uint32_t consistency_model) override;\n  Result OnAtomicNotifyExpr(Opcode opcode,\n                            Index memidx,\n                            Address alignment_log2,\n                            Address offset) override;\n  Result OnBinaryExpr(Opcode opcode) override;\n  Result OnBlockExpr(Type sig_type) override;\n  Result OnBrExpr(Index depth) override;\n  Result OnBrIfExpr(Index depth) override;\n  Result OnBrOnNonNullExpr(Index depth) override;\n  Result OnBrOnNullExpr(Index depth) override;\n  Result OnBrTableExpr(Index num_targets,\n                       Index* target_depths,\n                       Index default_target_depth) override;\n  Result OnCallExpr(Index func_index) override;\n  Result OnCallIndirectExpr(Index sig_index, Index table_index) override;\n  Result OnCallRefExpr(Type sig_type) override;\n  Result OnCatchExpr(Index tag_index) override;\n  Result OnCatchAllExpr() override;\n  Result OnDelegateExpr(Index depth) override;\n  Result OnReturnCallExpr(Index func_index) override;\n  Result OnReturnCallIndirectExpr(Index sig_index, Index table_index) override;\n  Result OnReturnCallRefExpr(Type sig_type) override;\n  Result OnCompareExpr(Opcode opcode) override;\n  Result OnConvertExpr(Opcode opcode) override;\n  Result OnDropExpr() override;\n  Result OnElseExpr() override;\n  Result OnEndExpr() override;\n  Result OnF32ConstExpr(uint32_t value_bits) override;\n  Result OnF64ConstExpr(uint64_t value_bits) override;\n  Result OnV128ConstExpr(v128 value_bits) override;\n  Result OnGlobalGetExpr(Index global_index) override;\n  Result OnGlobalSetExpr(Index global_index) override;\n  Result OnI32ConstExpr(uint32_t value) override;\n  Result OnI64ConstExpr(uint64_t value) override;\n  Result OnIfExpr(Type sig_type) override;\n  Result OnLoadExpr(Opcode opcode,\n                    Index memidx,\n                    Address alignment_log2,\n                    Address offset) override;\n  Result OnLocalGetExpr(Index local_index) override;\n  Result OnLocalSetExpr(Index local_index) override;\n  Result OnLocalTeeExpr(Index local_index) override;\n  Result OnLoopExpr(Type sig_type) override;\n  Result OnMemoryCopyExpr(Index destmemidx, Index srcmemidx) override;\n  Result OnDataDropExpr(Index segment_index) override;\n  Result OnMemoryGrowExpr(Index memidx) override;\n  Result OnMemoryFillExpr(Index memidx) override;\n  Result OnMemoryInitExpr(Index segment_index, Index memidx) override;\n  Result OnMemorySizeExpr(Index memidx) override;\n  Result OnRefAsNonNullExpr() override;\n  Result OnRefFuncExpr(Index func_index) override;\n  Result OnRefNullExpr(Type type) override;\n  Result OnRefIsNullExpr() override;\n  Result OnNopExpr() override;\n  Result OnRethrowExpr(Index depth) override;\n  Result OnReturnExpr() override;\n  Result OnSelectExpr(Index result_count, Type* result_types) override;\n  Result OnStoreExpr(Opcode opcode,\n                     Index memidx,\n                     Address alignment_log2,\n                     Address offset) override;\n  Result OnUnaryExpr(Opcode opcode) override;\n  Result OnTableCopyExpr(Index dst_index, Index src_index) override;\n  Result OnTableGetExpr(Index table_index) override;\n  Result OnTableSetExpr(Index table_index) override;\n  Result OnTableGrowExpr(Index table_index) override;\n  Result OnTableSizeExpr(Index table_index) override;\n  Result OnTableFillExpr(Index table_index) override;\n  Result OnElemDropExpr(Index segment_index) override;\n  Result OnTableInitExpr(Index segment_index, Index table_index) override;\n  Result OnTernaryExpr(Opcode opcode) override;\n  Result OnThrowExpr(Index tag_index) override;\n  Result OnThrowRefExpr() override;\n  Result OnTryExpr(Type sig_type) override;\n  Result OnTryTableExpr(Type sig_type,\n                        const CatchClauseVector& catches) override;\n  Result OnUnreachableExpr() override;\n  Result EndFunctionBody(Index index) override;\n  Result OnSimdLaneOpExpr(Opcode opcode, uint64_t value) override;\n  Result OnSimdLoadLaneExpr(Opcode opcode,\n                            Index memidx,\n                            Address alignment_log2,\n                            Address offset,\n                            uint64_t value) override;\n  Result OnSimdStoreLaneExpr(Opcode opcode,\n                             Index memidx,\n                             Address alignment_log2,\n                             Address offset,\n                             uint64_t value) override;\n  Result OnSimdShuffleOpExpr(Opcode opcode, v128 value) override;\n  Result OnLoadSplatExpr(Opcode opcode,\n                         Index memidx,\n                         Address alignment_log2,\n                         Address offset) override;\n  Result OnLoadZeroExpr(Opcode opcode,\n                        Index memidx,\n                        Address alignment_log2,\n                        Address offset) override;\n\n  Result OnElemSegmentCount(Index count) override;\n  Result BeginElemSegment(Index index,\n                          Index table_index,\n                          uint8_t flags) override;\n  Result BeginElemSegmentInitExpr(Index index) override;\n  Result EndElemSegmentInitExpr(Index index) override;\n  Result OnElemSegmentElemType(Index index, Type elem_type) override;\n  Result OnElemSegmentElemExprCount(Index index, Index count) override;\n  Result BeginElemExpr(Index elem_index, Index expr_index) override;\n  Result EndElemExpr(Index elem_index, Index expr_index) override;\n\n  Result OnDataCount(Index count) override;\n  Result BeginDataSegmentInitExpr(Index index) override;\n  Result EndDataSegmentInitExpr(Index index) override;\n  Result BeginDataSegment(Index index,\n                          Index memory_index,\n                          uint8_t flags) override;\n  Result OnDataSegmentData(Index index,\n                           const void* data,\n                           Address size) override;\n\n private:\n  Location GetLocation() const;\n  Label* GetLabel(Index depth);\n  Label* GetNearestTryLabel(Index depth);\n  Label* TopLabel();\n  void PushLabel(LabelKind label = LabelKind::Block,\n                 Istream::Offset offset = Istream::kInvalidOffset,\n                 Istream::Offset fixup_offset = Istream::kInvalidOffset,\n                 u32 handler_desc_index = kInvalidIndex);\n  void PopLabel();\n\n  void PrintError(const char* format, ...);\n\n  Result GetDropCount(Index keep_count,\n                      size_t type_stack_limit,\n                      Index* out_drop_count);\n  Result GetBrDropKeepCount(Index depth,\n                            Index* out_drop_count,\n                            Index* out_keep_count);\n  Result GetReturnDropKeepCount(Index* out_drop_count, Index* out_keep_count);\n  Result GetReturnCallDropKeepCount(const FuncType&,\n                                    Index keep_extra,\n                                    Index* out_drop_count,\n                                    Index* out_keep_count);\n  Result BeginInitExpr(FuncDesc* init_func);\n  Result EndInitExpr();\n\n  void EmitBr(Index depth,\n              Index drop_count,\n              Index keep_count,\n              Index catch_drop_count);\n\n  Result EmitBrCond(Opcode opcode, Index depth);\n\n  void FixupTopLabel();\n  u32 GetFuncOffset(Index func_index);\n\n  Index TranslateLocalIndex(Index local_index);\n\n  Index num_func_imports() const;\n\n  Errors* errors_ = nullptr;\n  ModuleDesc& module_;\n  Istream& istream_;\n\n  SharedValidator validator_;\n\n  FuncDesc* func_;\n  std::vector<Label> label_stack_;\n  FixupMap depth_fixups_;\n  FixupMap func_fixups_;\n\n  u32 local_decl_count_;\n  u32 local_count_;\n\n  std::vector<FuncType> func_types_;      // Includes imported and defined.\n  std::vector<TableType> table_types_;    // Includes imported and defined.\n  std::vector<MemoryType> memory_types_;  // Includes imported and defined.\n  std::vector<GlobalType> global_types_;  // Includes imported and defined.\n  std::vector<TagType> tag_types_;        // Includes imported and defined.\n\n  std::string_view filename_;\n};\n\nLocation BinaryReaderInterp::GetLocation() const {\n  Location loc;\n  loc.filename = filename_;\n  loc.offset = state->offset;\n  return loc;\n}\n\nvoid FixupMap::Clear() {\n  map.clear();\n}\n\nvoid FixupMap::Append(Index index, Offset offset) {\n  map[index].push_back(offset);\n}\n\nvoid FixupMap::Resolve(Istream& istream, Index index) {\n  auto iter = map.find(index);\n  if (iter == map.end()) {\n    return;\n  }\n  for (Offset offset : iter->second) {\n    istream.ResolveFixupU32(offset);\n  }\n  map.erase(iter);\n}\n\nBinaryReaderInterp::BinaryReaderInterp(ModuleDesc* module,\n                                       std::string_view filename,\n                                       Errors* errors,\n                                       const Features& features)\n    : errors_(errors),\n      module_(*module),\n      istream_(module->istream),\n      validator_(errors, ValidateOptions(features)),\n      filename_(filename) {}\n\nLabel* BinaryReaderInterp::GetLabel(Index depth) {\n  assert(depth < label_stack_.size());\n  return &label_stack_[label_stack_.size() - depth - 1];\n}\n\nLabel* BinaryReaderInterp::GetNearestTryLabel(Index depth) {\n  for (size_t i = depth; i < label_stack_.size(); i++) {\n    Label* label = &label_stack_[label_stack_.size() - i - 1];\n    if (label->kind == LabelKind::Try) {\n      return label;\n    }\n  }\n  return nullptr;\n}\n\nLabel* BinaryReaderInterp::TopLabel() {\n  return GetLabel(0);\n}\n\nvoid WABT_PRINTF_FORMAT(2, 3) BinaryReaderInterp::PrintError(const char* format,\n                                                             ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  errors_->emplace_back(ErrorLevel::Error, Location(kInvalidOffset), buffer);\n}\n\nResult BinaryReaderInterp::GetDropCount(Index keep_count,\n                                        size_t type_stack_limit,\n                                        Index* out_drop_count) {\n  assert(validator_.type_stack_size() >= type_stack_limit);\n  Index type_stack_count = validator_.type_stack_size() - type_stack_limit;\n  // The keep_count may be larger than the type_stack_count if the typechecker\n  // is currently unreachable. In that case, it doesn't matter what value we\n  // drop, but 0 is a reasonable choice.\n  *out_drop_count =\n      type_stack_count >= keep_count ? type_stack_count - keep_count : 0;\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::GetBrDropKeepCount(Index depth,\n                                              Index* out_drop_count,\n                                              Index* out_keep_count) {\n  SharedValidator::Label* label;\n  CHECK_RESULT(validator_.GetLabel(depth, &label));\n  Index keep_count = label->br_types().size();\n  CHECK_RESULT(\n      GetDropCount(keep_count, label->type_stack_limit, out_drop_count));\n  *out_keep_count = keep_count;\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::GetReturnDropKeepCount(Index* out_drop_count,\n                                                  Index* out_keep_count) {\n  CHECK_RESULT(GetBrDropKeepCount(label_stack_.size() - 1, out_drop_count,\n                                  out_keep_count));\n  *out_drop_count += validator_.GetLocalCount();\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::GetReturnCallDropKeepCount(const FuncType& func_type,\n                                                      Index keep_extra,\n                                                      Index* out_drop_count,\n                                                      Index* out_keep_count) {\n  Index keep_count = static_cast<Index>(func_type.params.size()) + keep_extra;\n  CHECK_RESULT(GetDropCount(keep_count, 0, out_drop_count));\n  *out_drop_count += validator_.GetLocalCount();\n  *out_keep_count = keep_count;\n  return Result::Ok;\n}\n\nvoid BinaryReaderInterp::EmitBr(Index depth,\n                                Index drop_count,\n                                Index keep_count,\n                                Index catch_drop_count) {\n  istream_.EmitDropKeep(drop_count, keep_count);\n  istream_.EmitCatchDrop(catch_drop_count);\n  Istream::Offset offset = GetLabel(depth)->offset;\n  istream_.Emit(Opcode::Br);\n  if (offset == Istream::kInvalidOffset) {\n    // depth_fixups_ stores the depth counting up from zero, where zero is the\n    // top-level function scope.\n    depth_fixups_.Append(label_stack_.size() - 1 - depth, istream_.end());\n  }\n  istream_.Emit(offset);\n}\n\nResult BinaryReaderInterp::EmitBrCond(Opcode opcode, Index depth) {\n  Index drop_count, keep_count, catch_drop_count;\n  CHECK_RESULT(GetBrDropKeepCount(depth, &drop_count, &keep_count));\n  CHECK_RESULT(validator_.GetCatchCount(depth, &catch_drop_count));\n  // The opcode is flipped so if <cond> is\n  // true it can drop values from the stack.\n  istream_.Emit(opcode);\n  auto fixup = istream_.EmitFixupU32();\n  // The validator for br_on_null keeps the (non-null) reference on\n  // the stack. This reference needs to be ignored when the branch\n  // is executed. Note: opcode contains the flipped value.\n  if (opcode == Opcode::BrOnNonNull && drop_count > 0) {\n    drop_count--;\n  }\n  EmitBr(depth, drop_count, keep_count, catch_drop_count);\n  istream_.ResolveFixupU32(fixup);\n  return Result::Ok;\n}\n\nvoid BinaryReaderInterp::FixupTopLabel() {\n  depth_fixups_.Resolve(istream_, label_stack_.size() - 1);\n}\n\nu32 BinaryReaderInterp::GetFuncOffset(Index func_index) {\n  assert(func_index >= num_func_imports());\n  FuncDesc& func = module_.funcs[func_index - num_func_imports()];\n  if (func.code_offset == Istream::kInvalidOffset) {\n    func_fixups_.Append(func_index, istream_.end());\n  }\n  return func.code_offset;\n}\n\nbool BinaryReaderInterp::OnError(const Error& error) {\n  errors_->push_back(error);\n  return true;\n}\n\nResult BinaryReaderInterp::EndModule() {\n  CHECK_RESULT(validator_.EndModule());\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTypeCount(Index count) {\n  module_.func_types.reserve(std::min(count, kMaxPreallocatedBufferSize));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnFuncType(Index index,\n                                      Index param_count,\n                                      Type* param_types,\n                                      Index result_count,\n                                      Type* result_types) {\n  Result result = validator_.OnFuncType(GetLocation(), param_count, param_types,\n                                        result_count, result_types, index);\n  module_.func_types.push_back(FuncType(ToInterp(param_count, param_types),\n                                        ToInterp(result_count, result_types)));\n  return result;\n}\n\nResult BinaryReaderInterp::OnImportFunc(Index import_index,\n                                        std::string_view module_name,\n                                        std::string_view field_name,\n                                        Index func_index,\n                                        Index sig_index) {\n  CHECK_RESULT(\n      validator_.OnFunction(GetLocation(), Var(sig_index, GetLocation())));\n  FuncType& func_type = module_.func_types[sig_index];\n  module_.imports.push_back(ImportDesc{ImportType(\n      std::string(module_name), std::string(field_name), func_type.Clone())});\n  func_types_.push_back(func_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnImportTable(Index import_index,\n                                         std::string_view module_name,\n                                         std::string_view field_name,\n                                         Index table_index,\n                                         Type elem_type,\n                                         const Limits* elem_limits) {\n  CHECK_RESULT(\n      validator_.OnTable(GetLocation(), elem_type, *elem_limits,\n                         TableImportStatus::TableIsImported,\n                         TableInitExprStatus::TableWithoutInitExpression));\n  TableType table_type{elem_type, *elem_limits};\n  module_.imports.push_back(ImportDesc{ImportType(\n      std::string(module_name), std::string(field_name), table_type.Clone())});\n  table_types_.push_back(table_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnImportMemory(Index import_index,\n                                          std::string_view module_name,\n                                          std::string_view field_name,\n                                          Index memory_index,\n                                          const Limits* page_limits,\n                                          uint32_t page_size) {\n  CHECK_RESULT(validator_.OnMemory(GetLocation(), *page_limits, page_size));\n  MemoryType memory_type{*page_limits, page_size};\n  module_.imports.push_back(ImportDesc{ImportType(\n      std::string(module_name), std::string(field_name), memory_type.Clone())});\n  memory_types_.push_back(memory_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnImportGlobal(Index import_index,\n                                          std::string_view module_name,\n                                          std::string_view field_name,\n                                          Index global_index,\n                                          Type type,\n                                          bool mutable_) {\n  CHECK_RESULT(validator_.OnGlobalImport(GetLocation(), type, mutable_));\n  GlobalType global_type{type, ToMutability(mutable_)};\n  module_.imports.push_back(ImportDesc{ImportType(\n      std::string(module_name), std::string(field_name), global_type.Clone())});\n  global_types_.push_back(global_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnImportTag(Index import_index,\n                                       std::string_view module_name,\n                                       std::string_view field_name,\n                                       Index tag_index,\n                                       Index sig_index) {\n  CHECK_RESULT(validator_.OnTag(GetLocation(), Var(sig_index, GetLocation())));\n  FuncType& func_type = module_.func_types[sig_index];\n  TagType tag_type{TagAttr::Exception, func_type.params};\n  module_.imports.push_back(ImportDesc{ImportType(\n      std::string(module_name), std::string(field_name), tag_type.Clone())});\n  tag_types_.push_back(tag_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnFunctionCount(Index count) {\n  module_.funcs.reserve(std::min(count, kMaxPreallocatedBufferSize));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnFunction(Index index, Index sig_index) {\n  CHECK_RESULT(\n      validator_.OnFunction(GetLocation(), Var(sig_index, GetLocation())));\n  FuncType& func_type = module_.func_types[sig_index];\n  module_.funcs.push_back(FuncDesc{func_type, {}, Istream::kInvalidOffset, {}});\n  func_types_.push_back(func_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTableCount(Index count) {\n  module_.tables.reserve(std::min(count, kMaxPreallocatedBufferSize));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginTable(Index index,\n                                      Type elem_type,\n                                      const Limits* elem_limits,\n                                      TableInitExprStatus init_provided) {\n  CHECK_RESULT(validator_.OnTable(GetLocation(), elem_type, *elem_limits,\n                                  TableImportStatus::TableIsNotImported,\n                                  init_provided));\n  TableType table_type{elem_type, *elem_limits};\n  FuncDesc init_func{\n      FuncType{{}, {elem_type}}, {}, Istream::kInvalidOffset, {}};\n  module_.tables.push_back(TableDesc{table_type, init_func});\n  table_types_.push_back(table_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginTableInitExpr(Index index) {\n  TableDesc& table = module_.tables.back();\n  return BeginInitExpr(&table.init_func);\n}\n\nResult BinaryReaderInterp::EndTableInitExpr(Index index) {\n  FixupTopLabel();\n  CHECK_RESULT(validator_.EndInitExpr());\n  istream_.Emit(Opcode::Return);\n  PopLabel();\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnMemoryCount(Index count) {\n  module_.memories.reserve(std::min(count, kMaxPreallocatedBufferSize));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnMemory(Index index,\n                                    const Limits* limits,\n                                    uint32_t page_size) {\n  CHECK_RESULT(validator_.OnMemory(GetLocation(), *limits, page_size));\n  MemoryType memory_type{*limits, page_size};\n  module_.memories.push_back(MemoryDesc{memory_type});\n  memory_types_.push_back(memory_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnGlobalCount(Index count) {\n  module_.globals.reserve(std::min(count, kMaxPreallocatedBufferSize));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginGlobal(Index index, Type type, bool mutable_) {\n  CHECK_RESULT(validator_.OnGlobal(GetLocation(), type, mutable_));\n  GlobalType global_type{type, ToMutability(mutable_)};\n  FuncDesc init_func{FuncType{{}, {type}}, {}, Istream::kInvalidOffset, {}};\n  module_.globals.push_back(GlobalDesc{global_type, init_func});\n  global_types_.push_back(global_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginGlobalInitExpr(Index index) {\n  GlobalDesc& global = module_.globals.back();\n  return BeginInitExpr(&global.init_func);\n}\n\nResult BinaryReaderInterp::EndInitExpr() {\n  FixupTopLabel();\n  CHECK_RESULT(validator_.EndInitExpr());\n  istream_.Emit(Opcode::Return);\n  PopLabel();\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginInitExpr(FuncDesc* func) {\n  label_stack_.clear();\n  func_ = func;\n  func_->code_offset = istream_.end();\n  Type type = func->type.results[0];\n  CHECK_RESULT(validator_.BeginInitExpr(GetLocation(), type));\n  // Push implicit init func label (equivalent to return).\n  PushLabel(LabelKind::Try, Istream::kInvalidOffset, Istream::kInvalidOffset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::EndGlobalInitExpr(Index index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderInterp::OnTagCount(Index count) {\n  module_.tags.reserve(std::min(count, kMaxPreallocatedBufferSize));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTagType(Index index, Index sig_index) {\n  CHECK_RESULT(validator_.OnTag(GetLocation(), Var(sig_index, GetLocation())));\n  FuncType& func_type = module_.func_types[sig_index];\n  TagType tag_type{TagAttr::Exception, func_type.params};\n  module_.tags.push_back(TagDesc{tag_type});\n  tag_types_.push_back(tag_type);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnExport(Index index,\n                                    ExternalKind kind,\n                                    Index item_index,\n                                    std::string_view name) {\n  CHECK_RESULT(validator_.OnExport(GetLocation(), kind,\n                                   Var(item_index, GetLocation()), name));\n\n  std::unique_ptr<ExternType> type;\n  switch (kind) {\n    case ExternalKind::Func:   type = func_types_[item_index].Clone(); break;\n    case ExternalKind::Table:  type = table_types_[item_index].Clone(); break;\n    case ExternalKind::Memory: type = memory_types_[item_index].Clone(); break;\n    case ExternalKind::Global: type = global_types_[item_index].Clone(); break;\n    case ExternalKind::Tag:    type = tag_types_[item_index].Clone(); break;\n  }\n  module_.exports.push_back(\n      ExportDesc{ExportType(std::string(name), std::move(type)), item_index});\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnStartFunction(Index func_index) {\n  CHECK_RESULT(\n      validator_.OnStart(GetLocation(), Var(func_index, GetLocation())));\n  module_.starts.push_back(StartDesc{func_index});\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnElemSegmentCount(Index count) {\n  module_.elems.reserve(std::min(count, kMaxPreallocatedBufferSize));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginElemSegment(Index index,\n                                            Index table_index,\n                                            uint8_t flags) {\n  auto mode = ToSegmentMode(flags);\n  CHECK_RESULT(validator_.OnElemSegment(GetLocation(),\n                                        Var(table_index, GetLocation()), mode));\n\n  ValueType offset_type = ValueType::I32;\n  if (table_index < table_types_.size() &&\n      table_types_[table_index].limits.is_64) {\n    offset_type = ValueType::I64;\n  }\n  FuncDesc init_func{\n      FuncType{{}, {offset_type}}, {}, Istream::kInvalidOffset, {}};\n  ElemDesc desc{{}, ValueType::Void, mode, table_index, init_func};\n  module_.elems.push_back(desc);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginElemSegmentInitExpr(Index index) {\n  ElemDesc& elem = module_.elems.back();\n  return BeginInitExpr(&elem.init_func);\n}\n\nResult BinaryReaderInterp::EndElemSegmentInitExpr(Index index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderInterp::OnElemSegmentElemType(Index index, Type elem_type) {\n  ElemDesc& elem = module_.elems.back();\n  elem.type = elem_type;\n  return validator_.OnElemSegmentElemType(GetLocation(), elem_type);\n}\n\nResult BinaryReaderInterp::OnElemSegmentElemExprCount(Index index,\n                                                      Index count) {\n  ElemDesc& elem = module_.elems.back();\n  elem.elements.reserve(count);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginElemExpr(Index elem_index, Index expr_index) {\n  assert(elem_index == module_.elems.size() - 1);\n  ElemDesc& elem = module_.elems.back();\n  elem.elements.push_back(\n      {FuncType{{}, {elem.type}}, {}, Istream::kInvalidOffset, {}});\n  assert(expr_index == elem.elements.size() - 1);\n  return BeginInitExpr(&elem.elements.back());\n}\n\nResult BinaryReaderInterp::EndElemExpr(Index elem_index, Index expr_index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderInterp::OnDataCount(Index count) {\n  validator_.OnDataCount(count);\n  module_.datas.reserve(std::min(count, kMaxPreallocatedBufferSize));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::BeginDataSegmentInitExpr(Index index) {\n  DataDesc& data = module_.datas.back();\n  return BeginInitExpr(&data.init_func);\n}\n\nResult BinaryReaderInterp::EndDataSegmentInitExpr(Index index) {\n  return EndInitExpr();\n}\n\nResult BinaryReaderInterp::BeginDataSegment(Index index,\n                                            Index memory_index,\n                                            uint8_t flags) {\n  auto mode = ToSegmentMode(flags);\n  CHECK_RESULT(validator_.OnDataSegment(\n      GetLocation(), Var(memory_index, GetLocation()), mode));\n\n  ValueType offset_type = ValueType::I32;\n  if (memory_index < memory_types_.size() &&\n      memory_types_[memory_index].limits.is_64) {\n    offset_type = ValueType::I64;\n  }\n  FuncDesc init_func{\n      FuncType{{}, {offset_type}}, {}, Istream::kInvalidOffset, {}};\n  DataDesc desc{{}, mode, memory_index, init_func};\n  module_.datas.push_back(desc);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnDataSegmentData(Index index,\n                                             const void* src_data,\n                                             Address size) {\n  DataDesc& dst_data = module_.datas.back();\n  if (size > 0) {\n    dst_data.data.resize(size);\n    memcpy(dst_data.data.data(), src_data, size);\n  }\n  return Result::Ok;\n}\n\nvoid BinaryReaderInterp::PushLabel(LabelKind kind,\n                                   Istream::Offset offset,\n                                   Istream::Offset fixup_offset,\n                                   u32 handler_desc_index) {\n  label_stack_.push_back(Label{kind, offset, fixup_offset, handler_desc_index});\n}\n\nvoid BinaryReaderInterp::PopLabel() {\n  label_stack_.pop_back();\n}\n\nResult BinaryReaderInterp::BeginFunctionBody(Index index, Offset size) {\n  Index defined_index = index - num_func_imports();\n  func_ = &module_.funcs[defined_index];\n  func_->code_offset = istream_.end();\n\n  depth_fixups_.Clear();\n  label_stack_.clear();\n\n  // The fixups map is keyed by actual function index (not defined_index)\n  // (function imports don't have code and won't appear in the fixups map,\n  // but they still use function indexes)\n  func_fixups_.Resolve(istream_, index);\n\n  CHECK_RESULT(validator_.BeginFunctionBody(GetLocation(), index));\n\n  // Push implicit func label (equivalent to return).\n  // With exception handling it acts as a catch-less try block, which is\n  // needed to support delegating to the caller of a function using the\n  // try-delegate instruction.\n  PushLabel(LabelKind::Try, Istream::kInvalidOffset, Istream::kInvalidOffset,\n            func_->handlers.size());\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::EndFunctionBody(Index index) {\n  FixupTopLabel();\n  Index drop_count, keep_count;\n  CHECK_RESULT(GetReturnDropKeepCount(&drop_count, &keep_count));\n  CHECK_RESULT(validator_.EndFunctionBody(GetLocation()));\n  istream_.EmitDropKeep(drop_count, keep_count);\n  istream_.Emit(Opcode::Return);\n  PopLabel();\n  func_ = nullptr;\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnLocalDeclCount(Index count) {\n  local_decl_count_ = count;\n  local_count_ = 0;\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnLocalDecl(Index decl_index,\n                                       Index count,\n                                       Type type) {\n  CHECK_RESULT(validator_.OnLocalDecl(GetLocation(), count, type));\n\n  local_count_ += count;\n  func_->locals.push_back(LocalDesc{type, count, local_count_});\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::EndLocalDecls() {\n  if (local_count_ != 0) {\n    istream_.Emit(Opcode::InterpAlloca, local_count_);\n    for (Index i = 0; i < local_count_; i++) {\n      if (func_->GetLocalType(func_->type.params.size() + i).IsRef()) {\n        istream_.Emit(Opcode::InterpMarkRef, local_count_ - i);\n      }\n    }\n  }\n  // Continuation of the implicit func label, used for exception handling. (See\n  // BeginFunctionBody.)\n  // We need the local count for this, which is only available after processing\n  // all local decls.\n  // NOTE: we don't count the parameters, as they're not part of the frame.\n  func_->handlers.push_back(HandlerDesc{HandlerKind::Catch,\n                                        istream_.end(),\n                                        Istream::kInvalidOffset,\n                                        {},\n                                        {Istream::kInvalidOffset},\n                                        static_cast<u32>(local_count_),\n                                        0});\n\n  return Result::Ok;\n}\n\nIndex BinaryReaderInterp::num_func_imports() const {\n  return func_types_.size() - module_.funcs.size();\n}\n\nResult BinaryReaderInterp::OnOpcode(Opcode opcode) {\n  if (func_ == nullptr || label_stack_.empty()) {\n    PrintError(\"Unexpected instruction after end of function\");\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnUnaryExpr(Opcode opcode) {\n  CHECK_RESULT(validator_.OnUnary(GetLocation(), opcode));\n  istream_.Emit(opcode);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTernaryExpr(Opcode opcode) {\n  CHECK_RESULT(validator_.OnTernary(GetLocation(), opcode));\n  istream_.Emit(opcode);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnSimdLaneOpExpr(Opcode opcode, uint64_t value) {\n  CHECK_RESULT(validator_.OnSimdLaneOp(GetLocation(), opcode, value));\n  istream_.Emit(opcode, static_cast<u8>(value));\n  return Result::Ok;\n}\n\nuint32_t GetAlignment(Address alignment_log2) {\n  return alignment_log2 < 32 ? 1 << alignment_log2 : ~0u;\n}\n\nResult BinaryReaderInterp::OnSimdLoadLaneExpr(Opcode opcode,\n                                              Index memidx,\n                                              Address alignment_log2,\n                                              Address offset,\n                                              uint64_t value) {\n  CHECK_RESULT(validator_.OnSimdLoadLane(\n      GetLocation(), opcode, Var(memidx, GetLocation()),\n      GetAlignment(alignment_log2), offset, value));\n  istream_.Emit(opcode, memidx, offset, static_cast<u8>(value));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnSimdStoreLaneExpr(Opcode opcode,\n                                               Index memidx,\n                                               Address alignment_log2,\n                                               Address offset,\n                                               uint64_t value) {\n  CHECK_RESULT(validator_.OnSimdStoreLane(\n      GetLocation(), opcode, Var(memidx, GetLocation()),\n      GetAlignment(alignment_log2), offset, value));\n  istream_.Emit(opcode, memidx, offset, static_cast<u8>(value));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnSimdShuffleOpExpr(Opcode opcode, v128 value) {\n  CHECK_RESULT(validator_.OnSimdShuffleOp(GetLocation(), opcode, value));\n  istream_.Emit(opcode, value);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnLoadSplatExpr(Opcode opcode,\n                                           Index memidx,\n                                           Address align_log2,\n                                           Address offset) {\n  CHECK_RESULT(validator_.OnLoadSplat(GetLocation(), opcode,\n                                      Var(memidx, GetLocation()),\n                                      GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnLoadZeroExpr(Opcode opcode,\n                                          Index memidx,\n                                          Address align_log2,\n                                          Address offset) {\n  CHECK_RESULT(validator_.OnLoadZero(GetLocation(), opcode,\n                                     Var(memidx, GetLocation()),\n                                     GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnAtomicLoadExpr(Opcode opcode,\n                                            Index memidx,\n                                            Address align_log2,\n                                            Address offset) {\n  CHECK_RESULT(validator_.OnAtomicLoad(GetLocation(), opcode,\n                                       Var(memidx, GetLocation()),\n                                       GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnAtomicStoreExpr(Opcode opcode,\n                                             Index memidx,\n                                             Address align_log2,\n                                             Address offset) {\n  CHECK_RESULT(validator_.OnAtomicStore(GetLocation(), opcode,\n                                        Var(memidx, GetLocation()),\n                                        GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnAtomicRmwExpr(Opcode opcode,\n                                           Index memidx,\n                                           Address align_log2,\n                                           Address offset) {\n  CHECK_RESULT(validator_.OnAtomicRmw(GetLocation(), opcode,\n                                      Var(memidx, GetLocation()),\n                                      GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnAtomicRmwCmpxchgExpr(Opcode opcode,\n                                                  Index memidx,\n                                                  Address align_log2,\n                                                  Address offset) {\n  CHECK_RESULT(validator_.OnAtomicRmwCmpxchg(GetLocation(), opcode,\n                                             Var(memidx, GetLocation()),\n                                             GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnBinaryExpr(Opcode opcode) {\n  CHECK_RESULT(validator_.OnBinary(GetLocation(), opcode));\n  istream_.Emit(opcode);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnBlockExpr(Type sig_type) {\n  CHECK_RESULT(validator_.OnBlock(GetLocation(), sig_type));\n  PushLabel();\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnLoopExpr(Type sig_type) {\n  CHECK_RESULT(validator_.OnLoop(GetLocation(), sig_type));\n  PushLabel(LabelKind::Block, istream_.end());\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnIfExpr(Type sig_type) {\n  CHECK_RESULT(validator_.OnIf(GetLocation(), sig_type));\n  istream_.Emit(Opcode::InterpBrUnless);\n  auto fixup = istream_.EmitFixupU32();\n  PushLabel(LabelKind::Block, Istream::kInvalidOffset, fixup);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnElseExpr() {\n  CHECK_RESULT(validator_.OnElse(GetLocation()));\n  Label* label = TopLabel();\n  Istream::Offset fixup_cond_offset = label->fixup_offset;\n  istream_.Emit(Opcode::Br);\n  label->fixup_offset = istream_.EmitFixupU32();\n  istream_.ResolveFixupU32(fixup_cond_offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnEndExpr() {\n  if (label_stack_.size() == 1) {\n    return Result::Ok;\n  }\n  SharedValidator::Label* label;\n  CHECK_RESULT(validator_.GetLabel(0, &label));\n  LabelType label_type = label->label_type;\n  CHECK_RESULT(validator_.OnEnd(GetLocation()));\n  if (label_type == LabelType::If || label_type == LabelType::Else) {\n    istream_.ResolveFixupU32(TopLabel()->fixup_offset);\n  } else if (label_type == LabelType::Try) {\n    // Catch-less try blocks need to fill in the handler description\n    // so that it can trigger an exception rethrow when it's reached.\n    Label* local_label = TopLabel();\n    HandlerDesc& desc = func_->handlers[local_label->handler_desc_index];\n    desc.try_end_offset = istream_.end();\n    assert(desc.catches.size() == 0);\n  } else if (label_type == LabelType::TryTable) {\n    // TryTable blocks need a try_end_offset\n    Label* local_label = TopLabel();\n    HandlerDesc& desc = func_->handlers[local_label->handler_desc_index];\n    desc.try_end_offset = istream_.end();\n  } else if (label_type == LabelType::Catch) {\n    istream_.EmitCatchDrop(1);\n  }\n  FixupTopLabel();\n  PopLabel();\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnBrExpr(Index depth) {\n  Index drop_count, keep_count, catch_drop_count;\n  CHECK_RESULT(GetBrDropKeepCount(depth, &drop_count, &keep_count));\n  CHECK_RESULT(validator_.GetCatchCount(depth, &catch_drop_count));\n  CHECK_RESULT(validator_.OnBr(GetLocation(), Var(depth, GetLocation())));\n  EmitBr(depth, drop_count, keep_count, catch_drop_count);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnBrIfExpr(Index depth) {\n  CHECK_RESULT(validator_.OnBrIf(GetLocation(), Var(depth, GetLocation())));\n  // Opcode is flipped.\n  return EmitBrCond(Opcode::InterpBrUnless, depth);\n}\n\nResult BinaryReaderInterp::OnBrOnNonNullExpr(Index depth) {\n  CHECK_RESULT(\n      validator_.OnBrOnNonNull(GetLocation(), Var(depth, GetLocation())));\n  // Opcode is flipped.\n  return EmitBrCond(Opcode::BrOnNull, depth);\n}\n\nResult BinaryReaderInterp::OnBrOnNullExpr(Index depth) {\n  CHECK_RESULT(validator_.OnBrOnNull(GetLocation(), Var(depth, GetLocation())));\n  // Opcode is flipped.\n  return EmitBrCond(Opcode::BrOnNonNull, depth);\n}\n\nResult BinaryReaderInterp::OnBrTableExpr(Index num_targets,\n                                         Index* target_depths,\n                                         Index default_target_depth) {\n  CHECK_RESULT(validator_.BeginBrTable(GetLocation()));\n  Index drop_count, keep_count, catch_drop_count;\n  istream_.Emit(Opcode::BrTable, num_targets);\n\n  for (Index i = 0; i < num_targets; ++i) {\n    Index depth = target_depths[i];\n    CHECK_RESULT(\n        validator_.OnBrTableTarget(GetLocation(), Var(depth, GetLocation())));\n    CHECK_RESULT(GetBrDropKeepCount(depth, &drop_count, &keep_count));\n    CHECK_RESULT(validator_.GetCatchCount(depth, &catch_drop_count));\n    // Emit DropKeep directly (instead of using EmitDropKeep) so the\n    // instruction has a fixed size. Same for CatchDrop as well.\n    istream_.Emit(Opcode::InterpDropKeep, drop_count, keep_count);\n    istream_.Emit(Opcode::InterpCatchDrop, catch_drop_count);\n    EmitBr(depth, 0, 0, 0);\n  }\n  CHECK_RESULT(validator_.OnBrTableTarget(\n      GetLocation(), Var(default_target_depth, GetLocation())));\n  CHECK_RESULT(\n      GetBrDropKeepCount(default_target_depth, &drop_count, &keep_count));\n  CHECK_RESULT(\n      validator_.GetCatchCount(default_target_depth, &catch_drop_count));\n  // The default case doesn't need a fixed size, since it is never jumped over.\n  istream_.EmitDropKeep(drop_count, keep_count);\n  istream_.Emit(Opcode::InterpCatchDrop, catch_drop_count);\n  EmitBr(default_target_depth, 0, 0, 0);\n\n  CHECK_RESULT(validator_.EndBrTable(GetLocation()));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnCallExpr(Index func_index) {\n  CHECK_RESULT(\n      validator_.OnCall(GetLocation(), Var(func_index, GetLocation())));\n\n  if (func_index >= num_func_imports()) {\n    istream_.Emit(Opcode::Call, func_index);\n  } else {\n    istream_.Emit(Opcode::InterpCallImport, func_index);\n  }\n\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnCallIndirectExpr(Index sig_index,\n                                              Index table_index) {\n  CHECK_RESULT(validator_.OnCallIndirect(GetLocation(),\n                                         Var(sig_index, GetLocation()),\n                                         Var(table_index, GetLocation())));\n  istream_.Emit(Opcode::CallIndirect, table_index, sig_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnCallRefExpr(Type sig_type) {\n  CHECK_RESULT(\n      validator_.OnCallRef(GetLocation(), Var(sig_type, GetLocation())));\n  assert(sig_type == Type::RefNull);\n  istream_.Emit(Opcode::CallRef);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnReturnCallExpr(Index func_index) {\n  CHECK_RESULT(\n      validator_.OnReturnCall(GetLocation(), Var(func_index, GetLocation())));\n\n  FuncType& func_type = func_types_[func_index];\n\n  Index drop_count, keep_count, catch_drop_count;\n  CHECK_RESULT(\n      GetReturnCallDropKeepCount(func_type, 0, &drop_count, &keep_count));\n  CHECK_RESULT(\n      validator_.GetCatchCount(label_stack_.size() - 1, &catch_drop_count));\n  // The validator must be run after we get the drop/keep counts, since it\n  // will change the type stack.\n  CHECK_RESULT(\n      validator_.OnReturnCall(GetLocation(), Var(func_index, GetLocation())));\n  istream_.EmitDropKeep(drop_count, keep_count);\n  istream_.EmitCatchDrop(catch_drop_count);\n\n  if (func_index >= num_func_imports()) {\n    istream_.Emit(Opcode::InterpAdjustFrameForReturnCall, func_index);\n    istream_.Emit(Opcode::Br);\n    // We emit this separately to ensure that the fixup generated by\n    // GetFuncOffset comes after the Br opcode.\n    istream_.Emit(GetFuncOffset(func_index));\n  } else {\n    istream_.Emit(Opcode::InterpCallImport, func_index);\n    istream_.Emit(Opcode::Return);\n  }\n\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnReturnCallIndirectExpr(Index sig_index,\n                                                    Index table_index) {\n  CHECK_RESULT(validator_.OnReturnCallIndirect(\n      GetLocation(), Var(sig_index, GetLocation()),\n      Var(table_index, GetLocation())));\n\n  FuncType& func_type = module_.func_types[sig_index];\n\n  Index drop_count, keep_count, catch_drop_count;\n  // +1 to include the index of the function.\n  CHECK_RESULT(\n      GetReturnCallDropKeepCount(func_type, +1, &drop_count, &keep_count));\n  CHECK_RESULT(\n      validator_.GetCatchCount(label_stack_.size() - 1, &catch_drop_count));\n  // The validator must be run after we get the drop/keep counts, since it\n  // changes the type stack.\n  CHECK_RESULT(validator_.OnReturnCallIndirect(\n      GetLocation(), Var(sig_index, GetLocation()),\n      Var(table_index, GetLocation())));\n  istream_.EmitDropKeep(drop_count, keep_count);\n  istream_.EmitCatchDrop(catch_drop_count);\n  istream_.Emit(Opcode::ReturnCallIndirect, table_index, sig_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnReturnCallRefExpr(Type sig_type) {\n  CHECK_RESULT(\n      validator_.OnReturnCallRef(GetLocation(), Var(sig_type, GetLocation())));\n  assert(sig_type == Type::RefNull);\n  istream_.Emit(Opcode::ReturnCallRef);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnCompareExpr(Opcode opcode) {\n  CHECK_RESULT(validator_.OnCompare(GetLocation(), opcode));\n  istream_.Emit(opcode);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnConvertExpr(Opcode opcode) {\n  CHECK_RESULT(validator_.OnConvert(GetLocation(), opcode));\n  istream_.Emit(opcode);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnDropExpr() {\n  CHECK_RESULT(validator_.OnDrop(GetLocation()));\n  istream_.Emit(Opcode::Drop);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnI32ConstExpr(uint32_t value) {\n  CHECK_RESULT(validator_.OnConst(GetLocation(), Type::I32));\n  istream_.Emit(Opcode::I32Const, value);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnI64ConstExpr(uint64_t value) {\n  CHECK_RESULT(validator_.OnConst(GetLocation(), Type::I64));\n  istream_.Emit(Opcode::I64Const, value);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnF32ConstExpr(uint32_t value_bits) {\n  CHECK_RESULT(validator_.OnConst(GetLocation(), Type::F32));\n  istream_.Emit(Opcode::F32Const, value_bits);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnF64ConstExpr(uint64_t value_bits) {\n  CHECK_RESULT(validator_.OnConst(GetLocation(), Type::F64));\n  istream_.Emit(Opcode::F64Const, value_bits);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnV128ConstExpr(v128 value_bits) {\n  CHECK_RESULT(validator_.OnConst(GetLocation(), Type::V128));\n  istream_.Emit(Opcode::V128Const, value_bits);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnGlobalGetExpr(Index global_index) {\n  CHECK_RESULT(\n      validator_.OnGlobalGet(GetLocation(), Var(global_index, GetLocation())));\n\n  Type type = global_types_.at(global_index).type;\n  if (type.IsRef()) {\n    istream_.Emit(Opcode::InterpGlobalGetRef, global_index);\n  } else {\n    istream_.Emit(Opcode::GlobalGet, global_index);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnGlobalSetExpr(Index global_index) {\n  CHECK_RESULT(\n      validator_.OnGlobalSet(GetLocation(), Var(global_index, GetLocation())));\n  istream_.Emit(Opcode::GlobalSet, global_index);\n  return Result::Ok;\n}\n\nIndex BinaryReaderInterp::TranslateLocalIndex(Index local_index) {\n  return validator_.type_stack_size() + validator_.GetLocalCount() -\n         local_index;\n}\n\nResult BinaryReaderInterp::OnLocalGetExpr(Index local_index) {\n  // Get the translated index before calling validator_.OnLocalGet because it\n  // will update the type stack size. We need the index to be relative to the\n  // old stack size.\n  Index translated_local_index = TranslateLocalIndex(local_index);\n  CHECK_RESULT(\n      validator_.OnLocalGet(GetLocation(), Var(local_index, GetLocation())));\n\n  Type type = func_->GetLocalType(local_index);\n  if (type.IsRef()) {\n    istream_.Emit(Opcode::InterpLocalGetRef, translated_local_index);\n  } else {\n    istream_.Emit(Opcode::LocalGet, translated_local_index);\n  }\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnLocalSetExpr(Index local_index) {\n  // See comment in OnLocalGetExpr above.\n  Index translated_local_index = TranslateLocalIndex(local_index);\n  CHECK_RESULT(\n      validator_.OnLocalSet(GetLocation(), Var(local_index, GetLocation())));\n\n  istream_.Emit(Opcode::LocalSet, translated_local_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnLocalTeeExpr(Index local_index) {\n  CHECK_RESULT(\n      validator_.OnLocalTee(GetLocation(), Var(local_index, GetLocation())));\n\n  istream_.Emit(Opcode::LocalTee, TranslateLocalIndex(local_index));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnLoadExpr(Opcode opcode,\n                                      Index memidx,\n                                      Address align_log2,\n                                      Address offset) {\n  CHECK_RESULT(validator_.OnLoad(GetLocation(), opcode,\n                                 Var(memidx, GetLocation()),\n                                 GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnStoreExpr(Opcode opcode,\n                                       Index memidx,\n                                       Address align_log2,\n                                       Address offset) {\n  CHECK_RESULT(validator_.OnStore(GetLocation(), opcode,\n                                  Var(memidx, GetLocation()),\n                                  GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnMemoryGrowExpr(Index memidx) {\n  CHECK_RESULT(\n      validator_.OnMemoryGrow(GetLocation(), Var(memidx, GetLocation())));\n  istream_.Emit(Opcode::MemoryGrow, memidx);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnMemorySizeExpr(Index memidx) {\n  CHECK_RESULT(\n      validator_.OnMemorySize(GetLocation(), Var(memidx, GetLocation())));\n  istream_.Emit(Opcode::MemorySize, memidx);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTableGrowExpr(Index table_index) {\n  CHECK_RESULT(\n      validator_.OnTableGrow(GetLocation(), Var(table_index, GetLocation())));\n  istream_.Emit(Opcode::TableGrow, table_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTableSizeExpr(Index table_index) {\n  CHECK_RESULT(\n      validator_.OnTableSize(GetLocation(), Var(table_index, GetLocation())));\n  istream_.Emit(Opcode::TableSize, table_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTableFillExpr(Index table_index) {\n  CHECK_RESULT(\n      validator_.OnTableFill(GetLocation(), Var(table_index, GetLocation())));\n  istream_.Emit(Opcode::TableFill, table_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnRefAsNonNullExpr() {\n  CHECK_RESULT(validator_.OnRefAsNonNull(Location()));\n  istream_.Emit(Opcode::RefAsNonNull);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnRefFuncExpr(Index func_index) {\n  CHECK_RESULT(\n      validator_.OnRefFunc(GetLocation(), Var(func_index, GetLocation())));\n  istream_.Emit(Opcode::RefFunc, func_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnRefNullExpr(Type type) {\n  CHECK_RESULT(validator_.OnRefNull(GetLocation(), Var(type, GetLocation())));\n  istream_.Emit(Opcode::RefNull);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnRefIsNullExpr() {\n  CHECK_RESULT(validator_.OnRefIsNull(GetLocation()));\n  istream_.Emit(Opcode::RefIsNull);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnNopExpr() {\n  CHECK_RESULT(validator_.OnNop(GetLocation()));\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnReturnExpr() {\n  Index drop_count, keep_count, catch_drop_count;\n  CHECK_RESULT(GetReturnDropKeepCount(&drop_count, &keep_count));\n  CHECK_RESULT(\n      validator_.GetCatchCount(label_stack_.size() - 1, &catch_drop_count));\n  CHECK_RESULT(validator_.OnReturn(GetLocation()));\n  istream_.EmitDropKeep(drop_count, keep_count);\n  istream_.EmitCatchDrop(catch_drop_count);\n  istream_.Emit(Opcode::Return);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnSelectExpr(Index result_count,\n                                        Type* result_types) {\n  CHECK_RESULT(validator_.OnSelect(GetLocation(), result_count, result_types));\n  istream_.Emit(Opcode::Select);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnUnreachableExpr() {\n  CHECK_RESULT(validator_.OnUnreachable(GetLocation()));\n  istream_.Emit(Opcode::Unreachable);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnAtomicWaitExpr(Opcode opcode,\n                                            Index memidx,\n                                            Address align_log2,\n                                            Address offset) {\n  CHECK_RESULT(validator_.OnAtomicWait(GetLocation(), opcode,\n                                       Var(memidx, GetLocation()),\n                                       GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnAtomicFenceExpr(uint32_t consistency_model) {\n  CHECK_RESULT(validator_.OnAtomicFence(GetLocation(), consistency_model));\n  istream_.Emit(Opcode::AtomicFence, consistency_model);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnAtomicNotifyExpr(Opcode opcode,\n                                              Index memidx,\n                                              Address align_log2,\n                                              Address offset) {\n  CHECK_RESULT(validator_.OnAtomicNotify(GetLocation(), opcode,\n                                         Var(memidx, GetLocation()),\n                                         GetAlignment(align_log2), offset));\n  istream_.Emit(opcode, memidx, offset);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnMemoryCopyExpr(Index destmemidx, Index srcmemidx) {\n  CHECK_RESULT(validator_.OnMemoryCopy(GetLocation(),\n                                       Var(destmemidx, GetLocation()),\n                                       Var(srcmemidx, GetLocation())));\n  istream_.Emit(Opcode::MemoryCopy, destmemidx, srcmemidx);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnDataDropExpr(Index segment_index) {\n  CHECK_RESULT(\n      validator_.OnDataDrop(GetLocation(), Var(segment_index, GetLocation())));\n  istream_.Emit(Opcode::DataDrop, segment_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnMemoryFillExpr(Index memidx) {\n  CHECK_RESULT(\n      validator_.OnMemoryFill(GetLocation(), Var(memidx, GetLocation())));\n  istream_.Emit(Opcode::MemoryFill, memidx);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnMemoryInitExpr(Index segment_index, Index memidx) {\n  CHECK_RESULT(validator_.OnMemoryInit(GetLocation(),\n                                       Var(segment_index, GetLocation()),\n                                       Var(memidx, GetLocation())));\n  istream_.Emit(Opcode::MemoryInit, memidx, segment_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTableGetExpr(Index table_index) {\n  CHECK_RESULT(\n      validator_.OnTableGet(GetLocation(), Var(table_index, GetLocation())));\n  istream_.Emit(Opcode::TableGet, table_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTableSetExpr(Index table_index) {\n  CHECK_RESULT(\n      validator_.OnTableSet(GetLocation(), Var(table_index, GetLocation())));\n  istream_.Emit(Opcode::TableSet, table_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTableCopyExpr(Index dst_index, Index src_index) {\n  CHECK_RESULT(validator_.OnTableCopy(GetLocation(),\n                                      Var(dst_index, GetLocation()),\n                                      Var(src_index, GetLocation())));\n  istream_.Emit(Opcode::TableCopy, dst_index, src_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnElemDropExpr(Index segment_index) {\n  CHECK_RESULT(\n      validator_.OnElemDrop(GetLocation(), Var(segment_index, GetLocation())));\n  istream_.Emit(Opcode::ElemDrop, segment_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTableInitExpr(Index segment_index,\n                                           Index table_index) {\n  CHECK_RESULT(validator_.OnTableInit(GetLocation(),\n                                      Var(segment_index, GetLocation()),\n                                      Var(table_index, GetLocation())));\n  istream_.Emit(Opcode::TableInit, table_index, segment_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnThrowExpr(Index tag_index) {\n  CHECK_RESULT(\n      validator_.OnThrow(GetLocation(), Var(tag_index, GetLocation())));\n  istream_.Emit(Opcode::Throw, tag_index);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnThrowRefExpr() {\n  CHECK_RESULT(validator_.OnThrowRef(GetLocation()));\n  istream_.Emit(Opcode::ThrowRef);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnRethrowExpr(Index depth) {\n  Index catch_depth;\n  CHECK_RESULT(validator_.OnRethrow(GetLocation(), Var(depth, GetLocation())));\n  CHECK_RESULT(validator_.GetCatchCount(depth, &catch_depth));\n  // The rethrow opcode takes an index into the exception stack rather than\n  // the number of catch nestings, so we subtract one here.\n  istream_.Emit(Opcode::Rethrow, catch_depth - 1);\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTryExpr(Type sig_type) {\n  u32 exn_stack_height;\n  CHECK_RESULT(\n      validator_.GetCatchCount(label_stack_.size() - 1, &exn_stack_height));\n  // NOTE: *NOT* GetLocalCount. we don't count the parameters, as they're not\n  // part of the frame.\n  u32 value_stack_height = validator_.type_stack_size() + local_count_;\n  CHECK_RESULT(validator_.OnTry(GetLocation(), sig_type));\n  // Push a label that tracks mapping of exn -> catch\n  PushLabel(LabelKind::Try, Istream::kInvalidOffset, Istream::kInvalidOffset,\n            func_->handlers.size());\n  func_->handlers.push_back(HandlerDesc{HandlerKind::Catch,\n                                        istream_.end(),\n                                        Istream::kInvalidOffset,\n                                        {},\n                                        {Istream::kInvalidOffset},\n                                        value_stack_height,\n                                        exn_stack_height});\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnTryTableExpr(Type sig_type,\n                                          const CatchClauseVector& catches) {\n  // we can just emit the catch handlers beforehand, so long as we skip over\n  // them when entering the try.\n  CHECK_RESULT(validator_.BeginTryTable(GetLocation(), sig_type));\n\n  u32 exn_stack_height;\n  CHECK_RESULT(\n      validator_.GetCatchCount(label_stack_.size() - 1, &exn_stack_height));\n  // NOTE: *NOT* GetLocalCount. we don't count the parameters, as they're not\n  // part of the frame.\n  u32 value_stack_height = validator_.type_stack_size() + local_count_;\n\n  HandlerDesc desc =\n      HandlerDesc{HandlerKind::Catch,        Istream::kInvalidOffset,\n                  Istream::kInvalidOffset,   {},\n                  {Istream::kInvalidOffset}, value_stack_height,\n                  exn_stack_height};\n\n  istream_.Emit(Opcode::Br);\n  auto offset = istream_.EmitFixupU32();\n\n  bool has_catch_all = false;\n  for (const auto& raw_catch : catches) {\n    TableCatch catch_;\n    catch_.kind = raw_catch.kind;\n    catch_.tag = Var(raw_catch.tag, GetLocation());\n    catch_.target = Var(raw_catch.depth, GetLocation());\n    CHECK_RESULT(validator_.OnTryTableCatch(GetLocation(), catch_));\n    // stop emitting handlers after catch_all - but we must still validate the\n    // handlers we don't emit\n    if (has_catch_all) {\n      continue;\n    }\n    if (catch_.IsCatchAll()) {\n      has_catch_all = true;\n      desc.catch_all_ref = catch_.IsRef();\n      desc.catch_all_offset = istream_.end();\n    } else {\n      desc.catches.push_back(\n          CatchDesc{raw_catch.tag, istream_.end(), catch_.IsRef()});\n    }\n    // we can't use GetBrDropKeepCount because we're not in a real block.\n    SharedValidator::Label* vlabel;\n    CHECK_RESULT(validator_.GetLabel(raw_catch.depth, &vlabel));\n    // we keep the exception's results.\n    // (this has already been validated, above)\n    Index keep_count = vlabel->br_types().size();\n    // we drop everything between the current block and the br target.\n    // (we have already taken the TryTable block parameters into account, in\n    // BeginTryTable)\n    Index drop_count = validator_.type_stack_size() - vlabel->type_stack_limit;\n    Index catch_drop_count;\n    // we use the regular catch count\n    CHECK_RESULT(validator_.GetCatchCount(raw_catch.depth, &catch_drop_count));\n    // but increment, as we are semantically in a catch\n    catch_drop_count++;\n    EmitBr(raw_catch.depth, drop_count, keep_count, catch_drop_count);\n  }\n\n  CHECK_RESULT(validator_.EndTryTable(GetLocation(), sig_type));\n\n  desc.try_start_offset = istream_.end();\n\n  // as usual, the label is pushed after the catch handlers\n  PushLabel(LabelKind::Try, Istream::kInvalidOffset, Istream::kInvalidOffset,\n            func_->handlers.size());\n  func_->handlers.push_back(std::move(desc));\n\n  istream_.ResolveFixupU32(offset);\n\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnCatchExpr(Index tag_index) {\n  CHECK_RESULT(\n      validator_.OnCatch(GetLocation(), Var(tag_index, GetLocation()), false));\n  Label* label = TopLabel();\n  HandlerDesc& desc = func_->handlers[label->handler_desc_index];\n  desc.kind = HandlerKind::Catch;\n  // Drop the previous block's exception if it was a catch.\n  if (label->kind == LabelKind::Block) {\n    istream_.EmitCatchDrop(1);\n  }\n  // Jump to the end of the block at the end of the previous try or catch.\n  Istream::Offset offset = label->offset;\n  istream_.Emit(Opcode::Br);\n  assert(offset == Istream::kInvalidOffset);\n  depth_fixups_.Append(label_stack_.size() - 1, istream_.end());\n  istream_.Emit(offset);\n  // The offset is only set after the first catch block, as the offset range\n  // should only cover the try block itself.\n  if (desc.try_end_offset == Istream::kInvalidOffset) {\n    desc.try_end_offset = istream_.end();\n  }\n  // The label kind is switched to Block from Try in order to distinguish\n  // catch blocks from try blocks. This is used to ensure that a try-delegate\n  // inside this catch will not delegate to the catch, and instead find outer\n  // try blocks to use as a delegate target.\n  label->kind = LabelKind::Block;\n  desc.catches.push_back(CatchDesc{tag_index, istream_.end()});\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnCatchAllExpr() {\n  CHECK_RESULT(validator_.OnCatch(GetLocation(), Var(), true));\n  Label* label = TopLabel();\n  HandlerDesc& desc = func_->handlers[label->handler_desc_index];\n  desc.kind = HandlerKind::Catch;\n  if (label->kind == LabelKind::Block) {\n    istream_.EmitCatchDrop(1);\n  }\n  Istream::Offset offset = label->offset;\n  istream_.Emit(Opcode::Br);\n  assert(offset == Istream::kInvalidOffset);\n  depth_fixups_.Append(label_stack_.size() - 1, istream_.end());\n  istream_.Emit(offset);\n  if (desc.try_end_offset == Istream::kInvalidOffset) {\n    desc.try_end_offset = istream_.end();\n  }\n  label->kind = LabelKind::Block;\n  desc.catch_all_offset = istream_.end();\n  return Result::Ok;\n}\n\nResult BinaryReaderInterp::OnDelegateExpr(Index depth) {\n  CHECK_RESULT(validator_.OnDelegate(GetLocation(), Var(depth, GetLocation())));\n  Label* label = TopLabel();\n  assert(label->kind == LabelKind::Try);\n  HandlerDesc& desc = func_->handlers[label->handler_desc_index];\n  desc.kind = HandlerKind::Delegate;\n  Istream::Offset offset = label->offset;\n  istream_.Emit(Opcode::Br);\n  assert(offset == Istream::kInvalidOffset);\n  depth_fixups_.Append(label_stack_.size() - 1, istream_.end());\n  istream_.Emit(offset);\n  desc.try_end_offset = istream_.end();\n  Label* target_label = GetNearestTryLabel(depth + 1);\n  assert(target_label);\n  desc.delegate_handler_index = target_label->handler_desc_index;\n  FixupTopLabel();\n  PopLabel();\n  return Result::Ok;\n}\n\n}  // namespace\n\nResult ReadBinaryInterp(std::string_view filename,\n                        const void* data,\n                        size_t size,\n                        const ReadBinaryOptions& options,\n                        Errors* errors,\n                        ModuleDesc* out_module) {\n  BinaryReaderInterp reader(out_module, filename, errors, options.features);\n  return ReadBinary(data, size, &reader, options);\n}\n\n}  // namespace interp\n}  // namespace wabt\n"
  },
  {
    "path": "src/interp/interp-util.cc",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/interp/interp-util.h\"\n\n#include <cinttypes>\n\n#include \"wabt/stream.h\"\n\nnamespace wabt {\nnamespace interp {\n\nstd::string TypedValueToString(const TypedValue& tv) {\n  switch (tv.type) {\n    case Type::I32:\n      return StringPrintf(\"i32:%u\", tv.value.Get<s32>());\n\n    case Type::I64:\n      return StringPrintf(\"i64:%\" PRIu64, tv.value.Get<s64>());\n\n    case Type::F32:\n      return StringPrintf(\"f32:%f\", tv.value.Get<f32>());\n\n    case Type::F64:\n      return StringPrintf(\"f64:%f\", tv.value.Get<f64>());\n\n    case Type::V128: {\n      v128 simd = tv.value.Get<v128>();\n      return StringPrintf(\"v128 i32x4:0x%08x 0x%08x 0x%08x 0x%08x\", simd.u32(0),\n                          simd.u32(1), simd.u32(2), simd.u32(3));\n    }\n\n    case Type::I8:  // For SIMD lane.\n      return StringPrintf(\"i8:%u\", tv.value.Get<u32>() & 0xff);\n\n    case Type::I16:  // For SIMD lane.\n      return StringPrintf(\"i16:%u\", tv.value.Get<u32>() & 0xffff);\n\n    case Type::FuncRef:\n      return StringPrintf(\"funcref:%\" PRIzd, tv.value.Get<Ref>().index);\n\n    case Type::ExternRef:\n      return StringPrintf(\"externref:%\" PRIzd, tv.value.Get<Ref>().index);\n\n    case Type::ExnRef:\n      return StringPrintf(\"exnref:%\" PRIzd, tv.value.Get<Ref>().index);\n\n    case Type::Reference:\n    case Type::Ref:\n    case Type::RefNull:\n    case Type::Func:\n    case Type::Struct:\n    case Type::Array:\n    case Type::Void:\n    case Type::Any:\n    case Type::I8U:\n    case Type::I16U:\n    case Type::I32U:\n      // These types are not concrete types and should never exist as a value\n      WABT_UNREACHABLE;\n  }\n  WABT_UNREACHABLE;\n}\n\nvoid WriteValue(Stream* stream, const TypedValue& tv) {\n  std::string s = TypedValueToString(tv);\n  stream->WriteData(s.data(), s.size());\n}\n\nvoid WriteValues(Stream* stream,\n                 const ValueTypes& types,\n                 const Values& values) {\n  assert(types.size() == values.size());\n  for (size_t i = 0; i < values.size(); ++i) {\n    WriteValue(stream, TypedValue{types[i], values[i]});\n    if (i != values.size() - 1) {\n      stream->Writef(\", \");\n    }\n  }\n}\n\nvoid WriteTrap(Stream* stream, const char* desc, const Trap::Ptr& trap) {\n  stream->Writef(\"%s: %s\\n\", desc, trap->message().c_str());\n}\n\nvoid WriteCall(Stream* stream,\n               std::string_view name,\n               const FuncType& func_type,\n               const Values& params,\n               const Values& results,\n               const Trap::Ptr& trap) {\n  stream->Writef(PRIstringview \"(\", WABT_PRINTF_STRING_VIEW_ARG(name));\n  WriteValues(stream, func_type.params, params);\n  stream->Writef(\") =>\");\n  if (!trap) {\n    if (!results.empty()) {\n      stream->Writef(\" \");\n      WriteValues(stream, func_type.results, results);\n    }\n    stream->Writef(\"\\n\");\n  } else {\n    WriteTrap(stream, \" error\", trap);\n  }\n}\n\n}  // namespace interp\n}  // namespace wabt\n"
  },
  {
    "path": "src/interp/interp-wasi.cc",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * This is an experiment and currently extremely limited implementation\n * of the WASI syscall API.  The implementation of the API itself is coming from\n * uvwasi: https://github.com/cjihrig/uvwasi.\n *\n * Most of the code in the file is mostly marshelling data between the wabt\n * interpreter and uvwasi.\n *\n * For details of the WASI api see:\n * https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs.md\n * and the C headers version:\n * https://github.com/WebAssembly/wasi-libc/blob/master/libc-bottom-half/headers/public/wasi/api.h\n */\n\n#include \"wabt/interp/interp-wasi.h\"\n#include \"wabt/interp/interp-util.h\"\n\n#ifdef WITH_WASI\n\n#include \"uvwasi.h\"\n\n#include <cinttypes>\n#include <unordered_map>\n\nusing namespace wabt;\nusing namespace wabt::interp;\n\nnamespace {\n\n// Types that align with WASI spec on size and alignment.  These are\n// copied directly from wasi-lib's auto-generated api.h\n// TODO(sbc): Auto-generate this from witx.\n\n// BEGIN: wasi.h types from wasi-libc\n\nusing __wasi_size_t = uint32_t;\nusing __wasi_ptr_t = uint32_t;\n\nstatic_assert(sizeof(__wasi_size_t) == 4, \"witx calculated size\");\nstatic_assert(alignof(__wasi_size_t) == 4, \"witx calculated align\");\nstatic_assert(sizeof(__wasi_ptr_t) == 4, \"witx calculated size\");\nstatic_assert(alignof(__wasi_ptr_t) == 4, \"witx calculated align\");\n\nstruct __wasi_prestat_dir_t {\n  __wasi_size_t pr_name_len;\n};\n\nusing __wasi_preopentype_t = uint8_t;\nusing __wasi_rights_t = uint64_t;\nusing __wasi_fdflags_t = uint16_t;\nusing __wasi_filetype_t = uint8_t;\nusing __wasi_oflags_t = uint16_t;\nusing __wasi_lookupflags_t = uint32_t;\nusing __wasi_fd_t = uint32_t;\nusing __wasi_timestamp_t = uint64_t;\nusing __wasi_whence_t = uint8_t;\nusing __wasi_filedelta_t = int64_t;\nusing __wasi_filesize_t = uint64_t;\n\nunion __wasi_prestat_u_t {\n  __wasi_prestat_dir_t dir;\n};\n\nstruct __wasi_prestat_t {\n  __wasi_preopentype_t tag;\n  __wasi_prestat_u_t u;\n};\n\nstruct __wasi_fdstat_t {\n  __wasi_filetype_t fs_filetype;\n  __wasi_fdflags_t fs_flags;\n  __wasi_rights_t fs_rights_base;\n  __wasi_rights_t fs_rights_inheriting;\n};\n\nstatic_assert(sizeof(__wasi_fdstat_t) == 24, \"witx calculated size\");\nstatic_assert(alignof(__wasi_fdstat_t) == 8, \"witx calculated align\");\nstatic_assert(offsetof(__wasi_fdstat_t, fs_filetype) == 0,\n              \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_fdstat_t, fs_flags) == 2,\n              \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_fdstat_t, fs_rights_base) == 8,\n              \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_fdstat_t, fs_rights_inheriting) == 16,\n              \"witx calculated offset\");\n\nstruct __wasi_iovec_t {\n  __wasi_ptr_t buf;\n  __wasi_size_t buf_len;\n};\n\nstatic_assert(sizeof(__wasi_iovec_t) == 8, \"witx calculated size\");\nstatic_assert(alignof(__wasi_iovec_t) == 4, \"witx calculated align\");\nstatic_assert(offsetof(__wasi_iovec_t, buf) == 0, \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_iovec_t, buf_len) == 4, \"witx calculated offset\");\n\nusing __wasi_device_t = uint64_t;\n\nstatic_assert(sizeof(__wasi_device_t) == 8, \"witx calculated size\");\nstatic_assert(alignof(__wasi_device_t) == 8, \"witx calculated align\");\n\nusing __wasi_inode_t = uint64_t;\n\nstatic_assert(sizeof(__wasi_inode_t) == 8, \"witx calculated size\");\nstatic_assert(alignof(__wasi_inode_t) == 8, \"witx calculated align\");\n\nusing __wasi_linkcount_t = uint64_t;\n\nstatic_assert(sizeof(__wasi_linkcount_t) == 8, \"witx calculated size\");\nstatic_assert(alignof(__wasi_linkcount_t) == 8, \"witx calculated align\");\n\nstruct __wasi_filestat_t {\n  __wasi_device_t dev;\n  __wasi_inode_t ino;\n  __wasi_filetype_t filetype;\n  __wasi_linkcount_t nlink;\n  __wasi_filesize_t size;\n  __wasi_timestamp_t atim;\n  __wasi_timestamp_t mtim;\n  __wasi_timestamp_t ctim;\n};\n\nstatic_assert(sizeof(__wasi_filestat_t) == 64, \"witx calculated size\");\nstatic_assert(alignof(__wasi_filestat_t) == 8, \"witx calculated align\");\nstatic_assert(offsetof(__wasi_filestat_t, dev) == 0, \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_filestat_t, ino) == 8, \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_filestat_t, filetype) == 16,\n              \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_filestat_t, nlink) == 24,\n              \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_filestat_t, size) == 32,\n              \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_filestat_t, atim) == 40,\n              \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_filestat_t, mtim) == 48,\n              \"witx calculated offset\");\nstatic_assert(offsetof(__wasi_filestat_t, ctim) == 56,\n              \"witx calculated offset\");\n\n#define __WASI_ERRNO_SUCCESS (UINT16_C(0))\n#define __WASI_ERRNO_NOENT (UINT16_C(44))\n\n// END wasi.h types from wasi-lib\n\nclass WasiInstance {\n public:\n  WasiInstance(Instance::Ptr instance,\n               uvwasi_s* uvwasi,\n               Memory* memory,\n               Stream* trace_stream)\n      : trace_stream(trace_stream),\n        instance(instance),\n        uvwasi(uvwasi),\n        memory(memory) {}\n\n  Result random_get(const Values& params, Values& results, Trap::Ptr* trap) {\n    /* __wasi_errno_t __wasi_random_get(uint8_t * buf, __wasi_size_t buf_len) */\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result proc_exit(const Values& params, Values& results, Trap::Ptr* trap) {\n    const Value arg0 = params[0];\n    uvwasi_proc_exit(uvwasi, arg0.Get<u32>());\n    return Result::Ok;\n  }\n\n  Result poll_oneoff(const Values& params, Values& results, Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result clock_time_get(const Values& params,\n                        Values& results,\n                        Trap::Ptr* trap) {\n    /* __wasi_errno_t __wasi_clock_time_get(__wasi_clockid_t id,\n     *                                      __wasi_timestamp_t precision,\n     *                                      __wasi_timestamp_t *time)\n     */\n    __wasi_timestamp_t t;\n    results[0].Set<u32>(uvwasi_clock_time_get(uvwasi, params[0].Get<u32>(),\n                                              params[1].Get<u64>(), &t));\n    uint32_t time_ptr = params[2].Get<u32>();\n    CHECK_RESULT(writeValue<__wasi_timestamp_t>(t, time_ptr, trap));\n    return Result::Ok;\n  }\n\n  Result path_rename(const Values& params, Values& results, Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result path_open(const Values& params, Values& results, Trap::Ptr* trap) {\n    /* __wasi_errno_t __wasi_path_open(__wasi_fd_t fd,\n                                       __wasi_lookupflags_t dirflags,\n                                       const char *path,\n                                       size_t path_len,\n                                       __wasi_oflags_t oflags,\n                                       __wasi_rights_t fs_rights_base,\n                                       __wasi_rights_t fs_rights_inherting,\n                                       __wasi_fdflags_t fdflags,\n                                       __wasi_fd_t *opened_fd) */\n    uvwasi_fd_t dirfd = params[0].Get<u32>();\n    __wasi_lookupflags_t dirflags = params[1].Get<u32>();\n    uint32_t path_ptr = params[2].Get<u32>();\n    __wasi_size_t path_len = params[3].Get<u32>();\n    __wasi_oflags_t oflags = params[4].Get<u32>();\n    __wasi_rights_t fs_rights_base = params[5].Get<u32>();\n    __wasi_rights_t fs_rights_inherting = params[6].Get<u32>();\n    __wasi_fdflags_t fs_flags = params[7].Get<u32>();\n    uint32_t out_ptr = params[8].Get<u32>();\n    char* path;\n    CHECK_RESULT(getMemPtr<char>(path_ptr, path_len, &path, trap));\n    if (trace_stream) {\n      trace_stream->Writef(\"path_open : %s\\n\", path);\n    }\n    uvwasi_fd_t outfd;\n    results[0].Set<u32>(uvwasi_path_open(\n        uvwasi, dirfd, dirflags, path, path_len, oflags, fs_rights_base,\n        fs_rights_inherting, fs_flags, &outfd));\n    if (trace_stream) {\n      trace_stream->Writef(\"path_open -> %d\\n\", results[0].Get<u32>());\n    }\n    CHECK_RESULT(writeValue<__wasi_fd_t>(outfd, out_ptr, trap));\n    return Result::Ok;\n  }\n\n  Result path_filestat_get(const Values& params,\n                           Values& results,\n                           Trap::Ptr* trap) {\n    /* __wasi_errno_t __wasi_path_filestat_get(__wasi_fd_t fd,\n     *                                         __wasi_lookupflags_t flags,\n     *                                         const char *path,\n     *                                         size_t path_len,\n     *                                         __wasi_filestat_t *buf\n     */\n    uvwasi_fd_t fd = params[0].Get<u32>();\n    __wasi_lookupflags_t flags = params[1].Get<u32>();\n    uint32_t path_ptr = params[2].Get<u32>();\n    uvwasi_size_t path_len = params[3].Get<u32>();\n    uint32_t filestat_ptr = params[4].Get<u32>();\n    char* path;\n    CHECK_RESULT(getMemPtr<char>(path_ptr, path_len, &path, trap));\n    if (trace_stream) {\n      trace_stream->Writef(\"path_filestat_get : %d %s\\n\", fd, path);\n    }\n    uvwasi_filestat_t buf;\n    results[0].Set<u32>(\n        uvwasi_path_filestat_get(uvwasi, fd, flags, path, path_len, &buf));\n    __wasi_filestat_t* filestat;\n    CHECK_RESULT(getMemPtr<__wasi_filestat_t>(\n        filestat_ptr, sizeof(__wasi_filestat_t), &filestat, trap));\n    uvwasi_serdes_write_filestat_t(filestat, 0, &buf);\n    if (trace_stream) {\n      trace_stream->Writef(\"path_filestat_get -> size=%\" PRIu64 \" %d\\n\",\n                           buf.st_size, results[0].Get<u32>());\n    }\n    return Result::Ok;\n  }\n\n  Result path_symlink(const Values& params, Values& results, Trap::Ptr* trap) {\n    /* __wasi_errno_t __wasi_path_symlink(const char *old_path,\n     *                                    size_t old_path_len,\n     *                                    __wasi_fd_t fd,\n     *                                    const char *new_path,\n     *                                    size_t new_path_len);\n     */\n\n    uint32_t old_path_ptr = params[0].Get<u32>();\n    __wasi_size_t old_path_len = params[1].Get<u32>();\n    uvwasi_fd_t fd = params[2].Get<u32>();\n    uint32_t new_path_ptr = params[3].Get<u32>();\n    __wasi_size_t new_path_len = params[4].Get<u32>();\n    char* old_path;\n    char* new_path;\n    CHECK_RESULT(getMemPtr<char>(old_path_ptr, old_path_len, &old_path, trap));\n    CHECK_RESULT(getMemPtr<char>(new_path_ptr, new_path_len, &new_path, trap));\n    if (trace_stream) {\n      trace_stream->Writef(\"path_symlink %d %s : %s\\n\", fd, old_path, new_path);\n    }\n    results[0].Set<u32>(uvwasi_path_symlink(uvwasi, old_path, old_path_len, fd,\n                                            new_path, new_path_len));\n    if (trace_stream) {\n      trace_stream->Writef(\"path_symlink -> %d\\n\", results[0].Get<u32>());\n    }\n    return Result::Ok;\n  }\n\n  Result path_readlink(const Values& params, Values& results, Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result path_create_directory(const Values& params,\n                               Values& results,\n                               Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result path_remove_directory(const Values& params,\n                               Values& results,\n                               Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result path_unlink_file(const Values& params,\n                          Values& results,\n                          Trap::Ptr* trap) {\n    /* __wasi_errno_t __wasi_path_unlink_file(__wasi_fd_t fd,\n     *                                        const char *path,\n     *                                        size_t path_len)\n     */\n    uvwasi_fd_t fd = params[0].Get<u32>();\n    uint32_t path_ptr = params[1].Get<u32>();\n    __wasi_size_t path_len = params[2].Get<u32>();\n    char* path;\n    CHECK_RESULT(getMemPtr<char>(path_ptr, path_len, &path, trap));\n    if (trace_stream) {\n      trace_stream->Writef(\"path_unlink_file %d %s\\n\", fd, path);\n    }\n    results[0].Set<u32>(uvwasi_path_unlink_file(uvwasi, fd, path, path_len));\n    return Result::Ok;\n  }\n\n  Result fd_prestat_get(const Values& params,\n                        Values& results,\n                        Trap::Ptr* trap) {\n    /* __wasi_errno_t __wasi_fd_prestat_get(__wasi_fd_t fd,\n     *                                      __wasi_prestat_t *buf))\n     */\n    uvwasi_fd_t fd = params[0].Get<u32>();\n    uint32_t prestat_ptr = params[1].Get<u32>();\n    if (trace_stream) {\n      trace_stream->Writef(\"fd_prestat_get %d\\n\", fd);\n    }\n    uvwasi_prestat_t buf;\n    results[0].Set<u32>(uvwasi_fd_prestat_get(uvwasi, fd, &buf));\n    __wasi_prestat_t* prestat;\n    CHECK_RESULT(getMemPtr<__wasi_prestat_t>(prestat_ptr, 1, &prestat, trap));\n    uvwasi_serdes_write_prestat_t(prestat, 0, &buf);\n    if (trace_stream) {\n      trace_stream->Writef(\"fd_prestat_get -> %d\\n\", results[0].Get<u32>());\n    }\n    return Result::Ok;\n  }\n\n  Result fd_prestat_dir_name(const Values& params,\n                             Values& results,\n                             Trap::Ptr* trap) {\n    uvwasi_fd_t fd = params[0].Get<u32>();\n    uint32_t path_ptr = params[1].Get<u32>();\n    uvwasi_size_t path_len = params[2].Get<u32>();\n    if (trace_stream) {\n      trace_stream->Writef(\"fd_prestat_dir_name %d %d %d\\n\", fd, path_ptr,\n                           path_len);\n    }\n    char* path;\n    CHECK_RESULT(getMemPtr<char>(path_ptr, path_len, &path, trap));\n    results[0].Set<u32>(uvwasi_fd_prestat_dir_name(uvwasi, fd, path, path_len));\n    if (trace_stream) {\n      trace_stream->Writef(\"fd_prestat_dir_name %d -> %d %s %d\\n\", fd,\n                           results[0].Get<u32>(), path, path_len);\n    }\n    return Result::Ok;\n  }\n\n  Result fd_filestat_get(const Values& params,\n                         Values& results,\n                         Trap::Ptr* trap) {\n    /* __wasi_fd_filestat_get(__wasi_fd_t f, __wasi_filestat_t *buf) */\n    uvwasi_fd_t fd = params[0].Get<u32>();\n    uint32_t filestat_ptr = params[1].Get<u32>();\n    uvwasi_filestat_t buf;\n    results[0].Set<u32>(uvwasi_fd_filestat_get(uvwasi, fd, &buf));\n    __wasi_filestat_t* filestat;\n    CHECK_RESULT(getMemPtr<__wasi_filestat_t>(\n        filestat_ptr, sizeof(__wasi_filestat_t), &filestat, trap));\n    uvwasi_serdes_write_filestat_t(filestat, 0, &buf);\n    if (trace_stream) {\n      trace_stream->Writef(\"fd_filestat_get -> size=%\" PRIu64 \" %d\\n\",\n                           buf.st_size, results[0].Get<u32>());\n    }\n    return Result::Ok;\n  }\n\n  Result fd_fdstat_set_flags(const Values& params,\n                             Values& results,\n                             Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result fd_fdstat_get(const Values& params, Values& results, Trap::Ptr* trap) {\n    int32_t fd = params[0].Get<u32>();\n    uint32_t stat_ptr = params[1].Get<u32>();\n    if (trace_stream) {\n      trace_stream->Writef(\"fd_fdstat_get %d\\n\", fd);\n    }\n    CHECK_RESULT(getMemPtr<__wasi_fdstat_t>(stat_ptr, 1, nullptr, trap));\n    uvwasi_fdstat_t host_statbuf;\n    results[0].Set<u32>(uvwasi_fd_fdstat_get(uvwasi, fd, &host_statbuf));\n\n    // Write the host statbuf into the target wasm memory\n    __wasi_fdstat_t* statbuf;\n    CHECK_RESULT(getMemPtr<__wasi_fdstat_t>(stat_ptr, 1, &statbuf, trap));\n    uvwasi_serdes_write_fdstat_t(statbuf, 0, &host_statbuf);\n    return Result::Ok;\n  }\n\n  Result fd_read(const Values& params, Values& results, Trap::Ptr* trap) {\n    int32_t fd = params[0].Get<u32>();\n    int32_t iovptr = params[1].Get<u32>();\n    int32_t iovcnt = params[2].Get<u32>();\n    int32_t out_ptr = params[3].Get<u32>();\n    if (trace_stream) {\n      trace_stream->Writef(\"fd_read %d [%d]\\n\", fd, iovcnt);\n    }\n    __wasi_iovec_t* wasm_iovs;\n    CHECK_RESULT(getMemPtr<__wasi_iovec_t>(iovptr, iovcnt, &wasm_iovs, trap));\n    std::vector<uvwasi_iovec_t> iovs(iovcnt);\n    for (int i = 0; i < iovcnt; i++) {\n      iovs[i].buf_len = wasm_iovs[i].buf_len;\n\n      CHECK_RESULT(getMemPtr<uint8_t>(wasm_iovs[i].buf, wasm_iovs[i].buf_len,\n                                      reinterpret_cast<uint8_t**>(&iovs[i].buf),\n                                      trap));\n    }\n    __wasi_ptr_t* out_addr;\n    CHECK_RESULT(getMemPtr<__wasi_ptr_t>(out_ptr, 1, &out_addr, trap));\n    results[0].Set<u32>(\n        uvwasi_fd_read(uvwasi, fd, iovs.data(), iovs.size(), out_addr));\n    if (trace_stream) {\n      trace_stream->Writef(\"fd_read -> %d\\n\", results[0].Get<u32>());\n    }\n    return Result::Ok;\n  }\n\n  Result fd_pread(const Values& params, Values& results, Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result fd_readdir(const Values& params, Values& results, Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result fd_write(const Values& params, Values& results, Trap::Ptr* trap) {\n    int32_t fd = params[0].Get<u32>();\n    int32_t iovptr = params[1].Get<u32>();\n    int32_t iovcnt = params[2].Get<u32>();\n    __wasi_iovec_t* wasm_iovs;\n    CHECK_RESULT(getMemPtr<__wasi_iovec_t>(iovptr, iovcnt, &wasm_iovs, trap));\n    std::vector<uvwasi_ciovec_t> iovs(iovcnt);\n    for (int i = 0; i < iovcnt; i++) {\n      iovs[i].buf_len = wasm_iovs[i].buf_len;\n      CHECK_RESULT(getMemPtr<const uint8_t>(\n          wasm_iovs[i].buf, wasm_iovs[i].buf_len,\n          reinterpret_cast<const uint8_t**>(&iovs[i].buf), trap));\n    }\n    __wasi_ptr_t* out_addr;\n    CHECK_RESULT(\n        getMemPtr<__wasi_ptr_t>(params[3].Get<u32>(), 1, &out_addr, trap));\n    results[0].Set<u32>(\n        uvwasi_fd_write(uvwasi, fd, iovs.data(), iovs.size(), out_addr));\n    return Result::Ok;\n  }\n\n  Result fd_pwrite(const Values& params, Values& results, Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result fd_close(const Values& params, Values& results, Trap::Ptr* trap) {\n    assert(false);\n    return Result::Ok;\n  }\n\n  Result fd_seek(const Values& params, Values& results, Trap::Ptr* trap) {\n    /* __wasi_errno_t __wasi_fd_seek(__wasi_fd_t fd,\n     *                               __wasi_filedelta_t offset,\n     *                               __wasi_whence_t whence,\n     *                               __wasi_filesize_t *newoffset)\n     */\n    int32_t fd = params[0].Get<u32>();\n    __wasi_filedelta_t offset = params[1].Get<u32>();\n    __wasi_whence_t whence = params[2].Get<u32>();\n    uint32_t newoffset_ptr = params[3].Get<u32>();\n    uvwasi_filesize_t newoffset;\n    results[0].Set<u32>(uvwasi_fd_seek(uvwasi, fd, offset, whence, &newoffset));\n    CHECK_RESULT(writeValue<__wasi_filesize_t>(newoffset, newoffset_ptr, trap));\n    return Result::Ok;\n  }\n\n  Result environ_get(const Values& params, Values& results, Trap::Ptr* trap) {\n    uvwasi_size_t environc;\n    uvwasi_size_t environ_buf_size;\n    uvwasi_environ_sizes_get(uvwasi, &environc, &environ_buf_size);\n    uint32_t wasm_buf = params[1].Get<u32>();\n    char* buf;\n    CHECK_RESULT(getMemPtr<char>(wasm_buf, environ_buf_size, &buf, trap));\n    std::vector<char*> host_env(environc);\n    uvwasi_environ_get(uvwasi, host_env.data(), buf);\n\n    // Copy host_env pointer array wasm_env)\n    for (uvwasi_size_t i = 0; i < environc; i++) {\n      uint32_t rel_address = host_env[i] - buf;\n      uint32_t dest = params[0].Get<u32>() + (i * sizeof(uint32_t));\n      CHECK_RESULT(writeValue<uint32_t>(wasm_buf + rel_address, dest, trap));\n    }\n\n    results[0].Set<u32>(__WASI_ERRNO_SUCCESS);\n    return Result::Ok;\n  }\n\n  Result environ_sizes_get(const Values& params,\n                           Values& results,\n                           Trap::Ptr* trap) {\n    uvwasi_size_t environc;\n    uvwasi_size_t environ_buf_size;\n    uvwasi_environ_sizes_get(uvwasi, &environc, &environ_buf_size);\n    CHECK_RESULT(writeValue<uint32_t>(environc, params[0].Get<u32>(), trap));\n    CHECK_RESULT(\n        writeValue<uint32_t>(environ_buf_size, params[1].Get<u32>(), trap));\n    if (trace_stream) {\n      trace_stream->Writef(\"environ_sizes_get -> %d %d\\n\", environc,\n                           environ_buf_size);\n    }\n    results[0].Set<u32>(__WASI_ERRNO_SUCCESS);\n    return Result::Ok;\n  }\n\n  Result args_get(const Values& params, Values& results, Trap::Ptr* trap) {\n    uvwasi_size_t argc;\n    uvwasi_size_t arg_buf_size;\n    uvwasi_args_sizes_get(uvwasi, &argc, &arg_buf_size);\n    uint32_t wasm_buf = params[1].Get<u32>();\n    char* buf;\n    CHECK_RESULT(getMemPtr<char>(wasm_buf, arg_buf_size, &buf, trap));\n    std::vector<char*> host_args(argc);\n    uvwasi_args_get(uvwasi, host_args.data(), buf);\n\n    // Copy host_args pointer array wasm_args)\n    for (uvwasi_size_t i = 0; i < argc; i++) {\n      uint32_t rel_address = host_args[i] - buf;\n      uint32_t dest = params[0].Get<u32>() + (i * sizeof(uint32_t));\n      CHECK_RESULT(writeValue<uint32_t>(wasm_buf + rel_address, dest, trap));\n    }\n    results[0].Set<u32>(__WASI_ERRNO_SUCCESS);\n    return Result::Ok;\n  }\n\n  Result args_sizes_get(const Values& params,\n                        Values& results,\n                        Trap::Ptr* trap) {\n    uvwasi_size_t argc;\n    uvwasi_size_t arg_buf_size;\n    uvwasi_args_sizes_get(uvwasi, &argc, &arg_buf_size);\n    CHECK_RESULT(writeValue<uint32_t>(argc, params[0].Get<u32>(), trap));\n    CHECK_RESULT(\n        writeValue<uint32_t>(arg_buf_size, params[1].Get<u32>(), trap));\n    if (trace_stream) {\n      trace_stream->Writef(\"args_sizes_get -> %d %d\\n\", argc, arg_buf_size);\n    }\n    results[0].Set<u32>(__WASI_ERRNO_SUCCESS);\n    return Result::Ok;\n  }\n\n  // The trace stream accosiated with the instance.\n  Stream* trace_stream;\n\n  Instance::Ptr instance;\n\n private:\n  // Write a value into wasm-memory and the given memory offset.\n  template <typename T>\n  Result writeValue(T value, uint32_t target_address, Trap::Ptr* trap) {\n    T* abs_address;\n    CHECK_RESULT(getMemPtr<T>(target_address, sizeof(T), &abs_address, trap));\n    *abs_address = value;\n    return Result::Ok;\n  }\n\n  // Result a wasm-memory-local address to an absolute memory location.\n  template <typename T>\n  Result getMemPtr(uint32_t address,\n                   uint32_t num_elems,\n                   T** result,\n                   Trap::Ptr* trap) {\n    if (!memory->IsValidAccess(address, 0, num_elems * sizeof(T))) {\n      *trap =\n          Trap::New(*instance.store(),\n                    StringPrintf(\"out of bounds memory access: \"\n                                 \"[%u, %\" PRIu64 \") >= max value %\" PRIu64,\n                                 address, u64{address} + num_elems * sizeof(T),\n                                 memory->ByteSize()));\n      return Result::Error;\n    }\n    if (result) {\n      *result = reinterpret_cast<T*>(memory->UnsafeData() + address);\n    }\n    return Result::Ok;\n  }\n\n  uvwasi_s* uvwasi;\n  // The memory accociated with the instance.  Looked up once on startup\n  // and cached here.\n  Memory* memory;\n};\n\nstd::unordered_map<Instance*, WasiInstance*> wasiInstances;\n\n// TODO(sbc): Auto-generate this.\n\n#define WASI_CALLBACK(NAME)                                                 \\\n  static Result NAME(Thread& thread, const Values& params, Values& results, \\\n                     Trap::Ptr* trap) {                                     \\\n    Instance* instance = thread.GetCallerInstance();                        \\\n    assert(instance);                                                       \\\n    WasiInstance* wasi_instance = wasiInstances[instance];                  \\\n    if (wasi_instance->trace_stream) {                                      \\\n      wasi_instance->trace_stream->Writef(                                  \\\n          \">>> running wasi function \\\"%s\\\":\\n\", #NAME);                    \\\n    }                                                                       \\\n    return wasi_instance->NAME(params, results, trap);                      \\\n  }\n\n#define WASI_FUNC(NAME) WASI_CALLBACK(NAME)\n#include \"wasi_api.def\"\n#undef WASI_FUNC\n\n}  // namespace\n\nnamespace wabt {\nnamespace interp {\n\nResult WasiBindImports(const Module::Ptr& module,\n                       RefVec& imports,\n                       Stream* stream,\n                       Stream* trace_stream) {\n  Store* store = module.store();\n  for (auto&& import : module->desc().imports) {\n    if (import.type.type->kind != ExternKind::Func) {\n      stream->Writef(\"wasi error: invalid import type: %s\\n\",\n                     import.type.name.c_str());\n      return Result::Error;\n    }\n\n    if (import.type.module != \"wasi_snapshot_preview1\" &&\n        import.type.module != \"wasi_unstable\") {\n      stream->Writef(\"wasi error: unknown module import: `%s`\\n\",\n                     import.type.module.c_str());\n      return Result::Error;\n    }\n\n    auto func_type = *cast<FuncType>(import.type.type.get());\n    auto import_name = StringPrintf(\"%s.%s\", import.type.module.c_str(),\n                                    import.type.name.c_str());\n    HostFunc::Ptr host_func;\n\n    // TODO(sbc): Validate signatures of imports.\n#define WASI_FUNC(NAME)                                 \\\n  if (import.type.name == #NAME) {                      \\\n    host_func = HostFunc::New(*store, func_type, NAME); \\\n    goto found;                                         \\\n  }\n#include \"wasi_api.def\"\n#undef WASI_FUNC\n\n    stream->Writef(\"unknown wasi API import: `%s`\\n\", import.type.name.c_str());\n    return Result::Error;\n  found:\n    imports.push_back(host_func.ref());\n  }\n\n  return Result::Ok;\n}\n\nResult WasiRunStart(const Instance::Ptr& instance,\n                    uvwasi_s* uvwasi,\n                    Stream* err_stream,\n                    Stream* trace_stream) {\n  Store* store = instance.store();\n  auto module = store->UnsafeGet<Module>(instance->module());\n  auto&& module_desc = module->desc();\n\n  Func::Ptr start;\n  Memory::Ptr memory;\n  for (auto&& export_ : module_desc.exports) {\n    if (export_.type.name == \"memory\") {\n      if (export_.type.type->kind != ExternalKind::Memory) {\n        err_stream->Writef(\"wasi error: memory export has incorrect type\\n\");\n        return Result::Error;\n      }\n      memory = store->UnsafeGet<Memory>(instance->memories()[export_.index]);\n    }\n    if (export_.type.name == \"_start\") {\n      if (export_.type.type->kind != ExternalKind::Func) {\n        err_stream->Writef(\"wasi error: _start export is not a function\\n\");\n        return Result::Error;\n      }\n      start = store->UnsafeGet<Func>(instance->funcs()[export_.index]);\n    }\n    if (start && memory) {\n      break;\n    }\n  }\n\n  if (!start) {\n    err_stream->Writef(\"wasi error: _start export not found\\n\");\n    return Result::Error;\n  }\n\n  if (!memory) {\n    err_stream->Writef(\"wasi error: memory export not found\\n\");\n    return Result::Error;\n  }\n\n  if (start->type().params.size() || start->type().results.size()) {\n    err_stream->Writef(\"wasi error: invalid _start signature\\n\");\n    return Result::Error;\n  }\n\n  // Register memory\n  WasiInstance wasi(instance, uvwasi, memory.get(), trace_stream);\n  wasiInstances[instance.get()] = &wasi;\n\n  // Call start ([] -> [])\n  Values params;\n  Values results;\n  Trap::Ptr trap;\n  Result res = start->Call(*store, params, results, &trap, trace_stream);\n  if (trap) {\n    WriteTrap(err_stream, \"error\", trap);\n  }\n\n  // Unregister memory\n  wasiInstances.erase(instance.get());\n  return res;\n}\n\n}  // namespace interp\n}  // namespace wabt\n\n#endif\n"
  },
  {
    "path": "src/interp/interp-wasm-c-api.cc",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <wasm.h>\n\n#include \"wabt/binary-reader.h\"\n#include \"wabt/cast.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/interp/binary-reader-interp.h\"\n#include \"wabt/interp/interp-util.h\"\n#include \"wabt/interp/interp.h\"\n\nusing namespace wabt;\nusing namespace wabt::interp;\n\n#define own\n\n#ifndef NDEBUG\n#define TRACE0() TRACE(\"\")\n#define TRACE(str, ...) \\\n  fprintf(stderr, \"CAPI: [%s] \" str \"\\n\", __func__, ##__VA_ARGS__)\n#define TRACE_NO_NL(str, ...) \\\n  fprintf(stderr, \"CAPI: [%s] \" str, __func__, ##__VA_ARGS__)\n#else\n#define TRACE0(...)\n#define TRACE(...)\n#define TRACE_NO_NL(...)\n#endif\n\nstatic Features s_features;\nstatic std::unique_ptr<FileStream> s_log_stream;\nstatic std::unique_ptr<FileStream> s_stdout_stream;\n\n// Type conversion utilities\nstatic ValueType ToWabtValueType(wasm_valkind_t);\nstatic wasm_valkind_t FromWabtValueType(ValueType);\n\nstatic wasm_externkind_t FromWabtExternKind(ExternKind);\n\nstatic ValueTypes ToWabtValueTypes(const wasm_valtype_vec_t* types);\nstatic void FromWabtValueTypes(const ValueTypes&, wasm_valtype_vec_t* out);\n\nstatic wasm_mutability_t FromWabtMutability(Mutability);\nstatic Mutability ToWabtMutability(wasm_mutability_t);\n\nstatic Limits ToWabtLimits(const wasm_limits_t&);\nstatic wasm_limits_t FromWabtLimits(const Limits&);\n\n// Value conversion utilities\nstatic TypedValue ToWabtValue(const wasm_val_t&);\nstatic wasm_val_t FromWabtValue(Store&, const TypedValue&);\n\nstatic Values ToWabtValues(const wasm_val_vec_t* values);\nstatic void FromWabtValues(Store& store,\n                           wasm_val_vec_t* values,\n                           const ValueTypes& types,\n                           const Values& wabt_values);\n\n// Structs\nstruct wasm_config_t {};\n\nstruct wasm_engine_t {};\n\nstruct wasm_valtype_t {\n  ValueType I;\n};\n\nstruct wasm_externtype_t {\n  static std::unique_ptr<wasm_externtype_t> New(std::unique_ptr<ExternType>);\n\n  std::unique_ptr<wasm_externtype_t> Clone() const { return New(I->Clone()); }\n\n  virtual ~wasm_externtype_t() {}\n\n  wasm_externtype_t(const wasm_externtype_t& other) = delete;\n  wasm_externtype_t& operator=(const wasm_externtype_t& other) = delete;\n\n  template <typename T>\n  T* As() const {\n    return cast<T>(I.get());\n  }\n\n  std::unique_ptr<ExternType> I;\n\n protected:\n  wasm_externtype_t(std::unique_ptr<ExternType> et) : I(std::move(et)) {}\n};\n\nstruct wasm_functype_t : wasm_externtype_t {\n  wasm_functype_t(own wasm_valtype_vec_t* params,\n                  own wasm_valtype_vec_t* results)\n      : wasm_externtype_t{std::make_unique<FuncType>(\n            ToWabtValueTypes(params),\n            ToWabtValueTypes(results))},\n        params(*params),\n        results(*results) {}\n\n  wasm_functype_t(FuncType ft)\n      : wasm_externtype_t{std::make_unique<FuncType>(ft)} {\n    FromWabtValueTypes(ft.params, &params);\n    FromWabtValueTypes(ft.results, &results);\n  }\n\n  ~wasm_functype_t() {\n    wasm_valtype_vec_delete(&params);\n    wasm_valtype_vec_delete(&results);\n  }\n\n  // Stored here because API requires returning pointers.\n  wasm_valtype_vec_t params;\n  wasm_valtype_vec_t results;\n};\n\nstruct wasm_globaltype_t : wasm_externtype_t {\n  wasm_globaltype_t(own wasm_valtype_t* type, wasm_mutability_t mut)\n      : wasm_externtype_t{std::make_unique<GlobalType>(type->I,\n                                                       ToWabtMutability(mut))},\n        valtype{*type} {\n    wasm_valtype_delete(type);\n  }\n\n  wasm_globaltype_t(GlobalType gt)\n      : wasm_externtype_t{std::make_unique<GlobalType>(gt)}, valtype{gt.type} {}\n\n  // Stored here because API requires returning pointers.\n  wasm_valtype_t valtype;\n};\n\nstruct wasm_tabletype_t : wasm_externtype_t {\n  wasm_tabletype_t(own wasm_valtype_t* type, const wasm_limits_t* limits)\n      : wasm_externtype_t{std::make_unique<TableType>(type->I,\n                                                      ToWabtLimits(*limits))},\n        elemtype(*type),\n        limits(*limits) {\n    wasm_valtype_delete(type);\n  }\n\n  wasm_tabletype_t(TableType tt)\n      : wasm_externtype_t{std::make_unique<TableType>(tt)},\n        elemtype{tt.element},\n        limits{FromWabtLimits(tt.limits)} {}\n\n  // Stored here because API requires returning pointers.\n  wasm_valtype_t elemtype;\n  wasm_limits_t limits;\n};\n\nstruct wasm_memorytype_t : wasm_externtype_t {\n  wasm_memorytype_t(const wasm_limits_t* limits)\n      : wasm_externtype_t{std::make_unique<MemoryType>(\n            ToWabtLimits(*limits),\n            WABT_DEFAULT_PAGE_SIZE)},  // wasm-c-api doesn't support\n                                       // custom-page-sizes yet\n        limits{*limits} {}\n\n  wasm_memorytype_t(MemoryType mt)\n      : wasm_externtype_t{std::make_unique<MemoryType>(mt)},\n        limits{FromWabtLimits(mt.limits)} {}\n\n  // Stored here because API requires returning pointers.\n  wasm_limits_t limits;\n};\n\n// static\nstd::unique_ptr<wasm_externtype_t> wasm_externtype_t::New(\n    std::unique_ptr<ExternType> ptr) {\n  switch (ptr->kind) {\n    case ExternKind::Func:\n      return std::make_unique<wasm_functype_t>(*cast<FuncType>(ptr.get()));\n\n    case ExternKind::Table:\n      return std::make_unique<wasm_tabletype_t>(*cast<TableType>(ptr.get()));\n\n    case ExternKind::Memory:\n      return std::make_unique<wasm_memorytype_t>(*cast<MemoryType>(ptr.get()));\n\n    case ExternKind::Global:\n      return std::make_unique<wasm_globaltype_t>(*cast<GlobalType>(ptr.get()));\n\n    case ExternKind::Tag:\n      break;\n  }\n\n  assert(false);\n  return {};\n}\n\nstruct wasm_importtype_t {\n  wasm_importtype_t(ImportType it)\n      : I(it),\n        extern_{wasm_externtype_t::New(it.type->Clone())},\n        module{I.module.size(), const_cast<wasm_byte_t*>(I.module.data())},\n        name{I.name.size(), const_cast<wasm_byte_t*>(I.name.data())} {}\n\n  wasm_importtype_t(const wasm_importtype_t& other)\n      : wasm_importtype_t(other.I) {}\n\n  wasm_importtype_t& operator=(const wasm_importtype_t& other) {\n    wasm_importtype_t copy(other);\n    std::swap(I, copy.I);\n    std::swap(extern_, copy.extern_);\n    std::swap(module, copy.module);\n    std::swap(name, copy.name);\n    return *this;\n  }\n\n  ImportType I;\n  // Stored here because API requires returning pointers.\n  std::unique_ptr<wasm_externtype_t> extern_;\n  wasm_name_t module;\n  wasm_name_t name;\n};\n\nstruct wasm_exporttype_t {\n  wasm_exporttype_t(ExportType et)\n      : I(et),\n        extern_{wasm_externtype_t::New(et.type->Clone())},\n        name{I.name.size(), const_cast<wasm_byte_t*>(I.name.data())} {}\n\n  wasm_exporttype_t(const wasm_exporttype_t& other)\n      : wasm_exporttype_t(other.I) {}\n\n  wasm_exporttype_t& operator=(const wasm_exporttype_t& other) {\n    wasm_exporttype_t copy(other);\n    std::swap(I, copy.I);\n    std::swap(extern_, copy.extern_);\n    std::swap(name, copy.name);\n    return *this;\n  }\n\n  ExportType I;\n  // Stored here because API requires returning pointers.\n  std::unique_ptr<wasm_externtype_t> extern_;\n  wasm_name_t name;\n};\n\nstruct wasm_store_t {\n  wasm_store_t(const Features& features) : I(features) {}\n  Store I;\n};\n\nstruct wasm_ref_t {\n  wasm_ref_t(RefPtr<Object> ptr) : I(ptr) {}\n\n  template <typename T>\n  T* As() const {\n    return cast<T>(I.get());\n  }\n\n  RefPtr<Object> I;\n};\n\nstruct wasm_frame_t {\n  Frame I;\n};\n\nstruct wasm_trap_t : wasm_ref_t {\n  wasm_trap_t(RefPtr<Trap> ptr) : wasm_ref_t(ptr) {}\n};\n\nstruct wasm_foreign_t : wasm_ref_t {\n  wasm_foreign_t(RefPtr<Foreign> ptr) : wasm_ref_t(ptr) {}\n};\n\nstruct wasm_module_t : wasm_ref_t {\n  wasm_module_t(RefPtr<Module> ptr, const wasm_byte_vec_t* in)\n      : wasm_ref_t(ptr) {\n    wasm_byte_vec_copy(&binary, in);\n  }\n\n  wasm_module_t(const wasm_module_t& other) : wasm_ref_t(other.I) {\n    wasm_byte_vec_copy(&binary, &other.binary);\n  }\n\n  wasm_module_t& operator=(const wasm_module_t& other) {\n    wasm_module_t copy(other);\n    std::swap(I, copy.I);\n    std::swap(binary, copy.binary);\n    return *this;\n  }\n\n  ~wasm_module_t() { wasm_byte_vec_delete(&binary); }\n  // TODO: This is used for wasm_module_serialize/wasm_module_deserialize.\n  // Currently the standard wasm binary bytes are cached here, but it would be\n  // better to have a serialization of ModuleDesc instead.\n  wasm_byte_vec_t binary;\n};\n\nstruct wasm_shared_module_t : wasm_module_t {};\n\nstruct wasm_extern_t : wasm_ref_t {\n  wasm_extern_t(RefPtr<Extern> ptr) : wasm_ref_t(ptr) {}\n};\n\nstruct wasm_func_t : wasm_extern_t {\n  wasm_func_t(RefPtr<Func> ptr) : wasm_extern_t(ptr) {}\n};\n\nstruct wasm_global_t : wasm_extern_t {\n  wasm_global_t(RefPtr<Global> ptr) : wasm_extern_t(ptr) {}\n};\n\nstruct wasm_table_t : wasm_extern_t {\n  wasm_table_t(RefPtr<Table> ptr) : wasm_extern_t(ptr) {}\n};\n\nstruct wasm_memory_t : wasm_extern_t {\n  wasm_memory_t(RefPtr<Memory> ptr) : wasm_extern_t(ptr) {}\n};\n\nstruct wasm_instance_t : wasm_ref_t {\n  wasm_instance_t(RefPtr<Instance> ptr) : wasm_ref_t(ptr) {}\n};\n\n// Type conversion utilities\nstatic ValueType ToWabtValueType(wasm_valkind_t kind) {\n  switch (kind) {\n    case WASM_I32:\n      return ValueType::I32;\n    case WASM_I64:\n      return ValueType::I64;\n    case WASM_F32:\n      return ValueType::F32;\n    case WASM_F64:\n      return ValueType::F64;\n    case WASM_ANYREF:\n      return ValueType::ExternRef;\n    case WASM_FUNCREF:\n      return ValueType::FuncRef;\n    default:\n      TRACE(\"unexpected wasm_valkind_t: %d\", kind);\n      WABT_UNREACHABLE;\n  }\n  WABT_UNREACHABLE;\n}\n\nstatic wasm_valkind_t FromWabtValueType(ValueType type) {\n  switch (type) {\n    case ValueType::I32:\n      return WASM_I32;\n    case ValueType::I64:\n      return WASM_I64;\n    case ValueType::F32:\n      return WASM_F32;\n    case ValueType::F64:\n      return WASM_F64;\n    case ValueType::ExternRef:\n      return WASM_ANYREF;\n    case ValueType::FuncRef:\n      return WASM_FUNCREF;\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\nstatic wasm_externkind_t FromWabtExternKind(ExternKind kind) {\n  switch (kind) {\n    case ExternalKind::Func:\n      return WASM_EXTERN_FUNC;\n    case ExternalKind::Global:\n      return WASM_EXTERN_GLOBAL;\n    case ExternalKind::Table:\n      return WASM_EXTERN_TABLE;\n    case ExternalKind::Memory:\n      return WASM_EXTERN_MEMORY;\n    case ExternalKind::Tag:\n      WABT_UNREACHABLE;\n  }\n  WABT_UNREACHABLE;\n}\n\nstatic ValueTypes ToWabtValueTypes(const wasm_valtype_vec_t* types) {\n  ValueTypes result;\n  for (size_t i = 0; i < types->size; ++i) {\n    result.push_back(types->data[i]->I);\n  }\n  return result;\n}\n\nstatic void FromWabtValueTypes(const ValueTypes& types,\n                               wasm_valtype_vec_t* out) {\n  wasm_valtype_vec_new_uninitialized(out, types.size());\n  for (size_t i = 0; i < types.size(); ++i) {\n    out->data[i] = wasm_valtype_new(FromWabtValueType(types[i]));\n  }\n}\n\nstatic wasm_mutability_t FromWabtMutability(Mutability mut) {\n  return mut == Mutability::Var ? WASM_VAR : WASM_CONST;\n}\n\nstatic Mutability ToWabtMutability(wasm_mutability_t mut) {\n  return mut == WASM_VAR ? Mutability::Var : Mutability::Const;\n}\n\n// Value conversion utilities\n\nstatic TypedValue ToWabtValue(const wasm_val_t& value) {\n  TypedValue out;\n  out.type = ToWabtValueType(value.kind);\n  switch (value.kind) {\n    case WASM_I32:\n      out.value.Set(value.of.i32);\n      break;\n    case WASM_I64:\n      out.value.Set(value.of.i64);\n      break;\n    case WASM_F32:\n      out.value.Set(value.of.f32);\n      break;\n    case WASM_F64:\n      out.value.Set(value.of.f64);\n      break;\n    case WASM_ANYREF:\n    case WASM_FUNCREF:\n      out.value.Set(value.of.ref ? value.of.ref->I->self() : Ref::Null);\n      break;\n    default:\n      TRACE(\"unexpected wasm type: %d\", value.kind);\n      assert(false);\n  }\n  TRACE(\"-> %s\", TypedValueToString(out).c_str());\n  return out;\n}\n\nstatic wasm_val_t FromWabtValue(Store& store, const TypedValue& tv) {\n  TRACE(\"%s\", TypedValueToString(tv).c_str());\n  wasm_val_t out_value;\n  switch (tv.type) {\n    case Type::I32:\n      out_value.kind = WASM_I32;\n      out_value.of.i32 = tv.value.Get<s32>();\n      break;\n    case Type::I64:\n      out_value.kind = WASM_I64;\n      out_value.of.i64 = tv.value.Get<s64>();\n      break;\n    case Type::F32:\n      out_value.kind = WASM_F32;\n      out_value.of.f32 = tv.value.Get<f32>();\n      break;\n    case Type::F64:\n      out_value.kind = WASM_F64;\n      out_value.of.f64 = tv.value.Get<f64>();\n      break;\n    case Type::FuncRef: {\n      Ref ref = tv.value.Get<Ref>();\n      out_value.kind = WASM_FUNCREF;\n      out_value.of.ref = new wasm_func_t(store.UnsafeGet<Func>(ref));\n      break;\n    }\n    case Type::ExternRef: {\n      Ref ref = tv.value.Get<Ref>();\n      out_value.kind = WASM_ANYREF;\n      out_value.of.ref = new wasm_foreign_t(store.UnsafeGet<Foreign>(ref));\n      break;\n    }\n    default:\n      TRACE(\"unexpected wabt type: %d\", static_cast<int>(tv.type));\n      assert(false);\n  }\n  return out_value;\n}\n\nstatic Limits ToWabtLimits(const wasm_limits_t& limits) {\n  return Limits(limits.min, limits.max);\n}\n\nstatic wasm_limits_t FromWabtLimits(const Limits& limits) {\n  return wasm_limits_t{(uint32_t)limits.initial, (uint32_t)limits.max};\n}\n\nstatic Values ToWabtValues(const wasm_val_vec_t* values) {\n  Values result;\n  for (size_t i = 0; i < values->size; ++i) {\n    result.push_back(ToWabtValue(values->data[i]).value);\n  }\n  return result;\n}\n\nstatic void FromWabtValues(Store& store,\n                           wasm_val_vec_t* values,\n                           const ValueTypes& types,\n                           const Values& wabt_values) {\n  assert(types.size() == wabt_values.size());\n  assert(types.size() == values->size);\n  for (size_t i = 0; i < types.size(); ++i) {\n    values->data[i] =\n        FromWabtValue(store, TypedValue{types[i], wabt_values[i]});\n  }\n}\n\nstatic std::string ToString(const wasm_message_t* msg) {\n  return std::string(msg->data, msg->size);\n}\n\nstatic wasm_message_t FromString(const std::string& s) {\n  wasm_message_t result;\n  wasm_byte_vec_new(&result, s.size() + 1, s.c_str());\n  return result;\n}\n\nstatic ReadBinaryOptions GetOptions() {\n  const bool kReadDebugNames = true;\n  const bool kStopOnFirstError = true;\n  const bool kFailOnCustomSectionError = true;\n  s_features.EnableAll();\n  if (getenv(\"WASM_API_DEBUG\") != nullptr) {\n    s_log_stream = FileStream::CreateStderr();\n  }\n  return ReadBinaryOptions(s_features, s_log_stream.get(), kReadDebugNames,\n                           kStopOnFirstError, kFailOnCustomSectionError);\n}\n\nextern \"C\" {\n\n// wasm_valtype\n\nown wasm_valtype_t* wasm_valtype_new(wasm_valkind_t kind) {\n  return new wasm_valtype_t{ToWabtValueType(kind)};\n}\n\nwasm_valkind_t wasm_valtype_kind(const wasm_valtype_t* type) {\n  assert(type);\n  return FromWabtValueType(type->I);\n}\n\n// Helpers\n\nstatic void print_sig(const FuncType& sig) {\n#ifndef NDEBUG\n  fprintf(stderr, \"(\");\n  bool first = true;\n  for (auto type : sig.params) {\n    if (!first) {\n      fprintf(stderr, \", \");\n    }\n    first = false;\n    fprintf(stderr, \"%s\", type.GetName().c_str());\n  }\n  fprintf(stderr, \") -> (\");\n  first = true;\n  for (auto type : sig.results) {\n    if (!first) {\n      fprintf(stderr, \", \");\n    }\n    first = false;\n    fprintf(stderr, \"%s\", type.GetName().c_str());\n  }\n  fprintf(stderr, \")\\n\");\n#endif\n}\n\n// wasm_val\n\nvoid wasm_val_delete(own wasm_val_t* val) {\n  assert(val);\n  if (wasm_valkind_is_ref(val->kind)) {\n    delete val->of.ref;\n    val->of.ref = nullptr;\n  }\n}\n\nvoid wasm_val_copy(own wasm_val_t* out, const wasm_val_t* in) {\n  TRACE(\"%s\", TypedValueToString(ToWabtValue(*in)).c_str());\n  if (wasm_valkind_is_ref(in->kind)) {\n    out->kind = in->kind;\n    out->of.ref = in->of.ref ? new wasm_ref_t{*in->of.ref} : nullptr;\n  } else {\n    *out = *in;\n  }\n  TRACE(\"-> %p %s\", out, TypedValueToString(ToWabtValue(*out)).c_str());\n}\n\n// wasm_trap\n\nown wasm_trap_t* wasm_trap_new(wasm_store_t* store, const wasm_message_t* msg) {\n  return new wasm_trap_t{Trap::New(store->I, ToString(msg))};\n}\n\nvoid wasm_trap_message(const wasm_trap_t* trap, own wasm_message_t* out) {\n  assert(trap);\n  *out = FromString(trap->As<Trap>()->message());\n}\n\nown wasm_frame_t* wasm_trap_origin(const wasm_trap_t* trap) {\n  // TODO(sbc): Implement stack traces\n  return nullptr;\n}\n\nvoid wasm_trap_trace(const wasm_trap_t* trap, own wasm_frame_vec_t* out) {\n  assert(trap);\n  assert(out);\n  wasm_frame_vec_new_empty(out);\n  // std::string msg(trap->message.data, trap->message.size);\n  // TRACE(stderr, \"error: %s\\n\", msg.c_str());\n}\n\n// wasm_config\n\nown wasm_config_t* wasm_config_new() {\n  return new wasm_config_t();\n}\n\n// wasm_engine\n\nown wasm_engine_t* wasm_engine_new() {\n  return new wasm_engine_t();\n}\n\nown wasm_engine_t* wasm_engine_new_with_config(own wasm_config_t*) {\n  assert(false);\n  return nullptr;\n}\n\n// wasm_store\n\nown wasm_store_t* wasm_store_new(wasm_engine_t* engine) {\n  assert(engine);\n  return new wasm_store_t(s_features);\n}\n\n// wasm_module\n\nown wasm_module_t* wasm_module_new(wasm_store_t* store,\n                                   const wasm_byte_vec_t* binary) {\n  Errors errors;\n  ModuleDesc module_desc;\n  if (Failed(ReadBinaryInterp(\"<internal>\", binary->data, binary->size,\n                              GetOptions(), &errors, &module_desc))) {\n    FormatErrorsToFile(errors, Location::Type::Binary);\n    return nullptr;\n  }\n\n  return new wasm_module_t{Module::New(store->I, module_desc), binary};\n}\n\nbool wasm_module_validate(wasm_store_t* store, const wasm_byte_vec_t* binary) {\n  // TODO: Optimize this; for now it is generating a new module and discarding\n  // it. But since this call only needs to validate, it could do much less.\n  wasm_module_t* module = wasm_module_new(store, binary);\n  if (module == nullptr) {\n    return false;\n  }\n  wasm_module_delete(module);\n  return true;\n}\n\nvoid wasm_module_imports(const wasm_module_t* module,\n                         own wasm_importtype_vec_t* out) {\n  auto&& import_types = module->As<Module>()->import_types();\n  TRACE(\"%\" PRIzx, import_types.size());\n  wasm_importtype_vec_new_uninitialized(out, import_types.size());\n\n  for (size_t i = 0; i < import_types.size(); ++i) {\n    out->data[i] = new wasm_importtype_t{import_types[i]};\n  }\n}\n\nvoid wasm_module_exports(const wasm_module_t* module,\n                         own wasm_exporttype_vec_t* out) {\n  auto&& export_types = module->As<Module>()->export_types();\n  TRACE(\"%\" PRIzx, export_types.size());\n  wasm_exporttype_vec_new_uninitialized(out, export_types.size());\n\n  for (size_t i = 0; i < export_types.size(); ++i) {\n    out->data[i] = new wasm_exporttype_t{export_types[i]};\n  }\n}\n\nvoid wasm_module_serialize(const wasm_module_t* module,\n                           own wasm_byte_vec_t* out) {\n  wasm_byte_vec_copy(out, &module->binary);\n}\n\nown wasm_module_t* wasm_module_deserialize(wasm_store_t* store,\n                                           const wasm_byte_vec_t* bytes) {\n  return wasm_module_new(store, bytes);\n}\n\n// wasm_importtype\n\nown wasm_importtype_t* wasm_importtype_new(own wasm_name_t* module,\n                                           own wasm_name_t* name,\n                                           own wasm_externtype_t* type) {\n  return new wasm_importtype_t{\n      ImportType{ToString(module), ToString(name), type->I->Clone()}};\n}\n\nconst wasm_name_t* wasm_importtype_module(const wasm_importtype_t* im) {\n  return &im->module;\n}\n\nconst wasm_name_t* wasm_importtype_name(const wasm_importtype_t* im) {\n  return &im->name;\n}\n\nconst wasm_externtype_t* wasm_importtype_type(const wasm_importtype_t* im) {\n  return im->extern_.get();\n}\n\n// wasm_exporttype\n\nown wasm_exporttype_t* wasm_exporttype_new(own wasm_name_t* name,\n                                           wasm_externtype_t* type) {\n  return new wasm_exporttype_t{ExportType{ToString(name), type->I->Clone()}};\n}\n\nconst wasm_name_t* wasm_exporttype_name(const wasm_exporttype_t* ex) {\n  return &ex->name;\n}\n\nconst wasm_externtype_t* wasm_exporttype_type(const wasm_exporttype_t* ex) {\n  TRACE(\"%p\", ex);\n  assert(ex);\n  return ex->extern_.get();\n}\n\n// wasm_instance\n\nown wasm_instance_t* wasm_instance_new(wasm_store_t* store,\n                                       const wasm_module_t* module,\n                                       const wasm_extern_vec_t* imports,\n                                       own wasm_trap_t** trap_out) {\n  TRACE(\"%p %p\", store, module);\n  assert(module);\n  assert(store);\n\n  RefVec import_refs;\n  for (size_t i = 0; i < module->As<Module>()->import_types().size(); i++) {\n    import_refs.push_back(imports->data[i]->I->self());\n  }\n\n  Trap::Ptr trap;\n  auto instance =\n      Instance::Instantiate(store->I, module->I->self(), import_refs, &trap);\n  if (trap) {\n    *trap_out = new wasm_trap_t{trap};\n    return nullptr;\n  }\n\n  return new wasm_instance_t{instance};\n}\n\nvoid wasm_instance_exports(const wasm_instance_t* instance,\n                           own wasm_extern_vec_t* out) {\n  auto&& exports = instance->As<Instance>()->exports();\n  wasm_extern_vec_new_uninitialized(out, exports.size());\n  TRACE(\"%\" PRIzx, exports.size());\n\n  for (size_t i = 0; i < exports.size(); ++i) {\n    out->data[i] =\n        new wasm_extern_t{instance->I.store()->UnsafeGet<Extern>(exports[i])};\n  }\n}\n\n// wasm_functype\n\nown wasm_functype_t* wasm_functype_new(own wasm_valtype_vec_t* params,\n                                       own wasm_valtype_vec_t* results) {\n  TRACE(\"params=%\" PRIzx \" args=%\" PRIzx, params->size, results->size);\n  auto* res = new wasm_functype_t{params, results};\n  TRACE_NO_NL(\"\");\n  print_sig(*res->As<FuncType>());\n  return res;\n}\n\nconst wasm_valtype_vec_t* wasm_functype_params(const wasm_functype_t* f) {\n  TRACE(\"%\" PRIzx, f->params.size);\n  return &f->params;\n}\n\nconst wasm_valtype_vec_t* wasm_functype_results(const wasm_functype_t* f) {\n  return &f->results;\n}\n\n// wasm_func\nown wasm_func_t* wasm_func_new(wasm_store_t* store,\n                               const wasm_functype_t* type,\n                               wasm_func_callback_t callback) {\n  FuncType wabt_type = *type->As<FuncType>();\n  auto lambda = [=](Thread& thread, const Values& wabt_params,\n                    Values& wabt_results, Trap::Ptr* out_trap) -> Result {\n    wasm_val_vec_t params, results;\n    wasm_val_vec_new_uninitialized(&params, wabt_params.size());\n    wasm_val_vec_new_uninitialized(&results, wabt_results.size());\n    FromWabtValues(store->I, &params, wabt_type.params, wabt_params);\n    auto trap = callback(&params, &results);\n    wasm_val_vec_delete(&params);\n    if (trap) {\n      *out_trap = trap->I.As<Trap>();\n      wasm_trap_delete(trap);\n      // Can't use wasm_val_vec_delete since it wasn't populated.\n      delete[] results.data;\n      return Result::Error;\n    }\n    wabt_results = ToWabtValues(&results);\n    wasm_val_vec_delete(&results);\n    return Result::Ok;\n  };\n\n  return new wasm_func_t{HostFunc::New(store->I, wabt_type, lambda)};\n}\n\nown wasm_func_t* wasm_func_new_with_env(wasm_store_t* store,\n                                        const wasm_functype_t* type,\n                                        wasm_func_callback_with_env_t callback,\n                                        void* env,\n                                        void (*finalizer)(void*)) {\n  FuncType wabt_type = *type->As<FuncType>();\n  auto lambda = [=](Thread& thread, const Values& wabt_params,\n                    Values& wabt_results, Trap::Ptr* out_trap) -> Result {\n    wasm_val_vec_t params, results;\n    wasm_val_vec_new_uninitialized(&params, wabt_params.size());\n    wasm_val_vec_new_uninitialized(&results, wabt_results.size());\n    FromWabtValues(store->I, &params, wabt_type.params, wabt_params);\n    auto trap = callback(env, &params, &results);\n    wasm_val_vec_delete(&params);\n    if (trap) {\n      *out_trap = trap->I.As<Trap>();\n      wasm_trap_delete(trap);\n      // Can't use wasm_val_vec_delete since it wasn't populated.\n      delete[] results.data;\n      return Result::Error;\n    }\n    wabt_results = ToWabtValues(&results);\n    wasm_val_vec_delete(&results);\n    return Result::Ok;\n  };\n\n  // TODO: This finalizer is different from the host_info finalizer.\n  return new wasm_func_t{HostFunc::New(store->I, wabt_type, lambda)};\n}\n\nown wasm_functype_t* wasm_func_type(const wasm_func_t* func) {\n  TRACE0();\n  return new wasm_functype_t{func->As<Func>()->type()};\n}\n\nsize_t wasm_func_result_arity(const wasm_func_t* func) {\n  return func->As<Func>()->type().results.size();\n}\n\nsize_t wasm_func_param_arity(const wasm_func_t* func) {\n  return func->As<Func>()->type().params.size();\n}\n\nown wasm_trap_t* wasm_func_call(const wasm_func_t* f,\n                                const wasm_val_vec_t* args,\n                                wasm_val_vec_t* results) {\n  // TODO: get some information about the function; name/index\n  // TRACE(\"%d\", f->index);\n\n  auto&& func_type = f->As<Func>()->type();\n  Values wabt_args = ToWabtValues(args);\n  Values wabt_results;\n  Trap::Ptr trap;\n  if (Failed(\n          f->As<Func>()->Call(*f->I.store(), wabt_args, wabt_results, &trap))) {\n    return new wasm_trap_t{trap};\n  }\n  FromWabtValues(*f->I.store(), results, func_type.results, wabt_results);\n  return nullptr;\n}\n\n// wasm_globaltype\n\nown wasm_globaltype_t* wasm_globaltype_new(own wasm_valtype_t* type,\n                                           wasm_mutability_t mut) {\n  assert(type);\n  auto* result = new wasm_globaltype_t{GlobalType{\n      type->I, mut == WASM_CONST ? Mutability::Const : Mutability::Var}};\n  wasm_valtype_delete(type);\n  return result;\n}\n\nwasm_mutability_t wasm_globaltype_mutability(const wasm_globaltype_t* type) {\n  assert(type);\n  return FromWabtMutability(type->As<GlobalType>()->mut);\n}\n\nconst wasm_valtype_t* wasm_globaltype_content(const wasm_globaltype_t* type) {\n  assert(type);\n  return &type->valtype;\n}\n\n// wasm_tabletype\n\nown wasm_tabletype_t* wasm_tabletype_new(own wasm_valtype_t* type,\n                                         const wasm_limits_t* limits) {\n  return new wasm_tabletype_t{type, limits};\n}\n\nconst wasm_valtype_t* wasm_tabletype_element(const wasm_tabletype_t* type) {\n  return &type->elemtype;\n}\n\nconst wasm_limits_t* wasm_tabletype_limits(const wasm_tabletype_t* type) {\n  return &type->limits;\n}\n\n// wasm_memorytype\n\nown wasm_memorytype_t* wasm_memorytype_new(const wasm_limits_t* limits) {\n  return new wasm_memorytype_t(limits);\n}\n\nconst wasm_limits_t* wasm_memorytype_limits(const wasm_memorytype_t* t) {\n  return &t->limits;\n}\n\n// wasm_global\n\nown wasm_global_t* wasm_global_new(wasm_store_t* store,\n                                   const wasm_globaltype_t* type,\n                                   const wasm_val_t* val) {\n  assert(store && type);\n  TypedValue value = ToWabtValue(*val);\n  TRACE(\"%s\", TypedValueToString(value).c_str());\n  return new wasm_global_t{\n      Global::New(store->I, *type->As<GlobalType>(), value.value)};\n}\n\nown wasm_globaltype_t* wasm_global_type(const wasm_global_t* global) {\n  return new wasm_globaltype_t{global->As<Global>()->type()};\n}\n\nvoid wasm_global_get(const wasm_global_t* global, own wasm_val_t* out) {\n  assert(global);\n  TRACE0();\n  TypedValue tv{global->As<Global>()->type().type, global->As<Global>()->Get()};\n  TRACE(\" -> %s\", TypedValueToString(tv).c_str());\n  *out = FromWabtValue(*global->I.store(), tv);\n}\n\nvoid wasm_global_set(wasm_global_t* global, const wasm_val_t* val) {\n  TRACE0();\n  if (wasm_valkind_is_ref(val->kind)) {\n    global->As<Global>()->Set(*global->I.store(), val->of.ref->I->self());\n  } else {\n    global->As<Global>()->UnsafeSet(ToWabtValue(*val).value);\n  }\n}\n\n// wasm_table\n\nown wasm_table_t* wasm_table_new(wasm_store_t* store,\n                                 const wasm_tabletype_t* type,\n                                 wasm_ref_t* init) {\n  return new wasm_table_t{Table::New(store->I, *type->As<TableType>(),\n                                     init ? init->I->self() : Ref::Null)};\n}\n\nown wasm_tabletype_t* wasm_table_type(const wasm_table_t* table) {\n  return new wasm_tabletype_t{table->As<Table>()->type()};\n}\n\nwasm_table_size_t wasm_table_size(const wasm_table_t* table) {\n  return table->As<Table>()->size();\n}\n\nown wasm_ref_t* wasm_table_get(const wasm_table_t* table,\n                               wasm_table_size_t index) {\n  Ref ref;\n  if (Failed(table->As<Table>()->Get(index, &ref))) {\n    return nullptr;\n  }\n  if (ref == Ref::Null) {\n    return nullptr;\n  }\n  return new wasm_ref_t{table->I.store()->UnsafeGet<Object>(ref)};\n}\n\nbool wasm_table_set(wasm_table_t* table,\n                    wasm_table_size_t index,\n                    wasm_ref_t* ref) {\n  return Succeeded(table->As<Table>()->Set(*table->I.store(), index,\n                                           ref ? ref->I->self() : Ref::Null));\n}\n\nbool wasm_table_grow(wasm_table_t* table,\n                     wasm_table_size_t delta,\n                     wasm_ref_t* init) {\n  return Succeeded(table->As<Table>()->Grow(\n      *table->I.store(), delta, init ? init->I->self() : Ref::Null));\n}\n\n// wams_memory\n\nown wasm_memory_t* wasm_memory_new(wasm_store_t* store,\n                                   const wasm_memorytype_t* type) {\n  TRACE0();\n  return new wasm_memory_t{Memory::New(store->I, *type->As<MemoryType>())};\n}\n\nown wasm_memorytype_t* wasm_memory_type(const wasm_memory_t* memory) {\n  return new wasm_memorytype_t{memory->As<Memory>()->type()};\n}\n\nbyte_t* wasm_memory_data(wasm_memory_t* memory) {\n  return reinterpret_cast<byte_t*>(memory->As<Memory>()->UnsafeData());\n}\n\nwasm_memory_pages_t wasm_memory_size(const wasm_memory_t* memory) {\n  return memory->As<Memory>()->PageSize();\n}\n\nsize_t wasm_memory_data_size(const wasm_memory_t* memory) {\n  return memory->As<Memory>()->ByteSize();\n}\n\nbool wasm_memory_grow(wasm_memory_t* memory, wasm_memory_pages_t delta) {\n  return Succeeded(memory->As<Memory>()->Grow(delta));\n}\n\n// wasm_frame\n\nown wasm_frame_t* wasm_frame_copy(const wasm_frame_t* frame) {\n  return new wasm_frame_t{*frame};\n}\n\nwasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) {\n  // TODO\n  return nullptr;\n}\n\nsize_t wasm_frame_module_offset(const wasm_frame_t* frame) {\n  // TODO\n  return 0;\n}\n\nsize_t wasm_frame_func_offset(const wasm_frame_t* frame) {\n  // TODO\n  return 0;\n}\n\nuint32_t wasm_frame_func_index(const wasm_frame_t* frame) {\n  // TODO\n  return 0;\n}\n\n// wasm_externtype\n\nwasm_externkind_t wasm_externtype_kind(const wasm_externtype_t* type) {\n  assert(type);\n  return FromWabtExternKind(type->I->kind);\n}\n\n// wasm_extern\n\nown wasm_externtype_t* wasm_extern_type(const wasm_extern_t* extern_) {\n  return wasm_externtype_t::New(extern_->As<Extern>()->extern_type().Clone())\n      .release();\n}\n\nwasm_externkind_t wasm_extern_kind(const wasm_extern_t* extern_) {\n  return FromWabtExternKind(extern_->As<Extern>()->extern_type().kind);\n}\n\n// wasm_foreign\n\nown wasm_foreign_t* wasm_foreign_new(wasm_store_t* store) {\n  return new wasm_foreign_t{Foreign::New(store->I, nullptr)};\n}\n\n// vector types\n\n#define WASM_IMPL_OWN(name)                           \\\n  void wasm_##name##_delete(own wasm_##name##_t* t) { \\\n    assert(t);                                        \\\n    TRACE0();                                         \\\n    delete t;                                         \\\n  }\n\nWASM_IMPL_OWN(frame);\nWASM_IMPL_OWN(config);\nWASM_IMPL_OWN(engine);\nWASM_IMPL_OWN(store);\n\n#define WASM_IMPL_VEC_BASE(name, ptr_or_none)                            \\\n  void wasm_##name##_vec_new_empty(own wasm_##name##_vec_t* out) {       \\\n    TRACE0();                                                            \\\n    wasm_##name##_vec_new_uninitialized(out, 0);                         \\\n  }                                                                      \\\n  void wasm_##name##_vec_new_uninitialized(own wasm_##name##_vec_t* vec, \\\n                                           size_t size) {                \\\n    TRACE(\"%\" PRIzx, size);                                              \\\n    vec->size = size;                                                    \\\n    vec->data = size ? new wasm_##name##_t ptr_or_none[size] : nullptr;  \\\n  }\n\n#define WASM_IMPL_VEC_PLAIN(name)                                       \\\n  WASM_IMPL_VEC_BASE(name, )                                            \\\n  void wasm_##name##_vec_new(own wasm_##name##_vec_t* vec, size_t size, \\\n                             own wasm_##name##_t const src[]) {         \\\n    TRACE0();                                                           \\\n    wasm_##name##_vec_new_uninitialized(vec, size);                     \\\n    memcpy(vec->data, src, size * sizeof(wasm_##name##_t));             \\\n  }                                                                     \\\n  void wasm_##name##_vec_copy(own wasm_##name##_vec_t* out,             \\\n                              const wasm_##name##_vec_t* vec) {         \\\n    TRACE(\"%\" PRIzx, vec->size);                                        \\\n    wasm_##name##_vec_new_uninitialized(out, vec->size);                \\\n    memcpy(out->data, vec->data, vec->size * sizeof(wasm_##name##_t));  \\\n  }                                                                     \\\n  void wasm_##name##_vec_delete(own wasm_##name##_vec_t* vec) {         \\\n    TRACE0();                                                           \\\n    delete[] vec->data;                                                 \\\n    vec->size = 0;                                                      \\\n  }\n\nWASM_IMPL_VEC_PLAIN(byte);\n\n// Special implementation for wasm_val_t, since it's weird.\nWASM_IMPL_VEC_BASE(val, )\nvoid wasm_val_vec_new(own wasm_val_vec_t* vec,\n                      size_t size,\n                      own wasm_val_t const src[]) {\n  TRACE0();\n  wasm_val_vec_new_uninitialized(vec, size);\n  for (size_t i = 0; i < size; ++i) {\n    vec->data[i] = src[i];\n  }\n}\n\nvoid wasm_val_vec_copy(own wasm_val_vec_t* out, const wasm_val_vec_t* vec) {\n  TRACE(\"%\" PRIzx, vec->size);\n  wasm_val_vec_new_uninitialized(out, vec->size);\n  for (size_t i = 0; i < vec->size; ++i) {\n    wasm_val_copy(&out->data[i], &vec->data[i]);\n  }\n}\n\nvoid wasm_val_vec_delete(own wasm_val_vec_t* vec) {\n  TRACE0();\n  for (size_t i = 0; i < vec->size; ++i) {\n    wasm_val_delete(&vec->data[i]);\n  }\n  delete[] vec->data;\n  vec->size = 0;\n}\n\n#define WASM_IMPL_VEC_OWN(name)                                         \\\n  WASM_IMPL_VEC_BASE(name, *)                                           \\\n  void wasm_##name##_vec_new(own wasm_##name##_vec_t* vec, size_t size, \\\n                             own wasm_##name##_t* const src[]) {        \\\n    TRACE0();                                                           \\\n    wasm_##name##_vec_new_uninitialized(vec, size);                     \\\n    for (size_t i = 0; i < size; ++i) {                                 \\\n      vec->data[i] = src[i];                                            \\\n    }                                                                   \\\n  }                                                                     \\\n  void wasm_##name##_vec_copy(own wasm_##name##_vec_t* out,             \\\n                              const wasm_##name##_vec_t* vec) {         \\\n    TRACE(\"%\" PRIzx, vec->size);                                        \\\n    wasm_##name##_vec_new_uninitialized(out, vec->size);                \\\n    for (size_t i = 0; i < vec->size; ++i) {                            \\\n      out->data[i] = wasm_##name##_copy(vec->data[i]);                  \\\n    }                                                                   \\\n  }                                                                     \\\n  void wasm_##name##_vec_delete(wasm_##name##_vec_t* vec) {             \\\n    TRACE0();                                                           \\\n    for (size_t i = 0; i < vec->size; ++i) {                            \\\n      delete vec->data[i];                                              \\\n    }                                                                   \\\n    delete[] vec->data;                                                 \\\n    vec->size = 0;                                                      \\\n  }\n\nWASM_IMPL_VEC_OWN(frame);\nWASM_IMPL_VEC_OWN(extern);\n\n#define WASM_IMPL_TYPE(name)                                              \\\n  WASM_IMPL_OWN(name)                                                     \\\n  WASM_IMPL_VEC_OWN(name)                                                 \\\n  own wasm_##name##_t* wasm_##name##_copy(const wasm_##name##_t* other) { \\\n    TRACE0();                                                             \\\n    return new wasm_##name##_t(*other);                                   \\\n  }\n\nWASM_IMPL_TYPE(valtype);\nWASM_IMPL_TYPE(importtype);\nWASM_IMPL_TYPE(exporttype);\n\n#define WASM_IMPL_TYPE_CLONE(name)                                        \\\n  WASM_IMPL_OWN(name)                                                     \\\n  WASM_IMPL_VEC_OWN(name)                                                 \\\n  own wasm_##name##_t* wasm_##name##_copy(const wasm_##name##_t* other) { \\\n    TRACE0();                                                             \\\n    return static_cast<wasm_##name##_t*>(other->Clone().release());       \\\n  }\n\nWASM_IMPL_TYPE_CLONE(functype);\nWASM_IMPL_TYPE_CLONE(globaltype);\nWASM_IMPL_TYPE_CLONE(tabletype);\nWASM_IMPL_TYPE_CLONE(memorytype);\nWASM_IMPL_TYPE_CLONE(externtype);\n\n#define WASM_IMPL_REF_BASE(name)                                          \\\n  WASM_IMPL_OWN(name)                                                     \\\n  own wasm_##name##_t* wasm_##name##_copy(const wasm_##name##_t* ref) {   \\\n    TRACE0();                                                             \\\n    return new wasm_##name##_t(*ref);                                     \\\n  }                                                                       \\\n  bool wasm_##name##_same(const wasm_##name##_t* ref,                     \\\n                          const wasm_##name##_t* other) {                 \\\n    TRACE0();                                                             \\\n    return ref->I == other->I;                                            \\\n  }                                                                       \\\n  void* wasm_##name##_get_host_info(const wasm_##name##_t* ref) {         \\\n    return ref->I->host_info();                                           \\\n  }                                                                       \\\n  void wasm_##name##_set_host_info(wasm_##name##_t* ref, void* info) {    \\\n    ref->I->set_host_info(info);                                          \\\n  }                                                                       \\\n  void wasm_##name##_set_host_info_with_finalizer(                        \\\n      wasm_##name##_t* ref, void* info, void (*finalizer)(void*)) {       \\\n    ref->I->set_host_info(info);                                          \\\n    ref->I->set_finalizer([=](Object* o) { finalizer(o->host_info()); }); \\\n  }\n\n#define WASM_IMPL_REF(name)                                                  \\\n  WASM_IMPL_REF_BASE(name)                                                   \\\n  wasm_ref_t* wasm_##name##_as_ref(wasm_##name##_t* subclass) {              \\\n    return subclass;                                                         \\\n  }                                                                          \\\n  wasm_##name##_t* wasm_ref_as_##name(wasm_ref_t* ref) {                     \\\n    return static_cast<wasm_##name##_t*>(ref);                               \\\n  }                                                                          \\\n  const wasm_ref_t* wasm_##name##_as_ref_const(                              \\\n      const wasm_##name##_t* subclass) {                                     \\\n    return subclass;                                                         \\\n  }                                                                          \\\n  const wasm_##name##_t* wasm_ref_as_##name##_const(const wasm_ref_t* ref) { \\\n    return static_cast<const wasm_##name##_t*>(ref);                         \\\n  }\n\nWASM_IMPL_REF_BASE(ref);\n\nWASM_IMPL_REF(extern);\nWASM_IMPL_REF(foreign);\nWASM_IMPL_REF(func);\nWASM_IMPL_REF(global);\nWASM_IMPL_REF(instance);\nWASM_IMPL_REF(memory);\nWASM_IMPL_REF(table);\nWASM_IMPL_REF(trap);\n\n#define WASM_IMPL_SHARABLE_REF(name)                                           \\\n  WASM_IMPL_REF(name)                                                          \\\n  WASM_IMPL_OWN(shared_##name)                                                 \\\n  own wasm_shared_##name##_t* wasm_##name##_share(const wasm_##name##_t* t) {  \\\n    return static_cast<wasm_shared_##name##_t*>(                               \\\n        const_cast<wasm_##name##_t*>(t));                                      \\\n  }                                                                            \\\n  own wasm_##name##_t* wasm_##name##_obtain(wasm_store_t*,                     \\\n                                            const wasm_shared_##name##_t* t) { \\\n    return static_cast<wasm_##name##_t*>(                                      \\\n        const_cast<wasm_shared_##name##_t*>(t));                               \\\n  }\n\nWASM_IMPL_SHARABLE_REF(module)\n\n#define WASM_IMPL_EXTERN(name)                                                 \\\n  const wasm_##name##type_t* wasm_externtype_as_##name##type_const(            \\\n      const wasm_externtype_t* t) {                                            \\\n    return static_cast<const wasm_##name##type_t*>(t);                         \\\n  }                                                                            \\\n  wasm_##name##type_t* wasm_externtype_as_##name##type(wasm_externtype_t* t) { \\\n    return static_cast<wasm_##name##type_t*>(t);                               \\\n  }                                                                            \\\n  wasm_externtype_t* wasm_##name##type_as_externtype(wasm_##name##type_t* t) { \\\n    return static_cast<wasm_externtype_t*>(t);                                 \\\n  }                                                                            \\\n  const wasm_externtype_t* wasm_##name##type_as_externtype_const(              \\\n      const wasm_##name##type_t* t) {                                          \\\n    return static_cast<const wasm_externtype_t*>(t);                           \\\n  }                                                                            \\\n  wasm_extern_t* wasm_##name##_as_extern(wasm_##name##_t* name) {              \\\n    return static_cast<wasm_extern_t*>(name);                                  \\\n  }                                                                            \\\n  const wasm_extern_t* wasm_##name##_as_extern_const(                          \\\n      const wasm_##name##_t* name) {                                           \\\n    return static_cast<const wasm_extern_t*>(name);                            \\\n  }                                                                            \\\n  wasm_##name##_t* wasm_extern_as_##name(wasm_extern_t* ext) {                 \\\n    return static_cast<wasm_##name##_t*>(ext);                                 \\\n  }\n\nWASM_IMPL_EXTERN(table);\nWASM_IMPL_EXTERN(func);\nWASM_IMPL_EXTERN(global);\nWASM_IMPL_EXTERN(memory);\n\n}  // extern \"C\"\n"
  },
  {
    "path": "src/interp/interp.cc",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/interp/interp.h\"\n\n#include <algorithm>\n#include <cassert>\n#include <cinttypes>\n\n#include \"wabt/interp/interp-math.h\"\n\nnamespace wabt {\nnamespace interp {\n\nconst char* GetName(Mutability mut) {\n  static const char* kNames[] = {\"immutable\", \"mutable\"};\n  return kNames[int(mut)];\n}\n\nconst std::string GetName(ValueType type) {\n  return type.GetName();\n}\n\nconst char* GetName(ExternKind kind) {\n  return GetKindName(kind);\n}\n\nconst char* GetName(ObjectKind kind) {\n  static const char* kNames[] = {\n      \"Null\",  \"Foreign\", \"Trap\",   \"Exception\", \"DefinedFunc\", \"HostFunc\",\n      \"Table\", \"Memory\",  \"Global\", \"Tag\",       \"Module\",      \"Instance\",\n  };\n\n  WABT_STATIC_ASSERT(WABT_ARRAY_SIZE(kNames) == kCommandTypeCount);\n\n  return kNames[int(kind)];\n}\n\n//// Refs ////\n// static\nconst Ref Ref::Null{0};\n\n//// Limits ////\nResult Match(const Limits& expected,\n             const Limits& actual,\n             std::string* out_msg) {\n  if (actual.initial < expected.initial) {\n    *out_msg = StringPrintf(\"actual size (%\" PRIu64\n                            \") smaller than declared (%\" PRIu64 \")\",\n                            actual.initial, expected.initial);\n    return Result::Error;\n  }\n\n  if (expected.has_max) {\n    if (!actual.has_max) {\n      *out_msg = StringPrintf(\n          \"max size (unspecified) larger than declared (%\" PRIu64 \")\",\n          expected.max);\n      return Result::Error;\n    } else if (actual.max > expected.max) {\n      *out_msg = StringPrintf(\"max size (%\" PRIu64\n                              \") larger than declared (%\" PRIu64 \")\",\n                              actual.max, expected.max);\n      return Result::Error;\n    }\n  }\n\n  if (expected.is_64 && !actual.is_64) {\n    *out_msg = StringPrintf(\"expected i64 memory, but i32 memory provided\");\n    return Result::Error;\n  } else if (actual.is_64 && !expected.is_64) {\n    *out_msg = StringPrintf(\"expected i32 memory, but i64 memory provided\");\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\n//// FuncType ////\nstd::unique_ptr<ExternType> FuncType::Clone() const {\n  return std::make_unique<FuncType>(*this);\n}\n\nstatic bool RecursiveMatch(const ValueTypes& expected,\n                           std::vector<FuncType>* expected_func_types,\n                           const ValueTypes& actual,\n                           std::vector<FuncType>* actual_func_types) {\n  if (expected_func_types == nullptr || actual_func_types == nullptr) {\n    return false;\n  }\n\n  size_t size = expected.size();\n  if (size != actual.size()) {\n    return false;\n  }\n\n  for (size_t i = 0; i < size; i++) {\n    if (!expected[i].IsReferenceWithIndex()) {\n      if (expected[i] != actual[i]) {\n        return false;\n      }\n      continue;\n    }\n\n    if (static_cast<Type::Enum>(expected[i]) !=\n        static_cast<Type::Enum>(actual[i])) {\n      return false;\n    }\n\n    const FuncType& expected_type =\n        (*expected_func_types)[expected[i].GetReferenceIndex()];\n    const FuncType& actual_type =\n        (*actual_func_types)[actual[i].GetReferenceIndex()];\n\n    assert(expected_type.func_types == expected_func_types);\n    assert(actual_type.func_types == actual_func_types);\n\n    if (!RecursiveMatch(expected_type.params, expected_func_types,\n                        actual_type.params, actual_func_types) ||\n        !RecursiveMatch(expected_type.results, expected_func_types,\n                        actual_type.results, actual_func_types)) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nResult Match(const FuncType& expected,\n             const FuncType& actual,\n             std::string* out_msg) {\n  bool has_reference = false;\n\n  for (auto it : expected.params) {\n    if (it.IsReferenceWithIndex()) {\n      has_reference = true;\n      break;\n    }\n  }\n\n  if (!has_reference) {\n    for (auto it : expected.results) {\n      if (it.IsReferenceWithIndex()) {\n        has_reference = true;\n        break;\n      }\n    }\n  }\n\n  if (!has_reference) {\n    // Simple function, can be a callback without module.\n    if (expected.params == actual.params &&\n        expected.results == actual.results) {\n      return Result::Ok;\n    }\n  } else {\n    if (RecursiveMatch(expected.params, expected.func_types, actual.params,\n                       actual.func_types) &&\n        RecursiveMatch(expected.results, expected.func_types, actual.results,\n                       actual.func_types)) {\n      return Result::Ok;\n    }\n  }\n\n  if (out_msg) {\n    *out_msg = \"import signature mismatch\";\n  }\n  return Result::Error;\n}\n\n//// TableType ////\nstd::unique_ptr<ExternType> TableType::Clone() const {\n  return std::make_unique<TableType>(*this);\n}\n\nResult Match(const TableType& expected,\n             const TableType& actual,\n             std::string* out_msg) {\n  if (expected.element != actual.element) {\n    *out_msg = StringPrintf(\n        \"type mismatch in imported table, expected %s but got %s.\",\n        GetName(expected.element).c_str(), GetName(actual.element).c_str());\n    return Result::Error;\n  }\n\n  if (Failed(Match(expected.limits, actual.limits, out_msg))) {\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\n//// MemoryType ////\nstd::unique_ptr<ExternType> MemoryType::Clone() const {\n  return std::make_unique<MemoryType>(*this);\n}\n\nResult Match(const MemoryType& expected,\n             const MemoryType& actual,\n             std::string* out_msg) {\n  if (expected.page_size != actual.page_size) {\n    *out_msg = StringPrintf(\n        \"page_size mismatch in imported memory, expected %u but got %u.\",\n        expected.page_size, actual.page_size);\n    return Result::Error;\n  }\n  return Match(expected.limits, actual.limits, out_msg);\n}\n\n//// GlobalType ////\nstd::unique_ptr<ExternType> GlobalType::Clone() const {\n  return std::make_unique<GlobalType>(*this);\n}\n\nResult Match(const GlobalType& expected,\n             const GlobalType& actual,\n             std::string* out_msg) {\n  if (actual.mut != expected.mut) {\n    *out_msg = StringPrintf(\n        \"mutability mismatch in imported global, expected %s but got %s.\",\n        GetName(actual.mut), GetName(expected.mut));\n    return Result::Error;\n  }\n\n  if (actual.type != expected.type &&\n      (expected.mut == Mutability::Var ||\n       !TypesMatch(expected.type, actual.type))) {\n    *out_msg = StringPrintf(\n        \"type mismatch in imported global, expected %s but got %s.\",\n        GetName(expected.type).c_str(), GetName(actual.type).c_str());\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\n//// TagType ////\nstd::unique_ptr<ExternType> TagType::Clone() const {\n  return std::make_unique<TagType>(*this);\n}\n\nResult Match(const TagType& expected,\n             const TagType& actual,\n             std::string* out_msg) {\n  if (expected.signature != actual.signature) {\n    if (out_msg) {\n      *out_msg = \"signature mismatch in imported tag\";\n    }\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\n//// Types ////\n\nbool TypesMatch(ValueType expected, ValueType actual) {\n  // Currently there is no subtyping, so expected and actual must match\n  // exactly. In the future this may be expanded.\n  if (expected == actual) {\n    return true;\n  }\n\n  if (expected == Type::FuncRef &&\n      (actual == Type::Ref ||\n       (expected.IsNullableNonTypedRef() &&\n        (actual == Type::FuncRef || actual == Type::RefNull)))) {\n    return true;\n  }\n\n  if (actual == Type::Ref && expected == Type::RefNull &&\n      actual.GetReferenceIndex() == expected.GetReferenceIndex()) {\n    return true;\n  }\n\n  return false;\n}\n\n//// Limits ////\ntemplate <typename T>\nbool CanGrow(const Limits& limits, T old_size, T delta, T* new_size) {\n  if (limits.max >= delta && old_size <= limits.max - delta) {\n    *new_size = old_size + delta;\n    return true;\n  }\n  return false;\n}\n\n//// FuncDesc ////\n\nValueType FuncDesc::GetLocalType(Index index) const {\n  if (index < type.params.size()) {\n    return type.params[index];\n  }\n  index -= type.params.size();\n\n  auto iter = std::lower_bound(\n      locals.begin(), locals.end(), index + 1,\n      [](const LocalDesc& lhs, Index rhs) { return lhs.end < rhs; });\n  assert(iter != locals.end());\n  return iter->type;\n}\n\n//// Store ////\nStore::Store(const Features& features) : features_(features) {\n  Ref ref{objects_.New(new Object(ObjectKind::Null))};\n  assert(ref == Ref::Null);\n  roots_.New(ref);\n}\n\n#ifndef NDEBUG\nbool Store::HasValueType(Ref ref, ValueType type) const {\n  // TODO opt?\n  if (!IsValid(ref)) {\n    return false;\n  }\n  if (type == ValueType::ExternRef) {\n    return true;\n  }\n  if (ref == Ref::Null) {\n    return true;\n  }\n\n  Object* obj = objects_.Get(ref.index);\n  switch (type) {\n    case ValueType::FuncRef:\n    case ValueType::Ref:\n    case ValueType::RefNull:\n      return obj->kind() == ObjectKind::DefinedFunc ||\n             obj->kind() == ObjectKind::HostFunc;\n    case ValueType::ExnRef:\n      return obj->kind() == ObjectKind::Exception;\n    default:\n      return false;\n  }\n}\n#endif\n\nStore::RootList::Index Store::NewRoot(Ref ref) {\n  return roots_.New(ref);\n}\n\nStore::RootList::Index Store::CopyRoot(RootList::Index index) {\n  // roots_.Get() returns a reference to an element in an internal vector, and\n  // roots_.New() might forward its arguments to emplace_back on the same\n  // vector. This seems to \"work\" in most environments, but fails on Visual\n  // Studio 2015 Win64. Copying it to a value fixes the issue.\n  auto obj_index = roots_.Get(index);\n  return roots_.New(obj_index);\n}\n\nvoid Store::DeleteRoot(RootList::Index index) {\n  roots_.Delete(index);\n}\n\nvoid Store::Collect() {\n  size_t object_count = objects_.size();\n\n  assert(gc_context_.call_depth == 0);\n\n  gc_context_.marks.resize(object_count);\n  std::fill(gc_context_.marks.begin(), gc_context_.marks.end(), false);\n\n  // First mark all roots.\n  for (RootList::Index i = 0; i < roots_.size(); ++i) {\n    if (roots_.IsUsed(i)) {\n      Mark(roots_.Get(i));\n    }\n  }\n\n  for (auto thread : threads_) {\n    thread->Mark();\n  }\n\n  // This vector is often empty since the default maximum\n  // recursion is usually enough to mark all objects.\n  while (WABT_UNLIKELY(!gc_context_.untraced_objects.empty())) {\n    size_t index = gc_context_.untraced_objects.back();\n\n    assert(gc_context_.marks[index]);\n    assert(gc_context_.call_depth == 0);\n\n    gc_context_.untraced_objects.pop_back();\n    objects_.Get(index)->Mark(*this);\n  }\n\n  assert(gc_context_.call_depth == 0);\n\n  // Delete all unmarked objects.\n  for (size_t i = 0; i < object_count; ++i) {\n    if (objects_.IsUsed(i) && !gc_context_.marks[i]) {\n      objects_.Delete(i);\n    }\n  }\n}\n\nvoid Store::Mark(Ref ref) {\n  size_t index = ref.index;\n\n  if (gc_context_.marks[index])\n    return;\n\n  gc_context_.marks[index] = true;\n\n  if (WABT_UNLIKELY(gc_context_.call_depth >= max_call_depth)) {\n    gc_context_.untraced_objects.push_back(index);\n    return;\n  }\n\n  gc_context_.call_depth++;\n  objects_.Get(index)->Mark(*this);\n  gc_context_.call_depth--;\n}\n\nvoid Store::Mark(const RefVec& refs) {\n  for (auto&& ref : refs) {\n    Mark(ref);\n  }\n}\n\n//// Object ////\nObject::~Object() {\n  if (finalizer_) {\n    finalizer_(this);\n  }\n}\n\n//// Foreign ////\nForeign::Foreign(Store&, void* ptr) : Object(skind), ptr_(ptr) {}\n\nvoid Foreign::Mark(Store&) {}\n\n//// Frame ////\nvoid Frame::Mark(Store& store) {\n  store.Mark(func);\n}\n\n//// Trap ////\nTrap::Trap(Store& store,\n           const std::string& msg,\n           const std::vector<Frame>& trace)\n    : Object(skind), message_(msg), trace_(trace) {}\n\nvoid Trap::Mark(Store& store) {\n  for (auto&& frame : trace_) {\n    frame.Mark(store);\n  }\n}\n\n//// Exception ////\nException::Exception(Store& store, Ref tag, Values& args)\n    : Object(skind), tag_(tag), args_(args) {}\n\nvoid Exception::Mark(Store& store) {\n  Tag::Ptr tag(store, tag_);\n  store.Mark(tag_);\n  ValueTypes params = tag->type().signature;\n  for (size_t i = 0; i < params.size(); i++) {\n    if (params[i].IsRef()) {\n      store.Mark(args_[i].Get<Ref>());\n    }\n  }\n}\n\n//// Extern ////\ntemplate <typename T>\nResult Extern::MatchImpl(Store& store,\n                         const ImportType& import_type,\n                         const T& actual,\n                         Trap::Ptr* out_trap) {\n  const T* extern_type = dyn_cast<T>(import_type.type.get());\n  if (!extern_type) {\n    *out_trap = Trap::New(\n        store,\n        StringPrintf(\"expected import \\\"%s.%s\\\" to have kind %s, not %s\",\n                     import_type.module.c_str(), import_type.name.c_str(),\n                     GetName(import_type.type->kind), GetName(T::skind)));\n    return Result::Error;\n  }\n\n  std::string msg;\n  if (Failed(interp::Match(*extern_type, actual, &msg))) {\n    *out_trap = Trap::New(store, msg);\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\n//// Func ////\nFunc::Func(ObjectKind kind, FuncType type) : Extern(kind), type_(type) {}\n\nResult Func::Call(Store& store,\n                  const Values& params,\n                  Values& results,\n                  Trap::Ptr* out_trap,\n                  Stream* trace_stream) {\n  Thread thread(store, trace_stream);\n  return DoCall(thread, params, results, out_trap);\n}\n\nResult Func::Call(Thread& thread,\n                  const Values& params,\n                  Values& results,\n                  Trap::Ptr* out_trap) {\n  return DoCall(thread, params, results, out_trap);\n}\n\n//// DefinedFunc ////\nDefinedFunc::DefinedFunc(Store& store, Ref instance, FuncDesc desc)\n    : Func(skind, desc.type), instance_(instance), desc_(desc) {}\n\nvoid DefinedFunc::Mark(Store& store) {\n  store.Mark(instance_);\n}\n\nResult DefinedFunc::Match(Store& store,\n                          const ImportType& import_type,\n                          Trap::Ptr* out_trap) {\n  return MatchImpl(store, import_type, type_, out_trap);\n}\n\nResult DefinedFunc::DoCall(Thread& thread,\n                           const Values& params,\n                           Values& results,\n                           Trap::Ptr* out_trap) {\n  assert(params.size() == type_.params.size());\n  thread.PushValues(type_.params, params);\n  RunResult result = thread.PushCall(*this, out_trap);\n  if (result == RunResult::Trap) {\n    return Result::Error;\n  }\n  result = thread.Run(out_trap);\n  if (result == RunResult::Trap) {\n    return Result::Error;\n  } else if (result == RunResult::Exception) {\n    // While this is not actually a trap, it is a convenient way\n    // to report an uncaught exception.\n    *out_trap = Trap::New(thread.store(), \"uncaught exception\");\n    return Result::Error;\n  }\n  thread.PopValues(type_.results, &results);\n  return Result::Ok;\n}\n\n//// HostFunc ////\nHostFunc::HostFunc(Store&, FuncType type, Callback callback)\n    : Func(skind, type), callback_(callback) {}\n\nvoid HostFunc::Mark(Store&) {}\n\nResult HostFunc::Match(Store& store,\n                       const ImportType& import_type,\n                       Trap::Ptr* out_trap) {\n  return MatchImpl(store, import_type, type_, out_trap);\n}\n\nResult HostFunc::DoCall(Thread& thread,\n                        const Values& params,\n                        Values& results,\n                        Trap::Ptr* out_trap) {\n  return callback_(thread, params, results, out_trap);\n}\n\n//// Table ////\nTable::Table(Store& store, TableType type, Ref init_ref)\n    : Extern(skind), type_(type) {\n  elements_.resize(type.limits.initial);\n  if (init_ref != Ref::Null) {\n    Fill(store, 0, init_ref, type.limits.initial);\n  }\n}\n\nvoid Table::Mark(Store& store) {\n  store.Mark(elements_);\n}\n\nResult Table::Match(Store& store,\n                    const ImportType& import_type,\n                    Trap::Ptr* out_trap) {\n  return MatchImpl(store, import_type, type_, out_trap);\n}\n\nbool Table::IsValidRange(u32 offset, u32 size) const {\n  size_t elem_size = elements_.size();\n  return size <= elem_size && offset <= elem_size - size;\n}\n\nResult Table::Get(u32 offset, Ref* out) const {\n  if (IsValidRange(offset, 1)) {\n    *out = elements_[offset];\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nRef Table::UnsafeGet(u32 offset) const {\n  assert(IsValidRange(offset, 1));\n  return elements_[offset];\n}\n\nResult Table::Set(Store& store, u32 offset, Ref ref) {\n  assert(store.HasValueType(ref, type_.element));\n  if (IsValidRange(offset, 1)) {\n    elements_[offset] = ref;\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult Table::Grow(Store& store, u32 count, Ref ref) {\n  size_t old_size = elements_.size();\n  u32 new_size;\n  assert(store.HasValueType(ref, type_.element));\n  if (CanGrow<u32>(type_.limits, old_size, count, &new_size)) {\n    // Grow the limits of the table too, so that if it is used as an\n    // import to another module its new size is honored.\n    type_.limits.initial += count;\n    elements_.resize(new_size);\n    Fill(store, old_size, ref, new_size - old_size);\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult Table::Fill(Store& store, u32 offset, Ref ref, u32 size) {\n  assert(store.HasValueType(ref, type_.element));\n  if (IsValidRange(offset, size)) {\n    std::fill(elements_.begin() + offset, elements_.begin() + offset + size,\n              ref);\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult Table::Init(Store& store,\n                   u32 dst_offset,\n                   const ElemSegment& src,\n                   u32 src_offset,\n                   u32 size) {\n  if (IsValidRange(dst_offset, size) && src.IsValidRange(src_offset, size) &&\n      TypesMatch(type_.element, src.desc().type)) {\n    std::copy(src.elements().begin() + src_offset,\n              src.elements().begin() + src_offset + size,\n              elements_.begin() + dst_offset);\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\n// static\nResult Table::Copy(Store& store,\n                   Table& dst,\n                   u32 dst_offset,\n                   const Table& src,\n                   u32 src_offset,\n                   u32 size) {\n  if (dst.IsValidRange(dst_offset, size) &&\n      src.IsValidRange(src_offset, size) &&\n      TypesMatch(dst.type_.element, src.type_.element)) {\n    auto src_begin = src.elements_.begin() + src_offset;\n    auto src_end = src_begin + size;\n    auto dst_begin = dst.elements_.begin() + dst_offset;\n    auto dst_end = dst_begin + size;\n    if (dst.self() == src.self() && src_begin < dst_begin) {\n      std::move_backward(src_begin, src_end, dst_end);\n    } else {\n      std::move(src_begin, src_end, dst_begin);\n    }\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\n//// Memory ////\nMemory::Memory(class Store&, MemoryType type)\n    : Extern(skind), type_(type), pages_(type.limits.initial) {\n  data_.resize(pages_ * type_.page_size);\n}\n\nvoid Memory::Mark(class Store&) {}\n\nResult Memory::Match(class Store& store,\n                     const ImportType& import_type,\n                     Trap::Ptr* out_trap) {\n  return MatchImpl(store, import_type, type_, out_trap);\n}\n\nResult Memory::Grow(u64 count) {\n  u64 new_pages;\n  if (CanGrow<u64>(type_.limits, pages_, count, &new_pages)) {\n    // Grow the limits of the memory too, so that if it is used as an\n    // import to another module its new size is honored.\n    type_.limits.initial += count;\n#if WABT_BIG_ENDIAN\n    auto old_size = data_.size();\n#endif\n    pages_ = new_pages;\n    data_.resize(new_pages * type_.page_size);\n#if WABT_BIG_ENDIAN\n    std::move_backward(data_.begin(), data_.begin() + old_size, data_.end());\n    std::fill(data_.begin(), data_.end() - old_size, 0);\n#endif\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult Memory::Fill(u64 offset, u8 value, u64 size) {\n  if (IsValidAccess(offset, 0, size)) {\n#if WABT_BIG_ENDIAN\n    std::fill(data_.end() - offset - size, data_.end() - offset, value);\n#else\n    std::fill(data_.begin() + offset, data_.begin() + offset + size, value);\n#endif\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult Memory::Init(u64 dst_offset,\n                    const DataSegment& src,\n                    u64 src_offset,\n                    u64 size) {\n  if (IsValidAccess(dst_offset, 0, size) &&\n      src.IsValidRange(src_offset, size)) {\n    std::copy(src.desc().data.begin() + src_offset,\n              src.desc().data.begin() + src_offset + size,\n#if WABT_BIG_ENDIAN\n              data_.rbegin() + dst_offset);\n#else\n              data_.begin() + dst_offset);\n#endif\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\n// static\nResult Memory::Copy(Memory& dst,\n                    u64 dst_offset,\n                    const Memory& src,\n                    u64 src_offset,\n                    u64 size) {\n  if (dst.IsValidAccess(dst_offset, 0, size) &&\n      src.IsValidAccess(src_offset, 0, size)) {\n#if WABT_BIG_ENDIAN\n    auto src_begin = src.data_.end() - src_offset - size;\n    auto dst_begin = dst.data_.end() - dst_offset - size;\n#else\n    auto src_begin = src.data_.begin() + src_offset;\n    auto dst_begin = dst.data_.begin() + dst_offset;\n#endif\n    auto src_end = src_begin + size;\n    auto dst_end = dst_begin + size;\n    if (src.self() == dst.self() && src_begin < dst_begin) {\n      std::move_backward(src_begin, src_end, dst_end);\n    } else {\n      std::move(src_begin, src_end, dst_begin);\n    }\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult Instance::CallInitFunc(Store& store,\n                              const Ref func_ref,\n                              Value* result,\n                              Trap::Ptr* out_trap) {\n  Values results;\n  Func::Ptr func{store, func_ref};\n  if (Failed(func->Call(store, {}, results, out_trap))) {\n    return Result::Error;\n  }\n  assert(results.size() == 1);\n  *result = results[0];\n  return Result::Ok;\n}\n\n//// Global ////\nGlobal::Global(Store& store, GlobalType type, Value value)\n    : Extern(skind), type_(type), value_(value) {}\n\nvoid Global::Mark(Store& store) {\n  if (IsReference(type_.type)) {\n    store.Mark(value_.Get<Ref>());\n  }\n}\n\nResult Global::Match(Store& store,\n                     const ImportType& import_type,\n                     Trap::Ptr* out_trap) {\n  return MatchImpl(store, import_type, type_, out_trap);\n}\n\nvoid Global::Set(Store& store, Ref ref) {\n  assert(store.HasValueType(ref, type_.type));\n  value_.Set(ref);\n}\n\nvoid Global::UnsafeSet(Value value) {\n  value_ = value;\n}\n\n//// Tag ////\nTag::Tag(Store&, TagType type) : Extern(skind), type_(type) {}\n\nvoid Tag::Mark(Store&) {}\n\nResult Tag::Match(Store& store,\n                  const ImportType& import_type,\n                  Trap::Ptr* out_trap) {\n  return MatchImpl(store, import_type, type_, out_trap);\n}\n\n//// ElemSegment ////\nElemSegment::ElemSegment(Store& store,\n                         const ElemDesc* desc,\n                         Instance::Ptr& inst)\n    : desc_(desc) {\n  Trap::Ptr out_trap;\n  elements_.reserve(desc->elements.size());\n  for (auto&& elem_expr : desc->elements) {\n    Value value;\n    Ref func_ref = DefinedFunc::New(store, inst.ref(), elem_expr).ref();\n    if (Failed(inst->CallInitFunc(store, func_ref, &value, &out_trap))) {\n      WABT_UNREACHABLE;  // valid const expression cannot trap\n    }\n    elements_.push_back(value.Get<Ref>());\n  }\n}\n\nbool ElemSegment::IsValidRange(u32 offset, u32 size) const {\n  u32 elem_size = this->size();\n  return size <= elem_size && offset <= elem_size - size;\n}\n\n//// DataSegment ////\nDataSegment::DataSegment(const DataDesc* desc)\n    : desc_(desc), size_(desc->data.size()) {}\n\nbool DataSegment::IsValidRange(u64 offset, u64 size) const {\n  u64 data_size = size_;\n  return size <= data_size && offset <= data_size - size;\n}\n\n//// Module ////\nModule::Module(Store&, ModuleDesc desc)\n    : Object(skind), desc_(std::move(desc)) {\n  for (auto&& import : desc_.imports) {\n    import_types_.emplace_back(import.type);\n\n    if (import.type.type->kind == ExternKind::Func) {\n      cast<FuncType>(import.type.type.get())->func_types = &desc_.func_types;\n    }\n  }\n\n  for (auto&& export_ : desc_.exports) {\n    export_types_.emplace_back(export_.type);\n\n    if (export_.type.type->kind == ExternKind::Func) {\n      cast<FuncType>(export_.type.type.get())->func_types = &desc_.func_types;\n    }\n  }\n\n  for (auto& func_type : desc_.func_types) {\n    func_type.func_types = &desc_.func_types;\n  }\n\n  for (auto& func : desc_.funcs) {\n    func.type.func_types = &desc_.func_types;\n  }\n}\n\nvoid Module::Mark(Store&) {}\n\n//// ElemSegment ////\nvoid ElemSegment::Mark(Store& store) {\n  store.Mark(elements_);\n}\n\n//// Instance ////\nInstance::Instance(Store& store, Ref module) : Object(skind), module_(module) {\n  assert(store.Is<Module>(module));\n}\n\n// static\nInstance::Ptr Instance::Instantiate(Store& store,\n                                    Ref module,\n                                    const RefVec& imports,\n                                    Trap::Ptr* out_trap) {\n  Module::Ptr mod{store, module};\n  Instance::Ptr inst = store.Alloc<Instance>(store, module);\n\n  size_t import_desc_count = mod->desc().imports.size();\n  if (imports.size() < import_desc_count) {\n    *out_trap = Trap::New(store, \"not enough imports!\");\n    return {};\n  }\n\n  // Imports.\n  for (size_t i = 0; i < import_desc_count; ++i) {\n    auto&& import_desc = mod->desc().imports[i];\n    Ref extern_ref = imports[i];\n    if (extern_ref == Ref::Null) {\n      *out_trap = Trap::New(store, StringPrintf(\"invalid import \\\"%s.%s\\\"\",\n                                                import_desc.type.module.c_str(),\n                                                import_desc.type.name.c_str()));\n      return {};\n    }\n\n    Extern::Ptr extern_{store, extern_ref};\n    if (Failed(extern_->Match(store, import_desc.type, out_trap))) {\n      return {};\n    }\n\n    inst->imports_.push_back(extern_ref);\n\n    switch (import_desc.type.type->kind) {\n      case ExternKind::Func:   inst->funcs_.push_back(extern_ref); break;\n      case ExternKind::Table:  inst->tables_.push_back(extern_ref); break;\n      case ExternKind::Memory: inst->memories_.push_back(extern_ref); break;\n      case ExternKind::Global: inst->globals_.push_back(extern_ref); break;\n      case ExternKind::Tag:    inst->tags_.push_back(extern_ref); break;\n    }\n  }\n\n  // Funcs.\n  for (auto&& desc : mod->desc().funcs) {\n    inst->funcs_.push_back(DefinedFunc::New(store, inst.ref(), desc).ref());\n  }\n\n  // Tables.\n  for (auto&& desc : mod->desc().tables) {\n    Ref ref = Ref::Null;\n    if (desc.init_func.code_offset != Istream::kInvalidOffset) {\n      Ref func_ref = DefinedFunc::New(store, inst.ref(), desc.init_func).ref();\n      Value value;\n      if (Failed(inst->CallInitFunc(store, func_ref, &value, out_trap))) {\n        return {};\n      }\n      ref = value.Get<Ref>();\n    }\n    inst->tables_.push_back(Table::New(store, desc.type, ref).ref());\n  }\n\n  // Memories.\n  for (auto&& desc : mod->desc().memories) {\n    inst->memories_.push_back(Memory::New(store, desc.type).ref());\n  }\n\n  // Globals.\n  for (auto&& desc : mod->desc().globals) {\n    Value value;\n    Ref func_ref = DefinedFunc::New(store, inst.ref(), desc.init_func).ref();\n    if (Failed(inst->CallInitFunc(store, func_ref, &value, out_trap))) {\n      return {};\n    }\n    inst->globals_.push_back(Global::New(store, desc.type, value).ref());\n  }\n\n  // Tags.\n  for (auto&& desc : mod->desc().tags) {\n    inst->tags_.push_back(Tag::New(store, desc.type).ref());\n  }\n\n  // Exports.\n  for (auto&& desc : mod->desc().exports) {\n    Ref ref;\n    switch (desc.type.type->kind) {\n      case ExternKind::Func:   ref = inst->funcs_[desc.index]; break;\n      case ExternKind::Table:  ref = inst->tables_[desc.index]; break;\n      case ExternKind::Memory: ref = inst->memories_[desc.index]; break;\n      case ExternKind::Global: ref = inst->globals_[desc.index]; break;\n      case ExternKind::Tag:    ref = inst->tags_[desc.index]; break;\n    }\n    inst->exports_.push_back(ref);\n  }\n\n  // Elems.\n  for (auto&& desc : mod->desc().elems) {\n    inst->elems_.emplace_back(store, &desc, inst);\n  }\n\n  // Datas.\n  for (auto&& desc : mod->desc().datas) {\n    inst->datas_.emplace_back(&desc);\n  }\n\n  // Initialization.\n  // The MVP requires that all segments are bounds-checked before being copied\n  // into the table or memory. The bulk memory proposal changes this behavior;\n  // instead, each segment is copied in order. If any segment fails, then no\n  // further segments are copied. Any data that was written persists.\n  enum Pass { Check, Init };\n  int pass = store.features().bulk_memory_enabled() ? Init : Check;\n  for (; pass <= Init; ++pass) {\n    // Elems.\n    for (auto&& segment : inst->elems_) {\n      auto&& desc = segment.desc();\n      if (desc.mode == SegmentMode::Active) {\n        Result result;\n        Table::Ptr table{store, inst->tables_[desc.table_index]};\n        Value value;\n        Ref func_ref =\n            DefinedFunc::New(store, inst.ref(), desc.init_func).ref();\n        if (Failed(inst->CallInitFunc(store, func_ref, &value, out_trap))) {\n          return {};\n        }\n\n        u64 offset;\n        if (table->type().limits.is_64) {\n          offset = value.Get<u64>();\n        } else {\n          offset = value.Get<u32>();\n        }\n\n        if (pass == Check) {\n          result = table->IsValidRange(offset, segment.size()) ? Result::Ok\n                                                               : Result::Error;\n        } else {\n          result = table->Init(store, offset, segment, 0, segment.size());\n          if (Succeeded(result)) {\n            segment.Drop();\n          }\n        }\n\n        if (Failed(result)) {\n          *out_trap = Trap::New(\n              store,\n              StringPrintf(\"out of bounds table access: elem segment is \"\n                           \"out of bounds: [%\" PRIu64 \", %\" PRIu64\n                           \") >= max value %u\",\n                           offset, offset + segment.size(), table->size()));\n          return {};\n        }\n      } else if (desc.mode == SegmentMode::Declared) {\n        segment.Drop();\n      }\n    }\n\n    // Data.\n    for (auto&& segment : inst->datas_) {\n      auto&& desc = segment.desc();\n      if (desc.mode == SegmentMode::Active) {\n        Result result;\n        Memory::Ptr memory{store, inst->memories_[desc.memory_index]};\n        Value offset_op;\n        Ref func_ref =\n            DefinedFunc::New(store, inst.ref(), desc.init_func).ref();\n        if (Failed(inst->CallInitFunc(store, func_ref, &offset_op, out_trap))) {\n          return {};\n        }\n        u64 offset = memory->type().limits.is_64 ? offset_op.Get<u64>()\n                                                 : offset_op.Get<u32>();\n        if (pass == Check) {\n          result = memory->IsValidAccess(offset, 0, segment.size())\n                       ? Result::Ok\n                       : Result::Error;\n        } else {\n          result = memory->Init(offset, segment, 0, segment.size());\n          if (Succeeded(result)) {\n            segment.Drop();\n          }\n        }\n\n        if (Failed(result)) {\n          *out_trap = Trap::New(\n              store, StringPrintf(\n                         \"out of bounds memory access: data segment is \"\n                         \"out of bounds: [%\" PRIu64 \", %\" PRIu64\n                         \") >= max value %\" PRIu64,\n                         offset, offset + segment.size(), memory->ByteSize()));\n          return {};\n        }\n      } else if (desc.mode == SegmentMode::Declared) {\n        segment.Drop();\n      }\n    }\n  }\n\n  // Start.\n  for (auto&& start : mod->desc().starts) {\n    Func::Ptr func{store, inst->funcs_[start.func_index]};\n    Values results;\n    if (Failed(func->Call(store, {}, results, out_trap))) {\n      return {};\n    }\n  }\n\n  return inst;\n}\n\nvoid Instance::Mark(Store& store) {\n  store.Mark(module_);\n  store.Mark(imports_);\n  store.Mark(funcs_);\n  store.Mark(memories_);\n  store.Mark(tables_);\n  store.Mark(globals_);\n  store.Mark(tags_);\n  store.Mark(exports_);\n  for (auto&& elem : elems_) {\n    elem.Mark(store);\n  }\n}\n\n//// Thread ////\nThread::Thread(Store& store, Stream* trace_stream)\n    : store_(store), trace_stream_(trace_stream) {\n  store.threads().insert(this);\n\n  Thread::Options options;\n  frames_.reserve(options.call_stack_size);\n  values_.reserve(options.value_stack_size);\n  if (trace_stream) {\n    trace_source_ = std::make_unique<TraceSource>(this);\n  }\n}\n\nThread::~Thread() {\n  store_.threads().erase(this);\n}\n\nvoid Thread::Mark() {\n  for (auto&& frame : frames_) {\n    frame.Mark(store_);\n  }\n  for (auto index : refs_) {\n    store_.Mark(values_[index].Get<Ref>());\n  }\n  store_.Mark(exceptions_);\n}\n\nvoid Thread::PushValues(const ValueTypes& types, const Values& values) {\n  assert(types.size() == values.size());\n  for (size_t i = 0; i < types.size(); ++i) {\n    if (IsReference(types[i])) {\n      refs_.push_back(values_.size());\n    }\n    values_.push_back(values[i]);\n  }\n}\n\n#define TRAP(msg) *out_trap = Trap::New(store_, (msg), frames_), RunResult::Trap\n#define TRAP_IF(cond, msg)     \\\n  if (WABT_UNLIKELY((cond))) { \\\n    return TRAP(msg);          \\\n  }\n#define TRAP_UNLESS(cond, msg) TRAP_IF(!(cond), msg)\n\nInstance* Thread::GetCallerInstance() {\n  if (frames_.size() < 2)\n    return nullptr;\n  return frames_[frames_.size() - 2].inst;\n}\n\nRunResult Thread::PushCall(Ref func, u32 offset, Trap::Ptr* out_trap) {\n  TRAP_IF(frames_.size() == frames_.capacity(), \"call stack exhausted\");\n  frames_.emplace_back(func, values_.size(), exceptions_.size(), offset, inst_,\n                       mod_);\n  return RunResult::Ok;\n}\n\nRunResult Thread::PushCall(const DefinedFunc& func, Trap::Ptr* out_trap) {\n  TRAP_IF(frames_.size() == frames_.capacity(), \"call stack exhausted\");\n  inst_ = store_.UnsafeGet<Instance>(func.instance()).get();\n  mod_ = store_.UnsafeGet<Module>(inst_->module()).get();\n  frames_.emplace_back(func.self(), values_.size(), exceptions_.size(),\n                       func.desc().code_offset, inst_, mod_);\n  return RunResult::Ok;\n}\n\nRunResult Thread::PushCall(const HostFunc& func, Trap::Ptr* out_trap) {\n  TRAP_IF(frames_.size() == frames_.capacity(), \"call stack exhausted\");\n  inst_ = nullptr;\n  mod_ = nullptr;\n  frames_.emplace_back(func.self(), values_.size(), exceptions_.size(), 0,\n                       inst_, mod_);\n  return RunResult::Ok;\n}\n\nRunResult Thread::PopCall() {\n  // Sanity check that the exception stack was popped correctly.\n  assert(frames_.back().exceptions == exceptions_.size());\n\n  frames_.pop_back();\n  if (frames_.empty()) {\n    return RunResult::Return;\n  }\n\n  auto& frame = frames_.back();\n  if (!frame.inst) {\n    // Returning to a HostFunc called on this thread.\n    return RunResult::Return;\n  }\n\n  inst_ = frame.inst;\n  mod_ = frame.mod;\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoReturnCall(const Func::Ptr& func, Trap::Ptr* out_trap) {\n  PopCall();\n  DoCall(func, out_trap);\n  return frames_.empty() ? RunResult::Return : RunResult::Ok;\n}\n\nvoid Thread::PopValues(const ValueTypes& types, Values* out_values) {\n  assert(values_.size() >= types.size());\n  out_values->resize(types.size());\n  std::copy(values_.end() - types.size(), values_.end(), out_values->begin());\n  values_.resize(values_.size() - types.size());\n}\n\nRunResult Thread::Run(Trap::Ptr* out_trap) {\n  const int kDefaultInstructionCount = 1000;\n  RunResult result;\n  do {\n    result = Run(kDefaultInstructionCount, out_trap);\n  } while (result == RunResult::Ok);\n  return result;\n}\n\nRunResult Thread::Run(int num_instructions, Trap::Ptr* out_trap) {\n  DefinedFunc::Ptr func{store_, frames_.back().func};\n  for (; num_instructions > 0; --num_instructions) {\n    auto result = StepInternal(out_trap);\n    if (result != RunResult::Ok) {\n      return result;\n    }\n  }\n  return RunResult::Ok;\n}\n\nRunResult Thread::Step(Trap::Ptr* out_trap) {\n  DefinedFunc::Ptr func{store_, frames_.back().func};\n  return StepInternal(out_trap);\n}\n\nValue& Thread::Pick(Index index) {\n  assert(index > 0 && index <= values_.size());\n  return values_[values_.size() - index];\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL Thread::Pop() {\n  return Pop().Get<T>();\n}\n\nValue Thread::Pop() {\n  if (!refs_.empty() && refs_.back() >= values_.size() - 1) {\n    refs_.pop_back();\n  }\n  auto value = values_.back();\n  values_.pop_back();\n  return value;\n}\n\nu64 Thread::PopPtr(const Memory::Ptr& memory) {\n  return memory->type().limits.is_64 ? Pop<u64>() : Pop<u32>();\n}\n\nu64 Thread::PopPtr(const Table::Ptr& table) {\n  return table->type().limits.is_64 ? Pop<u64>() : Pop<u32>();\n}\n\nvoid Thread::PushPtr(const Memory::Ptr& memory, u64 value) {\n  if (memory->type().limits.is_64) {\n    Push<u64>(value);\n  } else {\n    Push<u32>(value);\n  }\n}\n\nvoid Thread::PushPtr(const Table::Ptr& table, u64 value) {\n  if (table->type().limits.is_64) {\n    Push<u64>(value);\n  } else {\n    Push<u32>(value);\n  }\n}\n\ntemplate <typename T>\nvoid WABT_VECTORCALL Thread::Push(T value) {\n  Push(Value::Make(value));\n}\n\ntemplate <>\nvoid Thread::Push<bool>(bool value) {\n  Push(Value::Make(static_cast<u32>(value ? 1 : 0)));\n}\n\nvoid Thread::Push(Value value) {\n  values_.push_back(value);\n}\n\nvoid Thread::Push(Ref ref) {\n  refs_.push_back(values_.size());\n  values_.push_back(Value::Make(ref));\n}\n\nRunResult Thread::StepInternal(Trap::Ptr* out_trap) {\n  using O = Opcode;\n\n  u32& pc = frames_.back().offset;\n  auto& istream = mod_->desc().istream;\n\n  if (trace_stream_) {\n    istream.Trace(trace_stream_, pc, trace_source_.get());\n  }\n\n  // clang-format off\n  auto instr = istream.Read(&pc);\n  switch (instr.op) {\n    case O::Unreachable:\n      return TRAP(\"unreachable executed\");\n\n    case O::Br:\n      pc = instr.imm_u32;\n      break;\n\n    case O::BrIf:\n      if (Pop<u32>()) {\n        pc = instr.imm_u32;\n      }\n      break;\n\n    case O::BrOnNonNull: {\n      Ref ref = Pop<Ref>();\n      if (ref != Ref::Null) {\n        Push(ref);\n        pc = instr.imm_u32;\n      }\n      break;\n    }\n\n    case O::BrOnNull: {\n      Ref ref = Pop<Ref>();\n      if (ref == Ref::Null) {\n        pc = instr.imm_u32;\n      } else {\n        Push(ref);\n      }\n      break;\n    }\n\n    case O::BrTable: {\n      auto key = Pop<u32>();\n      if (key >= instr.imm_u32) {\n        key = instr.imm_u32;\n      }\n      pc += key * Istream::kBrTableEntrySize;\n      break;\n    }\n\n    case O::Return:\n      return PopCall();\n\n    case O::Call: {\n      Ref new_func_ref = inst_->funcs()[instr.imm_u32];\n      DefinedFunc::Ptr new_func{store_, new_func_ref};\n      if (PushCall(new_func_ref, new_func->desc().code_offset, out_trap) ==\n          RunResult::Trap) {\n        return RunResult::Trap;\n      }\n      break;\n    }\n\n    case O::CallIndirect:\n    case O::ReturnCallIndirect: {\n      Table::Ptr table{store_, inst_->tables()[instr.imm_u32x2.fst]};\n      auto&& func_type = mod_->desc().func_types[instr.imm_u32x2.snd];\n      u64 entry = PopPtr(table);\n      TRAP_IF(entry >= table->elements().size(), \"undefined table index\");\n      auto new_func_ref = table->elements()[entry];\n      TRAP_IF(new_func_ref == Ref::Null, \"uninitialized table element\");\n      Func::Ptr new_func{store_, new_func_ref};\n      TRAP_IF(\n          Failed(Match(new_func->type(), func_type, nullptr)),\n          \"indirect call signature mismatch\");  // TODO: don't use \"signature\"\n      if (instr.op == O::ReturnCallIndirect) {\n        return DoReturnCall(new_func, out_trap);\n      } else {\n        return DoCall(new_func, out_trap);\n      }\n    }\n\n    case O::CallRef:\n    case O::ReturnCallRef: {\n      Ref new_func_ref = Pop<Ref>();\n      TRAP_IF(new_func_ref == Ref::Null, \"null function reference\");\n      Func::Ptr new_func{store_, new_func_ref};\n\n      if (instr.op == O::ReturnCallRef) {\n        return DoReturnCall(new_func, out_trap);\n      } else {\n        return DoCall(new_func, out_trap);\n      }\n    }\n\n    case O::Drop:\n      Pop();\n      break;\n\n    case O::Select: {\n      auto cond = Pop<u32>();\n      auto ref = false;\n      // check if either is a ref\n      ref |= !refs_.empty() && refs_.back() == values_.size() - 1;\n      Value false_ = Pop();\n      ref |= !refs_.empty() && refs_.back() == values_.size() - 1;\n      Value true_ = Pop();\n      if (ref) {\n        refs_.push_back(values_.size());\n      }\n      Push(cond ? true_ : false_);\n      break;\n    }\n\n    case O::InterpLocalGetRef:\n      refs_.push_back(values_.size());\n      [[fallthrough]];\n    case O::LocalGet:\n      Push(Pick(instr.imm_u32));\n      break;\n\n    case O::LocalSet: {\n      Pick(instr.imm_u32) = Pick(1);\n      Pop();\n      break;\n    }\n\n    case O::LocalTee:\n      Pick(instr.imm_u32) = Pick(1);\n      break;\n\n    case O::InterpMarkRef:\n      refs_.push_back(values_.size() - instr.imm_u32);\n      break;\n\n    case O::InterpGlobalGetRef:\n      refs_.push_back(values_.size());\n      [[fallthrough]];\n    case O::GlobalGet: {\n      Global::Ptr global{store_, inst_->globals()[instr.imm_u32]};\n      Push(global->Get());\n      break;\n    }\n\n    case O::GlobalSet: {\n      Global::Ptr global{store_, inst_->globals()[instr.imm_u32]};\n      global->UnsafeSet(Pop());\n      break;\n    }\n\n    case O::I32Load:    return DoLoad<u32>(instr, out_trap);\n    case O::I64Load:    return DoLoad<u64>(instr, out_trap);\n    case O::F32Load:    return DoLoad<f32>(instr, out_trap);\n    case O::F64Load:    return DoLoad<f64>(instr, out_trap);\n    case O::I32Load8S:  return DoLoad<s32, s8>(instr, out_trap);\n    case O::I32Load8U:  return DoLoad<u32, u8>(instr, out_trap);\n    case O::I32Load16S: return DoLoad<s32, s16>(instr, out_trap);\n    case O::I32Load16U: return DoLoad<u32, u16>(instr, out_trap);\n    case O::I64Load8S:  return DoLoad<s64, s8>(instr, out_trap);\n    case O::I64Load8U:  return DoLoad<u64, u8>(instr, out_trap);\n    case O::I64Load16S: return DoLoad<s64, s16>(instr, out_trap);\n    case O::I64Load16U: return DoLoad<u64, u16>(instr, out_trap);\n    case O::I64Load32S: return DoLoad<s64, s32>(instr, out_trap);\n    case O::I64Load32U: return DoLoad<u64, u32>(instr, out_trap);\n\n    case O::I32Store:   return DoStore<u32>(instr, out_trap);\n    case O::I64Store:   return DoStore<u64>(instr, out_trap);\n    case O::F32Store:   return DoStore<f32>(instr, out_trap);\n    case O::F64Store:   return DoStore<f64>(instr, out_trap);\n    case O::I32Store8:  return DoStore<u32, u8>(instr, out_trap);\n    case O::I32Store16: return DoStore<u32, u16>(instr, out_trap);\n    case O::I64Store8:  return DoStore<u64, u8>(instr, out_trap);\n    case O::I64Store16: return DoStore<u64, u16>(instr, out_trap);\n    case O::I64Store32: return DoStore<u64, u32>(instr, out_trap);\n\n    case O::MemorySize: {\n      Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32]};\n      PushPtr(memory, memory->PageSize());\n      break;\n    }\n\n    case O::MemoryGrow: {\n      Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32]};\n      u64 old_size = memory->PageSize();\n      if (Failed(memory->Grow(PopPtr(memory)))) {\n        PushPtr(memory, -1);\n      } else {\n        PushPtr(memory, old_size);\n      }\n      break;\n    }\n\n    case O::I32Const: Push(instr.imm_u32); break;\n    case O::F32Const: Push(instr.imm_f32); break;\n    case O::I64Const: Push(instr.imm_u64); break;\n    case O::F64Const: Push(instr.imm_f64); break;\n\n    case O::I32Eqz: return DoUnop(IntEqz<u32>);\n    case O::I32Eq:  return DoBinop(Eq<u32>);\n    case O::I32Ne:  return DoBinop(Ne<u32>);\n    case O::I32LtS: return DoBinop(Lt<s32>);\n    case O::I32LtU: return DoBinop(Lt<u32>);\n    case O::I32GtS: return DoBinop(Gt<s32>);\n    case O::I32GtU: return DoBinop(Gt<u32>);\n    case O::I32LeS: return DoBinop(Le<s32>);\n    case O::I32LeU: return DoBinop(Le<u32>);\n    case O::I32GeS: return DoBinop(Ge<s32>);\n    case O::I32GeU: return DoBinop(Ge<u32>);\n\n    case O::I64Eqz: return DoUnop(IntEqz<u64>);\n    case O::I64Eq:  return DoBinop(Eq<u64>);\n    case O::I64Ne:  return DoBinop(Ne<u64>);\n    case O::I64LtS: return DoBinop(Lt<s64>);\n    case O::I64LtU: return DoBinop(Lt<u64>);\n    case O::I64GtS: return DoBinop(Gt<s64>);\n    case O::I64GtU: return DoBinop(Gt<u64>);\n    case O::I64LeS: return DoBinop(Le<s64>);\n    case O::I64LeU: return DoBinop(Le<u64>);\n    case O::I64GeS: return DoBinop(Ge<s64>);\n    case O::I64GeU: return DoBinop(Ge<u64>);\n\n    case O::F32Eq:  return DoBinop(Eq<f32>);\n    case O::F32Ne:  return DoBinop(Ne<f32>);\n    case O::F32Lt:  return DoBinop(Lt<f32>);\n    case O::F32Gt:  return DoBinop(Gt<f32>);\n    case O::F32Le:  return DoBinop(Le<f32>);\n    case O::F32Ge:  return DoBinop(Ge<f32>);\n\n    case O::F64Eq:  return DoBinop(Eq<f64>);\n    case O::F64Ne:  return DoBinop(Ne<f64>);\n    case O::F64Lt:  return DoBinop(Lt<f64>);\n    case O::F64Gt:  return DoBinop(Gt<f64>);\n    case O::F64Le:  return DoBinop(Le<f64>);\n    case O::F64Ge:  return DoBinop(Ge<f64>);\n\n    case O::I32Clz:    return DoUnop(IntClz<u32>);\n    case O::I32Ctz:    return DoUnop(IntCtz<u32>);\n    case O::I32Popcnt: return DoUnop(IntPopcnt<u32>);\n    case O::I32Add:    return DoBinop(Add<u32>);\n    case O::I32Sub:    return DoBinop(Sub<u32>);\n    case O::I32Mul:    return DoBinop(Mul<u32>);\n    case O::I32DivS:   return DoBinop(IntDiv<s32>, out_trap);\n    case O::I32DivU:   return DoBinop(IntDiv<u32>, out_trap);\n    case O::I32RemS:   return DoBinop(IntRem<s32>, out_trap);\n    case O::I32RemU:   return DoBinop(IntRem<u32>, out_trap);\n    case O::I32And:    return DoBinop(IntAnd<u32>);\n    case O::I32Or:     return DoBinop(IntOr<u32>);\n    case O::I32Xor:    return DoBinop(IntXor<u32>);\n    case O::I32Shl:    return DoBinop(IntShl<u32>);\n    case O::I32ShrS:   return DoBinop(IntShr<s32>);\n    case O::I32ShrU:   return DoBinop(IntShr<u32>);\n    case O::I32Rotl:   return DoBinop(IntRotl<u32>);\n    case O::I32Rotr:   return DoBinop(IntRotr<u32>);\n\n    case O::I64Clz:    return DoUnop(IntClz<u64>);\n    case O::I64Ctz:    return DoUnop(IntCtz<u64>);\n    case O::I64Popcnt: return DoUnop(IntPopcnt<u64>);\n    case O::I64Add:    return DoBinop(Add<u64>);\n    case O::I64Sub:    return DoBinop(Sub<u64>);\n    case O::I64Mul:    return DoBinop(Mul<u64>);\n    case O::I64DivS:   return DoBinop(IntDiv<s64>, out_trap);\n    case O::I64DivU:   return DoBinop(IntDiv<u64>, out_trap);\n    case O::I64RemS:   return DoBinop(IntRem<s64>, out_trap);\n    case O::I64RemU:   return DoBinop(IntRem<u64>, out_trap);\n    case O::I64And:    return DoBinop(IntAnd<u64>);\n    case O::I64Or:     return DoBinop(IntOr<u64>);\n    case O::I64Xor:    return DoBinop(IntXor<u64>);\n    case O::I64Shl:    return DoBinop(IntShl<u64>);\n    case O::I64ShrS:   return DoBinop(IntShr<s64>);\n    case O::I64ShrU:   return DoBinop(IntShr<u64>);\n    case O::I64Rotl:   return DoBinop(IntRotl<u64>);\n    case O::I64Rotr:   return DoBinop(IntRotr<u64>);\n\n    case O::F32Abs:     return DoUnop(FloatAbs<f32>);\n    case O::F32Neg:     return DoUnop(FloatNeg<f32>);\n    case O::F32Ceil:    return DoUnop(FloatCeil<f32>);\n    case O::F32Floor:   return DoUnop(FloatFloor<f32>);\n    case O::F32Trunc:   return DoUnop(FloatTrunc<f32>);\n    case O::F32Nearest: return DoUnop(FloatNearest<f32>);\n    case O::F32Sqrt:    return DoUnop(FloatSqrt<f32>);\n    case O::F32Add:      return DoBinop(Add<f32>);\n    case O::F32Sub:      return DoBinop(Sub<f32>);\n    case O::F32Mul:      return DoBinop(Mul<f32>);\n    case O::F32Div:      return DoBinop(FloatDiv<f32>);\n    case O::F32Min:      return DoBinop(FloatMin<f32>);\n    case O::F32Max:      return DoBinop(FloatMax<f32>);\n    case O::F32Copysign: return DoBinop(FloatCopysign<f32>);\n\n    case O::F64Abs:     return DoUnop(FloatAbs<f64>);\n    case O::F64Neg:     return DoUnop(FloatNeg<f64>);\n    case O::F64Ceil:    return DoUnop(FloatCeil<f64>);\n    case O::F64Floor:   return DoUnop(FloatFloor<f64>);\n    case O::F64Trunc:   return DoUnop(FloatTrunc<f64>);\n    case O::F64Nearest: return DoUnop(FloatNearest<f64>);\n    case O::F64Sqrt:    return DoUnop(FloatSqrt<f64>);\n    case O::F64Add:      return DoBinop(Add<f64>);\n    case O::F64Sub:      return DoBinop(Sub<f64>);\n    case O::F64Mul:      return DoBinop(Mul<f64>);\n    case O::F64Div:      return DoBinop(FloatDiv<f64>);\n    case O::F64Min:      return DoBinop(FloatMin<f64>);\n    case O::F64Max:      return DoBinop(FloatMax<f64>);\n    case O::F64Copysign: return DoBinop(FloatCopysign<f64>);\n\n    case O::I32WrapI64:      return DoConvert<u32, u64>(out_trap);\n    case O::I32TruncF32S:    return DoConvert<s32, f32>(out_trap);\n    case O::I32TruncF32U:    return DoConvert<u32, f32>(out_trap);\n    case O::I32TruncF64S:    return DoConvert<s32, f64>(out_trap);\n    case O::I32TruncF64U:    return DoConvert<u32, f64>(out_trap);\n    case O::I64ExtendI32S:   return DoConvert<s64, s32>(out_trap);\n    case O::I64ExtendI32U:   return DoConvert<u64, u32>(out_trap);\n    case O::I64TruncF32S:    return DoConvert<s64, f32>(out_trap);\n    case O::I64TruncF32U:    return DoConvert<u64, f32>(out_trap);\n    case O::I64TruncF64S:    return DoConvert<s64, f64>(out_trap);\n    case O::I64TruncF64U:    return DoConvert<u64, f64>(out_trap);\n    case O::F32ConvertI32S:  return DoConvert<f32, s32>(out_trap);\n    case O::F32ConvertI32U:  return DoConvert<f32, u32>(out_trap);\n    case O::F32ConvertI64S:  return DoConvert<f32, s64>(out_trap);\n    case O::F32ConvertI64U:  return DoConvert<f32, u64>(out_trap);\n    case O::F32DemoteF64:    return DoConvert<f32, f64>(out_trap);\n    case O::F64ConvertI32S:  return DoConvert<f64, s32>(out_trap);\n    case O::F64ConvertI32U:  return DoConvert<f64, u32>(out_trap);\n    case O::F64ConvertI64S:  return DoConvert<f64, s64>(out_trap);\n    case O::F64ConvertI64U:  return DoConvert<f64, u64>(out_trap);\n    case O::F64PromoteF32:   return DoConvert<f64, f32>(out_trap);\n\n    case O::I32ReinterpretF32: return DoReinterpret<u32, f32>();\n    case O::F32ReinterpretI32: return DoReinterpret<f32, u32>();\n    case O::I64ReinterpretF64: return DoReinterpret<u64, f64>();\n    case O::F64ReinterpretI64: return DoReinterpret<f64, u64>();\n\n    case O::I32Extend8S:   return DoUnop(IntExtend<u32, 7>);\n    case O::I32Extend16S:  return DoUnop(IntExtend<u32, 15>);\n    case O::I64Extend8S:   return DoUnop(IntExtend<u64, 7>);\n    case O::I64Extend16S:  return DoUnop(IntExtend<u64, 15>);\n    case O::I64Extend32S:  return DoUnop(IntExtend<u64, 31>);\n\n    case O::InterpAlloca:\n      values_.resize(values_.size() + instr.imm_u32);\n      // refs_ will be marked in InterpMarkRef.\n      break;\n\n    case O::InterpBrUnless:\n      if (!Pop<u32>()) {\n        pc = instr.imm_u32;\n      }\n      break;\n\n    case O::InterpCallImport: {\n      Ref new_func_ref = inst_->funcs()[instr.imm_u32];\n      Func::Ptr new_func{store_, new_func_ref};\n      return DoCall(new_func, out_trap);\n    }\n\n    case O::InterpDropKeep: {\n      auto drop = instr.imm_u32x2.fst;\n      auto keep = instr.imm_u32x2.snd;\n      // Shift kept refs down.\n      auto iter = refs_.rbegin();\n      for (; iter != refs_.rend(); ++iter) {\n        if (*iter >= values_.size() - keep) {\n          *iter -= drop;\n        } else {\n          break;\n        }\n      }\n      // Find dropped refs.\n      auto drop_iter = iter;\n      for (; drop_iter != refs_.rend(); ++drop_iter) {\n        if (*drop_iter < values_.size() - keep - drop) {\n          break;\n        }\n      }\n      // Erase dropped refs.\n      refs_.erase(drop_iter.base(), iter.base());\n      std::move(values_.end() - keep, values_.end(),\n                values_.end() - drop - keep);\n      values_.resize(values_.size() - drop);\n      break;\n    }\n\n    case O::InterpCatchDrop: {\n      auto drop = instr.imm_u32;\n      for (u32 i = 0; i < drop; i++) {\n        exceptions_.pop_back();\n      }\n      break;\n    }\n\n    // This operation adjusts the function reference of the reused frame\n    // after a return_call. This ensures the correct exception handlers are\n    // used for the call.\n    case O::InterpAdjustFrameForReturnCall: {\n      Ref new_func_ref = inst_->funcs()[instr.imm_u32];\n      Frame& current_frame = frames_.back();\n      current_frame.func = new_func_ref;\n      break;\n    }\n\n    case O::I32TruncSatF32S: return DoUnop(IntTruncSat<s32, f32>);\n    case O::I32TruncSatF32U: return DoUnop(IntTruncSat<u32, f32>);\n    case O::I32TruncSatF64S: return DoUnop(IntTruncSat<s32, f64>);\n    case O::I32TruncSatF64U: return DoUnop(IntTruncSat<u32, f64>);\n    case O::I64TruncSatF32S: return DoUnop(IntTruncSat<s64, f32>);\n    case O::I64TruncSatF32U: return DoUnop(IntTruncSat<u64, f32>);\n    case O::I64TruncSatF64S: return DoUnop(IntTruncSat<s64, f64>);\n    case O::I64TruncSatF64U: return DoUnop(IntTruncSat<u64, f64>);\n\n    case O::MemoryInit: return DoMemoryInit(instr, out_trap);\n    case O::DataDrop:   return DoDataDrop(instr);\n    case O::MemoryCopy: return DoMemoryCopy(instr, out_trap);\n    case O::MemoryFill: return DoMemoryFill(instr, out_trap);\n\n    case O::TableInit: return DoTableInit(instr, out_trap);\n    case O::ElemDrop:  return DoElemDrop(instr);\n    case O::TableCopy: return DoTableCopy(instr, out_trap);\n    case O::TableGet:  return DoTableGet(instr, out_trap);\n    case O::TableSet:  return DoTableSet(instr, out_trap);\n    case O::TableGrow: return DoTableGrow(instr, out_trap);\n    case O::TableSize: return DoTableSize(instr);\n    case O::TableFill: return DoTableFill(instr, out_trap);\n\n    case O::RefNull:\n      Push(Ref::Null);\n      break;\n\n    case O::RefIsNull:\n      Push(Pop<Ref>() == Ref::Null);\n      break;\n\n    case O::RefAsNonNull:\n      TRAP_IF(Pick(1).Get<Ref>() == Ref::Null, \"null reference\");\n      break;\n\n    case O::RefFunc:\n      Push(inst_->funcs()[instr.imm_u32]);\n      break;\n\n    case O::V128Load: return DoLoad<v128>(instr, out_trap);\n    case O::V128Store: return DoStore<v128>(instr, out_trap);\n\n    case O::V128Const:\n      Push<v128>(instr.imm_v128);\n      break;\n\n    case O::I8X16Splat:        return DoSimdSplat<u8x16, u32>();\n    case O::I8X16ExtractLaneS: return DoSimdExtract<s8x16, s32>(instr);\n    case O::I8X16ExtractLaneU: return DoSimdExtract<u8x16, u32>(instr);\n    case O::I8X16ReplaceLane:  return DoSimdReplace<u8x16, u32>(instr);\n    case O::I16X8Splat:        return DoSimdSplat<u16x8, u32>();\n    case O::I16X8ExtractLaneS: return DoSimdExtract<s16x8, s32>(instr);\n    case O::I16X8ExtractLaneU: return DoSimdExtract<u16x8, u32>(instr);\n    case O::I16X8ReplaceLane:  return DoSimdReplace<u16x8, u32>(instr);\n    case O::I32X4Splat:        return DoSimdSplat<u32x4, u32>();\n    case O::I32X4ExtractLane:  return DoSimdExtract<s32x4, u32>(instr);\n    case O::I32X4ReplaceLane:  return DoSimdReplace<u32x4, u32>(instr);\n    case O::I64X2Splat:        return DoSimdSplat<u64x2, u64>();\n    case O::I64X2ExtractLane:  return DoSimdExtract<u64x2, u64>(instr);\n    case O::I64X2ReplaceLane:  return DoSimdReplace<u64x2, u64>(instr);\n    case O::F32X4Splat:        return DoSimdSplat<f32x4, f32>();\n    case O::F32X4ExtractLane:  return DoSimdExtract<f32x4, f32>(instr);\n    case O::F32X4ReplaceLane:  return DoSimdReplace<f32x4, f32>(instr);\n    case O::F64X2Splat:        return DoSimdSplat<f64x2, f64>();\n    case O::F64X2ExtractLane:  return DoSimdExtract<f64x2, f64>(instr);\n    case O::F64X2ReplaceLane:  return DoSimdReplace<f64x2, f64>(instr);\n\n    case O::I8X16Eq:  return DoSimdBinop(EqMask<u8>);\n    case O::I8X16Ne:  return DoSimdBinop(NeMask<u8>);\n    case O::I8X16LtS: return DoSimdBinop(LtMask<s8>);\n    case O::I8X16LtU: return DoSimdBinop(LtMask<u8>);\n    case O::I8X16GtS: return DoSimdBinop(GtMask<s8>);\n    case O::I8X16GtU: return DoSimdBinop(GtMask<u8>);\n    case O::I8X16LeS: return DoSimdBinop(LeMask<s8>);\n    case O::I8X16LeU: return DoSimdBinop(LeMask<u8>);\n    case O::I8X16GeS: return DoSimdBinop(GeMask<s8>);\n    case O::I8X16GeU: return DoSimdBinop(GeMask<u8>);\n    case O::I16X8Eq:  return DoSimdBinop(EqMask<u16>);\n    case O::I16X8Ne:  return DoSimdBinop(NeMask<u16>);\n    case O::I16X8LtS: return DoSimdBinop(LtMask<s16>);\n    case O::I16X8LtU: return DoSimdBinop(LtMask<u16>);\n    case O::I16X8GtS: return DoSimdBinop(GtMask<s16>);\n    case O::I16X8GtU: return DoSimdBinop(GtMask<u16>);\n    case O::I16X8LeS: return DoSimdBinop(LeMask<s16>);\n    case O::I16X8LeU: return DoSimdBinop(LeMask<u16>);\n    case O::I16X8GeS: return DoSimdBinop(GeMask<s16>);\n    case O::I16X8GeU: return DoSimdBinop(GeMask<u16>);\n    case O::I32X4Eq:  return DoSimdBinop(EqMask<u32>);\n    case O::I32X4Ne:  return DoSimdBinop(NeMask<u32>);\n    case O::I32X4LtS: return DoSimdBinop(LtMask<s32>);\n    case O::I32X4LtU: return DoSimdBinop(LtMask<u32>);\n    case O::I32X4GtS: return DoSimdBinop(GtMask<s32>);\n    case O::I32X4GtU: return DoSimdBinop(GtMask<u32>);\n    case O::I32X4LeS: return DoSimdBinop(LeMask<s32>);\n    case O::I32X4LeU: return DoSimdBinop(LeMask<u32>);\n    case O::I32X4GeS: return DoSimdBinop(GeMask<s32>);\n    case O::I32X4GeU: return DoSimdBinop(GeMask<u32>);\n    case O::I64X2Eq:  return DoSimdBinop(EqMask<u64>);\n    case O::I64X2Ne:  return DoSimdBinop(NeMask<u64>);\n    case O::I64X2LtS: return DoSimdBinop(LtMask<s64>);\n    case O::I64X2GtS: return DoSimdBinop(GtMask<s64>);\n    case O::I64X2LeS: return DoSimdBinop(LeMask<s64>);\n    case O::I64X2GeS: return DoSimdBinop(GeMask<s64>);\n    case O::F32X4Eq:  return DoSimdBinop(EqMask<f32>);\n    case O::F32X4Ne:  return DoSimdBinop(NeMask<f32>);\n    case O::F32X4Lt:  return DoSimdBinop(LtMask<f32>);\n    case O::F32X4Gt:  return DoSimdBinop(GtMask<f32>);\n    case O::F32X4Le:  return DoSimdBinop(LeMask<f32>);\n    case O::F32X4Ge:  return DoSimdBinop(GeMask<f32>);\n    case O::F64X2Eq:  return DoSimdBinop(EqMask<f64>);\n    case O::F64X2Ne:  return DoSimdBinop(NeMask<f64>);\n    case O::F64X2Lt:  return DoSimdBinop(LtMask<f64>);\n    case O::F64X2Gt:  return DoSimdBinop(GtMask<f64>);\n    case O::F64X2Le:  return DoSimdBinop(LeMask<f64>);\n    case O::F64X2Ge:  return DoSimdBinop(GeMask<f64>);\n\n    case O::V128Not:       return DoSimdUnop(IntNot<u64>);\n    case O::V128And:       return DoSimdBinop(IntAnd<u64>);\n    case O::V128Or:        return DoSimdBinop(IntOr<u64>);\n    case O::V128Xor:       return DoSimdBinop(IntXor<u64>);\n    case O::V128AnyTrue:      return DoSimdIsTrue<u8x16, 1>();\n\n    case O::V128BitSelect:\n    case O::I8X16RelaxedLaneSelect:\n    case O::I16X8RelaxedLaneSelect:\n    case O::I32X4RelaxedLaneSelect:\n    case O::I64X2RelaxedLaneSelect:\n      return DoSimdBitSelect();\n\n    case O::I8X16Neg:          return DoSimdUnop(IntNeg<u8>);\n    case O::I8X16Bitmask:      return DoSimdBitmask<s8x16>();\n    case O::I8X16AllTrue:      return DoSimdIsTrue<u8x16, 16>();\n    case O::I8X16Shl:          return DoSimdShift(IntShl<u8>);\n    case O::I8X16ShrS:         return DoSimdShift(IntShr<s8>);\n    case O::I8X16ShrU:         return DoSimdShift(IntShr<u8>);\n    case O::I8X16Add:          return DoSimdBinop(Add<u8>);\n    case O::I8X16AddSatS:      return DoSimdBinop(IntAddSat<s8>);\n    case O::I8X16AddSatU:      return DoSimdBinop(IntAddSat<u8>);\n    case O::I8X16Sub:          return DoSimdBinop(Sub<u8>);\n    case O::I8X16SubSatS:      return DoSimdBinop(IntSubSat<s8>);\n    case O::I8X16SubSatU:      return DoSimdBinop(IntSubSat<u8>);\n    case O::I8X16MinS:         return DoSimdBinop(IntMin<s8>);\n    case O::I8X16MinU:         return DoSimdBinop(IntMin<u8>);\n    case O::I8X16MaxS:         return DoSimdBinop(IntMax<s8>);\n    case O::I8X16MaxU:         return DoSimdBinop(IntMax<u8>);\n\n    case O::I16X8Neg:          return DoSimdUnop(IntNeg<u16>);\n    case O::I16X8Bitmask:      return DoSimdBitmask<s16x8>();\n    case O::I16X8AllTrue:      return DoSimdIsTrue<u16x8, 8>();\n    case O::I16X8Shl:          return DoSimdShift(IntShl<u16>);\n    case O::I16X8ShrS:         return DoSimdShift(IntShr<s16>);\n    case O::I16X8ShrU:         return DoSimdShift(IntShr<u16>);\n    case O::I16X8Add:          return DoSimdBinop(Add<u16>);\n    case O::I16X8AddSatS:      return DoSimdBinop(IntAddSat<s16>);\n    case O::I16X8AddSatU:      return DoSimdBinop(IntAddSat<u16>);\n    case O::I16X8Sub:          return DoSimdBinop(Sub<u16>);\n    case O::I16X8SubSatS:      return DoSimdBinop(IntSubSat<s16>);\n    case O::I16X8SubSatU:      return DoSimdBinop(IntSubSat<u16>);\n    case O::I16X8Mul:          return DoSimdBinop(Mul<u16>);\n    case O::I16X8MinS:         return DoSimdBinop(IntMin<s16>);\n    case O::I16X8MinU:         return DoSimdBinop(IntMin<u16>);\n    case O::I16X8MaxS:         return DoSimdBinop(IntMax<s16>);\n    case O::I16X8MaxU:         return DoSimdBinop(IntMax<u16>);\n\n    case O::I32X4Neg:          return DoSimdUnop(IntNeg<u32>);\n    case O::I32X4Bitmask:      return DoSimdBitmask<s32x4>();\n    case O::I32X4AllTrue:      return DoSimdIsTrue<u32x4, 4>();\n    case O::I32X4Shl:          return DoSimdShift(IntShl<u32>);\n    case O::I32X4ShrS:         return DoSimdShift(IntShr<s32>);\n    case O::I32X4ShrU:         return DoSimdShift(IntShr<u32>);\n    case O::I32X4Add:          return DoSimdBinop(Add<u32>);\n    case O::I32X4Sub:          return DoSimdBinop(Sub<u32>);\n    case O::I32X4Mul:          return DoSimdBinop(Mul<u32>);\n    case O::I32X4MinS:         return DoSimdBinop(IntMin<s32>);\n    case O::I32X4MinU:         return DoSimdBinop(IntMin<u32>);\n    case O::I32X4MaxS:         return DoSimdBinop(IntMax<s32>);\n    case O::I32X4MaxU:         return DoSimdBinop(IntMax<u32>);\n\n    case O::I64X2Neg:          return DoSimdUnop(IntNeg<u64>);\n    case O::I64X2Bitmask:      return DoSimdBitmask<s64x2>();\n    case O::I64X2AllTrue:      return DoSimdIsTrue<u64x2, 2>();\n    case O::I64X2Shl:          return DoSimdShift(IntShl<u64>);\n    case O::I64X2ShrS:         return DoSimdShift(IntShr<s64>);\n    case O::I64X2ShrU:         return DoSimdShift(IntShr<u64>);\n    case O::I64X2Add:          return DoSimdBinop(Add<u64>);\n    case O::I64X2Sub:          return DoSimdBinop(Sub<u64>);\n    case O::I64X2Mul:          return DoSimdBinop(Mul<u64>);\n\n    case O::F32X4Ceil:         return DoSimdUnop(FloatCeil<f32>);\n    case O::F32X4Floor:        return DoSimdUnop(FloatFloor<f32>);\n    case O::F32X4Trunc:        return DoSimdUnop(FloatTrunc<f32>);\n    case O::F32X4Nearest:      return DoSimdUnop(FloatNearest<f32>);\n\n    case O::F64X2Ceil:         return DoSimdUnop(FloatCeil<f64>);\n    case O::F64X2Floor:        return DoSimdUnop(FloatFloor<f64>);\n    case O::F64X2Trunc:        return DoSimdUnop(FloatTrunc<f64>);\n    case O::F64X2Nearest:      return DoSimdUnop(FloatNearest<f64>);\n\n    case O::F32X4Abs:          return DoSimdUnop(FloatAbs<f32>);\n    case O::F32X4Neg:          return DoSimdUnop(FloatNeg<f32>);\n    case O::F32X4Sqrt:         return DoSimdUnop(FloatSqrt<f32>);\n    case O::F32X4Add:          return DoSimdBinop(Add<f32>);\n    case O::F32X4Sub:          return DoSimdBinop(Sub<f32>);\n    case O::F32X4Mul:          return DoSimdBinop(Mul<f32>);\n    case O::F32X4Div:          return DoSimdBinop(FloatDiv<f32>);\n    case O::F32X4PMin:         return DoSimdBinop(FloatPMin<f32>);\n    case O::F32X4PMax:         return DoSimdBinop(FloatPMax<f32>);\n\n    case O::F32X4Min:\n    case O::F32X4RelaxedMin:\n      return DoSimdBinop(FloatMin<f32>);\n\n    case O::F32X4Max:\n    case O::F32X4RelaxedMax:\n      return DoSimdBinop(FloatMax<f32>);\n\n    case O::F64X2Abs:          return DoSimdUnop(FloatAbs<f64>);\n    case O::F64X2Neg:          return DoSimdUnop(FloatNeg<f64>);\n    case O::F64X2Sqrt:         return DoSimdUnop(FloatSqrt<f64>);\n    case O::F64X2Add:          return DoSimdBinop(Add<f64>);\n    case O::F64X2Sub:          return DoSimdBinop(Sub<f64>);\n    case O::F64X2Mul:          return DoSimdBinop(Mul<f64>);\n    case O::F64X2Div:          return DoSimdBinop(FloatDiv<f64>);\n    case O::F64X2PMin:         return DoSimdBinop(FloatPMin<f64>);\n    case O::F64X2PMax:         return DoSimdBinop(FloatPMax<f64>);\n\n    case O::F64X2Min:\n    case O::F64X2RelaxedMin:\n      return DoSimdBinop(FloatMin<f64>);\n\n    case O::F64X2Max:\n    case O::F64X2RelaxedMax:\n      return DoSimdBinop(FloatMax<f64>);\n\n    case O::I32X4TruncSatF32X4S:\n    case O::I32X4RelaxedTruncF32X4S:\n      return DoSimdUnop(IntTruncSat<s32, f32>);\n\n    case O::I32X4TruncSatF32X4U:\n    case O::I32X4RelaxedTruncF32X4U:\n      return DoSimdUnop(IntTruncSat<u32, f32>);\n\n    case O::I32X4TruncSatF64X2SZero:\n    case O::I32X4RelaxedTruncF64X2SZero:\n      return DoSimdUnopZero(IntTruncSat<s32, f64>);\n\n    case O::I32X4TruncSatF64X2UZero:\n    case O::I32X4RelaxedTruncF64X2UZero:\n      return DoSimdUnopZero(IntTruncSat<u32, f64>);\n\n    case O::F32X4ConvertI32X4S:  return DoSimdUnop(Convert<f32, s32>);\n    case O::F32X4ConvertI32X4U:  return DoSimdUnop(Convert<f32, u32>);\n    case O::F32X4DemoteF64X2Zero: return DoSimdUnopZero(Convert<f32, f64>);\n    case O::F64X2PromoteLowF32X4: return DoSimdConvert<f64x2, f32x4, true>();\n    case O::F64X2ConvertLowI32X4S: return DoSimdConvert<f64x2, s32x4, true>();\n    case O::F64X2ConvertLowI32X4U: return DoSimdConvert<f64x2, u32x4, true>();\n\n    case O::I8X16Swizzle:\n    case O::I8X16RelaxedSwizzle:\n      return DoSimdSwizzle();\n\n    case O::I8X16Shuffle:     return DoSimdShuffle(instr);\n\n    case O::V128Load8Splat:    return DoSimdLoadSplat<u8x16>(instr, out_trap);\n    case O::V128Load16Splat:   return DoSimdLoadSplat<u16x8>(instr, out_trap);\n    case O::V128Load32Splat:   return DoSimdLoadSplat<u32x4>(instr, out_trap);\n    case O::V128Load64Splat:   return DoSimdLoadSplat<u64x2>(instr, out_trap);\n\n    case O::V128Load8Lane:    return DoSimdLoadLane<u8x16>(instr, out_trap);\n    case O::V128Load16Lane:   return DoSimdLoadLane<u16x8>(instr, out_trap);\n    case O::V128Load32Lane:   return DoSimdLoadLane<u32x4>(instr, out_trap);\n    case O::V128Load64Lane:   return DoSimdLoadLane<u64x2>(instr, out_trap);\n\n    case O::V128Store8Lane:    return DoSimdStoreLane<u8x16>(instr, out_trap);\n    case O::V128Store16Lane:   return DoSimdStoreLane<u16x8>(instr, out_trap);\n    case O::V128Store32Lane:   return DoSimdStoreLane<u32x4>(instr, out_trap);\n    case O::V128Store64Lane:   return DoSimdStoreLane<u64x2>(instr, out_trap);\n\n    case O::V128Load32Zero: return DoSimdLoadZero<u32x4, u32>(instr, out_trap);\n    case O::V128Load64Zero: return DoSimdLoadZero<u64x2, u64>(instr, out_trap);\n\n    case O::I8X16NarrowI16X8S:    return DoSimdNarrow<s8x16, s16x8>();\n    case O::I8X16NarrowI16X8U:    return DoSimdNarrow<u8x16, s16x8>();\n    case O::I16X8NarrowI32X4S:    return DoSimdNarrow<s16x8, s32x4>();\n    case O::I16X8NarrowI32X4U:    return DoSimdNarrow<u16x8, s32x4>();\n    case O::I16X8ExtendLowI8X16S:  return DoSimdConvert<s16x8, s8x16, true>();\n    case O::I16X8ExtendHighI8X16S: return DoSimdConvert<s16x8, s8x16, false>();\n    case O::I16X8ExtendLowI8X16U:  return DoSimdConvert<u16x8, u8x16, true>();\n    case O::I16X8ExtendHighI8X16U: return DoSimdConvert<u16x8, u8x16, false>();\n    case O::I32X4ExtendLowI16X8S:  return DoSimdConvert<s32x4, s16x8, true>();\n    case O::I32X4ExtendHighI16X8S: return DoSimdConvert<s32x4, s16x8, false>();\n    case O::I32X4ExtendLowI16X8U:  return DoSimdConvert<u32x4, u16x8, true>();\n    case O::I32X4ExtendHighI16X8U: return DoSimdConvert<u32x4, u16x8, false>();\n    case O::I64X2ExtendLowI32X4S:  return DoSimdConvert<s64x2, s32x4, true>();\n    case O::I64X2ExtendHighI32X4S: return DoSimdConvert<s64x2, s32x4, false>();\n    case O::I64X2ExtendLowI32X4U:  return DoSimdConvert<u64x2, u32x4, true>();\n    case O::I64X2ExtendHighI32X4U: return DoSimdConvert<u64x2, u32x4, false>();\n\n    case O::V128Load8X8S:  return DoSimdLoadExtend<s16x8, s8x8>(instr, out_trap);\n    case O::V128Load8X8U:  return DoSimdLoadExtend<u16x8, u8x8>(instr, out_trap);\n    case O::V128Load16X4S: return DoSimdLoadExtend<s32x4, s16x4>(instr, out_trap);\n    case O::V128Load16X4U: return DoSimdLoadExtend<u32x4, u16x4>(instr, out_trap);\n    case O::V128Load32X2S: return DoSimdLoadExtend<s64x2, s32x2>(instr, out_trap);\n    case O::V128Load32X2U: return DoSimdLoadExtend<u64x2, u32x2>(instr, out_trap);\n\n    case O::V128Andnot: return DoSimdBinop(IntAndNot<u64>);\n    case O::I8X16AvgrU: return DoSimdBinop(IntAvgr<u8>);\n    case O::I16X8AvgrU: return DoSimdBinop(IntAvgr<u16>);\n\n    case O::I8X16Abs: return DoSimdUnop(IntAbs<u8>);\n    case O::I16X8Abs: return DoSimdUnop(IntAbs<u16>);\n    case O::I32X4Abs: return DoSimdUnop(IntAbs<u32>);\n    case O::I64X2Abs: return DoSimdUnop(IntAbs<u64>);\n\n    case O::I8X16Popcnt: return DoSimdUnop(IntPopcnt<u8>);\n\n    case O::I16X8ExtaddPairwiseI8X16S: return DoSimdExtaddPairwise<s16x8, s8x16>();\n    case O::I16X8ExtaddPairwiseI8X16U: return DoSimdExtaddPairwise<u16x8, u8x16>();\n    case O::I32X4ExtaddPairwiseI16X8S: return DoSimdExtaddPairwise<s32x4, s16x8>();\n    case O::I32X4ExtaddPairwiseI16X8U: return DoSimdExtaddPairwise<u32x4, u16x8>();\n\n    case O::I16X8ExtmulLowI8X16S: return DoSimdExtmul<s16x8, s8x16, true>();\n    case O::I16X8ExtmulHighI8X16S: return DoSimdExtmul<s16x8, s8x16, false>();\n    case O::I16X8ExtmulLowI8X16U: return DoSimdExtmul<u16x8, u8x16, true>();\n    case O::I16X8ExtmulHighI8X16U: return DoSimdExtmul<u16x8, u8x16, false>();\n    case O::I32X4ExtmulLowI16X8S: return DoSimdExtmul<s32x4, s16x8, true>();\n    case O::I32X4ExtmulHighI16X8S: return DoSimdExtmul<s32x4, s16x8, false>();\n    case O::I32X4ExtmulLowI16X8U: return DoSimdExtmul<u32x4, u16x8, true>();\n    case O::I32X4ExtmulHighI16X8U: return DoSimdExtmul<u32x4, u16x8, false>();\n    case O::I64X2ExtmulLowI32X4S: return DoSimdExtmul<s64x2, s32x4, true>();\n    case O::I64X2ExtmulHighI32X4S: return DoSimdExtmul<s64x2, s32x4, false>();\n    case O::I64X2ExtmulLowI32X4U: return DoSimdExtmul<u64x2, u32x4, true>();\n    case O::I64X2ExtmulHighI32X4U: return DoSimdExtmul<u64x2, u32x4, false>();\n\n    case O::I16X8Q15mulrSatS:\n    case O::I16X8RelaxedQ15mulrS:\n      return DoSimdBinop(SaturatingRoundingQMul<s16>);\n\n    case O::I32X4DotI16X8S: return DoSimdDot<u32x4, s16x8>();\n    case O::I16X8DotI8X16I7X16S: return DoSimdDot<u16x8, s8x16>();\n    case O::I32X4DotI8X16I7X16AddS: return DoSimdDotAdd<u32x4, s16x8>();\n\n    case O::F32X4RelaxedMadd: return DoSimdRelaxedMadd<f32>();\n    case O::F32X4RelaxedNmadd: return DoSimdRelaxedNmadd<f32>();\n    case O::F64X2RelaxedMadd: return DoSimdRelaxedMadd<f64>();\n    case O::F64X2RelaxedNmadd: return DoSimdRelaxedNmadd<f64>();\n\n    case O::AtomicFence:\n    case O::MemoryAtomicNotify:\n    case O::MemoryAtomicWait32:\n    case O::MemoryAtomicWait64:\n    case O::I64Add128:\n    case O::I64Sub128:\n    case O::I64MulWideS:\n    case O::I64MulWideU:\n      return TRAP(\"not implemented\");\n\n    case O::I32AtomicLoad:       return DoAtomicLoad<u32>(instr, out_trap);\n    case O::I64AtomicLoad:       return DoAtomicLoad<u64>(instr, out_trap);\n    case O::I32AtomicLoad8U:     return DoAtomicLoad<u32, u8>(instr, out_trap);\n    case O::I32AtomicLoad16U:    return DoAtomicLoad<u32, u16>(instr, out_trap);\n    case O::I64AtomicLoad8U:     return DoAtomicLoad<u64, u8>(instr, out_trap);\n    case O::I64AtomicLoad16U:    return DoAtomicLoad<u64, u16>(instr, out_trap);\n    case O::I64AtomicLoad32U:    return DoAtomicLoad<u64, u32>(instr, out_trap);\n    case O::I32AtomicStore:      return DoAtomicStore<u32>(instr, out_trap);\n    case O::I64AtomicStore:      return DoAtomicStore<u64>(instr, out_trap);\n    case O::I32AtomicStore8:     return DoAtomicStore<u32, u8>(instr, out_trap);\n    case O::I32AtomicStore16:    return DoAtomicStore<u32, u16>(instr, out_trap);\n    case O::I64AtomicStore8:     return DoAtomicStore<u64, u8>(instr, out_trap);\n    case O::I64AtomicStore16:    return DoAtomicStore<u64, u16>(instr, out_trap);\n    case O::I64AtomicStore32:    return DoAtomicStore<u64, u32>(instr, out_trap);\n    case O::I32AtomicRmwAdd:     return DoAtomicRmw<u32>(Add<u32>, instr, out_trap);\n    case O::I64AtomicRmwAdd:     return DoAtomicRmw<u64>(Add<u64>, instr, out_trap);\n    case O::I32AtomicRmw8AddU:   return DoAtomicRmw<u32>(Add<u8>, instr, out_trap);\n    case O::I32AtomicRmw16AddU:  return DoAtomicRmw<u32>(Add<u16>, instr, out_trap);\n    case O::I64AtomicRmw8AddU:   return DoAtomicRmw<u64>(Add<u8>, instr, out_trap);\n    case O::I64AtomicRmw16AddU:  return DoAtomicRmw<u64>(Add<u16>, instr, out_trap);\n    case O::I64AtomicRmw32AddU:  return DoAtomicRmw<u64>(Add<u32>, instr, out_trap);\n    case O::I32AtomicRmwSub:     return DoAtomicRmw<u32>(Sub<u32>, instr, out_trap);\n    case O::I64AtomicRmwSub:     return DoAtomicRmw<u64>(Sub<u64>, instr, out_trap);\n    case O::I32AtomicRmw8SubU:   return DoAtomicRmw<u32>(Sub<u8>, instr, out_trap);\n    case O::I32AtomicRmw16SubU:  return DoAtomicRmw<u32>(Sub<u16>, instr, out_trap);\n    case O::I64AtomicRmw8SubU:   return DoAtomicRmw<u64>(Sub<u8>, instr, out_trap);\n    case O::I64AtomicRmw16SubU:  return DoAtomicRmw<u64>(Sub<u16>, instr, out_trap);\n    case O::I64AtomicRmw32SubU:  return DoAtomicRmw<u64>(Sub<u32>, instr, out_trap);\n    case O::I32AtomicRmwAnd:     return DoAtomicRmw<u32>(IntAnd<u32>, instr, out_trap);\n    case O::I64AtomicRmwAnd:     return DoAtomicRmw<u64>(IntAnd<u64>, instr, out_trap);\n    case O::I32AtomicRmw8AndU:   return DoAtomicRmw<u32>(IntAnd<u8>, instr, out_trap);\n    case O::I32AtomicRmw16AndU:  return DoAtomicRmw<u32>(IntAnd<u16>, instr, out_trap);\n    case O::I64AtomicRmw8AndU:   return DoAtomicRmw<u64>(IntAnd<u8>, instr, out_trap);\n    case O::I64AtomicRmw16AndU:  return DoAtomicRmw<u64>(IntAnd<u16>, instr, out_trap);\n    case O::I64AtomicRmw32AndU:  return DoAtomicRmw<u64>(IntAnd<u32>, instr, out_trap);\n    case O::I32AtomicRmwOr:      return DoAtomicRmw<u32>(IntOr<u32>, instr, out_trap);\n    case O::I64AtomicRmwOr:      return DoAtomicRmw<u64>(IntOr<u64>, instr, out_trap);\n    case O::I32AtomicRmw8OrU:    return DoAtomicRmw<u32>(IntOr<u8>, instr, out_trap);\n    case O::I32AtomicRmw16OrU:   return DoAtomicRmw<u32>(IntOr<u16>, instr, out_trap);\n    case O::I64AtomicRmw8OrU:    return DoAtomicRmw<u64>(IntOr<u8>, instr, out_trap);\n    case O::I64AtomicRmw16OrU:   return DoAtomicRmw<u64>(IntOr<u16>, instr, out_trap);\n    case O::I64AtomicRmw32OrU:   return DoAtomicRmw<u64>(IntOr<u32>, instr, out_trap);\n    case O::I32AtomicRmwXor:     return DoAtomicRmw<u32>(IntXor<u32>, instr, out_trap);\n    case O::I64AtomicRmwXor:     return DoAtomicRmw<u64>(IntXor<u64>, instr, out_trap);\n    case O::I32AtomicRmw8XorU:   return DoAtomicRmw<u32>(IntXor<u8>, instr, out_trap);\n    case O::I32AtomicRmw16XorU:  return DoAtomicRmw<u32>(IntXor<u16>, instr, out_trap);\n    case O::I64AtomicRmw8XorU:   return DoAtomicRmw<u64>(IntXor<u8>, instr, out_trap);\n    case O::I64AtomicRmw16XorU:  return DoAtomicRmw<u64>(IntXor<u16>, instr, out_trap);\n    case O::I64AtomicRmw32XorU:  return DoAtomicRmw<u64>(IntXor<u32>, instr, out_trap);\n    case O::I32AtomicRmwXchg:    return DoAtomicRmw<u32>(Xchg<u32>, instr, out_trap);\n    case O::I64AtomicRmwXchg:    return DoAtomicRmw<u64>(Xchg<u64>, instr, out_trap);\n    case O::I32AtomicRmw8XchgU:  return DoAtomicRmw<u32>(Xchg<u8>, instr, out_trap);\n    case O::I32AtomicRmw16XchgU: return DoAtomicRmw<u32>(Xchg<u16>, instr, out_trap);\n    case O::I64AtomicRmw8XchgU:  return DoAtomicRmw<u64>(Xchg<u8>, instr, out_trap);\n    case O::I64AtomicRmw16XchgU: return DoAtomicRmw<u64>(Xchg<u16>, instr, out_trap);\n    case O::I64AtomicRmw32XchgU: return DoAtomicRmw<u64>(Xchg<u32>, instr, out_trap);\n\n    case O::I32AtomicRmwCmpxchg:    return DoAtomicRmwCmpxchg<u32>(instr, out_trap);\n    case O::I64AtomicRmwCmpxchg:    return DoAtomicRmwCmpxchg<u64>(instr, out_trap);\n    case O::I32AtomicRmw8CmpxchgU:  return DoAtomicRmwCmpxchg<u32, u8>(instr, out_trap);\n    case O::I32AtomicRmw16CmpxchgU: return DoAtomicRmwCmpxchg<u32, u16>(instr, out_trap);\n    case O::I64AtomicRmw8CmpxchgU:  return DoAtomicRmwCmpxchg<u64, u8>(instr, out_trap);\n    case O::I64AtomicRmw16CmpxchgU: return DoAtomicRmwCmpxchg<u64, u16>(instr, out_trap);\n    case O::I64AtomicRmw32CmpxchgU: return DoAtomicRmwCmpxchg<u64, u32>(instr, out_trap);\n\n    case O::Throw: {\n      u32 tag_index = instr.imm_u32;\n      Values params;\n      Ref tag_ref = inst_->tags()[tag_index];\n      Tag::Ptr tag{store_, tag_ref};\n      PopValues(tag->type().signature, &params);\n      Exception::Ptr exn = Exception::New(store_, tag_ref, params);\n      return DoThrow(exn);\n    }\n    case O::Rethrow: {\n      u32 exn_index = instr.imm_u32;\n      Exception::Ptr exn{store_,\n                         exceptions_[exceptions_.size() - exn_index - 1]};\n      return DoThrow(exn);\n    }\n    case O::ThrowRef: {\n      Ref ref = Pop<Ref>();\n      assert(store_.HasValueType(ref, ValueType::ExnRef));\n      // FIXME better error message?\n      TRAP_IF(ref == Ref::Null, \"expected exnref, got null\");\n      Exception::Ptr exn = store_.UnsafeGet<Exception>(ref);\n      return DoThrow(exn);\n    }\n\n    // The following opcodes are either never generated or should never be\n    // executed.\n    case O::Nop:\n    case O::Block:\n    case O::Loop:\n    case O::If:\n    case O::Else:\n    case O::End:\n    case O::ReturnCall:\n    case O::SelectT:\n\n    case O::Try:\n    case O::TryTable:\n    case O::Catch:\n    case O::CatchAll:\n    case O::Delegate:\n    case O::InterpData:\n    case O::Invalid:\n      WABT_UNREACHABLE;\n      break;\n  }\n  // clang-format on\n\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoCall(const Func::Ptr& func, Trap::Ptr* out_trap) {\n  if (auto* host_func = dyn_cast<HostFunc>(func.get())) {\n    auto& func_type = host_func->type();\n\n    Values params;\n    PopValues(func_type.params, &params);\n    if (PushCall(*host_func, out_trap) == RunResult::Trap) {\n      return RunResult::Trap;\n    }\n\n    Values results(func_type.results.size());\n    if (Failed(host_func->Call(*this, params, results, out_trap))) {\n      return RunResult::Trap;\n    }\n\n    PopCall();\n    PushValues(func_type.results, results);\n  } else {\n    if (PushCall(*cast<DefinedFunc>(func.get()), out_trap) == RunResult::Trap) {\n      return RunResult::Trap;\n    }\n  }\n  return RunResult::Ok;\n}\n\ntemplate <typename T>\nRunResult Thread::Load(Instr instr, T* out, Trap::Ptr* out_trap) {\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32x2.fst]};\n  u64 offset = PopPtr(memory);\n  TRAP_IF(Failed(memory->Load(offset, instr.imm_u32x2.snd, out)),\n          StringPrintf(\"out of bounds memory access: access at %\" PRIu64\n                       \"+%\" PRIzd \" >= max value %\" PRIu64,\n                       offset + instr.imm_u32x2.snd, sizeof(T),\n                       memory->ByteSize()));\n  return RunResult::Ok;\n}\n\ntemplate <typename T, typename V>\nRunResult Thread::DoLoad(Instr instr, Trap::Ptr* out_trap) {\n  V val;\n  if (Load<V>(instr, &val, out_trap) != RunResult::Ok) {\n    return RunResult::Trap;\n  }\n  Push(static_cast<T>(val));\n  return RunResult::Ok;\n}\n\ntemplate <typename T, typename V>\nRunResult Thread::DoStore(Instr instr, Trap::Ptr* out_trap) {\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32x2.fst]};\n  V val = static_cast<V>(Pop<T>());\n  u64 offset = PopPtr(memory);\n  TRAP_IF(Failed(memory->Store(offset, instr.imm_u32x2.snd, val)),\n          StringPrintf(\"out of bounds memory access: access at %\" PRIu64\n                       \"+%\" PRIzd \" >= max value %\" PRIu64,\n                       offset + instr.imm_u32x2.snd, sizeof(V),\n                       memory->ByteSize()));\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoUnop(UnopFunc<R, T> f) {\n  Push<R>(f(Pop<T>()));\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoUnop(UnopTrapFunc<R, T> f, Trap::Ptr* out_trap) {\n  T out;\n  std::string msg;\n  TRAP_IF(f(Pop<T>(), &out, &msg) == RunResult::Trap, msg);\n  Push<R>(out);\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoBinop(BinopFunc<R, T> f) {\n  auto rhs = Pop<T>();\n  auto lhs = Pop<T>();\n  Push<R>(f(lhs, rhs));\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoBinop(BinopTrapFunc<R, T> f, Trap::Ptr* out_trap) {\n  auto rhs = Pop<T>();\n  auto lhs = Pop<T>();\n  T out;\n  std::string msg;\n  TRAP_IF(f(lhs, rhs, &out, &msg) == RunResult::Trap, msg);\n  Push<R>(out);\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoConvert(Trap::Ptr* out_trap) {\n  auto val = Pop<T>();\n  if (std::is_integral<R>::value && std::is_floating_point<T>::value) {\n    // Don't use std::isnan here because T may be a non-floating-point type.\n    TRAP_IF(IsNaN(val), \"invalid conversion to integer\");\n  }\n  TRAP_UNLESS(CanConvert<R>(val), \"integer overflow\");\n  Push<R>(Convert<R>(val));\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoReinterpret() {\n  Push(Bitcast<R>(Pop<T>()));\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoMemoryInit(Instr instr, Trap::Ptr* out_trap) {\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32x2.fst]};\n  auto&& data = inst_->datas()[instr.imm_u32x2.snd];\n  auto size = Pop<u32>();\n  auto src = Pop<u32>();\n  u64 dst = PopPtr(memory);\n  TRAP_IF(Failed(memory->Init(dst, data, src, size)),\n          \"out of bounds memory access: memory.init out of bounds\");\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoDataDrop(Instr instr) {\n  inst_->datas()[instr.imm_u32].Drop();\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoMemoryCopy(Instr instr, Trap::Ptr* out_trap) {\n  Memory::Ptr mem_dst{store_, inst_->memories()[instr.imm_u32x2.fst]};\n  Memory::Ptr mem_src{store_, inst_->memories()[instr.imm_u32x2.snd]};\n  u64 size = PopPtr(mem_src);\n  u64 src = PopPtr(mem_src);\n  u64 dst = PopPtr(mem_dst);\n  // TODO: change to \"out of bounds\"\n  TRAP_IF(Failed(Memory::Copy(*mem_dst, dst, *mem_src, src, size)),\n          \"out of bounds memory access: memory.copy out of bound\");\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoMemoryFill(Instr instr, Trap::Ptr* out_trap) {\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32]};\n  u64 size = PopPtr(memory);\n  auto value = Pop<u32>();\n  u64 dst = PopPtr(memory);\n  TRAP_IF(Failed(memory->Fill(dst, value, size)),\n          \"out of bounds memory access: memory.fill out of bounds\");\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoTableInit(Instr instr, Trap::Ptr* out_trap) {\n  Table::Ptr table{store_, inst_->tables()[instr.imm_u32x2.fst]};\n  auto&& elem = inst_->elems()[instr.imm_u32x2.snd];\n  auto size = Pop<u32>();\n  auto src = Pop<u32>();\n  u64 dst = PopPtr(table);\n  TRAP_IF(Failed(table->Init(store_, dst, elem, src, size)),\n          \"out of bounds table access: table.init out of bounds\");\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoElemDrop(Instr instr) {\n  inst_->elems()[instr.imm_u32].Drop();\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoTableCopy(Instr instr, Trap::Ptr* out_trap) {\n  Table::Ptr table_dst{store_, inst_->tables()[instr.imm_u32x2.fst]};\n  Table::Ptr table_src{store_, inst_->tables()[instr.imm_u32x2.snd]};\n  u64 size = PopPtr(table_src);\n  u64 src = PopPtr(table_src);\n  u64 dst = PopPtr(table_dst);\n  TRAP_IF(Failed(Table::Copy(store_, *table_dst, dst, *table_src, src, size)),\n          \"out of bounds table access: table.copy out of bounds\");\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoTableGet(Instr instr, Trap::Ptr* out_trap) {\n  Table::Ptr table{store_, inst_->tables()[instr.imm_u32]};\n  u64 index = PopPtr(table);\n  Ref ref;\n  TRAP_IF(Failed(table->Get(index, &ref)),\n          StringPrintf(\"out of bounds table access: table.get at %\" PRIu64\n                       \" >= max value %u\",\n                       index, table->size()));\n  Push(ref);\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoTableSet(Instr instr, Trap::Ptr* out_trap) {\n  Table::Ptr table{store_, inst_->tables()[instr.imm_u32]};\n  auto ref = Pop<Ref>();\n  u64 index = PopPtr(table);\n  TRAP_IF(Failed(table->Set(store_, index, ref)),\n          StringPrintf(\"out of bounds table access: table.set at %\" PRIu64\n                       \" >= max value %u\",\n                       index, table->size()));\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoTableGrow(Instr instr, Trap::Ptr* out_trap) {\n  Table::Ptr table{store_, inst_->tables()[instr.imm_u32]};\n  u32 old_size = table->size();\n  auto delta = PopPtr(table);\n  auto ref = Pop<Ref>();\n  if (Failed(table->Grow(store_, delta, ref))) {\n    PushPtr(table, -1);\n  } else {\n    PushPtr(table, old_size);\n  }\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoTableSize(Instr instr) {\n  Table::Ptr table{store_, inst_->tables()[instr.imm_u32]};\n  PushPtr(table, table->size());\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoTableFill(Instr instr, Trap::Ptr* out_trap) {\n  Table::Ptr table{store_, inst_->tables()[instr.imm_u32]};\n  u64 size = PopPtr(table);\n  auto value = Pop<Ref>();\n  u64 dst = PopPtr(table);\n  TRAP_IF(Failed(table->Fill(store_, dst, value, size)),\n          \"out of bounds table access: table.fill out of bounds\");\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoSimdSplat() {\n  auto val = Pop<T>();\n  R result;\n  std::fill(std::begin(result.v), std::end(result.v), val);\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoSimdExtract(Instr instr) {\n  Push<T>(Pop<R>()[instr.imm_u8]);\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoSimdReplace(Instr instr) {\n  auto val = Pop<T>();\n  auto simd = Pop<R>();\n  simd[instr.imm_u8] = val;\n  Push(simd);\n  return RunResult::Ok;\n}\n\ntemplate <typename T> struct Simd128;\ntemplate <> struct Simd128<s8> { using Type = s8x16; };\ntemplate <> struct Simd128<u8> { using Type = u8x16; };\ntemplate <> struct Simd128<s16> { using Type = s16x8; };\ntemplate <> struct Simd128<u16> { using Type = u16x8; };\ntemplate <> struct Simd128<s32> { using Type = s32x4; };\ntemplate <> struct Simd128<u32> { using Type = u32x4; };\ntemplate <> struct Simd128<s64> { using Type = s64x2; };\ntemplate <> struct Simd128<u64> { using Type = u64x2; };\ntemplate <> struct Simd128<f32> { using Type = f32x4; };\ntemplate <> struct Simd128<f64> { using Type = f64x2; };\n\ntemplate <typename R, typename T>\nRunResult Thread::DoSimdUnop(UnopFunc<R, T> f) {\n  using ST = typename Simd128<T>::Type;\n  using SR = typename Simd128<R>::Type;\n  auto val = Pop<ST>();\n  SR result;\n  std::transform(std::begin(val.v), std::end(val.v), std::begin(result.v), f);\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoSimdUnopZero(UnopFunc<R, T> f) {\n  using ST = typename Simd128<T>::Type;\n  using SR = typename Simd128<R>::Type;\n  auto val = Pop<ST>();\n  SR result;\n  for (u8 i = 0; i < ST::lanes; ++i) {\n    result[i] = f(val[i]);\n  }\n  for (u8 i = ST::lanes; i < SR::lanes; ++i) {\n    result[i] = 0;\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoSimdBinop(BinopFunc<R, T> f) {\n  using ST = typename Simd128<T>::Type;\n  using SR = typename Simd128<R>::Type;\n  static_assert(ST::lanes == SR::lanes, \"SIMD lanes don't match\");\n  auto rhs = Pop<ST>();\n  auto lhs = Pop<ST>();\n  SR result;\n  for (u8 i = 0; i < SR::lanes; ++i) {\n    result[i] = f(lhs[i], rhs[i]);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoSimdBitSelect() {\n  using S = u64x2;\n  auto c = Pop<S>();\n  auto rhs = Pop<S>();\n  auto lhs = Pop<S>();\n  S result;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    result[i] = (lhs[i] & c[i]) | (rhs[i] & ~c[i]);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S, u8 count>\nRunResult Thread::DoSimdIsTrue() {\n  using L = typename S::LaneType;\n  auto val = Pop<S>();\n  Push(std::count_if(std::begin(val.v), std::end(val.v),\n                     [](L x) { return x != 0; }) >= count);\n  return RunResult::Ok;\n}\n\ntemplate <typename S>\nRunResult Thread::DoSimdBitmask() {\n  auto val = Pop<S>();\n  u32 result = 0;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    if (val[i] < 0) {\n      result |= 1 << i;\n    }\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoSimdShift(BinopFunc<R, T> f) {\n  using ST = typename Simd128<T>::Type;\n  using SR = typename Simd128<R>::Type;\n  static_assert(ST::lanes == SR::lanes, \"SIMD lanes don't match\");\n  auto amount = Pop<u32>();\n  auto lhs = Pop<ST>();\n  SR result;\n  for (u8 i = 0; i < SR::lanes; ++i) {\n    result[i] = f(lhs[i], amount);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S>\nRunResult Thread::DoSimdLoadSplat(Instr instr, Trap::Ptr* out_trap) {\n  using L = typename S::LaneType;\n  L val;\n  if (Load<L>(instr, &val, out_trap) != RunResult::Ok) {\n    return RunResult::Trap;\n  }\n  S result;\n  std::fill(std::begin(result.v), std::end(result.v), val);\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S>\nRunResult Thread::DoSimdLoadLane(Instr instr, Trap::Ptr* out_trap) {\n  using T = typename S::LaneType;\n  auto result = Pop<S>();\n  T val;\n  if (Load<T>(instr, &val, out_trap) != RunResult::Ok) {\n    return RunResult::Trap;\n  }\n  result[instr.imm_u32x2_u8.idx] = val;\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S>\nRunResult Thread::DoSimdStoreLane(Instr instr, Trap::Ptr* out_trap) {\n  using T = typename S::LaneType;\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32x2_u8.fst]};\n  auto result = Pop<S>();\n  T val = result[instr.imm_u32x2_u8.idx];\n  u64 offset = PopPtr(memory);\n  TRAP_IF(Failed(memory->Store(offset, instr.imm_u32x2_u8.snd, val)),\n          StringPrintf(\"out of bounds memory access: access at %\" PRIu64\n                       \"+%\" PRIzd \" >= max value %\" PRIu64,\n                       offset + instr.imm_u32x2_u8.snd, sizeof(T),\n                       memory->ByteSize()));\n  return RunResult::Ok;\n}\n\ntemplate <typename S, typename T>\nRunResult Thread::DoSimdLoadZero(Instr instr, Trap::Ptr* out_trap) {\n  using L = typename S::LaneType;\n  L val;\n  if (Load<L>(instr, &val, out_trap) != RunResult::Ok) {\n    return RunResult::Trap;\n  }\n  S result;\n  std::fill(std::begin(result.v), std::end(result.v), 0);\n  result[0] = val;\n  Push(result);\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoSimdSwizzle() {\n  using S = u8x16;\n  auto rhs = Pop<S>();\n  auto lhs = Pop<S>();\n  S result;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    result[i] = rhs[i] < S::lanes ? lhs[rhs[i]] : 0;\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoSimdShuffle(Instr instr) {\n  using S = u8x16;\n  auto sel = Bitcast<S>(instr.imm_v128);\n  auto rhs = Pop<S>();\n  auto lhs = Pop<S>();\n  S result;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    result[i] = sel[i] < S::lanes ? lhs[sel[i]] : rhs[sel[i] - S::lanes];\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S, typename T>\nRunResult Thread::DoSimdNarrow() {\n  using SL = typename S::LaneType;\n  using TL = typename T::LaneType;\n  auto rhs = Pop<T>();\n  auto lhs = Pop<T>();\n  S result;\n  for (u8 i = 0; i < T::lanes; ++i) {\n    result[i] = Saturate<SL, TL>(lhs[i]);\n  }\n  for (u8 i = 0; i < T::lanes; ++i) {\n    result[T::lanes + i] = Saturate<SL, TL>(rhs[i]);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S, typename T, bool low>\nRunResult Thread::DoSimdConvert() {\n  using SL = typename S::LaneType;\n  auto val = Pop<T>();\n  S result;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    result[i] = Convert<SL>(val[(low ? 0 : S::lanes) + i]);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S, typename T, bool low>\nRunResult Thread::DoSimdExtmul() {\n  auto rhs = Pop<T>();\n  auto lhs = Pop<T>();\n  S result;\n  using U = typename S::LaneType;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    u8 laneidx = (low ? 0 : S::lanes) + i;\n    result[i] = U(lhs[laneidx]) * U(rhs[laneidx]);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S, typename T>\nRunResult Thread::DoSimdLoadExtend(Instr instr, Trap::Ptr* out_trap) {\n  T val;\n  if (Load<T>(instr, &val, out_trap) != RunResult::Ok) {\n    return RunResult::Trap;\n  }\n  S result;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    result[i] = val[i];\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S, typename T>\nRunResult Thread::DoSimdExtaddPairwise() {\n  auto val = Pop<T>();\n  S result;\n  using U = typename S::LaneType;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    u8 laneidx = i * 2;\n    result[i] = U(val[laneidx]) + U(val[laneidx + 1]);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S, typename T>\nRunResult Thread::DoSimdDot() {\n  using SL = typename S::LaneType;\n  auto rhs = Pop<T>();\n  auto lhs = Pop<T>();\n  S result;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    u8 laneidx = i * 2;\n    SL lo = SL(lhs[laneidx] * rhs[laneidx]);\n    SL hi = SL(lhs[laneidx + 1] * rhs[laneidx + 1]);\n    result[i] = Add(lo, hi);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S, typename T>\nRunResult Thread::DoSimdDotAdd() {\n  using SL = typename S::LaneType;\n  auto acc = Pop<S>();\n  auto rhs = Pop<T>();\n  auto lhs = Pop<T>();\n  S result;\n  for (u8 i = 0; i < S::lanes; ++i) {\n    u8 laneidx = i * 2;\n    SL lo = SL(lhs[laneidx] * rhs[laneidx]);\n    SL hi = SL(lhs[laneidx + 1] * rhs[laneidx + 1]);\n    result[i] = Add(lo, hi);\n    result[i] = Add(result[i], acc[i]);\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S>\nRunResult Thread::DoSimdRelaxedMadd() {\n  using SS = typename Simd128<S>::Type;\n  auto c = Pop<SS>();\n  auto b = Pop<SS>();\n  auto a = Pop<SS>();\n  SS result;\n  for (u8 i = 0; i < SS::lanes; ++i) {\n    result[i] = a[i] * b[i] + c[i];\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename S>\nRunResult Thread::DoSimdRelaxedNmadd() {\n  using SS = typename Simd128<S>::Type;\n  auto c = Pop<SS>();\n  auto b = Pop<SS>();\n  auto a = Pop<SS>();\n  SS result;\n  for (u8 i = 0; i < SS::lanes; ++i) {\n    result[i] = -(a[i] * b[i]) + c[i];\n  }\n  Push(result);\n  return RunResult::Ok;\n}\n\ntemplate <typename T, typename V>\nRunResult Thread::DoAtomicLoad(Instr instr, Trap::Ptr* out_trap) {\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32x2.fst]};\n  u64 offset = PopPtr(memory);\n  V val;\n  TRAP_IF(Failed(memory->AtomicLoad(offset, instr.imm_u32x2.snd, &val)),\n          StringPrintf(\"invalid atomic access at %\" PRIaddress \"+%u\", offset,\n                       instr.imm_u32x2.snd));\n  Push(static_cast<T>(val));\n  return RunResult::Ok;\n}\n\ntemplate <typename T, typename V>\nRunResult Thread::DoAtomicStore(Instr instr, Trap::Ptr* out_trap) {\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32x2.fst]};\n  V val = static_cast<V>(Pop<T>());\n  u64 offset = PopPtr(memory);\n  TRAP_IF(Failed(memory->AtomicStore(offset, instr.imm_u32x2.snd, val)),\n          StringPrintf(\"invalid atomic access at %\" PRIaddress \"+%u\", offset,\n                       instr.imm_u32x2.snd));\n  return RunResult::Ok;\n}\n\ntemplate <typename R, typename T>\nRunResult Thread::DoAtomicRmw(BinopFunc<T, T> f,\n                              Instr instr,\n                              Trap::Ptr* out_trap) {\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32x2.fst]};\n  T val = static_cast<T>(Pop<R>());\n  u64 offset = PopPtr(memory);\n  T old;\n  TRAP_IF(Failed(memory->AtomicRmw(offset, instr.imm_u32x2.snd, val, f, &old)),\n          StringPrintf(\"invalid atomic access at %\" PRIaddress \"+%u\", offset,\n                       instr.imm_u32x2.snd));\n  Push(static_cast<R>(old));\n  return RunResult::Ok;\n}\n\ntemplate <typename T, typename V>\nRunResult Thread::DoAtomicRmwCmpxchg(Instr instr, Trap::Ptr* out_trap) {\n  Memory::Ptr memory{store_, inst_->memories()[instr.imm_u32x2.fst]};\n  V replace = static_cast<V>(Pop<T>());\n  V expect = static_cast<V>(Pop<T>());\n  V old;\n  u64 offset = PopPtr(memory);\n  TRAP_IF(Failed(memory->AtomicRmwCmpxchg(offset, instr.imm_u32x2.snd, expect,\n                                          replace, &old)),\n          StringPrintf(\"invalid atomic access at %\" PRIaddress \"+%u\", offset,\n                       instr.imm_u32x2.snd));\n  Push(static_cast<T>(old));\n  return RunResult::Ok;\n}\n\nRunResult Thread::DoThrow(Exception::Ptr exn) {\n  Istream::Offset target_offset = Istream::kInvalidOffset;\n  u32 target_values, target_exceptions;\n  Tag::Ptr exn_tag{store_, exn->tag()};\n  bool popped_frame = false;\n  bool had_catch_all = false;\n  bool target_exnref = false;\n\n  // DoThrow is responsible for unwinding the stack at the point at which an\n  // exception is thrown, and also branching to the appropriate catch within\n  // the target try-catch. In a compiler, the tag dispatch might be done in\n  // generated code in a landing pad, but this is easier for the interpreter.\n  while (!frames_.empty()) {\n    const Frame& frame = frames_.back();\n    DefinedFunc::Ptr func{store_, frame.func};\n    u32 pc = frame.offset;\n    auto handlers = func->desc().handlers;\n\n    // We iterate in reverse order, in order to traverse handlers from most\n    // specific (pushed last) to least specific within a nested stack of\n    // try-catch blocks.\n    auto iter = handlers.rbegin();\n    while (iter != handlers.rend()) {\n      const HandlerDesc& handler = *iter;\n      // pc points to the *next* instruction by the time we're in DoThrow.\n      if (pc > handler.try_start_offset && pc <= handler.try_end_offset) {\n        // For a try-delegate, skip part of the traversal by directly going\n        // up to an outer handler specified by the delegate depth.\n        if (handler.kind == HandlerKind::Delegate) {\n          // Subtract one as we're trying to get a reverse iterator that is\n          // offset by `delegate_handler_index` from the first item.\n          iter = handlers.rend() - handler.delegate_handler_index - 1;\n          continue;\n        }\n        // Otherwise, check for a matching catch tag or catch_all.\n        for (auto _catch : handler.catches) {\n          // Here we have to be careful to use the target frame's instance\n          // to look up the tag rather than the throw's instance.\n          Ref catch_tag_ref = frame.inst->tags()[_catch.tag_index];\n          Tag::Ptr catch_tag{store_, catch_tag_ref};\n          if (exn_tag == catch_tag) {\n            target_offset = _catch.offset;\n            target_values = (*iter).values;\n            target_exceptions = (*iter).exceptions;\n            target_exnref = _catch.ref;\n            goto found_handler;\n          }\n        }\n        if (handler.catch_all_offset != Istream::kInvalidOffset) {\n          target_offset = handler.catch_all_offset;\n          target_values = (*iter).values;\n          target_exceptions = (*iter).exceptions;\n          had_catch_all = true;\n          target_exnref = handler.catch_all_ref;\n          goto found_handler;\n        }\n      }\n      iter++;\n    }\n    frames_.pop_back();\n    popped_frame = true;\n  }\n\n  // If the call frames are empty now, the exception is uncaught.\n  assert(frames_.empty());\n  return RunResult::Exception;\n\nfound_handler:\n  assert(target_offset != Istream::kInvalidOffset);\n\n  Frame& target_frame = frames_.back();\n  // If the throw crosses call frames, we need to reset the state to that\n  // call frame's values. The stack heights may need to be offset by the\n  // handler's heights as we may be jumping into the middle of the function\n  // code after some stack height changes.\n  if (popped_frame) {\n    inst_ = target_frame.inst;\n    mod_ = target_frame.mod;\n  }\n  values_.resize(target_frame.values + target_values);\n  exceptions_.resize(target_frame.exceptions + target_exceptions);\n  // Jump to the handler.\n  target_frame.offset = target_offset;\n  // When an exception is caught, it needs to be tracked in a stack\n  // to allow for rethrows. This stack is popped on leaving the try-catch\n  // or by control instructions such as `br`.\n  exceptions_.push_back(exn.ref());\n  // Also push exception payload values if applicable.\n  if (!had_catch_all) {\n    PushValues(exn_tag->type().signature, exn->args());\n  }\n  if (target_exnref) {\n    Push(exn.ref());\n  }\n  return RunResult::Ok;\n}\n\nThread::TraceSource::TraceSource(Thread* thread) : thread_(thread) {}\n\nstd::string Thread::TraceSource::Header(Istream::Offset offset) {\n  return StringPrintf(\"#%\" PRIzd \". %4u: V:%-3\" PRIzd,\n                      thread_->frames_.size() - 1, offset,\n                      thread_->values_.size());\n}\n\nstd::string Thread::TraceSource::Pick(Index index, Instr instr) {\n  Value val = thread_->Pick(index);\n  const char* reftype;\n  // Estimate number of operands.\n  // TODO: Instead, record this accurately in opcode.def.\n  Index num_operands = 3;\n  for (Index i = 3; i >= 1; i--) {\n    if (instr.op.GetParamType(i) == ValueType::Void) {\n      num_operands--;\n    } else {\n      break;\n    }\n  }\n  auto type = index > num_operands\n                  ? Type(ValueType::Void)\n                  : instr.op.GetParamType(num_operands - index + 1);\n  if (type == ValueType::Void) {\n    // Void should never be displayed normally; we only expect to see it when\n    // the stack may have different a different type. This is likely to occur\n    // with an index; try to see which type we should expect.\n    switch (instr.op) {\n      case Opcode::GlobalSet: type = GetGlobalType(instr.imm_u32); break;\n      case Opcode::LocalSet:\n      case Opcode::LocalTee:  type = GetLocalType(instr.imm_u32); break;\n      case Opcode::TableSet:\n      case Opcode::TableGrow:\n      case Opcode::TableFill: type = GetTableElementType(instr.imm_u32); break;\n      default: return \"?\";\n    }\n  }\n\n  switch (type) {\n    case ValueType::I32: return StringPrintf(\"%u\", val.Get<u32>());\n    case ValueType::I64: return StringPrintf(\"%\" PRIu64, val.Get<u64>());\n    case ValueType::F32: return StringPrintf(\"%g\", val.Get<f32>());\n    case ValueType::F64: return StringPrintf(\"%g\", val.Get<f64>());\n    case ValueType::V128: {\n      auto v = val.Get<v128>();\n      return StringPrintf(\"0x%08x 0x%08x 0x%08x 0x%08x\", v.u32(0), v.u32(1),\n                          v.u32(2), v.u32(3));\n    }\n\n      // clang-format off\n    case ValueType::FuncRef:    reftype = \"funcref\"; break;\n    case ValueType::ExternRef:  reftype = \"externref\"; break;\n    case ValueType::ExnRef:     reftype = \"exnref\"; break;\n      // clang-format on\n\n    default:\n      WABT_UNREACHABLE;\n      break;\n  }\n\n  // Handle ref types.\n  return StringPrintf(\"%s:%\" PRIzd, reftype, val.Get<Ref>().index);\n}\n\nValueType Thread::TraceSource::GetLocalType(Index stack_slot) {\n  const Frame& frame = thread_->frames_.back();\n  DefinedFunc::Ptr func{thread_->store_, frame.func};\n  // When a function is called, the arguments are first pushed on the stack by\n  // the caller, then the new call frame is pushed (which caches the current\n  // height of the value stack). At that point, any local variables will be\n  // allocated on the stack. For example, a function that has two parameters\n  // and one local variable will have a stack like this:\n  //\n  //                 frame.values      top of stack\n  //                 v                 v\n  //   param1 param2 | local1 ..........\n  //\n  // When the instruction stream is generated, all local variable access is\n  // translated into a value relative to the top of the stack, counting up from\n  // 1. So in the previous example, if there are three values above the local\n  // variable, the stack looks like:\n  //\n  //              param1 param2 | local1 value1 value2 value3\n  // stack slot:    6      5        4      3      2      1\n  // local index:   0      1        2\n  //\n  // local1 can be accessed with stack_slot 4, and param1 can be accessed with\n  // stack_slot 6. The formula below takes these values into account to convert\n  // the stack_slot into a local index.\n  Index local_index =\n      (thread_->values_.size() - frame.values + func->type().params.size()) -\n      stack_slot;\n  return func->desc().GetLocalType(local_index);\n}\n\nValueType Thread::TraceSource::GetGlobalType(Index index) {\n  return thread_->mod_->desc().globals[index].type.type;\n}\n\nValueType Thread::TraceSource::GetTableElementType(Index index) {\n  return thread_->mod_->desc().tables[index].type.element;\n}\n\n}  // namespace interp\n}  // namespace wabt\n"
  },
  {
    "path": "src/interp/istream.cc",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/interp/istream.h\"\n\n#include <cinttypes>\n\nnamespace wabt {\nnamespace interp {\n\ntemplate <typename T>\nvoid WABT_VECTORCALL Istream::EmitAt(Offset offset, T val) {\n  u32 new_size = offset + sizeof(T);\n  if (new_size > data_.size()) {\n    data_.resize(new_size);\n  }\n  memcpy(data_.data() + offset, &val, sizeof(val));\n}\n\ntemplate <typename T>\nvoid WABT_VECTORCALL Istream::EmitInternal(T val) {\n  EmitAt(end(), val);\n}\n\nvoid Istream::Emit(u32 val) {\n  EmitInternal(val);\n}\n\nvoid Istream::Emit(Opcode::Enum op) {\n  EmitInternal(static_cast<SerializedOpcode>(op));\n}\n\nvoid Istream::Emit(Opcode::Enum op, u8 val) {\n  Emit(op);\n  EmitInternal(val);\n}\n\nvoid Istream::Emit(Opcode::Enum op, u32 val) {\n  Emit(op);\n  EmitInternal(val);\n}\n\nvoid Istream::Emit(Opcode::Enum op, u64 val) {\n  Emit(op);\n  EmitInternal(val);\n}\n\nvoid Istream::Emit(Opcode::Enum op, v128 val) {\n  Emit(op);\n  EmitInternal(val);\n}\n\nvoid Istream::Emit(Opcode::Enum op, u32 val1, u32 val2) {\n  Emit(op);\n  EmitInternal(val1);\n  EmitInternal(val2);\n}\n\nvoid Istream::Emit(Opcode::Enum op, u32 val1, u32 val2, u8 val3) {\n  Emit(op);\n  EmitInternal(val1);\n  EmitInternal(val2);\n  EmitInternal(val3);\n}\n\nvoid Istream::EmitDropKeep(u32 drop, u32 keep) {\n  if (drop > 0) {\n    if (drop == 1 && keep == 0) {\n      Emit(Opcode::Drop);\n    } else {\n      Emit(Opcode::InterpDropKeep, drop, keep);\n    }\n  }\n}\n\nvoid Istream::EmitCatchDrop(u32 drop) {\n  if (drop > 0) {\n    Emit(Opcode::InterpCatchDrop, drop);\n  }\n}\n\nIstream::Offset Istream::EmitFixupU32() {\n  auto result = end();\n  EmitInternal(kInvalidOffset);\n  return result;\n}\n\nvoid Istream::ResolveFixupU32(Offset fixup_offset) {\n  EmitAt(fixup_offset, end());\n}\n\nIstream::Offset Istream::end() const {\n  return static_cast<u32>(data_.size());\n}\n\ntemplate <typename T>\nT WABT_VECTORCALL Istream::ReadAt(Offset* offset) const {\n  assert(*offset + sizeof(T) <= data_.size());\n  T result;\n  memcpy(&result, data_.data() + *offset, sizeof(T));\n  *offset += sizeof(T);\n  return result;\n}\n\nInstr Istream::Read(Offset* offset) const {\n  Instr instr;\n  instr.op = static_cast<Opcode::Enum>(ReadAt<SerializedOpcode>(offset));\n\n  switch (instr.op) {\n    case Opcode::Drop:\n    case Opcode::Nop:\n    case Opcode::Return:\n    case Opcode::Unreachable:\n    case Opcode::ThrowRef:\n    case Opcode::RefNull:\n      // 0 immediates, 0 operands.\n      instr.kind = InstrKind::Imm_0_Op_0;\n      break;\n\n    case Opcode::F32Abs:\n    case Opcode::F32Ceil:\n    case Opcode::F32ConvertI32S:\n    case Opcode::F32ConvertI32U:\n    case Opcode::F32ConvertI64S:\n    case Opcode::F32ConvertI64U:\n    case Opcode::F32DemoteF64:\n    case Opcode::F32Floor:\n    case Opcode::F32Nearest:\n    case Opcode::F32Neg:\n    case Opcode::F32ReinterpretI32:\n    case Opcode::F32Sqrt:\n    case Opcode::F32Trunc:\n    case Opcode::F32X4Abs:\n    case Opcode::F32X4Ceil:\n    case Opcode::F32X4ConvertI32X4S:\n    case Opcode::F32X4ConvertI32X4U:\n    case Opcode::F32X4Floor:\n    case Opcode::F32X4Nearest:\n    case Opcode::F32X4Neg:\n    case Opcode::F32X4Splat:\n    case Opcode::F32X4Sqrt:\n    case Opcode::F32X4Trunc:\n    case Opcode::F64Abs:\n    case Opcode::F64Ceil:\n    case Opcode::F64ConvertI32S:\n    case Opcode::F64ConvertI32U:\n    case Opcode::F64ConvertI64S:\n    case Opcode::F64ConvertI64U:\n    case Opcode::F64Floor:\n    case Opcode::F64Nearest:\n    case Opcode::F64Neg:\n    case Opcode::F64PromoteF32:\n    case Opcode::F64ReinterpretI64:\n    case Opcode::F64Sqrt:\n    case Opcode::F64Trunc:\n    case Opcode::F64X2Abs:\n    case Opcode::F64X2Ceil:\n    case Opcode::F64X2Floor:\n    case Opcode::F64X2Nearest:\n    case Opcode::F64X2Neg:\n    case Opcode::F64X2Splat:\n    case Opcode::F64X2Sqrt:\n    case Opcode::F64X2Trunc:\n    case Opcode::I16X8AllTrue:\n    case Opcode::I16X8Bitmask:\n    case Opcode::I16X8Neg:\n    case Opcode::I16X8Splat:\n    case Opcode::I16X8ExtendHighI8X16S:\n    case Opcode::I16X8ExtendHighI8X16U:\n    case Opcode::I16X8ExtendLowI8X16S:\n    case Opcode::I16X8ExtendLowI8X16U:\n    case Opcode::I32Clz:\n    case Opcode::I32Ctz:\n    case Opcode::I32Eqz:\n    case Opcode::I32Extend16S:\n    case Opcode::I32Extend8S:\n    case Opcode::I32Popcnt:\n    case Opcode::I32ReinterpretF32:\n    case Opcode::I32TruncF32S:\n    case Opcode::I32TruncF32U:\n    case Opcode::I32TruncF64S:\n    case Opcode::I32TruncF64U:\n    case Opcode::I32TruncSatF32S:\n    case Opcode::I32TruncSatF32U:\n    case Opcode::I32TruncSatF64S:\n    case Opcode::I32TruncSatF64U:\n    case Opcode::I32WrapI64:\n    case Opcode::I32X4AllTrue:\n    case Opcode::I32X4Bitmask:\n    case Opcode::I32X4Neg:\n    case Opcode::I32X4Splat:\n    case Opcode::I32X4TruncSatF32X4S:\n    case Opcode::I32X4TruncSatF32X4U:\n    case Opcode::I32X4ExtendHighI16X8S:\n    case Opcode::I32X4ExtendHighI16X8U:\n    case Opcode::I32X4ExtendLowI16X8S:\n    case Opcode::I32X4ExtendLowI16X8U:\n    case Opcode::I64Clz:\n    case Opcode::I64Ctz:\n    case Opcode::I64Eqz:\n    case Opcode::I64Extend16S:\n    case Opcode::I64Extend32S:\n    case Opcode::I64Extend8S:\n    case Opcode::I64ExtendI32S:\n    case Opcode::I64ExtendI32U:\n    case Opcode::I64Popcnt:\n    case Opcode::I64ReinterpretF64:\n    case Opcode::I64TruncF32S:\n    case Opcode::I64TruncF32U:\n    case Opcode::I64TruncF64S:\n    case Opcode::I64TruncF64U:\n    case Opcode::I64TruncSatF32S:\n    case Opcode::I64TruncSatF32U:\n    case Opcode::I64TruncSatF64S:\n    case Opcode::I64TruncSatF64U:\n    case Opcode::I64X2Neg:\n    case Opcode::I64X2AllTrue:\n    case Opcode::I64X2Bitmask:\n    case Opcode::I64X2ExtendLowI32X4S:\n    case Opcode::I64X2ExtendHighI32X4S:\n    case Opcode::I64X2ExtendLowI32X4U:\n    case Opcode::I64X2ExtendHighI32X4U:\n    case Opcode::I64X2Splat:\n    case Opcode::I8X16AllTrue:\n    case Opcode::I8X16Bitmask:\n    case Opcode::I8X16Neg:\n    case Opcode::I8X16Popcnt:\n    case Opcode::F32X4DemoteF64X2Zero:\n    case Opcode::F64X2PromoteLowF32X4:\n    case Opcode::I32X4TruncSatF64X2SZero:\n    case Opcode::I32X4TruncSatF64X2UZero:\n    case Opcode::F64X2ConvertLowI32X4S:\n    case Opcode::F64X2ConvertLowI32X4U:\n    case Opcode::I8X16Splat:\n    case Opcode::RefIsNull:\n    case Opcode::RefAsNonNull:\n    case Opcode::V128Not:\n    case Opcode::V128AnyTrue:\n    case Opcode::I8X16Abs:\n    case Opcode::I16X8Abs:\n    case Opcode::I32X4Abs:\n    case Opcode::I64X2Abs:\n    case Opcode::I16X8ExtaddPairwiseI8X16S:\n    case Opcode::I16X8ExtaddPairwiseI8X16U:\n    case Opcode::I32X4ExtaddPairwiseI16X8S:\n    case Opcode::I32X4ExtaddPairwiseI16X8U:\n    case Opcode::I32X4RelaxedTruncF32X4S:\n    case Opcode::I32X4RelaxedTruncF32X4U:\n    case Opcode::I32X4RelaxedTruncF64X2SZero:\n    case Opcode::I32X4RelaxedTruncF64X2UZero:\n      // 0 immediates, 1 operand.\n      instr.kind = InstrKind::Imm_0_Op_1;\n      break;\n\n    case Opcode::F32Add:\n    case Opcode::F32Copysign:\n    case Opcode::F32Div:\n    case Opcode::F32Eq:\n    case Opcode::F32Ge:\n    case Opcode::F32Gt:\n    case Opcode::F32Le:\n    case Opcode::F32Lt:\n    case Opcode::F32Max:\n    case Opcode::F32Min:\n    case Opcode::F32Mul:\n    case Opcode::F32Ne:\n    case Opcode::F32Sub:\n    case Opcode::F32X4Add:\n    case Opcode::F32X4Div:\n    case Opcode::F32X4Eq:\n    case Opcode::F32X4Ge:\n    case Opcode::F32X4Gt:\n    case Opcode::F32X4Le:\n    case Opcode::F32X4Lt:\n    case Opcode::F32X4Max:\n    case Opcode::F32X4Min:\n    case Opcode::F32X4Mul:\n    case Opcode::F32X4Ne:\n    case Opcode::F32X4PMax:\n    case Opcode::F32X4PMin:\n    case Opcode::F32X4Sub:\n    case Opcode::F64Add:\n    case Opcode::F64Copysign:\n    case Opcode::F64Div:\n    case Opcode::F64Eq:\n    case Opcode::F64Ge:\n    case Opcode::F64Gt:\n    case Opcode::F64Le:\n    case Opcode::F64Lt:\n    case Opcode::F64Max:\n    case Opcode::F64Min:\n    case Opcode::F64Mul:\n    case Opcode::F64Ne:\n    case Opcode::F64Sub:\n    case Opcode::F64X2Add:\n    case Opcode::F64X2Div:\n    case Opcode::F64X2Eq:\n    case Opcode::F64X2Ge:\n    case Opcode::F64X2Gt:\n    case Opcode::F64X2Le:\n    case Opcode::F64X2Lt:\n    case Opcode::F64X2Max:\n    case Opcode::F64X2Min:\n    case Opcode::F64X2Mul:\n    case Opcode::F64X2Ne:\n    case Opcode::F64X2PMax:\n    case Opcode::F64X2PMin:\n    case Opcode::F64X2Sub:\n    case Opcode::I16X8Q15mulrSatS:\n    case Opcode::I16X8Add:\n    case Opcode::I16X8AddSatS:\n    case Opcode::I16X8AddSatU:\n    case Opcode::I16X8AvgrU:\n    case Opcode::I16X8Eq:\n    case Opcode::I16X8GeS:\n    case Opcode::I16X8GeU:\n    case Opcode::I16X8GtS:\n    case Opcode::I16X8GtU:\n    case Opcode::I16X8LeS:\n    case Opcode::I16X8LeU:\n    case Opcode::I16X8LtS:\n    case Opcode::I16X8LtU:\n    case Opcode::I16X8MaxS:\n    case Opcode::I16X8MaxU:\n    case Opcode::I16X8MinS:\n    case Opcode::I16X8MinU:\n    case Opcode::I16X8Mul:\n    case Opcode::I16X8NarrowI32X4S:\n    case Opcode::I16X8NarrowI32X4U:\n    case Opcode::I16X8Ne:\n    case Opcode::I16X8Shl:\n    case Opcode::I16X8ShrS:\n    case Opcode::I16X8ShrU:\n    case Opcode::I16X8Sub:\n    case Opcode::I16X8SubSatS:\n    case Opcode::I16X8SubSatU:\n    case Opcode::I16X8ExtmulLowI8X16S:\n    case Opcode::I16X8ExtmulHighI8X16S:\n    case Opcode::I16X8ExtmulLowI8X16U:\n    case Opcode::I16X8ExtmulHighI8X16U:\n    case Opcode::I32Add:\n    case Opcode::I32And:\n    case Opcode::I32DivS:\n    case Opcode::I32DivU:\n    case Opcode::I32Eq:\n    case Opcode::I32GeS:\n    case Opcode::I32GeU:\n    case Opcode::I32GtS:\n    case Opcode::I32GtU:\n    case Opcode::I32LeS:\n    case Opcode::I32LeU:\n    case Opcode::I32LtS:\n    case Opcode::I32LtU:\n    case Opcode::I32Mul:\n    case Opcode::I32Ne:\n    case Opcode::I32Or:\n    case Opcode::I32RemS:\n    case Opcode::I32RemU:\n    case Opcode::I32Rotl:\n    case Opcode::I32Rotr:\n    case Opcode::I32Shl:\n    case Opcode::I32ShrS:\n    case Opcode::I32ShrU:\n    case Opcode::I32Sub:\n    case Opcode::I32X4Add:\n    case Opcode::I32X4Eq:\n    case Opcode::I32X4GeS:\n    case Opcode::I32X4GeU:\n    case Opcode::I32X4GtS:\n    case Opcode::I32X4GtU:\n    case Opcode::I32X4LeS:\n    case Opcode::I32X4LeU:\n    case Opcode::I32X4LtS:\n    case Opcode::I32X4LtU:\n    case Opcode::I32X4MaxS:\n    case Opcode::I32X4MaxU:\n    case Opcode::I32X4MinS:\n    case Opcode::I32X4MinU:\n    case Opcode::I32X4Mul:\n    case Opcode::I32X4Ne:\n    case Opcode::I32X4Shl:\n    case Opcode::I32X4ShrS:\n    case Opcode::I32X4ShrU:\n    case Opcode::I32X4Sub:\n    case Opcode::I32X4DotI16X8S:\n    case Opcode::I32X4ExtmulLowI16X8S:\n    case Opcode::I32X4ExtmulHighI16X8S:\n    case Opcode::I32X4ExtmulLowI16X8U:\n    case Opcode::I32X4ExtmulHighI16X8U:\n    case Opcode::I32Xor:\n    case Opcode::I64Add:\n    case Opcode::I64And:\n    case Opcode::I64DivS:\n    case Opcode::I64DivU:\n    case Opcode::I64Eq:\n    case Opcode::I64GeS:\n    case Opcode::I64GeU:\n    case Opcode::I64GtS:\n    case Opcode::I64GtU:\n    case Opcode::I64LeS:\n    case Opcode::I64LeU:\n    case Opcode::I64LtS:\n    case Opcode::I64LtU:\n    case Opcode::I64Mul:\n    case Opcode::I64Ne:\n    case Opcode::I64Or:\n    case Opcode::I64RemS:\n    case Opcode::I64RemU:\n    case Opcode::I64Rotl:\n    case Opcode::I64Rotr:\n    case Opcode::I64Shl:\n    case Opcode::I64ShrS:\n    case Opcode::I64ShrU:\n    case Opcode::I64Sub:\n    case Opcode::I64X2Add:\n    case Opcode::I64X2Shl:\n    case Opcode::I64X2ShrS:\n    case Opcode::I64X2ShrU:\n    case Opcode::I64X2Sub:\n    case Opcode::I64X2Mul:\n    case Opcode::I64X2Eq:\n    case Opcode::I64X2Ne:\n    case Opcode::I64X2LtS:\n    case Opcode::I64X2GtS:\n    case Opcode::I64X2LeS:\n    case Opcode::I64X2GeS:\n    case Opcode::I64X2ExtmulLowI32X4S:\n    case Opcode::I64X2ExtmulHighI32X4S:\n    case Opcode::I64X2ExtmulLowI32X4U:\n    case Opcode::I64X2ExtmulHighI32X4U:\n    case Opcode::I64Xor:\n    case Opcode::I8X16Add:\n    case Opcode::I8X16AddSatS:\n    case Opcode::I8X16AddSatU:\n    case Opcode::I8X16AvgrU:\n    case Opcode::I8X16Eq:\n    case Opcode::I8X16GeS:\n    case Opcode::I8X16GeU:\n    case Opcode::I8X16GtS:\n    case Opcode::I8X16GtU:\n    case Opcode::I8X16LeS:\n    case Opcode::I8X16LeU:\n    case Opcode::I8X16LtS:\n    case Opcode::I8X16LtU:\n    case Opcode::I8X16MaxS:\n    case Opcode::I8X16MaxU:\n    case Opcode::I8X16MinS:\n    case Opcode::I8X16MinU:\n    case Opcode::I8X16NarrowI16X8S:\n    case Opcode::I8X16NarrowI16X8U:\n    case Opcode::I8X16Ne:\n    case Opcode::I8X16Shl:\n    case Opcode::I8X16ShrS:\n    case Opcode::I8X16ShrU:\n    case Opcode::I8X16Sub:\n    case Opcode::I8X16SubSatS:\n    case Opcode::I8X16SubSatU:\n    case Opcode::V128And:\n    case Opcode::V128Andnot:\n    case Opcode::V128BitSelect:\n    case Opcode::V128Or:\n    case Opcode::V128Xor:\n    case Opcode::I8X16Swizzle:\n    case Opcode::I8X16RelaxedSwizzle:\n    case Opcode::F32X4RelaxedMin:\n    case Opcode::F32X4RelaxedMax:\n    case Opcode::F64X2RelaxedMin:\n    case Opcode::F64X2RelaxedMax:\n    case Opcode::I16X8RelaxedQ15mulrS:\n    case Opcode::I16X8DotI8X16I7X16S:\n      // 0 immediates, 2 operands\n      instr.kind = InstrKind::Imm_0_Op_2;\n      break;\n\n    case Opcode::I64Add128:\n    case Opcode::I64Sub128:\n    case Opcode::I64MulWideS:\n    case Opcode::I64MulWideU:\n      assert(false);  // Unsupported\n\n    case Opcode::Select:\n    case Opcode::SelectT:\n    case Opcode::F32X4RelaxedMadd:\n    case Opcode::F32X4RelaxedNmadd:\n    case Opcode::F64X2RelaxedMadd:\n    case Opcode::F64X2RelaxedNmadd:\n    case Opcode::I8X16RelaxedLaneSelect:\n    case Opcode::I16X8RelaxedLaneSelect:\n    case Opcode::I32X4RelaxedLaneSelect:\n    case Opcode::I64X2RelaxedLaneSelect:\n    case Opcode::I32X4DotI8X16I7X16AddS:\n      // 0 immediates, 3 operands\n      instr.kind = InstrKind::Imm_0_Op_3;\n      break;\n\n    case Opcode::Br:\n      // Jump target immediate, 0 operands.\n      instr.kind = InstrKind::Imm_Jump_Op_0;\n      instr.imm_u32 = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::BrIf:\n    case Opcode::BrOnNonNull:\n    case Opcode::BrOnNull:\n    case Opcode::BrTable:\n    case Opcode::InterpBrUnless:\n      // Jump target immediate, 1 operand.\n      instr.kind = InstrKind::Imm_Jump_Op_1;\n      instr.imm_u32 = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::GlobalGet:\n    case Opcode::LocalGet:\n    case Opcode::InterpLocalGetRef:\n    case Opcode::InterpGlobalGetRef:\n    case Opcode::InterpMarkRef:\n    case Opcode::MemorySize:\n    case Opcode::TableSize:\n    case Opcode::DataDrop:\n    case Opcode::ElemDrop:\n    case Opcode::RefFunc:\n    case Opcode::Throw:\n    case Opcode::Rethrow:\n      // Index immediate, 0 operands.\n      instr.kind = InstrKind::Imm_Index_Op_0;\n      instr.imm_u32 = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::GlobalSet:\n    case Opcode::LocalSet:\n    case Opcode::LocalTee:\n    case Opcode::MemoryGrow:\n    case Opcode::TableGet:\n      // Index immediate, 1 operand.\n      instr.kind = InstrKind::Imm_Index_Op_1;\n      instr.imm_u32 = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::TableSet:\n    case Opcode::TableGrow:\n      // Index immediate, 2 operands.\n      instr.kind = InstrKind::Imm_Index_Op_2;\n      instr.imm_u32 = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::MemoryFill:\n    case Opcode::TableFill:\n      // Index immediate, 3 operands.\n      instr.kind = InstrKind::Imm_Index_Op_3;\n      instr.imm_u32 = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::Call:\n    case Opcode::InterpCallImport:\n      instr.kind = InstrKind::Imm_Index_Op_N;\n      instr.imm_u32 = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::CallIndirect:\n    case Opcode::ReturnCallIndirect:\n      // Index immediate, N operands.\n      instr.kind = InstrKind::Imm_Index_Index_Op_N;\n      instr.imm_u32x2.fst = ReadAt<u32>(offset);\n      instr.imm_u32x2.snd = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::MemoryInit:\n    case Opcode::TableInit:\n    case Opcode::MemoryCopy:\n    case Opcode::TableCopy:\n      // Index + index immediates, 3 operands.\n      instr.kind = InstrKind::Imm_Index_Index_Op_3;\n      instr.imm_u32x2.fst = ReadAt<u32>(offset);\n      instr.imm_u32x2.snd = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::F32Load:\n    case Opcode::F64Load:\n    case Opcode::V128Load8X8S:\n    case Opcode::V128Load8X8U:\n    case Opcode::V128Load16Splat:\n    case Opcode::I32AtomicLoad:\n    case Opcode::I32AtomicLoad16U:\n    case Opcode::I32AtomicLoad8U:\n    case Opcode::I32Load:\n    case Opcode::I32Load16S:\n    case Opcode::I32Load16U:\n    case Opcode::I32Load8S:\n    case Opcode::I32Load8U:\n    case Opcode::V128Load16X4S:\n    case Opcode::V128Load16X4U:\n    case Opcode::V128Load32Splat:\n    case Opcode::I64AtomicLoad:\n    case Opcode::I64AtomicLoad16U:\n    case Opcode::I64AtomicLoad32U:\n    case Opcode::I64AtomicLoad8U:\n    case Opcode::I64Load:\n    case Opcode::I64Load16S:\n    case Opcode::I64Load16U:\n    case Opcode::I64Load32S:\n    case Opcode::I64Load32U:\n    case Opcode::I64Load8S:\n    case Opcode::I64Load8U:\n    case Opcode::V128Load32X2S:\n    case Opcode::V128Load32X2U:\n    case Opcode::V128Load64Splat:\n    case Opcode::V128Load8Splat:\n    case Opcode::V128Load:\n    case Opcode::V128Load32Zero:\n    case Opcode::V128Load64Zero:\n      // Index + memory offset immediates, 1 operand.\n      instr.kind = InstrKind::Imm_Index_Offset_Op_1;\n      instr.imm_u32x2.fst = ReadAt<u32>(offset);\n      instr.imm_u32x2.snd = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::MemoryAtomicNotify:\n    case Opcode::F32Store:\n    case Opcode::F64Store:\n    case Opcode::I32AtomicRmw16AddU:\n    case Opcode::I32AtomicRmw16AndU:\n    case Opcode::I32AtomicRmw16OrU:\n    case Opcode::I32AtomicRmw16SubU:\n    case Opcode::I32AtomicRmw16XchgU:\n    case Opcode::I32AtomicRmw16XorU:\n    case Opcode::I32AtomicRmw8AddU:\n    case Opcode::I32AtomicRmw8AndU:\n    case Opcode::I32AtomicRmw8OrU:\n    case Opcode::I32AtomicRmw8SubU:\n    case Opcode::I32AtomicRmw8XchgU:\n    case Opcode::I32AtomicRmw8XorU:\n    case Opcode::I32AtomicRmwAdd:\n    case Opcode::I32AtomicRmwAnd:\n    case Opcode::I32AtomicRmwOr:\n    case Opcode::I32AtomicRmwSub:\n    case Opcode::I32AtomicRmwXchg:\n    case Opcode::I32AtomicRmwXor:\n    case Opcode::I32AtomicStore:\n    case Opcode::I32AtomicStore16:\n    case Opcode::I32AtomicStore8:\n    case Opcode::I32Store:\n    case Opcode::I32Store16:\n    case Opcode::I32Store8:\n    case Opcode::I64AtomicRmw16AddU:\n    case Opcode::I64AtomicRmw16AndU:\n    case Opcode::I64AtomicRmw16OrU:\n    case Opcode::I64AtomicRmw16SubU:\n    case Opcode::I64AtomicRmw16XchgU:\n    case Opcode::I64AtomicRmw16XorU:\n    case Opcode::I64AtomicRmw32AddU:\n    case Opcode::I64AtomicRmw32AndU:\n    case Opcode::I64AtomicRmw32OrU:\n    case Opcode::I64AtomicRmw32SubU:\n    case Opcode::I64AtomicRmw32XchgU:\n    case Opcode::I64AtomicRmw32XorU:\n    case Opcode::I64AtomicRmw8AddU:\n    case Opcode::I64AtomicRmw8AndU:\n    case Opcode::I64AtomicRmw8OrU:\n    case Opcode::I64AtomicRmw8SubU:\n    case Opcode::I64AtomicRmw8XchgU:\n    case Opcode::I64AtomicRmw8XorU:\n    case Opcode::I64AtomicRmwAdd:\n    case Opcode::I64AtomicRmwAnd:\n    case Opcode::I64AtomicRmwOr:\n    case Opcode::I64AtomicRmwSub:\n    case Opcode::I64AtomicRmwXchg:\n    case Opcode::I64AtomicRmwXor:\n    case Opcode::I64AtomicStore:\n    case Opcode::I64AtomicStore16:\n    case Opcode::I64AtomicStore32:\n    case Opcode::I64AtomicStore8:\n    case Opcode::I64Store:\n    case Opcode::I64Store16:\n    case Opcode::I64Store32:\n    case Opcode::I64Store8:\n    case Opcode::V128Store:\n      // Index and memory offset immediates, 2 operands.\n      instr.kind = InstrKind::Imm_Index_Offset_Op_2;\n      instr.imm_u32x2.fst = ReadAt<u32>(offset);\n      instr.imm_u32x2.snd = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::V128Load8Lane:\n    case Opcode::V128Load16Lane:\n    case Opcode::V128Load32Lane:\n    case Opcode::V128Load64Lane:\n    case Opcode::V128Store8Lane:\n    case Opcode::V128Store16Lane:\n    case Opcode::V128Store32Lane:\n    case Opcode::V128Store64Lane:\n      // Index, memory offset, lane index immediates, 2 operands.\n      instr.kind = InstrKind::Imm_Index_Offset_Lane_Op_2;\n      instr.imm_u32x2_u8.fst = ReadAt<u32>(offset);\n      instr.imm_u32x2_u8.snd = ReadAt<u32>(offset);\n      instr.imm_u32x2_u8.idx = ReadAt<u8>(offset);\n      break;\n\n    case Opcode::I32AtomicRmw16CmpxchgU:\n    case Opcode::I32AtomicRmw8CmpxchgU:\n    case Opcode::I32AtomicRmwCmpxchg:\n    case Opcode::I64AtomicRmw16CmpxchgU:\n    case Opcode::I64AtomicRmw32CmpxchgU:\n    case Opcode::I64AtomicRmw8CmpxchgU:\n    case Opcode::I64AtomicRmwCmpxchg:\n    case Opcode::MemoryAtomicWait32:\n    case Opcode::MemoryAtomicWait64:\n      // Index and memory offset immediates, 3 operands.\n      instr.kind = InstrKind::Imm_Index_Offset_Op_3;\n      instr.imm_u32x2.fst = ReadAt<u32>(offset);\n      instr.imm_u32x2.snd = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::AtomicFence:\n    case Opcode::I32Const:\n    case Opcode::InterpAlloca:\n    case Opcode::InterpCatchDrop:\n    case Opcode::InterpAdjustFrameForReturnCall:\n      // i32/f32 immediate, 0 operands.\n      instr.kind = InstrKind::Imm_I32_Op_0;\n      instr.imm_u32 = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::I64Const:\n      // i64 immediate, 0 operands.\n      instr.kind = InstrKind::Imm_I64_Op_0;\n      instr.imm_u64 = ReadAt<u64>(offset);\n      break;\n\n    case Opcode::F32Const:\n      // f32 immediate, 0 operands.\n      instr.kind = InstrKind::Imm_F32_Op_0;\n      instr.imm_f32 = ReadAt<f32>(offset);\n      break;\n\n    case Opcode::F64Const:\n      // f64 immediate, 0 operands.\n      instr.kind = InstrKind::Imm_F64_Op_0;\n      instr.imm_f64 = ReadAt<f64>(offset);\n      break;\n\n    case Opcode::InterpDropKeep:\n      // i32 and i32 immediates, 0 operands.\n      instr.kind = InstrKind::Imm_I32_I32_Op_0;\n      instr.imm_u32x2.fst = ReadAt<u32>(offset);\n      instr.imm_u32x2.snd = ReadAt<u32>(offset);\n      break;\n\n    case Opcode::I8X16ExtractLaneS:\n    case Opcode::I8X16ExtractLaneU:\n    case Opcode::I16X8ExtractLaneS:\n    case Opcode::I16X8ExtractLaneU:\n    case Opcode::I32X4ExtractLane:\n    case Opcode::I64X2ExtractLane:\n    case Opcode::F32X4ExtractLane:\n    case Opcode::F64X2ExtractLane:\n      // u8 immediate, 1 operand.\n      instr.kind = InstrKind::Imm_I8_Op_1;\n      instr.imm_u8 = ReadAt<u8>(offset);\n      break;\n\n    case Opcode::I8X16ReplaceLane:\n    case Opcode::I16X8ReplaceLane:\n    case Opcode::I32X4ReplaceLane:\n    case Opcode::I64X2ReplaceLane:\n    case Opcode::F32X4ReplaceLane:\n    case Opcode::F64X2ReplaceLane:\n      // u8 immediate, 2 operands.\n      instr.kind = InstrKind::Imm_I8_Op_2;\n      instr.imm_u8 = ReadAt<u8>(offset);\n      break;\n\n    case Opcode::V128Const:\n      // v128 immediate, 0 operands.\n      instr.kind = InstrKind::Imm_V128_Op_0;\n      instr.imm_v128 = ReadAt<v128>(offset);\n      break;\n\n    case Opcode::I8X16Shuffle:\n      // v128 immediate, 2 operands.\n      instr.kind = InstrKind::Imm_V128_Op_2;\n      instr.imm_v128 = ReadAt<v128>(offset);\n      break;\n\n    case Opcode::Block:\n    case Opcode::CallRef:\n    case Opcode::Catch:\n    case Opcode::CatchAll:\n    case Opcode::Delegate:\n    case Opcode::Else:\n    case Opcode::End:\n    case Opcode::If:\n    case Opcode::InterpData:\n    case Opcode::Invalid:\n    case Opcode::Loop:\n    case Opcode::Try:\n    case Opcode::TryTable:\n    case Opcode::ReturnCall:\n    case Opcode::ReturnCallRef:\n      // Not used.\n      break;\n  }\n  return instr;\n}\n\nvoid Istream::Disassemble(Stream* stream) const {\n  Disassemble(stream, 0, data_.size());\n}\n\nstd::string Istream::DisassemblySource::Header(Offset offset) {\n  return StringPrintf(\"%4u\", offset);\n}\n\nstd::string Istream::DisassemblySource::Pick(Index index, Instr instr) {\n  return StringPrintf(\"%%[-%d]\", index);\n}\n\nIstream::Offset Istream::Disassemble(Stream* stream, Offset offset) const {\n  DisassemblySource source;\n  return Trace(stream, offset, &source);\n}\n\nvoid Istream::Disassemble(Stream* stream, Offset from, Offset to) const {\n  DisassemblySource source;\n  assert(from <= data_.size() && to <= data_.size() && from <= to);\n\n  Offset pc = from;\n  while (pc < to) {\n    pc = Trace(stream, pc, &source);\n  }\n}\n\nIstream::Offset Istream::Trace(Stream* stream,\n                               Offset offset,\n                               TraceSource* source) const {\n  Offset start = offset;\n  Instr instr = Read(&offset);\n  stream->Writef(\"%s| %s\", source->Header(start).c_str(), instr.op.GetName());\n\n  switch (instr.kind) {\n    case InstrKind::Imm_0_Op_0:\n      stream->Writef(\"\\n\");\n      break;\n\n    case InstrKind::Imm_0_Op_1:\n      stream->Writef(\" %s\\n\", source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_0_Op_2:\n      stream->Writef(\" %s, %s\\n\", source->Pick(2, instr).c_str(),\n                     source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_0_Op_3:\n      stream->Writef(\" %s, %s, %s\\n\", source->Pick(3, instr).c_str(),\n                     source->Pick(2, instr).c_str(),\n                     source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_Jump_Op_0:\n      stream->Writef(\" @%u\\n\", instr.imm_u32);\n      break;\n\n    case InstrKind::Imm_Jump_Op_1:\n      stream->Writef(\" @%u, %s\\n\", instr.imm_u32,\n                     source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_Index_Op_0:\n      stream->Writef(\" $%u\\n\", instr.imm_u32);\n      break;\n\n    case InstrKind::Imm_Index_Op_1:\n      stream->Writef(\" $%u, %s\\n\", instr.imm_u32,\n                     source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_Index_Op_2:\n      stream->Writef(\" $%u, %s, %s\\n\", instr.imm_u32,\n                     source->Pick(2, instr).c_str(),\n                     source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_Index_Op_3:\n      stream->Writef(\n          \" $%u, %s, %s, %s\\n\", instr.imm_u32, source->Pick(3, instr).c_str(),\n          source->Pick(2, instr).c_str(), source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_Index_Op_N:\n      stream->Writef(\" $%u\\n\", instr.imm_u32);  // TODO param/result count?\n      break;\n\n    case InstrKind::Imm_Index_Index_Op_3:\n      stream->Writef(\" $%u, $%u, %s, %s, %s\\n\", instr.imm_u32x2.fst,\n                     instr.imm_u32x2.snd, source->Pick(3, instr).c_str(),\n                     source->Pick(2, instr).c_str(),\n                     source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_Index_Index_Op_N:\n      stream->Writef(\" $%u, $%u\\n\", instr.imm_u32x2.fst,\n                     instr.imm_u32x2.snd);  // TODO param/result count?\n      break;\n\n    case InstrKind::Imm_Index_Offset_Op_1:\n      stream->Writef(\" $%u:%s+$%u\\n\", instr.imm_u32x2.fst,\n                     source->Pick(1, instr).c_str(), instr.imm_u32x2.snd);\n      break;\n\n    case InstrKind::Imm_Index_Offset_Op_2:\n      stream->Writef(\" $%u:%s+$%u, %s\\n\", instr.imm_u32x2.fst,\n                     source->Pick(2, instr).c_str(), instr.imm_u32x2.snd,\n                     source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_Index_Offset_Op_3:\n      stream->Writef(\" $%u:%s+$%u, %s, %s\\n\", instr.imm_u32x2.fst,\n                     source->Pick(3, instr).c_str(), instr.imm_u32x2.snd,\n                     source->Pick(2, instr).c_str(),\n                     source->Pick(1, instr).c_str());\n      break;\n\n    case InstrKind::Imm_Index_Offset_Lane_Op_2:\n      stream->Writef(\" $%u:%s+$%u, %s (Lane imm: $%u)\\n\",\n                     instr.imm_u32x2_u8.fst, source->Pick(2, instr).c_str(),\n                     instr.imm_u32x2_u8.snd, source->Pick(1, instr).c_str(),\n                     instr.imm_u32x2_u8.idx);\n      break;\n\n    case InstrKind::Imm_I32_Op_0:\n      stream->Writef(\" %u\\n\", instr.imm_u32);\n      break;\n\n    case InstrKind::Imm_I64_Op_0:\n      stream->Writef(\" %\" PRIu64 \"\\n\", instr.imm_u64);\n      break;\n\n    case InstrKind::Imm_F32_Op_0:\n      stream->Writef(\" %g\\n\", instr.imm_f32);\n      break;\n\n    case InstrKind::Imm_F64_Op_0:\n      stream->Writef(\" %g\\n\", instr.imm_f64);\n      break;\n\n    case InstrKind::Imm_I32_I32_Op_0:\n      stream->Writef(\" $%u $%u\\n\", instr.imm_u32x2.fst, instr.imm_u32x2.snd);\n      break;\n\n    case InstrKind::Imm_I8_Op_1:\n      // TODO: cleanup\n      stream->Writef(\" %s : (Lane imm: %u)\\n\", source->Pick(1, instr).c_str(),\n                     instr.imm_u8);\n      break;\n\n    case InstrKind::Imm_I8_Op_2:\n      // TODO: cleanup\n      stream->Writef(\" %s, %s : (Lane imm: $%u)\\n\",\n                     source->Pick(2, instr).c_str(),\n                     source->Pick(1, instr).c_str(), instr.imm_u8);\n      break;\n\n    case InstrKind::Imm_V128_Op_0:\n      stream->Writef(\" i32x4 0x%08x 0x%08x 0x%08x 0x%08x\\n\",\n                     instr.imm_v128.u32(0), instr.imm_v128.u32(1),\n                     instr.imm_v128.u32(2), instr.imm_v128.u32(3));\n      break;\n\n    case InstrKind::Imm_V128_Op_2:\n      // TODO: cleanup\n      stream->Writef(\n          \" %s, %s : (Lane imm: i32x4 0x%08x 0x%08x 0x%08x 0x%08x )\\n\",\n          source->Pick(2, instr).c_str(), source->Pick(1, instr).c_str(),\n          instr.imm_v128.u32(0), instr.imm_v128.u32(1), instr.imm_v128.u32(2),\n          instr.imm_v128.u32(3));\n      break;\n  }\n  return offset;\n}\n\n}  // namespace interp\n}  // namespace wabt\n"
  },
  {
    "path": "src/interp/wasi_api.def",
    "content": "WASI_FUNC(proc_exit)\nWASI_FUNC(fd_read)\nWASI_FUNC(fd_pread)\nWASI_FUNC(fd_write)\nWASI_FUNC(fd_pwrite)\nWASI_FUNC(fd_close)\nWASI_FUNC(fd_seek)\nWASI_FUNC(fd_prestat_get)\nWASI_FUNC(fd_prestat_dir_name)\nWASI_FUNC(fd_fdstat_get)\nWASI_FUNC(fd_fdstat_set_flags)\nWASI_FUNC(fd_filestat_get)\nWASI_FUNC(fd_readdir)\nWASI_FUNC(environ_sizes_get)\nWASI_FUNC(environ_get)\nWASI_FUNC(args_sizes_get)\nWASI_FUNC(args_get)\nWASI_FUNC(path_open)\nWASI_FUNC(path_filestat_get)\nWASI_FUNC(path_symlink)\nWASI_FUNC(path_unlink_file)\nWASI_FUNC(path_remove_directory)\nWASI_FUNC(path_create_directory)\nWASI_FUNC(path_readlink)\nWASI_FUNC(path_rename)\nWASI_FUNC(clock_time_get)\nWASI_FUNC(poll_oneoff)\nWASI_FUNC(random_get)\n"
  },
  {
    "path": "src/ir-util.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/ir-util.h\"\n\n#include <algorithm>\n#include <array>\n#include <cassert>\n#include <cinttypes>\n#include <cstdarg>\n#include <cstdio>\n#include <iterator>\n#include <map>\n#include <string>\n#include <vector>\n\n#include \"wabt/cast.h\"\n#include \"wabt/common.h\"\n#include \"wabt/expr-visitor.h\"\n#include \"wabt/ir-util.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/stream.h\"\n\n#define WABT_TRACING 0\n#include \"wabt/tracing.h\"\n\nusing namespace wabt;\n\nconst Label* ModuleContext::GetLabel(const Var& var) const {\n  if (var.is_name()) {\n    for (Index i = GetLabelStackSize(); i > 0; --i) {\n      auto label = &label_stack_[i - 1];\n      if (label->name == var.name()) {\n        return label;\n      }\n    }\n  } else if (var.index() < GetLabelStackSize()) {\n    auto label = &label_stack_[GetLabelStackSize() - var.index() - 1];\n    return label;\n  }\n  return nullptr;\n}\n\nIndex ModuleContext::GetLabelArity(const Var& var) const {\n  auto label = GetLabel(var);\n  if (!label) {\n    return 0;\n  }\n\n  return label->label_type == LabelType::Loop ? label->param_types.size()\n                                              : label->result_types.size();\n}\n\nIndex ModuleContext::GetFuncParamCount(const Var& var) const {\n  const Func* func = module.GetFunc(var);\n  return func ? func->GetNumParams() : 0;\n}\n\nIndex ModuleContext::GetFuncResultCount(const Var& var) const {\n  const Func* func = module.GetFunc(var);\n  return func ? func->GetNumResults() : 0;\n}\n\nvoid ModuleContext::BeginBlock(LabelType label_type, const Block& block) {\n  label_stack_.emplace_back(label_type, block.label, block.decl.sig.param_types,\n                            block.decl.sig.result_types);\n}\n\nvoid ModuleContext::EndBlock() {\n  label_stack_.pop_back();\n}\n\nvoid ModuleContext::BeginFunc(const Func& func) {\n  label_stack_.clear();\n  label_stack_.emplace_back(LabelType::Func, std::string(), TypeVector(),\n                            func.decl.sig.result_types);\n  current_func_ = &func;\n}\n\nvoid ModuleContext::EndFunc() {\n  current_func_ = nullptr;\n}\n\nModuleContext::Arities ModuleContext::GetExprArity(const Expr& expr) const {\n  switch (expr.type()) {\n    case ExprType::AtomicNotify:\n    case ExprType::AtomicRmw:\n    case ExprType::Binary:\n    case ExprType::Compare:\n    case ExprType::TableGrow:\n      return {2, 1};\n\n    case ExprType::Quaternary:\n      return {4, 2};\n\n    case ExprType::AtomicStore:\n    case ExprType::Store:\n    case ExprType::TableSet:\n      return {2, 0};\n\n    case ExprType::Block:\n      return {0, cast<BlockExpr>(&expr)->block.decl.sig.GetNumResults()};\n\n    case ExprType::Br:\n      return {GetLabelArity(cast<BrExpr>(&expr)->var), 1, true};\n\n    case ExprType::BrIf: {\n      Index arity = GetLabelArity(cast<BrIfExpr>(&expr)->var);\n      return {arity + 1, arity};\n    }\n\n    case ExprType::BrOnNonNull: {\n      Index arity = GetLabelArity(cast<BrOnNonNullExpr>(&expr)->var);\n      return {arity + 1, arity};\n    }\n\n    case ExprType::BrOnNull: {\n      Index arity = GetLabelArity(cast<BrOnNullExpr>(&expr)->var);\n      return {arity + 1, arity};\n    }\n\n    case ExprType::BrTable:\n      return {GetLabelArity(cast<BrTableExpr>(&expr)->default_target) + 1, 1,\n              true};\n\n    case ExprType::Call: {\n      const Var& var = cast<CallExpr>(&expr)->var;\n      return {GetFuncParamCount(var), GetFuncResultCount(var)};\n    }\n\n    case ExprType::ReturnCall: {\n      const Var& var = cast<ReturnCallExpr>(&expr)->var;\n      return {GetFuncParamCount(var), GetFuncResultCount(var), true};\n    }\n\n    case ExprType::CallIndirect: {\n      const auto* ci_expr = cast<CallIndirectExpr>(&expr);\n      return {ci_expr->decl.GetNumParams() + 1, ci_expr->decl.GetNumResults()};\n    }\n\n    case ExprType::CallRef: {\n      const Var& var = cast<CallRefExpr>(&expr)->sig_type;\n      return {GetFuncParamCount(var) + 1, GetFuncResultCount(var)};\n    }\n\n    case ExprType::ReturnCallIndirect: {\n      const auto* rci_expr = cast<ReturnCallIndirectExpr>(&expr);\n      return {rci_expr->decl.GetNumParams() + 1, rci_expr->decl.GetNumResults(),\n              true};\n    }\n\n    case ExprType::ReturnCallRef: {\n      const Var& var = cast<CallRefExpr>(&expr)->sig_type;\n      return {GetFuncParamCount(var) + 1, GetFuncResultCount(var), true};\n    }\n\n    case ExprType::Const:\n    case ExprType::GlobalGet:\n    case ExprType::LocalGet:\n    case ExprType::MemorySize:\n    case ExprType::TableSize:\n    case ExprType::RefNull:\n    case ExprType::RefFunc:\n      return {0, 1};\n\n    case ExprType::Unreachable:\n      return {0, 1, true};\n\n    case ExprType::DataDrop:\n    case ExprType::ElemDrop:\n    case ExprType::AtomicFence:\n    case ExprType::CodeMetadata:\n      return {0, 0};\n\n    case ExprType::MemoryInit:\n    case ExprType::TableInit:\n    case ExprType::MemoryFill:\n    case ExprType::MemoryCopy:\n    case ExprType::TableCopy:\n    case ExprType::TableFill:\n      return {3, 0};\n\n    case ExprType::AtomicLoad:\n    case ExprType::Convert:\n    case ExprType::Load:\n    case ExprType::LocalTee:\n    case ExprType::MemoryGrow:\n    case ExprType::Unary:\n    case ExprType::TableGet:\n    case ExprType::RefIsNull:\n    case ExprType::LoadSplat:\n    case ExprType::LoadZero:\n    case ExprType::RefAsNonNull:\n      return {1, 1};\n\n    case ExprType::Drop:\n    case ExprType::GlobalSet:\n    case ExprType::LocalSet:\n      return {1, 0};\n\n    case ExprType::If:\n      return {1, cast<IfExpr>(&expr)->true_.decl.sig.GetNumResults()};\n\n    case ExprType::Loop:\n      return {0, cast<LoopExpr>(&expr)->block.decl.sig.GetNumResults()};\n\n    case ExprType::Nop:\n      return {0, 0};\n\n    case ExprType::Return:\n      return {static_cast<Index>(current_func_->decl.sig.result_types.size()),\n              1, true};\n\n    case ExprType::Rethrow:\n      return {0, 0, true};\n\n    case ExprType::AtomicRmwCmpxchg:\n    case ExprType::AtomicWait:\n    case ExprType::Select:\n      return {3, 1};\n\n    case ExprType::Throw: {\n      auto throw_ = cast<ThrowExpr>(&expr);\n      Index operand_count = 0;\n      if (Tag* tag = module.GetTag(throw_->var)) {\n        operand_count = tag->decl.sig.param_types.size();\n      }\n      return {operand_count, 0, true};\n    }\n\n    case ExprType::ThrowRef: {\n      return {1, 1, true};\n    }\n\n    case ExprType::Try:\n      return {0, cast<TryExpr>(&expr)->block.decl.sig.GetNumResults()};\n\n    case ExprType::TryTable:\n      return {0, cast<TryTableExpr>(&expr)->block.decl.sig.GetNumResults()};\n\n    case ExprType::Ternary:\n      return {3, 1};\n\n    case ExprType::SimdLaneOp: {\n      const Opcode opcode = cast<SimdLaneOpExpr>(&expr)->opcode;\n      switch (opcode) {\n        case Opcode::I8X16ExtractLaneS:\n        case Opcode::I8X16ExtractLaneU:\n        case Opcode::I16X8ExtractLaneS:\n        case Opcode::I16X8ExtractLaneU:\n        case Opcode::I32X4ExtractLane:\n        case Opcode::I64X2ExtractLane:\n        case Opcode::F32X4ExtractLane:\n        case Opcode::F64X2ExtractLane:\n          return {1, 1};\n\n        case Opcode::I8X16ReplaceLane:\n        case Opcode::I16X8ReplaceLane:\n        case Opcode::I32X4ReplaceLane:\n        case Opcode::I64X2ReplaceLane:\n        case Opcode::F32X4ReplaceLane:\n        case Opcode::F64X2ReplaceLane:\n          return {2, 1};\n\n        default:\n          fprintf(stderr, \"Invalid Opcode for expr type: %s\\n\",\n                  GetExprTypeName(expr));\n          assert(0);\n          return {0, 0};\n      }\n    }\n\n    case ExprType::SimdLoadLane:\n    case ExprType::SimdStoreLane: {\n      return {2, 1};\n    }\n\n    case ExprType::SimdShuffleOp:\n      return {2, 1};\n  }\n\n  WABT_UNREACHABLE;\n}\n"
  },
  {
    "path": "src/ir.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/ir.h\"\n\n#include <cassert>\n#include <cstddef>\n#include <numeric>\n\n#include \"wabt/cast.h\"\n\nnamespace {\n\nconst char* ExprTypeName[] = {\n    \"AtomicLoad\",\n    \"AtomicRmw\",\n    \"AtomicRmwCmpxchg\",\n    \"AtomicStore\",\n    \"AtomicNotify\",\n    \"AtomicFence\",\n    \"AtomicWait\",\n    \"Binary\",\n    \"Quaternary\",\n    \"Block\",\n    \"Br\",\n    \"BrIf\",\n    \"BrOnNonNull\",\n    \"BrOnNull\",\n    \"BrTable\",\n    \"Call\",\n    \"CallIndirect\",\n    \"CallRef\",\n    \"CodeMetadata\",\n    \"Compare\",\n    \"Const\",\n    \"Convert\",\n    \"Drop\",\n    \"GlobalGet\",\n    \"GlobalSet\",\n    \"If\",\n    \"Load\",\n    \"LocalGet\",\n    \"LocalSet\",\n    \"LocalTee\",\n    \"Loop\",\n    \"MemoryCopy\",\n    \"DataDrop\",\n    \"MemoryFill\",\n    \"MemoryGrow\",\n    \"MemoryInit\",\n    \"MemorySize\",\n    \"Nop\",\n    \"RefAsNonNull\",\n    \"RefIsNull\",\n    \"RefFunc\",\n    \"RefNull\",\n    \"Rethrow\",\n    \"Return\",\n    \"ReturnCall\",\n    \"ReturnCallIndirect\",\n    \"ReturnCallRef\",\n    \"Select\",\n    \"SimdLaneOp\",\n    \"SimdLoadLane\",\n    \"SimdStoreLane\",\n    \"SimdShuffleOp\",\n    \"LoadSplat\",\n    \"LoadZero\",\n    \"Store\",\n    \"TableCopy\",\n    \"ElemDrop\",\n    \"TableInit\",\n    \"TableGet\",\n    \"TableGrow\",\n    \"TableSize\",\n    \"TableSet\",\n    \"TableFill\",\n    \"Ternary\",\n    \"Throw\",\n    \"ThrowRef\",\n    \"Try\",\n    \"TryTable\",\n    \"Unary\",\n    \"Unreachable\",\n};\n\n}  // end of anonymous namespace\n\nnamespace wabt {\n\nconst char* GetExprTypeName(ExprType type) {\n  static_assert(WABT_ENUM_COUNT(ExprType) == WABT_ARRAY_SIZE(ExprTypeName),\n                \"Malformed ExprTypeName array\");\n  return ExprTypeName[size_t(type)];\n}\n\nconst char* GetExprTypeName(const Expr& expr) {\n  return GetExprTypeName(expr.type());\n}\n\nbool FuncSignature::operator==(const FuncSignature& rhs) const {\n  if (param_types.size() != rhs.param_types.size() ||\n      result_types.size() != rhs.result_types.size()) {\n    return false;\n  }\n\n  if (param_types.size() > 0 &&\n      memcmp(param_types.data(), rhs.param_types.data(),\n             param_types.size() * sizeof(Type)) != 0) {\n    return false;\n  }\n\n  if (result_types.size() > 0 &&\n      memcmp(result_types.data(), rhs.result_types.data(),\n             result_types.size() * sizeof(Type)) != 0) {\n    return false;\n  }\n\n  return true;\n}\n\nconst Export* Module::GetExport(std::string_view name) const {\n  Index index = export_bindings.FindIndex(name);\n  if (index >= exports.size()) {\n    return nullptr;\n  }\n  return exports[index];\n}\n\nIndex Module::GetFuncIndex(const Var& var) const {\n  return func_bindings.FindIndex(var);\n}\n\nIndex Module::GetGlobalIndex(const Var& var) const {\n  return global_bindings.FindIndex(var);\n}\n\nIndex Module::GetTableIndex(const Var& var) const {\n  return table_bindings.FindIndex(var);\n}\n\nIndex Module::GetMemoryIndex(const Var& var) const {\n  return memory_bindings.FindIndex(var);\n}\n\nIndex Module::GetFuncTypeIndex(const Var& var) const {\n  return type_bindings.FindIndex(var);\n}\n\nIndex Module::GetTagIndex(const Var& var) const {\n  return tag_bindings.FindIndex(var);\n}\n\nIndex Module::GetDataSegmentIndex(const Var& var) const {\n  return data_segment_bindings.FindIndex(var);\n}\n\nIndex Module::GetElemSegmentIndex(const Var& var) const {\n  return elem_segment_bindings.FindIndex(var);\n}\n\nbool Module::IsImport(ExternalKind kind, const Var& var) const {\n  switch (kind) {\n    case ExternalKind::Func:\n      return GetFuncIndex(var) < num_func_imports;\n\n    case ExternalKind::Global:\n      return GetGlobalIndex(var) < num_global_imports;\n\n    case ExternalKind::Memory:\n      return GetMemoryIndex(var) < num_memory_imports;\n\n    case ExternalKind::Table:\n      return GetTableIndex(var) < num_table_imports;\n\n    case ExternalKind::Tag:\n      return GetTagIndex(var) < num_tag_imports;\n\n    default:\n      return false;\n  }\n}\n\nvoid LocalTypes::Set(const TypeVector& types) {\n  decls_.clear();\n  if (types.empty()) {\n    return;\n  }\n\n  Type type = types[0];\n  Index count = 1;\n  for (Index i = 1; i < types.size(); ++i) {\n    if (types[i] != type) {\n      decls_.emplace_back(type, count);\n      type = types[i];\n      count = 1;\n    } else {\n      ++count;\n    }\n  }\n  decls_.emplace_back(type, count);\n}\n\nIndex LocalTypes::size() const {\n  return std::accumulate(\n      decls_.begin(), decls_.end(), 0,\n      [](Index sum, const Decl& decl) { return sum + decl.second; });\n}\n\nType LocalTypes::operator[](Index i) const {\n  Index count = 0;\n  for (auto decl : decls_) {\n    if (i < count + decl.second) {\n      return decl.first;\n    }\n    count += decl.second;\n  }\n  assert(i < count);\n  return Type::Any;\n}\n\nType Func::GetLocalType(Index index) const {\n  Index num_params = decl.GetNumParams();\n  if (index < num_params) {\n    return GetParamType(index);\n  } else {\n    index -= num_params;\n    assert(index < local_types.size());\n    return local_types[index];\n  }\n}\n\nType Func::GetLocalType(const Var& var) const {\n  return GetLocalType(GetLocalIndex(var));\n}\n\nIndex Func::GetLocalIndex(const Var& var) const {\n  if (var.is_index()) {\n    return var.index();\n  }\n  return bindings.FindIndex(var);\n}\n\nconst Func* Module::GetFunc(const Var& var) const {\n  return const_cast<Module*>(this)->GetFunc(var);\n}\n\nFunc* Module::GetFunc(const Var& var) {\n  Index index = func_bindings.FindIndex(var);\n  if (index >= funcs.size()) {\n    return nullptr;\n  }\n  return funcs[index];\n}\n\nconst Global* Module::GetGlobal(const Var& var) const {\n  return const_cast<Module*>(this)->GetGlobal(var);\n}\n\nGlobal* Module::GetGlobal(const Var& var) {\n  Index index = global_bindings.FindIndex(var);\n  if (index >= globals.size()) {\n    return nullptr;\n  }\n  return globals[index];\n}\n\nconst Table* Module::GetTable(const Var& var) const {\n  return const_cast<Module*>(this)->GetTable(var);\n}\n\nTable* Module::GetTable(const Var& var) {\n  Index index = table_bindings.FindIndex(var);\n  if (index >= tables.size()) {\n    return nullptr;\n  }\n  return tables[index];\n}\n\nconst Memory* Module::GetMemory(const Var& var) const {\n  return const_cast<Module*>(this)->GetMemory(var);\n}\n\nMemory* Module::GetMemory(const Var& var) {\n  Index index = memory_bindings.FindIndex(var);\n  if (index >= memories.size()) {\n    return nullptr;\n  }\n  return memories[index];\n}\n\nTag* Module::GetTag(const Var& var) const {\n  Index index = GetTagIndex(var);\n  if (index >= tags.size()) {\n    return nullptr;\n  }\n  return tags[index];\n}\n\nconst DataSegment* Module::GetDataSegment(const Var& var) const {\n  return const_cast<Module*>(this)->GetDataSegment(var);\n}\n\nDataSegment* Module::GetDataSegment(const Var& var) {\n  Index index = data_segment_bindings.FindIndex(var);\n  if (index >= data_segments.size()) {\n    return nullptr;\n  }\n  return data_segments[index];\n}\n\nconst ElemSegment* Module::GetElemSegment(const Var& var) const {\n  return const_cast<Module*>(this)->GetElemSegment(var);\n}\n\nElemSegment* Module::GetElemSegment(const Var& var) {\n  Index index = elem_segment_bindings.FindIndex(var);\n  if (index >= elem_segments.size()) {\n    return nullptr;\n  }\n  return elem_segments[index];\n}\n\nconst FuncType* Module::GetFuncType(const Var& var) const {\n  return const_cast<Module*>(this)->GetFuncType(var);\n}\n\nFuncType* Module::GetFuncType(const Var& var) {\n  Index index = type_bindings.FindIndex(var);\n  if (index >= types.size()) {\n    return nullptr;\n  }\n  return dyn_cast<FuncType>(types[index]);\n}\n\nIndex Module::GetFuncTypeIndex(const FuncSignature& sig) const {\n  for (size_t i = 0; i < types.size(); ++i) {\n    if (auto* func_type = dyn_cast<FuncType>(types[i])) {\n      if (func_type->sig == sig) {\n        return i;\n      }\n    }\n  }\n  return kInvalidIndex;\n}\n\nIndex Module::GetFuncTypeIndex(const FuncDeclaration& decl) const {\n  if (decl.has_func_type) {\n    return GetFuncTypeIndex(decl.type_var);\n  } else {\n    return GetFuncTypeIndex(decl.sig);\n  }\n}\n\nvoid Module::AppendField(std::unique_ptr<DataSegmentModuleField> field) {\n  DataSegment& data_segment = field->data_segment;\n  if (!data_segment.name.empty()) {\n    data_segment_bindings.emplace(data_segment.name,\n                                  Binding(field->loc, data_segments.size()));\n  }\n  data_segments.push_back(&data_segment);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<ElemSegmentModuleField> field) {\n  ElemSegment& elem_segment = field->elem_segment;\n  if (!elem_segment.name.empty()) {\n    elem_segment_bindings.emplace(elem_segment.name,\n                                  Binding(field->loc, elem_segments.size()));\n  }\n  elem_segments.push_back(&elem_segment);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<TagModuleField> field) {\n  Tag& tag = field->tag;\n  if (!tag.name.empty()) {\n    tag_bindings.emplace(tag.name, Binding(field->loc, tags.size()));\n  }\n  tags.push_back(&tag);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<ExportModuleField> field) {\n  // Exported names are allowed to be empty.\n  Export& export_ = field->export_;\n  export_bindings.emplace(export_.name, Binding(field->loc, exports.size()));\n  exports.push_back(&export_);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<FuncModuleField> field) {\n  Func& func = field->func;\n  if (!func.name.empty()) {\n    func_bindings.emplace(func.name, Binding(field->loc, funcs.size()));\n  }\n  funcs.push_back(&func);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<TypeModuleField> field) {\n  TypeEntry& type = *field->type;\n  if (!type.name.empty()) {\n    type_bindings.emplace(type.name, Binding(field->loc, types.size()));\n  }\n  types.push_back(&type);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<GlobalModuleField> field) {\n  Global& global = field->global;\n  if (!global.name.empty()) {\n    global_bindings.emplace(global.name, Binding(field->loc, globals.size()));\n  }\n  globals.push_back(&global);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<ImportModuleField> field) {\n  Import* import = field->import.get();\n  const std::string* name = nullptr;\n  BindingHash* bindings = nullptr;\n  Index index = kInvalidIndex;\n\n  switch (import->kind()) {\n    case ExternalKind::Func: {\n      Func& func = cast<FuncImport>(import)->func;\n      name = &func.name;\n      bindings = &func_bindings;\n      index = funcs.size();\n      funcs.push_back(&func);\n      ++num_func_imports;\n      break;\n    }\n\n    case ExternalKind::Table: {\n      Table& table = cast<TableImport>(import)->table;\n      name = &table.name;\n      bindings = &table_bindings;\n      index = tables.size();\n      tables.push_back(&table);\n      ++num_table_imports;\n      break;\n    }\n\n    case ExternalKind::Memory: {\n      Memory& memory = cast<MemoryImport>(import)->memory;\n      name = &memory.name;\n      bindings = &memory_bindings;\n      index = memories.size();\n      memories.push_back(&memory);\n      ++num_memory_imports;\n      break;\n    }\n\n    case ExternalKind::Global: {\n      Global& global = cast<GlobalImport>(import)->global;\n      name = &global.name;\n      bindings = &global_bindings;\n      index = globals.size();\n      globals.push_back(&global);\n      ++num_global_imports;\n      break;\n    }\n\n    case ExternalKind::Tag: {\n      Tag& tag = cast<TagImport>(import)->tag;\n      name = &tag.name;\n      bindings = &tag_bindings;\n      index = tags.size();\n      tags.push_back(&tag);\n      ++num_tag_imports;\n      break;\n    }\n  }\n\n  assert(name && bindings && index != kInvalidIndex);\n  if (!name->empty()) {\n    bindings->emplace(*name, Binding(field->loc, index));\n  }\n  imports.push_back(import);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<MemoryModuleField> field) {\n  Memory& memory = field->memory;\n  if (!memory.name.empty()) {\n    memory_bindings.emplace(memory.name, Binding(field->loc, memories.size()));\n  }\n  memories.push_back(&memory);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<StartModuleField> field) {\n  starts.push_back(&field->start);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<TableModuleField> field) {\n  Table& table = field->table;\n  if (!table.name.empty()) {\n    table_bindings.emplace(table.name, Binding(field->loc, tables.size()));\n  }\n  tables.push_back(&table);\n  fields.push_back(std::move(field));\n}\n\nvoid Module::AppendField(std::unique_ptr<ModuleField> field) {\n  switch (field->type()) {\n    case ModuleFieldType::Func:\n      AppendField(cast<FuncModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::Global:\n      AppendField(cast<GlobalModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::Import:\n      AppendField(cast<ImportModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::Export:\n      AppendField(cast<ExportModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::Type:\n      AppendField(cast<TypeModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::Table:\n      AppendField(cast<TableModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::ElemSegment:\n      AppendField(cast<ElemSegmentModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::Memory:\n      AppendField(cast<MemoryModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::DataSegment:\n      AppendField(cast<DataSegmentModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::Start:\n      AppendField(cast<StartModuleField>(std::move(field)));\n      break;\n\n    case ModuleFieldType::Tag:\n      AppendField(cast<TagModuleField>(std::move(field)));\n      break;\n  }\n}\n\nvoid Module::AppendFields(ModuleFieldList* fields) {\n  while (!fields->empty())\n    AppendField(std::unique_ptr<ModuleField>(fields->extract_front()));\n}\n\nconst Module* Script::GetFirstModule() const {\n  return const_cast<Script*>(this)->GetFirstModule();\n}\n\nModule* Script::GetFirstModule() {\n  for (const std::unique_ptr<Command>& command : commands) {\n    if (auto* module_command = dyn_cast<ModuleCommand>(command.get())) {\n      return &module_command->module;\n    }\n  }\n  return nullptr;\n}\n\nconst Module* Script::GetModule(const Var& var) const {\n  Index index = module_bindings.FindIndex(var);\n  if (index >= commands.size()) {\n    return nullptr;\n  }\n  auto* command = commands[index].get();\n  if (isa<ModuleCommand>(command)) {\n    return &cast<ModuleCommand>(command)->module;\n  } else if (isa<ScriptModuleCommand>(command)) {\n    return &cast<ScriptModuleCommand>(command)->module;\n  }\n  return nullptr;\n}\n\nvoid MakeTypeBindingReverseMapping(\n    size_t num_types,\n    const BindingHash& bindings,\n    std::vector<std::string>* out_reverse_mapping) {\n  out_reverse_mapping->clear();\n  out_reverse_mapping->resize(num_types);\n  for (const auto& [name, binding] : bindings) {\n    assert(static_cast<size_t>(binding.index) < out_reverse_mapping->size());\n    (*out_reverse_mapping)[binding.index] = name;\n  }\n}\n\nVar::Var() : Var(kInvalidIndex, Location()) {}\n\nVar::Var(Index index, const Location& loc)\n    : loc(loc), type_(VarType::Index), opt_type_(0), index_(index) {}\n\nVar::Var(std::string_view name, const Location& loc)\n    : loc(loc), type_(VarType::Name), opt_type_(0), name_(name) {}\n\nVar::Var(Type type, const Location& loc)\n    : loc(loc), type_(VarType::Index), index_(0) {\n  assert(static_cast<int32_t>(type) < 0 &&\n         static_cast<int32_t>(type) >= INT16_MIN);\n  opt_type_ = static_cast<int16_t>(type);\n\n  if (type.IsReferenceWithIndex()) {\n    index_ = type.GetReferenceIndex();\n  } else if (type.IsNonTypedRef()) {\n    index_ = type.IsNullableNonTypedRef() ? Type::ReferenceOrNull\n                                          : Type::ReferenceNonNull;\n  }\n}\n\nVar::Var(Var&& rhs) : Var() {\n  *this = std::move(rhs);\n}\n\nVar::Var(const Var& rhs) : Var() {\n  *this = rhs;\n}\n\nVar& Var::operator=(Var&& rhs) {\n  loc = rhs.loc;\n  opt_type_ = rhs.opt_type_;\n  if (rhs.is_index()) {\n    set_index(rhs.index_);\n  } else {\n    set_name(rhs.name_);\n  }\n  return *this;\n}\n\nVar& Var::operator=(const Var& rhs) {\n  loc = rhs.loc;\n  opt_type_ = rhs.opt_type_;\n  if (rhs.is_index()) {\n    set_index(rhs.index_);\n  } else {\n    set_name(rhs.name_);\n  }\n  return *this;\n}\n\nVar::~Var() {\n  Destroy();\n}\n\nvoid Var::set_index(Index index) {\n  Destroy();\n  type_ = VarType::Index;\n  index_ = index;\n}\n\nvoid Var::set_name(std::string&& name) {\n  Destroy();\n  type_ = VarType::Name;\n  Construct(name_, std::move(name));\n}\n\nvoid Var::set_name(std::string_view name) {\n  set_name(std::string(name));\n}\n\nvoid Var::set_opt_type(Type::Enum type) {\n  assert(static_cast<int32_t>(type) < 0 &&\n         static_cast<int32_t>(type) >= INT16_MIN);\n  opt_type_ = static_cast<int16_t>(type);\n}\n\nType Var::to_type() const {\n  Type::Enum type = static_cast<Type::Enum>(opt_type_);\n\n  if (Type::EnumIsReferenceWithIndex(type) || Type::EnumIsNonTypedRef(type)) {\n    return Type(type, index());\n  }\n\n  return Type(type);\n}\n\nvoid Var::Destroy() {\n  if (is_name()) {\n    Destruct(name_);\n  }\n}\n\nuint8_t ElemSegment::GetFlags(const Module* module,\n                              bool function_references_enabled) const {\n  uint8_t flags = 0;\n\n  switch (kind) {\n    case SegmentKind::Active: {\n      Index table_index = module->GetTableIndex(table_var);\n      if (elem_type != Type::FuncRef || table_index != 0) {\n        flags |= SegExplicitIndex;\n      }\n      break;\n    }\n\n    case SegmentKind::Passive:\n      flags |= SegPassive;\n      break;\n\n    case SegmentKind::Declared:\n      flags |= SegDeclared;\n      break;\n  }\n\n  if (function_references_enabled &&\n      elem_type != Type(Type::FuncRef, Type::ReferenceNonNull)) {\n    flags |= SegUseElemExprs;\n  } else {\n    bool all_ref_func =\n        elem_type == Type::FuncRef &&\n        std::all_of(elem_exprs.begin(), elem_exprs.end(),\n                    [](const ExprList& elem_expr) {\n                      return elem_expr.front().type() == ExprType::RefFunc;\n                    });\n\n    if (!all_ref_func) {\n      flags |= SegUseElemExprs;\n    }\n  }\n\n  return flags;\n}\n\nuint8_t DataSegment::GetFlags(const Module* module) const {\n  uint8_t flags = 0;\n\n  if (kind == SegmentKind::Passive) {\n    flags |= SegPassive;\n  }\n\n  Index memory_index = module->GetMemoryIndex(memory_var);\n  if (memory_index != 0) {\n    flags |= SegExplicitIndex;\n  }\n\n  return flags;\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/leb128.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/leb128.h\"\n\n#include <type_traits>\n\n#include \"wabt/stream.h\"\n\n#define MAX_U32_LEB128_BYTES 5\n#define MAX_U64_LEB128_BYTES 10\n\nnamespace wabt {\n\nOffset U32Leb128Length(uint32_t value) {\n  uint32_t size = 0;\n  do {\n    value >>= 7;\n    size++;\n  } while (value != 0);\n  return size;\n}\n\n#define LEB128_LOOP_UNTIL(end_cond) \\\n  do {                              \\\n    uint8_t byte = value & 0x7f;    \\\n    value >>= 7;                    \\\n    if (end_cond) {                 \\\n      data[length++] = byte;        \\\n      break;                        \\\n    } else {                        \\\n      data[length++] = byte | 0x80; \\\n    }                               \\\n  } while (1)\n\nOffset WriteFixedU32Leb128At(Stream* stream,\n                             Offset offset,\n                             uint32_t value,\n                             const char* desc) {\n  uint8_t data[MAX_U32_LEB128_BYTES];\n  Offset length =\n      WriteFixedU32Leb128Raw(data, data + MAX_U32_LEB128_BYTES, value);\n  stream->WriteDataAt(offset, data, length, desc);\n  return length;\n}\n\nvoid WriteU32Leb128(Stream* stream, uint32_t value, const char* desc) {\n  uint8_t data[MAX_U32_LEB128_BYTES];\n  Offset length = 0;\n  LEB128_LOOP_UNTIL(value == 0);\n  stream->WriteData(data, length, desc);\n}\n\nvoid WriteFixedU32Leb128(Stream* stream, uint32_t value, const char* desc) {\n  uint8_t data[MAX_U32_LEB128_BYTES];\n  Offset length =\n      WriteFixedU32Leb128Raw(data, data + MAX_U32_LEB128_BYTES, value);\n  stream->WriteData(data, length, desc);\n}\n\n// returns the length of the leb128.\nOffset WriteU32Leb128At(Stream* stream,\n                        Offset offset,\n                        uint32_t value,\n                        const char* desc) {\n  uint8_t data[MAX_U32_LEB128_BYTES];\n  Offset length = 0;\n  LEB128_LOOP_UNTIL(value == 0);\n  stream->WriteDataAt(offset, data, length, desc);\n  return length;\n}\n\nOffset WriteU32Leb128Raw(uint8_t* dest, uint8_t* dest_end, uint32_t value) {\n  uint8_t data[MAX_U32_LEB128_BYTES];\n  Offset length = 0;\n  LEB128_LOOP_UNTIL(value == 0);\n  if (static_cast<Offset>(dest_end - dest) < length) {\n    return 0;\n  }\n  memcpy(dest, data, length);\n  return length;\n}\n\nOffset WriteFixedU32Leb128Raw(uint8_t* data, uint8_t* end, uint32_t value) {\n  if (end - data < MAX_U32_LEB128_BYTES) {\n    return 0;\n  }\n  data[0] = (value & 0x7f) | 0x80;\n  data[1] = ((value >> 7) & 0x7f) | 0x80;\n  data[2] = ((value >> 14) & 0x7f) | 0x80;\n  data[3] = ((value >> 21) & 0x7f) | 0x80;\n  data[4] = ((value >> 28) & 0x0f);\n  return MAX_U32_LEB128_BYTES;\n}\n\nstatic void WriteS32Leb128(Stream* stream, int32_t value, const char* desc) {\n  uint8_t data[MAX_U32_LEB128_BYTES];\n  Offset length = 0;\n  if (value < 0) {\n    LEB128_LOOP_UNTIL(value == -1 && (byte & 0x40));\n  } else {\n    LEB128_LOOP_UNTIL(value == 0 && !(byte & 0x40));\n  }\n\n  stream->WriteData(data, length, desc);\n}\n\nstatic void WriteS64Leb128(Stream* stream, int64_t value, const char* desc) {\n  uint8_t data[MAX_U64_LEB128_BYTES];\n  Offset length = 0;\n  if (value < 0) {\n    LEB128_LOOP_UNTIL(value == -1 && (byte & 0x40));\n  } else {\n    LEB128_LOOP_UNTIL(value == 0 && !(byte & 0x40));\n  }\n\n  stream->WriteData(data, length, desc);\n}\n\nvoid WriteS32Leb128(Stream* stream, uint32_t value, const char* desc) {\n  WriteS32Leb128(stream, Bitcast<int32_t>(value), desc);\n}\n\nvoid WriteU64Leb128(Stream* stream, uint64_t value, const char* desc) {\n  uint8_t data[MAX_U64_LEB128_BYTES];\n  Offset length = 0;\n  LEB128_LOOP_UNTIL(value == 0);\n  stream->WriteData(data, length, desc);\n}\n\nvoid WriteS64Leb128(Stream* stream, uint64_t value, const char* desc) {\n  WriteS64Leb128(stream, Bitcast<int64_t>(value), desc);\n}\n\nvoid WriteFixedS32Leb128(Stream* stream, uint32_t value, const char* desc) {\n  uint8_t data[MAX_U32_LEB128_BYTES];\n  data[0] = (value & 0x7f) | 0x80;\n  data[1] = ((value >> 7) & 0x7f) | 0x80;\n  data[2] = ((value >> 14) & 0x7f) | 0x80;\n  data[3] = ((value >> 21) & 0x7f) | 0x80;\n  // The last byte needs to be sign-extended.\n  data[4] = ((value >> 28) & 0x0f);\n  if (static_cast<int32_t>(value) < 0) {\n    data[4] |= 0x70;\n  }\n  stream->WriteData(data, MAX_U32_LEB128_BYTES, desc);\n}\n\n#undef LEB128_LOOP_UNTIL\n\n#define BYTE_AT(type, i, shift) ((static_cast<type>(p[i]) & 0x7f) << (shift))\n\n#define LEB128_1(type) (BYTE_AT(type, 0, 0))\n#define LEB128_2(type) (BYTE_AT(type, 1, 7) | LEB128_1(type))\n#define LEB128_3(type) (BYTE_AT(type, 2, 14) | LEB128_2(type))\n#define LEB128_4(type) (BYTE_AT(type, 3, 21) | LEB128_3(type))\n#define LEB128_5(type) (BYTE_AT(type, 4, 28) | LEB128_4(type))\n#define LEB128_6(type) (BYTE_AT(type, 5, 35) | LEB128_5(type))\n#define LEB128_7(type) (BYTE_AT(type, 6, 42) | LEB128_6(type))\n#define LEB128_8(type) (BYTE_AT(type, 7, 49) | LEB128_7(type))\n#define LEB128_9(type) (BYTE_AT(type, 8, 56) | LEB128_8(type))\n#define LEB128_10(type) (BYTE_AT(type, 9, 63) | LEB128_9(type))\n\n#define SHIFT_AMOUNT(type, sign_bit) (sizeof(type) * 8 - 1 - (sign_bit))\n#define SIGN_EXTEND(type, value, sign_bit)                       \\\n  (static_cast<type>((value) << SHIFT_AMOUNT(type, sign_bit)) >> \\\n   SHIFT_AMOUNT(type, sign_bit))\n\nsize_t ReadU32Leb128(const uint8_t* p,\n                     const uint8_t* end,\n                     uint32_t* out_value) {\n  if (p < end && (p[0] & 0x80) == 0) {\n    *out_value = LEB128_1(uint32_t);\n    return 1;\n  } else if (p + 1 < end && (p[1] & 0x80) == 0) {\n    *out_value = LEB128_2(uint32_t);\n    return 2;\n  } else if (p + 2 < end && (p[2] & 0x80) == 0) {\n    *out_value = LEB128_3(uint32_t);\n    return 3;\n  } else if (p + 3 < end && (p[3] & 0x80) == 0) {\n    *out_value = LEB128_4(uint32_t);\n    return 4;\n  } else if (p + 4 < end && (p[4] & 0x80) == 0) {\n    // The top bits set represent values > 32 bits.\n    if (p[4] & 0xf0) {\n      return 0;\n    }\n    *out_value = LEB128_5(uint32_t);\n    return 5;\n  } else {\n    // past the end.\n    *out_value = 0;\n    return 0;\n  }\n}\n\nsize_t ReadU64Leb128(const uint8_t* p,\n                     const uint8_t* end,\n                     uint64_t* out_value) {\n  if (p < end && (p[0] & 0x80) == 0) {\n    *out_value = LEB128_1(uint64_t);\n    return 1;\n  } else if (p + 1 < end && (p[1] & 0x80) == 0) {\n    *out_value = LEB128_2(uint64_t);\n    return 2;\n  } else if (p + 2 < end && (p[2] & 0x80) == 0) {\n    *out_value = LEB128_3(uint64_t);\n    return 3;\n  } else if (p + 3 < end && (p[3] & 0x80) == 0) {\n    *out_value = LEB128_4(uint64_t);\n    return 4;\n  } else if (p + 4 < end && (p[4] & 0x80) == 0) {\n    *out_value = LEB128_5(uint64_t);\n    return 5;\n  } else if (p + 5 < end && (p[5] & 0x80) == 0) {\n    *out_value = LEB128_6(uint64_t);\n    return 6;\n  } else if (p + 6 < end && (p[6] & 0x80) == 0) {\n    *out_value = LEB128_7(uint64_t);\n    return 7;\n  } else if (p + 7 < end && (p[7] & 0x80) == 0) {\n    *out_value = LEB128_8(uint64_t);\n    return 8;\n  } else if (p + 8 < end && (p[8] & 0x80) == 0) {\n    *out_value = LEB128_9(uint64_t);\n    return 9;\n  } else if (p + 9 < end && (p[9] & 0x80) == 0) {\n    // The top bits set represent values > 64 bits.\n    if (p[9] & 0xfe) {\n      return 0;\n    }\n    *out_value = LEB128_10(uint64_t);\n    return 10;\n  } else {\n    // past the end.\n    *out_value = 0;\n    return 0;\n  }\n}\n\nsize_t ReadS32Leb128(const uint8_t* p,\n                     const uint8_t* end,\n                     uint32_t* out_value) {\n  if (p < end && (p[0] & 0x80) == 0) {\n    uint32_t result = LEB128_1(uint32_t);\n    *out_value = SIGN_EXTEND(int32_t, result, 6);\n    return 1;\n  } else if (p + 1 < end && (p[1] & 0x80) == 0) {\n    uint32_t result = LEB128_2(uint32_t);\n    *out_value = SIGN_EXTEND(int32_t, result, 13);\n    return 2;\n  } else if (p + 2 < end && (p[2] & 0x80) == 0) {\n    uint32_t result = LEB128_3(uint32_t);\n    *out_value = SIGN_EXTEND(int32_t, result, 20);\n    return 3;\n  } else if (p + 3 < end && (p[3] & 0x80) == 0) {\n    uint32_t result = LEB128_4(uint32_t);\n    *out_value = SIGN_EXTEND(int32_t, result, 27);\n    return 4;\n  } else if (p + 4 < end && (p[4] & 0x80) == 0) {\n    // The top bits should be a sign-extension of the sign bit.\n    int top_bits = p[4] & 0xf8;\n    if (top_bits != 0x78 && top_bits != 0) {\n      return 0;\n    }\n    uint32_t result = LEB128_5(uint32_t);\n    *out_value = result;\n    return 5;\n  } else {\n    // Past the end.\n    return 0;\n  }\n}\n\nsize_t ReadS64Leb128(const uint8_t* p,\n                     const uint8_t* end,\n                     uint64_t* out_value) {\n  if (p < end && (p[0] & 0x80) == 0) {\n    uint64_t result = LEB128_1(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 6);\n    return 1;\n  } else if (p + 1 < end && (p[1] & 0x80) == 0) {\n    uint64_t result = LEB128_2(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 13);\n    return 2;\n  } else if (p + 2 < end && (p[2] & 0x80) == 0) {\n    uint64_t result = LEB128_3(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 20);\n    return 3;\n  } else if (p + 3 < end && (p[3] & 0x80) == 0) {\n    uint64_t result = LEB128_4(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 27);\n    return 4;\n  } else if (p + 4 < end && (p[4] & 0x80) == 0) {\n    uint64_t result = LEB128_5(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 34);\n    return 5;\n  } else if (p + 5 < end && (p[5] & 0x80) == 0) {\n    uint64_t result = LEB128_6(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 41);\n    return 6;\n  } else if (p + 6 < end && (p[6] & 0x80) == 0) {\n    uint64_t result = LEB128_7(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 48);\n    return 7;\n  } else if (p + 7 < end && (p[7] & 0x80) == 0) {\n    uint64_t result = LEB128_8(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 55);\n    return 8;\n  } else if (p + 8 < end && (p[8] & 0x80) == 0) {\n    uint64_t result = LEB128_9(uint64_t);\n    *out_value = SIGN_EXTEND(int64_t, result, 62);\n    return 9;\n  } else if (p + 9 < end && (p[9] & 0x80) == 0) {\n    // The top bits should be a sign-extension of the sign bit.\n    int top_bits = p[9];\n    if (top_bits != 0x7f && top_bits != 0) {\n      return 0;\n    }\n    uint64_t result = LEB128_10(uint64_t);\n    *out_value = result;\n    return 10;\n  } else {\n    // Past the end.\n    return 0;\n  }\n}\n\n#undef BYTE_AT\n#undef LEB128_1\n#undef LEB128_2\n#undef LEB128_3\n#undef LEB128_4\n#undef LEB128_5\n#undef LEB128_6\n#undef LEB128_7\n#undef LEB128_8\n#undef LEB128_9\n#undef LEB128_10\n#undef SHIFT_AMOUNT\n#undef SIGN_EXTEND\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/lexer-keywords.txt",
    "content": "struct TokenInfo {\n  TokenInfo(const char* name) : name(name) {}\n  TokenInfo(const char* name, TokenType token_type)\n      : name(name), token_type(token_type) {}\n  TokenInfo(const char* name, Type value_type)\n      : name(name), token_type(TokenType::ValueType), value_type(value_type) {}\n  TokenInfo(const char* name, Type value_type, TokenType token_type)\n      : name(name), token_type(token_type), value_type(value_type) {}\n  TokenInfo(const char* name, TokenType token_type, Opcode opcode)\n      : name(name), token_type(token_type), opcode(opcode) {}\n\n  const char* name;\n  TokenType token_type;\n  union {\n    Type value_type;\n    Opcode opcode;\n  };\n};\n%%\narray, Type::Array, TokenType::Array\nafter, TokenType::After\nassert_exception, TokenType::AssertException\nassert_exhaustion, TokenType::AssertExhaustion\nassert_invalid, TokenType::AssertInvalid\nassert_malformed, TokenType::AssertMalformed\nassert_return, TokenType::AssertReturn\nassert_trap, TokenType::AssertTrap\nassert_unlinkable, TokenType::AssertUnlinkable\natomic.fence, TokenType::AtomicFence, Opcode::AtomicFence\nbefore, TokenType::Before\nbinary, TokenType::Bin\nblock, TokenType::Block, Opcode::Block\nbr_if, TokenType::BrIf, Opcode::BrIf\nbr_on_non_null, TokenType::BrOnNonNull, Opcode::BrOnNonNull\nbr_on_null, TokenType::BrOnNull, Opcode::BrOnNull\nbr_table, TokenType::BrTable, Opcode::BrTable\nbr, TokenType::Br, Opcode::Br\ncall_indirect, TokenType::CallIndirect, Opcode::CallIndirect\ncall_ref, TokenType::CallRef, Opcode::CallRef\ncall, TokenType::Call, Opcode::Call\ncatch, TokenType::Catch, Opcode::Catch\ncatch_all, TokenType::CatchAll, Opcode::CatchAll\ncatch_ref, TokenType::CatchRef\ncatch_all_ref, TokenType::CatchAllRef\ncode, TokenType::Code\ndata.drop, TokenType::DataDrop, Opcode::DataDrop\ndata, TokenType::Data\ndeclare, TokenType::Declare\ndelegate, TokenType::Delegate\ndo, TokenType::Do\ndrop, TokenType::Drop, Opcode::Drop\neither, TokenType::Either\nelem.drop, TokenType::ElemDrop, Opcode::ElemDrop\nelem, TokenType::Elem\nelse, TokenType::Else, Opcode::Else\nend, TokenType::End, Opcode::End\ntag, TokenType::Tag\nextern, Type::ExternRef, TokenType::Extern\nexternref, Type::ExternRef\nexn, Type::ExnRef, TokenType::Exn\nexnref, Type::ExnRef\nexport, TokenType::Export\nf32.abs, TokenType::Unary, Opcode::F32Abs\nf32.add, TokenType::Binary, Opcode::F32Add\nf32.ceil, TokenType::Unary, Opcode::F32Ceil\nf32.const, TokenType::Const, Opcode::F32Const\nf32.convert_i32_s, TokenType::Convert, Opcode::F32ConvertI32S\nf32.convert_i32_u, TokenType::Convert, Opcode::F32ConvertI32U\nf32.convert_i64_s, TokenType::Convert, Opcode::F32ConvertI64S\nf32.convert_i64_u, TokenType::Convert, Opcode::F32ConvertI64U\nf32.copysign, TokenType::Binary, Opcode::F32Copysign\nf32.demote_f64, TokenType::Convert, Opcode::F32DemoteF64\nf32.div, TokenType::Binary, Opcode::F32Div\nf32.eq, TokenType::Compare, Opcode::F32Eq\nf32.floor, TokenType::Unary, Opcode::F32Floor\nf32.ge, TokenType::Compare, Opcode::F32Ge\nf32.gt, TokenType::Compare, Opcode::F32Gt\nf32.le, TokenType::Compare, Opcode::F32Le\nf32.load, TokenType::Load, Opcode::F32Load\nf32.lt, TokenType::Compare, Opcode::F32Lt\nf32.max, TokenType::Binary, Opcode::F32Max\nf32.min, TokenType::Binary, Opcode::F32Min\nf32.mul, TokenType::Binary, Opcode::F32Mul\nf32.nearest, TokenType::Unary, Opcode::F32Nearest\nf32.neg, TokenType::Unary, Opcode::F32Neg\nf32.ne, TokenType::Compare, Opcode::F32Ne\nf32.reinterpret_i32, TokenType::Convert, Opcode::F32ReinterpretI32\nf32.sqrt, TokenType::Unary, Opcode::F32Sqrt\nf32.store, TokenType::Store, Opcode::F32Store\nf32.sub, TokenType::Binary, Opcode::F32Sub\nf32.trunc, TokenType::Unary, Opcode::F32Trunc\nf32, Type::F32\nf32x4.abs, TokenType::Unary, Opcode::F32X4Abs\nf32x4.add, TokenType::Binary, Opcode::F32X4Add\nf32x4.ceil, TokenType::Unary, Opcode::F32X4Ceil\nf32x4.convert_i32x4_s, TokenType::Unary, Opcode::F32X4ConvertI32X4S\nf32x4.convert_i32x4_u, TokenType::Unary, Opcode::F32X4ConvertI32X4U\nf32x4.div, TokenType::Binary, Opcode::F32X4Div\nf32x4.eq, TokenType::Compare, Opcode::F32X4Eq\nf32x4.extract_lane, TokenType::SimdLaneOp, Opcode::F32X4ExtractLane\nf32x4.floor, TokenType::Unary, Opcode::F32X4Floor\nf32x4.ge, TokenType::Compare, Opcode::F32X4Ge\nf32x4.gt, TokenType::Compare, Opcode::F32X4Gt\nf32x4.le, TokenType::Compare, Opcode::F32X4Le\nf32x4.lt, TokenType::Compare, Opcode::F32X4Lt\nf32x4.max, TokenType::Binary, Opcode::F32X4Max\nf32x4.min, TokenType::Binary, Opcode::F32X4Min\nf32x4.mul, TokenType::Binary, Opcode::F32X4Mul\nf32x4.nearest, TokenType::Unary, Opcode::F32X4Nearest\nf32x4.neg, TokenType::Unary, Opcode::F32X4Neg\nf32x4.ne, TokenType::Compare, Opcode::F32X4Ne\nf32x4.pmax, TokenType::Binary, Opcode::F32X4PMax\nf32x4.pmin, TokenType::Binary, Opcode::F32X4PMin\nf32x4.relaxed_madd, TokenType::Ternary, Opcode::F32X4RelaxedMadd\nf32x4.relaxed_max, TokenType::Binary, Opcode::F32X4RelaxedMax\nf32x4.relaxed_min, TokenType::Binary, Opcode::F32X4RelaxedMin\nf32x4.relaxed_nmadd, TokenType::Ternary, Opcode::F32X4RelaxedNmadd\nf32x4.replace_lane, TokenType::SimdLaneOp, Opcode::F32X4ReplaceLane\nf32x4.splat, TokenType::Unary, Opcode::F32X4Splat\nf32x4.sqrt, TokenType::Unary, Opcode::F32X4Sqrt\nf32x4.sub, TokenType::Binary, Opcode::F32X4Sub\nf32x4.trunc, TokenType::Unary, Opcode::F32X4Trunc\nf32x4.demote_f64x2_zero, TokenType::Unary, Opcode::F32X4DemoteF64X2Zero\nf32x4, TokenType::F32X4\nf64.abs, TokenType::Unary, Opcode::F64Abs\nf64.add, TokenType::Binary, Opcode::F64Add\nf64.ceil, TokenType::Unary, Opcode::F64Ceil\nf64.const, TokenType::Const, Opcode::F64Const\nf64.convert_i32_s, TokenType::Convert, Opcode::F64ConvertI32S\nf64.convert_i32_u, TokenType::Convert, Opcode::F64ConvertI32U\nf64.convert_i64_s, TokenType::Convert, Opcode::F64ConvertI64S\nf64.convert_i64_u, TokenType::Convert, Opcode::F64ConvertI64U\nf64.copysign, TokenType::Binary, Opcode::F64Copysign\nf64.div, TokenType::Binary, Opcode::F64Div\nf64.eq, TokenType::Compare, Opcode::F64Eq\nf64.floor, TokenType::Unary, Opcode::F64Floor\nf64.ge, TokenType::Compare, Opcode::F64Ge\nf64.gt, TokenType::Compare, Opcode::F64Gt\nf64.le, TokenType::Compare, Opcode::F64Le\nf64.load, TokenType::Load, Opcode::F64Load\nf64.lt, TokenType::Compare, Opcode::F64Lt\nf64.max, TokenType::Binary, Opcode::F64Max\nf64.min, TokenType::Binary, Opcode::F64Min\nf64.mul, TokenType::Binary, Opcode::F64Mul\nf64.nearest, TokenType::Unary, Opcode::F64Nearest\nf64.neg, TokenType::Unary, Opcode::F64Neg\nf64.ne, TokenType::Compare, Opcode::F64Ne\nf64.promote_f32, TokenType::Convert, Opcode::F64PromoteF32\nf64.reinterpret_i64, TokenType::Convert, Opcode::F64ReinterpretI64\nf64.sqrt, TokenType::Unary, Opcode::F64Sqrt\nf64.store, TokenType::Store, Opcode::F64Store\nf64.sub, TokenType::Binary, Opcode::F64Sub\nf64.trunc, TokenType::Unary, Opcode::F64Trunc\nf64, Type::F64\nf64x2.abs, TokenType::Unary, Opcode::F64X2Abs\nf64x2.add, TokenType::Binary, Opcode::F64X2Add\nf64x2.ceil, TokenType::Unary, Opcode::F64X2Ceil\nf64x2.div, TokenType::Binary, Opcode::F64X2Div\nf64x2.eq, TokenType::Compare, Opcode::F64X2Eq\nf64x2.extract_lane, TokenType::SimdLaneOp, Opcode::F64X2ExtractLane\nf64x2.floor, TokenType::Unary, Opcode::F64X2Floor\nf64x2.ge, TokenType::Compare, Opcode::F64X2Ge\nf64x2.gt, TokenType::Compare, Opcode::F64X2Gt\nf64x2.le, TokenType::Compare, Opcode::F64X2Le\nf64x2.lt, TokenType::Compare, Opcode::F64X2Lt\nf64x2.max, TokenType::Binary, Opcode::F64X2Max\nf64x2.min, TokenType::Binary, Opcode::F64X2Min\nf64x2.mul, TokenType::Binary, Opcode::F64X2Mul\nf64x2.nearest, TokenType::Unary, Opcode::F64X2Nearest\nf64x2.neg, TokenType::Unary, Opcode::F64X2Neg\nf64x2.ne, TokenType::Compare, Opcode::F64X2Ne\nf64x2.pmax, TokenType::Binary, Opcode::F64X2PMax\nf64x2.pmin, TokenType::Binary, Opcode::F64X2PMin\nf64x2.relaxed_madd, TokenType::Ternary, Opcode::F64X2RelaxedMadd\nf64x2.relaxed_max, TokenType::Binary, Opcode::F64X2RelaxedMax\nf64x2.relaxed_min, TokenType::Binary, Opcode::F64X2RelaxedMin\nf64x2.relaxed_nmadd, TokenType::Ternary, Opcode::F64X2RelaxedNmadd\nf64x2.replace_lane, TokenType::SimdLaneOp, Opcode::F64X2ReplaceLane\nf64x2.splat, TokenType::Unary, Opcode::F64X2Splat\nf64x2.sqrt, TokenType::Unary, Opcode::F64X2Sqrt\nf64x2.sub, TokenType::Binary, Opcode::F64X2Sub\nf64x2.trunc, TokenType::Unary, Opcode::F64X2Trunc\nf64x2.convert_low_i32x4_s, TokenType::Unary, Opcode::F64X2ConvertLowI32X4S\nf64x2.convert_low_i32x4_u, TokenType::Unary, Opcode::F64X2ConvertLowI32X4U\nf64x2.promote_low_f32x4, TokenType::Unary, Opcode::F64X2PromoteLowF32X4\nf64x2, TokenType::F64X2\nfield, TokenType::Field\nfunc, Type::FuncRef, TokenType::Func\nfuncref, Type::FuncRef\nfunction, TokenType::Function\nget, TokenType::Get\nglobal.get, TokenType::GlobalGet, Opcode::GlobalGet\nglobal.set, TokenType::GlobalSet, Opcode::GlobalSet\nglobal, TokenType::Global\ni16x8.abs, TokenType::Unary, Opcode::I16X8Abs\ni16x8.add_sat_s, TokenType::Binary, Opcode::I16X8AddSatS\ni16x8.add_sat_u, TokenType::Binary, Opcode::I16X8AddSatU\ni16x8.add, TokenType::Binary, Opcode::I16X8Add\ni16x8.all_true, TokenType::Unary, Opcode::I16X8AllTrue\ni16x8.avgr_u, TokenType::Binary, Opcode::I16X8AvgrU\ni16x8.bitmask, TokenType::Unary, Opcode::I16X8Bitmask\ni16x8.relaxed_dot_i8x16_i7x16_s, TokenType::Binary, Opcode::I16X8DotI8X16I7X16S\ni16x8.eq, TokenType::Compare, Opcode::I16X8Eq\ni16x8.extract_lane_s, TokenType::SimdLaneOp, Opcode::I16X8ExtractLaneS\ni16x8.extract_lane_u, TokenType::SimdLaneOp, Opcode::I16X8ExtractLaneU\ni16x8.ge_s, TokenType::Compare, Opcode::I16X8GeS\ni16x8.ge_u, TokenType::Compare, Opcode::I16X8GeU\ni16x8.gt_s, TokenType::Compare, Opcode::I16X8GtS\ni16x8.gt_u, TokenType::Compare, Opcode::I16X8GtU\ni16x8.le_s, TokenType::Compare, Opcode::I16X8LeS\ni16x8.le_u, TokenType::Compare, Opcode::I16X8LeU\nv128.load8x8_s, TokenType::Load, Opcode::V128Load8X8S\nv128.load8x8_u, TokenType::Load, Opcode::V128Load8X8U\ni16x8.lt_s, TokenType::Compare, Opcode::I16X8LtS\ni16x8.lt_u, TokenType::Compare, Opcode::I16X8LtU\ni16x8.max_s, TokenType::Binary, Opcode::I16X8MaxS\ni16x8.max_u, TokenType::Binary, Opcode::I16X8MaxU\ni16x8.min_s, TokenType::Binary, Opcode::I16X8MinS\ni16x8.min_u, TokenType::Binary, Opcode::I16X8MinU\ni16x8.mul, TokenType::Binary, Opcode::I16X8Mul\ni16x8.narrow_i32x4_s, TokenType::Binary, Opcode::I16X8NarrowI32X4S\ni16x8.narrow_i32x4_u, TokenType::Binary, Opcode::I16X8NarrowI32X4U\ni16x8.neg, TokenType::Unary, Opcode::I16X8Neg\ni16x8.q15mulr_sat_s, TokenType::Binary, Opcode::I16X8Q15mulrSatS\ni16x8.ne, TokenType::Compare, Opcode::I16X8Ne\ni16x8.relaxed_laneselect, TokenType::Ternary, Opcode::I16X8RelaxedLaneSelect\ni16x8.relaxed_q15mulr_s, TokenType::Binary, Opcode::I16X8RelaxedQ15mulrS\ni16x8.replace_lane, TokenType::SimdLaneOp, Opcode::I16X8ReplaceLane\ni16x8.shl, TokenType::Binary, Opcode::I16X8Shl\ni16x8.shr_s, TokenType::Binary, Opcode::I16X8ShrS\ni16x8.shr_u, TokenType::Binary, Opcode::I16X8ShrU\ni16x8.splat, TokenType::Unary, Opcode::I16X8Splat\ni16x8.sub_sat_s, TokenType::Binary, Opcode::I16X8SubSatS\ni16x8.sub_sat_u, TokenType::Binary, Opcode::I16X8SubSatU\ni16x8.sub, TokenType::Binary, Opcode::I16X8Sub\ni16x8.extadd_pairwise_i8x16_s, TokenType::Unary, Opcode::I16X8ExtaddPairwiseI8X16S\ni16x8.extadd_pairwise_i8x16_u, TokenType::Unary, Opcode::I16X8ExtaddPairwiseI8X16U\ni16x8.extmul_low_i8x16_s, TokenType::Binary, Opcode::I16X8ExtmulLowI8X16S\ni16x8.extmul_high_i8x16_s, TokenType::Binary, Opcode::I16X8ExtmulHighI8X16S\ni16x8.extmul_low_i8x16_u, TokenType::Binary, Opcode::I16X8ExtmulLowI8X16U\ni16x8.extmul_high_i8x16_u, TokenType::Binary, Opcode::I16X8ExtmulHighI8X16U\ni16x8, TokenType::I16X8\ni16x8.extend_high_i8x16_s, TokenType::Unary, Opcode::I16X8ExtendHighI8X16S\ni16x8.extend_high_i8x16_u, TokenType::Unary, Opcode::I16X8ExtendHighI8X16U\ni16x8.extend_low_i8x16_s, TokenType::Unary, Opcode::I16X8ExtendLowI8X16S\ni16x8.extend_low_i8x16_u, TokenType::Unary, Opcode::I16X8ExtendLowI8X16U\ni32.add, TokenType::Binary, Opcode::I32Add\ni32.and, TokenType::Binary, Opcode::I32And\ni32.atomic.load16_u, TokenType::AtomicLoad, Opcode::I32AtomicLoad16U\ni32.atomic.load8_u, TokenType::AtomicLoad, Opcode::I32AtomicLoad8U\ni32.atomic.load, TokenType::AtomicLoad, Opcode::I32AtomicLoad\ni32.atomic.rmw16.add_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw16AddU\ni32.atomic.rmw16.and_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw16AndU\ni32.atomic.rmw16.cmpxchg_u, TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw16CmpxchgU\ni32.atomic.rmw16.or_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw16OrU\ni32.atomic.rmw16.sub_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw16SubU\ni32.atomic.rmw16.xchg_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw16XchgU\ni32.atomic.rmw16.xor_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw16XorU\ni32.atomic.rmw8.add_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw8AddU\ni32.atomic.rmw8.and_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw8AndU\ni32.atomic.rmw8.cmpxchg_u, TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw8CmpxchgU\ni32.atomic.rmw8.or_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw8OrU\ni32.atomic.rmw8.sub_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw8SubU\ni32.atomic.rmw8.xchg_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw8XchgU\ni32.atomic.rmw8.xor_u, TokenType::AtomicRmw, Opcode::I32AtomicRmw8XorU\ni32.atomic.rmw.add, TokenType::AtomicRmw, Opcode::I32AtomicRmwAdd\ni32.atomic.rmw.and, TokenType::AtomicRmw, Opcode::I32AtomicRmwAnd\ni32.atomic.rmw.cmpxchg, TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmwCmpxchg\ni32.atomic.rmw.or, TokenType::AtomicRmw, Opcode::I32AtomicRmwOr\ni32.atomic.rmw.sub, TokenType::AtomicRmw, Opcode::I32AtomicRmwSub\ni32.atomic.rmw.xchg, TokenType::AtomicRmw, Opcode::I32AtomicRmwXchg\ni32.atomic.rmw.xor, TokenType::AtomicRmw, Opcode::I32AtomicRmwXor\ni32.atomic.store16, TokenType::AtomicStore, Opcode::I32AtomicStore16\ni32.atomic.store8, TokenType::AtomicStore, Opcode::I32AtomicStore8\ni32.atomic.store, TokenType::AtomicStore, Opcode::I32AtomicStore\ni32.clz, TokenType::Unary, Opcode::I32Clz\ni32.const, TokenType::Const, Opcode::I32Const\ni32.ctz, TokenType::Unary, Opcode::I32Ctz\ni32.div_s, TokenType::Binary, Opcode::I32DivS\ni32.div_u, TokenType::Binary, Opcode::I32DivU\ni32.eq, TokenType::Compare, Opcode::I32Eq\ni32.eqz, TokenType::Convert, Opcode::I32Eqz\ni32.extend16_s, TokenType::Unary, Opcode::I32Extend16S\ni32.extend8_s, TokenType::Unary, Opcode::I32Extend8S\ni32.ge_s, TokenType::Compare, Opcode::I32GeS\ni32.ge_u, TokenType::Compare, Opcode::I32GeU\ni32.gt_s, TokenType::Compare, Opcode::I32GtS\ni32.gt_u, TokenType::Compare, Opcode::I32GtU\ni32.le_s, TokenType::Compare, Opcode::I32LeS\ni32.le_u, TokenType::Compare, Opcode::I32LeU\ni32.load16_s, TokenType::Load, Opcode::I32Load16S\ni32.load16_u, TokenType::Load, Opcode::I32Load16U\ni32.load8_s, TokenType::Load, Opcode::I32Load8S\ni32.load8_u, TokenType::Load, Opcode::I32Load8U\ni32.load, TokenType::Load, Opcode::I32Load\ni32.lt_s, TokenType::Compare, Opcode::I32LtS\ni32.lt_u, TokenType::Compare, Opcode::I32LtU\ni32.mul, TokenType::Binary, Opcode::I32Mul\ni32.ne, TokenType::Compare, Opcode::I32Ne\ni32.or, TokenType::Binary, Opcode::I32Or\ni32.popcnt, TokenType::Unary, Opcode::I32Popcnt\ni32.reinterpret_f32, TokenType::Convert, Opcode::I32ReinterpretF32\ni32.rem_s, TokenType::Binary, Opcode::I32RemS\ni32.rem_u, TokenType::Binary, Opcode::I32RemU\ni32.rotl, TokenType::Binary, Opcode::I32Rotl\ni32.rotr, TokenType::Binary, Opcode::I32Rotr\ni32.shl, TokenType::Binary, Opcode::I32Shl\ni32.shr_s, TokenType::Binary, Opcode::I32ShrS\ni32.shr_u, TokenType::Binary, Opcode::I32ShrU\ni32.store16, TokenType::Store, Opcode::I32Store16\ni32.store8, TokenType::Store, Opcode::I32Store8\ni32.store, TokenType::Store, Opcode::I32Store\ni32.sub, TokenType::Binary, Opcode::I32Sub\ni32.trunc_f32_s, TokenType::Convert, Opcode::I32TruncF32S\ni32.trunc_f32_u, TokenType::Convert, Opcode::I32TruncF32U\ni32.trunc_f64_s, TokenType::Convert, Opcode::I32TruncF64S\ni32.trunc_f64_u, TokenType::Convert, Opcode::I32TruncF64U\ni32.trunc_sat_f32_s, TokenType::Convert, Opcode::I32TruncSatF32S\ni32.trunc_sat_f32_u, TokenType::Convert, Opcode::I32TruncSatF32U\ni32.trunc_sat_f64_s, TokenType::Convert, Opcode::I32TruncSatF64S\ni32.trunc_sat_f64_u, TokenType::Convert, Opcode::I32TruncSatF64U\ni32, Type::I32\ni32.wrap_i64, TokenType::Convert, Opcode::I32WrapI64\ni32x4.abs, TokenType::Unary, Opcode::I32X4Abs\ni32x4.add, TokenType::Binary, Opcode::I32X4Add\ni32x4.all_true, TokenType::Unary, Opcode::I32X4AllTrue\ni32x4.bitmask, TokenType::Unary, Opcode::I32X4Bitmask\ni32x4.relaxed_dot_i8x16_i7x16_add_s, TokenType::Ternary, Opcode::I32X4DotI8X16I7X16AddS\ni32x4.eq, TokenType::Compare, Opcode::I32X4Eq\ni32x4.extract_lane, TokenType::SimdLaneOp, Opcode::I32X4ExtractLane\ni32x4.ge_s, TokenType::Compare, Opcode::I32X4GeS\ni32x4.ge_u, TokenType::Compare, Opcode::I32X4GeU\ni32x4.gt_s, TokenType::Compare, Opcode::I32X4GtS\ni32x4.gt_u, TokenType::Compare, Opcode::I32X4GtU\ni32x4.le_s, TokenType::Compare, Opcode::I32X4LeS\ni32x4.le_u, TokenType::Compare, Opcode::I32X4LeU\ni32x4.relaxed_trunc_f32x4_s, TokenType::Unary, Opcode::I32X4RelaxedTruncF32X4S\ni32x4.relaxed_trunc_f32x4_u, TokenType::Unary, Opcode::I32X4RelaxedTruncF32X4U\ni32x4.relaxed_trunc_f64x2_s_zero, TokenType::Unary, Opcode::I32X4RelaxedTruncF64X2SZero\ni32x4.relaxed_trunc_f64x2_u_zero, TokenType::Unary, Opcode::I32X4RelaxedTruncF64X2UZero\nv128.load16x4_s, TokenType::Load, Opcode::V128Load16X4S\nv128.load16x4_u, TokenType::Load, Opcode::V128Load16X4U\ni32x4.lt_s, TokenType::Compare, Opcode::I32X4LtS\ni32x4.lt_u, TokenType::Compare, Opcode::I32X4LtU\ni32x4.max_s, TokenType::Binary, Opcode::I32X4MaxS\ni32x4.max_u, TokenType::Binary, Opcode::I32X4MaxU\ni32x4.min_s, TokenType::Binary, Opcode::I32X4MinS\ni32x4.min_u, TokenType::Binary, Opcode::I32X4MinU\ni32x4.dot_i16x8_s, TokenType::Binary, Opcode::I32X4DotI16X8S\ni32x4.mul, TokenType::Binary, Opcode::I32X4Mul\ni32x4.neg, TokenType::Unary, Opcode::I32X4Neg\ni32x4.ne, TokenType::Compare, Opcode::I32X4Ne\ni32x4.relaxed_laneselect, TokenType::Ternary, Opcode::I32X4RelaxedLaneSelect\ni32x4.replace_lane, TokenType::SimdLaneOp, Opcode::I32X4ReplaceLane\ni32x4.shl, TokenType::Binary, Opcode::I32X4Shl\ni32x4.shr_s, TokenType::Binary, Opcode::I32X4ShrS\ni32x4.shr_u, TokenType::Binary, Opcode::I32X4ShrU\ni32x4.splat, TokenType::Unary, Opcode::I32X4Splat\ni32x4.sub, TokenType::Binary, Opcode::I32X4Sub\ni32x4.extadd_pairwise_i16x8_s, TokenType::Unary, Opcode::I32X4ExtaddPairwiseI16X8S\ni32x4.extadd_pairwise_i16x8_u, TokenType::Unary, Opcode::I32X4ExtaddPairwiseI16X8U\ni32x4.extmul_low_i16x8_s, TokenType::Binary, Opcode::I32X4ExtmulLowI16X8S\ni32x4.extmul_high_i16x8_s, TokenType::Binary, Opcode::I32X4ExtmulHighI16X8S\ni32x4.extmul_low_i16x8_u, TokenType::Binary, Opcode::I32X4ExtmulLowI16X8U\ni32x4.extmul_high_i16x8_u, TokenType::Binary, Opcode::I32X4ExtmulHighI16X8U\ni32x4, TokenType::I32X4\ni32x4.trunc_sat_f32x4_s, TokenType::Unary, Opcode::I32X4TruncSatF32X4S\ni32x4.trunc_sat_f32x4_u, TokenType::Unary, Opcode::I32X4TruncSatF32X4U\ni32x4.extend_high_i16x8_s, TokenType::Unary, Opcode::I32X4ExtendHighI16X8S\ni32x4.extend_high_i16x8_u, TokenType::Unary, Opcode::I32X4ExtendHighI16X8U\ni32x4.extend_low_i16x8_s, TokenType::Unary, Opcode::I32X4ExtendLowI16X8S\ni32x4.extend_low_i16x8_u, TokenType::Unary, Opcode::I32X4ExtendLowI16X8U\ni32x4.trunc_sat_f64x2_s_zero, TokenType::Unary, Opcode::I32X4TruncSatF64X2SZero\ni32x4.trunc_sat_f64x2_u_zero, TokenType::Unary, Opcode::I32X4TruncSatF64X2UZero\ni32.xor, TokenType::Binary, Opcode::I32Xor\ni64.add, TokenType::Binary, Opcode::I64Add\ni64.and, TokenType::Binary, Opcode::I64And\ni64.atomic.load16_u, TokenType::AtomicLoad, Opcode::I64AtomicLoad16U\ni64.atomic.load32_u, TokenType::AtomicLoad, Opcode::I64AtomicLoad32U\ni64.atomic.load8_u, TokenType::AtomicLoad, Opcode::I64AtomicLoad8U\ni64.atomic.load, TokenType::AtomicLoad, Opcode::I64AtomicLoad\ni64.atomic.rmw16.add_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw16AddU\ni64.atomic.rmw16.and_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw16AndU\ni64.atomic.rmw16.cmpxchg_u, TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw16CmpxchgU\ni64.atomic.rmw16.or_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw16OrU\ni64.atomic.rmw16.sub_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw16SubU\ni64.atomic.rmw16.xchg_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw16XchgU\ni64.atomic.rmw16.xor_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw16XorU\ni64.atomic.rmw32.add_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw32AddU\ni64.atomic.rmw32.and_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw32AndU\ni64.atomic.rmw32.cmpxchg_u, TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw32CmpxchgU\ni64.atomic.rmw32.or_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw32OrU\ni64.atomic.rmw32.sub_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw32SubU\ni64.atomic.rmw32.xchg_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw32XchgU\ni64.atomic.rmw32.xor_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw32XorU\ni64.atomic.rmw8.add_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw8AddU\ni64.atomic.rmw8.and_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw8AndU\ni64.atomic.rmw8.cmpxchg_u, TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw8CmpxchgU\ni64.atomic.rmw8.or_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw8OrU\ni64.atomic.rmw8.sub_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw8SubU\ni64.atomic.rmw8.xchg_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw8XchgU\ni64.atomic.rmw8.xor_u, TokenType::AtomicRmw, Opcode::I64AtomicRmw8XorU\ni64.atomic.rmw.add, TokenType::AtomicRmw, Opcode::I64AtomicRmwAdd\ni64.atomic.rmw.and, TokenType::AtomicRmw, Opcode::I64AtomicRmwAnd\ni64.atomic.rmw.cmpxchg, TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmwCmpxchg\ni64.atomic.rmw.or, TokenType::AtomicRmw, Opcode::I64AtomicRmwOr\ni64.atomic.rmw.sub, TokenType::AtomicRmw, Opcode::I64AtomicRmwSub\ni64.atomic.rmw.xchg, TokenType::AtomicRmw, Opcode::I64AtomicRmwXchg\ni64.atomic.rmw.xor, TokenType::AtomicRmw, Opcode::I64AtomicRmwXor\ni64.atomic.store16, TokenType::AtomicStore, Opcode::I64AtomicStore16\ni64.atomic.store32, TokenType::AtomicStore, Opcode::I64AtomicStore32\ni64.atomic.store8, TokenType::AtomicStore, Opcode::I64AtomicStore8\ni64.atomic.store, TokenType::AtomicStore, Opcode::I64AtomicStore\ni64.clz, TokenType::Unary, Opcode::I64Clz\ni64.const, TokenType::Const, Opcode::I64Const\ni64.ctz, TokenType::Unary, Opcode::I64Ctz\ni64.div_s, TokenType::Binary, Opcode::I64DivS\ni64.div_u, TokenType::Binary, Opcode::I64DivU\ni64.eq, TokenType::Compare, Opcode::I64Eq\ni64.eqz, TokenType::Convert, Opcode::I64Eqz\ni64.extend16_s, TokenType::Unary, Opcode::I64Extend16S\ni64.extend32_s, TokenType::Unary, Opcode::I64Extend32S\ni64.extend8_s, TokenType::Unary, Opcode::I64Extend8S\ni64.extend_i32_s, TokenType::Convert, Opcode::I64ExtendI32S\ni64.extend_i32_u, TokenType::Convert, Opcode::I64ExtendI32U\ni64.ge_s, TokenType::Compare, Opcode::I64GeS\ni64.ge_u, TokenType::Compare, Opcode::I64GeU\ni64.gt_s, TokenType::Compare, Opcode::I64GtS\ni64.gt_u, TokenType::Compare, Opcode::I64GtU\ni64.le_s, TokenType::Compare, Opcode::I64LeS\ni64.le_u, TokenType::Compare, Opcode::I64LeU\ni64.load16_s, TokenType::Load, Opcode::I64Load16S\ni64.load16_u, TokenType::Load, Opcode::I64Load16U\ni64.load32_s, TokenType::Load, Opcode::I64Load32S\ni64.load32_u, TokenType::Load, Opcode::I64Load32U\ni64.load8_s, TokenType::Load, Opcode::I64Load8S\ni64.load8_u, TokenType::Load, Opcode::I64Load8U\ni64.load, TokenType::Load, Opcode::I64Load\ni64.lt_s, TokenType::Compare, Opcode::I64LtS\ni64.lt_u, TokenType::Compare, Opcode::I64LtU\ni64.mul, TokenType::Binary, Opcode::I64Mul\ni64.ne, TokenType::Compare, Opcode::I64Ne\ni64.or, TokenType::Binary, Opcode::I64Or\ni64.popcnt, TokenType::Unary, Opcode::I64Popcnt\ni64.reinterpret_f64, TokenType::Convert, Opcode::I64ReinterpretF64\ni64.rem_s, TokenType::Binary, Opcode::I64RemS\ni64.rem_u, TokenType::Binary, Opcode::I64RemU\ni64.rotl, TokenType::Binary, Opcode::I64Rotl\ni64.rotr, TokenType::Binary, Opcode::I64Rotr\ni64.shl, TokenType::Binary, Opcode::I64Shl\ni64.shr_s, TokenType::Binary, Opcode::I64ShrS\ni64.shr_u, TokenType::Binary, Opcode::I64ShrU\ni64.store16, TokenType::Store, Opcode::I64Store16\ni64.store32, TokenType::Store, Opcode::I64Store32\ni64.store8, TokenType::Store, Opcode::I64Store8\ni64.store, TokenType::Store, Opcode::I64Store\ni64.sub, TokenType::Binary, Opcode::I64Sub\ni64.trunc_f32_s, TokenType::Convert, Opcode::I64TruncF32S\ni64.trunc_f32_u, TokenType::Convert, Opcode::I64TruncF32U\ni64.trunc_f64_s, TokenType::Convert, Opcode::I64TruncF64S\ni64.trunc_f64_u, TokenType::Convert, Opcode::I64TruncF64U\ni64.trunc_sat_f32_s, TokenType::Convert, Opcode::I64TruncSatF32S\ni64.trunc_sat_f32_u, TokenType::Convert, Opcode::I64TruncSatF32U\ni64.trunc_sat_f64_s, TokenType::Convert, Opcode::I64TruncSatF64S\ni64.trunc_sat_f64_u, TokenType::Convert, Opcode::I64TruncSatF64U\ni64, Type::I64\ni64x2.add, TokenType::Binary, Opcode::I64X2Add\ni64x2.extract_lane, TokenType::SimdLaneOp, Opcode::I64X2ExtractLane\nv128.load32x2_s, TokenType::Load, Opcode::V128Load32X2S\nv128.load32x2_u, TokenType::Load, Opcode::V128Load32X2U\ni64x2.mul, TokenType::Binary, Opcode::I64X2Mul\ni64x2.eq, TokenType::Binary, Opcode::I64X2Eq\ni64x2.ne, TokenType::Binary, Opcode::I64X2Ne\ni64x2.lt_s, TokenType::Binary, Opcode::I64X2LtS\ni64x2.gt_s, TokenType::Binary, Opcode::I64X2GtS\ni64x2.le_s, TokenType::Binary, Opcode::I64X2LeS\ni64x2.ge_s, TokenType::Binary, Opcode::I64X2GeS\ni64x2.abs, TokenType::Unary, Opcode::I64X2Abs\ni64x2.neg, TokenType::Unary, Opcode::I64X2Neg\ni64x2.all_true, TokenType::Unary, Opcode::I64X2AllTrue\ni64x2.bitmask, TokenType::Unary, Opcode::I64X2Bitmask\ni64x2.extend_low_i32x4_s, TokenType::Unary, Opcode::I64X2ExtendLowI32X4S\ni64x2.extend_high_i32x4_s, TokenType::Unary, Opcode::I64X2ExtendHighI32X4S\ni64x2.extend_low_i32x4_u, TokenType::Unary, Opcode::I64X2ExtendLowI32X4U\ni64x2.extend_high_i32x4_u, TokenType::Unary, Opcode::I64X2ExtendHighI32X4U\ni64x2.relaxed_laneselect, TokenType::Ternary, Opcode::I64X2RelaxedLaneSelect\ni64x2.replace_lane, TokenType::SimdLaneOp, Opcode::I64X2ReplaceLane\ni64x2.shl, TokenType::Binary, Opcode::I64X2Shl\ni64x2.shr_s, TokenType::Binary, Opcode::I64X2ShrS\ni64x2.shr_u, TokenType::Binary, Opcode::I64X2ShrU\ni64x2.splat, TokenType::Unary, Opcode::I64X2Splat\ni64x2.sub, TokenType::Binary, Opcode::I64X2Sub\ni64x2.extmul_low_i32x4_s, TokenType::Binary, Opcode::I64X2ExtmulLowI32X4S\ni64x2.extmul_high_i32x4_s, TokenType::Binary, Opcode::I64X2ExtmulHighI32X4S\ni64x2.extmul_low_i32x4_u, TokenType::Binary, Opcode::I64X2ExtmulLowI32X4U\ni64x2.extmul_high_i32x4_u, TokenType::Binary, Opcode::I64X2ExtmulHighI32X4U\ni64x2, TokenType::I64X2\ni64.xor, TokenType::Binary, Opcode::I64Xor\ni8x16.abs, TokenType::Unary, Opcode::I8X16Abs\ni8x16.add_sat_s, TokenType::Binary, Opcode::I8X16AddSatS\ni8x16.add_sat_u, TokenType::Binary, Opcode::I8X16AddSatU\ni8x16.add, TokenType::Binary, Opcode::I8X16Add\ni8x16.all_true, TokenType::Unary, Opcode::I8X16AllTrue\ni8x16.avgr_u, TokenType::Binary, Opcode::I8X16AvgrU\ni8x16.bitmask, TokenType::Unary, Opcode::I8X16Bitmask\ni8x16.eq, TokenType::Compare, Opcode::I8X16Eq\ni8x16.extract_lane_s, TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneS\ni8x16.extract_lane_u, TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneU\ni8x16.ge_s, TokenType::Compare, Opcode::I8X16GeS\ni8x16.ge_u, TokenType::Compare, Opcode::I8X16GeU\ni8x16.gt_s, TokenType::Compare, Opcode::I8X16GtS\ni8x16.gt_u, TokenType::Compare, Opcode::I8X16GtU\ni8x16.le_s, TokenType::Compare, Opcode::I8X16LeS\ni8x16.le_u, TokenType::Compare, Opcode::I8X16LeU\ni8x16.lt_s, TokenType::Compare, Opcode::I8X16LtS\ni8x16.lt_u, TokenType::Compare, Opcode::I8X16LtU\ni8x16.max_s, TokenType::Binary, Opcode::I8X16MaxS\ni8x16.max_u, TokenType::Binary, Opcode::I8X16MaxU\ni8x16.min_s, TokenType::Binary, Opcode::I8X16MinS\ni8x16.min_u, TokenType::Binary, Opcode::I8X16MinU\ni8x16.narrow_i16x8_s, TokenType::Binary, Opcode::I8X16NarrowI16X8S\ni8x16.narrow_i16x8_u, TokenType::Binary, Opcode::I8X16NarrowI16X8U\ni8x16.neg, TokenType::Unary, Opcode::I8X16Neg\ni8x16.popcnt, TokenType::Unary, Opcode::I8X16Popcnt\ni8x16.ne, TokenType::Compare, Opcode::I8X16Ne\ni8x16.relaxed_swizzle, TokenType::Binary, Opcode::I8X16RelaxedSwizzle\ni8x16.relaxed_laneselect, TokenType::Ternary, Opcode::I8X16RelaxedLaneSelect\ni8x16.replace_lane, TokenType::SimdLaneOp, Opcode::I8X16ReplaceLane\ni8x16.shl, TokenType::Binary, Opcode::I8X16Shl\ni8x16.shr_s, TokenType::Binary, Opcode::I8X16ShrS\ni8x16.shr_u, TokenType::Binary, Opcode::I8X16ShrU\ni8x16.splat, TokenType::Unary, Opcode::I8X16Splat\ni8x16.sub_sat_s, TokenType::Binary, Opcode::I8X16SubSatS\ni8x16.sub_sat_u, TokenType::Binary, Opcode::I8X16SubSatU\ni8x16.sub, TokenType::Binary, Opcode::I8X16Sub\ni8x16, TokenType::I8X16\nif, TokenType::If, Opcode::If\nimport, TokenType::Import\ninput, TokenType::Input\ninvoke, TokenType::Invoke\nitem, TokenType::Item\nlocal.get, TokenType::LocalGet, Opcode::LocalGet\nlocal.set, TokenType::LocalSet, Opcode::LocalSet\nlocal.tee, TokenType::LocalTee, Opcode::LocalTee\nlocal, TokenType::Local\nloop, TokenType::Loop, Opcode::Loop\nmemory.atomic.notify, TokenType::AtomicNotify, Opcode::MemoryAtomicNotify\nmemory.atomic.wait32, TokenType::AtomicWait, Opcode::MemoryAtomicWait32\nmemory.atomic.wait64, TokenType::AtomicWait, Opcode::MemoryAtomicWait64\nmemory.copy, TokenType::MemoryCopy, Opcode::MemoryCopy\nmemory.fill, TokenType::MemoryFill, Opcode::MemoryFill\nmemory.grow, TokenType::MemoryGrow, Opcode::MemoryGrow\nmemory.init, TokenType::MemoryInit, Opcode::MemoryInit\nmemory.size, TokenType::MemorySize, Opcode::MemorySize\nmemory, TokenType::Memory\nmodule, TokenType::Module\nmut, TokenType::Mut\nnan:arithmetic, TokenType::NanArithmetic\nnan:canonical, TokenType::NanCanonical\nnop, TokenType::Nop, Opcode::Nop\nnull, TokenType::Null\noffset, TokenType::Offset\noutput, TokenType::Output\npagesize, TokenType::PageSize\nparam, TokenType::Param\nref, TokenType::Ref\nquote, TokenType::Quote\nref.as_non_null, TokenType::RefAsNonNull, Opcode::RefAsNonNull\nref.extern, TokenType::RefExtern\nref.func, TokenType::RefFunc, Opcode::RefFunc\nref.is_null, TokenType::RefIsNull, Opcode::RefIsNull\nref.null, TokenType::RefNull, Opcode::RefNull\nregister, TokenType::Register\nresult, TokenType::Result\nrethrow, TokenType::Rethrow, Opcode::Rethrow\nreturn_call_indirect, TokenType::ReturnCallIndirect, Opcode::ReturnCallIndirect\nreturn_call_ref, TokenType::ReturnCallRef, Opcode::ReturnCallRef\nreturn_call, TokenType::ReturnCall, Opcode::ReturnCall\nreturn, TokenType::Return, Opcode::Return\nselect, TokenType::Select, Opcode::Select\nshared, TokenType::Shared\nstart, TokenType::Start\nstruct, Type::Struct, TokenType::Struct\ntable.copy, TokenType::TableCopy, Opcode::TableCopy\ntable.fill, TokenType::TableFill, Opcode::TableFill\ntable.get, TokenType::TableGet, Opcode::TableGet\ntable.grow, TokenType::TableGrow, Opcode::TableGrow\ntable.init, TokenType::TableInit, Opcode::TableInit\ntable.set, TokenType::TableSet, Opcode::TableSet\ntable.size, TokenType::TableSize, Opcode::TableSize\ntable, TokenType::Table\nthen, TokenType::Then\nthrow, TokenType::Throw, Opcode::Throw\nthrow_ref, TokenType::ThrowRef, Opcode::ThrowRef\ntry, TokenType::Try, Opcode::Try\ntry_table, TokenType::TryTable, Opcode::TryTable\ntype, TokenType::Type\nunreachable, TokenType::Unreachable, Opcode::Unreachable\nv128.andnot, TokenType::Binary, Opcode::V128Andnot\nv128.and, TokenType::Binary, Opcode::V128And\nv128.bitselect, TokenType::Ternary, Opcode::V128BitSelect\nv128.const, TokenType::Const, Opcode::V128Const\nv128.load, TokenType::Load, Opcode::V128Load\nv128.not, TokenType::Unary, Opcode::V128Not\nv128.or, TokenType::Binary, Opcode::V128Or\nv128.any_true, TokenType::Unary, Opcode::V128AnyTrue\nv128.load32_zero, TokenType::Load, Opcode::V128Load32Zero\nv128.load64_zero, TokenType::Load, Opcode::V128Load64Zero\nv128.store, TokenType::Store, Opcode::V128Store\nv128, Type::V128\nv128.xor, TokenType::Binary, Opcode::V128Xor\nv128.load16_splat, TokenType::Load, Opcode::V128Load16Splat\nv128.load32_splat, TokenType::Load, Opcode::V128Load32Splat\nv128.load64_splat, TokenType::Load, Opcode::V128Load64Splat\nv128.load8_splat, TokenType::Load, Opcode::V128Load8Splat\nv128.load8_lane, TokenType::SimdLoadLane, Opcode::V128Load8Lane\nv128.load16_lane, TokenType::SimdLoadLane, Opcode::V128Load16Lane\nv128.load32_lane, TokenType::SimdLoadLane, Opcode::V128Load32Lane\nv128.load64_lane, TokenType::SimdLoadLane, Opcode::V128Load64Lane\nv128.store8_lane, TokenType::SimdStoreLane, Opcode::V128Store8Lane\nv128.store16_lane, TokenType::SimdStoreLane, Opcode::V128Store16Lane\nv128.store32_lane, TokenType::SimdStoreLane, Opcode::V128Store32Lane\nv128.store64_lane, TokenType::SimdStoreLane, Opcode::V128Store64Lane\ni8x16.shuffle, TokenType::SimdShuffleOp, Opcode::I8X16Shuffle\ni8x16.swizzle, TokenType::Binary, Opcode::I8X16Swizzle\ni64.add128, TokenType::Quaternary, Opcode::I64Add128\ni64.sub128, TokenType::Quaternary, Opcode::I64Sub128\ni64.mul_wide_s, TokenType::Binary, Opcode::I64MulWideS\ni64.mul_wide_u, TokenType::Binary, Opcode::I64MulWideU\n"
  },
  {
    "path": "src/lexer-source-line-finder.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/lexer-source-line-finder.h\"\n\n#include <algorithm>\n\n#include \"wabt/lexer-source.h\"\n\nnamespace wabt {\n\nLexerSourceLineFinder::LexerSourceLineFinder(\n    std::unique_ptr<LexerSource> source)\n    : source_(std::move(source)),\n      next_line_start_(0),\n      last_cr_(false),\n      eof_(false) {\n  source_->Seek(0);\n  // Line 0 should not be used; but it makes indexing simpler.\n  line_ranges_.emplace_back(0, 0);\n}\n\nResult LexerSourceLineFinder::GetSourceLine(const Location& loc,\n                                            Offset max_line_length,\n                                            SourceLine* out_source_line) {\n  ColumnRange column_range(loc.first_column, loc.last_column);\n  OffsetRange original;\n  CHECK_RESULT(GetLineOffsets(loc.line, &original));\n\n  OffsetRange clamped =\n      ClampSourceLineOffsets(original, column_range, max_line_length);\n  bool has_start_ellipsis = original.start != clamped.start;\n  bool has_end_ellipsis = original.end != clamped.end;\n\n  out_source_line->column_offset = clamped.start - original.start;\n\n  if (has_start_ellipsis) {\n    out_source_line->line += \"...\";\n    clamped.start += 3;\n  }\n  if (has_end_ellipsis) {\n    clamped.end -= 3;\n  }\n\n  std::vector<char> read_line;\n  CHECK_RESULT(source_->ReadRange(clamped, &read_line));\n  out_source_line->line.append(read_line.begin(), read_line.end());\n\n  if (has_end_ellipsis) {\n    out_source_line->line += \"...\";\n  }\n\n  return Result::Ok;\n}\n\nbool LexerSourceLineFinder::IsLineCached(int line) const {\n  return static_cast<size_t>(line) < line_ranges_.size();\n}\n\nOffsetRange LexerSourceLineFinder::GetCachedLine(int line) const {\n  assert(IsLineCached(line));\n  return line_ranges_[line];\n}\n\nResult LexerSourceLineFinder::GetLineOffsets(int find_line,\n                                             OffsetRange* out_range) {\n  if (IsLineCached(find_line)) {\n    *out_range = GetCachedLine(find_line);\n    return Result::Ok;\n  }\n\n  const size_t kBufferSize = 1 << 16;\n  std::vector<char> buffer(kBufferSize);\n\n  assert(!line_ranges_.empty());\n  Offset buffer_file_offset = 0;\n  while (!IsLineCached(find_line) && !eof_) {\n    CHECK_RESULT(source_->Tell(&buffer_file_offset));\n    size_t read_size = source_->Fill(buffer.data(), buffer.size());\n    if (read_size < buffer.size()) {\n      eof_ = true;\n    }\n\n    for (auto iter = buffer.begin(), end = iter + read_size; iter < end;\n         ++iter) {\n      if (*iter == '\\n') {\n        // Don't include \\n or \\r in the line range.\n        Offset line_offset =\n            buffer_file_offset + (iter - buffer.begin()) - last_cr_;\n        line_ranges_.emplace_back(next_line_start_, line_offset);\n        next_line_start_ = line_offset + last_cr_ + 1;\n      }\n      last_cr_ = *iter == '\\r';\n    }\n\n    if (eof_) {\n      // Add the final line as an empty range.\n      Offset end = buffer_file_offset + read_size;\n      line_ranges_.emplace_back(next_line_start_, end);\n    }\n  }\n\n  if (IsLineCached(find_line)) {\n    *out_range = GetCachedLine(find_line);\n    return Result::Ok;\n  } else {\n    assert(eof_);\n    return Result::Error;\n  }\n}\n\n// static\nOffsetRange LexerSourceLineFinder::ClampSourceLineOffsets(\n    OffsetRange offset_range,\n    ColumnRange column_range,\n    Offset max_line_length) {\n  Offset line_length = offset_range.size();\n  if (line_length > max_line_length) {\n    size_t column_count = column_range.size();\n    size_t center_on;\n    if (column_count > max_line_length) {\n      // The column range doesn't fit, just center on first_column.\n      center_on = column_range.start - 1;\n    } else {\n      // the entire range fits, display it all in the center.\n      center_on = (column_range.start + column_range.end) / 2 - 1;\n    }\n    if (center_on > max_line_length / 2) {\n      offset_range.start += center_on - max_line_length / 2;\n    }\n    offset_range.start =\n        std::min(offset_range.start, offset_range.end - max_line_length);\n    offset_range.end = offset_range.start + max_line_length;\n  }\n\n  return offset_range;\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/lexer-source.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/lexer-source.h\"\n\n#include <algorithm>\n\nnamespace wabt {\n\nLexerSource::LexerSource(const void* data, Offset size)\n    : data_(data), size_(size), read_offset_(0) {}\n\nstd::unique_ptr<LexerSource> LexerSource::Clone() {\n  LexerSource* result = new LexerSource(data_, size_);\n  result->read_offset_ = read_offset_;\n  return std::unique_ptr<LexerSource>(result);\n}\n\nResult LexerSource::Tell(Offset* out_offset) {\n  *out_offset = read_offset_;\n  return Result::Ok;\n}\n\nsize_t LexerSource::Fill(void* dest, Offset size) {\n  Offset read_size = std::min(size, size_ - read_offset_);\n  if (read_size > 0) {\n    const void* src = static_cast<const char*>(data_) + read_offset_;\n    memcpy(dest, src, read_size);\n    read_offset_ += read_size;\n  }\n  return read_size;\n}\n\nResult LexerSource::Seek(Offset offset) {\n  if (offset < size_) {\n    read_offset_ = offset;\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult LexerSource::ReadRange(OffsetRange range, std::vector<char>* out_data) {\n  OffsetRange clamped = range;\n  clamped.start = std::min(clamped.start, size_);\n  clamped.end = std::min(clamped.end, size_);\n  if (clamped.size()) {\n    out_data->resize(clamped.size());\n    const void* src = static_cast<const char*>(data_) + clamped.start;\n    memcpy(out_data->data(), src, clamped.size());\n  }\n  return Result::Ok;\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/literal.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/literal.h\"\n\n#include <cassert>\n#include <cerrno>\n#include <cinttypes>\n#include <cmath>\n#include <cstdlib>\n#include <cstring>\n#include <limits>\n#include <type_traits>\n\nnamespace wabt {\n\nnamespace {\n\ntemplate <typename T>\nstruct FloatTraitsBase {};\n\n// The \"PlusOne\" values are used because normal IEEE floats have an implicit\n// leading one, so they have an additional bit of precision.\n\ntemplate <>\nstruct FloatTraitsBase<float> {\n  using Uint = uint32_t;\n  static constexpr int kBits = sizeof(Uint) * 8;\n  static constexpr int kSigBits = 23;\n  static constexpr float kHugeVal = HUGE_VALF;\n  static constexpr int kMaxHexBufferSize = WABT_MAX_FLOAT_HEX;\n\n  static float Strto(const char* s, char** endptr) { return strtof(s, endptr); }\n};\n\ntemplate <>\nstruct FloatTraitsBase<double> {\n  using Uint = uint64_t;\n  static constexpr int kBits = sizeof(Uint) * 8;\n  static constexpr int kSigBits = 52;\n  static constexpr float kHugeVal = HUGE_VAL;\n  static constexpr int kMaxHexBufferSize = WABT_MAX_DOUBLE_HEX;\n\n  static double Strto(const char* s, char** endptr) {\n    return strtod(s, endptr);\n  }\n};\n\ntemplate <typename T>\nstruct FloatTraits : FloatTraitsBase<T> {\n  using Uint = typename FloatTraitsBase<T>::Uint;\n  using FloatTraitsBase<T>::kBits;\n  using FloatTraitsBase<T>::kSigBits;\n\n  static constexpr int kExpBits = kBits - kSigBits - 1;\n  static constexpr int kSignShift = kBits - 1;\n  static constexpr Uint kSigMask = (Uint(1) << kSigBits) - 1;\n  static constexpr int kSigPlusOneBits = kSigBits + 1;\n  static constexpr Uint kSigPlusOneMask = (Uint(1) << kSigPlusOneBits) - 1;\n  static constexpr int kExpMask = (1 << kExpBits) - 1;\n  static constexpr int kMaxExp = 1 << (kExpBits - 1);\n  static constexpr int kMinExp = -kMaxExp + 1;\n  static constexpr int kExpBias = -kMinExp;\n  static constexpr Uint kQuietNanTag = Uint(1) << (kSigBits - 1);\n};\n\ntemplate <typename T>\nclass FloatParser {\n public:\n  using Traits = FloatTraits<T>;\n  using Uint = typename Traits::Uint;\n  using Float = T;\n\n  static Result Parse(LiteralType,\n                      const char* s,\n                      const char* end,\n                      Uint* out_bits);\n\n private:\n  static bool StringStartsWith(const char* start,\n                               const char* end,\n                               const char* prefix);\n  static Uint Make(bool sign, int exp, Uint sig);\n  static Uint ShiftAndRoundToNearest(Uint significand,\n                                     int shift,\n                                     bool seen_trailing_non_zero);\n\n  static Result ParseFloat(const char* s, const char* end, Uint* out_bits);\n  static Result ParseNan(const char* s, const char* end, Uint* out_bits);\n  static Result ParseHex(const char* s, const char* end, Uint* out_bits);\n  static void ParseInfinity(const char* s, const char* end, Uint* out_bits);\n};\n\ntemplate <typename T>\nclass FloatWriter {\n public:\n  using Traits = FloatTraits<T>;\n  using Uint = typename Traits::Uint;\n\n  static void WriteHex(char* out, size_t size, Uint bits);\n};\n\n// Return 1 if the non-NULL-terminated string starting with |start| and ending\n// with |end| starts with the NULL-terminated string |prefix|.\ntemplate <typename T>\n// static\nbool FloatParser<T>::StringStartsWith(const char* start,\n                                      const char* end,\n                                      const char* prefix) {\n  while (start < end && *prefix) {\n    if (*start != *prefix) {\n      return false;\n    }\n    start++;\n    prefix++;\n  }\n  return *prefix == 0;\n}\n\n// static\ntemplate <typename T>\nResult FloatParser<T>::ParseFloat(const char* s,\n                                  const char* end,\n                                  Uint* out_bits) {\n  // Here is the normal behavior for strtof/strtod:\n  //\n  // input     | errno  |   output   |\n  // ---------------------------------\n  // overflow  | ERANGE | +-HUGE_VAL |\n  // underflow | ERANGE |        0.0 |\n  // otherwise |      0 |      value |\n  //\n  // So normally we need to clear errno before calling strto{f,d}, and check\n  // afterward whether it was set to ERANGE.\n  //\n  // glibc seems to have a bug where\n  // strtof(\"340282356779733661637539395458142568448\") will return HUGE_VAL,\n  // but will not set errno to ERANGE. Since this function is only called when\n  // we know that we have parsed a \"normal\" number (i.e. not \"inf\"), we know\n  // that if we ever get HUGE_VAL, it must be overflow.\n  //\n  // The WebAssembly spec also ignores underflow, so we don't need to check for\n  // ERANGE at all.\n\n  // WebAssembly floats can contain underscores, but strto* can't parse those,\n  // so remove them first.\n  assert(s <= end);\n  const size_t kBufferSize = end - s + 1;  // +1 for \\0.\n  char* buffer = static_cast<char*>(alloca(kBufferSize));\n  auto buffer_end =\n      std::copy_if(s, end, buffer, [](char c) -> bool { return c != '_'; });\n  assert(buffer_end < buffer + kBufferSize);\n  *buffer_end = 0;\n\n  char* endptr;\n  Float value = Traits::Strto(buffer, &endptr);\n  if (endptr != buffer_end ||\n      (value == Traits::kHugeVal || value == -Traits::kHugeVal)) {\n    return Result::Error;\n  }\n\n  memcpy(out_bits, &value, sizeof(value));\n  return Result::Ok;\n}\n\n// static\ntemplate <typename T>\ntypename FloatParser<T>::Uint FloatParser<T>::Make(bool sign,\n                                                   int exp,\n                                                   Uint sig) {\n  assert(exp >= Traits::kMinExp && exp <= Traits::kMaxExp);\n  assert(sig <= Traits::kSigMask);\n  return (Uint(sign) << Traits::kSignShift) |\n         (Uint(exp + Traits::kExpBias) << Traits::kSigBits) | sig;\n}\n\n// static\ntemplate <typename T>\ntypename FloatParser<T>::Uint FloatParser<T>::ShiftAndRoundToNearest(\n    Uint significand,\n    int shift,\n    bool seen_trailing_non_zero) {\n  assert(shift > 0);\n  // Round ties to even.\n  if ((significand & (Uint(1) << shift)) || seen_trailing_non_zero) {\n    significand += Uint(1) << (shift - 1);\n  }\n  significand >>= shift;\n  return significand;\n}\n\n// static\ntemplate <typename T>\nResult FloatParser<T>::ParseNan(const char* s,\n                                const char* end,\n                                Uint* out_bits) {\n  bool is_neg = false;\n  if (*s == '-') {\n    is_neg = true;\n    s++;\n  } else if (*s == '+') {\n    s++;\n  }\n  assert(StringStartsWith(s, end, \"nan\"));\n  s += 3;\n\n  Uint tag;\n  if (s != end) {\n    tag = 0;\n    assert(StringStartsWith(s, end, \":0x\"));\n    s += 3;\n\n    for (; s < end; ++s) {\n      if (*s == '_') {\n        continue;\n      }\n      uint32_t digit;\n      CHECK_RESULT(ParseHexdigit(*s, &digit));\n      tag = tag * 16 + digit;\n      // Check for overflow.\n      if (tag > Traits::kSigMask) {\n        return Result::Error;\n      }\n    }\n\n    // NaN cannot have a zero tag, that is reserved for infinity.\n    if (tag == 0) {\n      return Result::Error;\n    }\n  } else {\n    tag = Traits::kQuietNanTag;\n  }\n\n  *out_bits = Make(is_neg, Traits::kMaxExp, tag);\n  return Result::Ok;\n}\n\n// static\ntemplate <typename T>\nResult FloatParser<T>::ParseHex(const char* s,\n                                const char* end,\n                                Uint* out_bits) {\n  bool is_neg = false;\n  if (*s == '-') {\n    is_neg = true;\n    s++;\n  } else if (*s == '+') {\n    s++;\n  }\n  assert(StringStartsWith(s, end, \"0x\"));\n  s += 2;\n\n  // Loop over the significand; everything up to the 'p'.\n  // This code is a bit nasty because we want to support extra zeroes anywhere\n  // without having to use many significand bits.\n  // e.g.\n  // 0x00000001.0p0 => significand = 1, significand_exponent = 0\n  // 0x10000000.0p0 => significand = 1, significand_exponent = 28\n  // 0x0.000001p0 => significand = 1, significand_exponent = -24\n  bool seen_dot = false;\n  bool seen_trailing_non_zero = false;\n  Uint significand = 0;\n  int significand_exponent = 0;  // Exponent adjustment due to dot placement.\n  for (; s < end; ++s) {\n    uint32_t digit;\n    if (*s == '_') {\n      continue;\n    } else if (*s == '.') {\n      seen_dot = true;\n    } else if (Succeeded(ParseHexdigit(*s, &digit))) {\n      if (Traits::kBits - Clz(significand) <= Traits::kSigPlusOneBits) {\n        significand = (significand << 4) + digit;\n        if (seen_dot) {\n          significand_exponent -= 4;\n        }\n      } else {\n        if (!seen_trailing_non_zero && digit != 0) {\n          seen_trailing_non_zero = true;\n        }\n        if (!seen_dot) {\n          significand_exponent += 4;\n        }\n      }\n    } else {\n      break;\n    }\n  }\n\n  if (significand == 0) {\n    // 0 or -0.\n    *out_bits = Make(is_neg, Traits::kMinExp, 0);\n    return Result::Ok;\n  }\n\n  int exponent = 0;\n  bool exponent_is_neg = false;\n  if (s < end) {\n    assert(*s == 'p' || *s == 'P');\n    s++;\n    // Exponent is always positive, but significand_exponent is signed.\n    // significand_exponent_add is negated if exponent will be negative, so it\n    // can be easily summed to see if the exponent is too large (see below).\n    int significand_exponent_add = 0;\n    if (*s == '-') {\n      exponent_is_neg = true;\n      significand_exponent_add = -significand_exponent;\n      s++;\n    } else if (*s == '+') {\n      s++;\n      significand_exponent_add = significand_exponent;\n    }\n\n    for (; s < end; ++s) {\n      if (*s == '_') {\n        continue;\n      }\n\n      uint32_t digit = (*s - '0');\n      assert(digit <= 9);\n      exponent = exponent * 10 + digit;\n      if (exponent + significand_exponent_add >= Traits::kMaxExp) {\n        break;\n      }\n    }\n  }\n\n  if (exponent_is_neg) {\n    exponent = -exponent;\n  }\n\n  int significand_bits = Traits::kBits - Clz(significand);\n  // -1 for the implicit 1 bit of the significand.\n  exponent += significand_exponent + significand_bits - 1;\n\n  if (exponent <= Traits::kMinExp) {\n    // Maybe subnormal.\n    auto update_seen_trailing_non_zero = [&](int shift) {\n      assert(shift > 0);\n      auto mask = (Uint(1) << (shift - 1)) - 1;\n      seen_trailing_non_zero |= (significand & mask) != 0;\n    };\n\n    // Normalize significand.\n    if (significand_bits > Traits::kSigBits) {\n      int shift = significand_bits - Traits::kSigBits;\n      update_seen_trailing_non_zero(shift);\n      significand >>= shift;\n    } else if (significand_bits < Traits::kSigBits) {\n      significand <<= (Traits::kSigBits - significand_bits);\n    }\n\n    int shift = Traits::kMinExp - exponent;\n    if (shift <= Traits::kSigBits) {\n      if (shift) {\n        update_seen_trailing_non_zero(shift);\n        significand =\n            ShiftAndRoundToNearest(significand, shift, seen_trailing_non_zero) &\n            Traits::kSigMask;\n      }\n      exponent = Traits::kMinExp;\n\n      if (significand != 0) {\n        *out_bits = Make(is_neg, exponent, significand);\n        return Result::Ok;\n      }\n    }\n\n    // Not subnormal, too small; return 0 or -0.\n    *out_bits = Make(is_neg, Traits::kMinExp, 0);\n  } else {\n    // Maybe Normal value.\n    if (significand_bits > Traits::kSigPlusOneBits) {\n      significand = ShiftAndRoundToNearest(\n          significand, significand_bits - Traits::kSigPlusOneBits,\n          seen_trailing_non_zero);\n      if (significand > Traits::kSigPlusOneMask) {\n        exponent++;\n      }\n    } else if (significand_bits < Traits::kSigPlusOneBits) {\n      significand <<= (Traits::kSigPlusOneBits - significand_bits);\n    }\n\n    if (exponent >= Traits::kMaxExp) {\n      // Would be inf or -inf, but the spec doesn't allow rounding hex-floats to\n      // infinity.\n      return Result::Error;\n    }\n\n    *out_bits = Make(is_neg, exponent, significand & Traits::kSigMask);\n  }\n\n  return Result::Ok;\n}\n\n// static\ntemplate <typename T>\nvoid FloatParser<T>::ParseInfinity(const char* s,\n                                   const char* end,\n                                   Uint* out_bits) {\n  bool is_neg = false;\n  if (*s == '-') {\n    is_neg = true;\n    s++;\n  } else if (*s == '+') {\n    s++;\n  }\n  assert(StringStartsWith(s, end, \"inf\"));\n  *out_bits = Make(is_neg, Traits::kMaxExp, 0);\n}\n\n// static\ntemplate <typename T>\nResult FloatParser<T>::Parse(LiteralType literal_type,\n                             const char* s,\n                             const char* end,\n                             Uint* out_bits) {\n#if COMPILER_IS_MSVC\n  if (literal_type == LiteralType::Int && StringStartsWith(s, end, \"0x\")) {\n    // Some MSVC crt implementation of strtof doesn't support hex strings\n    literal_type = LiteralType::Hexfloat;\n  }\n#endif\n  switch (literal_type) {\n    case LiteralType::Int:\n    case LiteralType::Float:\n      return ParseFloat(s, end, out_bits);\n\n    case LiteralType::Hexfloat:\n      return ParseHex(s, end, out_bits);\n\n    case LiteralType::Infinity:\n      ParseInfinity(s, end, out_bits);\n      return Result::Ok;\n\n    case LiteralType::Nan:\n      return ParseNan(s, end, out_bits);\n  }\n\n  WABT_UNREACHABLE;\n}\n\n// static\ntemplate <typename T>\nvoid FloatWriter<T>::WriteHex(char* out, size_t size, Uint bits) {\n  static constexpr int kNumNybbles = Traits::kBits / 4;\n  static constexpr int kTopNybbleShift = Traits::kBits - 4;\n  static constexpr Uint kTopNybble = Uint(0xf) << kTopNybbleShift;\n  static const char s_hex_digits[] = \"0123456789abcdef\";\n\n  char buffer[Traits::kMaxHexBufferSize];\n  char* p = buffer;\n  bool is_neg = (bits >> Traits::kSignShift);\n  int exp = ((bits >> Traits::kSigBits) & Traits::kExpMask) - Traits::kExpBias;\n  Uint sig = bits & Traits::kSigMask;\n\n  if (is_neg) {\n    *p++ = '-';\n  }\n  if (exp == Traits::kMaxExp) {\n    // Infinity or nan.\n    if (sig == 0) {\n      strcpy(p, \"inf\");\n      p += 3;\n    } else {\n      strcpy(p, \"nan\");\n      p += 3;\n      if (sig != Traits::kQuietNanTag) {\n        strcpy(p, \":0x\");\n        p += 3;\n        // Skip leading zeroes.\n        int num_nybbles = kNumNybbles;\n        while ((sig & kTopNybble) == 0) {\n          sig <<= 4;\n          num_nybbles--;\n        }\n        while (num_nybbles) {\n          Uint nybble = (sig >> kTopNybbleShift) & 0xf;\n          *p++ = s_hex_digits[nybble];\n          sig <<= 4;\n          --num_nybbles;\n        }\n      }\n    }\n  } else {\n    bool is_zero = sig == 0 && exp == Traits::kMinExp;\n    strcpy(p, \"0x\");\n    p += 2;\n    *p++ = is_zero ? '0' : '1';\n\n    // Shift sig up so the top 4-bits are at the top of the Uint.\n    sig <<= Traits::kBits - Traits::kSigBits;\n\n    if (sig) {\n      if (exp == Traits::kMinExp) {\n        // Subnormal; shift the significand up, and shift out the implicit 1.\n        Uint leading_zeroes = Clz(sig);\n        if (leading_zeroes < Traits::kSignShift) {\n          sig <<= leading_zeroes + 1;\n        } else {\n          sig = 0;\n        }\n        exp -= leading_zeroes;\n      }\n\n      *p++ = '.';\n      while (sig) {\n        int nybble = (sig >> kTopNybbleShift) & 0xf;\n        *p++ = s_hex_digits[nybble];\n        sig <<= 4;\n      }\n    }\n    *p++ = 'p';\n    if (is_zero) {\n      strcpy(p, \"+0\");\n      p += 2;\n    } else {\n      if (exp < 0) {\n        *p++ = '-';\n        exp = -exp;\n      } else {\n        *p++ = '+';\n      }\n      if (exp >= 1000) {\n        *p++ = '1';\n      }\n      if (exp >= 100) {\n        *p++ = '0' + (exp / 100) % 10;\n      }\n      if (exp >= 10) {\n        *p++ = '0' + (exp / 10) % 10;\n      }\n      *p++ = '0' + exp % 10;\n    }\n  }\n\n  size_t len = p - buffer;\n  if (len >= size) {\n    len = size - 1;\n  }\n  memcpy(out, buffer, len);\n  out[len] = '\\0';\n}\n\n}  // end anonymous namespace\n\nResult ParseHexdigit(char c, uint32_t* out) {\n  if (static_cast<unsigned int>(c - '0') <= 9) {\n    *out = c - '0';\n    return Result::Ok;\n  } else if (static_cast<unsigned int>(c - 'a') < 6) {\n    *out = 10 + (c - 'a');\n    return Result::Ok;\n  } else if (static_cast<unsigned int>(c - 'A') < 6) {\n    *out = 10 + (c - 'A');\n    return Result::Ok;\n  }\n  return Result::Error;\n}\n\nResult ParseUint64(const char* s, const char* end, uint64_t* out) {\n  if (s == end) {\n    return Result::Error;\n  }\n  uint64_t value = 0;\n  if (*s == '0' && s + 1 < end && s[1] == 'x') {\n    s += 2;\n    if (s == end) {\n      return Result::Error;\n    }\n    constexpr uint64_t kMaxDiv16 = UINT64_MAX / 16;\n    constexpr uint64_t kMaxMod16 = UINT64_MAX % 16;\n    for (; s < end; ++s) {\n      uint32_t digit;\n      if (*s == '_') {\n        continue;\n      }\n      CHECK_RESULT(ParseHexdigit(*s, &digit));\n      // Check for overflow.\n      if (value > kMaxDiv16 || (value == kMaxDiv16 && digit > kMaxMod16)) {\n        return Result::Error;\n      }\n      value = value * 16 + digit;\n    }\n  } else {\n    constexpr uint64_t kMaxDiv10 = UINT64_MAX / 10;\n    constexpr uint64_t kMaxMod10 = UINT64_MAX % 10;\n    for (; s < end; ++s) {\n      if (*s == '_') {\n        continue;\n      }\n      uint32_t digit = (*s - '0');\n      if (digit > 9) {\n        return Result::Error;\n      }\n      // Check for overflow.\n      if (value > kMaxDiv10 || (value == kMaxDiv10 && digit > kMaxMod10)) {\n        return Result::Error;\n      }\n      value = value * 10 + digit;\n    }\n  }\n  if (s != end) {\n    return Result::Error;\n  }\n  *out = value;\n  return Result::Ok;\n}\n\nResult ParseInt64(const char* s,\n                  const char* end,\n                  uint64_t* out,\n                  ParseIntType parse_type) {\n  bool has_sign = false;\n  if (*s == '-' || *s == '+') {\n    if (parse_type == ParseIntType::UnsignedOnly) {\n      return Result::Error;\n    }\n    if (*s == '-') {\n      has_sign = true;\n    }\n    s++;\n  }\n  uint64_t value = 0;\n  Result result = ParseUint64(s, end, &value);\n  if (has_sign) {\n    // abs(INT64_MIN) == INT64_MAX + 1.\n    if (value > static_cast<uint64_t>(INT64_MAX) + 1) {\n      return Result::Error;\n    }\n    value = UINT64_MAX - value + 1;\n  }\n  *out = value;\n  return result;\n}\n\nnamespace {\nuint32_t AddWithCarry(uint32_t x, uint32_t y, uint32_t* carry) {\n  // Increments *carry if the addition overflows, otherwise leaves carry alone.\n  if ((0xffffffff - x) < y) {\n    ++*carry;\n  }\n  return x + y;\n}\n\nvoid Mul10(v128* v) {\n  // Multiply-by-10 decomposes into (x << 3) + (x << 1). We implement those\n  // operations with carrying from smaller quads of the v128 to the larger\n  // quads.\n\n  constexpr uint32_t kTopThreeBits = 0xe0000000;\n  constexpr uint32_t kTopBit = 0x80000000;\n\n  uint32_t carry_into_v1 =\n      ((v->u32(0) & kTopThreeBits) >> 29) + ((v->u32(0) & kTopBit) >> 31);\n  v->set_u32(0, AddWithCarry(v->u32(0) << 3, v->u32(0) << 1, &carry_into_v1));\n  uint32_t carry_into_v2 =\n      ((v->u32(1) & kTopThreeBits) >> 29) + ((v->u32(1) & kTopBit) >> 31);\n  v->set_u32(1, AddWithCarry(v->u32(1) << 3, v->u32(1) << 1, &carry_into_v2));\n  v->set_u32(1, AddWithCarry(v->u32(1), carry_into_v1, &carry_into_v2));\n  uint32_t carry_into_v3 =\n      ((v->u32(2) & kTopThreeBits) >> 29) + ((v->u32(2) & kTopBit) >> 31);\n  v->set_u32(2, AddWithCarry(v->u32(2) << 3, v->u32(2) << 1, &carry_into_v3));\n  v->set_u32(2, AddWithCarry(v->u32(2), carry_into_v2, &carry_into_v3));\n  v->set_u32(3, v->u32(3) * 10 + carry_into_v3);\n}\n}  // namespace\n\nResult ParseUint128(const char* s, const char* end, v128* out) {\n  if (s == end) {\n    return Result::Error;\n  }\n\n  out->set_zero();\n\n  while (true) {\n    uint32_t digit = (*s - '0');\n    if (digit > 9) {\n      return Result::Error;\n    }\n\n    uint32_t carry_into_v1 = 0;\n    uint32_t carry_into_v2 = 0;\n    uint32_t carry_into_v3 = 0;\n    uint32_t overflow = 0;\n    out->set_u32(0, AddWithCarry(out->u32(0), digit, &carry_into_v1));\n    out->set_u32(1, AddWithCarry(out->u32(1), carry_into_v1, &carry_into_v2));\n    out->set_u32(2, AddWithCarry(out->u32(2), carry_into_v2, &carry_into_v3));\n    out->set_u32(3, AddWithCarry(out->u32(3), carry_into_v3, &overflow));\n    if (overflow) {\n      return Result::Error;\n    }\n\n    ++s;\n\n    if (s == end) {\n      break;\n    }\n\n    Mul10(out);\n  }\n  return Result::Ok;\n}\n\ntemplate <typename U>\nResult ParseInt(const char* s,\n                const char* end,\n                U* out,\n                ParseIntType parse_type) {\n  using S = typename std::make_signed<U>::type;\n  uint64_t value;\n  bool has_sign = false;\n  if (*s == '-' || *s == '+') {\n    if (parse_type == ParseIntType::UnsignedOnly) {\n      return Result::Error;\n    }\n    if (*s == '-') {\n      has_sign = true;\n    }\n    s++;\n  }\n  CHECK_RESULT(ParseUint64(s, end, &value));\n\n  if (has_sign) {\n    // abs(INTN_MIN) == INTN_MAX + 1.\n    if (value > static_cast<uint64_t>(std::numeric_limits<S>::max()) + 1) {\n      return Result::Error;\n    }\n    value = std::numeric_limits<U>::max() - value + 1;\n  } else {\n    if (value > static_cast<uint64_t>(std::numeric_limits<U>::max())) {\n      return Result::Error;\n    }\n  }\n  *out = static_cast<U>(value);\n  return Result::Ok;\n}\n\nResult ParseInt8(const char* s,\n                 const char* end,\n                 uint8_t* out,\n                 ParseIntType parse_type) {\n  return ParseInt(s, end, out, parse_type);\n}\n\nResult ParseInt16(const char* s,\n                  const char* end,\n                  uint16_t* out,\n                  ParseIntType parse_type) {\n  return ParseInt(s, end, out, parse_type);\n}\n\nResult ParseInt32(const char* s,\n                  const char* end,\n                  uint32_t* out,\n                  ParseIntType parse_type) {\n  return ParseInt(s, end, out, parse_type);\n}\n\nResult ParseFloat(LiteralType literal_type,\n                  const char* s,\n                  const char* end,\n                  uint32_t* out_bits) {\n  return FloatParser<float>::Parse(literal_type, s, end, out_bits);\n}\n\nResult ParseDouble(LiteralType literal_type,\n                   const char* s,\n                   const char* end,\n                   uint64_t* out_bits) {\n  return FloatParser<double>::Parse(literal_type, s, end, out_bits);\n}\n\nvoid WriteFloatHex(char* buffer, size_t size, uint32_t bits) {\n  return FloatWriter<float>::WriteHex(buffer, size, bits);\n}\n\nvoid WriteDoubleHex(char* buffer, size_t size, uint64_t bits) {\n  return FloatWriter<double>::WriteHex(buffer, size, bits);\n}\n\nvoid WriteUint128(char* buffer, size_t size, v128 bits) {\n  uint64_t digits;\n  uint64_t remainder;\n  char reversed_buffer[40];\n  size_t len = 0;\n  do {\n    remainder = bits.u32(3);\n\n    for (int i = 3; i != 0; --i) {\n      digits = remainder / 10;\n      remainder = ((remainder - digits * 10) << 32) + bits.u32(i - 1);\n      bits.set_u32(i, digits);\n    }\n\n    digits = remainder / 10;\n    remainder = remainder - digits * 10;\n    bits.set_u32(0, digits);\n\n    char remainder_buffer[21];\n    snprintf(remainder_buffer, 21, \"%\" PRIu64, remainder);\n    int remainder_buffer_len = strlen(remainder_buffer);\n    assert(len + remainder_buffer_len < sizeof(reversed_buffer));\n    memcpy(&reversed_buffer[len], remainder_buffer, remainder_buffer_len);\n    len += remainder_buffer_len;\n  } while (!bits.is_zero());\n  size_t truncated_tail = 0;\n  if (len >= size) {\n    truncated_tail = len - size + 1;\n    len = size - 1;\n  }\n  std::reverse_copy(reversed_buffer + truncated_tail,\n                    reversed_buffer + len + truncated_tail, buffer);\n  buffer[len] = '\\0';\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/opcode-code-table.c",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/opcode-code-table.h\"\n\n#include \"wabt/config.h\"\n\n#include <stdint.h>\n\ntypedef enum WabtOpcodeEnum {\n#define WABT_OPCODE(rtype, rtype2, type1, type2, type3, mem_size, prefix, \\\n                    code, Name, text, decomp)                             \\\n  Name,\n#include \"wabt/opcode.def\"\n#undef WABT_OPCODE\n  Invalid,\n} WabtOpcodeEnum;\n\nWABT_STATIC_ASSERT(Invalid <= WABT_OPCODE_CODE_TABLE_SIZE);\n\n/* The array index calculated below must match the one in Opcode::FromCode. */\nuint32_t WabtOpcodeCodeTable[WABT_OPCODE_CODE_TABLE_SIZE] = {\n#define WABT_OPCODE(rtype, rtype2, type1, type2, type3, mem_size, prefix, \\\n                    code, Name, text, decomp)                             \\\n  [(prefix << MAX_OPCODE_BITS) + code] = Name,\n#include \"wabt/opcode.def\"\n#undef WABT_OPCODE\n};\n"
  },
  {
    "path": "src/opcode.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/opcode.h\"\n\n#include \"wabt/feature.h\"\n\nnamespace wabt {\n\n// static\nOpcode::Info Opcode::infos_[] = {\n#define WABT_OPCODE(rtype, rtype2, type1, type2, type3, mem_size, prefix, \\\n                    code, Name, text, decomp)                             \\\n  {text,                                                                  \\\n   decomp,                                                                \\\n   Type::rtype,                                                           \\\n   Type::rtype2,                                                          \\\n   {Type::type1, Type::type2, Type::type3},                               \\\n   mem_size,                                                              \\\n   prefix,                                                                \\\n   code,                                                                  \\\n   PrefixCode(prefix, code)},\n#include \"wabt/opcode.def\"\n#undef WABT_OPCODE\n\n    {\"<invalid>\",\n     \"\",\n     Type::Void,\n     Type::Void,\n     {Type::Void, Type::Void, Type::Void},\n     0,\n     0,\n     0,\n     0},\n};\n\n#define WABT_OPCODE(rtype, rtype2, type1, type2, type3, mem_size, prefix, \\\n                    code, Name, text, decomp)                             \\\n  /* static */ Opcode Opcode::Name##_Opcode(Opcode::Name);\n#include \"wabt/opcode.def\"\n#undef WABT_OPCODE\n\nOpcode::Info Opcode::GetInfo() const {\n  if (enum_ < Invalid) {\n    return infos_[enum_];\n  }\n\n  Info invalid_info = infos_[Opcode::Invalid];\n  DecodeInvalidOpcode(enum_, &invalid_info.prefix, &invalid_info.code);\n  invalid_info.prefix_code = PrefixCode(invalid_info.prefix, invalid_info.code);\n  return invalid_info;\n}\n\nbool Opcode::IsNaturallyAligned(Address alignment) const {\n  Address opcode_align = GetMemorySize();\n  return alignment == WABT_USE_NATURAL_ALIGNMENT || alignment == opcode_align;\n}\n\nAddress Opcode::GetAlignment(Address alignment) const {\n  if (alignment == WABT_USE_NATURAL_ALIGNMENT) {\n    return GetMemorySize();\n  }\n  return alignment;\n}\n\nbool Opcode::IsEnabled(const Features& features) const {\n  switch (enum_) {\n    case Opcode::Try:\n    case Opcode::Catch:\n    case Opcode::Delegate:\n    case Opcode::Throw:\n    case Opcode::ThrowRef:\n    case Opcode::TryTable:\n    case Opcode::Rethrow:\n      return features.exceptions_enabled();\n\n    case Opcode::ReturnCallIndirect:\n    case Opcode::ReturnCall:\n      return features.tail_call_enabled();\n\n    case Opcode::I32TruncSatF32S:\n    case Opcode::I32TruncSatF32U:\n    case Opcode::I32TruncSatF64S:\n    case Opcode::I32TruncSatF64U:\n    case Opcode::I64TruncSatF32S:\n    case Opcode::I64TruncSatF32U:\n    case Opcode::I64TruncSatF64S:\n    case Opcode::I64TruncSatF64U:\n      return features.sat_float_to_int_enabled();\n\n    case Opcode::I32Extend8S:\n    case Opcode::I32Extend16S:\n    case Opcode::I64Extend8S:\n    case Opcode::I64Extend16S:\n    case Opcode::I64Extend32S:\n      return features.sign_extension_enabled();\n\n    case Opcode::MemoryAtomicNotify:\n    case Opcode::MemoryAtomicWait32:\n    case Opcode::MemoryAtomicWait64:\n    case Opcode::AtomicFence:\n    case Opcode::I32AtomicLoad:\n    case Opcode::I64AtomicLoad:\n    case Opcode::I32AtomicLoad8U:\n    case Opcode::I32AtomicLoad16U:\n    case Opcode::I64AtomicLoad8U:\n    case Opcode::I64AtomicLoad16U:\n    case Opcode::I64AtomicLoad32U:\n    case Opcode::I32AtomicStore:\n    case Opcode::I64AtomicStore:\n    case Opcode::I32AtomicStore8:\n    case Opcode::I32AtomicStore16:\n    case Opcode::I64AtomicStore8:\n    case Opcode::I64AtomicStore16:\n    case Opcode::I64AtomicStore32:\n    case Opcode::I32AtomicRmwAdd:\n    case Opcode::I64AtomicRmwAdd:\n    case Opcode::I32AtomicRmw8AddU:\n    case Opcode::I32AtomicRmw16AddU:\n    case Opcode::I64AtomicRmw8AddU:\n    case Opcode::I64AtomicRmw16AddU:\n    case Opcode::I64AtomicRmw32AddU:\n    case Opcode::I32AtomicRmwSub:\n    case Opcode::I64AtomicRmwSub:\n    case Opcode::I32AtomicRmw8SubU:\n    case Opcode::I32AtomicRmw16SubU:\n    case Opcode::I64AtomicRmw8SubU:\n    case Opcode::I64AtomicRmw16SubU:\n    case Opcode::I64AtomicRmw32SubU:\n    case Opcode::I32AtomicRmwAnd:\n    case Opcode::I64AtomicRmwAnd:\n    case Opcode::I32AtomicRmw8AndU:\n    case Opcode::I32AtomicRmw16AndU:\n    case Opcode::I64AtomicRmw8AndU:\n    case Opcode::I64AtomicRmw16AndU:\n    case Opcode::I64AtomicRmw32AndU:\n    case Opcode::I32AtomicRmwOr:\n    case Opcode::I64AtomicRmwOr:\n    case Opcode::I32AtomicRmw8OrU:\n    case Opcode::I32AtomicRmw16OrU:\n    case Opcode::I64AtomicRmw8OrU:\n    case Opcode::I64AtomicRmw16OrU:\n    case Opcode::I64AtomicRmw32OrU:\n    case Opcode::I32AtomicRmwXor:\n    case Opcode::I64AtomicRmwXor:\n    case Opcode::I32AtomicRmw8XorU:\n    case Opcode::I32AtomicRmw16XorU:\n    case Opcode::I64AtomicRmw8XorU:\n    case Opcode::I64AtomicRmw16XorU:\n    case Opcode::I64AtomicRmw32XorU:\n    case Opcode::I32AtomicRmwXchg:\n    case Opcode::I64AtomicRmwXchg:\n    case Opcode::I32AtomicRmw8XchgU:\n    case Opcode::I32AtomicRmw16XchgU:\n    case Opcode::I64AtomicRmw8XchgU:\n    case Opcode::I64AtomicRmw16XchgU:\n    case Opcode::I64AtomicRmw32XchgU:\n    case Opcode::I32AtomicRmwCmpxchg:\n    case Opcode::I64AtomicRmwCmpxchg:\n    case Opcode::I32AtomicRmw8CmpxchgU:\n    case Opcode::I32AtomicRmw16CmpxchgU:\n    case Opcode::I64AtomicRmw8CmpxchgU:\n    case Opcode::I64AtomicRmw16CmpxchgU:\n    case Opcode::I64AtomicRmw32CmpxchgU:\n      return features.threads_enabled();\n\n    case Opcode::V128Const:\n    case Opcode::V128Load:\n    case Opcode::V128Store:\n    case Opcode::I8X16Splat:\n    case Opcode::I16X8Splat:\n    case Opcode::I32X4Splat:\n    case Opcode::I64X2Splat:\n    case Opcode::F32X4Splat:\n    case Opcode::F64X2Splat:\n    case Opcode::I8X16ExtractLaneS:\n    case Opcode::I8X16ExtractLaneU:\n    case Opcode::I16X8ExtractLaneS:\n    case Opcode::I16X8ExtractLaneU:\n    case Opcode::I32X4ExtractLane:\n    case Opcode::I64X2ExtractLane:\n    case Opcode::F32X4ExtractLane:\n    case Opcode::F64X2ExtractLane:\n    case Opcode::I8X16ReplaceLane:\n    case Opcode::I16X8ReplaceLane:\n    case Opcode::I32X4ReplaceLane:\n    case Opcode::I64X2ReplaceLane:\n    case Opcode::F32X4ReplaceLane:\n    case Opcode::F64X2ReplaceLane:\n    case Opcode::I8X16Add:\n    case Opcode::I16X8Add:\n    case Opcode::I32X4Add:\n    case Opcode::I64X2Add:\n    case Opcode::I8X16Sub:\n    case Opcode::I16X8Sub:\n    case Opcode::I32X4Sub:\n    case Opcode::I64X2Sub:\n    case Opcode::I16X8Mul:\n    case Opcode::I32X4Mul:\n    case Opcode::I8X16Neg:\n    case Opcode::I16X8Neg:\n    case Opcode::I32X4Neg:\n    case Opcode::I64X2Neg:\n    case Opcode::I8X16AddSatS:\n    case Opcode::I8X16AddSatU:\n    case Opcode::I16X8AddSatS:\n    case Opcode::I16X8AddSatU:\n    case Opcode::I8X16SubSatS:\n    case Opcode::I8X16SubSatU:\n    case Opcode::I16X8SubSatS:\n    case Opcode::I16X8SubSatU:\n    case Opcode::I8X16Shl:\n    case Opcode::I16X8Shl:\n    case Opcode::I32X4Shl:\n    case Opcode::I64X2Shl:\n    case Opcode::I8X16ShrS:\n    case Opcode::I8X16ShrU:\n    case Opcode::I16X8ShrS:\n    case Opcode::I16X8ShrU:\n    case Opcode::I32X4ShrS:\n    case Opcode::I32X4ShrU:\n    case Opcode::I64X2ShrS:\n    case Opcode::I64X2ShrU:\n    case Opcode::V128And:\n    case Opcode::V128Or:\n    case Opcode::V128Xor:\n    case Opcode::V128Not:\n    case Opcode::V128BitSelect:\n    case Opcode::V128AnyTrue:\n    case Opcode::I8X16Bitmask:\n    case Opcode::I16X8Bitmask:\n    case Opcode::I32X4Bitmask:\n    case Opcode::I64X2Bitmask:\n    case Opcode::I8X16AllTrue:\n    case Opcode::I16X8AllTrue:\n    case Opcode::I32X4AllTrue:\n    case Opcode::I64X2AllTrue:\n    case Opcode::I8X16Eq:\n    case Opcode::I16X8Eq:\n    case Opcode::I32X4Eq:\n    case Opcode::F32X4Eq:\n    case Opcode::F64X2Eq:\n    case Opcode::I8X16Ne:\n    case Opcode::I16X8Ne:\n    case Opcode::I32X4Ne:\n    case Opcode::F32X4Ne:\n    case Opcode::F64X2Ne:\n    case Opcode::I8X16LtS:\n    case Opcode::I8X16LtU:\n    case Opcode::I16X8LtS:\n    case Opcode::I16X8LtU:\n    case Opcode::I32X4LtS:\n    case Opcode::I32X4LtU:\n    case Opcode::F32X4Lt:\n    case Opcode::F64X2Lt:\n    case Opcode::I8X16LeS:\n    case Opcode::I8X16LeU:\n    case Opcode::I16X8LeS:\n    case Opcode::I16X8LeU:\n    case Opcode::I32X4LeS:\n    case Opcode::I32X4LeU:\n    case Opcode::F32X4Le:\n    case Opcode::F64X2Le:\n    case Opcode::I8X16GtS:\n    case Opcode::I8X16GtU:\n    case Opcode::I16X8GtS:\n    case Opcode::I16X8GtU:\n    case Opcode::I32X4GtS:\n    case Opcode::I32X4GtU:\n    case Opcode::F32X4Gt:\n    case Opcode::F64X2Gt:\n    case Opcode::I8X16GeS:\n    case Opcode::I8X16GeU:\n    case Opcode::I16X8GeS:\n    case Opcode::I16X8GeU:\n    case Opcode::I32X4GeS:\n    case Opcode::I32X4GeU:\n    case Opcode::F32X4Ge:\n    case Opcode::F64X2Ge:\n    case Opcode::F32X4Neg:\n    case Opcode::F64X2Neg:\n    case Opcode::F32X4Abs:\n    case Opcode::F64X2Abs:\n    case Opcode::F32X4Min:\n    case Opcode::F32X4PMin:\n    case Opcode::F64X2Min:\n    case Opcode::F64X2PMin:\n    case Opcode::F32X4Max:\n    case Opcode::F32X4PMax:\n    case Opcode::F64X2Max:\n    case Opcode::F64X2PMax:\n    case Opcode::F32X4Add:\n    case Opcode::F64X2Add:\n    case Opcode::F32X4Sub:\n    case Opcode::F64X2Sub:\n    case Opcode::F32X4Div:\n    case Opcode::F64X2Div:\n    case Opcode::F32X4Mul:\n    case Opcode::F64X2Mul:\n    case Opcode::F32X4Sqrt:\n    case Opcode::F64X2Sqrt:\n    case Opcode::F32X4ConvertI32X4S:\n    case Opcode::F32X4ConvertI32X4U:\n    case Opcode::I32X4TruncSatF32X4S:\n    case Opcode::I32X4TruncSatF32X4U:\n    case Opcode::I8X16Swizzle:\n    case Opcode::I8X16Shuffle:\n    case Opcode::V128Load8Splat:\n    case Opcode::V128Load16Splat:\n    case Opcode::V128Load32Splat:\n    case Opcode::V128Load64Splat:\n    case Opcode::V128Load8Lane:\n    case Opcode::V128Load16Lane:\n    case Opcode::V128Load32Lane:\n    case Opcode::V128Load64Lane:\n    case Opcode::V128Store8Lane:\n    case Opcode::V128Store16Lane:\n    case Opcode::V128Store32Lane:\n    case Opcode::V128Store64Lane:\n    case Opcode::I8X16Abs:\n    case Opcode::I16X8Abs:\n    case Opcode::I32X4Abs:\n      return features.simd_enabled();\n\n    case Opcode::I8X16RelaxedSwizzle:\n    case Opcode::I32X4RelaxedTruncF32X4S:\n    case Opcode::I32X4RelaxedTruncF32X4U:\n    case Opcode::I32X4RelaxedTruncF64X2SZero:\n    case Opcode::I32X4RelaxedTruncF64X2UZero:\n    case Opcode::F32X4RelaxedMadd:\n    case Opcode::F32X4RelaxedNmadd:\n    case Opcode::F64X2RelaxedMadd:\n    case Opcode::F64X2RelaxedNmadd:\n    case Opcode::I8X16RelaxedLaneSelect:\n    case Opcode::I16X8RelaxedLaneSelect:\n    case Opcode::I32X4RelaxedLaneSelect:\n    case Opcode::I64X2RelaxedLaneSelect:\n    case Opcode::F32X4RelaxedMin:\n    case Opcode::F32X4RelaxedMax:\n    case Opcode::F64X2RelaxedMin:\n    case Opcode::F64X2RelaxedMax:\n    case Opcode::I16X8RelaxedQ15mulrS:\n    case Opcode::I16X8DotI8X16I7X16S:\n    case Opcode::I32X4DotI8X16I7X16AddS:\n      return features.relaxed_simd_enabled();\n\n    case Opcode::MemoryInit:\n    case Opcode::DataDrop:\n    case Opcode::MemoryCopy:\n    case Opcode::MemoryFill:\n    case Opcode::TableInit:\n    case Opcode::ElemDrop:\n    case Opcode::TableCopy:\n      return features.bulk_memory_enabled();\n\n    case Opcode::TableGet:\n    case Opcode::TableSet:\n    case Opcode::TableGrow:\n    case Opcode::TableSize:\n    case Opcode::RefNull:\n    case Opcode::RefIsNull:\n      return features.reference_types_enabled();\n\n    case Opcode::CallRef:\n    case Opcode::ReturnCallRef:\n    case Opcode::BrOnNonNull:\n    case Opcode::BrOnNull:\n    case Opcode::RefAsNonNull:\n      return features.function_references_enabled();\n\n    // Interpreter opcodes are never \"enabled\".\n    case Opcode::InterpAlloca:\n    case Opcode::InterpBrUnless:\n    case Opcode::InterpCallImport:\n    case Opcode::InterpData:\n    case Opcode::InterpDropKeep:\n      return false;\n\n    default:\n      return true;\n  }\n}\n\nuint32_t Opcode::GetSimdLaneCount() const {\n  switch (enum_) {\n    case Opcode::I8X16ExtractLaneS:\n    case Opcode::I8X16ExtractLaneU:\n    case Opcode::I8X16ReplaceLane:\n    case Opcode::V128Load8Lane:\n    case Opcode::V128Store8Lane:\n      return 16;\n      break;\n    case Opcode::I16X8ExtractLaneS:\n    case Opcode::I16X8ExtractLaneU:\n    case Opcode::I16X8ReplaceLane:\n    case Opcode::V128Load16Lane:\n    case Opcode::V128Store16Lane:\n      return 8;\n      break;\n    case Opcode::F32X4ExtractLane:\n    case Opcode::F32X4ReplaceLane:\n    case Opcode::I32X4ExtractLane:\n    case Opcode::I32X4ReplaceLane:\n    case Opcode::V128Load32Lane:\n    case Opcode::V128Store32Lane:\n      return 4;\n      break;\n    case Opcode::F64X2ExtractLane:\n    case Opcode::F64X2ReplaceLane:\n    case Opcode::I64X2ExtractLane:\n    case Opcode::I64X2ReplaceLane:\n    case Opcode::V128Load64Lane:\n    case Opcode::V128Store64Lane:\n      return 2;\n      break;\n    default:\n      WABT_UNREACHABLE;\n  }\n}\n\n// Get the byte sequence for this opcode, including prefix.\nstd::vector<uint8_t> Opcode::GetBytes() const {\n  std::vector<uint8_t> result;\n  if (HasPrefix()) {\n    result.push_back(GetPrefix());\n    uint8_t buffer[5];\n    Offset length =\n        WriteU32Leb128Raw(buffer, buffer + sizeof(buffer), GetCode());\n    assert(length != 0);\n    result.insert(result.end(), buffer, buffer + length);\n  } else {\n    result.push_back(GetCode());\n  }\n  return result;\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/option-parser.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/option-parser.h\"\n\n#include <cstdarg>\n#include <cstdio>\n#include <cstring>\n\n#include \"wabt/config.h\"\n\nnamespace wabt {\n\nOptionParser::Option::Option(char short_name,\n                             const std::string& long_name,\n                             const std::string& metavar,\n                             HasArgument has_argument,\n                             const std::string& help,\n                             const Callback& callback)\n    : short_name(short_name),\n      long_name(long_name),\n      metavar(metavar),\n      has_argument(has_argument == HasArgument::Yes),\n      help(help),\n      callback(callback) {}\n\nOptionParser::Argument::Argument(const std::string& name,\n                                 ArgumentCount count,\n                                 const Callback& callback)\n    : name(name), count(count), callback(callback) {}\n\nOptionParser::OptionParser(const char* program_name, const char* description)\n    : program_name_(program_name),\n      description_(description),\n      on_error_([this](const std::string& message) { DefaultError(message); }) {\n  // Add common options\n  AddOption(\"help\", \"Print this help message\", [this]() {\n    PrintHelp();\n    exit(0);\n  });\n  AddOption(\"version\", \"Print version information\", []() {\n    printf(\"%s\\n\", WABT_VERSION_STRING);\n    exit(0);\n  });\n}\n\nvoid OptionParser::AddOption(const Option& option) {\n  options_.emplace_back(option);\n}\n\nvoid OptionParser::AddArgument(const std::string& name,\n                               ArgumentCount count,\n                               const Callback& callback) {\n  arguments_.emplace_back(name, count, callback);\n}\n\nvoid OptionParser::AddOption(char short_name,\n                             const char* long_name,\n                             const char* help,\n                             const NullCallback& callback) {\n  Option option(short_name, long_name, std::string(), HasArgument::No, help,\n                [callback](const char*) { callback(); });\n  AddOption(option);\n}\n\nvoid OptionParser::AddOption(const char* long_name,\n                             const char* help,\n                             const NullCallback& callback) {\n  Option option('\\0', long_name, std::string(), HasArgument::No, help,\n                [callback](const char*) { callback(); });\n  AddOption(option);\n}\n\nvoid OptionParser::AddOption(char short_name,\n                             const char* long_name,\n                             const char* metavar,\n                             const char* help,\n                             const Callback& callback) {\n  Option option(short_name, long_name, metavar, HasArgument::Yes, help,\n                callback);\n  AddOption(option);\n}\n\nvoid OptionParser::SetErrorCallback(const Callback& callback) {\n  on_error_ = callback;\n}\n\n// static\nint OptionParser::Match(const char* s,\n                        const std::string& full,\n                        bool has_argument) {\n  int i;\n  for (i = 0;; i++) {\n    if (full[i] == '\\0') {\n      // Perfect match. Return +1, so it will be preferred over a longer option\n      // with the same prefix.\n      if (s[i] == '\\0') {\n        return i + 1;\n      }\n\n      // We want to fail if s is longer than full, e.g. --foobar vs. --foo.\n      // However, if s ends with an '=', it's OK.\n      if (!(has_argument && s[i] == '=')) {\n        return -1;\n      }\n      break;\n    }\n    if (s[i] == '\\0') {\n      break;\n    }\n    if (s[i] != full[i]) {\n      return -1;\n    }\n  }\n  return i;\n}\n\nvoid OptionParser::Errorf(const char* format, ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  std::string msg(program_name_);\n  msg += \": \";\n  msg += buffer;\n  msg += \"\\nTry '--help' for more information.\";\n  on_error_(msg.c_str());\n}\n\nvoid OptionParser::DefaultError(const std::string& message) {\n  WABT_FATAL(\"%s\\n\", message.c_str());\n}\n\nvoid OptionParser::HandleArgument(size_t* arg_index, const char* arg_value) {\n  if (*arg_index >= arguments_.size()) {\n    Errorf(\"unexpected argument '%s'\", arg_value);\n    return;\n  }\n  Argument& argument = arguments_[*arg_index];\n  argument.callback(arg_value);\n  argument.handled_count++;\n\n  if (argument.count == ArgumentCount::One) {\n    (*arg_index)++;\n  }\n}\n\nvoid OptionParser::Parse(int argc, char* argv[]) {\n  size_t arg_index = 0;\n  bool processing_options = true;\n\n  for (int i = 1; i < argc; ++i) {\n    const char* arg = argv[i];\n    if (!processing_options || arg[0] != '-') {\n      // Non-option argument.\n      HandleArgument(&arg_index, arg);\n      continue;\n    }\n\n    if (arg[1] == '-') {\n      if (arg[2] == '\\0') {\n        // -- on its own means stop processing args, everything should\n        // be treated as positional.\n        processing_options = false;\n        continue;\n      }\n      // Long option.\n      int best_index = -1;\n      int best_length = 0;\n      int best_count = 0;\n      for (size_t j = 0; j < options_.size(); ++j) {\n        const Option& option = options_[j];\n        if (!option.long_name.empty()) {\n          int match_length =\n              Match(&arg[2], option.long_name, option.has_argument);\n          if (match_length > best_length) {\n            best_index = j;\n            best_length = match_length;\n            best_count = 1;\n          } else if (match_length == best_length && best_length > 0) {\n            best_count++;\n          }\n        }\n      }\n\n      if (best_count > 1) {\n        Errorf(\"ambiguous option '%s'\", arg);\n        continue;\n      } else if (best_count == 0) {\n        Errorf(\"unknown option '%s'\", arg);\n        continue;\n      }\n\n      const Option& best_option = options_[best_index];\n      const char* option_argument = nullptr;\n      if (best_option.has_argument) {\n        if (arg[best_length + 1] != 0 &&    // This byte is 0 on a full match.\n            arg[best_length + 2] == '=') {  // +2 to skip \"--\".\n          option_argument = &arg[best_length + 3];\n        } else {\n          if (i + 1 == argc ||\n              (argv[i + 1][0] == '-' && strlen(argv[i + 1]) > 1)) {\n            Errorf(\"option '--%s' requires argument\",\n                   best_option.long_name.c_str());\n            continue;\n          }\n          ++i;\n          option_argument = argv[i];\n        }\n      }\n      best_option.callback(option_argument);\n    } else {\n      // Short option.\n      if (arg[1] == '\\0') {\n        // Just \"-\".\n        HandleArgument(&arg_index, arg);\n        continue;\n      }\n\n      // Allow short names to be combined, e.g. \"-d -v\" => \"-dv\".\n      for (int k = 1; arg[k]; ++k) {\n        bool matched = false;\n        for (const Option& option : options_) {\n          if (option.short_name && arg[k] == option.short_name) {\n            const char* option_argument = nullptr;\n            if (option.has_argument) {\n              // A short option with a required argument cannot be followed\n              // by other short options_.\n              if (arg[k + 1] != '\\0') {\n                Errorf(\"option '-%c' requires argument\", option.short_name);\n                break;\n              }\n\n              if (i + 1 == argc ||\n                  (argv[i + 1][0] == '-' && strlen(argv[i + 1]) > 1)) {\n                Errorf(\"option '-%c' requires argument\", option.short_name);\n                break;\n              }\n              ++i;\n              option_argument = argv[i];\n            }\n            option.callback(option_argument);\n            matched = true;\n            break;\n          }\n        }\n\n        if (!matched) {\n          Errorf(\"unknown option '-%c'\", arg[k]);\n          continue;\n        }\n      }\n    }\n  }\n\n  // For now, all arguments must be provided. Check that the last Argument was\n  // handled at least once.\n  if (!arguments_.empty() && arguments_.back().handled_count == 0) {\n    for (size_t i = arg_index; i < arguments_.size(); ++i) {\n      if (arguments_[i].count != ArgumentCount::ZeroOrMore) {\n        Errorf(\"expected %s argument.\", arguments_[i].name.c_str());\n      }\n    }\n  }\n}\n\nvoid OptionParser::PrintHelp() {\n  printf(\"usage: %s [options]\", program_name_.c_str());\n\n  for (size_t i = 0; i < arguments_.size(); ++i) {\n    Argument& argument = arguments_[i];\n    switch (argument.count) {\n      case ArgumentCount::One:\n        printf(\" %s\", argument.name.c_str());\n        break;\n\n      case ArgumentCount::OneOrMore:\n        printf(\" %s+\", argument.name.c_str());\n        break;\n\n      case ArgumentCount::ZeroOrMore:\n        printf(\" [%s]...\", argument.name.c_str());\n        break;\n    }\n  }\n\n  printf(\"\\n\\n\");\n  printf(\"%s\\n\", description_.c_str());\n  printf(\"options:\\n\");\n\n  const size_t kExtraSpace = 8;\n  size_t longest_name_length = 0;\n  for (const Option& option : options_) {\n    size_t length;\n    if (!option.long_name.empty()) {\n      length = option.long_name.size();\n      if (!option.metavar.empty()) {\n        // +1 for '='.\n        length += option.metavar.size() + 1;\n      }\n    } else {\n      continue;\n    }\n\n    if (length > longest_name_length) {\n      longest_name_length = length;\n    }\n  }\n\n  for (const Option& option : options_) {\n    if (!option.short_name && option.long_name.empty()) {\n      continue;\n    }\n\n    std::string line;\n    if (option.short_name) {\n      line += std::string(\"  -\") + option.short_name + \", \";\n    } else {\n      line += \"      \";\n    }\n\n    std::string flag;\n    if (!option.long_name.empty()) {\n      flag = \"--\";\n      if (!option.metavar.empty()) {\n        flag += option.long_name + '=' + option.metavar;\n      } else {\n        flag += option.long_name;\n      }\n    }\n\n    // +2 for \"--\" of the long flag name.\n    size_t remaining = longest_name_length + kExtraSpace + 2 - flag.size();\n    line += flag + std::string(remaining, ' ');\n\n    if (!option.help.empty()) {\n      line += option.help;\n    }\n    printf(\"%s\\n\", line.c_str());\n  }\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/prebuilt/.clang-format",
    "content": "DisableFormat: true\nSortIncludes: false\n"
  },
  {
    "path": "src/prebuilt/lexer-keywords.cc",
    "content": "/* C++ code produced by gperf version 3.2.1 */\n/* Command-line: gperf -m 50 -L C++ -N InWordSet -E -t -c --output-file=src/prebuilt/lexer-keywords.cc src/lexer-keywords.txt  */\n/* Computed positions: -k'1,3,5-8,10,12,15,17-19,23,27,$' */\n\n#if !((' ' == 32) && ('!' == 33) && ('\"' == 34) && ('#' == 35) \\\n      && ('%' == 37) && ('&' == 38) && ('\\'' == 39) && ('(' == 40) \\\n      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \\\n      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \\\n      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \\\n      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \\\n      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \\\n      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \\\n      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \\\n      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \\\n      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \\\n      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \\\n      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \\\n      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \\\n      && ('Z' == 90) && ('[' == 91) && ('\\\\' == 92) && (']' == 93) \\\n      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \\\n      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \\\n      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \\\n      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \\\n      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \\\n      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \\\n      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \\\n      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))\n/* The character set is not based on ISO-646.  */\n#error \"gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>.\"\n#endif\n\n#line 1 \"src/lexer-keywords.txt\"\nstruct TokenInfo {\n  TokenInfo(const char* name) : name(name) {}\n  TokenInfo(const char* name, TokenType token_type)\n      : name(name), token_type(token_type) {}\n  TokenInfo(const char* name, Type value_type)\n      : name(name), token_type(TokenType::ValueType), value_type(value_type) {}\n  TokenInfo(const char* name, Type value_type, TokenType token_type)\n      : name(name), token_type(token_type), value_type(value_type) {}\n  TokenInfo(const char* name, TokenType token_type, Opcode opcode)\n      : name(name), token_type(token_type), opcode(opcode) {}\n\n  const char* name;\n  TokenType token_type;\n  union {\n    Type value_type;\n    Opcode opcode;\n  };\n};\n/* maximum key range = 2477, duplicates = 0 */\n\nclass Perfect_Hash\n{\nprivate:\n  static inline unsigned int hash (const char *str, size_t len);\npublic:\n  static struct TokenInfo *InWordSet (const char *str, size_t len);\n};\n\ninline unsigned int\nPerfect_Hash::hash (const char *str, size_t len)\n{\n  static unsigned short asso_values[] =\n    {\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507,    7, 2507, 2507,  501,\n       251,    8,   13,    7,  324,  428,   75, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507,  174,   13,   11,  891,   60,\n        58,   11,  410,    7,  320,  271,   15,   11,    9,  104,\n        13,   64,  663,  918,   14,    9,   19,    7,  538,  676,\n       271,  305,   48, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507, 2507,\n      2507, 2507, 2507, 2507, 2507, 2507, 2507\n    };\n  unsigned int hval = len;\n\n  switch (hval)\n    {\n      default:\n        hval += asso_values[static_cast<unsigned char>(str[26])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 26:\n      case 25:\n      case 24:\n      case 23:\n        hval += asso_values[static_cast<unsigned char>(str[22])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 22:\n      case 21:\n      case 20:\n      case 19:\n        hval += asso_values[static_cast<unsigned char>(str[18])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 18:\n        hval += asso_values[static_cast<unsigned char>(str[17])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 17:\n        hval += asso_values[static_cast<unsigned char>(str[16])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 16:\n      case 15:\n        hval += asso_values[static_cast<unsigned char>(str[14])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 14:\n      case 13:\n      case 12:\n        hval += asso_values[static_cast<unsigned char>(str[11])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 11:\n      case 10:\n        hval += asso_values[static_cast<unsigned char>(str[9])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 9:\n      case 8:\n        hval += asso_values[static_cast<unsigned char>(str[7])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 7:\n        hval += asso_values[static_cast<unsigned char>(str[6])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 6:\n        hval += asso_values[static_cast<unsigned char>(str[5])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 5:\n        hval += asso_values[static_cast<unsigned char>(str[4])];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 4:\n      case 3:\n        hval += asso_values[static_cast<unsigned char>(str[2]+1)];\n#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n      [[fallthrough]];\n#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n      __attribute__ ((__fallthrough__));\n#endif\n      /*FALLTHROUGH*/\n      case 2:\n      case 1:\n        hval += asso_values[static_cast<unsigned char>(str[0]+1)];\n        break;\n    }\n  return hval + asso_values[static_cast<unsigned char>(str[len - 1])];\n}\n\nstruct TokenInfo *\nPerfect_Hash::InWordSet (const char *str, size_t len)\n{\n  enum\n    {\n      TOTAL_KEYWORDS = 610,\n      MIN_WORD_LENGTH = 2,\n      MAX_WORD_LENGTH = 35,\n      MIN_HASH_VALUE = 30,\n      MAX_HASH_VALUE = 2506\n    };\n\n#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wmissing-field-initializers\"\n#endif\n  static struct TokenInfo wordlist[] =\n    {\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"},\n#line 154 \"src/lexer-keywords.txt\"\n      {\"f64\", Type::F64},\n      {\"\"}, {\"\"},\n#line 47 \"src/lexer-keywords.txt\"\n      {\"data\", TokenType::Data},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 466 \"src/lexer-keywords.txt\"\n      {\"i64\", Type::I64},\n      {\"\"}, {\"\"}, {\"\"},\n#line 557 \"src/lexer-keywords.txt\"\n      {\"mut\", TokenType::Mut},\n      {\"\"}, {\"\"}, {\"\"},\n#line 124 \"src/lexer-keywords.txt\"\n      {\"f32x4\", TokenType::F32X4},\n      {\"\"}, {\"\"},\n#line 137 \"src/lexer-keywords.txt\"\n      {\"f64.ge\", TokenType::Compare, Opcode::F64Ge},\n#line 76 \"src/lexer-keywords.txt\"\n      {\"f32.ge\", TokenType::Compare, Opcode::F32Ge},\n#line 139 \"src/lexer-keywords.txt\"\n      {\"f64.le\", TokenType::Compare, Opcode::F64Le},\n#line 78 \"src/lexer-keywords.txt\"\n      {\"f32.le\", TokenType::Compare, Opcode::F32Le},\n      {\"\"},\n#line 366 \"src/lexer-keywords.txt\"\n      {\"i32x4\", TokenType::I32X4},\n#line 147 \"src/lexer-keywords.txt\"\n      {\"f64.ne\", TokenType::Compare, Opcode::F64Ne},\n#line 86 \"src/lexer-keywords.txt\"\n      {\"f32.ne\", TokenType::Compare, Opcode::F32Ne},\n      {\"\"}, {\"\"},\n#line 146 \"src/lexer-keywords.txt\"\n      {\"f64.neg\", TokenType::Unary, Opcode::F64Neg},\n#line 85 \"src/lexer-keywords.txt\"\n      {\"f32.neg\", TokenType::Unary, Opcode::F32Neg},\n#line 556 \"src/lexer-keywords.txt\"\n      {\"module\", TokenType::Module},\n#line 579 \"src/lexer-keywords.txt\"\n      {\"return\", TokenType::Return, Opcode::Return},\n#line 442 \"src/lexer-keywords.txt\"\n      {\"i64.ne\", TokenType::Compare, Opcode::I64Ne},\n#line 299 \"src/lexer-keywords.txt\"\n      {\"i32.ne\", TokenType::Compare, Opcode::I32Ne},\n#line 138 \"src/lexer-keywords.txt\"\n      {\"f64.gt\", TokenType::Compare, Opcode::F64Gt},\n#line 77 \"src/lexer-keywords.txt\"\n      {\"f32.gt\", TokenType::Compare, Opcode::F32Gt},\n#line 141 \"src/lexer-keywords.txt\"\n      {\"f64.lt\", TokenType::Compare, Opcode::F64Lt},\n#line 80 \"src/lexer-keywords.txt\"\n      {\"f32.lt\", TokenType::Compare, Opcode::F32Lt},\n      {\"\"}, {\"\"},\n#line 572 \"src/lexer-keywords.txt\"\n      {\"ref.null\", TokenType::RefNull, Opcode::RefNull},\n#line 102 \"src/lexer-keywords.txt\"\n      {\"f32x4.ge\", TokenType::Compare, Opcode::F32X4Ge},\n      {\"\"},\n#line 104 \"src/lexer-keywords.txt\"\n      {\"f32x4.le\", TokenType::Compare, Opcode::F32X4Le},\n#line 110 \"src/lexer-keywords.txt\"\n      {\"f32x4.neg\", TokenType::Unary, Opcode::F32X4Neg},\n#line 37 \"src/lexer-keywords.txt\"\n      {\"br\", TokenType::Br, Opcode::Br},\n#line 50 \"src/lexer-keywords.txt\"\n      {\"do\", TokenType::Do},\n#line 111 \"src/lexer-keywords.txt\"\n      {\"f32x4.ne\", TokenType::Compare, Opcode::F32X4Ne},\n      {\"\"}, {\"\"},\n#line 574 \"src/lexer-keywords.txt\"\n      {\"result\", TokenType::Result},\n      {\"\"},\n#line 351 \"src/lexer-keywords.txt\"\n      {\"i32x4.neg\", TokenType::Unary, Opcode::I32X4Neg},\n#line 45 \"src/lexer-keywords.txt\"\n      {\"code\", TokenType::Code},\n#line 332 \"src/lexer-keywords.txt\"\n      {\"i32x4.ge_u\", TokenType::Compare, Opcode::I32X4GeU},\n#line 352 \"src/lexer-keywords.txt\"\n      {\"i32x4.ne\", TokenType::Compare, Opcode::I32X4Ne},\n#line 336 \"src/lexer-keywords.txt\"\n      {\"i32x4.le_u\", TokenType::Compare, Opcode::I32X4LeU},\n#line 103 \"src/lexer-keywords.txt\"\n      {\"f32x4.gt\", TokenType::Compare, Opcode::F32X4Gt},\n#line 331 \"src/lexer-keywords.txt\"\n      {\"i32x4.ge_s\", TokenType::Compare, Opcode::I32X4GeS},\n#line 105 \"src/lexer-keywords.txt\"\n      {\"f32x4.lt\", TokenType::Compare, Opcode::F32X4Lt},\n#line 335 \"src/lexer-keywords.txt\"\n      {\"i32x4.le_s\", TokenType::Compare, Opcode::I32X4LeS},\n      {\"\"},\n#line 334 \"src/lexer-keywords.txt\"\n      {\"i32x4.gt_u\", TokenType::Compare, Opcode::I32X4GtU},\n#line 591 \"src/lexer-keywords.txt\"\n      {\"table\", TokenType::Table},\n#line 344 \"src/lexer-keywords.txt\"\n      {\"i32x4.lt_u\", TokenType::Compare, Opcode::I32X4LtU},\n      {\"\"},\n#line 333 \"src/lexer-keywords.txt\"\n      {\"i32x4.gt_s\", TokenType::Compare, Opcode::I32X4GtS},\n      {\"\"},\n#line 343 \"src/lexer-keywords.txt\"\n      {\"i32x4.lt_s\", TokenType::Compare, Opcode::I32X4LtS},\n      {\"\"}, {\"\"},\n#line 145 \"src/lexer-keywords.txt\"\n      {\"f64.nearest\", TokenType::Unary, Opcode::F64Nearest},\n#line 84 \"src/lexer-keywords.txt\"\n      {\"f32.nearest\", TokenType::Unary, Opcode::F32Nearest},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 30 \"src/lexer-keywords.txt\"\n      {\"before\", TokenType::Before},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 109 \"src/lexer-keywords.txt\"\n      {\"f32x4.nearest\", TokenType::Unary, Opcode::F32X4Nearest},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 443 \"src/lexer-keywords.txt\"\n      {\"i64.or\", TokenType::Binary, Opcode::I64Or},\n#line 300 \"src/lexer-keywords.txt\"\n      {\"i32.or\", TokenType::Binary, Opcode::I32Or},\n      {\"\"},\n#line 48 \"src/lexer-keywords.txt\"\n      {\"declare\", TokenType::Declare},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 586 \"src/lexer-keywords.txt\"\n      {\"table.get\", TokenType::TableGet, Opcode::TableGet},\n#line 583 \"src/lexer-keywords.txt\"\n      {\"struct\", Type::Struct, TokenType::Struct},\n#line 589 \"src/lexer-keywords.txt\"\n      {\"table.set\", TokenType::TableSet, Opcode::TableSet},\n#line 95 \"src/lexer-keywords.txt\"\n      {\"f32x4.ceil\", TokenType::Unary, Opcode::F32X4Ceil},\n#line 188 \"src/lexer-keywords.txt\"\n      {\"func\", Type::FuncRef, TokenType::Func},\n#line 153 \"src/lexer-keywords.txt\"\n      {\"f64.trunc\", TokenType::Unary, Opcode::F64Trunc},\n#line 91 \"src/lexer-keywords.txt\"\n      {\"f32.trunc\", TokenType::Unary, Opcode::F32Trunc},\n      {\"\"}, {\"\"},\n#line 151 \"src/lexer-keywords.txt\"\n      {\"f64.store\", TokenType::Store, Opcode::F64Store},\n#line 89 \"src/lexer-keywords.txt\"\n      {\"f32.store\", TokenType::Store, Opcode::F32Store},\n      {\"\"}, {\"\"}, {\"\"},\n#line 448 \"src/lexer-keywords.txt\"\n      {\"i64.rotl\", TokenType::Binary, Opcode::I64Rotl},\n#line 305 \"src/lexer-keywords.txt\"\n      {\"i32.rotl\", TokenType::Binary, Opcode::I32Rotl},\n      {\"\"},\n#line 456 \"src/lexer-keywords.txt\"\n      {\"i64.store\", TokenType::Store, Opcode::I64Store},\n#line 312 \"src/lexer-keywords.txt\"\n      {\"i32.store\", TokenType::Store, Opcode::I32Store},\n#line 144 \"src/lexer-keywords.txt\"\n      {\"f64.mul\", TokenType::Binary, Opcode::F64Mul},\n#line 83 \"src/lexer-keywords.txt\"\n      {\"f32.mul\", TokenType::Binary, Opcode::F32Mul},\n#line 122 \"src/lexer-keywords.txt\"\n      {\"f32x4.trunc\", TokenType::Unary, Opcode::F32X4Trunc},\n      {\"\"}, {\"\"},\n#line 449 \"src/lexer-keywords.txt\"\n      {\"i64.rotr\", TokenType::Binary, Opcode::I64Rotr},\n#line 306 \"src/lexer-keywords.txt\"\n      {\"i32.rotr\", TokenType::Binary, Opcode::I32Rotr},\n      {\"\"},\n#line 441 \"src/lexer-keywords.txt\"\n      {\"i64.mul\", TokenType::Binary, Opcode::I64Mul},\n#line 298 \"src/lexer-keywords.txt\"\n      {\"i32.mul\", TokenType::Binary, Opcode::I32Mul},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 108 \"src/lexer-keywords.txt\"\n      {\"f32x4.mul\", TokenType::Binary, Opcode::F32X4Mul},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 377 \"src/lexer-keywords.txt\"\n      {\"i64.and\", TokenType::Binary, Opcode::I64And},\n#line 248 \"src/lexer-keywords.txt\"\n      {\"i32.and\", TokenType::Binary, Opcode::I32And},\n#line 94 \"src/lexer-keywords.txt\"\n      {\"f32x4.add\", TokenType::Binary, Opcode::F32X4Add},\n#line 350 \"src/lexer-keywords.txt\"\n      {\"i32x4.mul\", TokenType::Binary, Opcode::I32X4Mul},\n      {\"\"}, {\"\"},\n#line 40 \"src/lexer-keywords.txt\"\n      {\"call\", TokenType::Call, Opcode::Call},\n      {\"\"}, {\"\"}, {\"\"},\n#line 325 \"src/lexer-keywords.txt\"\n      {\"i32x4.add\", TokenType::Binary, Opcode::I32X4Add},\n      {\"\"},\n#line 561 \"src/lexer-keywords.txt\"\n      {\"null\", TokenType::Null},\n#line 49 \"src/lexer-keywords.txt\"\n      {\"delegate\", TokenType::Delegate},\n      {\"\"}, {\"\"},\n#line 545 \"src/lexer-keywords.txt\"\n      {\"local\", TokenType::Local},\n      {\"\"}, {\"\"},\n#line 128 \"src/lexer-keywords.txt\"\n      {\"f64.const\", TokenType::Const, Opcode::F64Const},\n#line 66 \"src/lexer-keywords.txt\"\n      {\"f32.const\", TokenType::Const, Opcode::F32Const},\n      {\"\"},\n#line 118 \"src/lexer-keywords.txt\"\n      {\"f32x4.replace_lane\", TokenType::SimdLaneOp, Opcode::F32X4ReplaceLane},\n      {\"\"}, {\"\"},\n#line 414 \"src/lexer-keywords.txt\"\n      {\"i64.clz\", TokenType::Unary, Opcode::I64Clz},\n#line 276 \"src/lexer-keywords.txt\"\n      {\"i32.clz\", TokenType::Unary, Opcode::I32Clz},\n#line 415 \"src/lexer-keywords.txt\"\n      {\"i64.const\", TokenType::Const, Opcode::I64Const},\n#line 277 \"src/lexer-keywords.txt\"\n      {\"i32.const\", TokenType::Const, Opcode::I32Const},\n      {\"\"},\n#line 354 \"src/lexer-keywords.txt\"\n      {\"i32x4.replace_lane\", TokenType::SimdLaneOp, Opcode::I32X4ReplaceLane},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 416 \"src/lexer-keywords.txt\"\n      {\"i64.ctz\", TokenType::Unary, Opcode::I64Ctz},\n#line 278 \"src/lexer-keywords.txt\"\n      {\"i32.ctz\", TokenType::Unary, Opcode::I32Ctz},\n#line 126 \"src/lexer-keywords.txt\"\n      {\"f64.add\", TokenType::Binary, Opcode::F64Add},\n#line 64 \"src/lexer-keywords.txt\"\n      {\"f32.add\", TokenType::Binary, Opcode::F32Add},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 376 \"src/lexer-keywords.txt\"\n      {\"i64.add\", TokenType::Binary, Opcode::I64Add},\n#line 247 \"src/lexer-keywords.txt\"\n      {\"i32.add\", TokenType::Binary, Opcode::I32Add},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 140 \"src/lexer-keywords.txt\"\n      {\"f64.load\", TokenType::Load, Opcode::F64Load},\n#line 79 \"src/lexer-keywords.txt\"\n      {\"f32.load\", TokenType::Load, Opcode::F32Load},\n#line 542 \"src/lexer-keywords.txt\"\n      {\"local.get\", TokenType::LocalGet, Opcode::LocalGet},\n      {\"\"},\n#line 543 \"src/lexer-keywords.txt\"\n      {\"local.set\", TokenType::LocalSet, Opcode::LocalSet},\n#line 580 \"src/lexer-keywords.txt\"\n      {\"select\", TokenType::Select, Opcode::Select},\n#line 544 \"src/lexer-keywords.txt\"\n      {\"local.tee\", TokenType::LocalTee, Opcode::LocalTee},\n#line 116 \"src/lexer-keywords.txt\"\n      {\"f32x4.relaxed_min\", TokenType::Binary, Opcode::F32X4RelaxedMin},\n#line 438 \"src/lexer-keywords.txt\"\n      {\"i64.load\", TokenType::Load, Opcode::I64Load},\n#line 295 \"src/lexer-keywords.txt\"\n      {\"i32.load\", TokenType::Load, Opcode::I32Load},\n      {\"\"}, {\"\"}, {\"\"},\n#line 353 \"src/lexer-keywords.txt\"\n      {\"i32x4.relaxed_laneselect\", TokenType::Ternary, Opcode::I32X4RelaxedLaneSelect},\n#line 427 \"src/lexer-keywords.txt\"\n      {\"i64.ge_u\", TokenType::Compare, Opcode::I64GeU},\n#line 286 \"src/lexer-keywords.txt\"\n      {\"i32.ge_u\", TokenType::Compare, Opcode::I32GeU},\n#line 431 \"src/lexer-keywords.txt\"\n      {\"i64.le_u\", TokenType::Compare, Opcode::I64LeU},\n#line 290 \"src/lexer-keywords.txt\"\n      {\"i32.le_u\", TokenType::Compare, Opcode::I32LeU},\n#line 426 \"src/lexer-keywords.txt\"\n      {\"i64.ge_s\", TokenType::Compare, Opcode::I64GeS},\n#line 285 \"src/lexer-keywords.txt\"\n      {\"i32.ge_s\", TokenType::Compare, Opcode::I32GeS},\n#line 430 \"src/lexer-keywords.txt\"\n      {\"i64.le_s\", TokenType::Compare, Opcode::I64LeS},\n#line 289 \"src/lexer-keywords.txt\"\n      {\"i32.le_s\", TokenType::Compare, Opcode::I32LeS},\n#line 429 \"src/lexer-keywords.txt\"\n      {\"i64.gt_u\", TokenType::Compare, Opcode::I64GtU},\n#line 288 \"src/lexer-keywords.txt\"\n      {\"i32.gt_u\", TokenType::Compare, Opcode::I32GtU},\n#line 440 \"src/lexer-keywords.txt\"\n      {\"i64.lt_u\", TokenType::Compare, Opcode::I64LtU},\n#line 297 \"src/lexer-keywords.txt\"\n      {\"i32.lt_u\", TokenType::Compare, Opcode::I32LtU},\n#line 428 \"src/lexer-keywords.txt\"\n      {\"i64.gt_s\", TokenType::Compare, Opcode::I64GtS},\n#line 287 \"src/lexer-keywords.txt\"\n      {\"i32.gt_s\", TokenType::Compare, Opcode::I32GtS},\n#line 439 \"src/lexer-keywords.txt\"\n      {\"i64.lt_s\", TokenType::Compare, Opcode::I64LtS},\n#line 296 \"src/lexer-keywords.txt\"\n      {\"i32.lt_s\", TokenType::Compare, Opcode::I32LtS},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 92 \"src/lexer-keywords.txt\"\n      {\"f32\", Type::F32},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 326 \"src/lexer-keywords.txt\"\n      {\"i32x4.all_true\", TokenType::Unary, Opcode::I32X4AllTrue},\n#line 322 \"src/lexer-keywords.txt\"\n      {\"i32\", Type::I32},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 568 \"src/lexer-keywords.txt\"\n      {\"ref.as_non_null\", TokenType::RefAsNonNull, Opcode::RefAsNonNull},\n      {\"\"}, {\"\"}, {\"\"},\n#line 459 \"src/lexer-keywords.txt\"\n      {\"i64.trunc_f32_u\", TokenType::Convert, Opcode::I64TruncF32U},\n#line 315 \"src/lexer-keywords.txt\"\n      {\"i32.trunc_f32_u\", TokenType::Convert, Opcode::I32TruncF32U},\n#line 455 \"src/lexer-keywords.txt\"\n      {\"i64.store8\", TokenType::Store, Opcode::I64Store8},\n#line 311 \"src/lexer-keywords.txt\"\n      {\"i32.store8\", TokenType::Store, Opcode::I32Store8},\n#line 458 \"src/lexer-keywords.txt\"\n      {\"i64.trunc_f32_s\", TokenType::Convert, Opcode::I64TruncF32S},\n#line 314 \"src/lexer-keywords.txt\"\n      {\"i32.trunc_f32_s\", TokenType::Convert, Opcode::I32TruncF32S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 117 \"src/lexer-keywords.txt\"\n      {\"f32x4.relaxed_nmadd\", TokenType::Ternary, Opcode::F32X4RelaxedNmadd},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 340 \"src/lexer-keywords.txt\"\n      {\"i32x4.relaxed_trunc_f64x2_u_zero\", TokenType::Unary, Opcode::I32X4RelaxedTruncF64X2UZero},\n#line 578 \"src/lexer-keywords.txt\"\n      {\"return_call\", TokenType::ReturnCall, Opcode::ReturnCall},\n#line 339 \"src/lexer-keywords.txt\"\n      {\"i32x4.relaxed_trunc_f64x2_s_zero\", TokenType::Unary, Opcode::I32X4RelaxedTruncF64X2SZero},\n#line 35 \"src/lexer-keywords.txt\"\n      {\"br_on_null\", TokenType::BrOnNull, Opcode::BrOnNull},\n#line 162 \"src/lexer-keywords.txt\"\n      {\"f64x2.ge\", TokenType::Compare, Opcode::F64X2Ge},\n      {\"\"},\n#line 164 \"src/lexer-keywords.txt\"\n      {\"f64x2.le\", TokenType::Compare, Opcode::F64X2Le},\n#line 170 \"src/lexer-keywords.txt\"\n      {\"f64x2.neg\", TokenType::Unary, Opcode::F64X2Neg},\n      {\"\"}, {\"\"},\n#line 171 \"src/lexer-keywords.txt\"\n      {\"f64x2.ne\", TokenType::Compare, Opcode::F64X2Ne},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 479 \"src/lexer-keywords.txt\"\n      {\"i64x2.neg\", TokenType::Unary, Opcode::I64X2Neg},\n      {\"\"}, {\"\"},\n#line 473 \"src/lexer-keywords.txt\"\n      {\"i64x2.ne\", TokenType::Binary, Opcode::I64X2Ne},\n      {\"\"},\n#line 163 \"src/lexer-keywords.txt\"\n      {\"f64x2.gt\", TokenType::Compare, Opcode::F64X2Gt},\n#line 477 \"src/lexer-keywords.txt\"\n      {\"i64x2.ge_s\", TokenType::Binary, Opcode::I64X2GeS},\n#line 165 \"src/lexer-keywords.txt\"\n      {\"f64x2.lt\", TokenType::Compare, Opcode::F64X2Lt},\n#line 476 \"src/lexer-keywords.txt\"\n      {\"i64x2.le_s\", TokenType::Binary, Opcode::I64X2LeS},\n      {\"\"},\n#line 413 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.store\", TokenType::AtomicStore, Opcode::I64AtomicStore},\n#line 275 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.store\", TokenType::AtomicStore, Opcode::I32AtomicStore},\n      {\"\"}, {\"\"},\n#line 475 \"src/lexer-keywords.txt\"\n      {\"i64x2.gt_s\", TokenType::Binary, Opcode::I64X2GtS},\n      {\"\"},\n#line 474 \"src/lexer-keywords.txt\"\n      {\"i64x2.lt_s\", TokenType::Binary, Opcode::I64X2LtS},\n#line 57 \"src/lexer-keywords.txt\"\n      {\"tag\", TokenType::Tag},\n      {\"\"}, {\"\"}, {\"\"},\n#line 447 \"src/lexer-keywords.txt\"\n      {\"i64.rem_u\", TokenType::Binary, Opcode::I64RemU},\n#line 304 \"src/lexer-keywords.txt\"\n      {\"i32.rem_u\", TokenType::Binary, Opcode::I32RemU},\n#line 446 \"src/lexer-keywords.txt\"\n      {\"i64.rem_s\", TokenType::Binary, Opcode::I64RemS},\n#line 303 \"src/lexer-keywords.txt\"\n      {\"i32.rem_s\", TokenType::Binary, Opcode::I32RemS},\n      {\"\"},\n#line 406 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw.or\", TokenType::AtomicRmw, Opcode::I64AtomicRmwOr},\n#line 269 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw.or\", TokenType::AtomicRmw, Opcode::I32AtomicRmwOr},\n      {\"\"},\n#line 191 \"src/lexer-keywords.txt\"\n      {\"get\", TokenType::Get},\n#line 346 \"src/lexer-keywords.txt\"\n      {\"i32x4.max_u\", TokenType::Binary, Opcode::I32X4MaxU},\n#line 169 \"src/lexer-keywords.txt\"\n      {\"f64x2.nearest\", TokenType::Unary, Opcode::F64X2Nearest},\n#line 345 \"src/lexer-keywords.txt\"\n      {\"i32x4.max_s\", TokenType::Binary, Opcode::I32X4MaxS},\n      {\"\"},\n#line 393 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw32.sub_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw32SubU},\n      {\"\"},\n#line 437 \"src/lexer-keywords.txt\"\n      {\"i64.load8_u\", TokenType::Load, Opcode::I64Load8U},\n#line 294 \"src/lexer-keywords.txt\"\n      {\"i32.load8_u\", TokenType::Load, Opcode::I32Load8U},\n#line 436 \"src/lexer-keywords.txt\"\n      {\"i64.load8_s\", TokenType::Load, Opcode::I64Load8S},\n#line 293 \"src/lexer-keywords.txt\"\n      {\"i32.load8_s\", TokenType::Load, Opcode::I32Load8S},\n      {\"\"}, {\"\"},\n#line 390 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw32.and_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw32AndU},\n#line 595 \"src/lexer-keywords.txt\"\n      {\"try\", TokenType::Try, Opcode::Try},\n#line 569 \"src/lexer-keywords.txt\"\n      {\"ref.extern\", TokenType::RefExtern},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 157 \"src/lexer-keywords.txt\"\n      {\"f64x2.ceil\", TokenType::Unary, Opcode::F64X2Ceil},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 450 \"src/lexer-keywords.txt\"\n      {\"i64.shl\", TokenType::Binary, Opcode::I64Shl},\n#line 307 \"src/lexer-keywords.txt\"\n      {\"i32.shl\", TokenType::Binary, Opcode::I32Shl},\n#line 114 \"src/lexer-keywords.txt\"\n      {\"f32x4.relaxed_madd\", TokenType::Ternary, Opcode::F32X4RelaxedMadd},\n      {\"\"}, {\"\"}, {\"\"},\n#line 127 \"src/lexer-keywords.txt\"\n      {\"f64.ceil\", TokenType::Unary, Opcode::F64Ceil},\n#line 65 \"src/lexer-keywords.txt\"\n      {\"f32.ceil\", TokenType::Unary, Opcode::F32Ceil},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 182 \"src/lexer-keywords.txt\"\n      {\"f64x2.trunc\", TokenType::Unary, Opcode::F64X2Trunc},\n#line 355 \"src/lexer-keywords.txt\"\n      {\"i32x4.shl\", TokenType::Binary, Opcode::I32X4Shl},\n      {\"\"},\n#line 498 \"src/lexer-keywords.txt\"\n      {\"i64.xor\", TokenType::Binary, Opcode::I64Xor},\n#line 375 \"src/lexer-keywords.txt\"\n      {\"i32.xor\", TokenType::Binary, Opcode::I32Xor},\n      {\"\"}, {\"\"}, {\"\"},\n#line 590 \"src/lexer-keywords.txt\"\n      {\"table.size\", TokenType::TableSize, Opcode::TableSize},\n#line 454 \"src/lexer-keywords.txt\"\n      {\"i64.store32\", TokenType::Store, Opcode::I64Store32},\n      {\"\"}, {\"\"},\n#line 168 \"src/lexer-keywords.txt\"\n      {\"f64x2.mul\", TokenType::Binary, Opcode::F64X2Mul},\n      {\"\"}, {\"\"},\n#line 573 \"src/lexer-keywords.txt\"\n      {\"register\", TokenType::Register},\n      {\"\"}, {\"\"},\n#line 389 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw32.add_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw32AddU},\n#line 156 \"src/lexer-keywords.txt\"\n      {\"f64x2.add\", TokenType::Binary, Opcode::F64X2Add},\n#line 471 \"src/lexer-keywords.txt\"\n      {\"i64x2.mul\", TokenType::Binary, Opcode::I64X2Mul},\n      {\"\"},\n#line 409 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw.xor\", TokenType::AtomicRmw, Opcode::I64AtomicRmwXor},\n#line 272 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw.xor\", TokenType::AtomicRmw, Opcode::I32AtomicRmwXor},\n      {\"\"}, {\"\"},\n#line 392 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw32.or_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw32OrU},\n#line 467 \"src/lexer-keywords.txt\"\n      {\"i64x2.add\", TokenType::Binary, Opcode::I64X2Add},\n#line 588 \"src/lexer-keywords.txt\"\n      {\"table.init\", TokenType::TableInit, Opcode::TableInit},\n      {\"\"}, {\"\"},\n#line 381 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.load\", TokenType::AtomicLoad, Opcode::I64AtomicLoad},\n#line 251 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.load\", TokenType::AtomicLoad, Opcode::I32AtomicLoad},\n#line 143 \"src/lexer-keywords.txt\"\n      {\"f64.min\", TokenType::Binary, Opcode::F64Min},\n#line 82 \"src/lexer-keywords.txt\"\n      {\"f32.min\", TokenType::Binary, Opcode::F32Min},\n      {\"\"}, {\"\"}, {\"\"},\n#line 537 \"src/lexer-keywords.txt\"\n      {\"if\", TokenType::If, Opcode::If},\n#line 178 \"src/lexer-keywords.txt\"\n      {\"f64x2.replace_lane\", TokenType::SimdLaneOp, Opcode::F64X2ReplaceLane},\n#line 566 \"src/lexer-keywords.txt\"\n      {\"ref\", TokenType::Ref},\n#line 106 \"src/lexer-keywords.txt\"\n      {\"f32x4.max\", TokenType::Binary, Opcode::F32X4Max},\n#line 554 \"src/lexer-keywords.txt\"\n      {\"memory.size\", TokenType::MemorySize, Opcode::MemorySize},\n#line 107 \"src/lexer-keywords.txt\"\n      {\"f32x4.min\", TokenType::Binary, Opcode::F32X4Min},\n      {\"\"},\n#line 592 \"src/lexer-keywords.txt\"\n      {\"then\", TokenType::Then},\n      {\"\"},\n#line 487 \"src/lexer-keywords.txt\"\n      {\"i64x2.replace_lane\", TokenType::SimdLaneOp, Opcode::I64X2ReplaceLane},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 435 \"src/lexer-keywords.txt\"\n      {\"i64.load32_u\", TokenType::Load, Opcode::I64Load32U},\n      {\"\"}, {\"\"},\n#line 55 \"src/lexer-keywords.txt\"\n      {\"else\", TokenType::Else, Opcode::Else},\n#line 434 \"src/lexer-keywords.txt\"\n      {\"i64.load32_s\", TokenType::Load, Opcode::I64Load32S},\n      {\"\"}, {\"\"},\n#line 404 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw.and\", TokenType::AtomicRmw, Opcode::I64AtomicRmwAnd},\n#line 267 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw.and\", TokenType::AtomicRmw, Opcode::I32AtomicRmwAnd},\n      {\"\"}, {\"\"}, {\"\"},\n#line 100 \"src/lexer-keywords.txt\"\n      {\"f32x4.extract_lane\", TokenType::SimdLaneOp, Opcode::F32X4ExtractLane},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 190 \"src/lexer-keywords.txt\"\n      {\"function\", TokenType::Function},\n      {\"\"},\n#line 330 \"src/lexer-keywords.txt\"\n      {\"i32x4.extract_lane\", TokenType::SimdLaneOp, Opcode::I32X4ExtractLane},\n#line 52 \"src/lexer-keywords.txt\"\n      {\"either\", TokenType::Either},\n#line 58 \"src/lexer-keywords.txt\"\n      {\"extern\", Type::ExternRef, TokenType::Extern},\n      {\"\"}, {\"\"},\n#line 176 \"src/lexer-keywords.txt\"\n      {\"f64x2.relaxed_min\", TokenType::Binary, Opcode::F64X2RelaxedMin},\n      {\"\"}, {\"\"}, {\"\"},\n#line 412 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.store8\", TokenType::AtomicStore, Opcode::I64AtomicStore8},\n#line 274 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.store8\", TokenType::AtomicStore, Opcode::I32AtomicStore8},\n#line 486 \"src/lexer-keywords.txt\"\n      {\"i64x2.relaxed_laneselect\", TokenType::Ternary, Opcode::I64X2RelaxedLaneSelect},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 397 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw8.and_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw8AndU},\n#line 260 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw8.and_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw8AndU},\n#line 338 \"src/lexer-keywords.txt\"\n      {\"i32x4.relaxed_trunc_f32x4_u\", TokenType::Unary, Opcode::I32X4RelaxedTruncF32X4U},\n#line 56 \"src/lexer-keywords.txt\"\n      {\"end\", TokenType::End, Opcode::End},\n      {\"\"}, {\"\"},\n#line 337 \"src/lexer-keywords.txt\"\n      {\"i32x4.relaxed_trunc_f32x4_s\", TokenType::Unary, Opcode::I32X4RelaxedTruncF32X4S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 60 \"src/lexer-keywords.txt\"\n      {\"exn\", Type::ExnRef, TokenType::Exn},\n      {\"\"}, {\"\"},\n#line 403 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw.add\", TokenType::AtomicRmw, Opcode::I64AtomicRmwAdd},\n#line 266 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw.add\", TokenType::AtomicRmw, Opcode::I32AtomicRmwAdd},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 571 \"src/lexer-keywords.txt\"\n      {\"ref.is_null\", TokenType::RefIsNull, Opcode::RefIsNull},\n#line 480 \"src/lexer-keywords.txt\"\n      {\"i64x2.all_true\", TokenType::Unary, Opcode::I64X2AllTrue},\n#line 433 \"src/lexer-keywords.txt\"\n      {\"i64.load16_u\", TokenType::Load, Opcode::I64Load16U},\n#line 292 \"src/lexer-keywords.txt\"\n      {\"i32.load16_u\", TokenType::Load, Opcode::I32Load16U},\n      {\"\"}, {\"\"},\n#line 432 \"src/lexer-keywords.txt\"\n      {\"i64.load16_s\", TokenType::Load, Opcode::I64Load16S},\n#line 291 \"src/lexer-keywords.txt\"\n      {\"i32.load16_s\", TokenType::Load, Opcode::I32Load16S},\n      {\"\"},\n#line 186 \"src/lexer-keywords.txt\"\n      {\"f64x2\", TokenType::F64X2},\n      {\"\"}, {\"\"},\n#line 396 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw8.add_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw8AddU},\n#line 259 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw8.add_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw8AddU},\n      {\"\"}, {\"\"}, {\"\"},\n#line 497 \"src/lexer-keywords.txt\"\n      {\"i64x2\", TokenType::I64X2},\n      {\"\"}, {\"\"}, {\"\"},\n#line 541 \"src/lexer-keywords.txt\"\n      {\"item\", TokenType::Item},\n      {\"\"}, {\"\"},\n#line 177 \"src/lexer-keywords.txt\"\n      {\"f64x2.relaxed_nmadd\", TokenType::Ternary, Opcode::F64X2RelaxedNmadd},\n      {\"\"},\n#line 187 \"src/lexer-keywords.txt\"\n      {\"field\", TokenType::Field},\n      {\"\"}, {\"\"},\n#line 34 \"src/lexer-keywords.txt\"\n      {\"br_on_non_null\", TokenType::BrOnNonNull, Opcode::BrOnNonNull},\n      {\"\"},\n#line 101 \"src/lexer-keywords.txt\"\n      {\"f32x4.floor\", TokenType::Unary, Opcode::F32X4Floor},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 380 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.load8_u\", TokenType::AtomicLoad, Opcode::I64AtomicLoad8U},\n#line 250 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.load8_u\", TokenType::AtomicLoad, Opcode::I32AtomicLoad8U},\n#line 452 \"src/lexer-keywords.txt\"\n      {\"i64.shr_u\", TokenType::Binary, Opcode::I64ShrU},\n#line 309 \"src/lexer-keywords.txt\"\n      {\"i32.shr_u\", TokenType::Binary, Opcode::I32ShrU},\n#line 451 \"src/lexer-keywords.txt\"\n      {\"i64.shr_s\", TokenType::Binary, Opcode::I64ShrS},\n#line 308 \"src/lexer-keywords.txt\"\n      {\"i32.shr_s\", TokenType::Binary, Opcode::I32ShrS},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 357 \"src/lexer-keywords.txt\"\n      {\"i32x4.shr_u\", TokenType::Binary, Opcode::I32X4ShrU},\n#line 223 \"src/lexer-keywords.txt\"\n      {\"i16x8.neg\", TokenType::Unary, Opcode::I16X8Neg},\n#line 356 \"src/lexer-keywords.txt\"\n      {\"i32x4.shr_s\", TokenType::Binary, Opcode::I32X4ShrS},\n#line 207 \"src/lexer-keywords.txt\"\n      {\"i16x8.ge_u\", TokenType::Compare, Opcode::I16X8GeU},\n#line 225 \"src/lexer-keywords.txt\"\n      {\"i16x8.ne\", TokenType::Compare, Opcode::I16X8Ne},\n#line 211 \"src/lexer-keywords.txt\"\n      {\"i16x8.le_u\", TokenType::Compare, Opcode::I16X8LeU},\n      {\"\"},\n#line 206 \"src/lexer-keywords.txt\"\n      {\"i16x8.ge_s\", TokenType::Compare, Opcode::I16X8GeS},\n      {\"\"},\n#line 210 \"src/lexer-keywords.txt\"\n      {\"i16x8.le_s\", TokenType::Compare, Opcode::I16X8LeS},\n#line 570 \"src/lexer-keywords.txt\"\n      {\"ref.func\", TokenType::RefFunc, Opcode::RefFunc},\n#line 209 \"src/lexer-keywords.txt\"\n      {\"i16x8.gt_u\", TokenType::Compare, Opcode::I16X8GtU},\n      {\"\"},\n#line 215 \"src/lexer-keywords.txt\"\n      {\"i16x8.lt_u\", TokenType::Compare, Opcode::I16X8LtU},\n      {\"\"},\n#line 208 \"src/lexer-keywords.txt\"\n      {\"i16x8.gt_s\", TokenType::Compare, Opcode::I16X8GtS},\n#line 559 \"src/lexer-keywords.txt\"\n      {\"nan:canonical\", TokenType::NanCanonical},\n#line 214 \"src/lexer-keywords.txt\"\n      {\"i16x8.lt_s\", TokenType::Compare, Opcode::I16X8LtS},\n      {\"\"}, {\"\"},\n#line 136 \"src/lexer-keywords.txt\"\n      {\"f64.floor\", TokenType::Unary, Opcode::F64Floor},\n#line 75 \"src/lexer-keywords.txt\"\n      {\"f32.floor\", TokenType::Unary, Opcode::F32Floor},\n      {\"\"}, {\"\"},\n#line 423 \"src/lexer-keywords.txt\"\n      {\"i64.extend8_s\", TokenType::Unary, Opcode::I64Extend8S},\n#line 284 \"src/lexer-keywords.txt\"\n      {\"i32.extend8_s\", TokenType::Unary, Opcode::I32Extend8S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 42 \"src/lexer-keywords.txt\"\n      {\"catch_all\", TokenType::CatchAll, Opcode::CatchAll},\n#line 242 \"src/lexer-keywords.txt\"\n      {\"i16x8\", TokenType::I16X8},\n      {\"\"}, {\"\"}, {\"\"},\n#line 461 \"src/lexer-keywords.txt\"\n      {\"i64.trunc_f64_u\", TokenType::Convert, Opcode::I64TruncF64U},\n#line 317 \"src/lexer-keywords.txt\"\n      {\"i32.trunc_f64_u\", TokenType::Convert, Opcode::I32TruncF64U},\n      {\"\"}, {\"\"},\n#line 460 \"src/lexer-keywords.txt\"\n      {\"i64.trunc_f64_s\", TokenType::Convert, Opcode::I64TruncF64S},\n#line 316 \"src/lexer-keywords.txt\"\n      {\"i32.trunc_f64_s\", TokenType::Convert, Opcode::I32TruncF64S},\n      {\"\"}, {\"\"},\n#line 348 \"src/lexer-keywords.txt\"\n      {\"i32x4.min_u\", TokenType::Binary, Opcode::I32X4MinU},\n      {\"\"},\n#line 347 \"src/lexer-keywords.txt\"\n      {\"i32x4.min_s\", TokenType::Binary, Opcode::I32X4MinS},\n      {\"\"}, {\"\"},\n#line 174 \"src/lexer-keywords.txt\"\n      {\"f64x2.relaxed_madd\", TokenType::Ternary, Opcode::F64X2RelaxedMadd},\n      {\"\"}, {\"\"}, {\"\"},\n#line 629 \"src/lexer-keywords.txt\"\n      {\"i64.mul_wide_u\", TokenType::Binary, Opcode::I64MulWideU},\n      {\"\"},\n#line 628 \"src/lexer-keywords.txt\"\n      {\"i64.mul_wide_s\", TokenType::Binary, Opcode::I64MulWideS},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 488 \"src/lexer-keywords.txt\"\n      {\"i64x2.shl\", TokenType::Binary, Opcode::I64X2Shl},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"},\n#line 558 \"src/lexer-keywords.txt\"\n      {\"nan:arithmetic\", TokenType::NanArithmetic},\n      {\"\"},\n#line 576 \"src/lexer-keywords.txt\"\n      {\"return_call_indirect\", TokenType::ReturnCallIndirect, Opcode::ReturnCallIndirect},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 399 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw8.or_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw8OrU},\n#line 262 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw8.or_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw8OrU},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 220 \"src/lexer-keywords.txt\"\n      {\"i16x8.mul\", TokenType::Binary, Opcode::I16X8Mul},\n      {\"\"},\n#line 555 \"src/lexer-keywords.txt\"\n      {\"memory\", TokenType::Memory},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 198 \"src/lexer-keywords.txt\"\n      {\"i16x8.add\", TokenType::Binary, Opcode::I16X8Add},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 422 \"src/lexer-keywords.txt\"\n      {\"i64.extend32_s\", TokenType::Unary, Opcode::I64Extend32S},\n#line 166 \"src/lexer-keywords.txt\"\n      {\"f64x2.max\", TokenType::Binary, Opcode::F64X2Max},\n      {\"\"},\n#line 167 \"src/lexer-keywords.txt\"\n      {\"f64x2.min\", TokenType::Binary, Opcode::F64X2Min},\n      {\"\"}, {\"\"}, {\"\"},\n#line 395 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw32.xor_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw32XorU},\n      {\"\"}, {\"\"}, {\"\"},\n#line 394 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw32.xchg_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw32XchgU},\n#line 142 \"src/lexer-keywords.txt\"\n      {\"f64.max\", TokenType::Binary, Opcode::F64Max},\n#line 81 \"src/lexer-keywords.txt\"\n      {\"f32.max\", TokenType::Binary, Opcode::F32Max},\n      {\"\"},\n#line 228 \"src/lexer-keywords.txt\"\n      {\"i16x8.replace_lane\", TokenType::SimdLaneOp, Opcode::I16X8ReplaceLane},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 160 \"src/lexer-keywords.txt\"\n      {\"f64x2.extract_lane\", TokenType::SimdLaneOp, Opcode::F64X2ExtractLane},\n#line 523 \"src/lexer-keywords.txt\"\n      {\"i8x16.neg\", TokenType::Unary, Opcode::I8X16Neg},\n      {\"\"},\n#line 510 \"src/lexer-keywords.txt\"\n      {\"i8x16.ge_u\", TokenType::Compare, Opcode::I8X16GeU},\n#line 525 \"src/lexer-keywords.txt\"\n      {\"i8x16.ne\", TokenType::Compare, Opcode::I8X16Ne},\n#line 514 \"src/lexer-keywords.txt\"\n      {\"i8x16.le_u\", TokenType::Compare, Opcode::I8X16LeU},\n      {\"\"},\n#line 509 \"src/lexer-keywords.txt\"\n      {\"i8x16.ge_s\", TokenType::Compare, Opcode::I8X16GeS},\n#line 468 \"src/lexer-keywords.txt\"\n      {\"i64x2.extract_lane\", TokenType::SimdLaneOp, Opcode::I64X2ExtractLane},\n#line 513 \"src/lexer-keywords.txt\"\n      {\"i8x16.le_s\", TokenType::Compare, Opcode::I8X16LeS},\n#line 72 \"src/lexer-keywords.txt\"\n      {\"f32.demote_f64\", TokenType::Convert, Opcode::F32DemoteF64},\n#line 512 \"src/lexer-keywords.txt\"\n      {\"i8x16.gt_u\", TokenType::Compare, Opcode::I8X16GtU},\n      {\"\"},\n#line 516 \"src/lexer-keywords.txt\"\n      {\"i8x16.lt_u\", TokenType::Compare, Opcode::I8X16LtU},\n#line 567 \"src/lexer-keywords.txt\"\n      {\"quote\", TokenType::Quote},\n#line 511 \"src/lexer-keywords.txt\"\n      {\"i8x16.gt_s\", TokenType::Compare, Opcode::I8X16GtS},\n      {\"\"},\n#line 515 \"src/lexer-keywords.txt\"\n      {\"i8x16.lt_s\", TokenType::Compare, Opcode::I8X16LtS},\n      {\"\"}, {\"\"},\n#line 41 \"src/lexer-keywords.txt\"\n      {\"catch\", TokenType::Catch, Opcode::Catch},\n      {\"\"}, {\"\"}, {\"\"},\n#line 408 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw.xchg\", TokenType::AtomicRmw, Opcode::I64AtomicRmwXchg},\n#line 271 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw.xchg\", TokenType::AtomicRmw, Opcode::I32AtomicRmwXchg},\n      {\"\"},\n#line 226 \"src/lexer-keywords.txt\"\n      {\"i16x8.relaxed_laneselect\", TokenType::Ternary, Opcode::I16X8RelaxedLaneSelect},\n      {\"\"}, {\"\"}, {\"\"},\n#line 563 \"src/lexer-keywords.txt\"\n      {\"output\", TokenType::Output},\n      {\"\"}, {\"\"}, {\"\"},\n#line 562 \"src/lexer-keywords.txt\"\n      {\"offset\", TokenType::Offset},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 540 \"src/lexer-keywords.txt\"\n      {\"invoke\", TokenType::Invoke},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 421 \"src/lexer-keywords.txt\"\n      {\"i64.extend16_s\", TokenType::Unary, Opcode::I64Extend16S},\n#line 283 \"src/lexer-keywords.txt\"\n      {\"i32.extend16_s\", TokenType::Unary, Opcode::I32Extend16S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 115 \"src/lexer-keywords.txt\"\n      {\"f32x4.relaxed_max\", TokenType::Binary, Opcode::F32X4RelaxedMax},\n#line 402 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw8.xor_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw8XorU},\n#line 265 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw8.xor_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw8XorU},\n#line 119 \"src/lexer-keywords.txt\"\n      {\"f32x4.splat\", TokenType::Unary, Opcode::F32X4Splat},\n      {\"\"},\n#line 32 \"src/lexer-keywords.txt\"\n      {\"block\", TokenType::Block, Opcode::Block},\n      {\"\"}, {\"\"}, {\"\"},\n#line 31 \"src/lexer-keywords.txt\"\n      {\"binary\", TokenType::Bin},\n#line 234 \"src/lexer-keywords.txt\"\n      {\"i16x8.sub_sat_u\", TokenType::Binary, Opcode::I16X8SubSatU},\n#line 358 \"src/lexer-keywords.txt\"\n      {\"i32x4.splat\", TokenType::Unary, Opcode::I32X4Splat},\n      {\"\"},\n#line 199 \"src/lexer-keywords.txt\"\n      {\"i16x8.all_true\", TokenType::Unary, Opcode::I16X8AllTrue},\n#line 233 \"src/lexer-keywords.txt\"\n      {\"i16x8.sub_sat_s\", TokenType::Binary, Opcode::I16X8SubSatS},\n      {\"\"}, {\"\"}, {\"\"},\n#line 610 \"src/lexer-keywords.txt\"\n      {\"v128\", Type::V128},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 161 \"src/lexer-keywords.txt\"\n      {\"f64x2.floor\", TokenType::Unary, Opcode::F64X2Floor},\n      {\"\"}, {\"\"}, {\"\"},\n#line 38 \"src/lexer-keywords.txt\"\n      {\"call_indirect\", TokenType::CallIndirect, Opcode::CallIndirect},\n      {\"\"}, {\"\"},\n#line 502 \"src/lexer-keywords.txt\"\n      {\"i8x16.add\", TokenType::Binary, Opcode::I8X16Add},\n      {\"\"}, {\"\"},\n#line 605 \"src/lexer-keywords.txt\"\n      {\"v128.or\", TokenType::Binary, Opcode::V128Or},\n#line 551 \"src/lexer-keywords.txt\"\n      {\"memory.fill\", TokenType::MemoryFill, Opcode::MemoryFill},\n      {\"\"}, {\"\"},\n#line 585 \"src/lexer-keywords.txt\"\n      {\"table.fill\", TokenType::TableFill, Opcode::TableFill},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 490 \"src/lexer-keywords.txt\"\n      {\"i64x2.shr_u\", TokenType::Binary, Opcode::I64X2ShrU},\n      {\"\"},\n#line 489 \"src/lexer-keywords.txt\"\n      {\"i64x2.shr_s\", TokenType::Binary, Opcode::I64X2ShrS},\n      {\"\"},\n#line 379 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.load32_u\", TokenType::AtomicLoad, Opcode::I64AtomicLoad32U},\n      {\"\"},\n#line 528 \"src/lexer-keywords.txt\"\n      {\"i8x16.replace_lane\", TokenType::SimdLaneOp, Opcode::I8X16ReplaceLane},\n#line 197 \"src/lexer-keywords.txt\"\n      {\"i16x8.add_sat_u\", TokenType::Binary, Opcode::I16X8AddSatU},\n      {\"\"},\n#line 626 \"src/lexer-keywords.txt\"\n      {\"i64.add128\", TokenType::Quaternary, Opcode::I64Add128},\n      {\"\"},\n#line 196 \"src/lexer-keywords.txt\"\n      {\"i16x8.add_sat_s\", TokenType::Binary, Opcode::I16X8AddSatS},\n      {\"\"},\n#line 604 \"src/lexer-keywords.txt\"\n      {\"v128.not\", TokenType::Unary, Opcode::V128Not},\n#line 609 \"src/lexer-keywords.txt\"\n      {\"v128.store\", TokenType::Store, Opcode::V128Store},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"},\n#line 391 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw32.cmpxchg_u\", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw32CmpxchgU},\n      {\"\"}, {\"\"},\n#line 584 \"src/lexer-keywords.txt\"\n      {\"table.copy\", TokenType::TableCopy, Opcode::TableCopy},\n      {\"\"},\n#line 411 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.store32\", TokenType::AtomicStore, Opcode::I64AtomicStore32},\n#line 217 \"src/lexer-keywords.txt\"\n      {\"i16x8.max_u\", TokenType::Binary, Opcode::I16X8MaxU},\n#line 46 \"src/lexer-keywords.txt\"\n      {\"data.drop\", TokenType::DataDrop, Opcode::DataDrop},\n#line 216 \"src/lexer-keywords.txt\"\n      {\"i16x8.max_s\", TokenType::Binary, Opcode::I16X8MaxS},\n      {\"\"}, {\"\"}, {\"\"},\n#line 113 \"src/lexer-keywords.txt\"\n      {\"f32x4.pmin\", TokenType::Binary, Opcode::F32X4PMin},\n#line 600 \"src/lexer-keywords.txt\"\n      {\"v128.and\", TokenType::Binary, Opcode::V128And},\n      {\"\"}, {\"\"},\n#line 603 \"src/lexer-keywords.txt\"\n      {\"v128.load\", TokenType::Load, Opcode::V128Load},\n#line 527 \"src/lexer-keywords.txt\"\n      {\"i8x16.relaxed_laneselect\", TokenType::Ternary, Opcode::I8X16RelaxedLaneSelect},\n      {\"\"}, {\"\"}, {\"\"},\n#line 386 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw16.sub_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw16SubU},\n#line 256 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw16.sub_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw16SubU},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 383 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw16.and_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AndU},\n#line 253 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw16.and_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AndU},\n#line 623 \"src/lexer-keywords.txt\"\n      {\"v128.store64_lane\", TokenType::SimdStoreLane, Opcode::V128Store64Lane},\n      {\"\"}, {\"\"},\n#line 425 \"src/lexer-keywords.txt\"\n      {\"i64.extend_i32_u\", TokenType::Convert, Opcode::I64ExtendI32U},\n      {\"\"},\n#line 424 \"src/lexer-keywords.txt\"\n      {\"i64.extend_i32_s\", TokenType::Convert, Opcode::I64ExtendI32S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 599 \"src/lexer-keywords.txt\"\n      {\"v128.andnot\", TokenType::Binary, Opcode::V128Andnot},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 229 \"src/lexer-keywords.txt\"\n      {\"i16x8.shl\", TokenType::Binary, Opcode::I16X8Shl},\n      {\"\"}, {\"\"}, {\"\"},\n#line 602 \"src/lexer-keywords.txt\"\n      {\"v128.const\", TokenType::Const, Opcode::V128Const},\n      {\"\"},\n#line 378 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.load16_u\", TokenType::AtomicLoad, Opcode::I64AtomicLoad16U},\n#line 249 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.load16_u\", TokenType::AtomicLoad, Opcode::I32AtomicLoad16U},\n      {\"\"},\n#line 534 \"src/lexer-keywords.txt\"\n      {\"i8x16.sub_sat_u\", TokenType::Binary, Opcode::I8X16SubSatU},\n      {\"\"}, {\"\"},\n#line 503 \"src/lexer-keywords.txt\"\n      {\"i8x16.all_true\", TokenType::Unary, Opcode::I8X16AllTrue},\n#line 533 \"src/lexer-keywords.txt\"\n      {\"i8x16.sub_sat_s\", TokenType::Binary, Opcode::I8X16SubSatS},\n      {\"\"}, {\"\"},\n#line 59 \"src/lexer-keywords.txt\"\n      {\"externref\", Type::ExternRef},\n      {\"\"},\n#line 465 \"src/lexer-keywords.txt\"\n      {\"i64.trunc_sat_f64_u\", TokenType::Convert, Opcode::I64TruncSatF64U},\n#line 321 \"src/lexer-keywords.txt\"\n      {\"i32.trunc_sat_f64_u\", TokenType::Convert, Opcode::I32TruncSatF64U},\n      {\"\"}, {\"\"},\n#line 464 \"src/lexer-keywords.txt\"\n      {\"i64.trunc_sat_f64_s\", TokenType::Convert, Opcode::I64TruncSatF64S},\n#line 320 \"src/lexer-keywords.txt\"\n      {\"i32.trunc_sat_f64_s\", TokenType::Convert, Opcode::I32TruncSatF64S},\n#line 616 \"src/lexer-keywords.txt\"\n      {\"v128.load8_lane\", TokenType::SimdLoadLane, Opcode::V128Load8Lane},\n      {\"\"},\n#line 33 \"src/lexer-keywords.txt\"\n      {\"br_if\", TokenType::BrIf, Opcode::BrIf},\n      {\"\"},\n#line 382 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw16.add_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw16AddU},\n#line 252 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw16.add_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw16AddU},\n      {\"\"}, {\"\"}, {\"\"},\n#line 615 \"src/lexer-keywords.txt\"\n      {\"v128.load8_splat\", TokenType::Load, Opcode::V128Load8Splat},\n      {\"\"}, {\"\"},\n#line 385 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw16.or_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw16OrU},\n#line 255 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw16.or_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw16OrU},\n      {\"\"},\n#line 98 \"src/lexer-keywords.txt\"\n      {\"f32x4.div\", TokenType::Binary, Opcode::F32X4Div},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 132 \"src/lexer-keywords.txt\"\n      {\"f64.convert_i64_u\", TokenType::Convert, Opcode::F64ConvertI64U},\n#line 70 \"src/lexer-keywords.txt\"\n      {\"f32.convert_i64_u\", TokenType::Convert, Opcode::F32ConvertI64U},\n#line 189 \"src/lexer-keywords.txt\"\n      {\"funcref\", Type::FuncRef},\n#line 553 \"src/lexer-keywords.txt\"\n      {\"memory.init\", TokenType::MemoryInit, Opcode::MemoryInit},\n#line 131 \"src/lexer-keywords.txt\"\n      {\"f64.convert_i64_s\", TokenType::Convert, Opcode::F64ConvertI64S},\n#line 69 \"src/lexer-keywords.txt\"\n      {\"f32.convert_i64_s\", TokenType::Convert, Opcode::F32ConvertI64S},\n      {\"\"},\n#line 54 \"src/lexer-keywords.txt\"\n      {\"elem\", TokenType::Elem},\n      {\"\"}, {\"\"},\n#line 21 \"src/lexer-keywords.txt\"\n      {\"after\", TokenType::After},\n      {\"\"}, {\"\"},\n#line 501 \"src/lexer-keywords.txt\"\n      {\"i8x16.add_sat_u\", TokenType::Binary, Opcode::I8X16AddSatU},\n      {\"\"}, {\"\"}, {\"\"},\n#line 500 \"src/lexer-keywords.txt\"\n      {\"i8x16.add_sat_s\", TokenType::Binary, Opcode::I8X16AddSatS},\n      {\"\"},\n#line 597 \"src/lexer-keywords.txt\"\n      {\"type\", TokenType::Type},\n#line 125 \"src/lexer-keywords.txt\"\n      {\"f64.abs\", TokenType::Unary, Opcode::F64Abs},\n#line 63 \"src/lexer-keywords.txt\"\n      {\"f32.abs\", TokenType::Unary, Opcode::F32Abs},\n      {\"\"}, {\"\"}, {\"\"},\n#line 213 \"src/lexer-keywords.txt\"\n      {\"v128.load8x8_u\", TokenType::Load, Opcode::V128Load8X8U},\n      {\"\"},\n#line 212 \"src/lexer-keywords.txt\"\n      {\"v128.load8x8_s\", TokenType::Load, Opcode::V128Load8X8S},\n      {\"\"},\n#line 349 \"src/lexer-keywords.txt\"\n      {\"i32x4.dot_i16x8_s\", TokenType::Binary, Opcode::I32X4DotI16X8S},\n#line 121 \"src/lexer-keywords.txt\"\n      {\"f32x4.sub\", TokenType::Binary, Opcode::F32X4Sub},\n      {\"\"},\n#line 582 \"src/lexer-keywords.txt\"\n      {\"start\", TokenType::Start},\n      {\"\"},\n#line 93 \"src/lexer-keywords.txt\"\n      {\"f32x4.abs\", TokenType::Unary, Opcode::F32X4Abs},\n      {\"\"}, {\"\"},\n#line 518 \"src/lexer-keywords.txt\"\n      {\"i8x16.max_u\", TokenType::Binary, Opcode::I8X16MaxU},\n#line 359 \"src/lexer-keywords.txt\"\n      {\"i32x4.sub\", TokenType::Binary, Opcode::I32X4Sub},\n#line 517 \"src/lexer-keywords.txt\"\n      {\"i8x16.max_s\", TokenType::Binary, Opcode::I8X16MaxS},\n      {\"\"}, {\"\"},\n#line 324 \"src/lexer-keywords.txt\"\n      {\"i32x4.abs\", TokenType::Unary, Opcode::I32X4Abs},\n#line 453 \"src/lexer-keywords.txt\"\n      {\"i64.store16\", TokenType::Store, Opcode::I64Store16},\n#line 310 \"src/lexer-keywords.txt\"\n      {\"i32.store16\", TokenType::Store, Opcode::I32Store16},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 536 \"src/lexer-keywords.txt\"\n      {\"i8x16\", TokenType::I8X16},\n      {\"\"}, {\"\"},\n#line 539 \"src/lexer-keywords.txt\"\n      {\"input\", TokenType::Input},\n      {\"\"}, {\"\"}, {\"\"},\n#line 598 \"src/lexer-keywords.txt\"\n      {\"unreachable\", TokenType::Unreachable, Opcode::Unreachable},\n      {\"\"},\n#line 175 \"src/lexer-keywords.txt\"\n      {\"f64x2.relaxed_max\", TokenType::Binary, Opcode::F64X2RelaxedMax},\n      {\"\"}, {\"\"},\n#line 179 \"src/lexer-keywords.txt\"\n      {\"f64x2.splat\", TokenType::Unary, Opcode::F64X2Splat},\n      {\"\"}, {\"\"},\n#line 368 \"src/lexer-keywords.txt\"\n      {\"i32x4.trunc_sat_f32x4_u\", TokenType::Unary, Opcode::I32X4TruncSatF32X4U},\n      {\"\"}, {\"\"},\n#line 538 \"src/lexer-keywords.txt\"\n      {\"import\", TokenType::Import},\n#line 367 \"src/lexer-keywords.txt\"\n      {\"i32x4.trunc_sat_f32x4_s\", TokenType::Unary, Opcode::I32X4TruncSatF32X4S},\n#line 491 \"src/lexer-keywords.txt\"\n      {\"i64x2.splat\", TokenType::Unary, Opcode::I64X2Splat},\n      {\"\"}, {\"\"}, {\"\"},\n#line 618 \"src/lexer-keywords.txt\"\n      {\"v128.load32_lane\", TokenType::SimdLoadLane, Opcode::V128Load32Lane},\n#line 529 \"src/lexer-keywords.txt\"\n      {\"i8x16.shl\", TokenType::Binary, Opcode::I8X16Shl},\n      {\"\"}, {\"\"},\n#line 150 \"src/lexer-keywords.txt\"\n      {\"f64.sqrt\", TokenType::Unary, Opcode::F64Sqrt},\n#line 88 \"src/lexer-keywords.txt\"\n      {\"f32.sqrt\", TokenType::Unary, Opcode::F32Sqrt},\n#line 43 \"src/lexer-keywords.txt\"\n      {\"catch_ref\", TokenType::CatchRef},\n      {\"\"},\n#line 596 \"src/lexer-keywords.txt\"\n      {\"try_table\", TokenType::TryTable, Opcode::TryTable},\n      {\"\"}, {\"\"},\n#line 620 \"src/lexer-keywords.txt\"\n      {\"v128.store8_lane\", TokenType::SimdStoreLane, Opcode::V128Store8Lane},\n      {\"\"},\n#line 120 \"src/lexer-keywords.txt\"\n      {\"f32x4.sqrt\", TokenType::Unary, Opcode::F32X4Sqrt},\n      {\"\"}, {\"\"}, {\"\"},\n#line 36 \"src/lexer-keywords.txt\"\n      {\"br_table\", TokenType::BrTable, Opcode::BrTable},\n      {\"\"}, {\"\"}, {\"\"},\n#line 194 \"src/lexer-keywords.txt\"\n      {\"global\", TokenType::Global},\n      {\"\"}, {\"\"},\n#line 613 \"src/lexer-keywords.txt\"\n      {\"v128.load32_splat\", TokenType::Load, Opcode::V128Load32Splat},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"},\n#line 581 \"src/lexer-keywords.txt\"\n      {\"shared\", TokenType::Shared},\n      {\"\"}, {\"\"},\n#line 231 \"src/lexer-keywords.txt\"\n      {\"i16x8.shr_u\", TokenType::Binary, Opcode::I16X8ShrU},\n      {\"\"},\n#line 230 \"src/lexer-keywords.txt\"\n      {\"i16x8.shr_s\", TokenType::Binary, Opcode::I16X8ShrS},\n#line 401 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw8.xchg_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw8XchgU},\n#line 264 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw8.xchg_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw8XchgU},\n#line 607 \"src/lexer-keywords.txt\"\n      {\"v128.load32_zero\", TokenType::Load, Opcode::V128Load32Zero},\n      {\"\"}, {\"\"},\n#line 420 \"src/lexer-keywords.txt\"\n      {\"i64.eqz\", TokenType::Convert, Opcode::I64Eqz},\n#line 282 \"src/lexer-keywords.txt\"\n      {\"i32.eqz\", TokenType::Convert, Opcode::I32Eqz},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 611 \"src/lexer-keywords.txt\"\n      {\"v128.xor\", TokenType::Binary, Opcode::V128Xor},\n      {\"\"}, {\"\"},\n#line 192 \"src/lexer-keywords.txt\"\n      {\"global.get\", TokenType::GlobalGet, Opcode::GlobalGet},\n      {\"\"},\n#line 193 \"src/lexer-keywords.txt\"\n      {\"global.set\", TokenType::GlobalSet, Opcode::GlobalSet},\n      {\"\"}, {\"\"},\n#line 606 \"src/lexer-keywords.txt\"\n      {\"v128.any_true\", TokenType::Unary, Opcode::V128AnyTrue},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 173 \"src/lexer-keywords.txt\"\n      {\"f64x2.pmin\", TokenType::Binary, Opcode::F64X2PMin},\n      {\"\"}, {\"\"}, {\"\"},\n#line 418 \"src/lexer-keywords.txt\"\n      {\"i64.div_u\", TokenType::Binary, Opcode::I64DivU},\n#line 280 \"src/lexer-keywords.txt\"\n      {\"i32.div_u\", TokenType::Binary, Opcode::I32DivU},\n#line 417 \"src/lexer-keywords.txt\"\n      {\"i64.div_s\", TokenType::Binary, Opcode::I64DivS},\n#line 279 \"src/lexer-keywords.txt\"\n      {\"i32.div_s\", TokenType::Binary, Opcode::I32DivS},\n#line 470 \"src/lexer-keywords.txt\"\n      {\"v128.load32x2_u\", TokenType::Load, Opcode::V128Load32X2U},\n      {\"\"}, {\"\"}, {\"\"},\n#line 469 \"src/lexer-keywords.txt\"\n      {\"v128.load32x2_s\", TokenType::Load, Opcode::V128Load32X2S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 219 \"src/lexer-keywords.txt\"\n      {\"i16x8.min_u\", TokenType::Binary, Opcode::I16X8MinU},\n      {\"\"},\n#line 218 \"src/lexer-keywords.txt\"\n      {\"i16x8.min_s\", TokenType::Binary, Opcode::I16X8MinS},\n#line 622 \"src/lexer-keywords.txt\"\n      {\"v128.store32_lane\", TokenType::SimdStoreLane, Opcode::V128Store32Lane},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"},\n#line 526 \"src/lexer-keywords.txt\"\n      {\"i8x16.relaxed_swizzle\", TokenType::Binary, Opcode::I8X16RelaxedSwizzle},\n      {\"\"}, {\"\"}, {\"\"},\n#line 552 \"src/lexer-keywords.txt\"\n      {\"memory.grow\", TokenType::MemoryGrow, Opcode::MemoryGrow},\n      {\"\"}, {\"\"}, {\"\"},\n#line 200 \"src/lexer-keywords.txt\"\n      {\"i16x8.avgr_u\", TokenType::Binary, Opcode::I16X8AvgrU},\n#line 205 \"src/lexer-keywords.txt\"\n      {\"i16x8.extract_lane_u\", TokenType::SimdLaneOp, Opcode::I16X8ExtractLaneU},\n      {\"\"},\n#line 204 \"src/lexer-keywords.txt\"\n      {\"i16x8.extract_lane_s\", TokenType::SimdLaneOp, Opcode::I16X8ExtractLaneS},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"},\n#line 463 \"src/lexer-keywords.txt\"\n      {\"i64.trunc_sat_f32_u\", TokenType::Convert, Opcode::I64TruncSatF32U},\n#line 319 \"src/lexer-keywords.txt\"\n      {\"i32.trunc_sat_f32_u\", TokenType::Convert, Opcode::I32TruncSatF32U},\n      {\"\"}, {\"\"},\n#line 462 \"src/lexer-keywords.txt\"\n      {\"i64.trunc_sat_f32_s\", TokenType::Convert, Opcode::I64TruncSatF32S},\n#line 318 \"src/lexer-keywords.txt\"\n      {\"i32.trunc_sat_f32_s\", TokenType::Convert, Opcode::I32TruncSatF32S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 565 \"src/lexer-keywords.txt\"\n      {\"param\", TokenType::Param},\n      {\"\"},\n#line 374 \"src/lexer-keywords.txt\"\n      {\"i32x4.trunc_sat_f64x2_u_zero\", TokenType::Unary, Opcode::I32X4TruncSatF64X2UZero},\n      {\"\"},\n#line 373 \"src/lexer-keywords.txt\"\n      {\"i32x4.trunc_sat_f64x2_s_zero\", TokenType::Unary, Opcode::I32X4TruncSatF64X2SZero},\n      {\"\"}, {\"\"}, {\"\"},\n#line 158 \"src/lexer-keywords.txt\"\n      {\"f64x2.div\", TokenType::Binary, Opcode::F64X2Div},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"},\n#line 130 \"src/lexer-keywords.txt\"\n      {\"f64.convert_i32_u\", TokenType::Convert, Opcode::F64ConvertI32U},\n#line 68 \"src/lexer-keywords.txt\"\n      {\"f32.convert_i32_u\", TokenType::Convert, Opcode::F32ConvertI32U},\n      {\"\"}, {\"\"},\n#line 129 \"src/lexer-keywords.txt\"\n      {\"f64.convert_i32_s\", TokenType::Convert, Opcode::F64ConvertI32S},\n#line 67 \"src/lexer-keywords.txt\"\n      {\"f32.convert_i32_s\", TokenType::Convert, Opcode::F32ConvertI32S},\n      {\"\"},\n#line 388 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw16.xor_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XorU},\n#line 258 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw16.xor_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XorU},\n#line 621 \"src/lexer-keywords.txt\"\n      {\"v128.store16_lane\", TokenType::SimdStoreLane, Opcode::V128Store16Lane},\n      {\"\"},\n#line 387 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw16.xchg_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw16XchgU},\n#line 257 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw16.xchg_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw16XchgU},\n#line 531 \"src/lexer-keywords.txt\"\n      {\"i8x16.shr_u\", TokenType::Binary, Opcode::I8X16ShrU},\n      {\"\"},\n#line 530 \"src/lexer-keywords.txt\"\n      {\"i8x16.shr_s\", TokenType::Binary, Opcode::I8X16ShrS},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"},\n#line 44 \"src/lexer-keywords.txt\"\n      {\"catch_all_ref\", TokenType::CatchAllRef},\n#line 181 \"src/lexer-keywords.txt\"\n      {\"f64x2.sub\", TokenType::Binary, Opcode::F64X2Sub},\n#line 39 \"src/lexer-keywords.txt\"\n      {\"call_ref\", TokenType::CallRef, Opcode::CallRef},\n#line 26 \"src/lexer-keywords.txt\"\n      {\"assert_return\", TokenType::AssertReturn},\n      {\"\"},\n#line 155 \"src/lexer-keywords.txt\"\n      {\"f64x2.abs\", TokenType::Unary, Opcode::F64X2Abs},\n      {\"\"}, {\"\"}, {\"\"},\n#line 492 \"src/lexer-keywords.txt\"\n      {\"i64x2.sub\", TokenType::Binary, Opcode::I64X2Sub},\n      {\"\"}, {\"\"}, {\"\"},\n#line 478 \"src/lexer-keywords.txt\"\n      {\"i64x2.abs\", TokenType::Unary, Opcode::I64X2Abs},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 520 \"src/lexer-keywords.txt\"\n      {\"i8x16.min_u\", TokenType::Binary, Opcode::I8X16MinU},\n      {\"\"},\n#line 519 \"src/lexer-keywords.txt\"\n      {\"i8x16.min_s\", TokenType::Binary, Opcode::I8X16MinS},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 398 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw8.cmpxchg_u\", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw8CmpxchgU},\n#line 261 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw8.cmpxchg_u\", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw8CmpxchgU},\n      {\"\"},\n#line 232 \"src/lexer-keywords.txt\"\n      {\"i16x8.splat\", TokenType::Unary, Opcode::I16X8Splat},\n      {\"\"},\n#line 504 \"src/lexer-keywords.txt\"\n      {\"i8x16.avgr_u\", TokenType::Binary, Opcode::I8X16AvgrU},\n#line 508 \"src/lexer-keywords.txt\"\n      {\"i8x16.extract_lane_u\", TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneU},\n      {\"\"},\n#line 507 \"src/lexer-keywords.txt\"\n      {\"i8x16.extract_lane_s\", TokenType::SimdLaneOp, Opcode::I8X16ExtractLaneS},\n      {\"\"}, {\"\"}, {\"\"},\n#line 180 \"src/lexer-keywords.txt\"\n      {\"f64x2.sqrt\", TokenType::Unary, Opcode::F64X2Sqrt},\n      {\"\"}, {\"\"}, {\"\"},\n#line 328 \"src/lexer-keywords.txt\"\n      {\"i32x4.relaxed_dot_i8x16_i7x16_add_s\", TokenType::Ternary, Opcode::I32X4DotI8X16I7X16AddS},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 577 \"src/lexer-keywords.txt\"\n      {\"return_call_ref\", TokenType::ReturnCallRef, Opcode::ReturnCallRef},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 400 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw8.sub_u\", TokenType::AtomicRmw, Opcode::I64AtomicRmw8SubU},\n#line 263 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw8.sub_u\", TokenType::AtomicRmw, Opcode::I32AtomicRmw8SubU},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 594 \"src/lexer-keywords.txt\"\n      {\"throw_ref\", TokenType::ThrowRef, Opcode::ThrowRef},\n#line 61 \"src/lexer-keywords.txt\"\n      {\"exnref\", Type::ExnRef},\n      {\"\"},\n#line 619 \"src/lexer-keywords.txt\"\n      {\"v128.load64_lane\", TokenType::SimdLoadLane, Opcode::V128Load64Lane},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 384 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw16.cmpxchg_u\", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmw16CmpxchgU},\n#line 254 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw16.cmpxchg_u\", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmw16CmpxchgU},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 614 \"src/lexer-keywords.txt\"\n      {\"v128.load64_splat\", TokenType::Load, Opcode::V128Load64Splat},\n      {\"\"}, {\"\"}, {\"\"},\n#line 51 \"src/lexer-keywords.txt\"\n      {\"drop\", TokenType::Drop, Opcode::Drop},\n#line 327 \"src/lexer-keywords.txt\"\n      {\"i32x4.bitmask\", TokenType::Unary, Opcode::I32X4Bitmask},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 123 \"src/lexer-keywords.txt\"\n      {\"f32x4.demote_f64x2_zero\", TokenType::Unary, Opcode::F32X4DemoteF64X2Zero},\n      {\"\"}, {\"\"},\n#line 484 \"src/lexer-keywords.txt\"\n      {\"i64x2.extend_low_i32x4_u\", TokenType::Unary, Opcode::I64X2ExtendLowI32X4U},\n#line 112 \"src/lexer-keywords.txt\"\n      {\"f32x4.pmax\", TokenType::Binary, Opcode::F32X4PMax},\n#line 482 \"src/lexer-keywords.txt\"\n      {\"i64x2.extend_low_i32x4_s\", TokenType::Unary, Opcode::I64X2ExtendLowI32X4S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 532 \"src/lexer-keywords.txt\"\n      {\"i8x16.splat\", TokenType::Unary, Opcode::I8X16Splat},\n      {\"\"}, {\"\"},\n#line 608 \"src/lexer-keywords.txt\"\n      {\"v128.load64_zero\", TokenType::Load, Opcode::V128Load64Zero},\n#line 405 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw.cmpxchg\", TokenType::AtomicRmwCmpxchg, Opcode::I64AtomicRmwCmpxchg},\n#line 268 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw.cmpxchg\", TokenType::AtomicRmwCmpxchg, Opcode::I32AtomicRmwCmpxchg},\n      {\"\"}, {\"\"}, {\"\"},\n#line 593 \"src/lexer-keywords.txt\"\n      {\"throw\", TokenType::Throw, Opcode::Throw},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 25 \"src/lexer-keywords.txt\"\n      {\"assert_malformed\", TokenType::AssertMalformed},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 62 \"src/lexer-keywords.txt\"\n      {\"export\", TokenType::Export},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 550 \"src/lexer-keywords.txt\"\n      {\"memory.copy\", TokenType::MemoryCopy, Opcode::MemoryCopy},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 495 \"src/lexer-keywords.txt\"\n      {\"i64x2.extmul_low_i32x4_u\", TokenType::Binary, Opcode::I64X2ExtmulLowI32X4U},\n      {\"\"},\n#line 493 \"src/lexer-keywords.txt\"\n      {\"i64x2.extmul_low_i32x4_s\", TokenType::Binary, Opcode::I64X2ExtmulLowI32X4S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 133 \"src/lexer-keywords.txt\"\n      {\"f64.copysign\", TokenType::Binary, Opcode::F64Copysign},\n#line 71 \"src/lexer-keywords.txt\"\n      {\"f32.copysign\", TokenType::Binary, Opcode::F32Copysign},\n#line 625 \"src/lexer-keywords.txt\"\n      {\"i8x16.swizzle\", TokenType::Binary, Opcode::I8X16Swizzle},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 624 \"src/lexer-keywords.txt\"\n      {\"i8x16.shuffle\", TokenType::SimdShuffleOp, Opcode::I8X16Shuffle},\n      {\"\"}, {\"\"},\n#line 134 \"src/lexer-keywords.txt\"\n      {\"f64.div\", TokenType::Binary, Opcode::F64Div},\n#line 73 \"src/lexer-keywords.txt\"\n      {\"f32.div\", TokenType::Binary, Opcode::F32Div},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 546 \"src/lexer-keywords.txt\"\n      {\"loop\", TokenType::Loop, Opcode::Loop},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 235 \"src/lexer-keywords.txt\"\n      {\"i16x8.sub\", TokenType::Binary, Opcode::I16X8Sub},\n      {\"\"}, {\"\"}, {\"\"},\n#line 195 \"src/lexer-keywords.txt\"\n      {\"i16x8.abs\", TokenType::Unary, Opcode::I16X8Abs},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 575 \"src/lexer-keywords.txt\"\n      {\"rethrow\", TokenType::Rethrow, Opcode::Rethrow},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 587 \"src/lexer-keywords.txt\"\n      {\"table.grow\", TokenType::TableGrow, Opcode::TableGrow},\n      {\"\"},\n#line 410 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.store16\", TokenType::AtomicStore, Opcode::I64AtomicStore16},\n#line 273 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.store16\", TokenType::AtomicStore, Opcode::I32AtomicStore16},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 524 \"src/lexer-keywords.txt\"\n      {\"i8x16.popcnt\", TokenType::Unary, Opcode::I8X16Popcnt},\n      {\"\"},\n#line 617 \"src/lexer-keywords.txt\"\n      {\"v128.load16_lane\", TokenType::SimdLoadLane, Opcode::V128Load16Lane},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 612 \"src/lexer-keywords.txt\"\n      {\"v128.load16_splat\", TokenType::Load, Opcode::V128Load16Splat},\n#line 20 \"src/lexer-keywords.txt\"\n      {\"array\", Type::Array, TokenType::Array},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 444 \"src/lexer-keywords.txt\"\n      {\"i64.popcnt\", TokenType::Unary, Opcode::I64Popcnt},\n#line 301 \"src/lexer-keywords.txt\"\n      {\"i32.popcnt\", TokenType::Unary, Opcode::I32Popcnt},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 370 \"src/lexer-keywords.txt\"\n      {\"i32x4.extend_high_i16x8_u\", TokenType::Unary, Opcode::I32X4ExtendHighI16X8U},\n      {\"\"},\n#line 369 \"src/lexer-keywords.txt\"\n      {\"i32x4.extend_high_i16x8_s\", TokenType::Unary, Opcode::I32X4ExtendHighI16X8S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 97 \"src/lexer-keywords.txt\"\n      {\"f32x4.convert_i32x4_u\", TokenType::Unary, Opcode::F32X4ConvertI32X4U},\n      {\"\"},\n#line 96 \"src/lexer-keywords.txt\"\n      {\"f32x4.convert_i32x4_s\", TokenType::Unary, Opcode::F32X4ConvertI32X4S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"},\n#line 535 \"src/lexer-keywords.txt\"\n      {\"i8x16.sub\", TokenType::Binary, Opcode::I8X16Sub},\n      {\"\"},\n#line 148 \"src/lexer-keywords.txt\"\n      {\"f64.promote_f32\", TokenType::Convert, Opcode::F64PromoteF32},\n      {\"\"},\n#line 499 \"src/lexer-keywords.txt\"\n      {\"i8x16.abs\", TokenType::Unary, Opcode::I8X16Abs},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 342 \"src/lexer-keywords.txt\"\n      {\"v128.load16x4_u\", TokenType::Load, Opcode::V128Load16X4U},\n      {\"\"}, {\"\"},\n#line 481 \"src/lexer-keywords.txt\"\n      {\"i64x2.bitmask\", TokenType::Unary, Opcode::I64X2Bitmask},\n#line 341 \"src/lexer-keywords.txt\"\n      {\"v128.load16x4_s\", TokenType::Load, Opcode::V128Load16X4S},\n#line 365 \"src/lexer-keywords.txt\"\n      {\"i32x4.extmul_high_i16x8_u\", TokenType::Binary, Opcode::I32X4ExtmulHighI16X8U},\n      {\"\"},\n#line 363 \"src/lexer-keywords.txt\"\n      {\"i32x4.extmul_high_i16x8_s\", TokenType::Binary, Opcode::I32X4ExtmulHighI16X8S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 627 \"src/lexer-keywords.txt\"\n      {\"i64.sub128\", TokenType::Quaternary, Opcode::I64Sub128},\n#line 172 \"src/lexer-keywords.txt\"\n      {\"f64x2.pmax\", TokenType::Binary, Opcode::F64X2PMax},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 564 \"src/lexer-keywords.txt\"\n      {\"pagesize\", TokenType::PageSize},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"},\n#line 372 \"src/lexer-keywords.txt\"\n      {\"i32x4.extend_low_i16x8_u\", TokenType::Unary, Opcode::I32X4ExtendLowI16X8U},\n      {\"\"},\n#line 371 \"src/lexer-keywords.txt\"\n      {\"i32x4.extend_low_i16x8_s\", TokenType::Unary, Opcode::I32X4ExtendLowI16X8S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 53 \"src/lexer-keywords.txt\"\n      {\"elem.drop\", TokenType::ElemDrop, Opcode::ElemDrop},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"},\n#line 560 \"src/lexer-keywords.txt\"\n      {\"nop\", TokenType::Nop, Opcode::Nop},\n#line 227 \"src/lexer-keywords.txt\"\n      {\"i16x8.relaxed_q15mulr_s\", TokenType::Binary, Opcode::I16X8RelaxedQ15mulrS},\n      {\"\"}, {\"\"}, {\"\"},\n#line 364 \"src/lexer-keywords.txt\"\n      {\"i32x4.extmul_low_i16x8_u\", TokenType::Binary, Opcode::I32X4ExtmulLowI16X8U},\n      {\"\"},\n#line 362 \"src/lexer-keywords.txt\"\n      {\"i32x4.extmul_low_i16x8_s\", TokenType::Binary, Opcode::I32X4ExtmulLowI16X8S},\n#line 149 \"src/lexer-keywords.txt\"\n      {\"f64.reinterpret_i64\", TokenType::Convert, Opcode::F64ReinterpretI64},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 246 \"src/lexer-keywords.txt\"\n      {\"i16x8.extend_low_i8x16_u\", TokenType::Unary, Opcode::I16X8ExtendLowI8X16U},\n      {\"\"},\n#line 245 \"src/lexer-keywords.txt\"\n      {\"i16x8.extend_low_i8x16_s\", TokenType::Unary, Opcode::I16X8ExtendLowI8X16S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"},\n#line 323 \"src/lexer-keywords.txt\"\n      {\"i32.wrap_i64\", TokenType::Convert, Opcode::I32WrapI64},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"},\n#line 240 \"src/lexer-keywords.txt\"\n      {\"i16x8.extmul_low_i8x16_u\", TokenType::Binary, Opcode::I16X8ExtmulLowI8X16U},\n      {\"\"},\n#line 238 \"src/lexer-keywords.txt\"\n      {\"i16x8.extmul_low_i8x16_s\", TokenType::Binary, Opcode::I16X8ExtmulLowI8X16S},\n#line 485 \"src/lexer-keywords.txt\"\n      {\"i64x2.extend_high_i32x4_u\", TokenType::Unary, Opcode::I64X2ExtendHighI32X4U},\n      {\"\"},\n#line 483 \"src/lexer-keywords.txt\"\n      {\"i64x2.extend_high_i32x4_s\", TokenType::Unary, Opcode::I64X2ExtendHighI32X4S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 202 \"src/lexer-keywords.txt\"\n      {\"i16x8.relaxed_dot_i8x16_i7x16_s\", TokenType::Binary, Opcode::I16X8DotI8X16I7X16S},\n      {\"\"}, {\"\"},\n#line 222 \"src/lexer-keywords.txt\"\n      {\"i16x8.narrow_i32x4_u\", TokenType::Binary, Opcode::I16X8NarrowI32X4U},\n      {\"\"},\n#line 221 \"src/lexer-keywords.txt\"\n      {\"i16x8.narrow_i32x4_s\", TokenType::Binary, Opcode::I16X8NarrowI32X4S},\n      {\"\"},\n#line 547 \"src/lexer-keywords.txt\"\n      {\"memory.atomic.notify\", TokenType::AtomicNotify, Opcode::MemoryAtomicNotify},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"},\n#line 361 \"src/lexer-keywords.txt\"\n      {\"i32x4.extadd_pairwise_i16x8_u\", TokenType::Unary, Opcode::I32X4ExtaddPairwiseI16X8U},\n      {\"\"},\n#line 360 \"src/lexer-keywords.txt\"\n      {\"i32x4.extadd_pairwise_i16x8_s\", TokenType::Unary, Opcode::I32X4ExtaddPairwiseI16X8S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 496 \"src/lexer-keywords.txt\"\n      {\"i64x2.extmul_high_i32x4_u\", TokenType::Binary, Opcode::I64X2ExtmulHighI32X4U},\n      {\"\"},\n#line 494 \"src/lexer-keywords.txt\"\n      {\"i64x2.extmul_high_i32x4_s\", TokenType::Binary, Opcode::I64X2ExtmulHighI32X4S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"},\n#line 23 \"src/lexer-keywords.txt\"\n      {\"assert_exhaustion\", TokenType::AssertExhaustion},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 445 \"src/lexer-keywords.txt\"\n      {\"i64.reinterpret_f64\", TokenType::Convert, Opcode::I64ReinterpretF64},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 87 \"src/lexer-keywords.txt\"\n      {\"f32.reinterpret_i32\", TokenType::Convert, Opcode::F32ReinterpretI32},\n      {\"\"},\n#line 152 \"src/lexer-keywords.txt\"\n      {\"f64.sub\", TokenType::Binary, Opcode::F64Sub},\n#line 90 \"src/lexer-keywords.txt\"\n      {\"f32.sub\", TokenType::Binary, Opcode::F32Sub},\n#line 27 \"src/lexer-keywords.txt\"\n      {\"assert_trap\", TokenType::AssertTrap},\n      {\"\"}, {\"\"},\n#line 201 \"src/lexer-keywords.txt\"\n      {\"i16x8.bitmask\", TokenType::Unary, Opcode::I16X8Bitmask},\n      {\"\"}, {\"\"},\n#line 457 \"src/lexer-keywords.txt\"\n      {\"i64.sub\", TokenType::Binary, Opcode::I64Sub},\n#line 313 \"src/lexer-keywords.txt\"\n      {\"i32.sub\", TokenType::Binary, Opcode::I32Sub},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"},\n#line 135 \"src/lexer-keywords.txt\"\n      {\"f64.eq\", TokenType::Compare, Opcode::F64Eq},\n#line 74 \"src/lexer-keywords.txt\"\n      {\"f32.eq\", TokenType::Compare, Opcode::F32Eq},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 419 \"src/lexer-keywords.txt\"\n      {\"i64.eq\", TokenType::Compare, Opcode::I64Eq},\n#line 281 \"src/lexer-keywords.txt\"\n      {\"i32.eq\", TokenType::Compare, Opcode::I32Eq},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 99 \"src/lexer-keywords.txt\"\n      {\"f32x4.eq\", TokenType::Compare, Opcode::F32X4Eq},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 329 \"src/lexer-keywords.txt\"\n      {\"i32x4.eq\", TokenType::Compare, Opcode::I32X4Eq},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"},\n#line 601 \"src/lexer-keywords.txt\"\n      {\"v128.bitselect\", TokenType::Ternary, Opcode::V128BitSelect},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 548 \"src/lexer-keywords.txt\"\n      {\"memory.atomic.wait32\", TokenType::AtomicWait, Opcode::MemoryAtomicWait32},\n#line 22 \"src/lexer-keywords.txt\"\n      {\"assert_exception\", TokenType::AssertException},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 505 \"src/lexer-keywords.txt\"\n      {\"i8x16.bitmask\", TokenType::Unary, Opcode::I8X16Bitmask},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 302 \"src/lexer-keywords.txt\"\n      {\"i32.reinterpret_f32\", TokenType::Convert, Opcode::I32ReinterpretF32},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 24 \"src/lexer-keywords.txt\"\n      {\"assert_invalid\", TokenType::AssertInvalid},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 549 \"src/lexer-keywords.txt\"\n      {\"memory.atomic.wait64\", TokenType::AtomicWait, Opcode::MemoryAtomicWait64},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 28 \"src/lexer-keywords.txt\"\n      {\"assert_unlinkable\", TokenType::AssertUnlinkable},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 407 \"src/lexer-keywords.txt\"\n      {\"i64.atomic.rmw.sub\", TokenType::AtomicRmw, Opcode::I64AtomicRmwSub},\n#line 270 \"src/lexer-keywords.txt\"\n      {\"i32.atomic.rmw.sub\", TokenType::AtomicRmw, Opcode::I32AtomicRmwSub},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 184 \"src/lexer-keywords.txt\"\n      {\"f64x2.convert_low_i32x4_u\", TokenType::Unary, Opcode::F64X2ConvertLowI32X4U},\n      {\"\"},\n#line 183 \"src/lexer-keywords.txt\"\n      {\"f64x2.convert_low_i32x4_s\", TokenType::Unary, Opcode::F64X2ConvertLowI32X4S},\n      {\"\"},\n#line 159 \"src/lexer-keywords.txt\"\n      {\"f64x2.eq\", TokenType::Compare, Opcode::F64X2Eq},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 472 \"src/lexer-keywords.txt\"\n      {\"i64x2.eq\", TokenType::Binary, Opcode::I64X2Eq},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 244 \"src/lexer-keywords.txt\"\n      {\"i16x8.extend_high_i8x16_u\", TokenType::Unary, Opcode::I16X8ExtendHighI8X16U},\n      {\"\"},\n#line 243 \"src/lexer-keywords.txt\"\n      {\"i16x8.extend_high_i8x16_s\", TokenType::Unary, Opcode::I16X8ExtendHighI8X16S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 224 \"src/lexer-keywords.txt\"\n      {\"i16x8.q15mulr_sat_s\", TokenType::Binary, Opcode::I16X8Q15mulrSatS},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 241 \"src/lexer-keywords.txt\"\n      {\"i16x8.extmul_high_i8x16_u\", TokenType::Binary, Opcode::I16X8ExtmulHighI8X16U},\n      {\"\"},\n#line 239 \"src/lexer-keywords.txt\"\n      {\"i16x8.extmul_high_i8x16_s\", TokenType::Binary, Opcode::I16X8ExtmulHighI8X16S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 29 \"src/lexer-keywords.txt\"\n      {\"atomic.fence\", TokenType::AtomicFence, Opcode::AtomicFence},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"},\n#line 203 \"src/lexer-keywords.txt\"\n      {\"i16x8.eq\", TokenType::Compare, Opcode::I16X8Eq},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 185 \"src/lexer-keywords.txt\"\n      {\"f64x2.promote_low_f32x4\", TokenType::Unary, Opcode::F64X2PromoteLowF32X4},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 522 \"src/lexer-keywords.txt\"\n      {\"i8x16.narrow_i16x8_u\", TokenType::Binary, Opcode::I8X16NarrowI16X8U},\n      {\"\"},\n#line 521 \"src/lexer-keywords.txt\"\n      {\"i8x16.narrow_i16x8_s\", TokenType::Binary, Opcode::I8X16NarrowI16X8S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 237 \"src/lexer-keywords.txt\"\n      {\"i16x8.extadd_pairwise_i8x16_u\", TokenType::Unary, Opcode::I16X8ExtaddPairwiseI8X16U},\n      {\"\"},\n#line 236 \"src/lexer-keywords.txt\"\n      {\"i16x8.extadd_pairwise_i8x16_s\", TokenType::Unary, Opcode::I16X8ExtaddPairwiseI8X16S},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n      {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"}, {\"\"},\n#line 506 \"src/lexer-keywords.txt\"\n      {\"i8x16.eq\", TokenType::Compare, Opcode::I8X16Eq}\n    };\n#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)\n#pragma GCC diagnostic pop\n#endif\n\n  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)\n    {\n      unsigned int key = hash (str, len);\n\n      if (key <= MAX_HASH_VALUE)\n        {\n          const char *s = wordlist[key].name;\n\n          if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\\0')\n            return &wordlist[key];\n        }\n    }\n  return static_cast<struct TokenInfo *> (0);\n}\n"
  },
  {
    "path": "src/prebuilt/wasm2c_atomicops_source_declarations.cc",
    "content": "const char* s_atomicops_source_declarations = R\"w2c_template(#include <stdatomic.h>\n)w2c_template\"\nR\"w2c_template(\n#ifndef WASM_RT_C11_AVAILABLE\n)w2c_template\"\nR\"w2c_template(#error \"C11 is required for Wasm threads and shared memory support\"\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n#define ATOMIC_ALIGNMENT_CHECK(addr, t1) \\\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(addr % sizeof(t1))) {     \\\n)w2c_template\"\nR\"w2c_template(    TRAP(UNALIGNED);                     \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_SHARED_LOAD(name, t1, t2, t3, force_read)                      \\\n)w2c_template\"\nR\"w2c_template(  static inline t3 name##_unchecked(wasm_rt_shared_memory_t* mem, u64 addr) { \\\n)w2c_template\"\nR\"w2c_template(    t1 result;                                                                \\\n)w2c_template\"\nR\"w2c_template(    result = atomic_load_explicit(                                            \\\n)w2c_template\"\nR\"w2c_template(        (_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)),                \\\n)w2c_template\"\nR\"w2c_template(        memory_order_relaxed);                                                \\\n)w2c_template\"\nR\"w2c_template(    force_read(result);                                                       \\\n)w2c_template\"\nR\"w2c_template(    return (t3)(t2)result;                                                    \\\n)w2c_template\"\nR\"w2c_template(  }                                                                           \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS0(name, _shared_, t1, return, t3)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_SHARED_LOAD(i32_load_shared, u32, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i64_load_shared, u64, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(f32_load_shared, f32, f32, f32, FORCE_READ_FLOAT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(f64_load_shared, f64, f64, f64, FORCE_READ_FLOAT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i32_load8_s_shared, s8, s32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i64_load8_s_shared, s8, s64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i32_load8_u_shared, u8, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i64_load8_u_shared, u8, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i32_load16_s_shared, s16, s32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i64_load16_s_shared, s16, s64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i32_load16_u_shared, u16, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i64_load16_u_shared, u16, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i64_load32_s_shared, s32, s64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_LOAD(i64_load32_u_shared, u32, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_SHARED_STORE(name, t1, t2)                                     \\\n)w2c_template\"\nR\"w2c_template(  static inline void name##_unchecked(wasm_rt_shared_memory_t* mem, u64 addr, \\\n)w2c_template\"\nR\"w2c_template(                                      t2 value) {                             \\\n)w2c_template\"\nR\"w2c_template(    t1 wrapped = (t1)value;                                                   \\\n)w2c_template\"\nR\"w2c_template(    atomic_store_explicit(                                                    \\\n)w2c_template\"\nR\"w2c_template(        (_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)), wrapped,       \\\n)w2c_template\"\nR\"w2c_template(        memory_order_relaxed);                                                \\\n)w2c_template\"\nR\"w2c_template(  }                                                                           \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name, _shared_, t1, , void, t2)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_SHARED_STORE(i32_store_shared, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_STORE(i64_store_shared, u64, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_STORE(f32_store_shared, f32, f32)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_STORE(f64_store_shared, f64, f64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_STORE(i32_store8_shared, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_STORE(i32_store16_shared, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_STORE(i64_store8_shared, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_STORE(i64_store16_shared, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SHARED_STORE(i64_store32_shared, u32, u64)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_ATOMIC_LOAD(name, t1, t2, t3, force_read)                    \\\n)w2c_template\"\nR\"w2c_template(  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) {      \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                       \\\n)w2c_template\"\nR\"w2c_template(    t1 result;                                                              \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&result, MEM_ADDR(mem, addr, sizeof(t1)), sizeof(t1));   \\\n)w2c_template\"\nR\"w2c_template(    force_read(result);                                                     \\\n)w2c_template\"\nR\"w2c_template(    return (t3)(t2)result;                                                  \\\n)w2c_template\"\nR\"w2c_template(  }                                                                         \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS0(name, _, t1, return, t3)                                  \\\n)w2c_template\"\nR\"w2c_template(  static inline t3 name##_shared_unchecked(wasm_rt_shared_memory_t* mem,    \\\n)w2c_template\"\nR\"w2c_template(                                           u64 addr) {                      \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                       \\\n)w2c_template\"\nR\"w2c_template(    t1 result;                                                              \\\n)w2c_template\"\nR\"w2c_template(    result =                                                                \\\n)w2c_template\"\nR\"w2c_template(        atomic_load((_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1))); \\\n)w2c_template\"\nR\"w2c_template(    force_read(result);                                                     \\\n)w2c_template\"\nR\"w2c_template(    return (t3)(t2)result;                                                  \\\n)w2c_template\"\nR\"w2c_template(  }                                                                         \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS0(name##_shared, _shared_, t1, return, t3)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_LOAD(i32_atomic_load, u32, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_LOAD(i64_atomic_load, u64, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_LOAD(i32_atomic_load8_u, u8, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_LOAD(i64_atomic_load8_u, u8, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_LOAD(i32_atomic_load16_u, u16, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_LOAD(i64_atomic_load16_u, u16, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_LOAD(i64_atomic_load32_u, u32, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_ATOMIC_STORE(name, t1, t2)                                  \\\n)w2c_template\"\nR\"w2c_template(  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr,     \\\n)w2c_template\"\nR\"w2c_template(                                      t2 value) {                          \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                      \\\n)w2c_template\"\nR\"w2c_template(    t1 wrapped = (t1)value;                                                \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(MEM_ADDR(mem, addr, sizeof(t1)), &wrapped, sizeof(t1)); \\\n)w2c_template\"\nR\"w2c_template(  }                                                                        \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name, _, t1, , void, t2)                                 \\\n)w2c_template\"\nR\"w2c_template(  static inline void name##_shared_unchecked(wasm_rt_shared_memory_t* mem, \\\n)w2c_template\"\nR\"w2c_template(                                             u64 addr, t2 value) {         \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                      \\\n)w2c_template\"\nR\"w2c_template(    t1 wrapped = (t1)value;                                                \\\n)w2c_template\"\nR\"w2c_template(    atomic_store((_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)),    \\\n)w2c_template\"\nR\"w2c_template(                 wrapped);                                                 \\\n)w2c_template\"\nR\"w2c_template(  }                                                                        \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name##_shared, _shared_, t1, , void, t2)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_STORE(i32_atomic_store, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_STORE(i64_atomic_store, u64, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_STORE(i32_atomic_store8, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_STORE(i32_atomic_store16, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_STORE(i64_atomic_store8, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_STORE(i64_atomic_store16, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_STORE(i64_atomic_store32, u32, u64)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_ATOMIC_RMW(name, opname, op, t1, t2)                      \\\n)w2c_template\"\nR\"w2c_template(  static inline t2 name##_unchecked(wasm_rt_memory_t* mem, u64 addr,     \\\n)w2c_template\"\nR\"w2c_template(                                    t2 value) {                          \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                    \\\n)w2c_template\"\nR\"w2c_template(    t1 wrapped = (t1)value;                                              \\\n)w2c_template\"\nR\"w2c_template(    t1 ret;                                                              \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&ret, MEM_ADDR(mem, addr, sizeof(t1)), sizeof(t1));   \\\n)w2c_template\"\nR\"w2c_template(    ret = ret op wrapped;                                                \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(MEM_ADDR(mem, addr, sizeof(t1)), &ret, sizeof(t1));   \\\n)w2c_template\"\nR\"w2c_template(    return (t2)ret;                                                      \\\n)w2c_template\"\nR\"w2c_template(  }                                                                      \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name, _, t1, return, t2, t2)                           \\\n)w2c_template\"\nR\"w2c_template(  static inline t2 name##_shared_unchecked(wasm_rt_shared_memory_t* mem, \\\n)w2c_template\"\nR\"w2c_template(                                           u64 addr, t2 value) {         \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                    \\\n)w2c_template\"\nR\"w2c_template(    t1 wrapped = (t1)value;                                              \\\n)w2c_template\"\nR\"w2c_template(    t1 ret = atomic_##opname(                                            \\\n)w2c_template\"\nR\"w2c_template(        (_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)), wrapped); \\\n)w2c_template\"\nR\"w2c_template(    return (t2)ret;                                                      \\\n)w2c_template\"\nR\"w2c_template(  }                                                                      \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name##_shared, _shared_, t1, return, t2, t2)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_add_u, fetch_add, +, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw16_add_u, fetch_add, +, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw_add, fetch_add, +, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw8_add_u, fetch_add, +, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw16_add_u, fetch_add, +, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw32_add_u, fetch_add, +, u32, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw_add, fetch_add, +, u64, u64)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_sub_u, fetch_sub, -, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw16_sub_u, fetch_sub, -, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw_sub, fetch_sub, -, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw8_sub_u, fetch_sub, -, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw16_sub_u, fetch_sub, -, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw32_sub_u, fetch_sub, -, u32, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw_sub, fetch_sub, -, u64, u64)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_and_u, fetch_and, &, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw16_and_u, fetch_and, &, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw_and, fetch_and, &, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw8_and_u, fetch_and, &, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw16_and_u, fetch_and, &, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw32_and_u, fetch_and, &, u32, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw_and, fetch_and, &, u64, u64)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_or_u, fetch_or, |, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw16_or_u, fetch_or, |, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw_or, fetch_or, |, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw8_or_u, fetch_or, |, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw16_or_u, fetch_or, |, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw32_or_u, fetch_or, |, u32, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw_or, fetch_or, |, u64, u64)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_xor_u, fetch_xor, ^, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw16_xor_u, fetch_xor, ^, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i32_atomic_rmw_xor, fetch_xor, ^, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw8_xor_u, fetch_xor, ^, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw16_xor_u, fetch_xor, ^, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw32_xor_u, fetch_xor, ^, u32, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_RMW(i64_atomic_rmw_xor, fetch_xor, ^, u64, u64)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_ATOMIC_XCHG(name, opname, t1, t2)                           \\\n)w2c_template\"\nR\"w2c_template(  static inline t2 name##_unchecked(wasm_rt_memory_t* mem, u64 addr,       \\\n)w2c_template\"\nR\"w2c_template(                                    t2 value) {                            \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                      \\\n)w2c_template\"\nR\"w2c_template(    t1 wrapped = (t1)value;                                                \\\n)w2c_template\"\nR\"w2c_template(    t1 ret;                                                                \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&ret, MEM_ADDR(mem, addr, sizeof(t1)), sizeof(t1));     \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(MEM_ADDR(mem, addr, sizeof(t1)), &wrapped, sizeof(t1)); \\\n)w2c_template\"\nR\"w2c_template(    return (t2)ret;                                                        \\\n)w2c_template\"\nR\"w2c_template(  }                                                                        \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name, _, t1, return, t2, t2)                             \\\n)w2c_template\"\nR\"w2c_template(  static inline t2 name##_shared_unchecked(wasm_rt_shared_memory_t* mem,   \\\n)w2c_template\"\nR\"w2c_template(                                           u64 addr, t2 value) {           \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                      \\\n)w2c_template\"\nR\"w2c_template(    t1 wrapped = (t1)value;                                                \\\n)w2c_template\"\nR\"w2c_template(    t1 ret = atomic_##opname(                                              \\\n)w2c_template\"\nR\"w2c_template(        (_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)), wrapped);   \\\n)w2c_template\"\nR\"w2c_template(    return (t2)ret;                                                        \\\n)w2c_template\"\nR\"w2c_template(  }                                                                        \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name##_shared, _shared_, t1, return, t2, t2)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_XCHG(i32_atomic_rmw8_xchg_u, exchange, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_XCHG(i32_atomic_rmw16_xchg_u, exchange, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_XCHG(i32_atomic_rmw_xchg, exchange, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_XCHG(i64_atomic_rmw8_xchg_u, exchange, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_XCHG(i64_atomic_rmw16_xchg_u, exchange, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_XCHG(i64_atomic_rmw32_xchg_u, exchange, u32, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_XCHG(i64_atomic_rmw_xchg, exchange, u64, u64)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_ATOMIC_CMP_XCHG(name, t1, t2)                                 \\\n)w2c_template\"\nR\"w2c_template(  static inline t1 name##_unchecked(wasm_rt_memory_t* mem, u64 addr,         \\\n)w2c_template\"\nR\"w2c_template(                                    t1 expected, t1 replacement) {           \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t2);                                        \\\n)w2c_template\"\nR\"w2c_template(    t2 expected_wrapped = (t2)expected;                                      \\\n)w2c_template\"\nR\"w2c_template(    t2 replacement_wrapped = (t2)replacement;                                \\\n)w2c_template\"\nR\"w2c_template(    t2 ret;                                                                  \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&ret, MEM_ADDR(mem, addr, sizeof(t2)), sizeof(t2));       \\\n)w2c_template\"\nR\"w2c_template(    if (ret == expected_wrapped) {                                           \\\n)w2c_template\"\nR\"w2c_template(      wasm_rt_memcpy(MEM_ADDR(mem, addr, sizeof(t2)), &replacement_wrapped,  \\\n)w2c_template\"\nR\"w2c_template(                     sizeof(t2));                                            \\\n)w2c_template\"\nR\"w2c_template(    }                                                                        \\\n)w2c_template\"\nR\"w2c_template(    return (t1)expected_wrapped;                                             \\\n)w2c_template\"\nR\"w2c_template(  }                                                                          \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS2(name, _, t2, return, t1, t1, t1)                           \\\n)w2c_template\"\nR\"w2c_template(  static inline t1 name##_shared_unchecked(                                  \\\n)w2c_template\"\nR\"w2c_template(      wasm_rt_shared_memory_t* mem, u64 addr, t1 expected, t1 replacement) { \\\n)w2c_template\"\nR\"w2c_template(    ATOMIC_ALIGNMENT_CHECK(addr, t2);                                        \\\n)w2c_template\"\nR\"w2c_template(    t2 expected_wrapped = (t2)expected;                                      \\\n)w2c_template\"\nR\"w2c_template(    t2 replacement_wrapped = (t2)replacement;                                \\\n)w2c_template\"\nR\"w2c_template(    atomic_compare_exchange_strong(                                          \\\n)w2c_template\"\nR\"w2c_template(        (_Atomic volatile t2*)MEM_ADDR(mem, addr, sizeof(t2)),               \\\n)w2c_template\"\nR\"w2c_template(        &expected_wrapped, replacement_wrapped);                             \\\n)w2c_template\"\nR\"w2c_template(    return (t1)expected_wrapped;                                             \\\n)w2c_template\"\nR\"w2c_template(  }                                                                          \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS2(name##_shared, _shared_, t2, return, t1, t1, t1)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_ATOMIC_CMP_XCHG(i32_atomic_rmw8_cmpxchg_u, u32, u8);\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_CMP_XCHG(i32_atomic_rmw16_cmpxchg_u, u32, u16);\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_CMP_XCHG(i32_atomic_rmw_cmpxchg, u32, u32);\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_CMP_XCHG(i64_atomic_rmw8_cmpxchg_u, u64, u8);\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_CMP_XCHG(i64_atomic_rmw16_cmpxchg_u, u64, u16);\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_CMP_XCHG(i64_atomic_rmw32_cmpxchg_u, u64, u32);\n)w2c_template\"\nR\"w2c_template(DEFINE_ATOMIC_CMP_XCHG(i64_atomic_rmw_cmpxchg, u64, u64);\n)w2c_template\"\nR\"w2c_template(\n#define atomic_fence() atomic_thread_fence(memory_order_seq_cst)\n)w2c_template\"\n;\n"
  },
  {
    "path": "src/prebuilt/wasm2c_header_bottom.cc",
    "content": "const char* s_header_bottom = R\"w2c_template(#ifdef __cplusplus\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\n;\n"
  },
  {
    "path": "src/prebuilt/wasm2c_header_top.cc",
    "content": "const char* s_header_top = R\"w2c_template(#include <stdint.h>\n)w2c_template\"\nR\"w2c_template(\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n)w2c_template\"\nR\"w2c_template(#define WASM_RT_CORE_TYPES_DEFINED\n)w2c_template\"\nR\"w2c_template(typedef uint8_t u8;\n)w2c_template\"\nR\"w2c_template(typedef int8_t s8;\n)w2c_template\"\nR\"w2c_template(typedef uint16_t u16;\n)w2c_template\"\nR\"w2c_template(typedef int16_t s16;\n)w2c_template\"\nR\"w2c_template(typedef uint32_t u32;\n)w2c_template\"\nR\"w2c_template(typedef int32_t s32;\n)w2c_template\"\nR\"w2c_template(typedef uint64_t u64;\n)w2c_template\"\nR\"w2c_template(typedef int64_t s64;\n)w2c_template\"\nR\"w2c_template(typedef float f32;\n)w2c_template\"\nR\"w2c_template(typedef double f64;\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n#ifdef __cplusplus\n)w2c_template\"\nR\"w2c_template(extern \"C\" {\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\n;\n"
  },
  {
    "path": "src/prebuilt/wasm2c_simd_source_declarations.cc",
    "content": "const char* s_simd_source_declarations = R\"w2c_template(#if defined(__GNUC__) && defined(__x86_64__)\n)w2c_template\"\nR\"w2c_template(#define SIMD_FORCE_READ(var) __asm__(\"\" ::\"x\"(var));\n)w2c_template\"\nR\"w2c_template(#elif defined(__GNUC__) && defined(__aarch64__)\n)w2c_template\"\nR\"w2c_template(#define SIMD_FORCE_READ(var) __asm__(\"\" ::\"w\"(var));\n)w2c_template\"\nR\"w2c_template(#elif defined(__s390x__)\n)w2c_template\"\nR\"w2c_template(#define SIMD_FORCE_READ(var) __asm__(\"\" ::\"d\"(var));\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define SIMD_FORCE_READ(var)\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(// TODO: equivalent constraint for ARM and other architectures\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_SIMD_LOAD_FUNC(name, func, t)                             \\\n)w2c_template\"\nR\"w2c_template(  static inline v128 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n)w2c_template\"\nR\"w2c_template(    v128 result = func(MEM_ADDR(mem, addr, sizeof(t)));                  \\\n)w2c_template\"\nR\"w2c_template(    SIMD_FORCE_READ(result);                                             \\\n)w2c_template\"\nR\"w2c_template(    return result;                                                       \\\n)w2c_template\"\nR\"w2c_template(  }                                                                      \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS0(name, _, t, return, v128);\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_SIMD_LOAD_LANE(name, func, t, lane)                     \\\n)w2c_template\"\nR\"w2c_template(  static inline v128 name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n)w2c_template\"\nR\"w2c_template(                                      v128 vec) {                      \\\n)w2c_template\"\nR\"w2c_template(    v128 result = func(MEM_ADDR(mem, addr, sizeof(t)), vec, lane);     \\\n)w2c_template\"\nR\"w2c_template(    SIMD_FORCE_READ(result);                                           \\\n)w2c_template\"\nR\"w2c_template(    return result;                                                     \\\n)w2c_template\"\nR\"w2c_template(  }                                                                    \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name, _, t, return, v128, v128);\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_SIMD_STORE(name, t)                                     \\\n)w2c_template\"\nR\"w2c_template(  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n)w2c_template\"\nR\"w2c_template(                                      v128 value) {                    \\\n)w2c_template\"\nR\"w2c_template(    simde_wasm_v128_store(MEM_ADDR(mem, addr, sizeof(t)), value);      \\\n)w2c_template\"\nR\"w2c_template(  }                                                                    \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name, _, t, , void, v128);\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_SIMD_STORE_LANE(name, func, t, lane)                    \\\n)w2c_template\"\nR\"w2c_template(  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n)w2c_template\"\nR\"w2c_template(                                      v128 value) {                    \\\n)w2c_template\"\nR\"w2c_template(    func(MEM_ADDR(mem, addr, sizeof(t)), value, lane);                 \\\n)w2c_template\"\nR\"w2c_template(  }                                                                    \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name, _, t, , void, v128);\n)w2c_template\"\nR\"w2c_template(\n// clang-format off\n)w2c_template\"\nR\"w2c_template(#if WABT_BIG_ENDIAN\n)w2c_template\"\nR\"w2c_template(static inline v128 v128_impl_load32_zero(const void* a) {\n)w2c_template\"\nR\"w2c_template(  return simde_wasm_i8x16_swizzle(\n)w2c_template\"\nR\"w2c_template(      simde_wasm_v128_load32_zero(a),\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i8x16_const(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3));\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(static inline v128 v128_impl_load64_zero(const void* a) {\n)w2c_template\"\nR\"w2c_template(  return simde_wasm_i8x16_swizzle(\n)w2c_template\"\nR\"w2c_template(      simde_wasm_v128_load64_zero(a),\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7));\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define v128_impl_load32_zero simde_wasm_v128_load32_zero\n)w2c_template\"\nR\"w2c_template(#define v128_impl_load64_zero simde_wasm_v128_load64_zero\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\nDEFINE_SIMD_LOAD_FUNC(v128_load, simde_wasm_v128_load, v128)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_SIMD_LOAD_FUNC(v128_load8_splat, simde_wasm_v128_load8_splat, u8)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(v128_load16_splat, simde_wasm_v128_load16_splat, u16)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(v128_load32_splat, simde_wasm_v128_load32_splat, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(v128_load64_splat, simde_wasm_v128_load64_splat, u64)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_SIMD_LOAD_FUNC(i16x8_load8x8, simde_wasm_i16x8_load8x8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(u16x8_load8x8, simde_wasm_u16x8_load8x8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(i32x4_load16x4, simde_wasm_i32x4_load16x4, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(u32x4_load16x4, simde_wasm_u32x4_load16x4, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(i64x2_load32x2, simde_wasm_i64x2_load32x2, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(u64x2_load32x2, simde_wasm_u64x2_load32x2, u64)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_SIMD_LOAD_FUNC(v128_load32_zero, v128_impl_load32_zero, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_FUNC(v128_load64_zero, v128_impl_load64_zero, u64)\n)w2c_template\"\nR\"w2c_template(\n#if WABT_BIG_ENDIAN\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane0, simde_wasm_v128_load8_lane, u8, 15)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane1, simde_wasm_v128_load8_lane, u8, 14)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane2, simde_wasm_v128_load8_lane, u8, 13)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane3, simde_wasm_v128_load8_lane, u8, 12)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane4, simde_wasm_v128_load8_lane, u8, 11)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane5, simde_wasm_v128_load8_lane, u8, 10)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane6, simde_wasm_v128_load8_lane, u8, 9)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane7, simde_wasm_v128_load8_lane, u8, 8)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane8, simde_wasm_v128_load8_lane, u8, 7)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane9, simde_wasm_v128_load8_lane, u8, 6)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane10, simde_wasm_v128_load8_lane, u8, 5)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane11, simde_wasm_v128_load8_lane, u8, 4)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane12, simde_wasm_v128_load8_lane, u8, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane13, simde_wasm_v128_load8_lane, u8, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane14, simde_wasm_v128_load8_lane, u8, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane15, simde_wasm_v128_load8_lane, u8, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane0, simde_wasm_v128_load16_lane, u16, 7)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane1, simde_wasm_v128_load16_lane, u16, 6)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane2, simde_wasm_v128_load16_lane, u16, 5)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane3, simde_wasm_v128_load16_lane, u16, 4)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane4, simde_wasm_v128_load16_lane, u16, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane5, simde_wasm_v128_load16_lane, u16, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane6, simde_wasm_v128_load16_lane, u16, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane7, simde_wasm_v128_load16_lane, u16, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load32_lane0, simde_wasm_v128_load32_lane, u32, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load32_lane1, simde_wasm_v128_load32_lane, u32, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load32_lane2, simde_wasm_v128_load32_lane, u32, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load32_lane3, simde_wasm_v128_load32_lane, u32, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load64_lane0, simde_wasm_v128_load64_lane, u64, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load64_lane1, simde_wasm_v128_load64_lane, u64, 0)\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane0, simde_wasm_v128_load8_lane, u8, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane1, simde_wasm_v128_load8_lane, u8, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane2, simde_wasm_v128_load8_lane, u8, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane3, simde_wasm_v128_load8_lane, u8, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane4, simde_wasm_v128_load8_lane, u8, 4)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane5, simde_wasm_v128_load8_lane, u8, 5)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane6, simde_wasm_v128_load8_lane, u8, 6)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane7, simde_wasm_v128_load8_lane, u8, 7)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane8, simde_wasm_v128_load8_lane, u8, 8)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane9, simde_wasm_v128_load8_lane, u8, 9)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane10, simde_wasm_v128_load8_lane, u8, 10)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane11, simde_wasm_v128_load8_lane, u8, 11)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane12, simde_wasm_v128_load8_lane, u8, 12)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane13, simde_wasm_v128_load8_lane, u8, 13)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane14, simde_wasm_v128_load8_lane, u8, 14)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load8_lane15, simde_wasm_v128_load8_lane, u8, 15)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane0, simde_wasm_v128_load16_lane, u16, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane1, simde_wasm_v128_load16_lane, u16, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane2, simde_wasm_v128_load16_lane, u16, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane3, simde_wasm_v128_load16_lane, u16, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane4, simde_wasm_v128_load16_lane, u16, 4)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane5, simde_wasm_v128_load16_lane, u16, 5)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane6, simde_wasm_v128_load16_lane, u16, 6)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load16_lane7, simde_wasm_v128_load16_lane, u16, 7)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load32_lane0, simde_wasm_v128_load32_lane, u32, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load32_lane1, simde_wasm_v128_load32_lane, u32, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load32_lane2, simde_wasm_v128_load32_lane, u32, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load32_lane3, simde_wasm_v128_load32_lane, u32, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load64_lane0, simde_wasm_v128_load64_lane, u64, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_LOAD_LANE(v128_load64_lane1, simde_wasm_v128_load64_lane, u64, 1)\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\nDEFINE_SIMD_STORE(v128_store, v128)\n)w2c_template\"\nR\"w2c_template(\n#if WABT_BIG_ENDIAN\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane0, simde_wasm_v128_store8_lane, u8, 15)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane1, simde_wasm_v128_store8_lane, u8, 14)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane2, simde_wasm_v128_store8_lane, u8, 13)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane3, simde_wasm_v128_store8_lane, u8, 12)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane4, simde_wasm_v128_store8_lane, u8, 11)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane5, simde_wasm_v128_store8_lane, u8, 10)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane6, simde_wasm_v128_store8_lane, u8, 9)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane7, simde_wasm_v128_store8_lane, u8, 8)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane8, simde_wasm_v128_store8_lane, u8, 7)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane9, simde_wasm_v128_store8_lane, u8, 6)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane10, simde_wasm_v128_store8_lane, u8, 5)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane11, simde_wasm_v128_store8_lane, u8, 4)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane12, simde_wasm_v128_store8_lane, u8, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane13, simde_wasm_v128_store8_lane, u8, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane14, simde_wasm_v128_store8_lane, u8, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane15, simde_wasm_v128_store8_lane, u8, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane0, simde_wasm_v128_store16_lane, u16, 7)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane1, simde_wasm_v128_store16_lane, u16, 6)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane2, simde_wasm_v128_store16_lane, u16, 5)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane3, simde_wasm_v128_store16_lane, u16, 4)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane4, simde_wasm_v128_store16_lane, u16, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane5, simde_wasm_v128_store16_lane, u16, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane6, simde_wasm_v128_store16_lane, u16, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane7, simde_wasm_v128_store16_lane, u16, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store32_lane0, simde_wasm_v128_store32_lane, u32, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store32_lane1, simde_wasm_v128_store32_lane, u32, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store32_lane2, simde_wasm_v128_store32_lane, u32, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store32_lane3, simde_wasm_v128_store32_lane, u32, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store64_lane0, simde_wasm_v128_store64_lane, u64, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store64_lane1, simde_wasm_v128_store64_lane, u64, 0)\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane0, simde_wasm_v128_store8_lane, u8, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane1, simde_wasm_v128_store8_lane, u8, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane2, simde_wasm_v128_store8_lane, u8, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane3, simde_wasm_v128_store8_lane, u8, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane4, simde_wasm_v128_store8_lane, u8, 4)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane5, simde_wasm_v128_store8_lane, u8, 5)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane6, simde_wasm_v128_store8_lane, u8, 6)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane7, simde_wasm_v128_store8_lane, u8, 7)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane8, simde_wasm_v128_store8_lane, u8, 8)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane9, simde_wasm_v128_store8_lane, u8, 9)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane10, simde_wasm_v128_store8_lane, u8, 10)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane11, simde_wasm_v128_store8_lane, u8, 11)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane12, simde_wasm_v128_store8_lane, u8, 12)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane13, simde_wasm_v128_store8_lane, u8, 13)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane14, simde_wasm_v128_store8_lane, u8, 14)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store8_lane15, simde_wasm_v128_store8_lane, u8, 15)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane0, simde_wasm_v128_store16_lane, u16, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane1, simde_wasm_v128_store16_lane, u16, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane2, simde_wasm_v128_store16_lane, u16, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane3, simde_wasm_v128_store16_lane, u16, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane4, simde_wasm_v128_store16_lane, u16, 4)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane5, simde_wasm_v128_store16_lane, u16, 5)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane6, simde_wasm_v128_store16_lane, u16, 6)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store16_lane7, simde_wasm_v128_store16_lane, u16, 7)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store32_lane0, simde_wasm_v128_store32_lane, u32, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store32_lane1, simde_wasm_v128_store32_lane, u32, 1)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store32_lane2, simde_wasm_v128_store32_lane, u32, 2)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store32_lane3, simde_wasm_v128_store32_lane, u32, 3)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store64_lane0, simde_wasm_v128_store64_lane, u64, 0)\n)w2c_template\"\nR\"w2c_template(DEFINE_SIMD_STORE_LANE(v128_store64_lane1, simde_wasm_v128_store64_lane, u64, 1)\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n#if WABT_BIG_ENDIAN\n)w2c_template\"\nR\"w2c_template(#define v128_const(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) simde_wasm_i8x16_const(p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a)\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_extract_lane(v, l) simde_wasm_i8x16_extract_lane(v, 15-(l))\n)w2c_template\"\nR\"w2c_template(#define v128_u8x16_extract_lane(v, l) simde_wasm_u8x16_extract_lane(v, 15-(l))\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extract_lane(v, l) simde_wasm_i16x8_extract_lane(v, 7-(l))\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extract_lane(v, l) simde_wasm_u16x8_extract_lane(v, 7-(l))\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extract_lane(v, l) simde_wasm_i32x4_extract_lane(v, 3-(l))\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extract_lane(v, l) simde_wasm_i64x2_extract_lane(v, 1-(l))\n)w2c_template\"\nR\"w2c_template(#define v128_f32x4_extract_lane(v, l) simde_wasm_f32x4_extract_lane(v, 3-(l))\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_extract_lane(v, l) simde_wasm_f64x2_extract_lane(v, 1-(l))\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_replace_lane(v, l, x) simde_wasm_i8x16_replace_lane(v, 15-(l), x)\n)w2c_template\"\nR\"w2c_template(#define v128_u8x16_replace_lane(v, l, x) simde_wasm_u8x16_replace_lane(v, 15-(l), x)\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_replace_lane(v, l, x) simde_wasm_i16x8_replace_lane(v, 7-(l), x)\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_replace_lane(v, l, x) simde_wasm_u16x8_replace_lane(v, 7-(l), x)\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_replace_lane(v, l, x) simde_wasm_i32x4_replace_lane(v, 3-(l), x)\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_replace_lane(v, l, x) simde_wasm_i64x2_replace_lane(v, 1-(l), x)\n)w2c_template\"\nR\"w2c_template(#define v128_f32x4_replace_lane(v, l, x) simde_wasm_f32x4_replace_lane(v, 3-(l), x)\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_replace_lane(v, l, x) simde_wasm_f64x2_replace_lane(v, 1-(l), x)\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_bitmask(v) simde_wasm_i8x16_bitmask(simde_wasm_i8x16_swizzle(v, simde_wasm_i8x16_const(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)))\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_bitmask(v) simde_wasm_i16x8_bitmask(simde_wasm_i8x16_swizzle(v, simde_wasm_i8x16_const(14,15,12,13,10,11,8,9,6,7,4,5,2,3,0,1)))\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_bitmask(v) simde_wasm_i32x4_bitmask(simde_wasm_i8x16_swizzle(v, simde_wasm_i8x16_const(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3)))\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_bitmask(v) simde_wasm_i64x2_bitmask(simde_wasm_i8x16_swizzle(v, simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)))\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_swizzle(v1, v2) simde_wasm_i8x16_swizzle(v1, simde_wasm_v128_xor(v2, simde_wasm_i8x16_splat(15)))\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_shuffle(v1,v2,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) simde_wasm_i8x16_shuffle(v2,v1,31-(p),31-(o),31-(n),31-(m),31-(l),31-(k),31-(j),31-(i),31-(h),31-(g),31-(f),31-(e),31-(d),31-(c),31-(b),31-(a))\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extmul_high_i8x16 simde_wasm_i16x8_extmul_low_i8x16\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extmul_high_u8x16 simde_wasm_u16x8_extmul_low_u8x16\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extmul_low_i8x16  simde_wasm_i16x8_extmul_high_i8x16\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extmul_low_u8x16  simde_wasm_u16x8_extmul_high_u8x16\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extmul_high_i16x8 simde_wasm_i32x4_extmul_low_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_extmul_high_u16x8 simde_wasm_u32x4_extmul_low_u16x8\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extmul_low_i16x8  simde_wasm_i32x4_extmul_high_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_extmul_low_u16x8  simde_wasm_u32x4_extmul_high_u16x8\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extmul_high_i32x4 simde_wasm_i64x2_extmul_low_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u64x2_extmul_high_u32x4 simde_wasm_u64x2_extmul_low_u32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extmul_low_i32x4  simde_wasm_i64x2_extmul_high_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u64x2_extmul_low_u32x4  simde_wasm_u64x2_extmul_high_u32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extend_high_i8x16 simde_wasm_i16x8_extend_low_i8x16\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extend_high_u8x16 simde_wasm_u16x8_extend_low_u8x16\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extend_low_i8x16  simde_wasm_i16x8_extend_high_i8x16\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extend_low_u8x16  simde_wasm_u16x8_extend_high_u8x16\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extend_high_i16x8 simde_wasm_i32x4_extend_low_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_extend_high_u16x8 simde_wasm_u32x4_extend_low_u16x8\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extend_low_i16x8  simde_wasm_i32x4_extend_high_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_extend_low_u16x8  simde_wasm_u32x4_extend_high_u16x8\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extend_high_i32x4 simde_wasm_i64x2_extend_low_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u64x2_extend_high_u32x4 simde_wasm_u64x2_extend_low_u32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extend_low_i32x4  simde_wasm_i64x2_extend_high_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u64x2_extend_low_u32x4  simde_wasm_u64x2_extend_high_u32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_trunc_sat_f64x2_zero(a)      \\\n)w2c_template\"\nR\"w2c_template(  simde_wasm_i8x16_swizzle(                     \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i32x4_trunc_sat_f64x2_zero(a), \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7))\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_trunc_sat_f64x2_zero(a)      \\\n)w2c_template\"\nR\"w2c_template(  simde_wasm_i8x16_swizzle(                     \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_u32x4_trunc_sat_f64x2_zero(a), \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7))\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_narrow_i32x4(a,b) simde_wasm_i16x8_narrow_i32x4(b,a)\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_narrow_i32x4(a,b) simde_wasm_u16x8_narrow_i32x4(b,a)\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_narrow_i16x8(a,b) simde_wasm_i8x16_narrow_i16x8(b,a)\n)w2c_template\"\nR\"w2c_template(#define v128_u8x16_narrow_i16x8(a,b) simde_wasm_u8x16_narrow_i16x8(b,a)\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_promote_low_f32x4(a)                        \\\n)w2c_template\"\nR\"w2c_template(  simde_wasm_f64x2_promote_low_f32x4(simde_wasm_i8x16_swizzle( \\\n)w2c_template\"\nR\"w2c_template(      a,                                                       \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)))\n)w2c_template\"\nR\"w2c_template(#define v128_f32x4_demote_f64x2_zero(a)      \\\n)w2c_template\"\nR\"w2c_template(  simde_wasm_i8x16_swizzle(                  \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_f32x4_demote_f64x2_zero(a), \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7))\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_convert_low_i32x4(a)                        \\\n)w2c_template\"\nR\"w2c_template(  simde_wasm_f64x2_convert_low_i32x4(simde_wasm_i8x16_swizzle( \\\n)w2c_template\"\nR\"w2c_template(      a,                                                       \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)))\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_convert_low_u32x4(a)                        \\\n)w2c_template\"\nR\"w2c_template(  simde_wasm_f64x2_convert_low_u32x4(simde_wasm_i8x16_swizzle( \\\n)w2c_template\"\nR\"w2c_template(      a,                                                       \\\n)w2c_template\"\nR\"w2c_template(      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)))\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define v128_const simde_wasm_i8x16_const\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_extract_lane simde_wasm_i8x16_extract_lane\n)w2c_template\"\nR\"w2c_template(#define v128_u8x16_extract_lane simde_wasm_u8x16_extract_lane\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extract_lane simde_wasm_i16x8_extract_lane\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extract_lane simde_wasm_u16x8_extract_lane\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extract_lane simde_wasm_i32x4_extract_lane\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extract_lane simde_wasm_i64x2_extract_lane\n)w2c_template\"\nR\"w2c_template(#define v128_f32x4_extract_lane simde_wasm_f32x4_extract_lane\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_extract_lane simde_wasm_f64x2_extract_lane\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_replace_lane simde_wasm_i8x16_replace_lane\n)w2c_template\"\nR\"w2c_template(#define v128_u8x16_replace_lane simde_wasm_u8x16_replace_lane\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_replace_lane simde_wasm_i16x8_replace_lane\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_replace_lane simde_wasm_u16x8_replace_lane\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_replace_lane simde_wasm_i32x4_replace_lane\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_replace_lane simde_wasm_i64x2_replace_lane\n)w2c_template\"\nR\"w2c_template(#define v128_f32x4_replace_lane simde_wasm_f32x4_replace_lane\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_replace_lane simde_wasm_f64x2_replace_lane\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_bitmask simde_wasm_i8x16_bitmask\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_bitmask simde_wasm_i16x8_bitmask\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_bitmask simde_wasm_i32x4_bitmask\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_bitmask simde_wasm_i64x2_bitmask\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_swizzle simde_wasm_i8x16_swizzle\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_shuffle simde_wasm_i8x16_shuffle\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extmul_high_i8x16 simde_wasm_i16x8_extmul_high_i8x16\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extmul_high_u8x16 simde_wasm_u16x8_extmul_high_u8x16\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extmul_low_i8x16  simde_wasm_i16x8_extmul_low_i8x16\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extmul_low_u8x16  simde_wasm_u16x8_extmul_low_u8x16\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extmul_high_i16x8 simde_wasm_i32x4_extmul_high_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_extmul_high_u16x8 simde_wasm_u32x4_extmul_high_u16x8\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extmul_low_i16x8  simde_wasm_i32x4_extmul_low_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_extmul_low_u16x8  simde_wasm_u32x4_extmul_low_u16x8\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extmul_high_i32x4 simde_wasm_i64x2_extmul_high_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u64x2_extmul_high_u32x4 simde_wasm_u64x2_extmul_high_u32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extmul_low_i32x4  simde_wasm_i64x2_extmul_low_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u64x2_extmul_low_u32x4  simde_wasm_u64x2_extmul_low_u32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extend_high_i8x16 simde_wasm_i16x8_extend_high_i8x16\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extend_high_u8x16 simde_wasm_u16x8_extend_high_u8x16\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_extend_low_i8x16  simde_wasm_i16x8_extend_low_i8x16\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_extend_low_u8x16  simde_wasm_u16x8_extend_low_u8x16\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extend_high_i16x8 simde_wasm_i32x4_extend_high_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_extend_high_u16x8 simde_wasm_u32x4_extend_high_u16x8\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_extend_low_i16x8  simde_wasm_i32x4_extend_low_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_extend_low_u16x8  simde_wasm_u32x4_extend_low_u16x8\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extend_high_i32x4 simde_wasm_i64x2_extend_high_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u64x2_extend_high_u32x4 simde_wasm_u64x2_extend_high_u32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i64x2_extend_low_i32x4  simde_wasm_i64x2_extend_low_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u64x2_extend_low_u32x4  simde_wasm_u64x2_extend_low_u32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i32x4_trunc_sat_f64x2_zero simde_wasm_i32x4_trunc_sat_f64x2_zero\n)w2c_template\"\nR\"w2c_template(#define v128_u32x4_trunc_sat_f64x2_zero simde_wasm_u32x4_trunc_sat_f64x2_zero\n)w2c_template\"\nR\"w2c_template(#define v128_i16x8_narrow_i32x4 simde_wasm_i16x8_narrow_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_u16x8_narrow_i32x4 simde_wasm_u16x8_narrow_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_i8x16_narrow_i16x8 simde_wasm_i8x16_narrow_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_u8x16_narrow_i16x8 simde_wasm_u8x16_narrow_i16x8\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_promote_low_f32x4 simde_wasm_f64x2_promote_low_f32x4\n)w2c_template\"\nR\"w2c_template(#define v128_f32x4_demote_f64x2_zero simde_wasm_f32x4_demote_f64x2_zero\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_convert_low_i32x4 simde_wasm_f64x2_convert_low_i32x4\n)w2c_template\"\nR\"w2c_template(#define v128_f64x2_convert_low_u32x4 simde_wasm_f64x2_convert_low_u32x4\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(// clang-format on\n)w2c_template\"\n;\n"
  },
  {
    "path": "src/prebuilt/wasm2c_source_declarations.cc",
    "content": "const char* s_source_declarations = R\"w2c_template(\n// Computes a pointer to an object of the given size in a little-endian memory.\n)w2c_template\"\nR\"w2c_template(//\n)w2c_template\"\nR\"w2c_template(// On a little-endian host, this is just &mem->data[addr] - the object's size is\n)w2c_template\"\nR\"w2c_template(// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n)w2c_template\"\nR\"w2c_template(// is the object's size.\n)w2c_template\"\nR\"w2c_template(//\n)w2c_template\"\nR\"w2c_template(// Note that mem may be evaluated multiple times.\n)w2c_template\"\nR\"w2c_template(//\n)w2c_template\"\nR\"w2c_template(// Parameters:\n)w2c_template\"\nR\"w2c_template(// mem - The memory.\n)w2c_template\"\nR\"w2c_template(// addr - The address.\n)w2c_template\"\nR\"w2c_template(// n - The size of the object.\n)w2c_template\"\nR\"w2c_template(//\n)w2c_template\"\nR\"w2c_template(// Result:\n)w2c_template\"\nR\"w2c_template(// A pointer for an object of size n.\n)w2c_template\"\nR\"w2c_template(#if WABT_BIG_ENDIAN\n)w2c_template\"\nR\"w2c_template(#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n// We can only use Segue for this module if it uses a single unshared imported\n)w2c_template\"\nR\"w2c_template(// or exported memory\n)w2c_template\"\nR\"w2c_template(#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n)w2c_template\"\nR\"w2c_template(#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n)w2c_template\"\nR\"w2c_template(// POSIX uses FS for TLS, GS is free\n)w2c_template\"\nR\"w2c_template(static inline void* wasm_rt_segue_read_base() {\n)w2c_template\"\nR\"w2c_template(  if (wasm_rt_fsgsbase_inst_supported) {\n)w2c_template\"\nR\"w2c_template(    return (void*)__builtin_ia32_rdgsbase64();\n)w2c_template\"\nR\"w2c_template(  } else {\n)w2c_template\"\nR\"w2c_template(    return wasm_rt_syscall_get_segue_base();\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(static inline void wasm_rt_segue_write_base(void* base) {\n)w2c_template\"\nR\"w2c_template(#if WASM_RT_SEGUE_FREE_SEGMENT\n)w2c_template\"\nR\"w2c_template(  if (wasm_rt_last_segment_val == base) {\n)w2c_template\"\nR\"w2c_template(    return;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\n  wasm_rt_last_segment_val = base;\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n  if (wasm_rt_fsgsbase_inst_supported) {\n)w2c_template\"\nR\"w2c_template(    __builtin_ia32_wrgsbase64((uintptr_t)base);\n)w2c_template\"\nR\"w2c_template(  } else {\n)w2c_template\"\nR\"w2c_template(    wasm_rt_syscall_set_segue_base(base);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n)w2c_template\"\nR\"w2c_template(\n#if WASM_RT_STACK_DEPTH_COUNT\n)w2c_template\"\nR\"w2c_template(#define FUNC_PROLOGUE                                            \\\n)w2c_template\"\nR\"w2c_template(  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n)w2c_template\"\nR\"w2c_template(    TRAP(EXHAUSTION);\n)w2c_template\"\nR\"w2c_template(\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define FUNC_PROLOGUE\n)w2c_template\"\nR\"w2c_template(\n#define FUNC_EPILOGUE\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n#define UNREACHABLE TRAP(UNREACHABLE)\n)w2c_template\"\nR\"w2c_template(\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n)w2c_template\"\nR\"w2c_template(                                 const wasm_rt_func_type_t b) {\n)w2c_template\"\nR\"w2c_template(  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n)w2c_template\"\nR\"w2c_template(  (LIKELY((x) < table.size && table.data[x].func &&      \\\n)w2c_template\"\nR\"w2c_template(          func_types_eq(ft, table.data[x].func_type)) || \\\n)w2c_template\"\nR\"w2c_template(   TRAP(CALL_INDIRECT))\n)w2c_template\"\nR\"w2c_template(\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n)w2c_template\"\nR\"w2c_template(\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n)w2c_template\"\nR\"w2c_template(  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n)w2c_template\"\nR\"w2c_template(   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n)w2c_template\"\nR\"w2c_template(\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n)w2c_template\"\nR\"w2c_template(#if __has_builtin(__builtin_add_overflow)\n)w2c_template\"\nR\"w2c_template(  return __builtin_add_overflow(a, b, resptr);\n)w2c_template\"\nR\"w2c_template(#elif defined(_MSC_VER)\n)w2c_template\"\nR\"w2c_template(  return _addcarry_u64(0, a, b, resptr);\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\n#define RANGE_CHECK(mem, offset, len)              \\\n)w2c_template\"\nR\"w2c_template(  do {                                             \\\n)w2c_template\"\nR\"w2c_template(    uint64_t res;                                  \\\n)w2c_template\"\nR\"w2c_template(    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n)w2c_template\"\nR\"w2c_template(      TRAP(OOB);                                   \\\n)w2c_template\"\nR\"w2c_template(    if (UNLIKELY(res > (mem)->size))               \\\n)w2c_template\"\nR\"w2c_template(      TRAP(OOB);                                   \\\n)w2c_template\"\nR\"w2c_template(  } while (0);\n)w2c_template\"\nR\"w2c_template(\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n)w2c_template\"\nR\"w2c_template(#include <stdio.h>\n)w2c_template\"\nR\"w2c_template(#define WASM_RT_CHECK_BASE(mem)                                               \\\n)w2c_template\"\nR\"w2c_template(  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n)w2c_template\"\nR\"w2c_template(    puts(\"Segment register mismatch\\n\");                                      \\\n)w2c_template\"\nR\"w2c_template(    abort();                                                                  \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define WASM_RT_CHECK_BASE(mem)\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n)w2c_template\"\nR\"w2c_template(// default-page-size, 32-bit memories. It may do nothing at all\n)w2c_template\"\nR\"w2c_template(// (if hardware bounds-checking is enabled via guard pages)\n)w2c_template\"\nR\"w2c_template(// or it may do a slightly faster RANGE_CHECK.\n)w2c_template\"\nR\"w2c_template(#if WASM_RT_MEMCHECK_GUARD_PAGES\n)w2c_template\"\nR\"w2c_template(#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n)w2c_template\"\nR\"w2c_template(  WASM_RT_CHECK_BASE(mem);                           \\\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n)w2c_template\"\nR\"w2c_template(    TRAP(OOB);\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n// MEMCHECK_GENERAL can be used for any memory\n)w2c_template\"\nR\"w2c_template(#define MEMCHECK_GENERAL(mem, a, t) \\\n)w2c_template\"\nR\"w2c_template(  WASM_RT_CHECK_BASE(mem);          \\\n)w2c_template\"\nR\"w2c_template(  RANGE_CHECK(mem, a, sizeof(t));\n)w2c_template\"\nR\"w2c_template(\n#ifdef __GNUC__\n)w2c_template\"\nR\"w2c_template(#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n)w2c_template\"\nR\"w2c_template(// Clang on Mips requires \"f\" constraints on floats\n)w2c_template\"\nR\"w2c_template(// See https://github.com/llvm/llvm-project/issues/64241\n)w2c_template\"\nR\"w2c_template(#if defined(__clang__) && \\\n)w2c_template\"\nR\"w2c_template(    (defined(mips) || defined(__mips__) || defined(__mips))\n)w2c_template\"\nR\"w2c_template(#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define FORCE_READ_INT(var)\n)w2c_template\"\nR\"w2c_template(#define FORCE_READ_FLOAT(var)\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n)w2c_template\"\nR\"w2c_template(  if (!n) {\n)w2c_template\"\nR\"w2c_template(    return;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(#if WABT_BIG_ENDIAN\n)w2c_template\"\nR\"w2c_template(  for (size_t i = 0; i < n; i++) {\n)w2c_template\"\nR\"w2c_template(    dest[i] = src[n - i - 1];\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(  wasm_rt_memcpy(dest, src, n);\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\n#define LOAD_DATA(m, o, i, s)            \\\n)w2c_template\"\nR\"w2c_template(  do {                                   \\\n)w2c_template\"\nR\"w2c_template(    RANGE_CHECK((&m), o, s);             \\\n)w2c_template\"\nR\"w2c_template(    load_data(MEM_ADDR(&m, o, s), i, s); \\\n)w2c_template\"\nR\"w2c_template(  } while (0)\n)w2c_template\"\nR\"w2c_template(\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n)w2c_template\"\nR\"w2c_template(  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n)w2c_template\"\nR\"w2c_template(                                             u64 addr) {                     \\\n)w2c_template\"\nR\"w2c_template(    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n)w2c_template\"\nR\"w2c_template(    ret_kw name##_unchecked(mem, addr);                                      \\\n)w2c_template\"\nR\"w2c_template(  }                                                                          \\\n)w2c_template\"\nR\"w2c_template(  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n)w2c_template\"\nR\"w2c_template(    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n)w2c_template\"\nR\"w2c_template(    ret_kw name##_unchecked(mem, addr);                                      \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n)w2c_template\"\nR\"w2c_template(                        val_type1)                                           \\\n)w2c_template\"\nR\"w2c_template(  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n)w2c_template\"\nR\"w2c_template(                                             u64 addr, val_type1 val1) {     \\\n)w2c_template\"\nR\"w2c_template(    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n)w2c_template\"\nR\"w2c_template(    ret_kw name##_unchecked(mem, addr, val1);                                \\\n)w2c_template\"\nR\"w2c_template(  }                                                                          \\\n)w2c_template\"\nR\"w2c_template(  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n)w2c_template\"\nR\"w2c_template(                                 val_type1 val1) {                           \\\n)w2c_template\"\nR\"w2c_template(    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n)w2c_template\"\nR\"w2c_template(    ret_kw name##_unchecked(mem, addr, val1);                                \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n)w2c_template\"\nR\"w2c_template(                        val_type1, val_type2)                                \\\n)w2c_template\"\nR\"w2c_template(  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n)w2c_template\"\nR\"w2c_template(                                             u64 addr, val_type1 val1,       \\\n)w2c_template\"\nR\"w2c_template(                                             val_type2 val2) {               \\\n)w2c_template\"\nR\"w2c_template(    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n)w2c_template\"\nR\"w2c_template(    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n)w2c_template\"\nR\"w2c_template(  }                                                                          \\\n)w2c_template\"\nR\"w2c_template(  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n)w2c_template\"\nR\"w2c_template(                                 val_type1 val1, val_type2 val2) {           \\\n)w2c_template\"\nR\"w2c_template(    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n)w2c_template\"\nR\"w2c_template(    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n)w2c_template\"\nR\"w2c_template(  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n)w2c_template\"\nR\"w2c_template(    t1 result;                                                         \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n)w2c_template\"\nR\"w2c_template(                   sizeof(t1));                                        \\\n)w2c_template\"\nR\"w2c_template(    force_read(result);                                                \\\n)w2c_template\"\nR\"w2c_template(    return (t3)(t2)result;                                             \\\n)w2c_template\"\nR\"w2c_template(  }                                                                    \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_STORE(name, t1, t2)                                     \\\n)w2c_template\"\nR\"w2c_template(  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n)w2c_template\"\nR\"w2c_template(                                      t2 value) {                      \\\n)w2c_template\"\nR\"w2c_template(    t1 wrapped = (t1)value;                                            \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n)w2c_template\"\nR\"w2c_template(                   sizeof(t1));                                        \\\n)w2c_template\"\nR\"w2c_template(  }                                                                    \\\n)w2c_template\"\nR\"w2c_template(  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n)w2c_template\"\nR\"w2c_template(\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(i32_store, u32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(i64_store, u64, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(f32_store, f32, f32)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(f64_store, f64, f64)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(i32_store8, u8, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(i32_store16, u16, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(i64_store8, u8, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(i64_store16, u16, u64)\n)w2c_template\"\nR\"w2c_template(DEFINE_STORE(i64_store32, u32, u64)\n)w2c_template\"\nR\"w2c_template(\n#if defined(_MSC_VER)\n)w2c_template\"\nR\"w2c_template(\n// Adapted from\n)w2c_template\"\nR\"w2c_template(// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n)w2c_template\"\nR\"w2c_template(\nstatic inline int I64_CLZ(unsigned long long v) {\n)w2c_template\"\nR\"w2c_template(  unsigned long r = 0;\n)w2c_template\"\nR\"w2c_template(#if defined(_M_AMD64) || defined(_M_ARM)\n)w2c_template\"\nR\"w2c_template(  if (_BitScanReverse64(&r, v)) {\n)w2c_template\"\nR\"w2c_template(    return 63 - r;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n)w2c_template\"\nR\"w2c_template(    return 31 - r;\n)w2c_template\"\nR\"w2c_template(  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n)w2c_template\"\nR\"w2c_template(    return 63 - r;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(  return 64;\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic inline int I32_CLZ(unsigned long v) {\n)w2c_template\"\nR\"w2c_template(  unsigned long r = 0;\n)w2c_template\"\nR\"w2c_template(  if (_BitScanReverse(&r, v)) {\n)w2c_template\"\nR\"w2c_template(    return 31 - r;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return 32;\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic inline int I64_CTZ(unsigned long long v) {\n)w2c_template\"\nR\"w2c_template(  if (!v) {\n)w2c_template\"\nR\"w2c_template(    return 64;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  unsigned long r = 0;\n)w2c_template\"\nR\"w2c_template(#if defined(_M_AMD64) || defined(_M_ARM)\n)w2c_template\"\nR\"w2c_template(  _BitScanForward64(&r, v);\n)w2c_template\"\nR\"w2c_template(  return (int)r;\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(  if (_BitScanForward(&r, (unsigned int)(v))) {\n)w2c_template\"\nR\"w2c_template(    return (int)(r);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n)w2c_template\"\nR\"w2c_template(  return (int)(r + 32);\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic inline int I32_CTZ(unsigned long v) {\n)w2c_template\"\nR\"w2c_template(  if (!v) {\n)w2c_template\"\nR\"w2c_template(    return 32;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  unsigned long r = 0;\n)w2c_template\"\nR\"w2c_template(  _BitScanForward(&r, v);\n)w2c_template\"\nR\"w2c_template(  return (int)r;\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n)w2c_template\"\nR\"w2c_template(  static inline u32 f_n(T x) {                                      \\\n)w2c_template\"\nR\"w2c_template(    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n)w2c_template\"\nR\"w2c_template(    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n)w2c_template\"\nR\"w2c_template(    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n)w2c_template\"\nR\"w2c_template(    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\n)w2c_template\"\nR\"w2c_template(POPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n)w2c_template\"\nR\"w2c_template(\n#undef POPCOUNT_DEFINE_PORTABLE\n)w2c_template\"\nR\"w2c_template(\n#else\n)w2c_template\"\nR\"w2c_template(\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n)w2c_template\"\nR\"w2c_template(#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n)w2c_template\"\nR\"w2c_template(#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n)w2c_template\"\nR\"w2c_template(#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n)w2c_template\"\nR\"w2c_template(#define I32_POPCNT(x) (__builtin_popcount(x))\n)w2c_template\"\nR\"w2c_template(#define I64_POPCNT(x) (__builtin_popcountll(x))\n)w2c_template\"\nR\"w2c_template(\n#endif\n)w2c_template\"\nR\"w2c_template(\n#define DIV_S(ut, min, x, y)                                  \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n)w2c_template\"\nR\"w2c_template(                                         : (ut)((x) / (y)))\n)w2c_template\"\nR\"w2c_template(\n#define REM_S(ut, min, x, y)                                 \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n)w2c_template\"\nR\"w2c_template(                                         : (ut)((x) % (y)))\n)w2c_template\"\nR\"w2c_template(\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n)w2c_template\"\nR\"w2c_template(#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n)w2c_template\"\nR\"w2c_template(#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n)w2c_template\"\nR\"w2c_template(#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n)w2c_template\"\nR\"w2c_template(\n#define DIVREM_U(op, x, y) \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n)w2c_template\"\nR\"w2c_template(\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n)w2c_template\"\nR\"w2c_template(#define REM_U(x, y) DIVREM_U(%, x, y)\n)w2c_template\"\nR\"w2c_template(\n#define ROTL(x, y, mask) \\\n)w2c_template\"\nR\"w2c_template(  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n)w2c_template\"\nR\"w2c_template(#define ROTR(x, y, mask) \\\n)w2c_template\"\nR\"w2c_template(  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n)w2c_template\"\nR\"w2c_template(\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n)w2c_template\"\nR\"w2c_template(#define I64_ROTL(x, y) ROTL(x, y, 63)\n)w2c_template\"\nR\"w2c_template(#define I32_ROTR(x, y) ROTR(x, y, 31)\n)w2c_template\"\nR\"w2c_template(#define I64_ROTR(x, y) ROTR(x, y, 63)\n)w2c_template\"\nR\"w2c_template(\n#define FMIN(x, y)                                           \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n)w2c_template\"\nR\"w2c_template(   : (x < y)                          ? x                    \\\n)w2c_template\"\nR\"w2c_template(                                      : y)\n)w2c_template\"\nR\"w2c_template(\n#define FMAX(x, y)                                           \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n)w2c_template\"\nR\"w2c_template(   : (x > y)                          ? x                    \\\n)w2c_template\"\nR\"w2c_template(                                      : y)\n)w2c_template\"\nR\"w2c_template(\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n)w2c_template\"\nR\"w2c_template(                                                 : (ut)(st)(x))\n)w2c_template\"\nR\"w2c_template(\n#define I32_TRUNC_S_F32(x) \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n)w2c_template\"\nR\"w2c_template(#define I64_TRUNC_S_F32(x) \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n)w2c_template\"\nR\"w2c_template(#define I32_TRUNC_S_F64(x) \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n)w2c_template\"\nR\"w2c_template(#define I64_TRUNC_S_F64(x) \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n)w2c_template\"\nR\"w2c_template(\n#define TRUNC_U(ut, ft, max, x)                                              \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n)w2c_template\"\nR\"w2c_template(                                                  : (ut)(x))\n)w2c_template\"\nR\"w2c_template(\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n)w2c_template\"\nR\"w2c_template(#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n)w2c_template\"\nR\"w2c_template(#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n)w2c_template\"\nR\"w2c_template(#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n)w2c_template\"\nR\"w2c_template(\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((x) != (x)))         ? 0                           \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n)w2c_template\"\nR\"w2c_template(                                  : (ut)(st)(x))\n)w2c_template\"\nR\"w2c_template(\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n)w2c_template\"\nR\"w2c_template(              INT32_MAX, x)\n)w2c_template\"\nR\"w2c_template(#define I64_TRUNC_SAT_S_F32(x)                                              \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n)w2c_template\"\nR\"w2c_template(              INT64_MAX, x)\n)w2c_template\"\nR\"w2c_template(#define I32_TRUNC_SAT_S_F64(x)                                        \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n)w2c_template\"\nR\"w2c_template(              INT32_MAX, x)\n)w2c_template\"\nR\"w2c_template(#define I64_TRUNC_SAT_S_F64(x)                                              \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n)w2c_template\"\nR\"w2c_template(              INT64_MAX, x)\n)w2c_template\"\nR\"w2c_template(\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n)w2c_template\"\nR\"w2c_template(  ((UNLIKELY((x) != (x)))          ? 0    \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n)w2c_template\"\nR\"w2c_template(   : (UNLIKELY(!((x) < (max))))    ? smax \\\n)w2c_template\"\nR\"w2c_template(                                   : (ut)(x))\n)w2c_template\"\nR\"w2c_template(\n#define I32_TRUNC_SAT_U_F32(x) \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n)w2c_template\"\nR\"w2c_template(#define I64_TRUNC_SAT_U_F32(x) \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n)w2c_template\"\nR\"w2c_template(#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n)w2c_template\"\nR\"w2c_template(#define I64_TRUNC_SAT_U_F64(x) \\\n)w2c_template\"\nR\"w2c_template(  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n)w2c_template\"\nR\"w2c_template(  static inline t2 name(t1 x) {                  \\\n)w2c_template\"\nR\"w2c_template(    t2 result;                                   \\\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n)w2c_template\"\nR\"w2c_template(    return result;                               \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\n)w2c_template\"\nR\"w2c_template(DEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\n)w2c_template\"\nR\"w2c_template(DEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\n)w2c_template\"\nR\"w2c_template(DEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n)w2c_template\"\nR\"w2c_template(\nstatic float quiet_nanf(float x) {\n)w2c_template\"\nR\"w2c_template(  uint32_t tmp;\n)w2c_template\"\nR\"w2c_template(  wasm_rt_memcpy(&tmp, &x, 4);\n)w2c_template\"\nR\"w2c_template(  tmp |= 0x7fc00000lu;\n)w2c_template\"\nR\"w2c_template(  wasm_rt_memcpy(&x, &tmp, 4);\n)w2c_template\"\nR\"w2c_template(  return x;\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic double quiet_nan(double x) {\n)w2c_template\"\nR\"w2c_template(  uint64_t tmp;\n)w2c_template\"\nR\"w2c_template(  wasm_rt_memcpy(&tmp, &x, 8);\n)w2c_template\"\nR\"w2c_template(  tmp |= 0x7ff8000000000000llu;\n)w2c_template\"\nR\"w2c_template(  wasm_rt_memcpy(&x, &tmp, 8);\n)w2c_template\"\nR\"w2c_template(  return x;\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic double wasm_quiet(double x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nan(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return x;\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic float wasm_quietf(float x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nanf(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return x;\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic double wasm_floor(double x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nan(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return floor(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic float wasm_floorf(float x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nanf(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return floorf(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic double wasm_ceil(double x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nan(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return ceil(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic float wasm_ceilf(float x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nanf(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return ceilf(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic double wasm_trunc(double x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nan(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return trunc(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic float wasm_truncf(float x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nanf(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return truncf(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic float wasm_nearbyintf(float x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nanf(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return nearbyintf(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic double wasm_nearbyint(double x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nan(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return nearbyint(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic float wasm_fabsf(float x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    uint32_t tmp;\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&tmp, &x, 4);\n)w2c_template\"\nR\"w2c_template(    tmp = tmp & ~(1UL << 31);\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&x, &tmp, 4);\n)w2c_template\"\nR\"w2c_template(    return x;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return fabsf(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic double wasm_fabs(double x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    uint64_t tmp;\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&tmp, &x, 8);\n)w2c_template\"\nR\"w2c_template(    tmp = tmp & ~(1ULL << 63);\n)w2c_template\"\nR\"w2c_template(    wasm_rt_memcpy(&x, &tmp, 8);\n)w2c_template\"\nR\"w2c_template(    return x;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return fabs(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic double wasm_sqrt(double x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nan(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return sqrt(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic float wasm_sqrtf(float x) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(isnan(x))) {\n)w2c_template\"\nR\"w2c_template(    return quiet_nanf(x);\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(  return sqrtf(x);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n)w2c_template\"\nR\"w2c_template(  RANGE_CHECK(mem, d, n);\n)w2c_template\"\nR\"w2c_template(  memset(MEM_ADDR(mem, d, n), val, n);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n)w2c_template\"\nR\"w2c_template(                               const wasm_rt_memory_t* src,\n)w2c_template\"\nR\"w2c_template(                               u64 dest_addr,\n)w2c_template\"\nR\"w2c_template(                               u64 src_addr,\n)w2c_template\"\nR\"w2c_template(                               u64 n) {\n)w2c_template\"\nR\"w2c_template(  RANGE_CHECK(dest, dest_addr, n);\n)w2c_template\"\nR\"w2c_template(  RANGE_CHECK(src, src_addr, n);\n)w2c_template\"\nR\"w2c_template(  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n)w2c_template\"\nR\"w2c_template(                               const u8* src,\n)w2c_template\"\nR\"w2c_template(                               u32 src_size,\n)w2c_template\"\nR\"w2c_template(                               u64 dest_addr,\n)w2c_template\"\nR\"w2c_template(                               u32 src_addr,\n)w2c_template\"\nR\"w2c_template(                               u32 n) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n)w2c_template\"\nR\"w2c_template(    TRAP(OOB);\n)w2c_template\"\nR\"w2c_template(  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n)w2c_template\"\nR\"w2c_template(\ntypedef struct {\n)w2c_template\"\nR\"w2c_template(  wasm_elem_segment_expr_type_t expr_type;\n)w2c_template\"\nR\"w2c_template(  wasm_rt_func_type_t type;\n)w2c_template\"\nR\"w2c_template(  wasm_rt_function_ptr_t func;\n)w2c_template\"\nR\"w2c_template(  wasm_rt_tailcallee_t func_tailcallee;\n)w2c_template\"\nR\"w2c_template(  size_t module_offset;\n)w2c_template\"\nR\"w2c_template(} wasm_elem_segment_expr_t;\n)w2c_template\"\nR\"w2c_template(\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n)w2c_template\"\nR\"w2c_template(                                      const wasm_elem_segment_expr_t* src,\n)w2c_template\"\nR\"w2c_template(                                      u32 src_size,\n)w2c_template\"\nR\"w2c_template(                                      u64 dest_addr,\n)w2c_template\"\nR\"w2c_template(                                      u32 src_addr,\n)w2c_template\"\nR\"w2c_template(                                      u32 n,\n)w2c_template\"\nR\"w2c_template(                                      void* module_instance) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n)w2c_template\"\nR\"w2c_template(    TRAP(OOB);\n)w2c_template\"\nR\"w2c_template(  RANGE_CHECK(dest, dest_addr, n);\n)w2c_template\"\nR\"w2c_template(  for (u32 i = 0; i < n; i++) {\n)w2c_template\"\nR\"w2c_template(    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n)w2c_template\"\nR\"w2c_template(    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n)w2c_template\"\nR\"w2c_template(    switch (src_expr->expr_type) {\n)w2c_template\"\nR\"w2c_template(      case RefFunc:\n)w2c_template\"\nR\"w2c_template(        *dest_val = (wasm_rt_funcref_t){\n)w2c_template\"\nR\"w2c_template(            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n)w2c_template\"\nR\"w2c_template(            (char*)module_instance + src_expr->module_offset};\n)w2c_template\"\nR\"w2c_template(        break;\n)w2c_template\"\nR\"w2c_template(      case RefNull:\n)w2c_template\"\nR\"w2c_template(        *dest_val = wasm_rt_funcref_null_value;\n)w2c_template\"\nR\"w2c_template(        break;\n)w2c_template\"\nR\"w2c_template(      case GlobalGet:\n)w2c_template\"\nR\"w2c_template(        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n)w2c_template\"\nR\"w2c_template(                                            src_expr->module_offset);\n)w2c_template\"\nR\"w2c_template(        break;\n)w2c_template\"\nR\"w2c_template(    }\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\n// Currently wasm2c only supports initializing externref tables with ref.null.\n)w2c_template\"\nR\"w2c_template(static inline void externref_table_init(wasm_rt_externref_table_t* dest,\n)w2c_template\"\nR\"w2c_template(                                        u32 src_size,\n)w2c_template\"\nR\"w2c_template(                                        u64 dest_addr,\n)w2c_template\"\nR\"w2c_template(                                        u32 src_addr,\n)w2c_template\"\nR\"w2c_template(                                        u32 n) {\n)w2c_template\"\nR\"w2c_template(  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n)w2c_template\"\nR\"w2c_template(    TRAP(OOB);\n)w2c_template\"\nR\"w2c_template(  RANGE_CHECK(dest, dest_addr, n);\n)w2c_template\"\nR\"w2c_template(  for (u32 i = 0; i < n; i++) {\n)w2c_template\"\nR\"w2c_template(    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(}\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_TABLE_COPY(type)                                              \\\n)w2c_template\"\nR\"w2c_template(  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n)w2c_template\"\nR\"w2c_template(                                       const wasm_rt_##type##_table_t* src,  \\\n)w2c_template\"\nR\"w2c_template(                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n)w2c_template\"\nR\"w2c_template(    RANGE_CHECK(dest, dest_addr, n);                                         \\\n)w2c_template\"\nR\"w2c_template(    RANGE_CHECK(src, src_addr, n);                                           \\\n)w2c_template\"\nR\"w2c_template(    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n)w2c_template\"\nR\"w2c_template(            n * sizeof(wasm_rt_##type##_t));                                 \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\nDEFINE_TABLE_COPY(funcref)\n)w2c_template\"\nR\"w2c_template(DEFINE_TABLE_COPY(externref)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_TABLE_GET(type)                        \\\n)w2c_template\"\nR\"w2c_template(  static inline wasm_rt_##type##_t type##_table_get(  \\\n)w2c_template\"\nR\"w2c_template(      const wasm_rt_##type##_table_t* table, u64 i) { \\\n)w2c_template\"\nR\"w2c_template(    if (UNLIKELY(i >= table->size))                   \\\n)w2c_template\"\nR\"w2c_template(      TRAP(OOB);                                      \\\n)w2c_template\"\nR\"w2c_template(    return table->data[i];                            \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\nDEFINE_TABLE_GET(funcref)\n)w2c_template\"\nR\"w2c_template(DEFINE_TABLE_GET(externref)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_TABLE_SET(type)                                               \\\n)w2c_template\"\nR\"w2c_template(  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n)w2c_template\"\nR\"w2c_template(                                      u64 i, const wasm_rt_##type##_t val) { \\\n)w2c_template\"\nR\"w2c_template(    if (UNLIKELY(i >= table->size))                                          \\\n)w2c_template\"\nR\"w2c_template(      TRAP(OOB);                                                             \\\n)w2c_template\"\nR\"w2c_template(    table->data[i] = val;                                                    \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\nDEFINE_TABLE_SET(funcref)\n)w2c_template\"\nR\"w2c_template(DEFINE_TABLE_SET(externref)\n)w2c_template\"\nR\"w2c_template(\n#define DEFINE_TABLE_FILL(type)                                               \\\n)w2c_template\"\nR\"w2c_template(  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n)w2c_template\"\nR\"w2c_template(                                       u64 d, const wasm_rt_##type##_t val,   \\\n)w2c_template\"\nR\"w2c_template(                                       u64 n) {                               \\\n)w2c_template\"\nR\"w2c_template(    RANGE_CHECK(table, d, n);                                                 \\\n)w2c_template\"\nR\"w2c_template(    for (uint32_t i = d; i < d + n; i++) {                                    \\\n)w2c_template\"\nR\"w2c_template(      table->data[i] = val;                                                   \\\n)w2c_template\"\nR\"w2c_template(    }                                                                         \\\n)w2c_template\"\nR\"w2c_template(  }\n)w2c_template\"\nR\"w2c_template(\nDEFINE_TABLE_FILL(funcref)\n)w2c_template\"\nR\"w2c_template(DEFINE_TABLE_FILL(externref)\n)w2c_template\"\nR\"w2c_template(\n#if defined(__GNUC__) || defined(__clang__)\n)w2c_template\"\nR\"w2c_template(#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n)w2c_template\"\nR\"w2c_template(#define FUNC_TYPE_EXTERN_T(x) const char* const x\n)w2c_template\"\nR\"w2c_template(#define FUNC_TYPE_T(x) static const char* const x\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n)w2c_template\"\nR\"w2c_template(#define FUNC_TYPE_EXTERN_T(x) const char x[]\n)w2c_template\"\nR\"w2c_template(#define FUNC_TYPE_T(x) static const char x[]\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n)w2c_template\"\nR\"w2c_template(#define static_assert(X) \\\n)w2c_template\"\nR\"w2c_template(  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\nR\"w2c_template(\n#ifdef _MSC_VER\n)w2c_template\"\nR\"w2c_template(#define WEAK_FUNC_DECL(func, fallback)                             \\\n)w2c_template\"\nR\"w2c_template(  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n)w2c_template\"\nR\"w2c_template(                                                                   \\\n)w2c_template\"\nR\"w2c_template(      void                                                         \\\n)w2c_template\"\nR\"w2c_template(      fallback(void** instance_ptr, void* tail_call_stack,         \\\n)w2c_template\"\nR\"w2c_template(               wasm_rt_tailcallee_t* next)\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#define WEAK_FUNC_DECL(func, fallback)                                        \\\n)w2c_template\"\nR\"w2c_template(  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n)w2c_template\"\nR\"w2c_template(                                  wasm_rt_tailcallee_t* next)\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\n;\n"
  },
  {
    "path": "src/prebuilt/wasm2c_source_includes.cc",
    "content": "const char* s_source_includes = R\"w2c_template(#include <assert.h>\n)w2c_template\"\nR\"w2c_template(#include <math.h>\n)w2c_template\"\nR\"w2c_template(#include <stdarg.h>\n)w2c_template\"\nR\"w2c_template(#include <stddef.h>\n)w2c_template\"\nR\"w2c_template(#include <string.h>\n)w2c_template\"\nR\"w2c_template(#if defined(__MINGW32__)\n)w2c_template\"\nR\"w2c_template(#include <malloc.h>\n)w2c_template\"\nR\"w2c_template(#elif defined(_MSC_VER)\n)w2c_template\"\nR\"w2c_template(#include <intrin.h>\n)w2c_template\"\nR\"w2c_template(#include <malloc.h>\n)w2c_template\"\nR\"w2c_template(#define alloca _alloca\n)w2c_template\"\nR\"w2c_template(#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n)w2c_template\"\nR\"w2c_template(#include <stdlib.h>\n)w2c_template\"\nR\"w2c_template(#else\n)w2c_template\"\nR\"w2c_template(#include <alloca.h>\n)w2c_template\"\nR\"w2c_template(#endif\n)w2c_template\"\n;\n"
  },
  {
    "path": "src/resolve-names.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/resolve-names.h\"\n\n#include <cassert>\n#include <cstdio>\n\n#include \"wabt/cast.h\"\n#include \"wabt/expr-visitor.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/wast-lexer.h\"\n\nnamespace wabt {\n\nnamespace {\n\nclass NameResolver : public ExprVisitor::DelegateNop {\n public:\n  NameResolver(Script* script, Errors* errors);\n\n  Result VisitModule(Module* module);\n  Result VisitScript(Script* script);\n\n  // Implementation of ExprVisitor::DelegateNop.\n  Result BeginBlockExpr(BlockExpr*) override;\n  Result EndBlockExpr(BlockExpr*) override;\n  Result OnBrExpr(BrExpr*) override;\n  Result OnBrIfExpr(BrIfExpr*) override;\n  Result OnBrOnNonNullExpr(BrOnNonNullExpr*) override;\n  Result OnBrOnNullExpr(BrOnNullExpr*) override;\n  Result OnBrTableExpr(BrTableExpr*) override;\n  Result OnCallExpr(CallExpr*) override;\n  Result OnCallIndirectExpr(CallIndirectExpr*) override;\n  Result OnCallRefExpr(CallRefExpr*) override;\n  Result OnCatchExpr(TryExpr*, Catch*) override;\n  Result OnDelegateExpr(TryExpr*) override;\n  Result OnReturnCallExpr(ReturnCallExpr*) override;\n  Result OnReturnCallIndirectExpr(ReturnCallIndirectExpr*) override;\n  Result OnReturnCallRefExpr(ReturnCallRefExpr*) override;\n  Result OnGlobalGetExpr(GlobalGetExpr*) override;\n  Result OnGlobalSetExpr(GlobalSetExpr*) override;\n  Result BeginIfExpr(IfExpr*) override;\n  Result EndIfExpr(IfExpr*) override;\n  Result OnLoadExpr(LoadExpr*) override;\n  Result OnLocalGetExpr(LocalGetExpr*) override;\n  Result OnLocalSetExpr(LocalSetExpr*) override;\n  Result OnLocalTeeExpr(LocalTeeExpr*) override;\n  Result BeginLoopExpr(LoopExpr*) override;\n  Result EndLoopExpr(LoopExpr*) override;\n  Result OnMemoryCopyExpr(MemoryCopyExpr*) override;\n  Result OnDataDropExpr(DataDropExpr*) override;\n  Result OnMemoryFillExpr(MemoryFillExpr*) override;\n  Result OnMemoryGrowExpr(MemoryGrowExpr*) override;\n  Result OnMemoryInitExpr(MemoryInitExpr*) override;\n  Result OnMemorySizeExpr(MemorySizeExpr*) override;\n  Result OnElemDropExpr(ElemDropExpr*) override;\n  Result OnTableCopyExpr(TableCopyExpr*) override;\n  Result OnTableInitExpr(TableInitExpr*) override;\n  Result OnTableGetExpr(TableGetExpr*) override;\n  Result OnTableSetExpr(TableSetExpr*) override;\n  Result OnTableGrowExpr(TableGrowExpr*) override;\n  Result OnTableSizeExpr(TableSizeExpr*) override;\n  Result OnTableFillExpr(TableFillExpr*) override;\n  Result OnRefFuncExpr(RefFuncExpr*) override;\n  Result OnRefNullExpr(RefNullExpr*) override;\n  Result OnStoreExpr(StoreExpr*) override;\n  Result BeginTryExpr(TryExpr*) override;\n  Result EndTryExpr(TryExpr*) override;\n  Result BeginTryTableExpr(TryTableExpr*) override;\n  Result EndTryTableExpr(TryTableExpr*) override;\n  Result OnThrowExpr(ThrowExpr*) override;\n  Result OnRethrowExpr(RethrowExpr*) override;\n  Result OnSimdLoadLaneExpr(SimdLoadLaneExpr*) override;\n  Result OnSimdStoreLaneExpr(SimdStoreLaneExpr*) override;\n\n private:\n  void PrintError(const Location* loc, const char* fmt, ...);\n  void PushLabel(const std::string& label);\n  void PopLabel();\n  void CheckDuplicateBindings(const BindingHash* bindings, const char* desc);\n  void PrintDuplicateBindingsError(const BindingHash::value_type&,\n                                   const BindingHash::value_type&,\n                                   const char* desc);\n  void ResolveLabelVar(Var* var);\n  void ResolveVar(const BindingHash* bindings, Var* var, const char* desc);\n  void ResolveFuncVar(Var* var);\n  void ResolveGlobalVar(Var* var);\n  void ResolveFuncTypeVar(Var* var);\n  void ResolveTableVar(Var* var);\n  void ResolveMemoryVar(Var* var);\n  void ResolveTagVar(Var* var);\n  void ResolveDataSegmentVar(Var* var);\n  void ResolveElemSegmentVar(Var* var);\n  void ResolveLocalVar(Var* var);\n  void ResolveBlockDeclarationVar(BlockDeclaration* decl);\n  void VisitFunc(Func* func);\n  void VisitExport(Export* export_);\n  void VisitGlobal(Global* global);\n  void VisitTag(Tag* tag);\n  void VisitTable(Table* table);\n  void VisitElemSegment(ElemSegment* segment);\n  void VisitDataSegment(DataSegment* segment);\n  void VisitScriptModule(ScriptModule* script_module);\n  void VisitCommand(Command* command);\n\n  Errors* errors_ = nullptr;\n  Script* script_ = nullptr;\n  Module* current_module_ = nullptr;\n  Func* current_func_ = nullptr;\n  ExprVisitor visitor_;\n  std::vector<std::string> labels_;\n  Result result_ = Result::Ok;\n};\n\nNameResolver::NameResolver(Script* script, Errors* errors)\n    : errors_(errors), script_(script), visitor_(this) {}\n\n}  // end anonymous namespace\n\nvoid WABT_PRINTF_FORMAT(3, 4) NameResolver::PrintError(const Location* loc,\n                                                       const char* format,\n                                                       ...) {\n  result_ = Result::Error;\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  errors_->emplace_back(ErrorLevel::Error, *loc, buffer);\n}\n\nvoid NameResolver::PushLabel(const std::string& label) {\n  labels_.push_back(label);\n}\n\nvoid NameResolver::PopLabel() {\n  labels_.pop_back();\n}\n\nvoid NameResolver::CheckDuplicateBindings(const BindingHash* bindings,\n                                          const char* desc) {\n  bindings->FindDuplicates([this, desc](const BindingHash::value_type& a,\n                                        const BindingHash::value_type& b) {\n    PrintDuplicateBindingsError(a, b, desc);\n  });\n}\n\nvoid NameResolver::PrintDuplicateBindingsError(const BindingHash::value_type& a,\n                                               const BindingHash::value_type& b,\n                                               const char* desc) {\n  // Choose the location that is later in the file.\n  const Location& a_loc = a.second.loc;\n  const Location& b_loc = b.second.loc;\n  const Location& loc = a_loc.line > b_loc.line ? a_loc : b_loc;\n  PrintError(&loc, \"redefinition of %s \\\"%s\\\"\", desc, a.first.c_str());\n}\n\nvoid NameResolver::ResolveLabelVar(Var* var) {\n  if (var->is_name()) {\n    for (int i = labels_.size() - 1; i >= 0; --i) {\n      const std::string& label = labels_[i];\n      if (label == var->name()) {\n        var->set_index(labels_.size() - i - 1);\n        return;\n      }\n    }\n    PrintError(&var->loc, \"undefined label variable \\\"%s\\\"\",\n               var->name().c_str());\n  }\n}\n\nvoid NameResolver::ResolveVar(const BindingHash* bindings,\n                              Var* var,\n                              const char* desc) {\n  if (var->is_name()) {\n    Index index = bindings->FindIndex(*var);\n    if (index == kInvalidIndex) {\n      PrintError(&var->loc, \"undefined %s variable \\\"%s\\\"\", desc,\n                 var->name().c_str());\n      return;\n    }\n\n    var->set_index(index);\n  }\n}\n\nvoid NameResolver::ResolveFuncVar(Var* var) {\n  ResolveVar(&current_module_->func_bindings, var, \"function\");\n}\n\nvoid NameResolver::ResolveGlobalVar(Var* var) {\n  ResolveVar(&current_module_->global_bindings, var, \"global\");\n}\n\nvoid NameResolver::ResolveFuncTypeVar(Var* var) {\n  ResolveVar(&current_module_->type_bindings, var, \"type\");\n}\n\nvoid NameResolver::ResolveTableVar(Var* var) {\n  ResolveVar(&current_module_->table_bindings, var, \"table\");\n}\n\nvoid NameResolver::ResolveMemoryVar(Var* var) {\n  ResolveVar(&current_module_->memory_bindings, var, \"memory\");\n}\n\nvoid NameResolver::ResolveTagVar(Var* var) {\n  ResolveVar(&current_module_->tag_bindings, var, \"tag\");\n}\n\nvoid NameResolver::ResolveDataSegmentVar(Var* var) {\n  ResolveVar(&current_module_->data_segment_bindings, var, \"data segment\");\n}\n\nvoid NameResolver::ResolveElemSegmentVar(Var* var) {\n  ResolveVar(&current_module_->elem_segment_bindings, var, \"elem segment\");\n}\n\nvoid NameResolver::ResolveLocalVar(Var* var) {\n  if (var->is_name()) {\n    if (!current_func_) {\n      return;\n    }\n\n    Index index = current_func_->GetLocalIndex(*var);\n    if (index == kInvalidIndex) {\n      PrintError(&var->loc, \"undefined local variable \\\"%s\\\"\",\n                 var->name().c_str());\n      return;\n    }\n\n    var->set_index(index);\n  }\n}\n\nvoid NameResolver::ResolveBlockDeclarationVar(BlockDeclaration* decl) {\n  if (decl->has_func_type) {\n    ResolveFuncTypeVar(&decl->type_var);\n  }\n}\n\nResult NameResolver::BeginBlockExpr(BlockExpr* expr) {\n  PushLabel(expr->block.label);\n  ResolveBlockDeclarationVar(&expr->block.decl);\n  return Result::Ok;\n}\n\nResult NameResolver::EndBlockExpr(BlockExpr* expr) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameResolver::BeginLoopExpr(LoopExpr* expr) {\n  PushLabel(expr->block.label);\n  ResolveBlockDeclarationVar(&expr->block.decl);\n  return Result::Ok;\n}\n\nResult NameResolver::EndLoopExpr(LoopExpr* expr) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameResolver::OnBrExpr(BrExpr* expr) {\n  ResolveLabelVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnBrIfExpr(BrIfExpr* expr) {\n  ResolveLabelVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnBrOnNonNullExpr(BrOnNonNullExpr* expr) {\n  ResolveLabelVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnBrOnNullExpr(BrOnNullExpr* expr) {\n  ResolveLabelVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnBrTableExpr(BrTableExpr* expr) {\n  for (Var& target : expr->targets)\n    ResolveLabelVar(&target);\n  ResolveLabelVar(&expr->default_target);\n  return Result::Ok;\n}\n\nResult NameResolver::OnCallExpr(CallExpr* expr) {\n  ResolveFuncVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnCallIndirectExpr(CallIndirectExpr* expr) {\n  if (expr->decl.has_func_type) {\n    ResolveFuncTypeVar(&expr->decl.type_var);\n  }\n  ResolveTableVar(&expr->table);\n  return Result::Ok;\n}\n\nResult NameResolver::OnCallRefExpr(CallRefExpr* expr) {\n  ResolveFuncTypeVar(&expr->sig_type);\n  return Result::Ok;\n}\n\nResult NameResolver::OnReturnCallExpr(ReturnCallExpr* expr) {\n  ResolveFuncVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnReturnCallIndirectExpr(ReturnCallIndirectExpr* expr) {\n  if (expr->decl.has_func_type) {\n    ResolveFuncTypeVar(&expr->decl.type_var);\n  }\n  ResolveTableVar(&expr->table);\n  return Result::Ok;\n}\n\nResult NameResolver::OnReturnCallRefExpr(ReturnCallRefExpr* expr) {\n  ResolveFuncTypeVar(&expr->sig_type);\n  return Result::Ok;\n}\n\nResult NameResolver::OnGlobalGetExpr(GlobalGetExpr* expr) {\n  ResolveGlobalVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnGlobalSetExpr(GlobalSetExpr* expr) {\n  ResolveGlobalVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::BeginIfExpr(IfExpr* expr) {\n  PushLabel(expr->true_.label);\n  ResolveBlockDeclarationVar(&expr->true_.decl);\n  return Result::Ok;\n}\n\nResult NameResolver::EndIfExpr(IfExpr* expr) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameResolver::OnLoadExpr(LoadExpr* expr) {\n  ResolveMemoryVar(&expr->memidx);\n  return Result::Ok;\n}\n\nResult NameResolver::OnLocalGetExpr(LocalGetExpr* expr) {\n  ResolveLocalVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnLocalSetExpr(LocalSetExpr* expr) {\n  ResolveLocalVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnLocalTeeExpr(LocalTeeExpr* expr) {\n  ResolveLocalVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnMemoryCopyExpr(MemoryCopyExpr* expr) {\n  ResolveMemoryVar(&expr->destmemidx);\n  ResolveMemoryVar(&expr->srcmemidx);\n  return Result::Ok;\n}\n\nResult NameResolver::OnDataDropExpr(DataDropExpr* expr) {\n  ResolveDataSegmentVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnMemoryFillExpr(MemoryFillExpr* expr) {\n  ResolveMemoryVar(&expr->memidx);\n  return Result::Ok;\n}\n\nResult NameResolver::OnMemoryGrowExpr(MemoryGrowExpr* expr) {\n  ResolveMemoryVar(&expr->memidx);\n  return Result::Ok;\n}\n\nResult NameResolver::OnMemoryInitExpr(MemoryInitExpr* expr) {\n  ResolveDataSegmentVar(&expr->var);\n  ResolveMemoryVar(&expr->memidx);\n  return Result::Ok;\n}\n\nResult NameResolver::OnMemorySizeExpr(MemorySizeExpr* expr) {\n  ResolveMemoryVar(&expr->memidx);\n  return Result::Ok;\n}\n\nResult NameResolver::OnElemDropExpr(ElemDropExpr* expr) {\n  ResolveElemSegmentVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnTableCopyExpr(TableCopyExpr* expr) {\n  ResolveTableVar(&expr->dst_table);\n  ResolveTableVar(&expr->src_table);\n  return Result::Ok;\n}\n\nResult NameResolver::OnTableInitExpr(TableInitExpr* expr) {\n  ResolveElemSegmentVar(&expr->segment_index);\n  ResolveTableVar(&expr->table_index);\n  return Result::Ok;\n}\n\nResult NameResolver::OnTableGetExpr(TableGetExpr* expr) {\n  ResolveTableVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnTableSetExpr(TableSetExpr* expr) {\n  ResolveTableVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnTableGrowExpr(TableGrowExpr* expr) {\n  ResolveTableVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnTableSizeExpr(TableSizeExpr* expr) {\n  ResolveTableVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnTableFillExpr(TableFillExpr* expr) {\n  ResolveTableVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnRefFuncExpr(RefFuncExpr* expr) {\n  ResolveFuncVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnRefNullExpr(RefNullExpr* expr) {\n  ResolveFuncTypeVar(&expr->type);\n  return Result::Ok;\n}\n\nResult NameResolver::OnStoreExpr(StoreExpr* expr) {\n  ResolveMemoryVar(&expr->memidx);\n  return Result::Ok;\n}\n\nResult NameResolver::BeginTryExpr(TryExpr* expr) {\n  PushLabel(expr->block.label);\n  ResolveBlockDeclarationVar(&expr->block.decl);\n  return Result::Ok;\n}\n\nResult NameResolver::EndTryExpr(TryExpr*) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameResolver::BeginTryTableExpr(TryTableExpr* expr) {\n  for (TableCatch& catch_ : expr->catches) {\n    if (!catch_.IsCatchAll()) {\n      ResolveTagVar(&catch_.tag);\n    }\n    ResolveLabelVar(&catch_.target);\n  }\n  PushLabel(expr->block.label);\n  ResolveBlockDeclarationVar(&expr->block.decl);\n  return Result::Ok;\n}\n\nResult NameResolver::EndTryTableExpr(TryTableExpr*) {\n  PopLabel();\n  return Result::Ok;\n}\n\nResult NameResolver::OnCatchExpr(TryExpr*, Catch* catch_) {\n  if (!catch_->IsCatchAll()) {\n    ResolveTagVar(&catch_->var);\n  }\n  return Result::Ok;\n}\n\nResult NameResolver::OnDelegateExpr(TryExpr* expr) {\n  // Pop the label here as a try-delegate has no `end` instruction.\n  PopLabel();\n\n  // We resolve *after* popping the label in order to ensure that the\n  // delegate label starts counting after the current try-delegate.\n  ResolveLabelVar(&expr->delegate_target);\n\n  return Result::Ok;\n}\n\nResult NameResolver::OnThrowExpr(ThrowExpr* expr) {\n  ResolveTagVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnRethrowExpr(RethrowExpr* expr) {\n  // Note: the variable refers to corresponding (enclosing) catch, using the try\n  // block label for context.\n  ResolveLabelVar(&expr->var);\n  return Result::Ok;\n}\n\nResult NameResolver::OnSimdLoadLaneExpr(SimdLoadLaneExpr* expr) {\n  ResolveMemoryVar(&expr->memidx);\n  return Result::Ok;\n}\n\nResult NameResolver::OnSimdStoreLaneExpr(SimdStoreLaneExpr* expr) {\n  ResolveMemoryVar(&expr->memidx);\n  return Result::Ok;\n}\n\nvoid NameResolver::VisitFunc(Func* func) {\n  current_func_ = func;\n  if (func->decl.has_func_type) {\n    ResolveFuncTypeVar(&func->decl.type_var);\n  }\n\n  func->bindings.FindDuplicates([func, this](const BindingHash::value_type& a,\n                                             const BindingHash::value_type& b) {\n    const char* desc =\n        (a.second.index < func->GetNumParams()) ? \"parameter\" : \"local\";\n    PrintDuplicateBindingsError(a, b, desc);\n  });\n\n  visitor_.VisitFunc(func);\n  current_func_ = nullptr;\n}\n\nvoid NameResolver::VisitExport(Export* export_) {\n  switch (export_->kind) {\n    case ExternalKind::Func:\n      ResolveFuncVar(&export_->var);\n      break;\n\n    case ExternalKind::Table:\n      ResolveTableVar(&export_->var);\n      break;\n\n    case ExternalKind::Memory:\n      ResolveMemoryVar(&export_->var);\n      break;\n\n    case ExternalKind::Global:\n      ResolveGlobalVar(&export_->var);\n      break;\n\n    case ExternalKind::Tag:\n      ResolveTagVar(&export_->var);\n      break;\n  }\n}\n\nvoid NameResolver::VisitGlobal(Global* global) {\n  visitor_.VisitExprList(global->init_expr);\n}\n\nvoid NameResolver::VisitTag(Tag* tag) {\n  if (tag->decl.has_func_type) {\n    ResolveFuncTypeVar(&tag->decl.type_var);\n  }\n}\n\nvoid NameResolver::VisitTable(Table* table) {\n  if (!table->init_expr.empty()) {\n    visitor_.VisitExprList(table->init_expr);\n  }\n}\n\nvoid NameResolver::VisitElemSegment(ElemSegment* segment) {\n  ResolveTableVar(&segment->table_var);\n  visitor_.VisitExprList(segment->offset);\n  for (ExprList& elem_expr : segment->elem_exprs) {\n    if (elem_expr.size() == 1 &&\n        elem_expr.front().type() == ExprType::RefFunc) {\n      ResolveFuncVar(&cast<RefFuncExpr>(&elem_expr.front())->var);\n    }\n  }\n}\n\nvoid NameResolver::VisitDataSegment(DataSegment* segment) {\n  ResolveMemoryVar(&segment->memory_var);\n  visitor_.VisitExprList(segment->offset);\n}\n\nResult NameResolver::VisitModule(Module* module) {\n  current_module_ = module;\n  CheckDuplicateBindings(&module->elem_segment_bindings, \"elem\");\n  CheckDuplicateBindings(&module->func_bindings, \"function\");\n  CheckDuplicateBindings(&module->global_bindings, \"global\");\n  CheckDuplicateBindings(&module->type_bindings, \"type\");\n  CheckDuplicateBindings(&module->table_bindings, \"table\");\n  CheckDuplicateBindings(&module->memory_bindings, \"memory\");\n  CheckDuplicateBindings(&module->tag_bindings, \"tag\");\n\n  for (Func* func : module->funcs)\n    VisitFunc(func);\n  for (Export* export_ : module->exports)\n    VisitExport(export_);\n  for (Global* global : module->globals)\n    VisitGlobal(global);\n  for (Tag* tag : module->tags)\n    VisitTag(tag);\n  for (Table* table : module->tables)\n    VisitTable(table);\n  for (ElemSegment* elem_segment : module->elem_segments)\n    VisitElemSegment(elem_segment);\n  for (DataSegment* data_segment : module->data_segments)\n    VisitDataSegment(data_segment);\n  for (Var* start : module->starts)\n    ResolveFuncVar(start);\n  current_module_ = nullptr;\n  return result_;\n}\n\nvoid NameResolver::VisitScriptModule(ScriptModule* script_module) {\n  if (auto* tsm = dyn_cast<TextScriptModule>(script_module)) {\n    VisitModule(&tsm->module);\n  }\n}\n\nvoid NameResolver::VisitCommand(Command* command) {\n  switch (command->type) {\n    case CommandType::Module:\n      VisitModule(&cast<ModuleCommand>(command)->module);\n      break;\n\n    case CommandType::ScriptModule:\n      VisitModule(&cast<ScriptModuleCommand>(command)->module);\n      break;\n\n    case CommandType::Action:\n    case CommandType::AssertReturn:\n    case CommandType::AssertTrap:\n    case CommandType::AssertExhaustion:\n    case CommandType::AssertException:\n    case CommandType::Register:\n      /* Don't resolve a module_var, since it doesn't really behave like other\n       * vars. You can't reference a module by index. */\n      break;\n\n    case CommandType::AssertMalformed:\n      /* Malformed modules should not be text; the whole point of this\n       * assertion is to test for malformed binary modules. */\n      break;\n\n    case CommandType::AssertInvalid: {\n      auto* assert_invalid_command = cast<AssertInvalidCommand>(command);\n      /* The module may be invalid because the names cannot be resolved; we\n       * don't want to print errors or fail if that's the case, but we still\n       * should try to resolve names when possible. */\n      Errors errors;\n      NameResolver new_resolver(script_, &errors);\n      new_resolver.VisitScriptModule(assert_invalid_command->module.get());\n      break;\n    }\n\n    case CommandType::AssertUnlinkable:\n      VisitScriptModule(cast<AssertUnlinkableCommand>(command)->module.get());\n      break;\n\n    case CommandType::AssertUninstantiable:\n      VisitScriptModule(\n          cast<AssertUninstantiableCommand>(command)->module.get());\n      break;\n  }\n}\n\nResult NameResolver::VisitScript(Script* script) {\n  for (const std::unique_ptr<Command>& command : script->commands)\n    VisitCommand(command.get());\n  return result_;\n}\n\nResult ResolveNamesModule(Module* module, Errors* errors) {\n  NameResolver resolver(nullptr, errors);\n  return resolver.VisitModule(module);\n}\n\nResult ResolveNamesScript(Script* script, Errors* errors) {\n  NameResolver resolver(script, errors);\n  return resolver.VisitScript(script);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/sha256.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/sha256.h\"\n\n#if HAVE_OPENSSL_SHA_H\n#include <openssl/sha.h>\n#else\n#include \"picosha2.h\"\n#endif\n\nnamespace wabt {\n\n/**\n * SHA-256 the \"input\" sv into the output \"digest\".\n *\n * Uses OpenSSL's libcrypto or vendored PicoSHA2.\n */\nvoid sha256(std::string_view input, std::string& digest) {\n  digest.clear();\n\n#if HAVE_OPENSSL_SHA_H\n  digest.resize(SHA256_DIGEST_LENGTH);\n  if (!SHA256(reinterpret_cast<const uint8_t*>(input.data()), input.size(),\n              reinterpret_cast<uint8_t*>(digest.data()))) {\n    // should not be possible to fail here, but check (and abort) just in case\n    abort();\n  }\n#else\n  digest.resize(picosha2::k_digest_size);\n  picosha2::hash256(input, digest);\n#endif\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/shared-validator.cc",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/shared-validator.h\"\n\n#include <algorithm>\n#include <cinttypes>\n#include <limits>\n\nnamespace wabt {\n\nTypeVector SharedValidator::ToTypeVector(Index count, const Type* types) {\n  return TypeVector(&types[0], &types[count]);\n}\n\nSharedValidator::SharedValidator(Errors* errors, const ValidateOptions& options)\n    : options_(options),\n      errors_(errors),\n      typechecker_(options.features, func_types_) {\n  typechecker_.set_error_callback(\n      [this](const char* msg) { OnTypecheckerError(msg); });\n}\n\nResult WABT_PRINTF_FORMAT(3, 4) SharedValidator::PrintError(const Location& loc,\n                                                            const char* format,\n                                                            ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  errors_->emplace_back(ErrorLevel::Error, loc, buffer);\n  return Result::Error;\n}\n\nvoid SharedValidator::OnTypecheckerError(const char* msg) {\n  PrintError(expr_loc_, \"%s\", msg);\n}\n\nResult SharedValidator::OnFuncType(const Location& loc,\n                                   Index param_count,\n                                   const Type* param_types,\n                                   Index result_count,\n                                   const Type* result_types,\n                                   Index type_index) {\n  Result result = Result::Ok;\n  if (!options_.features.multi_value_enabled() && result_count > 1) {\n    result |= PrintError(loc,\n                         \"multiple result values are not supported without \"\n                         \"multi-value enabled.\");\n  }\n  if (options_.features.reference_types_enabled()) {\n    for (Index i = 0; i < param_count; i++) {\n      result |= CheckReferenceType(loc, param_types[i], \"params\");\n    }\n    for (Index i = 0; i < result_count; i++) {\n      result |= CheckReferenceType(loc, result_types[i], \"results\");\n    }\n  }\n  func_types_.emplace(\n      num_types_++,\n      FuncType{ToTypeVector(param_count, param_types),\n               ToTypeVector(result_count, result_types), type_index});\n  return result;\n}\n\nResult SharedValidator::OnStructType(const Location&,\n                                     Index field_count,\n                                     TypeMut* fields) {\n  struct_types_.emplace(num_types_++, StructType{TypeMutVector(\n                                          &fields[0], &fields[field_count])});\n  return Result::Ok;\n}\n\nResult SharedValidator::OnArrayType(const Location&, TypeMut field) {\n  array_types_.emplace(num_types_++, ArrayType{field});\n  return Result::Ok;\n}\n\nResult SharedValidator::OnFunction(const Location& loc, Var sig_var) {\n  Result result = Result::Ok;\n  FuncType type;\n  result |= CheckFuncTypeIndex(sig_var, &type);\n  funcs_.push_back(type);\n  return result;\n}\n\nResult SharedValidator::CheckLimits(const Location& loc,\n                                    const Limits& limits,\n                                    uint64_t absolute_max,\n                                    const char* desc) {\n  Result result = Result::Ok;\n  if (limits.initial > absolute_max) {\n    result |=\n        PrintError(loc, \"initial %s (%\" PRIu64 \") must be <= (%\" PRIu64 \")\",\n                   desc, limits.initial, absolute_max);\n  }\n\n  if (limits.has_max) {\n    if (limits.max > absolute_max) {\n      result |= PrintError(loc, \"max %s (%\" PRIu64 \") must be <= (%\" PRIu64 \")\",\n                           desc, limits.max, absolute_max);\n    }\n\n    if (limits.max < limits.initial) {\n      result |= PrintError(\n          loc, \"max %s (%\" PRIu64 \") must be >= initial %s (%\" PRIu64 \")\", desc,\n          limits.max, desc, limits.initial);\n    }\n  }\n  return result;\n}\n\nResult SharedValidator::OnTable(const Location& loc,\n                                Type elem_type,\n                                const Limits& limits,\n                                TableImportStatus import_status,\n                                TableInitExprStatus init_provided) {\n  Result result = Result::Ok;\n  // Must be checked by parser or binary reader.\n  assert(elem_type.IsRef());\n  if (tables_.size() > 0 && !options_.features.reference_types_enabled()) {\n    result |= PrintError(loc, \"only one table allowed\");\n  }\n  result |= CheckLimits(loc, limits, UINT32_MAX, \"elems\");\n\n  if (limits.is_shared) {\n    result |= PrintError(loc, \"tables may not be shared\");\n  }\n  if (options_.features.reference_types_enabled()) {\n    if (!elem_type.IsRef()) {\n      result |= PrintError(loc, \"ables may only contain reference types\");\n    } else if (import_status == TableImportStatus::TableIsNotImported &&\n               init_provided ==\n                   TableInitExprStatus::TableWithoutInitExpression &&\n               !elem_type.IsNullableRef()) {\n      result |= PrintError(loc, \"missing table initializer\");\n    }\n  } else if (elem_type != Type::FuncRef) {\n    result |= PrintError(loc, \"tables must have funcref type\");\n  }\n\n  result |= CheckReferenceType(loc, elem_type, \"tables\");\n\n  tables_.push_back(TableType{elem_type, limits});\n  return result;\n}\n\nResult SharedValidator::OnMemory(const Location& loc,\n                                 const Limits& limits,\n                                 uint32_t page_size) {\n  Result result = Result::Ok;\n  if (memories_.size() > 0 && !options_.features.multi_memory_enabled()) {\n    result |= PrintError(loc, \"only one memory block allowed\");\n  }\n\n  if (page_size != WABT_DEFAULT_PAGE_SIZE) {\n    if (!options_.features.custom_page_sizes_enabled()) {\n      result |= PrintError(loc, \"only default page size (64 KiB) is allowed\");\n    } else if (page_size != 1) {\n      result |= PrintError(loc, \"only page sizes of 1 B or 64 KiB are allowed\");\n    }\n  }\n\n  uint64_t absolute_max = WABT_BYTES_TO_MIN_PAGES(\n      (limits.is_64 ? UINT64_MAX : UINT32_MAX), page_size);\n  result |= CheckLimits(loc, limits, absolute_max, \"pages\");\n\n  if (limits.is_shared) {\n    if (!options_.features.threads_enabled()) {\n      result |= PrintError(loc, \"memories may not be shared\");\n    } else if (!limits.has_max) {\n      result |= PrintError(loc, \"shared memories must have max sizes\");\n    }\n  }\n\n  memories_.push_back(MemoryType{limits});\n  return result;\n}\n\nResult SharedValidator::OnGlobalImport(const Location& loc,\n                                       Type type,\n                                       bool mutable_) {\n  Result result = Result::Ok;\n  if (mutable_ && !options_.features.mutable_globals_enabled()) {\n    result |= PrintError(loc, \"mutable globals cannot be imported\");\n  }\n  globals_.push_back(GlobalType{type, mutable_});\n  ++num_imported_globals_;\n  return result;\n}\n\nResult SharedValidator::OnGlobal(const Location& loc,\n                                 Type type,\n                                 bool mutable_) {\n  CHECK_RESULT(CheckReferenceType(loc, type, \"globals\"));\n  globals_.push_back(GlobalType{type, mutable_});\n  return Result::Ok;\n}\n\nResult SharedValidator::CheckType(const Location& loc,\n                                  Type actual,\n                                  Type expected,\n                                  const char* desc) {\n  if (Failed(typechecker_.CheckType(actual, expected))) {\n    PrintError(loc, \"type mismatch at %s. got %s, expected %s\", desc,\n               actual.GetName().c_str(), expected.GetName().c_str());\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult SharedValidator::CheckReferenceType(const Location& loc,\n                                           Type type,\n                                           const char* desc) {\n  if (type.IsReferenceWithIndex()) {\n    Index index = type.GetReferenceIndex();\n    auto iter = func_types_.find(index);\n\n    if (iter == func_types_.end()) {\n      return PrintError(loc,\n                        \"reference %\" PRIindex\n                        \" is out of range (max: %\" PRIindex \") in %s\",\n                        index, num_types_, desc);\n    }\n  }\n\n  return Result::Ok;\n}\n\nResult SharedValidator::OnTag(const Location& loc, Var sig_var) {\n  Result result = Result::Ok;\n  FuncType type;\n  result |= CheckFuncTypeIndex(sig_var, &type);\n  if (!type.results.empty()) {\n    result |= PrintError(loc, \"Tag signature must have 0 results.\");\n  }\n  tags_.push_back(TagType{type.params});\n  return result;\n}\n\nResult SharedValidator::OnExport(const Location& loc,\n                                 ExternalKind kind,\n                                 Var item_var,\n                                 std::string_view name) {\n  Result result = Result::Ok;\n  auto name_str = std::string(name);\n  if (export_names_.find(name_str) != export_names_.end()) {\n    result |= PrintError(loc, \"duplicate export \\\"\" PRIstringview \"\\\"\",\n                         WABT_PRINTF_STRING_VIEW_ARG(name));\n  }\n  export_names_.insert(name_str);\n\n  switch (kind) {\n    case ExternalKind::Func:\n      result |= CheckFuncIndex(item_var);\n      declared_funcs_.insert(item_var.index());\n      break;\n\n    case ExternalKind::Table:\n      result |= CheckTableIndex(item_var);\n      break;\n\n    case ExternalKind::Memory:\n      result |= CheckMemoryIndex(item_var);\n      break;\n\n    case ExternalKind::Global:\n      result |= CheckGlobalIndex(item_var);\n      break;\n\n    case ExternalKind::Tag:\n      result |= CheckTagIndex(item_var);\n      break;\n  }\n  return result;\n}\n\nResult SharedValidator::OnStart(const Location& loc, Var func_var) {\n  Result result = Result::Ok;\n  if (starts_++ > 0) {\n    result |= PrintError(loc, \"only one start function allowed\");\n  }\n  FuncType func_type;\n  result |= CheckFuncIndex(func_var, &func_type);\n  if (func_type.params.size() != 0) {\n    result |= PrintError(loc, \"start function must be nullary\");\n  }\n  if (func_type.results.size() != 0) {\n    result |= PrintError(loc, \"start function must not return anything\");\n  }\n  return result;\n}\n\nResult SharedValidator::OnElemSegment(const Location& loc,\n                                      Var table_var,\n                                      SegmentKind kind) {\n  Result result = Result::Ok;\n  TableType table_type;\n  if (kind == SegmentKind::Active) {\n    result |= CheckTableIndex(table_var, &table_type);\n  }\n  // Type gets set later in OnElemSegmentElemType.\n  elems_.push_back(\n      ElemType{Type::Void, kind == SegmentKind::Active, table_type.element});\n  return result;\n}\n\nResult SharedValidator::OnElemSegmentElemType(const Location& loc,\n                                              Type elem_type) {\n  Result result = Result::Ok;\n  auto& elem = elems_.back();\n  if (elem.is_active) {\n    // Check that the type of the elem segment matches the table in which\n    // it is active.\n    result |= CheckType(loc, elem_type, elem.table_type, \"elem segment\");\n  }\n\n  if (elem_type.IsReferenceWithIndex()) {\n    Index index = elem_type.GetReferenceIndex();\n    auto iter = func_types_.find(index);\n\n    if (iter == func_types_.end()) {\n      result |=\n          PrintError(loc, \"reference %\" PRIindex \" is out of range\", index);\n    }\n  }\n\n  elem.element = elem_type;\n  return result;\n}\n\nvoid SharedValidator::OnDataCount(Index count) {\n  data_segments_ = count;\n}\n\nResult SharedValidator::OnDataSegment(const Location& loc,\n                                      Var memory_var,\n                                      SegmentKind kind) {\n  Result result = Result::Ok;\n  if (kind == SegmentKind::Active) {\n    result |= CheckMemoryIndex(memory_var);\n  }\n  return result;\n}\n\nResult SharedValidator::CheckDeclaredFunc(Var func_var) {\n  if (declared_funcs_.count(func_var.index()) == 0) {\n    return PrintError(func_var.loc,\n                      \"function %\" PRIindex\n                      \" is not declared in any elem sections\",\n                      func_var.index());\n  }\n  return Result::Ok;\n}\n\nResult SharedValidator::EndModule() {\n  // Verify that any ref.func used in init expressions for globals are\n  // mentioned in an elems section.  This can't be done while process the\n  // globals because the global section comes before the elem section.\n  Result result = Result::Ok;\n  for (Var func_var : check_declared_funcs_) {\n    result |= CheckDeclaredFunc(func_var);\n  }\n  return result;\n}\n\nResult SharedValidator::CheckIndex(Var var, Index max_index, const char* desc) {\n  if (var.index() >= max_index) {\n    return PrintError(\n        var.loc, \"%s variable out of range: %\" PRIindex \" (max %\" PRIindex \")\",\n        desc, var.index(), max_index);\n  }\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult SharedValidator::CheckIndexWithValue(Var var,\n                                            const std::vector<T>& values,\n                                            T* out,\n                                            const char* desc) {\n  Result result = CheckIndex(var, values.size(), desc);\n  if (out) {\n    *out = Succeeded(result) ? values[var.index()] : T{};\n  }\n  return result;\n}\n\nResult SharedValidator::CheckLocalIndex(Var local_var, Type* out_type) {\n  auto iter = std::upper_bound(\n      locals_.begin(), locals_.end(), local_var.index(),\n      [](Index index, const LocalDecl& decl) { return index < decl.end; });\n  if (iter == locals_.end()) {\n    // TODO: better error\n    return PrintError(local_var.loc, \"local variable out of range (max %u)\",\n                      GetLocalCount());\n  }\n  *out_type = iter->type;\n  return Result::Ok;\n}\n\nResult SharedValidator::CheckFuncTypeIndex(Var sig_var, FuncType* out) {\n  Result result = CheckIndex(sig_var, num_types_, \"function type\");\n  if (Failed(result)) {\n    *out = FuncType{};\n    return Result::Error;\n  }\n\n  auto iter = func_types_.find(sig_var.index());\n  if (iter == func_types_.end()) {\n    return PrintError(sig_var.loc, \"type %d is not a function\",\n                      sig_var.index());\n  }\n\n  if (out) {\n    *out = iter->second;\n  }\n  return Result::Ok;\n}\n\nResult SharedValidator::CheckFuncIndex(Var func_var, FuncType* out) {\n  return CheckIndexWithValue(func_var, funcs_, out, \"function\");\n}\n\nResult SharedValidator::CheckMemoryIndex(Var memory_var, MemoryType* out) {\n  return CheckIndexWithValue(memory_var, memories_, out, \"memory\");\n}\n\nResult SharedValidator::CheckTableIndex(Var table_var, TableType* out) {\n  return CheckIndexWithValue(table_var, tables_, out, \"table\");\n}\n\nResult SharedValidator::CheckGlobalIndex(Var global_var, GlobalType* out) {\n  return CheckIndexWithValue(global_var, globals_, out, \"global\");\n}\n\nResult SharedValidator::CheckTagIndex(Var tag_var, TagType* out) {\n  return CheckIndexWithValue(tag_var, tags_, out, \"tag\");\n}\n\nResult SharedValidator::CheckElemSegmentIndex(Var elem_segment_var,\n                                              ElemType* out) {\n  return CheckIndexWithValue(elem_segment_var, elems_, out, \"elem_segment\");\n}\n\nResult SharedValidator::CheckDataSegmentIndex(Var data_segment_var) {\n  return CheckIndex(data_segment_var, data_segments_, \"data_segment\");\n}\n\nResult SharedValidator::CheckBlockSignature(const Location& loc,\n                                            Opcode opcode,\n                                            Type sig_type,\n                                            TypeVector* out_param_types,\n                                            TypeVector* out_result_types) {\n  Result result = Result::Ok;\n\n  if (sig_type.IsIndex()) {\n    Index sig_index = sig_type.GetIndex();\n    FuncType func_type;\n    result |= CheckFuncTypeIndex(Var(sig_index, loc), &func_type);\n\n    if (!func_type.params.empty() && !options_.features.multi_value_enabled()) {\n      result |= PrintError(loc, \"%s params not currently supported.\",\n                           opcode.GetName());\n    }\n    // Multiple results without --enable-multi-value is checked above in\n    // OnType.\n\n    *out_param_types = func_type.params;\n    *out_result_types = func_type.results;\n  } else {\n    if (sig_type.IsReferenceWithIndex()) {\n      Index index = sig_type.GetReferenceIndex();\n      auto iter = func_types_.find(index);\n\n      if (iter == func_types_.end()) {\n        result |=\n            PrintError(loc, \"reference %\" PRIindex \" is out of range\", index);\n      }\n    }\n\n    out_param_types->clear();\n    *out_result_types = sig_type.GetInlineVector();\n  }\n\n  return result;\n}\n\nIndex SharedValidator::GetFunctionTypeIndex(Index func_index) const {\n  assert(func_index < funcs_.size());\n  return funcs_[func_index].type_index;\n}\n\nvoid SharedValidator::SaveLocalRefs() {\n  if (!local_ref_is_set_.empty()) {\n    Label* label;\n    typechecker_.GetLabel(0, &label);\n    label->local_ref_is_set_ = local_ref_is_set_;\n  }\n}\n\nvoid SharedValidator::RestoreLocalRefs(Result result) {\n  if (!local_ref_is_set_.empty()) {\n    if (Succeeded(result)) {\n      Label* label;\n      typechecker_.GetLabel(0, &label);\n      assert(local_ref_is_set_.size() == label->local_ref_is_set_.size());\n      local_ref_is_set_ = label->local_ref_is_set_;\n    } else {\n      IgnoreLocalRefs();\n    }\n  }\n}\n\nvoid SharedValidator::IgnoreLocalRefs() {\n  std::fill(local_ref_is_set_.begin(), local_ref_is_set_.end(), true);\n}\n\nResult SharedValidator::BeginInitExpr(const Location& loc, Type type) {\n  expr_loc_ = loc;\n  in_init_expr_ = true;\n  return typechecker_.BeginInitExpr(type);\n}\n\nResult SharedValidator::EndInitExpr() {\n  in_init_expr_ = false;\n  return typechecker_.EndInitExpr();\n}\n\nResult SharedValidator::BeginFunctionBody(const Location& loc,\n                                          Index func_index) {\n  expr_loc_ = loc;\n  locals_.clear();\n  local_ref_is_set_.clear();\n  local_refs_map_.clear();\n  if (func_index < funcs_.size()) {\n    for (Type type : funcs_[func_index].params) {\n      // TODO: Coalesce parameters of the same type?\n      locals_.push_back(LocalDecl{type, GetLocalCount() + 1});\n    }\n    return typechecker_.BeginFunction(funcs_[func_index].results);\n  } else {\n    // Signature isn't available, use empty.\n    return typechecker_.BeginFunction(TypeVector());\n  }\n}\n\nResult SharedValidator::EndFunctionBody(const Location& loc) {\n  expr_loc_ = loc;\n  return typechecker_.EndFunction();\n}\n\nResult SharedValidator::OnLocalDecl(const Location& loc,\n                                    Index count,\n                                    Type type) {\n  const auto max_locals = std::numeric_limits<Index>::max();\n  if (count > max_locals - GetLocalCount()) {\n    PrintError(loc, \"local count must be < 0x10000000\");\n    return Result::Error;\n  }\n\n  CHECK_RESULT(CheckReferenceType(loc, type, \"locals\"));\n\n  Index local_count = GetLocalCount();\n\n  if (type.IsNonNullableRef()) {\n    for (Index i = 0; i < count; i++) {\n      local_refs_map_[local_count + i] =\n          LocalReferenceMap{type, static_cast<Index>(local_ref_is_set_.size())};\n      local_ref_is_set_.push_back(false);\n    }\n  }\n\n  locals_.push_back(LocalDecl{type, local_count + count});\n  return Result::Ok;\n}\n\nIndex SharedValidator::GetLocalCount() const {\n  return locals_.empty() ? 0 : locals_.back().end;\n}\n\nstatic bool is_power_of_two(uint32_t x) {\n  return x && ((x & (x - 1)) == 0);\n}\n\nResult SharedValidator::CheckAlign(const Location& loc,\n                                   Address alignment,\n                                   Address natural_alignment) {\n  if (!is_power_of_two(alignment)) {\n    PrintError(loc, \"alignment (%\" PRIaddress \") must be a power of 2\",\n               alignment);\n    return Result::Error;\n  }\n  if (alignment > natural_alignment) {\n    PrintError(\n        loc,\n        \"alignment must not be larger than natural alignment (%\" PRIaddress \")\",\n        natural_alignment);\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult SharedValidator::CheckOffset(const Location& loc,\n                                    Address offset,\n                                    const Limits& limits) {\n  if ((!limits.is_64) && (offset > UINT32_MAX)) {\n    PrintError(loc, \"offset must be less than or equal to 0xffffffff\");\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nResult SharedValidator::CheckAtomicAlign(const Location& loc,\n                                         Address alignment,\n                                         Address natural_alignment) {\n  if (!is_power_of_two(alignment)) {\n    PrintError(loc, \"alignment (%\" PRIaddress \") must be a power of 2\",\n               alignment);\n    return Result::Error;\n  }\n  if (alignment != natural_alignment) {\n    PrintError(loc,\n               \"alignment must be equal to natural alignment (%\" PRIaddress \")\",\n               natural_alignment);\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nbool SharedValidator::ValidInitOpcode(Opcode opcode) const {\n  if (opcode == Opcode::GlobalGet || opcode == Opcode::I32Const ||\n      opcode == Opcode::I64Const || opcode == Opcode::F32Const ||\n      opcode == Opcode::F64Const || opcode == Opcode::RefFunc ||\n      opcode == Opcode::RefNull) {\n    return true;\n  }\n  if (options_.features.extended_const_enabled()) {\n    if (opcode == Opcode::I32Mul || opcode == Opcode::I64Mul ||\n        opcode == Opcode::I32Sub || opcode == Opcode::I64Sub ||\n        opcode == Opcode::I32Add || opcode == Opcode::I64Add) {\n      return true;\n    }\n  }\n  return false;\n}\n\nResult SharedValidator::CheckInstr(Opcode opcode, const Location& loc) {\n  expr_loc_ = loc;\n  if (in_init_expr_ && !ValidInitOpcode(opcode)) {\n    PrintError(loc,\n               \"invalid initializer: instruction not valid in initializer \"\n               \"expression: %s\",\n               opcode.GetName());\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult SharedValidator::OnAtomicFence(const Location& loc,\n                                      uint32_t consistency_model) {\n  Result result = CheckInstr(Opcode::AtomicFence, loc);\n  if (consistency_model != 0) {\n    result |= PrintError(\n        loc, \"unexpected atomic.fence consistency model (expected 0): %u\",\n        consistency_model);\n  }\n  result |= typechecker_.OnAtomicFence(consistency_model);\n  return result;\n}\n\nResult SharedValidator::OnAtomicLoad(const Location& loc,\n                                     Opcode opcode,\n                                     Var memidx,\n                                     Address alignment,\n                                     Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAtomicAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnAtomicLoad(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnAtomicNotify(const Location& loc,\n                                       Opcode opcode,\n                                       Var memidx,\n                                       Address alignment,\n                                       Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAtomicAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnAtomicNotify(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnAtomicRmwCmpxchg(const Location& loc,\n                                           Opcode opcode,\n                                           Var memidx,\n                                           Address alignment,\n                                           Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAtomicAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnAtomicRmwCmpxchg(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnAtomicRmw(const Location& loc,\n                                    Opcode opcode,\n                                    Var memidx,\n                                    Address alignment,\n                                    Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAtomicAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnAtomicRmw(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnAtomicStore(const Location& loc,\n                                      Opcode opcode,\n                                      Var memidx,\n                                      Address alignment,\n                                      Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAtomicAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnAtomicStore(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnAtomicWait(const Location& loc,\n                                     Opcode opcode,\n                                     Var memidx,\n                                     Address alignment,\n                                     Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAtomicAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnAtomicWait(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnBinary(const Location& loc, Opcode opcode) {\n  Result result = CheckInstr(opcode, loc);\n  result |= typechecker_.OnBinary(opcode);\n  return result;\n}\n\nResult SharedValidator::OnTernary(const Location& loc, Opcode opcode) {\n  Result result = CheckInstr(opcode, loc);\n  result |= typechecker_.OnTernary(opcode);\n  return result;\n}\n\nResult SharedValidator::OnQuaternary(const Location& loc, Opcode opcode) {\n  Result result = CheckInstr(opcode, loc);\n  result |= typechecker_.OnQuaternary(opcode);\n  return result;\n}\n\nResult SharedValidator::OnBlock(const Location& loc, Type sig_type) {\n  Result result = CheckInstr(Opcode::Block, loc);\n  TypeVector param_types, result_types;\n  result |= CheckBlockSignature(loc, Opcode::Block, sig_type, &param_types,\n                                &result_types);\n  result |= typechecker_.OnBlock(param_types, result_types);\n  SaveLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnBr(const Location& loc, Var depth) {\n  Result result = CheckInstr(Opcode::Br, loc);\n  result |= typechecker_.OnBr(depth.index());\n  IgnoreLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnBrIf(const Location& loc, Var depth) {\n  Result result = CheckInstr(Opcode::BrIf, loc);\n  result |= typechecker_.OnBrIf(depth.index());\n  return result;\n}\n\nResult SharedValidator::OnBrOnNonNull(const Location& loc, Var depth) {\n  Result result = CheckInstr(Opcode::BrOnNonNull, loc);\n  result |= typechecker_.OnBrOnNonNull(depth.index());\n  return result;\n}\n\nResult SharedValidator::OnBrOnNull(const Location& loc, Var depth) {\n  Result result = CheckInstr(Opcode::BrOnNull, loc);\n  result |= typechecker_.OnBrOnNull(depth.index());\n  return result;\n}\n\nResult SharedValidator::BeginBrTable(const Location& loc) {\n  Result result = CheckInstr(Opcode::BrTable, loc);\n  result |= typechecker_.BeginBrTable();\n  return result;\n}\n\nResult SharedValidator::OnBrTableTarget(const Location& loc, Var depth) {\n  Result result = Result::Ok;\n  expr_loc_ = loc;\n  result |= typechecker_.OnBrTableTarget(depth.index());\n  return result;\n}\n\nResult SharedValidator::EndBrTable(const Location& loc) {\n  Result result = CheckInstr(Opcode::BrTable, loc);\n  result |= typechecker_.EndBrTable();\n  IgnoreLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnCall(const Location& loc, Var func_var) {\n  Result result = CheckInstr(Opcode::Call, loc);\n  FuncType func_type;\n  result |= CheckFuncIndex(func_var, &func_type);\n  result |= typechecker_.OnCall(func_type.params, func_type.results);\n  return result;\n}\n\nResult SharedValidator::OnCallIndirect(const Location& loc,\n                                       Var sig_var,\n                                       Var table_var) {\n  Result result = CheckInstr(Opcode::CallIndirect, loc);\n  FuncType func_type;\n  TableType table_type;\n  result |= CheckFuncTypeIndex(sig_var, &func_type);\n  result |= CheckTableIndex(table_var, &table_type);\n  if (table_type.element != Type::FuncRef) {\n    result |= PrintError(\n        loc,\n        \"type mismatch: call_indirect must reference table of funcref type\");\n  }\n  result |= typechecker_.OnCallIndirect(func_type.params, func_type.results,\n                                        table_type.limits);\n  return result;\n}\n\nResult SharedValidator::OnCallRef(const Location& loc, Var function_type_var) {\n  Result result = CheckInstr(Opcode::CallRef, loc);\n  FuncType func_type;\n  result |= CheckFuncTypeIndex(function_type_var, &func_type);\n  result |= typechecker_.OnCallRef(function_type_var.to_type(),\n                                   func_type.params, func_type.results);\n  return result;\n}\n\nResult SharedValidator::OnCatch(const Location& loc,\n                                Var tag_var,\n                                bool is_catch_all) {\n  Result result = CheckInstr(Opcode::Catch, loc);\n  if (is_catch_all) {\n    TypeVector empty;\n    result |= typechecker_.OnCatch(empty);\n  } else {\n    TagType tag_type;\n    result |= CheckTagIndex(tag_var, &tag_type);\n    result |= typechecker_.OnCatch(tag_type.params);\n  }\n  RestoreLocalRefs(result);\n  return result;\n}\n\nResult SharedValidator::OnCompare(const Location& loc, Opcode opcode) {\n  Result result = CheckInstr(opcode, loc);\n  result |= typechecker_.OnCompare(opcode);\n  return result;\n}\n\nResult SharedValidator::OnConst(const Location& loc, Type type) {\n  Result result = Result::Ok;\n  expr_loc_ = loc;\n  result |= typechecker_.OnConst(type);\n  return result;\n}\n\nResult SharedValidator::OnConvert(const Location& loc, Opcode opcode) {\n  Result result = CheckInstr(opcode, loc);\n  result |= typechecker_.OnConvert(opcode);\n  return result;\n}\n\nResult SharedValidator::OnDataDrop(const Location& loc, Var segment_var) {\n  Result result = CheckInstr(Opcode::DataDrop, loc);\n  result |= CheckDataSegmentIndex(segment_var);\n  result |= typechecker_.OnDataDrop(segment_var.index());\n  return result;\n}\n\nResult SharedValidator::OnDelegate(const Location& loc, Var depth) {\n  Result result = CheckInstr(Opcode::Delegate, loc);\n  result |= typechecker_.OnDelegate(depth.index());\n  return result;\n}\n\nResult SharedValidator::OnDrop(const Location& loc) {\n  Result result = CheckInstr(Opcode::Drop, loc);\n  result |= typechecker_.OnDrop();\n  return result;\n}\n\nResult SharedValidator::OnElemDrop(const Location& loc, Var segment_var) {\n  Result result = CheckInstr(Opcode::ElemDrop, loc);\n  result |= CheckElemSegmentIndex(segment_var);\n  result |= typechecker_.OnElemDrop(segment_var.index());\n  return result;\n}\n\nResult SharedValidator::OnElse(const Location& loc) {\n  // Don't call CheckInstr or update expr_loc_ here because if we fail we want\n  // the last expression in the If block to be reported as the error location,\n  // not the else itself.\n  Result result = Result::Ok;\n  result |= typechecker_.OnElse();\n  RestoreLocalRefs(result);\n  return result;\n}\n\nResult SharedValidator::OnEnd(const Location& loc) {\n  Result result = CheckInstr(Opcode::End, loc);\n  RestoreLocalRefs(result);\n  result |= typechecker_.OnEnd();\n  return result;\n}\n\nResult SharedValidator::OnGlobalGet(const Location& loc, Var global_var) {\n  Result result = CheckInstr(Opcode::GlobalGet, loc);\n  GlobalType global_type;\n  result |= CheckGlobalIndex(global_var, &global_type);\n  result |= typechecker_.OnGlobalGet(global_type.type);\n  if (Succeeded(result) && in_init_expr_) {\n    if (global_var.index() >= num_imported_globals_) {\n      result |= PrintError(\n          global_var.loc,\n          \"initializer expression can only reference an imported global\");\n    }\n    if (global_type.mutable_) {\n      result |= PrintError(\n          loc, \"initializer expression cannot reference a mutable global\");\n    }\n  }\n\n  return result;\n}\n\nResult SharedValidator::OnGlobalSet(const Location& loc, Var global_var) {\n  Result result = CheckInstr(Opcode::GlobalSet, loc);\n  GlobalType global_type;\n  result |= CheckGlobalIndex(global_var, &global_type);\n  if (!global_type.mutable_) {\n    result |= PrintError(\n        loc, \"can't global.set on immutable global at index %\" PRIindex \".\",\n        global_var.index());\n  }\n  result |= typechecker_.OnGlobalSet(global_type.type);\n  return result;\n}\n\nResult SharedValidator::OnIf(const Location& loc, Type sig_type) {\n  Result result = CheckInstr(Opcode::If, loc);\n  TypeVector param_types, result_types;\n  result |= CheckBlockSignature(loc, Opcode::If, sig_type, &param_types,\n                                &result_types);\n  result |= typechecker_.OnIf(param_types, result_types);\n  SaveLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnLoad(const Location& loc,\n                               Opcode opcode,\n                               Var memidx,\n                               Address alignment,\n                               Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnLoad(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnLoadSplat(const Location& loc,\n                                    Opcode opcode,\n                                    Var memidx,\n                                    Address alignment,\n                                    Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnLoad(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnLoadZero(const Location& loc,\n                                   Opcode opcode,\n                                   Var memidx,\n                                   Address alignment,\n                                   Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnLoad(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnLocalGet(const Location& loc, Var local_var) {\n  CHECK_RESULT(CheckInstr(Opcode::LocalGet, loc));\n  Result result = Result::Ok;\n  Type type = Type::Any;\n  result |= CheckLocalIndex(local_var, &type);\n  result |= typechecker_.OnLocalGet(type);\n  if (Succeeded(result) && type.IsNonNullableRef()) {\n    auto it = local_refs_map_.find(local_var.index());\n    if (it != local_refs_map_.end() &&\n        !local_ref_is_set_[it->second.local_ref_is_set]) {\n      return PrintError(local_var.loc, \"uninitialized local reference\");\n    }\n  }\n  return result;\n}\n\nResult SharedValidator::OnLocalSet(const Location& loc, Var local_var) {\n  CHECK_RESULT(CheckInstr(Opcode::LocalSet, loc));\n  Result result = Result::Ok;\n  Type type = Type::Any;\n  result |= CheckLocalIndex(local_var, &type);\n  result |= typechecker_.OnLocalSet(type);\n  if (Succeeded(result) && type.IsNonNullableRef()) {\n    auto it = local_refs_map_.find(local_var.index());\n    if (it != local_refs_map_.end()) {\n      local_ref_is_set_[it->second.local_ref_is_set] = true;\n    }\n  }\n  return result;\n}\n\nResult SharedValidator::OnLocalTee(const Location& loc, Var local_var) {\n  CHECK_RESULT(CheckInstr(Opcode::LocalTee, loc));\n  Result result = Result::Ok;\n  Type type = Type::Any;\n  result |= CheckLocalIndex(local_var, &type);\n  result |= typechecker_.OnLocalTee(type);\n  if (Succeeded(result) && type.IsNonNullableRef()) {\n    auto it = local_refs_map_.find(local_var.index());\n    if (it != local_refs_map_.end()) {\n      local_ref_is_set_[it->second.local_ref_is_set] = true;\n    }\n  }\n  return result;\n}\n\nResult SharedValidator::OnLoop(const Location& loc, Type sig_type) {\n  Result result = CheckInstr(Opcode::Loop, loc);\n  TypeVector param_types, result_types;\n  result |= CheckBlockSignature(loc, Opcode::Loop, sig_type, &param_types,\n                                &result_types);\n  result |= typechecker_.OnLoop(param_types, result_types);\n  SaveLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnMemoryCopy(const Location& loc,\n                                     Var destmemidx,\n                                     Var srcmemidx) {\n  Result result = CheckInstr(Opcode::MemoryCopy, loc);\n  MemoryType srcmt;\n  MemoryType dstmt;\n  result |= CheckMemoryIndex(destmemidx, &dstmt);\n  result |= CheckMemoryIndex(srcmemidx, &srcmt);\n  result |= typechecker_.OnMemoryCopy(dstmt.limits, srcmt.limits);\n  return result;\n}\n\nResult SharedValidator::OnMemoryFill(const Location& loc, Var memidx) {\n  Result result = CheckInstr(Opcode::MemoryFill, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= typechecker_.OnMemoryFill(mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnMemoryGrow(const Location& loc, Var memidx) {\n  Result result = CheckInstr(Opcode::MemoryGrow, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= typechecker_.OnMemoryGrow(mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnMemoryInit(const Location& loc,\n                                     Var segment_var,\n                                     Var memidx) {\n  Result result = CheckInstr(Opcode::MemoryInit, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckDataSegmentIndex(segment_var);\n  result |= typechecker_.OnMemoryInit(segment_var.index(), mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnMemorySize(const Location& loc, Var memidx) {\n  Result result = CheckInstr(Opcode::MemorySize, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= typechecker_.OnMemorySize(mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnNop(const Location& loc) {\n  Result result = CheckInstr(Opcode::Nop, loc);\n  return result;\n}\n\nResult SharedValidator::OnRefAsNonNull(const Location& loc) {\n  Result result = CheckInstr(Opcode::Nop, loc);\n  result |= typechecker_.OnRefAsNonNullExpr();\n  return result;\n}\n\nResult SharedValidator::OnRefFunc(const Location& loc, Var func_var) {\n  Result result = CheckInstr(Opcode::RefFunc, loc);\n  result |= CheckFuncIndex(func_var);\n  if (Succeeded(result)) {\n    // References in initializer expressions are considered declarations, as\n    // opposed to references in function bodies that are considered usages.\n    if (in_init_expr_) {\n      declared_funcs_.insert(func_var.index());\n    } else {\n      check_declared_funcs_.push_back(func_var);\n    }\n    Index func_type = GetFunctionTypeIndex(func_var.index());\n    result |= typechecker_.OnRefFuncExpr(func_type);\n  }\n  return result;\n}\n\nResult SharedValidator::OnRefIsNull(const Location& loc) {\n  Result result = CheckInstr(Opcode::RefIsNull, loc);\n  result |= typechecker_.OnRefIsNullExpr();\n  return result;\n}\n\nResult SharedValidator::OnRefNull(const Location& loc, Var func_type_var) {\n  Result result = CheckInstr(Opcode::RefNull, loc);\n\n  Type type = func_type_var.to_type();\n\n  switch (type) {\n    case Type::RefNull:\n      result |= CheckIndex(func_type_var, num_types_, \"function type\");\n      break;\n    case Type::FuncRef:\n    case Type::ExnRef:\n    case Type::ExternRef:\n      break;\n    default:\n      result |= PrintError(\n          loc, \"Only ref, externref, exnref, funcref are allowed for ref.null\");\n      break;\n  }\n\n  result |= typechecker_.OnRefNullExpr(type);\n  return result;\n}\n\nResult SharedValidator::OnRethrow(const Location& loc, Var depth) {\n  Result result = CheckInstr(Opcode::Rethrow, loc);\n  result |= typechecker_.OnRethrow(depth.index());\n  return result;\n}\n\nResult SharedValidator::OnReturnCall(const Location& loc, Var func_var) {\n  Result result = CheckInstr(Opcode::ReturnCall, loc);\n  FuncType func_type;\n  result |= CheckFuncIndex(func_var, &func_type);\n  result |= typechecker_.OnReturnCall(func_type.params, func_type.results);\n  IgnoreLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnReturnCallIndirect(const Location& loc,\n                                             Var sig_var,\n                                             Var table_var) {\n  Result result = CheckInstr(Opcode::CallIndirect, loc);\n  FuncType func_type;\n  TableType table_type;\n  result |= CheckFuncTypeIndex(sig_var, &func_type);\n  result |= CheckTableIndex(table_var, &table_type);\n  if (table_type.element != Type::FuncRef) {\n    result |= PrintError(loc,\n                         \"type mismatch: return_call_indirect must reference \"\n                         \"table of funcref type\");\n  }\n  result |=\n      typechecker_.OnReturnCallIndirect(func_type.params, func_type.results);\n  IgnoreLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnReturnCallRef(const Location& loc,\n                                        Var function_type_var) {\n  Result result = CheckInstr(Opcode::ReturnCallRef, loc);\n  FuncType func_type;\n  result |= CheckFuncTypeIndex(function_type_var, &func_type);\n  result |= typechecker_.OnReturnCallRef(function_type_var.to_type(),\n                                         func_type.params, func_type.results);\n  return result;\n}\n\nResult SharedValidator::OnReturn(const Location& loc) {\n  Result result = CheckInstr(Opcode::Return, loc);\n  result |= typechecker_.OnReturn();\n  IgnoreLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnSelect(const Location& loc,\n                                 Index result_count,\n                                 Type* result_types) {\n  Result result = CheckInstr(Opcode::Select, loc);\n\n  for (Index i = 0; i < result_count; i++) {\n    if (result_types[i].IsReferenceWithIndex()) {\n      Index index = result_types[i].GetReferenceIndex();\n      auto iter = func_types_.find(index);\n\n      if (iter == func_types_.end()) {\n        result |=\n            PrintError(loc, \"reference %\" PRIindex \" is out of range\", index);\n      }\n    }\n  }\n\n  if (result_count > 1) {\n    result |=\n        PrintError(loc, \"invalid arity in select instruction: %\" PRIindex \".\",\n                   result_count);\n  } else {\n    result |= typechecker_.OnSelect(ToTypeVector(result_count, result_types));\n  }\n  return result;\n}\n\nResult SharedValidator::OnSimdLaneOp(const Location& loc,\n                                     Opcode opcode,\n                                     uint64_t value) {\n  Result result = CheckInstr(opcode, loc);\n  result |= typechecker_.OnSimdLaneOp(opcode, value);\n  return result;\n}\n\nResult SharedValidator::OnSimdLoadLane(const Location& loc,\n                                       Opcode opcode,\n                                       Var memidx,\n                                       Address alignment,\n                                       Address offset,\n                                       uint64_t value) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnSimdLoadLane(opcode, mt.limits, value);\n  return result;\n}\n\nResult SharedValidator::OnSimdStoreLane(const Location& loc,\n                                        Opcode opcode,\n                                        Var memidx,\n                                        Address alignment,\n                                        Address offset,\n                                        uint64_t value) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnSimdStoreLane(opcode, mt.limits, value);\n  return result;\n}\n\nResult SharedValidator::OnSimdShuffleOp(const Location& loc,\n                                        Opcode opcode,\n                                        v128 value) {\n  Result result = CheckInstr(opcode, loc);\n  result |= typechecker_.OnSimdShuffleOp(opcode, value);\n  return result;\n}\n\nResult SharedValidator::OnStore(const Location& loc,\n                                Opcode opcode,\n                                Var memidx,\n                                Address alignment,\n                                Address offset) {\n  Result result = CheckInstr(opcode, loc);\n  MemoryType mt;\n  result |= CheckMemoryIndex(memidx, &mt);\n  result |= CheckAlign(loc, alignment, opcode.GetMemorySize());\n  result |= CheckOffset(loc, offset, mt.limits);\n  result |= typechecker_.OnStore(opcode, mt.limits);\n  return result;\n}\n\nResult SharedValidator::OnTableCopy(const Location& loc,\n                                    Var dst_var,\n                                    Var src_var) {\n  Result result = CheckInstr(Opcode::TableCopy, loc);\n  TableType dst_table;\n  TableType src_table;\n  result |= CheckTableIndex(dst_var, &dst_table);\n  result |= CheckTableIndex(src_var, &src_table);\n  result |= typechecker_.OnTableCopy(dst_table.limits, src_table.limits);\n  result |= CheckType(loc, src_table.element, dst_table.element, \"table.copy\");\n  return result;\n}\n\nResult SharedValidator::OnTableFill(const Location& loc, Var table_var) {\n  Result result = CheckInstr(Opcode::TableFill, loc);\n  TableType table_type;\n  result |= CheckTableIndex(table_var, &table_type);\n  result |= typechecker_.OnTableFill(table_type.element, table_type.limits);\n  return result;\n}\n\nResult SharedValidator::OnTableGet(const Location& loc, Var table_var) {\n  Result result = CheckInstr(Opcode::TableGet, loc);\n  TableType table_type;\n  result |= CheckTableIndex(table_var, &table_type);\n  result |= typechecker_.OnTableGet(table_type.element, table_type.limits);\n  return result;\n}\n\nResult SharedValidator::OnTableGrow(const Location& loc, Var table_var) {\n  Result result = CheckInstr(Opcode::TableGrow, loc);\n  TableType table_type;\n  result |= CheckTableIndex(table_var, &table_type);\n  result |= typechecker_.OnTableGrow(table_type.element, table_type.limits);\n  return result;\n}\n\nResult SharedValidator::OnTableInit(const Location& loc,\n                                    Var segment_var,\n                                    Var table_var) {\n  Result result = CheckInstr(Opcode::TableInit, loc);\n  TableType table_type;\n  ElemType elem_type;\n  result |= CheckTableIndex(table_var, &table_type);\n  result |= CheckElemSegmentIndex(segment_var, &elem_type);\n  result |= typechecker_.OnTableInit(segment_var.index(), table_type.limits);\n  result |= CheckType(loc, elem_type.element, table_type.element, \"table.init\");\n  return result;\n}\n\nResult SharedValidator::OnTableSet(const Location& loc, Var table_var) {\n  Result result = CheckInstr(Opcode::TableSet, loc);\n  TableType table_type;\n  result |= CheckTableIndex(table_var, &table_type);\n  result |= typechecker_.OnTableSet(table_type.element, table_type.limits);\n  return result;\n}\n\nResult SharedValidator::OnTableSize(const Location& loc, Var table_var) {\n  Result result = CheckInstr(Opcode::TableSize, loc);\n  TableType tt;\n  result |= CheckTableIndex(table_var, &tt);\n  result |= typechecker_.OnTableSize(tt.limits);\n  return result;\n}\n\nResult SharedValidator::OnThrow(const Location& loc, Var tag_var) {\n  Result result = CheckInstr(Opcode::Throw, loc);\n  TagType tag_type;\n  result |= CheckTagIndex(tag_var, &tag_type);\n  result |= typechecker_.OnThrow(tag_type.params);\n  return result;\n}\n\nResult SharedValidator::OnThrowRef(const Location& loc) {\n  Result result = CheckInstr(Opcode::ThrowRef, loc);\n  result |= typechecker_.OnThrowRef();\n  return result;\n}\n\nResult SharedValidator::OnTry(const Location& loc, Type sig_type) {\n  Result result = CheckInstr(Opcode::Try, loc);\n  TypeVector param_types, result_types;\n  result |= CheckBlockSignature(loc, Opcode::Try, sig_type, &param_types,\n                                &result_types);\n  result |= typechecker_.OnTry(param_types, result_types);\n  SaveLocalRefs();\n  return result;\n}\n\nResult SharedValidator::BeginTryTable(const Location& loc, Type sig_type) {\n  Result result = CheckInstr(Opcode::TryTable, loc);\n  TypeVector param_types, result_types;\n  result |= CheckBlockSignature(loc, Opcode::TryTable, sig_type, &param_types,\n                                &result_types);\n  result |= typechecker_.BeginTryTable(param_types);\n  return result;\n}\n\nResult SharedValidator::OnTryTableCatch(const Location& loc,\n                                        const TableCatch& catch_) {\n  Result result = Result::Ok;\n  TagType tag_type;\n  expr_loc_ = loc;\n  if (!catch_.IsCatchAll()) {\n    result |= CheckTagIndex(catch_.tag, &tag_type);\n  }\n  if (catch_.IsRef()) {\n    tag_type.params.push_back(Type::ExnRef);\n  }\n  result |=\n      typechecker_.OnTryTableCatch(tag_type.params, catch_.target.index());\n  return result;\n}\n\nResult SharedValidator::EndTryTable(const Location& loc, Type sig_type) {\n  Result result = CheckInstr(Opcode::TryTable, loc);\n  TypeVector param_types, result_types;\n  result |= CheckBlockSignature(loc, Opcode::TryTable, sig_type, &param_types,\n                                &result_types);\n  result |= typechecker_.EndTryTable(param_types, result_types);\n  SaveLocalRefs();\n  return result;\n}\n\nResult SharedValidator::OnUnary(const Location& loc, Opcode opcode) {\n  Result result = CheckInstr(opcode, loc);\n  result |= typechecker_.OnUnary(opcode);\n  return result;\n}\n\nResult SharedValidator::OnUnreachable(const Location& loc) {\n  Result result = CheckInstr(Opcode::Unreachable, loc);\n  result |= typechecker_.OnUnreachable();\n  IgnoreLocalRefs();\n  return result;\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/stream.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/stream.h\"\n\n#include <cassert>\n#include <cctype>\n#include <cerrno>\n\n#define DUMP_OCTETS_PER_LINE 16\n#define DUMP_OCTETS_PER_GROUP 2\n\n#define ERROR0(msg) fprintf(stderr, \"%s:%d: \" msg, __FILE__, __LINE__)\n#define ERROR(fmt, ...) \\\n  fprintf(stderr, \"%s:%d: \" fmt, __FILE__, __LINE__, __VA_ARGS__)\n\nnamespace wabt {\n\nStream::Stream(Stream* log_stream)\n    : offset_(0), result_(Result::Ok), log_stream_(log_stream) {}\n\nvoid Stream::AddOffset(ssize_t delta) {\n  offset_ += delta;\n}\n\nvoid Stream::WriteDataAt(size_t at,\n                         const void* src,\n                         size_t size,\n                         const char* desc,\n                         PrintChars print_chars) {\n  if (Failed(result_)) {\n    return;\n  }\n  if (log_stream_) {\n    log_stream_->WriteMemoryDump(src, size, at, print_chars, nullptr, desc);\n  }\n  result_ = WriteDataImpl(at, src, size);\n}\n\nvoid Stream::WriteData(const void* src,\n                       size_t size,\n                       const char* desc,\n                       PrintChars print_chars) {\n  WriteDataAt(offset_, src, size, desc, print_chars);\n  offset_ += size;\n}\n\nvoid Stream::MoveData(size_t dst_offset, size_t src_offset, size_t size) {\n  if (Failed(result_)) {\n    return;\n  }\n  if (log_stream_) {\n    log_stream_->Writef(\n        \"; move data: [%\" PRIzx \", %\" PRIzx \") -> [%\" PRIzx \", %\" PRIzx \")\\n\",\n        src_offset, src_offset + size, dst_offset, dst_offset + size);\n  }\n  result_ = MoveDataImpl(dst_offset, src_offset, size);\n}\n\nvoid Stream::Truncate(size_t size) {\n  if (Failed(result_)) {\n    return;\n  }\n  if (log_stream_) {\n    log_stream_->Writef(\"; truncate to %\" PRIzd \" (0x%\" PRIzx \")\\n\", size,\n                        size);\n  }\n  result_ = TruncateImpl(size);\n  if (Succeeded(result_) && offset_ > size) {\n    offset_ = size;\n  }\n}\n\nvoid Stream::Writef(const char* format, ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  WriteData(buffer, length);\n}\n\nvoid Stream::WriteMemoryDump(const void* start,\n                             size_t size,\n                             size_t offset,\n                             PrintChars print_chars,\n                             const char* prefix,\n                             const char* desc) {\n  const uint8_t* p = static_cast<const uint8_t*>(start);\n  const uint8_t* end = p + size;\n  while (p < end) {\n    const uint8_t* line = p;\n    const uint8_t* line_end = p + DUMP_OCTETS_PER_LINE;\n    if (prefix) {\n      Writef(\"%s\", prefix);\n    }\n    Writef(\"%07\" PRIzx \": \", reinterpret_cast<intptr_t>(p) -\n                                 reinterpret_cast<intptr_t>(start) + offset);\n    while (p < line_end) {\n      for (int i = 0; i < DUMP_OCTETS_PER_GROUP; ++i, ++p) {\n        if (p < end) {\n          Writef(\"%02x\", *p);\n        } else {\n          WriteChar(' ');\n          WriteChar(' ');\n        }\n      }\n      WriteChar(' ');\n    }\n\n    if (print_chars == PrintChars::Yes) {\n      WriteChar(' ');\n      p = line;\n      for (int i = 0; i < DUMP_OCTETS_PER_LINE && p < end; ++i, ++p)\n        WriteChar(isprint(*p) ? *p : '.');\n    }\n\n    /* if there are multiple lines, only print the desc on the last one */\n    if (p >= end && desc) {\n      Writef(\"  ; %s\", desc);\n    }\n    WriteChar('\\n');\n  }\n}\n\nResult OutputBuffer::WriteToFile(std::string_view filename) const {\n  std::string filename_str(filename);\n  FILE* file = fopen(filename_str.c_str(), \"wb\");\n  if (!file) {\n    ERROR(\"unable to open %s for writing\\n\", filename_str.c_str());\n    return Result::Error;\n  }\n\n  if (data.empty()) {\n    fclose(file);\n    return Result::Ok;\n  }\n\n  ssize_t bytes = fwrite(data.data(), 1, data.size(), file);\n  if (bytes < 0 || static_cast<size_t>(bytes) != data.size()) {\n    ERROR(\"failed to write %\" PRIzd \" bytes to %s\\n\", data.size(),\n          filename_str.c_str());\n    fclose(file);\n    return Result::Error;\n  }\n\n  fclose(file);\n  return Result::Ok;\n}\n\nResult OutputBuffer::WriteToStdout() const {\n  if (data.empty()) {\n    return Result::Ok;\n  }\n  ssize_t bytes = fwrite(data.data(), 1, data.size(), stdout);\n  if (bytes < 0 || static_cast<size_t>(bytes) != data.size()) {\n    ERROR(\"failed to write %\" PRIzd \" bytes to stdout\\n\", data.size());\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nMemoryStream::MemoryStream(Stream* log_stream)\n    : Stream(log_stream), buf_(new OutputBuffer()) {}\n\nMemoryStream::MemoryStream(std::unique_ptr<OutputBuffer>&& buf,\n                           Stream* log_stream)\n    : Stream(log_stream), buf_(std::move(buf)) {}\n\nstd::unique_ptr<OutputBuffer> MemoryStream::ReleaseOutputBuffer() {\n  return std::move(buf_);\n}\n\nvoid MemoryStream::Clear() {\n  if (buf_)\n    buf_->clear();\n  else\n    buf_.reset(new OutputBuffer());\n}\n\nResult MemoryStream::WriteDataImpl(size_t dst_offset,\n                                   const void* src,\n                                   size_t size) {\n  if (size == 0) {\n    return Result::Ok;\n  }\n  size_t end = dst_offset + size;\n  if (end > buf_->data.size()) {\n    buf_->data.resize(end);\n  }\n  uint8_t* dst = &buf_->data[dst_offset];\n  memcpy(dst, src, size);\n  return Result::Ok;\n}\n\nResult MemoryStream::MoveDataImpl(size_t dst_offset,\n                                  size_t src_offset,\n                                  size_t size) {\n  if (size == 0) {\n    return Result::Ok;\n  }\n  size_t src_end = src_offset + size;\n  size_t dst_end = dst_offset + size;\n  size_t end = src_end > dst_end ? src_end : dst_end;\n  if (end > buf_->data.size()) {\n    buf_->data.resize(end);\n  }\n\n  uint8_t* dst = &buf_->data[dst_offset];\n  uint8_t* src = &buf_->data[src_offset];\n  memmove(dst, src, size);\n  return Result::Ok;\n}\n\nResult MemoryStream::TruncateImpl(size_t size) {\n  if (size > buf_->data.size()) {\n    return Result::Error;\n  }\n  buf_->data.resize(size);\n  return Result::Ok;\n}\n\nFileStream::FileStream(std::string_view filename, Stream* log_stream)\n    : Stream(log_stream), file_(nullptr), offset_(0), should_close_(false) {\n  std::string filename_str(filename);\n  file_ = fopen(filename_str.c_str(), \"wb\");\n\n  // TODO(binji): this is pretty cheesy, should come up with a better API.\n  if (file_) {\n    should_close_ = true;\n  } else {\n    ERROR(\"fopen name=\\\"%s\\\" failed, errno=%d\\n\", filename_str.c_str(), errno);\n  }\n}\n\nFileStream::FileStream(FILE* file, Stream* log_stream)\n    : Stream(log_stream), file_(file), offset_(0), should_close_(false) {}\n\nFileStream::FileStream(FileStream&& other) {\n  *this = std::move(other);\n}\n\nFileStream& FileStream::operator=(FileStream&& other) {\n  file_ = other.file_;\n  offset_ = other.offset_;\n  should_close_ = other.should_close_;\n  other.file_ = nullptr;\n  other.offset_ = 0;\n  other.should_close_ = false;\n  return *this;\n}\n\nFileStream::~FileStream() {\n  // We don't want to close existing files (stdout/sterr, for example).\n  if (should_close_) {\n    fclose(file_);\n  }\n}\n\nvoid FileStream::Flush() {\n  if (file_) {\n    fflush(file_);\n  }\n}\n\nResult FileStream::WriteDataImpl(size_t at, const void* data, size_t size) {\n  if (!file_) {\n    return Result::Error;\n  }\n  if (size == 0) {\n    return Result::Ok;\n  }\n  if (at != offset_) {\n    if (fseek(file_, at, SEEK_SET) != 0) {\n      ERROR(\"fseek offset=%\" PRIzd \" failed, errno=%d\\n\", size, errno);\n      return Result::Error;\n    }\n    offset_ = at;\n  }\n  if (fwrite(data, size, 1, file_) != 1) {\n    ERROR(\"fwrite size=%\" PRIzd \" failed, errno=%d\\n\", size, errno);\n    return Result::Error;\n  }\n  offset_ += size;\n  return Result::Ok;\n}\n\nResult FileStream::MoveDataImpl(size_t dst_offset,\n                                size_t src_offset,\n                                size_t size) {\n  if (!file_) {\n    return Result::Error;\n  }\n  if (size == 0) {\n    return Result::Ok;\n  }\n  // TODO(binji): implement if needed.\n  ERROR0(\"FileStream::MoveDataImpl not implemented!\\n\");\n  return Result::Error;\n}\n\nResult FileStream::TruncateImpl(size_t size) {\n  if (!file_) {\n    return Result::Error;\n  }\n  // TODO(binji): implement if needed.\n  ERROR0(\"FileStream::TruncateImpl not implemented!\\n\");\n  return Result::Error;\n}\n\n// static\nstd::unique_ptr<FileStream> FileStream::CreateStdout() {\n  return std::unique_ptr<FileStream>(new FileStream(stdout));\n}\n\n// static\nstd::unique_ptr<FileStream> FileStream::CreateStderr() {\n  return std::unique_ptr<FileStream>(new FileStream(stderr));\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/template/wasm2c.bottom.h",
    "content": "#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "src/template/wasm2c.declarations.c",
    "content": "\n// Computes a pointer to an object of the given size in a little-endian memory.\n//\n// On a little-endian host, this is just &mem->data[addr] - the object's size is\n// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n// is the object's size.\n//\n// Note that mem may be evaluated multiple times.\n//\n// Parameters:\n// mem - The memory.\n// addr - The address.\n// n - The size of the object.\n//\n// Result:\n// A pointer for an object of size n.\n#if WABT_BIG_ENDIAN\n#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n#else\n#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n#endif\n\n// We can only use Segue for this module if it uses a single unshared imported\n// or exported memory\n#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n#else\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n#endif\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n// POSIX uses FS for TLS, GS is free\nstatic inline void* wasm_rt_segue_read_base() {\n  if (wasm_rt_fsgsbase_inst_supported) {\n    return (void*)__builtin_ia32_rdgsbase64();\n  } else {\n    return wasm_rt_syscall_get_segue_base();\n  }\n}\nstatic inline void wasm_rt_segue_write_base(void* base) {\n#if WASM_RT_SEGUE_FREE_SEGMENT\n  if (wasm_rt_last_segment_val == base) {\n    return;\n  }\n\n  wasm_rt_last_segment_val = base;\n#endif\n\n  if (wasm_rt_fsgsbase_inst_supported) {\n    __builtin_ia32_wrgsbase64((uintptr_t)base);\n  } else {\n    wasm_rt_syscall_set_segue_base(base);\n  }\n}\n#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n#else\n#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n#endif\n\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n\n#if WASM_RT_STACK_DEPTH_COUNT\n#define FUNC_PROLOGUE                                            \\\n  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n    TRAP(EXHAUSTION);\n\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n#else\n#define FUNC_PROLOGUE\n\n#define FUNC_EPILOGUE\n#endif\n\n#define UNREACHABLE TRAP(UNREACHABLE)\n\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n                                 const wasm_rt_func_type_t b) {\n  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n}\n\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n  (LIKELY((x) < table.size && table.data[x].func &&      \\\n          func_types_eq(ft, table.data[x].func_type)) || \\\n   TRAP(CALL_INDIRECT))\n\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n#if __has_builtin(__builtin_add_overflow)\n  return __builtin_add_overflow(a, b, resptr);\n#elif defined(_MSC_VER)\n  return _addcarry_u64(0, a, b, resptr);\n#else\n#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n#endif\n}\n\n#define RANGE_CHECK(mem, offset, len)              \\\n  do {                                             \\\n    uint64_t res;                                  \\\n    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n      TRAP(OOB);                                   \\\n    if (UNLIKELY(res > (mem)->size))               \\\n      TRAP(OOB);                                   \\\n  } while (0);\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n#include <stdio.h>\n#define WASM_RT_CHECK_BASE(mem)                                               \\\n  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n    puts(\"Segment register mismatch\\n\");                                      \\\n    abort();                                                                  \\\n  }\n#else\n#define WASM_RT_CHECK_BASE(mem)\n#endif\n\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n// default-page-size, 32-bit memories. It may do nothing at all\n// (if hardware bounds-checking is enabled via guard pages)\n// or it may do a slightly faster RANGE_CHECK.\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n#else\n#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n  WASM_RT_CHECK_BASE(mem);                           \\\n  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n    TRAP(OOB);\n#endif\n\n// MEMCHECK_GENERAL can be used for any memory\n#define MEMCHECK_GENERAL(mem, a, t) \\\n  WASM_RT_CHECK_BASE(mem);          \\\n  RANGE_CHECK(mem, a, sizeof(t));\n\n#ifdef __GNUC__\n#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n// Clang on Mips requires \"f\" constraints on floats\n// See https://github.com/llvm/llvm-project/issues/64241\n#if defined(__clang__) && \\\n    (defined(mips) || defined(__mips__) || defined(__mips))\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n#else\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n#endif\n#else\n#define FORCE_READ_INT(var)\n#define FORCE_READ_FLOAT(var)\n#endif\n\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n  if (!n) {\n    return;\n  }\n#if WABT_BIG_ENDIAN\n  for (size_t i = 0; i < n; i++) {\n    dest[i] = src[n - i - 1];\n  }\n#else\n  wasm_rt_memcpy(dest, src, n);\n#endif\n}\n\n#define LOAD_DATA(m, o, i, s)            \\\n  do {                                   \\\n    RANGE_CHECK((&m), o, s);             \\\n    load_data(MEM_ADDR(&m, o, s), i, s); \\\n  } while (0)\n\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr) {                     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }\n\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1)                                           \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1) {     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1) {                           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }\n\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1, val_type2)                                \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1,       \\\n                                             val_type2 val2) {               \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1, val_type2 val2) {           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }\n\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    t1 result;                                                         \\\n    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n                   sizeof(t1));                                        \\\n    force_read(result);                                                \\\n    return (t3)(t2)result;                                             \\\n  }                                                                    \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n\n#define DEFINE_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      t2 value) {                      \\\n    t1 wrapped = (t1)value;                                            \\\n    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n                   sizeof(t1));                                        \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\nDEFINE_STORE(i32_store, u32, u32)\nDEFINE_STORE(i64_store, u64, u64)\nDEFINE_STORE(f32_store, f32, f32)\nDEFINE_STORE(f64_store, f64, f64)\nDEFINE_STORE(i32_store8, u8, u32)\nDEFINE_STORE(i32_store16, u16, u32)\nDEFINE_STORE(i64_store8, u8, u64)\nDEFINE_STORE(i64_store16, u16, u64)\nDEFINE_STORE(i64_store32, u32, u64)\n\n#if defined(_MSC_VER)\n\n// Adapted from\n// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n\nstatic inline int I64_CLZ(unsigned long long v) {\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  if (_BitScanReverse64(&r, v)) {\n    return 63 - r;\n  }\n#else\n  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n    return 31 - r;\n  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n    return 63 - r;\n  }\n#endif\n  return 64;\n}\n\nstatic inline int I32_CLZ(unsigned long v) {\n  unsigned long r = 0;\n  if (_BitScanReverse(&r, v)) {\n    return 31 - r;\n  }\n  return 32;\n}\n\nstatic inline int I64_CTZ(unsigned long long v) {\n  if (!v) {\n    return 64;\n  }\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  _BitScanForward64(&r, v);\n  return (int)r;\n#else\n  if (_BitScanForward(&r, (unsigned int)(v))) {\n    return (int)(r);\n  }\n\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n  return (int)(r + 32);\n#endif\n}\n\nstatic inline int I32_CTZ(unsigned long v) {\n  if (!v) {\n    return 32;\n  }\n  unsigned long r = 0;\n  _BitScanForward(&r, v);\n  return (int)r;\n}\n\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n  static inline u32 f_n(T x) {                                      \\\n    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n  }\n\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\nPOPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n\n#undef POPCOUNT_DEFINE_PORTABLE\n\n#else\n\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n#define I32_POPCNT(x) (__builtin_popcount(x))\n#define I64_POPCNT(x) (__builtin_popcountll(x))\n\n#endif\n\n#define DIV_S(ut, min, x, y)                                  \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n                                         : (ut)((x) / (y)))\n\n#define REM_S(ut, min, x, y)                                 \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n                                         : (ut)((x) % (y)))\n\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n\n#define DIVREM_U(op, x, y) \\\n  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n#define REM_U(x, y) DIVREM_U(%, x, y)\n\n#define ROTL(x, y, mask) \\\n  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n#define ROTR(x, y, mask) \\\n  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n#define I64_ROTL(x, y) ROTL(x, y, 63)\n#define I32_ROTR(x, y) ROTR(x, y, 31)\n#define I64_ROTR(x, y) ROTR(x, y, 63)\n\n#define FMIN(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n   : (x < y)                          ? x                    \\\n                                      : y)\n\n#define FMAX(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n   : (x > y)                          ? x                    \\\n                                      : y)\n\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                 : (ut)(st)(x))\n\n#define I32_TRUNC_S_F32(x) \\\n  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n#define I64_TRUNC_S_F32(x) \\\n  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n#define I32_TRUNC_S_F64(x) \\\n  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n#define I64_TRUNC_S_F64(x) \\\n  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n\n#define TRUNC_U(ut, ft, max, x)                                              \\\n  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                  : (ut)(x))\n\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))         ? 0                           \\\n   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n                                  : (ut)(st)(x))\n\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F32(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n              INT64_MAX, x)\n#define I32_TRUNC_SAT_S_F64(x)                                        \\\n  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F64(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n              INT64_MAX, x)\n\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))          ? 0    \\\n   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n   : (UNLIKELY(!((x) < (max))))    ? smax \\\n                                   : (ut)(x))\n\n#define I32_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F64(x) \\\n  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n  static inline t2 name(t1 x) {                  \\\n    t2 result;                                   \\\n    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n    return result;                               \\\n  }\n\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\nDEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\nDEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\nDEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n\nstatic float quiet_nanf(float x) {\n  uint32_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 4);\n  tmp |= 0x7fc00000lu;\n  wasm_rt_memcpy(&x, &tmp, 4);\n  return x;\n}\n\nstatic double quiet_nan(double x) {\n  uint64_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 8);\n  tmp |= 0x7ff8000000000000llu;\n  wasm_rt_memcpy(&x, &tmp, 8);\n  return x;\n}\n\nstatic double wasm_quiet(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return x;\n}\n\nstatic float wasm_quietf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return x;\n}\n\nstatic double wasm_floor(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return floor(x);\n}\n\nstatic float wasm_floorf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return floorf(x);\n}\n\nstatic double wasm_ceil(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return ceil(x);\n}\n\nstatic float wasm_ceilf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return ceilf(x);\n}\n\nstatic double wasm_trunc(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return trunc(x);\n}\n\nstatic float wasm_truncf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return truncf(x);\n}\n\nstatic float wasm_nearbyintf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return nearbyintf(x);\n}\n\nstatic double wasm_nearbyint(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return nearbyint(x);\n}\n\nstatic float wasm_fabsf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    uint32_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 4);\n    tmp = tmp & ~(1UL << 31);\n    wasm_rt_memcpy(&x, &tmp, 4);\n    return x;\n  }\n  return fabsf(x);\n}\n\nstatic double wasm_fabs(double x) {\n  if (UNLIKELY(isnan(x))) {\n    uint64_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 8);\n    tmp = tmp & ~(1ULL << 63);\n    wasm_rt_memcpy(&x, &tmp, 8);\n    return x;\n  }\n  return fabs(x);\n}\n\nstatic double wasm_sqrt(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return sqrt(x);\n}\n\nstatic float wasm_sqrtf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return sqrtf(x);\n}\n\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n  RANGE_CHECK(mem, d, n);\n  memset(MEM_ADDR(mem, d, n), val, n);\n}\n\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n                               const wasm_rt_memory_t* src,\n                               u64 dest_addr,\n                               u64 src_addr,\n                               u64 n) {\n  RANGE_CHECK(dest, dest_addr, n);\n  RANGE_CHECK(src, src_addr, n);\n  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n}\n\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n                               const u8* src,\n                               u32 src_size,\n                               u64 dest_addr,\n                               u32 src_addr,\n                               u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n}\n\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n\ntypedef struct {\n  wasm_elem_segment_expr_type_t expr_type;\n  wasm_rt_func_type_t type;\n  wasm_rt_function_ptr_t func;\n  wasm_rt_tailcallee_t func_tailcallee;\n  size_t module_offset;\n} wasm_elem_segment_expr_t;\n\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n                                      const wasm_elem_segment_expr_t* src,\n                                      u32 src_size,\n                                      u64 dest_addr,\n                                      u32 src_addr,\n                                      u32 n,\n                                      void* module_instance) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n    switch (src_expr->expr_type) {\n      case RefFunc:\n        *dest_val = (wasm_rt_funcref_t){\n            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n            (char*)module_instance + src_expr->module_offset};\n        break;\n      case RefNull:\n        *dest_val = wasm_rt_funcref_null_value;\n        break;\n      case GlobalGet:\n        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n                                            src_expr->module_offset);\n        break;\n    }\n  }\n}\n\n// Currently wasm2c only supports initializing externref tables with ref.null.\nstatic inline void externref_table_init(wasm_rt_externref_table_t* dest,\n                                        u32 src_size,\n                                        u64 dest_addr,\n                                        u32 src_addr,\n                                        u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n  }\n}\n\n#define DEFINE_TABLE_COPY(type)                                              \\\n  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n                                       const wasm_rt_##type##_table_t* src,  \\\n                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n    RANGE_CHECK(dest, dest_addr, n);                                         \\\n    RANGE_CHECK(src, src_addr, n);                                           \\\n    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n            n * sizeof(wasm_rt_##type##_t));                                 \\\n  }\n\nDEFINE_TABLE_COPY(funcref)\nDEFINE_TABLE_COPY(externref)\n\n#define DEFINE_TABLE_GET(type)                        \\\n  static inline wasm_rt_##type##_t type##_table_get(  \\\n      const wasm_rt_##type##_table_t* table, u64 i) { \\\n    if (UNLIKELY(i >= table->size))                   \\\n      TRAP(OOB);                                      \\\n    return table->data[i];                            \\\n  }\n\nDEFINE_TABLE_GET(funcref)\nDEFINE_TABLE_GET(externref)\n\n#define DEFINE_TABLE_SET(type)                                               \\\n  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n                                      u64 i, const wasm_rt_##type##_t val) { \\\n    if (UNLIKELY(i >= table->size))                                          \\\n      TRAP(OOB);                                                             \\\n    table->data[i] = val;                                                    \\\n  }\n\nDEFINE_TABLE_SET(funcref)\nDEFINE_TABLE_SET(externref)\n\n#define DEFINE_TABLE_FILL(type)                                               \\\n  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n                                       u64 d, const wasm_rt_##type##_t val,   \\\n                                       u64 n) {                               \\\n    RANGE_CHECK(table, d, n);                                                 \\\n    for (uint32_t i = d; i < d + n; i++) {                                    \\\n      table->data[i] = val;                                                   \\\n    }                                                                         \\\n  }\n\nDEFINE_TABLE_FILL(funcref)\nDEFINE_TABLE_FILL(externref)\n\n#if defined(__GNUC__) || defined(__clang__)\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n#define FUNC_TYPE_EXTERN_T(x) const char* const x\n#define FUNC_TYPE_T(x) static const char* const x\n#else\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n#define FUNC_TYPE_EXTERN_T(x) const char x[]\n#define FUNC_TYPE_T(x) static const char x[]\n#endif\n\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n#define static_assert(X) \\\n  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n#endif\n\n#ifdef _MSC_VER\n#define WEAK_FUNC_DECL(func, fallback)                             \\\n  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n                                                                   \\\n      void                                                         \\\n      fallback(void** instance_ptr, void* tail_call_stack,         \\\n               wasm_rt_tailcallee_t* next)\n#else\n#define WEAK_FUNC_DECL(func, fallback)                                        \\\n  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n                                  wasm_rt_tailcallee_t* next)\n#endif\n"
  },
  {
    "path": "src/template/wasm2c.includes.c",
    "content": "#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#if defined(__MINGW32__)\n#include <malloc.h>\n#elif defined(_MSC_VER)\n#include <intrin.h>\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <stdlib.h>\n#else\n#include <alloca.h>\n#endif\n"
  },
  {
    "path": "src/template/wasm2c.top.h",
    "content": "#include <stdint.h>\n\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\ntypedef uint8_t u8;\ntypedef int8_t s8;\ntypedef uint16_t u16;\ntypedef int16_t s16;\ntypedef uint32_t u32;\ntypedef int32_t s32;\ntypedef uint64_t u64;\ntypedef int64_t s64;\ntypedef float f32;\ntypedef double f64;\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
  },
  {
    "path": "src/template/wasm2c_atomicops.declarations.c",
    "content": "#include <stdatomic.h>\n\n#ifndef WASM_RT_C11_AVAILABLE\n#error \"C11 is required for Wasm threads and shared memory support\"\n#endif\n\n#define ATOMIC_ALIGNMENT_CHECK(addr, t1) \\\n  if (UNLIKELY(addr % sizeof(t1))) {     \\\n    TRAP(UNALIGNED);                     \\\n  }\n\n#define DEFINE_SHARED_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_shared_memory_t* mem, u64 addr) { \\\n    t1 result;                                                                \\\n    result = atomic_load_explicit(                                            \\\n        (_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)),                \\\n        memory_order_relaxed);                                                \\\n    force_read(result);                                                       \\\n    return (t3)(t2)result;                                                    \\\n  }                                                                           \\\n  DEF_MEM_CHECKS0(name, _shared_, t1, return, t3)\n\nDEFINE_SHARED_LOAD(i32_load_shared, u32, u32, u32, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i64_load_shared, u64, u64, u64, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(f32_load_shared, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_SHARED_LOAD(f64_load_shared, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_SHARED_LOAD(i32_load8_s_shared, s8, s32, u32, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i64_load8_s_shared, s8, s64, u64, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i32_load8_u_shared, u8, u32, u32, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i64_load8_u_shared, u8, u64, u64, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i32_load16_s_shared, s16, s32, u32, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i64_load16_s_shared, s16, s64, u64, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i32_load16_u_shared, u16, u32, u32, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i64_load16_u_shared, u16, u64, u64, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i64_load32_s_shared, s32, s64, u64, FORCE_READ_INT)\nDEFINE_SHARED_LOAD(i64_load32_u_shared, u32, u64, u64, FORCE_READ_INT)\n\n#define DEFINE_SHARED_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_shared_memory_t* mem, u64 addr, \\\n                                      t2 value) {                             \\\n    t1 wrapped = (t1)value;                                                   \\\n    atomic_store_explicit(                                                    \\\n        (_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)), wrapped,       \\\n        memory_order_relaxed);                                                \\\n  }                                                                           \\\n  DEF_MEM_CHECKS1(name, _shared_, t1, , void, t2)\n\nDEFINE_SHARED_STORE(i32_store_shared, u32, u32)\nDEFINE_SHARED_STORE(i64_store_shared, u64, u64)\nDEFINE_SHARED_STORE(f32_store_shared, f32, f32)\nDEFINE_SHARED_STORE(f64_store_shared, f64, f64)\nDEFINE_SHARED_STORE(i32_store8_shared, u8, u32)\nDEFINE_SHARED_STORE(i32_store16_shared, u16, u32)\nDEFINE_SHARED_STORE(i64_store8_shared, u8, u64)\nDEFINE_SHARED_STORE(i64_store16_shared, u16, u64)\nDEFINE_SHARED_STORE(i64_store32_shared, u32, u64)\n\n#define DEFINE_ATOMIC_LOAD(name, t1, t2, t3, force_read)                    \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) {      \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                       \\\n    t1 result;                                                              \\\n    wasm_rt_memcpy(&result, MEM_ADDR(mem, addr, sizeof(t1)), sizeof(t1));   \\\n    force_read(result);                                                     \\\n    return (t3)(t2)result;                                                  \\\n  }                                                                         \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)                                  \\\n  static inline t3 name##_shared_unchecked(wasm_rt_shared_memory_t* mem,    \\\n                                           u64 addr) {                      \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                       \\\n    t1 result;                                                              \\\n    result =                                                                \\\n        atomic_load((_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1))); \\\n    force_read(result);                                                     \\\n    return (t3)(t2)result;                                                  \\\n  }                                                                         \\\n  DEF_MEM_CHECKS0(name##_shared, _shared_, t1, return, t3)\n\nDEFINE_ATOMIC_LOAD(i32_atomic_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_ATOMIC_LOAD(i64_atomic_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_ATOMIC_LOAD(i32_atomic_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_ATOMIC_LOAD(i64_atomic_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_ATOMIC_LOAD(i32_atomic_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_ATOMIC_LOAD(i64_atomic_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_ATOMIC_LOAD(i64_atomic_load32_u, u32, u64, u64, FORCE_READ_INT)\n\n#define DEFINE_ATOMIC_STORE(name, t1, t2)                                  \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr,     \\\n                                      t2 value) {                          \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                      \\\n    t1 wrapped = (t1)value;                                                \\\n    wasm_rt_memcpy(MEM_ADDR(mem, addr, sizeof(t1)), &wrapped, sizeof(t1)); \\\n  }                                                                        \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)                                 \\\n  static inline void name##_shared_unchecked(wasm_rt_shared_memory_t* mem, \\\n                                             u64 addr, t2 value) {         \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                      \\\n    t1 wrapped = (t1)value;                                                \\\n    atomic_store((_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)),    \\\n                 wrapped);                                                 \\\n  }                                                                        \\\n  DEF_MEM_CHECKS1(name##_shared, _shared_, t1, , void, t2)\n\nDEFINE_ATOMIC_STORE(i32_atomic_store, u32, u32)\nDEFINE_ATOMIC_STORE(i64_atomic_store, u64, u64)\nDEFINE_ATOMIC_STORE(i32_atomic_store8, u8, u32)\nDEFINE_ATOMIC_STORE(i32_atomic_store16, u16, u32)\nDEFINE_ATOMIC_STORE(i64_atomic_store8, u8, u64)\nDEFINE_ATOMIC_STORE(i64_atomic_store16, u16, u64)\nDEFINE_ATOMIC_STORE(i64_atomic_store32, u32, u64)\n\n#define DEFINE_ATOMIC_RMW(name, opname, op, t1, t2)                      \\\n  static inline t2 name##_unchecked(wasm_rt_memory_t* mem, u64 addr,     \\\n                                    t2 value) {                          \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                    \\\n    t1 wrapped = (t1)value;                                              \\\n    t1 ret;                                                              \\\n    wasm_rt_memcpy(&ret, MEM_ADDR(mem, addr, sizeof(t1)), sizeof(t1));   \\\n    ret = ret op wrapped;                                                \\\n    wasm_rt_memcpy(MEM_ADDR(mem, addr, sizeof(t1)), &ret, sizeof(t1));   \\\n    return (t2)ret;                                                      \\\n  }                                                                      \\\n  DEF_MEM_CHECKS1(name, _, t1, return, t2, t2)                           \\\n  static inline t2 name##_shared_unchecked(wasm_rt_shared_memory_t* mem, \\\n                                           u64 addr, t2 value) {         \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                    \\\n    t1 wrapped = (t1)value;                                              \\\n    t1 ret = atomic_##opname(                                            \\\n        (_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)), wrapped); \\\n    return (t2)ret;                                                      \\\n  }                                                                      \\\n  DEF_MEM_CHECKS1(name##_shared, _shared_, t1, return, t2, t2)\n\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_add_u, fetch_add, +, u8, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw16_add_u, fetch_add, +, u16, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw_add, fetch_add, +, u32, u32)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw8_add_u, fetch_add, +, u8, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw16_add_u, fetch_add, +, u16, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw32_add_u, fetch_add, +, u32, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw_add, fetch_add, +, u64, u64)\n\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_sub_u, fetch_sub, -, u8, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw16_sub_u, fetch_sub, -, u16, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw_sub, fetch_sub, -, u32, u32)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw8_sub_u, fetch_sub, -, u8, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw16_sub_u, fetch_sub, -, u16, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw32_sub_u, fetch_sub, -, u32, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw_sub, fetch_sub, -, u64, u64)\n\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_and_u, fetch_and, &, u8, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw16_and_u, fetch_and, &, u16, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw_and, fetch_and, &, u32, u32)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw8_and_u, fetch_and, &, u8, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw16_and_u, fetch_and, &, u16, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw32_and_u, fetch_and, &, u32, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw_and, fetch_and, &, u64, u64)\n\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_or_u, fetch_or, |, u8, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw16_or_u, fetch_or, |, u16, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw_or, fetch_or, |, u32, u32)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw8_or_u, fetch_or, |, u8, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw16_or_u, fetch_or, |, u16, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw32_or_u, fetch_or, |, u32, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw_or, fetch_or, |, u64, u64)\n\nDEFINE_ATOMIC_RMW(i32_atomic_rmw8_xor_u, fetch_xor, ^, u8, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw16_xor_u, fetch_xor, ^, u16, u32)\nDEFINE_ATOMIC_RMW(i32_atomic_rmw_xor, fetch_xor, ^, u32, u32)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw8_xor_u, fetch_xor, ^, u8, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw16_xor_u, fetch_xor, ^, u16, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw32_xor_u, fetch_xor, ^, u32, u64)\nDEFINE_ATOMIC_RMW(i64_atomic_rmw_xor, fetch_xor, ^, u64, u64)\n\n#define DEFINE_ATOMIC_XCHG(name, opname, t1, t2)                           \\\n  static inline t2 name##_unchecked(wasm_rt_memory_t* mem, u64 addr,       \\\n                                    t2 value) {                            \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                      \\\n    t1 wrapped = (t1)value;                                                \\\n    t1 ret;                                                                \\\n    wasm_rt_memcpy(&ret, MEM_ADDR(mem, addr, sizeof(t1)), sizeof(t1));     \\\n    wasm_rt_memcpy(MEM_ADDR(mem, addr, sizeof(t1)), &wrapped, sizeof(t1)); \\\n    return (t2)ret;                                                        \\\n  }                                                                        \\\n  DEF_MEM_CHECKS1(name, _, t1, return, t2, t2)                             \\\n  static inline t2 name##_shared_unchecked(wasm_rt_shared_memory_t* mem,   \\\n                                           u64 addr, t2 value) {           \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t1);                                      \\\n    t1 wrapped = (t1)value;                                                \\\n    t1 ret = atomic_##opname(                                              \\\n        (_Atomic volatile t1*)MEM_ADDR(mem, addr, sizeof(t1)), wrapped);   \\\n    return (t2)ret;                                                        \\\n  }                                                                        \\\n  DEF_MEM_CHECKS1(name##_shared, _shared_, t1, return, t2, t2)\n\nDEFINE_ATOMIC_XCHG(i32_atomic_rmw8_xchg_u, exchange, u8, u32)\nDEFINE_ATOMIC_XCHG(i32_atomic_rmw16_xchg_u, exchange, u16, u32)\nDEFINE_ATOMIC_XCHG(i32_atomic_rmw_xchg, exchange, u32, u32)\nDEFINE_ATOMIC_XCHG(i64_atomic_rmw8_xchg_u, exchange, u8, u64)\nDEFINE_ATOMIC_XCHG(i64_atomic_rmw16_xchg_u, exchange, u16, u64)\nDEFINE_ATOMIC_XCHG(i64_atomic_rmw32_xchg_u, exchange, u32, u64)\nDEFINE_ATOMIC_XCHG(i64_atomic_rmw_xchg, exchange, u64, u64)\n\n#define DEFINE_ATOMIC_CMP_XCHG(name, t1, t2)                                 \\\n  static inline t1 name##_unchecked(wasm_rt_memory_t* mem, u64 addr,         \\\n                                    t1 expected, t1 replacement) {           \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t2);                                        \\\n    t2 expected_wrapped = (t2)expected;                                      \\\n    t2 replacement_wrapped = (t2)replacement;                                \\\n    t2 ret;                                                                  \\\n    wasm_rt_memcpy(&ret, MEM_ADDR(mem, addr, sizeof(t2)), sizeof(t2));       \\\n    if (ret == expected_wrapped) {                                           \\\n      wasm_rt_memcpy(MEM_ADDR(mem, addr, sizeof(t2)), &replacement_wrapped,  \\\n                     sizeof(t2));                                            \\\n    }                                                                        \\\n    return (t1)expected_wrapped;                                             \\\n  }                                                                          \\\n  DEF_MEM_CHECKS2(name, _, t2, return, t1, t1, t1)                           \\\n  static inline t1 name##_shared_unchecked(                                  \\\n      wasm_rt_shared_memory_t* mem, u64 addr, t1 expected, t1 replacement) { \\\n    ATOMIC_ALIGNMENT_CHECK(addr, t2);                                        \\\n    t2 expected_wrapped = (t2)expected;                                      \\\n    t2 replacement_wrapped = (t2)replacement;                                \\\n    atomic_compare_exchange_strong(                                          \\\n        (_Atomic volatile t2*)MEM_ADDR(mem, addr, sizeof(t2)),               \\\n        &expected_wrapped, replacement_wrapped);                             \\\n    return (t1)expected_wrapped;                                             \\\n  }                                                                          \\\n  DEF_MEM_CHECKS2(name##_shared, _shared_, t2, return, t1, t1, t1)\n\nDEFINE_ATOMIC_CMP_XCHG(i32_atomic_rmw8_cmpxchg_u, u32, u8);\nDEFINE_ATOMIC_CMP_XCHG(i32_atomic_rmw16_cmpxchg_u, u32, u16);\nDEFINE_ATOMIC_CMP_XCHG(i32_atomic_rmw_cmpxchg, u32, u32);\nDEFINE_ATOMIC_CMP_XCHG(i64_atomic_rmw8_cmpxchg_u, u64, u8);\nDEFINE_ATOMIC_CMP_XCHG(i64_atomic_rmw16_cmpxchg_u, u64, u16);\nDEFINE_ATOMIC_CMP_XCHG(i64_atomic_rmw32_cmpxchg_u, u64, u32);\nDEFINE_ATOMIC_CMP_XCHG(i64_atomic_rmw_cmpxchg, u64, u64);\n\n#define atomic_fence() atomic_thread_fence(memory_order_seq_cst)\n"
  },
  {
    "path": "src/template/wasm2c_simd.declarations.c",
    "content": "#if defined(__GNUC__) && defined(__x86_64__)\n#define SIMD_FORCE_READ(var) __asm__(\"\" ::\"x\"(var));\n#elif defined(__GNUC__) && defined(__aarch64__)\n#define SIMD_FORCE_READ(var) __asm__(\"\" ::\"w\"(var));\n#elif defined(__s390x__)\n#define SIMD_FORCE_READ(var) __asm__(\"\" ::\"d\"(var));\n#else\n#define SIMD_FORCE_READ(var)\n#endif\n// TODO: equivalent constraint for ARM and other architectures\n\n#define DEFINE_SIMD_LOAD_FUNC(name, func, t)                             \\\n  static inline v128 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    v128 result = func(MEM_ADDR(mem, addr, sizeof(t)));                  \\\n    SIMD_FORCE_READ(result);                                             \\\n    return result;                                                       \\\n  }                                                                      \\\n  DEF_MEM_CHECKS0(name, _, t, return, v128);\n\n#define DEFINE_SIMD_LOAD_LANE(name, func, t, lane)                     \\\n  static inline v128 name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      v128 vec) {                      \\\n    v128 result = func(MEM_ADDR(mem, addr, sizeof(t)), vec, lane);     \\\n    SIMD_FORCE_READ(result);                                           \\\n    return result;                                                     \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t, return, v128, v128);\n\n#define DEFINE_SIMD_STORE(name, t)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      v128 value) {                    \\\n    simde_wasm_v128_store(MEM_ADDR(mem, addr, sizeof(t)), value);      \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t, , void, v128);\n\n#define DEFINE_SIMD_STORE_LANE(name, func, t, lane)                    \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      v128 value) {                    \\\n    func(MEM_ADDR(mem, addr, sizeof(t)), value, lane);                 \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t, , void, v128);\n\n// clang-format off\n#if WABT_BIG_ENDIAN\nstatic inline v128 v128_impl_load32_zero(const void* a) {\n  return simde_wasm_i8x16_swizzle(\n      simde_wasm_v128_load32_zero(a),\n      simde_wasm_i8x16_const(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3));\n}\nstatic inline v128 v128_impl_load64_zero(const void* a) {\n  return simde_wasm_i8x16_swizzle(\n      simde_wasm_v128_load64_zero(a),\n      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7));\n}\n#else\n#define v128_impl_load32_zero simde_wasm_v128_load32_zero\n#define v128_impl_load64_zero simde_wasm_v128_load64_zero\n#endif\n\nDEFINE_SIMD_LOAD_FUNC(v128_load, simde_wasm_v128_load, v128)\n\nDEFINE_SIMD_LOAD_FUNC(v128_load8_splat, simde_wasm_v128_load8_splat, u8)\nDEFINE_SIMD_LOAD_FUNC(v128_load16_splat, simde_wasm_v128_load16_splat, u16)\nDEFINE_SIMD_LOAD_FUNC(v128_load32_splat, simde_wasm_v128_load32_splat, u32)\nDEFINE_SIMD_LOAD_FUNC(v128_load64_splat, simde_wasm_v128_load64_splat, u64)\n\nDEFINE_SIMD_LOAD_FUNC(i16x8_load8x8, simde_wasm_i16x8_load8x8, u64)\nDEFINE_SIMD_LOAD_FUNC(u16x8_load8x8, simde_wasm_u16x8_load8x8, u64)\nDEFINE_SIMD_LOAD_FUNC(i32x4_load16x4, simde_wasm_i32x4_load16x4, u64)\nDEFINE_SIMD_LOAD_FUNC(u32x4_load16x4, simde_wasm_u32x4_load16x4, u64)\nDEFINE_SIMD_LOAD_FUNC(i64x2_load32x2, simde_wasm_i64x2_load32x2, u64)\nDEFINE_SIMD_LOAD_FUNC(u64x2_load32x2, simde_wasm_u64x2_load32x2, u64)\n\nDEFINE_SIMD_LOAD_FUNC(v128_load32_zero, v128_impl_load32_zero, u32)\nDEFINE_SIMD_LOAD_FUNC(v128_load64_zero, v128_impl_load64_zero, u64)\n\n#if WABT_BIG_ENDIAN\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane0, simde_wasm_v128_load8_lane, u8, 15)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane1, simde_wasm_v128_load8_lane, u8, 14)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane2, simde_wasm_v128_load8_lane, u8, 13)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane3, simde_wasm_v128_load8_lane, u8, 12)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane4, simde_wasm_v128_load8_lane, u8, 11)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane5, simde_wasm_v128_load8_lane, u8, 10)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane6, simde_wasm_v128_load8_lane, u8, 9)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane7, simde_wasm_v128_load8_lane, u8, 8)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane8, simde_wasm_v128_load8_lane, u8, 7)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane9, simde_wasm_v128_load8_lane, u8, 6)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane10, simde_wasm_v128_load8_lane, u8, 5)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane11, simde_wasm_v128_load8_lane, u8, 4)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane12, simde_wasm_v128_load8_lane, u8, 3)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane13, simde_wasm_v128_load8_lane, u8, 2)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane14, simde_wasm_v128_load8_lane, u8, 1)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane15, simde_wasm_v128_load8_lane, u8, 0)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane0, simde_wasm_v128_load16_lane, u16, 7)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane1, simde_wasm_v128_load16_lane, u16, 6)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane2, simde_wasm_v128_load16_lane, u16, 5)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane3, simde_wasm_v128_load16_lane, u16, 4)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane4, simde_wasm_v128_load16_lane, u16, 3)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane5, simde_wasm_v128_load16_lane, u16, 2)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane6, simde_wasm_v128_load16_lane, u16, 1)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane7, simde_wasm_v128_load16_lane, u16, 0)\nDEFINE_SIMD_LOAD_LANE(v128_load32_lane0, simde_wasm_v128_load32_lane, u32, 3)\nDEFINE_SIMD_LOAD_LANE(v128_load32_lane1, simde_wasm_v128_load32_lane, u32, 2)\nDEFINE_SIMD_LOAD_LANE(v128_load32_lane2, simde_wasm_v128_load32_lane, u32, 1)\nDEFINE_SIMD_LOAD_LANE(v128_load32_lane3, simde_wasm_v128_load32_lane, u32, 0)\nDEFINE_SIMD_LOAD_LANE(v128_load64_lane0, simde_wasm_v128_load64_lane, u64, 1)\nDEFINE_SIMD_LOAD_LANE(v128_load64_lane1, simde_wasm_v128_load64_lane, u64, 0)\n#else\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane0, simde_wasm_v128_load8_lane, u8, 0)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane1, simde_wasm_v128_load8_lane, u8, 1)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane2, simde_wasm_v128_load8_lane, u8, 2)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane3, simde_wasm_v128_load8_lane, u8, 3)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane4, simde_wasm_v128_load8_lane, u8, 4)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane5, simde_wasm_v128_load8_lane, u8, 5)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane6, simde_wasm_v128_load8_lane, u8, 6)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane7, simde_wasm_v128_load8_lane, u8, 7)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane8, simde_wasm_v128_load8_lane, u8, 8)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane9, simde_wasm_v128_load8_lane, u8, 9)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane10, simde_wasm_v128_load8_lane, u8, 10)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane11, simde_wasm_v128_load8_lane, u8, 11)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane12, simde_wasm_v128_load8_lane, u8, 12)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane13, simde_wasm_v128_load8_lane, u8, 13)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane14, simde_wasm_v128_load8_lane, u8, 14)\nDEFINE_SIMD_LOAD_LANE(v128_load8_lane15, simde_wasm_v128_load8_lane, u8, 15)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane0, simde_wasm_v128_load16_lane, u16, 0)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane1, simde_wasm_v128_load16_lane, u16, 1)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane2, simde_wasm_v128_load16_lane, u16, 2)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane3, simde_wasm_v128_load16_lane, u16, 3)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane4, simde_wasm_v128_load16_lane, u16, 4)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane5, simde_wasm_v128_load16_lane, u16, 5)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane6, simde_wasm_v128_load16_lane, u16, 6)\nDEFINE_SIMD_LOAD_LANE(v128_load16_lane7, simde_wasm_v128_load16_lane, u16, 7)\nDEFINE_SIMD_LOAD_LANE(v128_load32_lane0, simde_wasm_v128_load32_lane, u32, 0)\nDEFINE_SIMD_LOAD_LANE(v128_load32_lane1, simde_wasm_v128_load32_lane, u32, 1)\nDEFINE_SIMD_LOAD_LANE(v128_load32_lane2, simde_wasm_v128_load32_lane, u32, 2)\nDEFINE_SIMD_LOAD_LANE(v128_load32_lane3, simde_wasm_v128_load32_lane, u32, 3)\nDEFINE_SIMD_LOAD_LANE(v128_load64_lane0, simde_wasm_v128_load64_lane, u64, 0)\nDEFINE_SIMD_LOAD_LANE(v128_load64_lane1, simde_wasm_v128_load64_lane, u64, 1)\n#endif\n\nDEFINE_SIMD_STORE(v128_store, v128)\n\n#if WABT_BIG_ENDIAN\nDEFINE_SIMD_STORE_LANE(v128_store8_lane0, simde_wasm_v128_store8_lane, u8, 15)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane1, simde_wasm_v128_store8_lane, u8, 14)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane2, simde_wasm_v128_store8_lane, u8, 13)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane3, simde_wasm_v128_store8_lane, u8, 12)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane4, simde_wasm_v128_store8_lane, u8, 11)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane5, simde_wasm_v128_store8_lane, u8, 10)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane6, simde_wasm_v128_store8_lane, u8, 9)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane7, simde_wasm_v128_store8_lane, u8, 8)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane8, simde_wasm_v128_store8_lane, u8, 7)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane9, simde_wasm_v128_store8_lane, u8, 6)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane10, simde_wasm_v128_store8_lane, u8, 5)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane11, simde_wasm_v128_store8_lane, u8, 4)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane12, simde_wasm_v128_store8_lane, u8, 3)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane13, simde_wasm_v128_store8_lane, u8, 2)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane14, simde_wasm_v128_store8_lane, u8, 1)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane15, simde_wasm_v128_store8_lane, u8, 0)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane0, simde_wasm_v128_store16_lane, u16, 7)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane1, simde_wasm_v128_store16_lane, u16, 6)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane2, simde_wasm_v128_store16_lane, u16, 5)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane3, simde_wasm_v128_store16_lane, u16, 4)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane4, simde_wasm_v128_store16_lane, u16, 3)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane5, simde_wasm_v128_store16_lane, u16, 2)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane6, simde_wasm_v128_store16_lane, u16, 1)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane7, simde_wasm_v128_store16_lane, u16, 0)\nDEFINE_SIMD_STORE_LANE(v128_store32_lane0, simde_wasm_v128_store32_lane, u32, 3)\nDEFINE_SIMD_STORE_LANE(v128_store32_lane1, simde_wasm_v128_store32_lane, u32, 2)\nDEFINE_SIMD_STORE_LANE(v128_store32_lane2, simde_wasm_v128_store32_lane, u32, 1)\nDEFINE_SIMD_STORE_LANE(v128_store32_lane3, simde_wasm_v128_store32_lane, u32, 0)\nDEFINE_SIMD_STORE_LANE(v128_store64_lane0, simde_wasm_v128_store64_lane, u64, 1)\nDEFINE_SIMD_STORE_LANE(v128_store64_lane1, simde_wasm_v128_store64_lane, u64, 0)\n#else\nDEFINE_SIMD_STORE_LANE(v128_store8_lane0, simde_wasm_v128_store8_lane, u8, 0)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane1, simde_wasm_v128_store8_lane, u8, 1)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane2, simde_wasm_v128_store8_lane, u8, 2)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane3, simde_wasm_v128_store8_lane, u8, 3)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane4, simde_wasm_v128_store8_lane, u8, 4)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane5, simde_wasm_v128_store8_lane, u8, 5)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane6, simde_wasm_v128_store8_lane, u8, 6)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane7, simde_wasm_v128_store8_lane, u8, 7)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane8, simde_wasm_v128_store8_lane, u8, 8)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane9, simde_wasm_v128_store8_lane, u8, 9)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane10, simde_wasm_v128_store8_lane, u8, 10)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane11, simde_wasm_v128_store8_lane, u8, 11)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane12, simde_wasm_v128_store8_lane, u8, 12)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane13, simde_wasm_v128_store8_lane, u8, 13)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane14, simde_wasm_v128_store8_lane, u8, 14)\nDEFINE_SIMD_STORE_LANE(v128_store8_lane15, simde_wasm_v128_store8_lane, u8, 15)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane0, simde_wasm_v128_store16_lane, u16, 0)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane1, simde_wasm_v128_store16_lane, u16, 1)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane2, simde_wasm_v128_store16_lane, u16, 2)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane3, simde_wasm_v128_store16_lane, u16, 3)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane4, simde_wasm_v128_store16_lane, u16, 4)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane5, simde_wasm_v128_store16_lane, u16, 5)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane6, simde_wasm_v128_store16_lane, u16, 6)\nDEFINE_SIMD_STORE_LANE(v128_store16_lane7, simde_wasm_v128_store16_lane, u16, 7)\nDEFINE_SIMD_STORE_LANE(v128_store32_lane0, simde_wasm_v128_store32_lane, u32, 0)\nDEFINE_SIMD_STORE_LANE(v128_store32_lane1, simde_wasm_v128_store32_lane, u32, 1)\nDEFINE_SIMD_STORE_LANE(v128_store32_lane2, simde_wasm_v128_store32_lane, u32, 2)\nDEFINE_SIMD_STORE_LANE(v128_store32_lane3, simde_wasm_v128_store32_lane, u32, 3)\nDEFINE_SIMD_STORE_LANE(v128_store64_lane0, simde_wasm_v128_store64_lane, u64, 0)\nDEFINE_SIMD_STORE_LANE(v128_store64_lane1, simde_wasm_v128_store64_lane, u64, 1)\n#endif\n\n#if WABT_BIG_ENDIAN\n#define v128_const(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) simde_wasm_i8x16_const(p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a)\n#define v128_i8x16_extract_lane(v, l) simde_wasm_i8x16_extract_lane(v, 15-(l))\n#define v128_u8x16_extract_lane(v, l) simde_wasm_u8x16_extract_lane(v, 15-(l))\n#define v128_i16x8_extract_lane(v, l) simde_wasm_i16x8_extract_lane(v, 7-(l))\n#define v128_u16x8_extract_lane(v, l) simde_wasm_u16x8_extract_lane(v, 7-(l))\n#define v128_i32x4_extract_lane(v, l) simde_wasm_i32x4_extract_lane(v, 3-(l))\n#define v128_i64x2_extract_lane(v, l) simde_wasm_i64x2_extract_lane(v, 1-(l))\n#define v128_f32x4_extract_lane(v, l) simde_wasm_f32x4_extract_lane(v, 3-(l))\n#define v128_f64x2_extract_lane(v, l) simde_wasm_f64x2_extract_lane(v, 1-(l))\n#define v128_i8x16_replace_lane(v, l, x) simde_wasm_i8x16_replace_lane(v, 15-(l), x)\n#define v128_u8x16_replace_lane(v, l, x) simde_wasm_u8x16_replace_lane(v, 15-(l), x)\n#define v128_i16x8_replace_lane(v, l, x) simde_wasm_i16x8_replace_lane(v, 7-(l), x)\n#define v128_u16x8_replace_lane(v, l, x) simde_wasm_u16x8_replace_lane(v, 7-(l), x)\n#define v128_i32x4_replace_lane(v, l, x) simde_wasm_i32x4_replace_lane(v, 3-(l), x)\n#define v128_i64x2_replace_lane(v, l, x) simde_wasm_i64x2_replace_lane(v, 1-(l), x)\n#define v128_f32x4_replace_lane(v, l, x) simde_wasm_f32x4_replace_lane(v, 3-(l), x)\n#define v128_f64x2_replace_lane(v, l, x) simde_wasm_f64x2_replace_lane(v, 1-(l), x)\n#define v128_i8x16_bitmask(v) simde_wasm_i8x16_bitmask(simde_wasm_i8x16_swizzle(v, simde_wasm_i8x16_const(15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)))\n#define v128_i16x8_bitmask(v) simde_wasm_i16x8_bitmask(simde_wasm_i8x16_swizzle(v, simde_wasm_i8x16_const(14,15,12,13,10,11,8,9,6,7,4,5,2,3,0,1)))\n#define v128_i32x4_bitmask(v) simde_wasm_i32x4_bitmask(simde_wasm_i8x16_swizzle(v, simde_wasm_i8x16_const(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3)))\n#define v128_i64x2_bitmask(v) simde_wasm_i64x2_bitmask(simde_wasm_i8x16_swizzle(v, simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)))\n#define v128_i8x16_swizzle(v1, v2) simde_wasm_i8x16_swizzle(v1, simde_wasm_v128_xor(v2, simde_wasm_i8x16_splat(15)))\n#define v128_i8x16_shuffle(v1,v2,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) simde_wasm_i8x16_shuffle(v2,v1,31-(p),31-(o),31-(n),31-(m),31-(l),31-(k),31-(j),31-(i),31-(h),31-(g),31-(f),31-(e),31-(d),31-(c),31-(b),31-(a))\n#define v128_i16x8_extmul_high_i8x16 simde_wasm_i16x8_extmul_low_i8x16\n#define v128_u16x8_extmul_high_u8x16 simde_wasm_u16x8_extmul_low_u8x16\n#define v128_i16x8_extmul_low_i8x16  simde_wasm_i16x8_extmul_high_i8x16\n#define v128_u16x8_extmul_low_u8x16  simde_wasm_u16x8_extmul_high_u8x16\n#define v128_i32x4_extmul_high_i16x8 simde_wasm_i32x4_extmul_low_i16x8\n#define v128_u32x4_extmul_high_u16x8 simde_wasm_u32x4_extmul_low_u16x8\n#define v128_i32x4_extmul_low_i16x8  simde_wasm_i32x4_extmul_high_i16x8\n#define v128_u32x4_extmul_low_u16x8  simde_wasm_u32x4_extmul_high_u16x8\n#define v128_i64x2_extmul_high_i32x4 simde_wasm_i64x2_extmul_low_i32x4\n#define v128_u64x2_extmul_high_u32x4 simde_wasm_u64x2_extmul_low_u32x4\n#define v128_i64x2_extmul_low_i32x4  simde_wasm_i64x2_extmul_high_i32x4\n#define v128_u64x2_extmul_low_u32x4  simde_wasm_u64x2_extmul_high_u32x4\n#define v128_i16x8_extend_high_i8x16 simde_wasm_i16x8_extend_low_i8x16\n#define v128_u16x8_extend_high_u8x16 simde_wasm_u16x8_extend_low_u8x16\n#define v128_i16x8_extend_low_i8x16  simde_wasm_i16x8_extend_high_i8x16\n#define v128_u16x8_extend_low_u8x16  simde_wasm_u16x8_extend_high_u8x16\n#define v128_i32x4_extend_high_i16x8 simde_wasm_i32x4_extend_low_i16x8\n#define v128_u32x4_extend_high_u16x8 simde_wasm_u32x4_extend_low_u16x8\n#define v128_i32x4_extend_low_i16x8  simde_wasm_i32x4_extend_high_i16x8\n#define v128_u32x4_extend_low_u16x8  simde_wasm_u32x4_extend_high_u16x8\n#define v128_i64x2_extend_high_i32x4 simde_wasm_i64x2_extend_low_i32x4\n#define v128_u64x2_extend_high_u32x4 simde_wasm_u64x2_extend_low_u32x4\n#define v128_i64x2_extend_low_i32x4  simde_wasm_i64x2_extend_high_i32x4\n#define v128_u64x2_extend_low_u32x4  simde_wasm_u64x2_extend_high_u32x4\n#define v128_i32x4_trunc_sat_f64x2_zero(a)      \\\n  simde_wasm_i8x16_swizzle(                     \\\n      simde_wasm_i32x4_trunc_sat_f64x2_zero(a), \\\n      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7))\n#define v128_u32x4_trunc_sat_f64x2_zero(a)      \\\n  simde_wasm_i8x16_swizzle(                     \\\n      simde_wasm_u32x4_trunc_sat_f64x2_zero(a), \\\n      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7))\n#define v128_i16x8_narrow_i32x4(a,b) simde_wasm_i16x8_narrow_i32x4(b,a)\n#define v128_u16x8_narrow_i32x4(a,b) simde_wasm_u16x8_narrow_i32x4(b,a)\n#define v128_i8x16_narrow_i16x8(a,b) simde_wasm_i8x16_narrow_i16x8(b,a)\n#define v128_u8x16_narrow_i16x8(a,b) simde_wasm_u8x16_narrow_i16x8(b,a)\n#define v128_f64x2_promote_low_f32x4(a)                        \\\n  simde_wasm_f64x2_promote_low_f32x4(simde_wasm_i8x16_swizzle( \\\n      a,                                                       \\\n      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)))\n#define v128_f32x4_demote_f64x2_zero(a)      \\\n  simde_wasm_i8x16_swizzle(                  \\\n      simde_wasm_f32x4_demote_f64x2_zero(a), \\\n      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7))\n#define v128_f64x2_convert_low_i32x4(a)                        \\\n  simde_wasm_f64x2_convert_low_i32x4(simde_wasm_i8x16_swizzle( \\\n      a,                                                       \\\n      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)))\n#define v128_f64x2_convert_low_u32x4(a)                        \\\n  simde_wasm_f64x2_convert_low_u32x4(simde_wasm_i8x16_swizzle( \\\n      a,                                                       \\\n      simde_wasm_i8x16_const(8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)))\n#else\n#define v128_const simde_wasm_i8x16_const\n#define v128_i8x16_extract_lane simde_wasm_i8x16_extract_lane\n#define v128_u8x16_extract_lane simde_wasm_u8x16_extract_lane\n#define v128_i16x8_extract_lane simde_wasm_i16x8_extract_lane\n#define v128_u16x8_extract_lane simde_wasm_u16x8_extract_lane\n#define v128_i32x4_extract_lane simde_wasm_i32x4_extract_lane\n#define v128_i64x2_extract_lane simde_wasm_i64x2_extract_lane\n#define v128_f32x4_extract_lane simde_wasm_f32x4_extract_lane\n#define v128_f64x2_extract_lane simde_wasm_f64x2_extract_lane\n#define v128_i8x16_replace_lane simde_wasm_i8x16_replace_lane\n#define v128_u8x16_replace_lane simde_wasm_u8x16_replace_lane\n#define v128_i16x8_replace_lane simde_wasm_i16x8_replace_lane\n#define v128_u16x8_replace_lane simde_wasm_u16x8_replace_lane\n#define v128_i32x4_replace_lane simde_wasm_i32x4_replace_lane\n#define v128_i64x2_replace_lane simde_wasm_i64x2_replace_lane\n#define v128_f32x4_replace_lane simde_wasm_f32x4_replace_lane\n#define v128_f64x2_replace_lane simde_wasm_f64x2_replace_lane\n#define v128_i8x16_bitmask simde_wasm_i8x16_bitmask\n#define v128_i16x8_bitmask simde_wasm_i16x8_bitmask\n#define v128_i32x4_bitmask simde_wasm_i32x4_bitmask\n#define v128_i64x2_bitmask simde_wasm_i64x2_bitmask\n#define v128_i8x16_swizzle simde_wasm_i8x16_swizzle\n#define v128_i8x16_shuffle simde_wasm_i8x16_shuffle\n#define v128_i16x8_extmul_high_i8x16 simde_wasm_i16x8_extmul_high_i8x16\n#define v128_u16x8_extmul_high_u8x16 simde_wasm_u16x8_extmul_high_u8x16\n#define v128_i16x8_extmul_low_i8x16  simde_wasm_i16x8_extmul_low_i8x16\n#define v128_u16x8_extmul_low_u8x16  simde_wasm_u16x8_extmul_low_u8x16\n#define v128_i32x4_extmul_high_i16x8 simde_wasm_i32x4_extmul_high_i16x8\n#define v128_u32x4_extmul_high_u16x8 simde_wasm_u32x4_extmul_high_u16x8\n#define v128_i32x4_extmul_low_i16x8  simde_wasm_i32x4_extmul_low_i16x8\n#define v128_u32x4_extmul_low_u16x8  simde_wasm_u32x4_extmul_low_u16x8\n#define v128_i64x2_extmul_high_i32x4 simde_wasm_i64x2_extmul_high_i32x4\n#define v128_u64x2_extmul_high_u32x4 simde_wasm_u64x2_extmul_high_u32x4\n#define v128_i64x2_extmul_low_i32x4  simde_wasm_i64x2_extmul_low_i32x4\n#define v128_u64x2_extmul_low_u32x4  simde_wasm_u64x2_extmul_low_u32x4\n#define v128_i16x8_extend_high_i8x16 simde_wasm_i16x8_extend_high_i8x16\n#define v128_u16x8_extend_high_u8x16 simde_wasm_u16x8_extend_high_u8x16\n#define v128_i16x8_extend_low_i8x16  simde_wasm_i16x8_extend_low_i8x16\n#define v128_u16x8_extend_low_u8x16  simde_wasm_u16x8_extend_low_u8x16\n#define v128_i32x4_extend_high_i16x8 simde_wasm_i32x4_extend_high_i16x8\n#define v128_u32x4_extend_high_u16x8 simde_wasm_u32x4_extend_high_u16x8\n#define v128_i32x4_extend_low_i16x8  simde_wasm_i32x4_extend_low_i16x8\n#define v128_u32x4_extend_low_u16x8  simde_wasm_u32x4_extend_low_u16x8\n#define v128_i64x2_extend_high_i32x4 simde_wasm_i64x2_extend_high_i32x4\n#define v128_u64x2_extend_high_u32x4 simde_wasm_u64x2_extend_high_u32x4\n#define v128_i64x2_extend_low_i32x4  simde_wasm_i64x2_extend_low_i32x4\n#define v128_u64x2_extend_low_u32x4  simde_wasm_u64x2_extend_low_u32x4\n#define v128_i32x4_trunc_sat_f64x2_zero simde_wasm_i32x4_trunc_sat_f64x2_zero\n#define v128_u32x4_trunc_sat_f64x2_zero simde_wasm_u32x4_trunc_sat_f64x2_zero\n#define v128_i16x8_narrow_i32x4 simde_wasm_i16x8_narrow_i32x4\n#define v128_u16x8_narrow_i32x4 simde_wasm_u16x8_narrow_i32x4\n#define v128_i8x16_narrow_i16x8 simde_wasm_i8x16_narrow_i16x8\n#define v128_u8x16_narrow_i16x8 simde_wasm_u8x16_narrow_i16x8\n#define v128_f64x2_promote_low_f32x4 simde_wasm_f64x2_promote_low_f32x4\n#define v128_f32x4_demote_f64x2_zero simde_wasm_f32x4_demote_f64x2_zero\n#define v128_f64x2_convert_low_i32x4 simde_wasm_f64x2_convert_low_i32x4\n#define v128_f64x2_convert_low_u32x4 simde_wasm_f64x2_convert_low_u32x4\n#endif\n// clang-format on\n"
  },
  {
    "path": "src/test-binary-reader.cc",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"gtest/gtest.h\"\n\n#include \"wabt/binary-reader-nop.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/leb128.h\"\n#include \"wabt/opcode.h\"\n\nusing namespace wabt;\n\nnamespace {\n\nstruct BinaryReaderError : BinaryReaderNop {\n  bool OnError(const Error& error) override {\n    first_error = error;\n    return true;  // Error handled.\n  }\n\n  Error first_error;\n};\n\n}  // End of anonymous namespace\n\nTEST(BinaryReader, DisabledOpcodes) {\n  // Use the default features.\n  ReadBinaryOptions options;\n\n  // Loop through all opcodes.\n  for (uint32_t i = 0; i < static_cast<uint32_t>(Opcode::Invalid); ++i) {\n    Opcode opcode(static_cast<Opcode::Enum>(i));\n    if (opcode.IsEnabled(options.features)) {\n      continue;\n    }\n\n    // Use a shorter name to make the clang-formatted table below look nicer.\n    std::vector<uint8_t> b = opcode.GetBytes();\n    assert(b.size() <= 3);\n    b.resize(3);\n\n    uint8_t data[] = {\n        0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,  // magic + version\n        0x01, 0x04, 0x01, 0x60, 0x00, 0x00,  // type section: 1 type, (func)\n        0x03, 0x02, 0x01, 0x00,              // func section: 1 func, type 0\n        0x0a, 0x07, 0x01, 0x05, 0x00,        // code section: 1 func, 0 locals\n        b[0], b[1], b[2],  // The instruction, padded with zeroes\n        0x0b,              // end\n    };\n    const size_t size = sizeof(data);\n\n    BinaryReaderError reader;\n    Result result = ReadBinary(data, size, &reader, options);\n    EXPECT_EQ(Result::Error, result);\n\n    // This relies on the binary reader checking whether the opcode is allowed\n    // before reading any further data needed by the instruction.\n    const std::string& message = reader.first_error.message;\n    EXPECT_EQ(0u, message.find(\"unexpected opcode\"))\n        << \"Got error message: \" << message;\n  }\n}\n\nTEST(BinaryReader, InvalidFunctionBodySize) {\n  // A wasm module where the function body size extends past the end of the\n  // code section.  Without the bounds check this would allow the binary reader\n  // to read past the section boundary.\n  // TODO: Move this test upstream into the spec repo.\n\n  uint8_t data[] = {\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,  // magic + version\n      0x01, 0x04, 0x01, 0x60, 0x00, 0x00,  // type section: 1 type, (func)\n      0x03, 0x02, 0x01, 0x00,              // func section: 1 func, type 0\n      // Code section: 1 func, but body_size claims 0xFF bytes\n      0x0a, 0x04,  // code section, size=4\n      0x01,        // 1 function body\n      0xff, 0x01,  // body size = 255 (LEB128), far exceeds section\n      0x00,        // would be local decl count, but body_size is invalid\n  };\n\n  BinaryReaderError reader;\n  ReadBinaryOptions options;\n  Result result = ReadBinary(data, sizeof(data), &reader, options);\n  EXPECT_EQ(Result::Error, result);\n  EXPECT_NE(std::string::npos,\n            reader.first_error.message.find(\"invalid function body size\"))\n      << \"Got: \" << reader.first_error.message;\n}\n\nTEST(BinaryReader, OversizedSectionSize) {\n  // A module whose section size extends past the end of the data.  The\n  // subtraction-based overflow check must reject this before computing\n  // read_end_ = offset + section_size, which would overflow on platforms\n  // where size_t is 32-bit.\n  // TODO: Move this test upstream into the spec repo.\n\n  uint8_t data[] = {\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,  // magic + version\n      0x01,                                            // section code: Type\n      0x80, 0x80, 0x80, 0x80, 0x08,  // section size: 0x80000000 (LEB128)\n  };\n\n  BinaryReaderError reader;\n  ReadBinaryOptions options;\n  Result result = ReadBinary(data, sizeof(data), &reader, options);\n  EXPECT_EQ(Result::Error, result);\n  EXPECT_NE(std::string::npos,\n            reader.first_error.message.find(\"invalid section size\"))\n      << \"Got: \" << reader.first_error.message;\n}\n\nTEST(BinaryReader, OversizedSubsectionSize) {\n  // A module with a name section containing a subsection whose size extends\n  // past the section boundary.\n  // TODO: Move this test upstream into the spec repo.\n\n  uint8_t data[] = {\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,  // magic + version\n      // Custom section (name section)\n      0x00,  // section code: custom\n      0x09,  // section size: 9 bytes\n      0x04,  // name length\n      'n', 'a', 'm', 'e',\n      0x01,              // subsection type: function names\n      0x80, 0x80, 0x04,  // subsection size: 65536 (LEB128), exceeds section\n  };\n\n  BinaryReaderError reader;\n  ReadBinaryOptions options;\n  Result result = ReadBinary(data, sizeof(data), &reader, options);\n  // Custom section errors are not fatal by default, but ensure no crash.\n  (void)result;\n}\n"
  },
  {
    "path": "src/test-filenames.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"gtest/gtest.h\"\n\n#include \"wabt/filenames.h\"\n\nusing namespace wabt;\n\nnamespace {\n\nvoid assert_string_view_eq(const char* s, std::string_view sv) {\n  size_t len = std::strlen(s);\n  ASSERT_EQ(len, sv.size());\n  for (size_t i = 0; i < len; ++i) {\n    ASSERT_EQ(s[i], sv[i]);\n  }\n}\n\n}  // end anonymous namespace\n\nTEST(filenames, GetBasename) {\n  assert_string_view_eq(\"foo.txt\", GetBasename(\"/bar/dir/foo.txt\"));\n  assert_string_view_eq(\"foo.txt\", GetBasename(\"bar/dir/foo.txt\"));\n  assert_string_view_eq(\"foo.txt\", GetBasename(\"/foo.txt\"));\n  assert_string_view_eq(\"foo.txt\", GetBasename(\"\\\\bar\\\\dir\\\\foo.txt\"));\n  assert_string_view_eq(\"foo.txt\", GetBasename(\"bar\\\\dir\\\\foo.txt\"));\n  assert_string_view_eq(\"foo.txt\", GetBasename(\"\\\\foo.txt\"));\n  assert_string_view_eq(\"foo.txt\", GetBasename(\"foo.txt\"));\n  assert_string_view_eq(\"foo\", GetBasename(\"foo\"));\n  assert_string_view_eq(\"\", GetBasename(\"\"));\n}\n\nTEST(filenames, GetExtension) {\n  assert_string_view_eq(\".txt\", GetExtension(\"/bar/dir/foo.txt\"));\n  assert_string_view_eq(\".txt\", GetExtension(\"bar/dir/foo.txt\"));\n  assert_string_view_eq(\".txt\", GetExtension(\"foo.txt\"));\n  assert_string_view_eq(\"\", GetExtension(\"foo\"));\n  assert_string_view_eq(\"\", GetExtension(\"\"));\n}\n\nTEST(filenames, StripExtension) {\n  assert_string_view_eq(\"/bar/dir/foo\", StripExtension(\"/bar/dir/foo.txt\"));\n  assert_string_view_eq(\"bar/dir/foo\", StripExtension(\"bar/dir/foo.txt\"));\n  assert_string_view_eq(\"foo\", StripExtension(\"foo.txt\"));\n  assert_string_view_eq(\"foo\", StripExtension(\"foo\"));\n  assert_string_view_eq(\"\", StripExtension(\"\"));\n}\n"
  },
  {
    "path": "src/test-hexfloat.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cstdio>\n#include <thread>\n#include <vector>\n\n#include \"gtest/gtest.h\"\n\n#include \"wabt/literal.h\"\n\n#define FOREACH_UINT32_MULTIPLIER 1\n\n#define FOREACH_UINT32(bits) \\\n  uint32_t last_bits = 0;    \\\n  uint32_t bits = shard;     \\\n  int last_top_byte = -1;    \\\n  for (; bits >= last_bits;  \\\n       last_bits = bits, bits += num_threads_ * FOREACH_UINT32_MULTIPLIER)\n\n#define LOG_COMPLETION(bits)                                                  \\\n  if (shard == 0) {                                                           \\\n    int top_byte = bits >> 24;                                                \\\n    if (top_byte != last_top_byte) {                                          \\\n      printf(\"value: 0x%08x (%d%%)\\r\", bits,                                  \\\n             static_cast<int>(static_cast<double>(bits) * 100 / UINT32_MAX)); \\\n      fflush(stdout);                                                         \\\n      last_top_byte = top_byte;                                               \\\n    }                                                                         \\\n  }\n\n#define LOG_DONE()     \\\n  if (shard == 0) {    \\\n    printf(\"done.\\n\"); \\\n    fflush(stdout);    \\\n  }\n\nusing namespace wabt;\n\ntemplate <typename T, typename F>\nT bit_cast(F value) {\n  T result;\n  memcpy(&result, &value, sizeof(result));\n  return result;\n}\n\nstatic bool is_infinity_or_nan(uint32_t float_bits) {\n  return ((float_bits >> 23) & 0xff) == 0xff;\n}\n\nstatic bool is_infinity_or_nan(uint64_t double_bits) {\n  return ((double_bits >> 52) & 0x7ff) == 0x7ff;\n}\n\nclass ThreadedTest : public ::testing::Test {\n protected:\n  static constexpr int kDefaultNumThreads = 2;\n\n  virtual void SetUp() {\n    num_threads_ = std::thread::hardware_concurrency();\n    if (num_threads_ == 0)\n      num_threads_ = kDefaultNumThreads;\n  }\n\n  virtual void RunShard(int shard) = 0;\n\n  void RunThreads() {\n    std::vector<std::thread> threads;\n\n    for (int i = 0; i < num_threads_; ++i) {\n      threads.emplace_back(&ThreadedTest::RunShard, this, i);\n    }\n\n    for (std::thread& thread : threads) {\n      thread.join();\n    }\n  }\n\n  int num_threads_;\n};\n\n/* floats */\nclass AllFloatsParseTest : public ThreadedTest {\n protected:\n  virtual void RunShard(int shard) {\n    char buffer[100];\n    FOREACH_UINT32(bits) {\n      LOG_COMPLETION(bits);\n      if (is_infinity_or_nan(bits))\n        continue;\n\n      float value = bit_cast<float>(bits);\n      int len = snprintf(buffer, sizeof(buffer), \"%a\", value);\n\n      uint32_t me;\n      ASSERT_EQ(Result::Ok,\n                ParseFloat(LiteralType::Hexfloat, buffer, buffer + len, &me));\n      ASSERT_EQ(me, bits);\n    }\n    LOG_DONE();\n  }\n};\n\nTEST_F(AllFloatsParseTest, Run) {\n  RunThreads();\n}\n\nclass AllFloatsWriteTest : public ThreadedTest {\n protected:\n  virtual void RunShard(int shard) {\n    char buffer[100];\n    FOREACH_UINT32(bits) {\n      LOG_COMPLETION(bits);\n      if (is_infinity_or_nan(bits))\n        continue;\n\n      WriteFloatHex(buffer, sizeof(buffer), bits);\n\n      char* endptr;\n      float them_float = strtof(buffer, &endptr);\n      uint32_t them_bits = bit_cast<uint32_t>(them_float);\n      ASSERT_EQ(bits, them_bits);\n    }\n    LOG_DONE();\n  }\n};\n\nTEST_F(AllFloatsWriteTest, Run) {\n  RunThreads();\n}\n\nclass AllFloatsRoundtripTest : public ThreadedTest {\n protected:\n  static LiteralType ClassifyFloat(uint32_t float_bits) {\n    if (is_infinity_or_nan(float_bits)) {\n      if (float_bits & 0x7fffff) {\n        return LiteralType::Nan;\n      } else {\n        return LiteralType::Infinity;\n      }\n    } else {\n      return LiteralType::Hexfloat;\n    }\n  }\n\n  virtual void RunShard(int shard) {\n    char buffer[100];\n    FOREACH_UINT32(bits) {\n      LOG_COMPLETION(bits);\n      WriteFloatHex(buffer, sizeof(buffer), bits);\n      int len = strlen(buffer);\n\n      uint32_t new_bits;\n      ASSERT_EQ(Result::Ok, ParseFloat(ClassifyFloat(bits), buffer,\n                                       buffer + len, &new_bits));\n      ASSERT_EQ(new_bits, bits);\n    }\n    LOG_DONE();\n  }\n};\n\nTEST_F(AllFloatsRoundtripTest, Run) {\n  RunThreads();\n}\n\n/* doubles */\nclass ManyDoublesParseTest : public ThreadedTest {\n protected:\n  virtual void RunShard(int shard) {\n    char buffer[100];\n    FOREACH_UINT32(halfbits) {\n      LOG_COMPLETION(halfbits);\n      uint64_t bits = (static_cast<uint64_t>(halfbits) << 32) | halfbits;\n      if (is_infinity_or_nan(bits))\n        continue;\n\n      double value = bit_cast<double>(bits);\n      int len = snprintf(buffer, sizeof(buffer), \"%a\", value);\n\n      uint64_t me;\n      ASSERT_EQ(Result::Ok,\n                ParseDouble(LiteralType::Hexfloat, buffer, buffer + len, &me));\n      ASSERT_EQ(me, bits);\n    }\n    LOG_DONE();\n  }\n};\n\nTEST_F(ManyDoublesParseTest, Run) {\n  RunThreads();\n}\n\nclass ManyDoublesWriteTest : public ThreadedTest {\n protected:\n  virtual void RunShard(int shard) {\n    char buffer[100];\n    FOREACH_UINT32(halfbits) {\n      LOG_COMPLETION(halfbits);\n      uint64_t bits = (static_cast<uint64_t>(halfbits) << 32) | halfbits;\n      if (is_infinity_or_nan(bits))\n        continue;\n\n      WriteDoubleHex(buffer, sizeof(buffer), bits);\n\n      char* endptr;\n      double them_double = strtod(buffer, &endptr);\n      uint64_t them_bits = bit_cast<uint64_t>(them_double);\n      ASSERT_EQ(bits, them_bits);\n    }\n    LOG_DONE();\n  }\n};\n\nTEST_F(ManyDoublesWriteTest, Run) {\n  RunThreads();\n}\n\nclass ManyDoublesRoundtripTest : public ThreadedTest {\n protected:\n  static LiteralType ClassifyDouble(uint64_t double_bits) {\n    if (is_infinity_or_nan(double_bits)) {\n      if (double_bits & 0xfffffffffffffULL) {\n        return LiteralType::Nan;\n      } else {\n        return LiteralType::Infinity;\n      }\n    } else {\n      return LiteralType::Hexfloat;\n    }\n  }\n\n  virtual void RunShard(int shard) {\n    char buffer[100];\n    FOREACH_UINT32(halfbits) {\n      LOG_COMPLETION(halfbits);\n      uint64_t bits = (static_cast<uint64_t>(halfbits) << 32) | halfbits;\n      WriteDoubleHex(buffer, sizeof(buffer), bits);\n      int len = strlen(buffer);\n\n      uint64_t new_bits;\n      ASSERT_EQ(Result::Ok, ParseDouble(ClassifyDouble(bits), buffer,\n                                        buffer + len, &new_bits));\n      ASSERT_EQ(new_bits, bits);\n    }\n    LOG_DONE();\n  }\n};\n\nTEST_F(ManyDoublesRoundtripTest, Run) {\n  RunThreads();\n}\n"
  },
  {
    "path": "src/test-interp.cc",
    "content": "/*\n * Copyright 2020 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"gtest/gtest.h\"\n\n#include \"wabt/binary-reader.h\"\n#include \"wabt/error-formatter.h\"\n\n#include \"wabt/interp/binary-reader-interp.h\"\n#include \"wabt/interp/interp.h\"\n\nusing namespace wabt;\nusing namespace wabt::interp;\n\nclass InterpTest : public ::testing::Test {\n public:\n  void ReadModule(const std::vector<u8>& data) {\n    Errors errors;\n    ReadBinaryOptions options;\n    Result result = ReadBinaryInterp(\"<internal>\", data.data(), data.size(),\n                                     options, &errors, &module_desc_);\n    ASSERT_EQ(Result::Ok, result)\n        << FormatErrorsToString(errors, Location::Type::Binary);\n  }\n\n  void Instantiate(const RefVec& imports = RefVec{}) {\n    mod_ = Module::New(store_, module_desc_);\n    RefPtr<Trap> trap;\n    inst_ = Instance::Instantiate(store_, mod_.ref(), imports, &trap);\n    ASSERT_TRUE(inst_) << trap->message();\n  }\n\n  DefinedFunc::Ptr GetFuncExport(interp::Index index) {\n    EXPECT_LT(index, inst_->exports().size());\n    return store_.UnsafeGet<DefinedFunc>(inst_->exports()[index]);\n  }\n\n  void ExpectBufferStrEq(OutputBuffer& buf, const char* str) {\n    std::string buf_str(buf.data.begin(), buf.data.end());\n    EXPECT_STREQ(buf_str.c_str(), str);\n  }\n\n  Store store_;\n  ModuleDesc module_desc_;\n  Module::Ptr mod_;\n  Instance::Ptr inst_;\n};\n\nTEST_F(InterpTest, Empty) {\n  ASSERT_TRUE(mod_.empty());\n  ReadModule({0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00});\n  Instantiate();\n  ASSERT_FALSE(mod_.empty());\n}\n\nTEST_F(InterpTest, MVP) {\n  // (module\n  //   (type (;0;) (func (param i32) (result i32)))\n  //   (type (;1;) (func (param f32) (result f32)))\n  //   (type (;2;) (func))\n  //   (import \"foo\" \"bar\" (func (;0;) (type 0)))\n  //   (func (;1;) (type 1) (param f32) (result f32)\n  //     (f32.const 0x1.5p+5 (;=42;)))\n  //   (func (;2;) (type 2))\n  //   (table (;0;) 1 2 funcref)\n  //   (memory (;0;) 1)\n  //   (global (;0;) i32 (i32.const 1))\n  //   (export \"quux\" (func 1))\n  //   (start 2)\n  //   (elem (;0;) (i32.const 0) 0 1)\n  //   (data (;0;) (i32.const 2) \"hello\"))\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x03, 0x60,\n      0x01, 0x7f, 0x01, 0x7f, 0x60, 0x01, 0x7d, 0x01, 0x7d, 0x60, 0x00, 0x00,\n      0x02, 0x0b, 0x01, 0x03, 0x66, 0x6f, 0x6f, 0x03, 0x62, 0x61, 0x72, 0x00,\n      0x00, 0x03, 0x03, 0x02, 0x01, 0x02, 0x04, 0x05, 0x01, 0x70, 0x01, 0x01,\n      0x02, 0x05, 0x03, 0x01, 0x00, 0x01, 0x06, 0x06, 0x01, 0x7f, 0x00, 0x41,\n      0x01, 0x0b, 0x07, 0x08, 0x01, 0x04, 0x71, 0x75, 0x75, 0x78, 0x00, 0x01,\n      0x08, 0x01, 0x02, 0x09, 0x08, 0x01, 0x00, 0x41, 0x00, 0x0b, 0x02, 0x00,\n      0x01, 0x0a, 0x0c, 0x02, 0x07, 0x00, 0x43, 0x00, 0x00, 0x28, 0x42, 0x0b,\n      0x02, 0x00, 0x0b, 0x0b, 0x0b, 0x01, 0x00, 0x41, 0x02, 0x0b, 0x05, 0x68,\n      0x65, 0x6c, 0x6c, 0x6f,\n  });\n\n  EXPECT_EQ(3u, module_desc_.func_types.size());\n  EXPECT_EQ(1u, module_desc_.imports.size());\n  EXPECT_EQ(2u, module_desc_.funcs.size());\n  EXPECT_EQ(1u, module_desc_.tables.size());\n  EXPECT_EQ(1u, module_desc_.memories.size());\n  EXPECT_EQ(1u, module_desc_.globals.size());\n  EXPECT_EQ(0u, module_desc_.tags.size());\n  EXPECT_EQ(1u, module_desc_.exports.size());\n  EXPECT_EQ(1u, module_desc_.starts.size());\n  EXPECT_EQ(1u, module_desc_.elems.size());\n  EXPECT_EQ(1u, module_desc_.datas.size());\n}\n\nnamespace {\n\n// (func (export \"fac\") (param $n i32) (result i32)\n//   (local $result i32)\n//   (local.set $result (i32.const 1))\n//   (loop (result i32)\n//     (local.set $result\n//       (i32.mul\n//         (br_if 1 (local.get $result) (i32.eqz (local.get $n)))\n//         (local.get $n)))\n//     (local.set $n (i32.sub (local.get $n) (i32.const 1)))\n//     (br 0)))\nconst std::vector<u8> s_fac_module = {\n    0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01,\n    0x60, 0x01, 0x7f, 0x01, 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, 0x07,\n    0x01, 0x03, 0x66, 0x61, 0x63, 0x00, 0x00, 0x0a, 0x22, 0x01, 0x20,\n    0x01, 0x01, 0x7f, 0x41, 0x01, 0x21, 0x01, 0x03, 0x7f, 0x20, 0x01,\n    0x20, 0x00, 0x45, 0x0d, 0x01, 0x20, 0x00, 0x6c, 0x21, 0x01, 0x20,\n    0x00, 0x41, 0x01, 0x6b, 0x21, 0x00, 0x0c, 0x00, 0x0b, 0x0b,\n};\n\n}  // namespace\n\nTEST_F(InterpTest, Disassemble) {\n  ReadModule(s_fac_module);\n\n  MemoryStream stream;\n  module_desc_.istream.Disassemble(&stream);\n  auto buf = stream.ReleaseOutputBuffer();\n\n  ExpectBufferStrEq(*buf,\nR\"(   0| alloca 1\n   8| i32.const 1\n  16| local.set $2, %[-1]\n  24| local.get $1\n  32| local.get $3\n  40| i32.eqz %[-1]\n  44| br_unless @60, %[-1]\n  52| br @116\n  60| local.get $3\n  68| i32.mul %[-2], %[-1]\n  72| local.set $2, %[-1]\n  80| local.get $2\n  88| i32.const 1\n  96| i32.sub %[-2], %[-1]\n 100| local.set $3, %[-1]\n 108| br @24\n 116| drop_keep $2 $1\n 128| return\n)\");\n}\n\nTEST_F(InterpTest, Fac) {\n  ReadModule(s_fac_module);\n  Instantiate();\n  auto func = GetFuncExport(0);\n\n  Values results;\n  Trap::Ptr trap;\n  Result result = func->Call(store_, {Value::Make(5)}, results, &trap);\n\n  ASSERT_EQ(Result::Ok, result);\n  EXPECT_EQ(1u, results.size());\n  EXPECT_EQ(120u, results[0].Get<u32>());\n}\n\nTEST_F(InterpTest, Fac_Trace) {\n  ReadModule(s_fac_module);\n  Instantiate();\n  auto func = GetFuncExport(0);\n\n  Values results;\n  Trap::Ptr trap;\n  MemoryStream stream;\n  Result result = func->Call(store_, {Value::Make(2)}, results, &trap, &stream);\n  ASSERT_EQ(Result::Ok, result);\n\n  auto buf = stream.ReleaseOutputBuffer();\n  ExpectBufferStrEq(*buf,\nR\"(#0.    0: V:1  | alloca 1\n#0.    8: V:2  | i32.const 1\n#0.   16: V:3  | local.set $2, 1\n#0.   24: V:2  | local.get $1\n#0.   32: V:3  | local.get $3\n#0.   40: V:4  | i32.eqz 2\n#0.   44: V:4  | br_unless @60, 0\n#0.   60: V:3  | local.get $3\n#0.   68: V:4  | i32.mul 1, 2\n#0.   72: V:3  | local.set $2, 2\n#0.   80: V:2  | local.get $2\n#0.   88: V:3  | i32.const 1\n#0.   96: V:4  | i32.sub 2, 1\n#0.  100: V:3  | local.set $3, 1\n#0.  108: V:2  | br @24\n#0.   24: V:2  | local.get $1\n#0.   32: V:3  | local.get $3\n#0.   40: V:4  | i32.eqz 1\n#0.   44: V:4  | br_unless @60, 0\n#0.   60: V:3  | local.get $3\n#0.   68: V:4  | i32.mul 2, 1\n#0.   72: V:3  | local.set $2, 2\n#0.   80: V:2  | local.get $2\n#0.   88: V:3  | i32.const 1\n#0.   96: V:4  | i32.sub 1, 1\n#0.  100: V:3  | local.set $3, 0\n#0.  108: V:2  | br @24\n#0.   24: V:2  | local.get $1\n#0.   32: V:3  | local.get $3\n#0.   40: V:4  | i32.eqz 0\n#0.   44: V:4  | br_unless @60, 1\n#0.   52: V:3  | br @116\n#0.  116: V:3  | drop_keep $2 $1\n#0.  128: V:1  | return\n)\");\n}\n\nTEST_F(InterpTest, Local_Trace) {\n  // (func (export \"a\")\n  //   (local i32 i64 f32 f64)\n  //   (local.set 0 (i32.const 0))\n  //   (local.set 1 (i64.const 1))\n  //   (local.set 2 (f32.const 2))\n  //   (local.set 3 (f64.const 3)))\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01,\n      0x60, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0x07, 0x05, 0x01, 0x01,\n      0x61, 0x00, 0x00, 0x0a, 0x26, 0x01, 0x24, 0x04, 0x01, 0x7f, 0x01,\n      0x7e, 0x01, 0x7d, 0x01, 0x7c, 0x41, 0x00, 0x21, 0x00, 0x42, 0x01,\n      0x21, 0x01, 0x43, 0x00, 0x00, 0x00, 0x40, 0x21, 0x02, 0x44, 0x00,\n      0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x21, 0x03, 0x0b,\n  });\n\n  Instantiate();\n  auto func = GetFuncExport(0);\n\n  Values results;\n  Trap::Ptr trap;\n  MemoryStream stream;\n  Result result = func->Call(store_, {}, results, &trap, &stream);\n  ASSERT_EQ(Result::Ok, result);\n\n  auto buf = stream.ReleaseOutputBuffer();\n  ExpectBufferStrEq(*buf,\nR\"(#0.    0: V:0  | alloca 4\n#0.    8: V:4  | i32.const 0\n#0.   16: V:5  | local.set $5, 0\n#0.   24: V:4  | i64.const 1\n#0.   36: V:5  | local.set $4, 1\n#0.   44: V:4  | f32.const 2\n#0.   52: V:5  | local.set $3, 2\n#0.   60: V:4  | f64.const 3\n#0.   72: V:5  | local.set $2, 3\n#0.   80: V:4  | drop_keep $4 $0\n#0.   92: V:0  | return\n)\");\n}\n\nTEST_F(InterpTest, HostFunc) {\n  // (import \"\" \"f\" (func $f (param i32) (result i32)))\n  // (func (export \"g\") (result i32)\n  //   (call $f (i32.const 1)))\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x0a,\n      0x02, 0x60, 0x01, 0x7f, 0x01, 0x7f, 0x60, 0x00, 0x01, 0x7f,\n      0x02, 0x06, 0x01, 0x00, 0x01, 0x66, 0x00, 0x00, 0x03, 0x02,\n      0x01, 0x01, 0x07, 0x05, 0x01, 0x01, 0x67, 0x00, 0x01, 0x0a,\n      0x08, 0x01, 0x06, 0x00, 0x41, 0x01, 0x10, 0x00, 0x0b,\n  });\n\n  auto host_func =\n      HostFunc::New(store_, FuncType{{ValueType::I32}, {ValueType::I32}},\n                    [](Thread& thread, const Values& params, Values& results,\n                       Trap::Ptr* out_trap) -> Result {\n                      results[0] = Value::Make(params[0].Get<u32>() + 1);\n                      return Result::Ok;\n                    });\n\n  Instantiate({host_func->self()});\n\n  Values results;\n  Trap::Ptr trap;\n  Result result = GetFuncExport(0)->Call(store_, {}, results, &trap);\n\n  ASSERT_EQ(Result::Ok, result);\n  EXPECT_EQ(1u, results.size());\n  EXPECT_EQ(2u, results[0].Get<u32>());\n}\n\nTEST_F(InterpTest, HostFunc_PingPong) {\n  // (import \"\" \"f\" (func $f (param i32) (result i32)))\n  // (func (export \"g\") (param i32) (result i32)\n  //   (call $f (i32.add (local.get 0) (i32.const 1))))\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60,\n      0x01, 0x7f, 0x01, 0x7f, 0x02, 0x06, 0x01, 0x00, 0x01, 0x66, 0x00, 0x00,\n      0x03, 0x02, 0x01, 0x00, 0x07, 0x05, 0x01, 0x01, 0x67, 0x00, 0x01, 0x0a,\n      0x0b, 0x01, 0x09, 0x00, 0x20, 0x00, 0x41, 0x01, 0x6a, 0x10, 0x00, 0x0b,\n  });\n\n  auto host_func =\n      HostFunc::New(store_, FuncType{{ValueType::I32}, {ValueType::I32}},\n                    [&](Thread& thread, const Values& params, Values& results,\n                        Trap::Ptr* out_trap) -> Result {\n                      auto val = params[0].Get<u32>();\n                      if (val < 10) {\n                        return GetFuncExport(0)->Call(\n                            store_, {Value::Make(val * 2)}, results, out_trap);\n                      }\n                      results[0] = Value::Make(val);\n                      return Result::Ok;\n                    });\n\n  Instantiate({host_func->self()});\n\n  // Should produce the following calls:\n  //  g(1) -> f(2) -> g(4) -> f(5) -> g(10) -> f(11) -> return 11\n\n  Values results;\n  Trap::Ptr trap;\n  Result result =\n      GetFuncExport(0)->Call(store_, {Value::Make(1)}, results, &trap);\n\n  ASSERT_EQ(Result::Ok, result);\n  EXPECT_EQ(1u, results.size());\n  EXPECT_EQ(11u, results[0].Get<u32>());\n}\n\nTEST_F(InterpTest, HostFunc_PingPong_SameThread) {\n  // (import \"\" \"f\" (func $f (param i32) (result i32)))\n  // (func (export \"g\") (param i32) (result i32)\n  //   (call $f (i32.add (local.get 0) (i32.const 1))))\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x60,\n      0x01, 0x7f, 0x01, 0x7f, 0x02, 0x06, 0x01, 0x00, 0x01, 0x66, 0x00, 0x00,\n      0x03, 0x02, 0x01, 0x00, 0x07, 0x05, 0x01, 0x01, 0x67, 0x00, 0x01, 0x0a,\n      0x0b, 0x01, 0x09, 0x00, 0x20, 0x00, 0x41, 0x01, 0x6a, 0x10, 0x00, 0x0b,\n  });\n\n  Thread thread(store_);\n\n  auto host_func =\n      HostFunc::New(store_, FuncType{{ValueType::I32}, {ValueType::I32}},\n                    [&](Thread& t, const Values& params, Values& results,\n                        Trap::Ptr* out_trap) -> Result {\n                      auto val = params[0].Get<u32>();\n                      if (val < 10) {\n                        return GetFuncExport(0)->Call(t, {Value::Make(val * 2)},\n                                                      results, out_trap);\n                      }\n                      results[0] = Value::Make(val);\n                      return Result::Ok;\n                    });\n\n  Instantiate({host_func->self()});\n\n  // Should produce the following calls:\n  //  g(1) -> f(2) -> g(4) -> f(5) -> g(10) -> f(11) -> return 11\n\n  Values results;\n  Trap::Ptr trap;\n  Result result =\n      GetFuncExport(0)->Call(thread, {Value::Make(1)}, results, &trap);\n\n  ASSERT_EQ(Result::Ok, result);\n  EXPECT_EQ(1u, results.size());\n  EXPECT_EQ(11u, results[0].Get<u32>());\n}\n\nTEST_F(InterpTest, HostTrap) {\n  // (import \"host\" \"a\" (func $0))\n  // (func $1 call $0)\n  // (start $1)\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01,\n      0x60, 0x00, 0x00, 0x02, 0x0a, 0x01, 0x04, 0x68, 0x6f, 0x73, 0x74,\n      0x01, 0x61, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0x08, 0x01, 0x01,\n      0x0a, 0x06, 0x01, 0x04, 0x00, 0x10, 0x00, 0x0b,\n  });\n\n  auto host_func =\n      HostFunc::New(store_, FuncType{{}, {}},\n                    [&](Thread& thread, const Values& params, Values& results,\n                        Trap::Ptr* out_trap) -> Result {\n                      *out_trap = Trap::New(store_, \"boom\");\n                      return Result::Error;\n                    });\n\n  mod_ = Module::New(store_, module_desc_);\n  RefPtr<Trap> trap;\n  Instance::Instantiate(store_, mod_.ref(), {host_func->self()}, &trap);\n\n  ASSERT_TRUE(trap);\n  ASSERT_EQ(\"boom\", trap->message());\n}\n\nTEST_F(InterpTest, Rot13) {\n  // (import \"host\" \"mem\" (memory $mem 1))\n  // (import \"host\" \"fill_buf\" (func $fill_buf (param i32 i32) (result i32)))\n  // (import \"host\" \"buf_done\" (func $buf_done (param i32 i32)))\n  //\n  // (func $rot13c (param $c i32) (result i32)\n  //   (local $uc i32)\n  //\n  //   ;; No change if < 'A'.\n  //   (if (i32.lt_u (local.get $c) (i32.const 65))\n  //     (return (local.get $c)))\n  //\n  //   ;; Clear 5th bit of c, to force uppercase. 0xdf = 0b11011111\n  //   (local.set $uc (i32.and (local.get $c) (i32.const 0xdf)))\n  //\n  //   ;; In range ['A', 'M'] return |c| + 13.\n  //   (if (i32.le_u (local.get $uc) (i32.const 77))\n  //     (return (i32.add (local.get $c) (i32.const 13))))\n  //\n  //   ;; In range ['N', 'Z'] return |c| - 13.\n  //   (if (i32.le_u (local.get $uc) (i32.const 90))\n  //     (return (i32.sub (local.get $c) (i32.const 13))))\n  //\n  //   ;; No change for everything else.\n  //   (return (local.get $c))\n  // )\n  //\n  // (func (export \"rot13\")\n  //   (local $size i32)\n  //   (local $i i32)\n  //\n  //   ;; Ask host to fill memory [0, 1024) with data.\n  //   (call $fill_buf (i32.const 0) (i32.const 1024))\n  //\n  //   ;; The host returns the size filled.\n  //   (local.set $size)\n  //\n  //   ;; Loop over all bytes and rot13 them.\n  //   (block $exit\n  //     (loop $top\n  //       ;; if (i >= size) break\n  //       (if (i32.ge_u (local.get $i) (local.get $size)) (br $exit))\n  //\n  //       ;; mem[i] = rot13c(mem[i])\n  //       (i32.store8\n  //         (local.get $i)\n  //         (call $rot13c\n  //           (i32.load8_u (local.get $i))))\n  //\n  //       ;; i++\n  //       (local.set $i (i32.add (local.get $i) (i32.const 1)))\n  //       (br $top)\n  //     )\n  //   )\n  //\n  //   (call $buf_done (i32.const 0) (local.get $size))\n  // )\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x14, 0x04, 0x60,\n      0x02, 0x7f, 0x7f, 0x01, 0x7f, 0x60, 0x02, 0x7f, 0x7f, 0x00, 0x60, 0x01,\n      0x7f, 0x01, 0x7f, 0x60, 0x00, 0x00, 0x02, 0x2d, 0x03, 0x04, 0x68, 0x6f,\n      0x73, 0x74, 0x03, 0x6d, 0x65, 0x6d, 0x02, 0x00, 0x01, 0x04, 0x68, 0x6f,\n      0x73, 0x74, 0x08, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x62, 0x75, 0x66, 0x00,\n      0x00, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x08, 0x62, 0x75, 0x66, 0x5f, 0x64,\n      0x6f, 0x6e, 0x65, 0x00, 0x01, 0x03, 0x03, 0x02, 0x02, 0x03, 0x07, 0x09,\n      0x01, 0x05, 0x72, 0x6f, 0x74, 0x31, 0x33, 0x00, 0x03, 0x0a, 0x74, 0x02,\n      0x39, 0x01, 0x01, 0x7f, 0x20, 0x00, 0x41, 0xc1, 0x00, 0x49, 0x04, 0x40,\n      0x20, 0x00, 0x0f, 0x0b, 0x20, 0x00, 0x41, 0xdf, 0x01, 0x71, 0x21, 0x01,\n      0x20, 0x01, 0x41, 0xcd, 0x00, 0x4d, 0x04, 0x40, 0x20, 0x00, 0x41, 0x0d,\n      0x6a, 0x0f, 0x0b, 0x20, 0x01, 0x41, 0xda, 0x00, 0x4d, 0x04, 0x40, 0x20,\n      0x00, 0x41, 0x0d, 0x6b, 0x0f, 0x0b, 0x20, 0x00, 0x0f, 0x0b, 0x38, 0x01,\n      0x02, 0x7f, 0x41, 0x00, 0x41, 0x80, 0x08, 0x10, 0x00, 0x21, 0x00, 0x02,\n      0x40, 0x03, 0x40, 0x20, 0x01, 0x20, 0x00, 0x4f, 0x04, 0x40, 0x0c, 0x02,\n      0x0b, 0x20, 0x01, 0x20, 0x01, 0x2d, 0x00, 0x00, 0x10, 0x02, 0x3a, 0x00,\n      0x00, 0x20, 0x01, 0x41, 0x01, 0x6a, 0x21, 0x01, 0x0c, 0x00, 0x0b, 0x0b,\n      0x41, 0x00, 0x20, 0x00, 0x10, 0x01, 0x0b,\n  });\n\n  auto host_func =\n      HostFunc::New(store_, FuncType{{ValueType::I32}, {ValueType::I32}},\n                    [](Thread& thread, const Values& params, Values& results,\n                       Trap::Ptr* out_trap) -> Result {\n                      results[0] = Value::Make(params[0].Get<u32>() + 1);\n                      return Result::Ok;\n                    });\n\n  std::string string_data = \"Hello, WebAssembly!\";\n\n  auto memory =\n      Memory::New(store_, MemoryType{Limits{1}, WABT_DEFAULT_PAGE_SIZE});\n\n  auto fill_buf = [&](Thread& thread, const Values& params, Values& results,\n                      Trap::Ptr* out_trap) -> Result {\n    // (param $ptr i32) (param $max_size i32) (result $size i32)\n    EXPECT_EQ(2u, params.size());\n    EXPECT_EQ(1u, results.size());\n\n    u32 ptr = params[0].Get<u32>();\n    u32 max_size = params[1].Get<u32>();\n    u32 size = std::min(max_size, u32(string_data.size()));\n\n    EXPECT_LT(ptr + size, memory->ByteSize());\n\n#if WABT_BIG_ENDIAN\n    std::copy(string_data.rbegin(), string_data.rbegin() + size,\n              memory->UnsafeData() + memory->ByteSize() - ptr - size);\n#else\n    std::copy(string_data.begin(), string_data.begin() + size,\n              memory->UnsafeData() + ptr);\n#endif\n\n    results[0].Set(size);\n    return Result::Ok;\n  };\n  auto fill_buf_func = HostFunc::New(\n      store_, FuncType{{ValueType::I32, ValueType::I32}, {ValueType::I32}},\n      fill_buf);\n\n  auto buf_done = [&](Thread& thread, const Values& params, Values& results,\n                      Trap::Ptr* out_trap) -> Result {\n    // (param $ptr i32) (param $size i32)\n    EXPECT_EQ(2u, params.size());\n    EXPECT_EQ(0u, results.size());\n\n    u32 ptr = params[0].Get<u32>();\n    u32 size = params[1].Get<u32>();\n\n    EXPECT_LT(ptr + size, memory->ByteSize());\n\n    string_data.resize(size);\n#if WABT_BIG_ENDIAN\n    std::copy(memory->UnsafeData() + memory->ByteSize() - ptr - size,\n              memory->UnsafeData() + memory->ByteSize() - ptr,\n              string_data.rbegin());\n#else\n    std::copy(memory->UnsafeData() + ptr, memory->UnsafeData() + ptr + size,\n              string_data.begin());\n#endif\n\n    return Result::Ok;\n  };\n  auto buf_done_func = HostFunc::New(\n      store_, FuncType{{ValueType::I32, ValueType::I32}, {}}, buf_done);\n\n  Instantiate({memory->self(), fill_buf_func->self(), buf_done_func->self()});\n\n  auto rot13 = GetFuncExport(0);\n\n  Values results;\n  Trap::Ptr trap;\n  ASSERT_EQ(Result::Ok, rot13->Call(store_, {}, results, &trap));\n\n  ASSERT_EQ(\"Uryyb, JroNffrzoyl!\", string_data);\n\n  ASSERT_EQ(Result::Ok, rot13->Call(store_, {}, results, &trap));\n\n  ASSERT_EQ(\"Hello, WebAssembly!\", string_data);\n}\n\nclass InterpGCTest : public InterpTest {\n public:\n  void SetUp() override { before_new = store_.object_count(); }\n\n  void TearDown() override {\n    // Reset instance and module, in case they were allocated.\n    inst_.reset();\n    mod_.reset();\n\n    store_.Collect();\n    EXPECT_EQ(before_new, store_.object_count());\n  }\n\n  size_t before_new;\n};\n\nTEST_F(InterpGCTest, Collect_Basic) {\n  auto foreign = Foreign::New(store_, nullptr);\n  auto after_new = store_.object_count();\n  EXPECT_EQ(before_new + 1, after_new);\n\n  // Remove root, but object is not destroyed until collect.\n  foreign.reset();\n  EXPECT_EQ(after_new, store_.object_count());\n}\n\nTEST_F(InterpGCTest, Collect_GlobalCycle) {\n  auto gt = GlobalType{ValueType::ExternRef, Mutability::Var};\n  auto g1 = Global::New(store_, gt, Value::Make(Ref::Null));\n  auto g2 = Global::New(store_, gt, Value::Make(g1->self()));\n  g1->Set(store_, g2->self());\n\n  auto after_new = store_.object_count();\n  EXPECT_EQ(before_new + 2, after_new);\n\n  // Remove g1 root, but it's kept alive by g2.\n  g1.reset();\n  store_.Collect();\n  EXPECT_EQ(after_new, store_.object_count());\n\n  // Remove g2 root, now both should be removed.\n  g2.reset();\n}\n\nTEST_F(InterpGCTest, Collect_TableCycle) {\n  auto tt = TableType{ValueType::ExternRef, Limits{2}};\n  auto t1 = Table::New(store_, tt, Ref::Null);\n  auto t2 = Table::New(store_, tt, Ref::Null);\n  auto t3 = Table::New(store_, tt, Ref::Null);\n\n  t1->Set(store_, 0, t1->self());  // t1 references itself.\n  t2->Set(store_, 0, t3->self());\n  t3->Set(store_, 0, t2->self());  // t2 and t3 reference each other.\n  t3->Set(store_, 1, t1->self());  // t3 also references t1.\n\n  auto after_new = store_.object_count();\n  EXPECT_EQ(before_new + 3, after_new);\n\n  // Remove t1 and t2 roots, but their kept alive by t3.\n  t1.reset();\n  t2.reset();\n  store_.Collect();\n  EXPECT_EQ(after_new, store_.object_count());\n\n  // Remove t3 root, now all should be removed.\n  t3.reset();\n}\n\nTEST_F(InterpGCTest, Collect_Func) {\n  ReadModule(s_fac_module);\n  Instantiate();\n  auto func = GetFuncExport(0);\n\n  auto after_new = store_.object_count();\n  EXPECT_EQ(before_new + 3, after_new);  // module, instance, func.\n\n  // Reset module and instance roots, but they'll be kept alive by the func.\n  mod_.reset();\n  inst_.reset();\n  store_.Collect();\n  EXPECT_EQ(after_new, store_.object_count());\n}\n\nTEST_F(InterpGCTest, Collect_InstanceImport) {\n  // (import \"\" \"f\" (func))\n  // (import \"\" \"t\" (table 0 funcref))\n  // (import \"\" \"m\" (memory 0))\n  // (import \"\" \"g\" (global i32))\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01,\n      0x60, 0x00, 0x00, 0x02, 0x19, 0x04, 0x00, 0x01, 0x66, 0x00, 0x00,\n      0x00, 0x01, 0x74, 0x01, 0x70, 0x00, 0x00, 0x00, 0x01, 0x6d, 0x02,\n      0x00, 0x00, 0x00, 0x01, 0x67, 0x03, 0x7f, 0x00,\n  });\n  auto f = HostFunc::New(store_, FuncType{{}, {}},\n                         [](Thread& thread, const Values&, Values&,\n                            Trap::Ptr*) -> Result { return Result::Ok; });\n  auto t =\n      Table::New(store_, TableType{ValueType::FuncRef, Limits{0}}, Ref::Null);\n  auto m = Memory::New(store_, MemoryType{Limits{0}, WABT_DEFAULT_PAGE_SIZE});\n  auto g = Global::New(store_, GlobalType{ValueType::I32, Mutability::Const},\n                       Value::Make(5));\n\n  Instantiate({f->self(), t->self(), m->self(), g->self()});\n  auto after_new = store_.object_count();\n  EXPECT_EQ(before_new + 6, after_new);  // module, instance, f, t, m, g\n\n  // Instance keeps all imports alive.\n  f.reset();\n  t.reset();\n  m.reset();\n  g.reset();\n  store_.Collect();\n  EXPECT_EQ(after_new, store_.object_count());\n}\n\nTEST_F(InterpGCTest, Collect_InstanceExport) {\n  // (func (export \"f\"))\n  // (global (export \"g\") i32 (i32.const 0))\n  // (table (export \"t\") 0 funcref)\n  // (memory (export \"m\") 0)\n  ReadModule({\n      0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01,\n      0x60, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0x04, 0x04, 0x01, 0x70,\n      0x00, 0x00, 0x05, 0x03, 0x01, 0x00, 0x00, 0x06, 0x06, 0x01, 0x7f,\n      0x00, 0x41, 0x00, 0x0b, 0x07, 0x11, 0x04, 0x01, 0x66, 0x00, 0x00,\n      0x01, 0x67, 0x03, 0x00, 0x01, 0x74, 0x01, 0x00, 0x01, 0x6d, 0x02,\n      0x00, 0x0a, 0x04, 0x01, 0x02, 0x00, 0x0b,\n  });\n  Instantiate();\n  auto after_new = store_.object_count();\n  EXPECT_EQ(before_new + 7,\n            after_new);  // module, instance, f, t, m, g, g-init-func\n\n  // Instance keeps all exports alive, except the init func which can be\n  // collected once its has been run\n  store_.Collect();\n  EXPECT_EQ(after_new - 1, store_.object_count());\n}\n\nTEST_F(InterpGCTest, Collect_DeepRecursion) {\n  const size_t table_count = 65;\n\n  TableType tt = TableType{ValueType::ExternRef, Limits{1}};\n\n  // Create a chain of tables, where each contains\n  // a single reference to the next table.\n\n  Table::Ptr prev_table = Table::New(store_, tt, Ref::Null);\n\n  for (size_t i = 1; i < table_count; i++) {\n    Table::Ptr new_table = Table::New(store_, tt, Ref::Null);\n\n    new_table->Set(store_, 0, prev_table->self());\n\n    prev_table.reset();\n    prev_table = std::move(new_table);\n  }\n\n  store_.Collect();\n  EXPECT_EQ(table_count + 1, store_.object_count());\n\n  // Remove the last root, now all should be removed.\n  prev_table.reset();\n\n  store_.Collect();\n  EXPECT_EQ(1u, store_.object_count());\n}\n\n// TODO: Test for Thread keeping references alive as locals/params/stack values.\n// This requires better tracking of references than currently exists in the\n// interpreter. (see TODOs in Select/LocalGet/GlobalGet)\n"
  },
  {
    "path": "src/test-intrusive-list.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"gtest/gtest.h\"\n\n#include <memory>\n\n#include \"wabt/intrusive-list.h\"\n\nusing namespace wabt;\n\nnamespace {\n\nstruct TestObject : intrusive_list_base<TestObject> {\n  static int creation_count;\n\n  TestObject(int data = 0, int data2 = 0) : data(data), data2(data2) {\n    ++creation_count;\n  }\n\n  // Allow move.\n  TestObject(TestObject&& other) {\n    // Don't increment creation_count; we're moving from other.\n    *this = std::move(other);\n  }\n\n  TestObject& operator=(TestObject&& other) {\n    data = other.data;\n    data2 = other.data2;\n    other.moved = true;\n    return *this;\n  }\n\n  // Disallow copy.\n  TestObject(const TestObject&) = delete;\n  TestObject& operator=(const TestObject&) = delete;\n\n  ~TestObject() {\n    if (!moved) {\n      creation_count--;\n    }\n  }\n\n  int data;\n  int data2;\n  bool moved = false;\n};\n\n// static\nint TestObject::creation_count = 0;\n\nusing TestObjectList = intrusive_list<TestObject>;\n\nclass IntrusiveListTest : public ::testing::Test {\n protected:\n  virtual void SetUp() {\n    // Reset to 0 even if the previous test leaked objects to keep the tests\n    // independent.\n    TestObject::creation_count = 0;\n  }\n\n  virtual void TearDown() { ASSERT_EQ(0, TestObject::creation_count); }\n\n  TestObjectList NewList(const std::vector<int>& data_values) {\n    TestObjectList result;\n    for (auto data_value : data_values)\n      result.emplace_back(data_value);\n    return result;\n  }\n\n  void AssertListEq(const TestObjectList& list,\n                    const std::vector<int>& expected) {\n    size_t count = 0;\n    for (const TestObject& node : list) {\n      ASSERT_EQ(expected[count++], node.data);\n    }\n    ASSERT_EQ(count, expected.size());\n  }\n\n  void AssertListEq(const TestObjectList& list,\n                    const std::vector<int>& expected,\n                    const std::vector<int>& expected2) {\n    assert(expected.size() == expected2.size());\n    size_t count = 0;\n    for (const TestObject& node : list) {\n      ASSERT_EQ(expected[count], node.data);\n      ASSERT_EQ(expected2[count], node.data2);\n      count++;\n    }\n    ASSERT_EQ(count, expected.size());\n  }\n};\n\n}  // end anonymous namespace\n\nTEST_F(IntrusiveListTest, default_constructor) {\n  TestObjectList list;\n}\n\nTEST_F(IntrusiveListTest, node_constructor) {\n  TestObjectList list(std::make_unique<TestObject>(1));\n  AssertListEq(list, {1});\n}\n\nTEST_F(IntrusiveListTest, node_move_constructor) {\n  TestObjectList list(TestObject(1));\n  AssertListEq(list, {1});\n}\n\nTEST_F(IntrusiveListTest, move_constructor) {\n  TestObjectList list1 = NewList({1, 2, 3});\n  TestObjectList list2(std::move(list1));\n  AssertListEq(list1, {});\n  AssertListEq(list2, {1, 2, 3});\n}\n\nTEST_F(IntrusiveListTest, move_assignment_operator) {\n  TestObjectList list1 = NewList({1, 2, 3});\n  TestObjectList list2;\n\n  list2 = std::move(list1);\n  AssertListEq(list1, {});\n  AssertListEq(list2, {1, 2, 3});\n}\n\nnamespace {\n\nclass IntrusiveListIteratorTest : public IntrusiveListTest {\n protected:\n  virtual void SetUp() {\n    IntrusiveListTest::SetUp();\n\n    list_.emplace_back(1);\n    list_.emplace_back(2);\n    list_.emplace_back(3);\n  }\n\n  virtual void TearDown() {\n    list_.clear();\n\n    IntrusiveListTest::TearDown();\n  }\n\n  template <typename Iter>\n  void TestForward(Iter first, Iter last, const std::vector<int>& expected) {\n    size_t count = 0;\n    while (first != last) {\n      ASSERT_EQ(expected[count], first->data);\n      ++first;\n      ++count;\n    }\n    ASSERT_EQ(count, expected.size());\n  }\n\n  template <typename Iter>\n  void TestBackward(Iter first, Iter last, const std::vector<int>& expected) {\n    size_t count = 0;\n    while (first != last) {\n      --last;\n      ASSERT_EQ(expected[count], last->data);\n      ++count;\n    }\n    ASSERT_EQ(count, expected.size());\n  }\n\n  TestObjectList list_;\n  const TestObjectList& clist_ = list_;\n};\n\n}  // end of anonymous namespace\n\nTEST_F(IntrusiveListIteratorTest, begin_end_forward) {\n  TestForward(list_.begin(), list_.end(), {1, 2, 3});\n  TestForward(clist_.begin(), clist_.end(), {1, 2, 3});\n}\n\nTEST_F(IntrusiveListIteratorTest, rbegin_rend_forward) {\n  TestForward(list_.rbegin(), list_.rend(), {3, 2, 1});\n  TestForward(clist_.rbegin(), clist_.rend(), {3, 2, 1});\n}\n\nTEST_F(IntrusiveListIteratorTest, cbegin_cend_forward) {\n  TestForward(list_.cbegin(), list_.cend(), {1, 2, 3});\n  TestForward(clist_.cbegin(), clist_.cend(), {1, 2, 3});\n}\n\nTEST_F(IntrusiveListIteratorTest, crbegin_crend_forward) {\n  TestForward(list_.crbegin(), list_.crend(), {3, 2, 1});\n  TestForward(clist_.crbegin(), clist_.crend(), {3, 2, 1});\n}\n\nTEST_F(IntrusiveListIteratorTest, begin_end_backward) {\n  TestBackward(list_.begin(), list_.end(), {3, 2, 1});\n  TestBackward(clist_.begin(), clist_.end(), {3, 2, 1});\n}\n\nTEST_F(IntrusiveListIteratorTest, rbegin_rend_backward) {\n  TestBackward(list_.rbegin(), list_.rend(), {1, 2, 3});\n  TestBackward(clist_.rbegin(), clist_.rend(), {1, 2, 3});\n}\n\nTEST_F(IntrusiveListIteratorTest, cbegin_cend_backward) {\n  TestBackward(list_.cbegin(), list_.cend(), {3, 2, 1});\n  TestBackward(clist_.cbegin(), clist_.cend(), {3, 2, 1});\n}\n\nTEST_F(IntrusiveListIteratorTest, crbegin_crend_backward) {\n  TestBackward(list_.crbegin(), list_.crend(), {1, 2, 3});\n  TestBackward(clist_.crbegin(), clist_.crend(), {1, 2, 3});\n}\n\nTEST_F(IntrusiveListTest, size_empty) {\n  TestObjectList list;\n  ASSERT_EQ(0U, list.size());\n  ASSERT_TRUE(list.empty());\n\n  list.emplace_back(1);\n  ASSERT_EQ(1U, list.size());\n  ASSERT_FALSE(list.empty());\n}\n\nTEST_F(IntrusiveListTest, front_back) {\n  TestObjectList list;\n\n  list.emplace_back(1);\n  ASSERT_EQ(1, list.front().data);\n  ASSERT_EQ(1, list.back().data);\n\n  list.emplace_back(2);\n  ASSERT_EQ(1, list.front().data);\n  ASSERT_EQ(2, list.back().data);\n\n  const TestObjectList& clist = list;\n  ASSERT_EQ(1, clist.front().data);\n  ASSERT_EQ(2, clist.back().data);\n}\n\nTEST_F(IntrusiveListTest, emplace_front) {\n  TestObjectList list;\n\n  // Pass an additional arg to show that forwarding works properly.\n  list.emplace_front(1, 100);\n  list.emplace_front(2, 200);\n  list.emplace_front(3, 300);\n  list.emplace_front(4, 400);\n\n  AssertListEq(list, {4, 3, 2, 1}, {400, 300, 200, 100});\n}\n\nTEST_F(IntrusiveListTest, emplace_back) {\n  TestObjectList list;\n\n  // Pass an additional arg to show that forwarding works properly.\n  list.emplace_back(1, 100);\n  list.emplace_back(2, 200);\n  list.emplace_back(3, 300);\n  list.emplace_back(4, 400);\n\n  AssertListEq(list, {1, 2, 3, 4}, {100, 200, 300, 400});\n}\n\nTEST_F(IntrusiveListTest, push_front_pointer) {\n  TestObjectList list;\n\n  list.push_front(std::make_unique<TestObject>(1));\n  list.push_front(std::make_unique<TestObject>(2));\n  list.push_front(std::make_unique<TestObject>(3));\n\n  AssertListEq(list, {3, 2, 1});\n}\n\nTEST_F(IntrusiveListTest, push_back_pointer) {\n  TestObjectList list;\n\n  list.push_back(std::make_unique<TestObject>(1));\n  list.push_back(std::make_unique<TestObject>(2));\n  list.push_back(std::make_unique<TestObject>(3));\n\n  AssertListEq(list, {1, 2, 3});\n}\n\nTEST_F(IntrusiveListTest, push_front_move) {\n  TestObjectList list;\n\n  list.push_front(TestObject(1));\n  list.push_front(TestObject(2));\n  list.push_front(TestObject(3));\n\n  AssertListEq(list, {3, 2, 1});\n}\n\nTEST_F(IntrusiveListTest, push_back_move) {\n  TestObjectList list;\n\n  list.push_back(TestObject(1));\n  list.push_back(TestObject(2));\n  list.push_back(TestObject(3));\n\n  AssertListEq(list, {1, 2, 3});\n}\n\nTEST_F(IntrusiveListTest, pop_front) {\n  TestObjectList list = NewList({1, 2, 3, 4});\n\n  list.pop_front();\n  AssertListEq(list, {2, 3, 4});\n  list.pop_front();\n  AssertListEq(list, {3, 4});\n  list.pop_front();\n  AssertListEq(list, {4});\n  list.pop_front();\n  AssertListEq(list, {});\n}\n\nTEST_F(IntrusiveListTest, pop_back) {\n  TestObjectList list = NewList({1, 2, 3, 4});\n\n  list.pop_back();\n  AssertListEq(list, {1, 2, 3});\n  list.pop_back();\n  AssertListEq(list, {1, 2});\n  list.pop_back();\n  AssertListEq(list, {1});\n  list.pop_back();\n  AssertListEq(list, {});\n}\n\nTEST_F(IntrusiveListTest, extract_front) {\n  TestObjectList list = NewList({1, 2, 3});\n\n  std::unique_ptr<TestObject> t1(list.extract_front());\n  ASSERT_EQ(1, t1->data);\n  AssertListEq(list, {2, 3});\n\n  std::unique_ptr<TestObject> t2(list.extract_front());\n  ASSERT_EQ(2, t2->data);\n  AssertListEq(list, {3});\n\n  std::unique_ptr<TestObject> t3(list.extract_front());\n  ASSERT_EQ(3, t3->data);\n  AssertListEq(list, {});\n}\n\nTEST_F(IntrusiveListTest, extract_back) {\n  TestObjectList list = NewList({1, 2, 3});\n\n  std::unique_ptr<TestObject> t1(list.extract_back());\n  ASSERT_EQ(3, t1->data);\n  AssertListEq(list, {1, 2});\n\n  std::unique_ptr<TestObject> t2(list.extract_back());\n  ASSERT_EQ(2, t2->data);\n  AssertListEq(list, {1});\n\n  std::unique_ptr<TestObject> t3(list.extract_back());\n  ASSERT_EQ(1, t3->data);\n  AssertListEq(list, {});\n}\n\nTEST_F(IntrusiveListTest, emplace) {\n  TestObjectList list;\n\n  // Pass an additional arg to show that forwarding works properly.\n  list.emplace(list.begin(), 2, 200);\n  list.emplace(list.end(), 4, 400);\n  list.emplace(std::next(list.begin()), 3, 300);\n  list.emplace(list.begin(), 1, 100);\n\n  AssertListEq(list, {1, 2, 3, 4}, {100, 200, 300, 400});\n}\n\nTEST_F(IntrusiveListTest, insert_pointer) {\n  TestObjectList list;\n\n  list.insert(list.begin(), std::make_unique<TestObject>(2));\n  list.insert(list.end(), std::make_unique<TestObject>(4));\n  list.insert(std::next(list.begin()), std::make_unique<TestObject>(3));\n  list.insert(list.begin(), std::make_unique<TestObject>(1));\n\n  AssertListEq(list, {1, 2, 3, 4});\n}\n\nTEST_F(IntrusiveListTest, insert_move) {\n  TestObjectList list;\n\n  list.insert(list.begin(), TestObject(2));\n  list.insert(list.end(), TestObject(4));\n  list.insert(std::next(list.begin()), TestObject(3));\n  list.insert(list.begin(), TestObject(1));\n\n  AssertListEq(list, {1, 2, 3, 4});\n}\n\nTEST_F(IntrusiveListTest, extract) {\n  TestObjectList list = NewList({1, 2, 3, 4});\n\n  TestObjectList::iterator t1_iter = std::next(list.begin(), 0);\n  TestObjectList::iterator t2_iter = std::next(list.begin(), 1);\n  TestObjectList::iterator t3_iter = std::next(list.begin(), 2);\n  TestObjectList::iterator t4_iter = std::next(list.begin(), 3);\n\n  std::unique_ptr<TestObject> t2(list.extract(t2_iter));\n  ASSERT_EQ(2, t2->data);\n  AssertListEq(list, {1, 3, 4});\n\n  std::unique_ptr<TestObject> t4(list.extract(t4_iter));\n  ASSERT_EQ(4, t4->data);\n  AssertListEq(list, {1, 3});\n\n  std::unique_ptr<TestObject> t1(list.extract(t1_iter));\n  ASSERT_EQ(1, t1->data);\n  AssertListEq(list, {3});\n\n  std::unique_ptr<TestObject> t3(list.extract(t3_iter));\n  ASSERT_EQ(3, t3->data);\n  AssertListEq(list, {});\n}\n\nTEST_F(IntrusiveListTest, erase) {\n  TestObjectList list = NewList({1, 2, 3, 4});\n\n  TestObjectList::iterator t1_iter = std::next(list.begin(), 0);\n  TestObjectList::iterator t2_iter = std::next(list.begin(), 1);\n  TestObjectList::iterator t3_iter = std::next(list.begin(), 2);\n  TestObjectList::iterator t4_iter = std::next(list.begin(), 3);\n\n  // erase returns an iterator to the following node.\n  ASSERT_EQ(3, list.erase(t2_iter)->data);\n  AssertListEq(list, {1, 3, 4});\n\n  ASSERT_EQ(list.end(), list.erase(t4_iter));\n  AssertListEq(list, {1, 3});\n\n  ASSERT_EQ(3, list.erase(t1_iter)->data);\n  AssertListEq(list, {3});\n\n  ASSERT_EQ(list.end(), list.erase(t3_iter));\n  AssertListEq(list, {});\n}\n\nTEST_F(IntrusiveListTest, erase_range) {\n  TestObjectList list = NewList({1, 2, 3, 4, 5, 6});\n\n  // OK to erase an empty range.\n  list.erase(list.begin(), list.begin());\n  list.erase(list.end(), list.end());\n\n  // Erase the first element (1).\n  list.erase(list.begin(), std::next(list.begin()));\n  AssertListEq(list, {2, 3, 4, 5, 6});\n\n  // Erase the last element (6).\n  list.erase(std::prev(list.end()), list.end());\n  AssertListEq(list, {2, 3, 4, 5});\n\n  // Erase [3, 4] => [2, 5]\n  list.erase(std::next(list.begin()), std::prev(list.end()));\n  AssertListEq(list, {2, 5});\n\n  // Erase the rest.\n  list.erase(list.begin(), list.end());\n  AssertListEq(list, {});\n}\n\nTEST_F(IntrusiveListTest, swap) {\n  TestObjectList list1 = NewList({1, 2, 3, 4});\n\n  TestObjectList list2 = NewList({100, 200, 300});\n\n  AssertListEq(list1, {1, 2, 3, 4});\n  AssertListEq(list2, {100, 200, 300});\n\n  list1.swap(list2);\n\n  AssertListEq(list1, {100, 200, 300});\n  AssertListEq(list2, {1, 2, 3, 4});\n}\n\nTEST_F(IntrusiveListTest, clear) {\n  TestObjectList list = NewList({1, 2, 3, 4});\n\n  ASSERT_FALSE(list.empty());\n\n  list.clear();\n\n  ASSERT_EQ(0U, list.size());\n  ASSERT_TRUE(list.empty());\n}\n\nTEST_F(IntrusiveListTest, splice_list) {\n  TestObjectList list1 = NewList({1, 2, 3});\n\n  // Splice at beginning.\n  TestObjectList list2 = NewList({100, 200});\n  list1.splice(list1.begin(), list2);\n  AssertListEq(list1, {100, 200, 1, 2, 3});\n  AssertListEq(list2, {});\n\n  // Splice at end.\n  TestObjectList list3 = NewList({500, 600, 700});\n  list1.splice(list1.end(), list3);\n  AssertListEq(list1, {100, 200, 1, 2, 3, 500, 600, 700});\n  AssertListEq(list3, {});\n\n  // Splice in the middle.\n  TestObjectList list4 = NewList({400});\n  list1.splice(std::next(list1.begin(), 4), list4);\n  AssertListEq(list1, {100, 200, 1, 2, 400, 3, 500, 600, 700});\n  AssertListEq(list4, {});\n}\n\nTEST_F(IntrusiveListTest, splice_list_move) {\n  TestObjectList list1 = NewList({1, 2, 3});\n\n  // Splice at beginning.\n  list1.splice(list1.begin(), NewList({100, 200}));\n  AssertListEq(list1, {100, 200, 1, 2, 3});\n\n  // Splice at end.\n  list1.splice(list1.end(), NewList({500, 600, 700}));\n  AssertListEq(list1, {100, 200, 1, 2, 3, 500, 600, 700});\n\n  // Splice in the middle.\n  list1.splice(std::next(list1.begin(), 4), NewList({400}));\n  AssertListEq(list1, {100, 200, 1, 2, 400, 3, 500, 600, 700});\n}\n\nTEST_F(IntrusiveListTest, splice_node) {\n  TestObjectList list1 = NewList({1, 2, 3});\n\n  // Splice at beginning.\n  TestObjectList list2 = NewList({100, 200});\n  list1.splice(list1.begin(), list2, list2.begin());\n  AssertListEq(list1, {100, 1, 2, 3});\n  AssertListEq(list2, {200});\n\n  // Splice at end.\n  TestObjectList list3 = NewList({500, 600, 700});\n  list1.splice(list1.end(), list3, std::next(list3.begin(), 2));\n  AssertListEq(list1, {100, 1, 2, 3, 700});\n  AssertListEq(list3, {500, 600});\n\n  // Splice in the middle.\n  TestObjectList list4 = NewList({400});\n  list1.splice(std::next(list1.begin(), 3), list4, list4.begin());\n  AssertListEq(list1, {100, 1, 2, 400, 3, 700});\n  AssertListEq(list4, {});\n}\n\nTEST_F(IntrusiveListTest, splice_range) {\n  TestObjectList list1 = NewList({1, 2, 3});\n\n  // Splice at beginning.\n  TestObjectList list2 = NewList({100, 200, 300});\n  list1.splice(list1.begin(), list2, list2.begin(), std::prev(list2.end()));\n  AssertListEq(list1, {100, 200, 1, 2, 3});\n  AssertListEq(list2, {300});\n\n  // Splice at end.\n  TestObjectList list3 = NewList({500, 600, 700});\n  list1.splice(list1.end(), list3, std::next(list3.begin()), list3.end());\n  AssertListEq(list1, {100, 200, 1, 2, 3, 600, 700});\n  AssertListEq(list3, {500});\n\n  // Splice in the middle.\n  TestObjectList list4 = NewList({400});\n  list1.splice(std::next(list1.begin(), 4), list4, list4.begin(), list4.end());\n  AssertListEq(list1, {100, 200, 1, 2, 400, 3, 600, 700});\n  AssertListEq(list4, {});\n}\n"
  },
  {
    "path": "src/test-literal.cc",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <cstdio>\n#include <thread>\n#include <vector>\n\n#include \"gtest/gtest.h\"\n\n#include \"wabt/literal.h\"\n\nusing namespace wabt;\n\nnamespace {\n\nenum ParseIntTypeCombo {\n  UnsignedOnly,\n  SignedAndUnsigned,\n  Both,\n};\n\ntemplate <typename T>\nvoid AssertIntEquals(\n    T expected,\n    const char* s,\n    Result (*parse_int)(const char*, const char*, T*, ParseIntType),\n    ParseIntTypeCombo parse_type = Both) {\n  const char* const end = s + strlen(s);\n  T actual;\n  if (parse_type == UnsignedOnly || parse_type == Both) {\n    ASSERT_EQ(Result::Ok,\n              parse_int(s, end, &actual, ParseIntType::UnsignedOnly))\n        << s;\n    ASSERT_EQ(expected, actual);\n  } else {\n    ASSERT_EQ(Result::Error,\n              parse_int(s, end, &actual, ParseIntType::UnsignedOnly))\n        << s;\n  }\n\n  if (parse_type == SignedAndUnsigned || parse_type == Both) {\n    ASSERT_EQ(Result::Ok,\n              parse_int(s, end, &actual, ParseIntType::SignedAndUnsigned))\n        << s;\n    ASSERT_EQ(expected, actual);\n  } else {\n    ASSERT_EQ(Result::Error,\n              parse_int(s, end, &actual, ParseIntType::SignedAndUnsigned))\n        << s;\n  }\n}\n\nvoid AssertInt8Equals(uint8_t expected,\n                      const char* s,\n                      ParseIntTypeCombo parse_type = Both) {\n  AssertIntEquals(expected, s, ParseInt8, parse_type);\n}\n\nvoid AssertInt16Equals(uint16_t expected,\n                       const char* s,\n                       ParseIntTypeCombo parse_type = Both) {\n  AssertIntEquals(expected, s, ParseInt16, parse_type);\n}\n\nvoid AssertInt32Equals(uint32_t expected,\n                       const char* s,\n                       ParseIntTypeCombo parse_type = Both) {\n  AssertIntEquals(expected, s, ParseInt32, parse_type);\n}\n\nvoid AssertInt64Equals(uint64_t expected,\n                       const char* s,\n                       ParseIntTypeCombo parse_type = Both) {\n  AssertIntEquals(expected, s, ParseInt64, parse_type);\n}\n\nvoid AssertUint128Equals(v128 expected, const char* s) {\n  const char* const end = s + strlen(s);\n  v128 actual;\n  ASSERT_EQ(Result::Ok, ParseUint128(s, end, &actual)) << s;\n  ASSERT_EQ(expected, actual);\n}\n\nvoid AssertInt8Fails(const char* s) {\n  const char* const end = s + strlen(s);\n  uint8_t actual;\n  ASSERT_EQ(Result::Error,\n            ParseInt8(s, end, &actual, ParseIntType::SignedAndUnsigned))\n      << s;\n  ASSERT_EQ(Result::Error,\n            ParseInt8(s, end, &actual, ParseIntType::UnsignedOnly))\n      << s;\n}\n\nvoid AssertInt16Fails(const char* s) {\n  const char* const end = s + strlen(s);\n  uint16_t actual;\n  ASSERT_EQ(Result::Error,\n            ParseInt16(s, end, &actual, ParseIntType::SignedAndUnsigned))\n      << s;\n  ASSERT_EQ(Result::Error,\n            ParseInt16(s, end, &actual, ParseIntType::UnsignedOnly))\n      << s;\n}\n\nvoid AssertInt32Fails(const char* s) {\n  const char* const end = s + strlen(s);\n  uint32_t actual;\n  ASSERT_EQ(Result::Error,\n            ParseInt32(s, end, &actual, ParseIntType::SignedAndUnsigned))\n      << s;\n  ASSERT_EQ(Result::Error,\n            ParseInt32(s, end, &actual, ParseIntType::UnsignedOnly))\n      << s;\n}\n\nvoid AssertInt64Fails(const char* s) {\n  const char* const end = s + strlen(s);\n  uint64_t actual;\n  ASSERT_EQ(Result::Error,\n            ParseInt64(s, end, &actual, ParseIntType::SignedAndUnsigned))\n      << s;\n  ASSERT_EQ(Result::Error,\n            ParseInt64(s, end, &actual, ParseIntType::UnsignedOnly))\n      << s;\n}\n\nvoid AssertUint64Equals(uint64_t expected, const char* s) {\n  uint64_t actual;\n  ASSERT_EQ(Result::Ok, ParseUint64(s, s + strlen(s), &actual)) << s;\n  ASSERT_EQ(expected, actual);\n}\n\nvoid AssertUint64Fails(const char* s) {\n  uint64_t actual_bits;\n  ASSERT_EQ(Result::Error, ParseUint64(s, s + strlen(s), &actual_bits)) << s;\n}\n\nvoid AssertUint128Fails(const char* s) {\n  v128 actual;\n  ASSERT_EQ(Result::Error, ParseUint128(s, s + strlen(s), &actual)) << s;\n}\n\nvoid AssertHexFloatEquals(uint32_t expected_bits, const char* s) {\n  uint32_t actual_bits;\n  ASSERT_EQ(Result::Ok,\n            ParseFloat(LiteralType::Hexfloat, s, s + strlen(s), &actual_bits))\n      << s;\n  ASSERT_EQ(expected_bits, actual_bits) << s;\n}\n\nvoid AssertHexFloatFails(const char* s) {\n  uint32_t actual_bits;\n  ASSERT_EQ(Result::Error,\n            ParseFloat(LiteralType::Hexfloat, s, s + strlen(s), &actual_bits))\n      << s;\n}\n\nvoid AssertHexDoubleEquals(uint64_t expected_bits, const char* s) {\n  uint64_t actual_bits;\n  ASSERT_EQ(Result::Ok,\n            ParseDouble(LiteralType::Hexfloat, s, s + strlen(s), &actual_bits))\n      << s;\n  ASSERT_EQ(expected_bits, actual_bits);\n}\n\nvoid AssertHexDoubleFails(const char* s) {\n  uint64_t actual_bits;\n  ASSERT_EQ(Result::Error,\n            ParseDouble(LiteralType::Hexfloat, s, s + strlen(s), &actual_bits))\n      << s;\n}\n\n}  // end anonymous namespace\n\nTEST(ParseInt8, Both) {\n  AssertInt8Equals(0, \"0\");\n  AssertInt8Equals(100, \"100\");\n  AssertInt8Equals(123, \"123\");\n  AssertInt8Equals(127, \"127\");\n  AssertInt8Equals(255, \"255\");\n  AssertInt8Equals(0xca, \"0xca\");\n  AssertInt8Equals(0x7f, \"0x7f\");\n  AssertInt8Equals(0x80, \"0x80\");\n  AssertInt8Equals(0xff, \"0xff\");\n}\n\nTEST(ParseInt8, SignedAndUnsigned) {\n  AssertInt8Equals(128, \"-128\", SignedAndUnsigned);\n  AssertInt8Equals(-0x80, \"-0x80\", SignedAndUnsigned);\n  AssertInt8Equals(255, \"-1\", SignedAndUnsigned);\n  AssertInt8Equals(-1, \"-0x1\", SignedAndUnsigned);\n  AssertInt8Equals(1, \"+1\", SignedAndUnsigned);\n  AssertInt8Equals(-0x7b, \"-0x7B\", SignedAndUnsigned);\n  AssertInt8Equals(0xab, \"+0xab\", SignedAndUnsigned);\n}\n\nTEST(ParseInt8, Invalid) {\n  AssertInt8Fails(\"\");\n  AssertInt8Fails(\"-100hello\");\n  AssertInt8Fails(\"0XAB\");\n  AssertInt8Fails(\"0xga\");\n  AssertInt8Fails(\"two\");\n}\n\nTEST(ParseInt8, Underscores) {\n  AssertInt8Equals(123, \"12_3\", Both);\n  AssertInt8Equals(123, \"+12_3\", SignedAndUnsigned);\n  AssertInt8Equals(-123, \"-1_23\", SignedAndUnsigned);\n  AssertInt8Equals(19, \"1______9\", Both);\n  AssertInt8Equals(0xab, \"0xa_b\", Both);\n  AssertInt8Equals(0xab, \"+0xa_b\", SignedAndUnsigned);\n  AssertInt8Equals(-0x7b, \"-0x7_b\", SignedAndUnsigned);\n}\n\nTEST(ParseInt8, Overflow) {\n  AssertInt8Fails(\"256\");\n  AssertInt8Fails(\"-129\");\n  AssertInt8Fails(\"0x100\");\n  AssertInt8Fails(\"-0x81\");\n  AssertInt8Fails(\"1231231231231231231231\");\n}\n\nTEST(ParseInt16, Both) {\n  AssertInt16Equals(0, \"0\");\n  AssertInt16Equals(1000, \"1000\");\n  AssertInt16Equals(12345, \"12345\");\n  AssertInt16Equals(32767, \"32767\");\n  AssertInt16Equals(65535, \"65535\");\n  AssertInt16Equals(0xcafe, \"0xcafe\");\n  AssertInt16Equals(0x7fff, \"0x7fff\");\n  AssertInt16Equals(0x8000, \"0x8000\");\n  AssertInt16Equals(0xffff, \"0xffff\");\n}\n\nTEST(ParseInt16, SignedAndUnsigned) {\n  AssertInt16Equals(32768, \"-32768\", SignedAndUnsigned);\n  AssertInt16Equals(-0x8000, \"-0x8000\", SignedAndUnsigned);\n  AssertInt16Equals(65535, \"-1\", SignedAndUnsigned);\n  AssertInt16Equals(-1, \"-0x1\", SignedAndUnsigned);\n  AssertInt16Equals(1, \"+1\", SignedAndUnsigned);\n  AssertInt16Equals(-0x7bcd, \"-0x7BCD\", SignedAndUnsigned);\n  AssertInt16Equals(0xabcd, \"+0xabcd\", SignedAndUnsigned);\n}\n\nTEST(ParseInt16, Invalid) {\n  AssertInt16Fails(\"\");\n  AssertInt16Fails(\"-100hello\");\n  AssertInt16Fails(\"0XABCD\");\n  AssertInt16Fails(\"0xgabb\");\n  AssertInt16Fails(\"two\");\n}\n\nTEST(ParseInt16, Underscores) {\n  AssertInt16Equals(12345, \"12_345\", Both);\n  AssertInt16Equals(12345, \"+12_345\", SignedAndUnsigned);\n  AssertInt16Equals(-12345, \"-123_45\", SignedAndUnsigned);\n  AssertInt16Equals(19, \"1______9\", Both);\n  AssertInt16Equals(0xabcd, \"0xa_b_c_d\", Both);\n  AssertInt16Equals(0xabcd, \"+0xa_b_c_d\", SignedAndUnsigned);\n  AssertInt16Equals(-0x7bcd, \"-0x7_b_c_d\", SignedAndUnsigned);\n}\n\nTEST(ParseInt16, Overflow) {\n  AssertInt16Fails(\"65536\");\n  AssertInt16Fails(\"-32769\");\n  AssertInt16Fails(\"0x10000\");\n  AssertInt16Fails(\"-0x8001\");\n  AssertInt16Fails(\"1231231231231231231231\");\n}\n\nTEST(ParseInt32, Both) {\n  AssertInt32Equals(0, \"0\");\n  AssertInt32Equals(1000, \"1000\");\n  AssertInt32Equals(123456789, \"123456789\");\n  AssertInt32Equals(2147483647, \"2147483647\");\n  AssertInt32Equals(4294967295u, \"4294967295\");\n  AssertInt32Equals(0xcafef00du, \"0xcafef00d\");\n  AssertInt32Equals(0x7fffffff, \"0x7fffffff\");\n  AssertInt32Equals(0x80000000u, \"0x80000000\");\n  AssertInt32Equals(0xffffffffu, \"0xffffffff\");\n}\n\nTEST(ParseInt32, SignedAndUnsigned) {\n  AssertInt32Equals(2147483648, \"-2147483648\", SignedAndUnsigned);\n  AssertInt32Equals(-0x80000000ll, \"-0x80000000\", SignedAndUnsigned);\n  AssertInt32Equals(4294967295u, \"-1\", SignedAndUnsigned);\n  AssertInt32Equals(-1, \"-0x1\", SignedAndUnsigned);\n  AssertInt32Equals(1, \"+1\", SignedAndUnsigned);\n  AssertInt32Equals(-0xabcd, \"-0xABCD\", SignedAndUnsigned);\n  AssertInt32Equals(0xabcd, \"+0xabcd\", SignedAndUnsigned);\n}\n\nTEST(ParseInt32, Invalid) {\n  AssertInt32Fails(\"\");\n  AssertInt32Fails(\"-100hello\");\n  AssertInt32Fails(\"0XABCDEF\");\n  AssertInt32Fails(\"0xgabba\");\n  AssertInt32Fails(\"two\");\n}\n\nTEST(ParseInt32, Underscores) {\n  AssertInt32Equals(123456789, \"12_345_6789\", Both);\n  AssertInt32Equals(123456789, \"+12_345_6789\", SignedAndUnsigned);\n  AssertInt32Equals(-123456789, \"-12345_6789\", SignedAndUnsigned);\n  AssertInt32Equals(19, \"1______9\", Both);\n  AssertInt32Equals(0xabcd, \"0xa_b_c_d\", Both);\n  AssertInt32Equals(0xabcd, \"+0xa_b_c_d\", SignedAndUnsigned);\n  AssertInt32Equals(-0xabcd, \"-0xa_b_c_d\", SignedAndUnsigned);\n}\n\nTEST(ParseInt32, Overflow) {\n  AssertInt32Fails(\"4294967296\");\n  AssertInt32Fails(\"-2147483649\");\n  AssertInt32Fails(\"0x100000000\");\n  AssertInt32Fails(\"-0x80000001\");\n  AssertInt32Fails(\"1231231231231231231231\");\n}\n\nTEST(ParseInt64, Both) {\n  AssertInt64Equals(0, \"0\");\n  AssertInt64Equals(1000, \"1000\");\n  AssertInt64Equals(123456789, \"123456789\");\n  AssertInt64Equals(9223372036854775807ull, \"9223372036854775807\");\n  AssertInt64Equals(18446744073709551615ull, \"18446744073709551615\");\n  AssertInt64Equals(0x7fffffffffffffffull, \"0x7fffffffffffffff\");\n  AssertInt64Equals(0x8000000000000000ull, \"0x8000000000000000\");\n  AssertInt64Equals(0xffffffffffffffffull, \"0xffffffffffffffff\");\n}\n\nTEST(ParseInt64, SignedAndUnsigned) {\n  AssertInt64Equals(9223372036854775808ull, \"-9223372036854775808\",\n                    SignedAndUnsigned);\n  AssertInt64Equals(18446744073709551615ull, \"-1\", SignedAndUnsigned);\n  AssertInt64Equals(-1, \"-0x1\", SignedAndUnsigned);\n  AssertInt64Equals(1, \"+1\", SignedAndUnsigned);\n  AssertInt64Equals(-0x0bcdefabcdefabcdll, \"-0x0BCDEFABCDEFABCD\",\n                    SignedAndUnsigned);\n  AssertInt64Equals(0xabcdefabcdefabcdll, \"+0xabcdefabcdefabcd\",\n                    SignedAndUnsigned);\n}\n\nTEST(ParseInt64, Invalid) {\n  AssertInt64Fails(\"\");\n  AssertInt64Fails(\"-100hello\");\n  AssertInt64Fails(\"0XABCDEF\");\n  AssertInt64Fails(\"0xgabba\");\n  AssertInt64Fails(\"two\");\n}\n\nTEST(ParseInt64, Underscores) {\n  AssertInt64Equals(123456789, \"12_345_6789\", Both);\n  AssertInt64Equals(123456789, \"+12_345_6789\", SignedAndUnsigned);\n  AssertInt64Equals(-123456789, \"-12345_6789\", SignedAndUnsigned);\n  AssertInt64Equals(19, \"1______9\", Both);\n  AssertInt64Equals(0xabcd, \"0xa_b_c_d\", Both);\n  AssertInt64Equals(0xabcd, \"+0xa_b_c_d\", SignedAndUnsigned);\n  AssertInt64Equals(-0xabcd, \"-0xa_b_c_d\", SignedAndUnsigned);\n}\n\nTEST(ParseInt64, Overflow) {\n  AssertInt64Fails(\"18446744073709551616\");\n  AssertInt64Fails(\"-9223372036854775809\");\n  AssertInt32Fails(\"0x10000000000000000\");\n  AssertInt32Fails(\"-0x80000000000000001\");\n  AssertInt64Fails(\"1231231231231231231231\");\n}\n\nTEST(ParseUint64, Basic) {\n  AssertUint64Equals(0, \"0\");\n  AssertUint64Equals(1000, \"1000\");\n  AssertUint64Equals(123456789, \"123456789\");\n  AssertUint64Equals(1844674407370955161ull, \"1844674407370955161\");\n  AssertUint64Equals(18446744073709551615ull, \"18446744073709551615\");\n\n  AssertUint64Equals(0, \"0x0\");\n  AssertUint64Equals(0x1000, \"0x1000\");\n  AssertUint64Equals(0x123456789, \"0x123456789\");\n  AssertUint64Equals(0xabcdef, \"0xabcdef\");\n  AssertUint64Equals(0xffffffffffffffull, \"0xffffffffffffff\");\n  AssertUint64Equals(0xfffffffffffffffull, \"0xfffffffffffffff\");\n\n  AssertUint64Equals(0xabcdefabcdefabcdull, \"0xabcdefabcdefabcd\");\n}\n\nTEST(ParseUint64, NoOctal) {\n  AssertUint64Equals(100, \"0100\");\n  AssertUint64Equals(888, \"0000888\");\n}\n\nTEST(ParseUint64, Invalid) {\n  AssertUint64Fails(\"\");\n  AssertUint64Fails(\"-100\");\n  AssertUint64Fails(\"0XABCDEF\");\n  AssertUint64Fails(\"0xgabba\");\n  AssertUint64Fails(\"two\");\n}\n\nTEST(ParseUint64, Underscores) {\n  AssertUint64Equals(123456789, \"12_345_6789\");\n  AssertUint64Equals(19, \"1______9\");\n  AssertUint64Equals(0xabcd, \"0xa_b_c_d\");\n}\n\nTEST(ParseUint64, Overflow) {\n  AssertUint64Fails(\"0x10000000000000000\");\n  AssertUint64Fails(\"18446744073709551616\");\n  AssertUint64Fails(\"62857453058642199420\");\n  AssertUint64Fails(\"82000999361882825820\");\n  AssertUint64Fails(\"126539114687237086210\");\n  AssertUint64Fails(\"10000000000000000000000000000000000000000\");\n}\n\nTEST(ParseUint128, Basic) {\n  AssertUint128Equals({0, 0, 0, 0}, \"0\");\n  AssertUint128Equals({1, 0, 0, 0}, \"1\");\n  AssertUint128Equals({0x100f0e0d, 0x0c0b0a09, 0x08070605, 0x04030201},\n                      \"5332529520247008778714484145835150861\");\n  AssertUint128Equals({0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff},\n                      \"340282366920938463463374607431768211455\");\n  AssertUint128Equals({0, 0, 1, 0}, \"18446744073709551616\");\n}\n\nTEST(ParseUint128, Invalid) {\n  AssertUint128Fails(\"\");\n  AssertUint128Fails(\"-1\");\n  AssertUint128Fails(\"340282366920938463463374607431768211456\");\n  AssertUint128Fails(\"123a456\");\n}\n\nTEST(ParseFloat, NonCanonical) {\n  AssertHexFloatEquals(0x3f800000, \"0x00000000000000000000001.0p0\");\n  AssertHexFloatEquals(0x3f800000, \"0x1.00000000000000000000000p0\");\n  AssertHexFloatEquals(0x3f800000, \"0x0.0000000000000000000001p88\");\n}\n\nTEST(ParseFloat, Basic) {\n  AssertHexFloatEquals(0, \"0x0p0\");\n  AssertHexFloatEquals(0x3f800000, \"0x1\");\n}\n\nTEST(ParseFloat, Rounding) {\n  // |------- 23 bits -----| V-- extra bit\n  //\n  // 11111111111111111111101 0  ==> no rounding\n  AssertHexFloatEquals(0x7f7ffffd, \"0x1.fffffap127\");\n  // 11111111111111111111101 1  ==> round up\n  AssertHexFloatEquals(0x7f7ffffe, \"0x1.fffffbp127\");\n  // 11111111111111111111110 0  ==> no rounding\n  AssertHexFloatEquals(0x7f7ffffe, \"0x1.fffffcp127\");\n  // 11111111111111111111110 1  ==> round down\n  AssertHexFloatEquals(0x7f7ffffe, \"0x1.fffffdp127\");\n  // 11111111111111111111111 0  ==> no rounding\n  AssertHexFloatEquals(0x7f7fffff, \"0x1.fffffep127\");\n}\n\n// Duplicate the spec tests here for easier debugging.\nTEST(ParseFloat, RoundingSpec) {\n  static const struct {\n    const char* input;\n    uint32_t output;\n  } kTests[] = {\n      {\"+0x1.00000100000000000p-50\", 0x26800000},\n      {\"-0x1.00000100000000000p-50\", 0xa6800000},\n      {\"+0x1.00000100000000001p-50\", 0x26800001},\n      {\"-0x1.00000100000000001p-50\", 0xa6800001},\n      {\"+0x1.000001fffffffffffp-50\", 0x26800001},\n      {\"-0x1.000001fffffffffffp-50\", 0xa6800001},\n      {\"+0x1.00000200000000000p-50\", 0x26800001},\n      {\"-0x1.00000200000000000p-50\", 0xa6800001},\n      {\"+0x1.00000200000000001p-50\", 0x26800001},\n      {\"-0x1.00000200000000001p-50\", 0xa6800001},\n      {\"+0x1.000002fffffffffffp-50\", 0x26800001},\n      {\"-0x1.000002fffffffffffp-50\", 0xa6800001},\n      {\"+0x1.00000300000000000p-50\", 0x26800002},\n      {\"-0x1.00000300000000000p-50\", 0xa6800002},\n      {\"+0x1.00000300000000001p-50\", 0x26800002},\n      {\"-0x1.00000300000000001p-50\", 0xa6800002},\n      {\"+0x1.000003fffffffffffp-50\", 0x26800002},\n      {\"-0x1.000003fffffffffffp-50\", 0xa6800002},\n      {\"+0x1.00000400000000000p-50\", 0x26800002},\n      {\"-0x1.00000400000000000p-50\", 0xa6800002},\n      {\"+0x1.00000400000000001p-50\", 0x26800002},\n      {\"-0x1.00000400000000001p-50\", 0xa6800002},\n      {\"+0x1.000004fffffffffffp-50\", 0x26800002},\n      {\"-0x1.000004fffffffffffp-50\", 0xa6800002},\n      {\"+0x1.00000500000000000p-50\", 0x26800002},\n      {\"-0x1.00000500000000000p-50\", 0xa6800002},\n      {\"+0x1.00000500000000001p-50\", 0x26800003},\n      {\"-0x1.00000500000000001p-50\", 0xa6800003},\n      {\"+0x4000.004000000p-64\", 0x26800000},\n      {\"-0x4000.004000000p-64\", 0xa6800000},\n      {\"+0x4000.004000001p-64\", 0x26800001},\n      {\"-0x4000.004000001p-64\", 0xa6800001},\n      {\"+0x4000.007ffffffp-64\", 0x26800001},\n      {\"-0x4000.007ffffffp-64\", 0xa6800001},\n      {\"+0x4000.008000000p-64\", 0x26800001},\n      {\"-0x4000.008000000p-64\", 0xa6800001},\n      {\"+0x4000.008000001p-64\", 0x26800001},\n      {\"-0x4000.008000001p-64\", 0xa6800001},\n      {\"+0x4000.00bffffffp-64\", 0x26800001},\n      {\"-0x4000.00bffffffp-64\", 0xa6800001},\n      {\"+0x4000.00c000000p-64\", 0x26800002},\n      {\"-0x4000.00c000000p-64\", 0xa6800002},\n      {\"+0x4000.00c000001p-64\", 0x26800002},\n      {\"-0x4000.00c000001p-64\", 0xa6800002},\n      {\"+0x4000.00fffffffp-64\", 0x26800002},\n      {\"-0x4000.00fffffffp-64\", 0xa6800002},\n      {\"+0x4000.010000001p-64\", 0x26800002},\n      {\"-0x4000.010000001p-64\", 0xa6800002},\n      {\"+0x4000.013ffffffp-64\", 0x26800002},\n      {\"-0x4000.013ffffffp-64\", 0xa6800002},\n      {\"+0x4000.014000001p-64\", 0x26800003},\n      {\"-0x4000.014000001p-64\", 0xa6800003},\n      {\"+0x1.00000100000000000p+50\", 0x58800000},\n      {\"-0x1.00000100000000000p+50\", 0xd8800000},\n      {\"+0x1.00000100000000001p+50\", 0x58800001},\n      {\"-0x1.00000100000000001p+50\", 0xd8800001},\n      {\"+0x1.000001fffffffffffp+50\", 0x58800001},\n      {\"-0x1.000001fffffffffffp+50\", 0xd8800001},\n      {\"+0x1.00000200000000000p+50\", 0x58800001},\n      {\"-0x1.00000200000000000p+50\", 0xd8800001},\n      {\"+0x1.00000200000000001p+50\", 0x58800001},\n      {\"-0x1.00000200000000001p+50\", 0xd8800001},\n      {\"+0x1.000002fffffffffffp+50\", 0x58800001},\n      {\"-0x1.000002fffffffffffp+50\", 0xd8800001},\n      {\"+0x1.00000300000000000p+50\", 0x58800002},\n      {\"-0x1.00000300000000000p+50\", 0xd8800002},\n      {\"+0x1.00000300000000001p+50\", 0x58800002},\n      {\"-0x1.00000300000000001p+50\", 0xd8800002},\n      {\"+0x1.000003fffffffffffp+50\", 0x58800002},\n      {\"-0x1.000003fffffffffffp+50\", 0xd8800002},\n      {\"+0x1.00000400000000000p+50\", 0x58800002},\n      {\"-0x1.00000400000000000p+50\", 0xd8800002},\n      {\"+0x1.00000400000000001p+50\", 0x58800002},\n      {\"-0x1.00000400000000001p+50\", 0xd8800002},\n      {\"+0x1.000004fffffffffffp+50\", 0x58800002},\n      {\"-0x1.000004fffffffffffp+50\", 0xd8800002},\n      {\"+0x1.00000500000000000p+50\", 0x58800002},\n      {\"-0x1.00000500000000000p+50\", 0xd8800002},\n      {\"+0x1.00000500000000001p+50\", 0x58800003},\n      {\"-0x1.00000500000000001p+50\", 0xd8800003},\n      {\"+0x4000004000000\", 0x58800000},\n      {\"-0x4000004000000\", 0xd8800000},\n      {\"+0x4000004000001\", 0x58800001},\n      {\"-0x4000004000001\", 0xd8800001},\n      {\"+0x4000007ffffff\", 0x58800001},\n      {\"-0x4000007ffffff\", 0xd8800001},\n      {\"+0x4000008000000\", 0x58800001},\n      {\"-0x4000008000000\", 0xd8800001},\n      {\"+0x4000008000001\", 0x58800001},\n      {\"-0x4000008000001\", 0xd8800001},\n      {\"+0x400000bffffff\", 0x58800001},\n      {\"-0x400000bffffff\", 0xd8800001},\n      {\"+0x400000c000000\", 0x58800002},\n      {\"-0x400000c000000\", 0xd8800002},\n      {\"+0x0.00000100000000000p-126\", 0x0},\n      {\"-0x0.00000100000000000p-126\", 0x80000000},\n      {\"+0x0.00000100000000001p-126\", 0x1},\n      {\"-0x0.00000100000000001p-126\", 0x80000001},\n      {\"+0x0.00000101000000000p-126\", 0x1},\n      {\"+0x0.000001fffffffffffp-126\", 0x1},\n      {\"-0x0.000001fffffffffffp-126\", 0x80000001},\n      {\"+0x0.00000200000000000p-126\", 0x1},\n      {\"-0x0.00000200000000000p-126\", 0x80000001},\n      {\"+0x0.00000200000000001p-126\", 0x1},\n      {\"-0x0.00000200000000001p-126\", 0x80000001},\n      {\"+0x0.000002fffffffffffp-126\", 0x1},\n      {\"-0x0.000002fffffffffffp-126\", 0x80000001},\n      {\"+0x0.00000300000000000p-126\", 0x2},\n      {\"-0x0.00000300000000000p-126\", 0x80000002},\n      {\"+0x0.00000300000000001p-126\", 0x2},\n      {\"-0x0.00000300000000001p-126\", 0x80000002},\n      {\"+0x0.000003fffffffffffp-126\", 0x2},\n      {\"-0x0.000003fffffffffffp-126\", 0x80000002},\n      {\"+0x0.00000400000000000p-126\", 0x2},\n      {\"-0x0.00000400000000000p-126\", 0x80000002},\n      {\"+0x0.00000400000000001p-126\", 0x2},\n      {\"-0x0.00000400000000001p-126\", 0x80000002},\n      {\"+0x0.000004fffffffffffp-126\", 0x2},\n      {\"-0x0.000004fffffffffffp-126\", 0x80000002},\n      {\"+0x0.00000500000000000p-126\", 0x2},\n      {\"-0x0.00000500000000000p-126\", 0x80000002},\n      {\"+0x0.00000500000000001p-126\", 0x3},\n      {\"-0x0.00000500000000001p-126\", 0x80000003},\n      {\"+0x1.fffffe8p127\", 0x7f7fffff},\n      {\"-0x1.fffffe8p127\", 0xff7fffff},\n      {\"+0x1.fffffefffffff8p127\", 0x7f7fffff},\n      {\"-0x1.fffffefffffff8p127\", 0xff7fffff},\n      {\"+0x1.fffffefffffffffffp127\", 0x7f7fffff},\n      {\"-0x1.fffffefffffffffffp127\", 0xff7fffff},\n  };\n\n  for (auto test : kTests) {\n    AssertHexFloatEquals(test.output, test.input);\n  }\n}\n\nTEST(ParseFloat, OutOfRange) {\n  AssertHexFloatFails(\"0x1p128\");\n  AssertHexFloatFails(\"-0x1p128\");\n  AssertHexFloatFails(\"0x1.ffffffp127\");\n  AssertHexFloatFails(\"-0x1.ffffffp127\");\n}\n\nTEST(ParseDouble, NonCanonical) {\n  AssertHexDoubleEquals(0x3ff0000000000000, \"0x00000000000000000000001.0p0\");\n  AssertHexDoubleEquals(0x3ff0000000000000, \"0x1.00000000000000000000000p0\");\n  AssertHexDoubleEquals(0x3ff0000000000000, \"0x0.0000000000000000000001p88\");\n}\n\nTEST(ParseDouble, Rounding) {\n  // |-------------------- 52 bits ---------------------| V-- extra bit\n  //\n  // 1111111111111111111111111111111111111111111111111101 0  ==> no rounding\n  AssertHexDoubleEquals(0x7feffffffffffffd, \"0x1.ffffffffffffd0p1023\");\n  // 1111111111111111111111111111111111111111111111111101 1  ==> round up\n  AssertHexDoubleEquals(0x7feffffffffffffe, \"0x1.ffffffffffffd8p1023\");\n  // 1111111111111111111111111111111111111111111111111110 0  ==> no rounding\n  AssertHexDoubleEquals(0x7feffffffffffffe, \"0x1.ffffffffffffe0p1023\");\n  // 1111111111111111111111111111111111111111111111111110 1  ==> round down\n  AssertHexDoubleEquals(0x7feffffffffffffe, \"0x1.ffffffffffffe8p1023\");\n  // 1111111111111111111111111111111111111111111111111111 0  ==> no rounding\n  AssertHexDoubleEquals(0x7fefffffffffffff, \"0x1.fffffffffffff0p1023\");\n}\n\nTEST(ParseDouble, OutOfRange) {\n  AssertHexDoubleFails(\"0x1p1024\");\n  AssertHexDoubleFails(\"-0x1p1024\");\n  AssertHexDoubleFails(\"0x1.fffffffffffff8p1023\");\n  AssertHexDoubleFails(\"-0x1.fffffffffffff8p1023\");\n}\n\n// Duplicate the spec tests here for easier debugging.\nTEST(ParseDouble, RoundingSpec) {\n  static const struct {\n    const char* input;\n    uint64_t output;\n  } kTests[] = {\n      {\"+0x1.000000000000080000000000p-600\", 1905022642377719808ull},\n      {\"-0x1.000000000000080000000000p-600\", 11128394679232495616ull},\n      {\"+0x1.000000000000080000000001p-600\", 1905022642377719809ull},\n      {\"-0x1.000000000000080000000001p-600\", 11128394679232495617ull},\n      {\"+0x1.0000000000000fffffffffffp-600\", 1905022642377719809ull},\n      {\"-0x1.0000000000000fffffffffffp-600\", 11128394679232495617ull},\n      {\"+0x1.000000000000100000000000p-600\", 1905022642377719809ull},\n      {\"-0x1.000000000000100000000000p-600\", 11128394679232495617ull},\n      {\"+0x1.000000000000100000000001p-600\", 1905022642377719809ull},\n      {\"-0x1.000000000000100000000001p-600\", 11128394679232495617ull},\n      {\"+0x1.00000000000017ffffffffffp-600\", 1905022642377719809ull},\n      {\"-0x1.00000000000017ffffffffffp-600\", 11128394679232495617ull},\n      {\"+0x1.000000000000180000000000p-600\", 1905022642377719810ull},\n      {\"-0x1.000000000000180000000000p-600\", 11128394679232495618ull},\n      {\"+0x1.000000000000180000000001p-600\", 1905022642377719810ull},\n      {\"-0x1.000000000000180000000001p-600\", 11128394679232495618ull},\n      {\"+0x1.0000000000001fffffffffffp-600\", 1905022642377719810ull},\n      {\"-0x1.0000000000001fffffffffffp-600\", 11128394679232495618ull},\n      {\"+0x1.000000000000200000000000p-600\", 1905022642377719810ull},\n      {\"-0x1.000000000000200000000000p-600\", 11128394679232495618ull},\n      {\"+0x1.000000000000200000000001p-600\", 1905022642377719810ull},\n      {\"-0x1.000000000000200000000001p-600\", 11128394679232495618ull},\n      {\"+0x1.00000000000027ffffffffffp-600\", 1905022642377719810ull},\n      {\"-0x1.00000000000027ffffffffffp-600\", 11128394679232495618ull},\n      {\"+0x1.000000000000280000000001p-600\", 1905022642377719811ull},\n      {\"-0x1.000000000000280000000001p-600\", 11128394679232495619ull},\n      {\"+0x8000000.000000400000000000p-627\", 1905022642377719808ull},\n      {\"-0x8000000.000000400000000000p-627\", 11128394679232495616ull},\n      {\"+0x8000000.000000400000000001p-627\", 1905022642377719809ull},\n      {\"-0x8000000.000000400000000001p-627\", 11128394679232495617ull},\n      {\"+0x8000000.0000007fffffffffffp-627\", 1905022642377719809ull},\n      {\"-0x8000000.0000007fffffffffffp-627\", 11128394679232495617ull},\n      {\"+0x8000000.000000800000000000p-627\", 1905022642377719809ull},\n      {\"-0x8000000.000000800000000000p-627\", 11128394679232495617ull},\n      {\"+0x8000000.000000800000000001p-627\", 1905022642377719809ull},\n      {\"-0x8000000.000000800000000001p-627\", 11128394679232495617ull},\n      {\"+0x8000000.000000bfffffffffffp-627\", 1905022642377719809ull},\n      {\"-0x8000000.000000bfffffffffffp-627\", 11128394679232495617ull},\n      {\"+0x8000000.000000c00000000000p-627\", 1905022642377719810ull},\n      {\"-0x8000000.000000c00000000000p-627\", 11128394679232495618ull},\n      {\"+0x8000000.000000c00000000001p-627\", 1905022642377719810ull},\n      {\"-0x8000000.000000c00000000001p-627\", 11128394679232495618ull},\n      {\"+0x8000000.000000ffffffffffffp-627\", 1905022642377719810ull},\n      {\"-0x8000000.000000ffffffffffffp-627\", 11128394679232495618ull},\n      {\"+0x8000000.000001000000000000p-627\", 1905022642377719810ull},\n      {\"-0x8000000.000001000000000000p-627\", 11128394679232495618ull},\n      {\"+0x8000000.000001000000000001p-627\", 1905022642377719810ull},\n      {\"-0x8000000.000001000000000001p-627\", 11128394679232495618ull},\n      {\"+0x8000000.0000013fffffffffffp-627\", 1905022642377719810ull},\n      {\"-0x8000000.0000013fffffffffffp-627\", 11128394679232495618ull},\n      {\"+0x8000000.000001400000000001p-627\", 1905022642377719811ull},\n      {\"-0x8000000.000001400000000001p-627\", 11128394679232495619ull},\n      {\"+0x1.000000000000080000000000p+600\", 7309342195222315008ull},\n      {\"-0x1.000000000000080000000000p+600\", 16532714232077090816ull},\n      {\"+0x1.000000000000080000000001p+600\", 7309342195222315009ull},\n      {\"-0x1.000000000000080000000001p+600\", 16532714232077090817ull},\n      {\"+0x1.0000000000000fffffffffffp+600\", 7309342195222315009ull},\n      {\"-0x1.0000000000000fffffffffffp+600\", 16532714232077090817ull},\n      {\"+0x1.000000000000100000000000p+600\", 7309342195222315009ull},\n      {\"-0x1.000000000000100000000000p+600\", 16532714232077090817ull},\n      {\"+0x1.000000000000100000000001p+600\", 7309342195222315009ull},\n      {\"-0x1.000000000000100000000001p+600\", 16532714232077090817ull},\n      {\"+0x1.00000000000017ffffffffffp+600\", 7309342195222315009ull},\n      {\"-0x1.00000000000017ffffffffffp+600\", 16532714232077090817ull},\n      {\"+0x1.000000000000180000000000p+600\", 7309342195222315010ull},\n      {\"-0x1.000000000000180000000000p+600\", 16532714232077090818ull},\n      {\"+0x1.000000000000180000000001p+600\", 7309342195222315010ull},\n      {\"-0x1.000000000000180000000001p+600\", 16532714232077090818ull},\n      {\"+0x1.0000000000001fffffffffffp+600\", 7309342195222315010ull},\n      {\"-0x1.0000000000001fffffffffffp+600\", 16532714232077090818ull},\n      {\"+0x1.000000000000200000000000p+600\", 7309342195222315010ull},\n      {\"-0x1.000000000000200000000000p+600\", 16532714232077090818ull},\n      {\"+0x1.000000000000200000000001p+600\", 7309342195222315010ull},\n      {\"-0x1.000000000000200000000001p+600\", 16532714232077090818ull},\n      {\"+0x1.00000000000027ffffffffffp+600\", 7309342195222315010ull},\n      {\"-0x1.00000000000027ffffffffffp+600\", 16532714232077090818ull},\n      {\"+0x1.000000000000280000000000p+600\", 7309342195222315010ull},\n      {\"-0x1.000000000000280000000000p+600\", 16532714232077090818ull},\n      {\"+0x1.000000000000280000000001p+600\", 7309342195222315011ull},\n      {\"-0x1.000000000000280000000001p+600\", 16532714232077090819ull},\n      {\"+0x2000000000000100000000000\", 5044031582654955520ull},\n      {\"-0x2000000000000100000000000\", 14267403619509731328ull},\n      {\"+0x2000000000000100000000001\", 5044031582654955521ull},\n      {\"-0x2000000000000100000000001\", 14267403619509731329ull},\n      {\"+0x20000000000001fffffffffff\", 5044031582654955521ull},\n      {\"-0x20000000000001fffffffffff\", 14267403619509731329ull},\n      {\"+0x2000000000000200000000000\", 5044031582654955521ull},\n      {\"-0x2000000000000200000000000\", 14267403619509731329ull},\n      {\"+0x2000000000000200000000001\", 5044031582654955521ull},\n      {\"-0x2000000000000200000000001\", 14267403619509731329ull},\n      {\"+0x20000000000002fffffffffff\", 5044031582654955521ull},\n      {\"-0x20000000000002fffffffffff\", 14267403619509731329ull},\n      {\"+0x2000000000000300000000000\", 5044031582654955522ull},\n      {\"-0x2000000000000300000000000\", 14267403619509731330ull},\n      {\"+0x2000000000000300000000001\", 5044031582654955522ull},\n      {\"-0x2000000000000300000000001\", 14267403619509731330ull},\n      {\"+0x20000000000003fffffffffff\", 5044031582654955522ull},\n      {\"-0x20000000000003fffffffffff\", 14267403619509731330ull},\n      {\"+0x2000000000000400000000000\", 5044031582654955522ull},\n      {\"-0x2000000000000400000000000\", 14267403619509731330ull},\n      {\"+0x2000000000000400000000001\", 5044031582654955522ull},\n      {\"-0x2000000000000400000000001\", 14267403619509731330ull},\n      {\"+0x20000000000004fffffffffff\", 5044031582654955522ull},\n      {\"-0x20000000000004fffffffffff\", 14267403619509731330ull},\n      {\"+0x2000000000000500000000000\", 5044031582654955522ull},\n      {\"-0x2000000000000500000000000\", 14267403619509731330ull},\n      {\"+0x2000000000000500000000001\", 5044031582654955523ull},\n      {\"-0x2000000000000500000000001\", 14267403619509731331ull},\n      {\"+0x0.000000000000080000000000p-1022\", 0ull},\n      {\"-0x0.000000000000080000000000p-1022\", 9223372036854775808ull},\n      {\"+0x0.000000000000080000000001p-1022\", 1ull},\n      {\"-0x0.000000000000080000000001p-1022\", 9223372036854775809ull},\n      {\"+0x0.0000000000000fffffffffffp-1022\", 1ull},\n      {\"-0x0.0000000000000fffffffffffp-1022\", 9223372036854775809ull},\n      {\"+0x0.000000000000100000000000p-1022\", 1ull},\n      {\"-0x0.000000000000100000000000p-1022\", 9223372036854775809ull},\n      {\"+0x0.000000000000100000000001p-1022\", 1ull},\n      {\"-0x0.000000000000100000000001p-1022\", 9223372036854775809ull},\n      {\"+0x0.00000000000017ffffffffffp-1022\", 1ull},\n      {\"-0x0.00000000000017ffffffffffp-1022\", 9223372036854775809ull},\n      {\"+0x0.000000000000180000000000p-1022\", 2ull},\n      {\"-0x0.000000000000180000000000p-1022\", 9223372036854775810ull},\n      {\"+0x0.000000000000180000000001p-1022\", 2ull},\n      {\"-0x0.000000000000180000000001p-1022\", 9223372036854775810ull},\n      {\"+0x0.0000000000001fffffffffffp-1022\", 2ull},\n      {\"-0x0.0000000000001fffffffffffp-1022\", 9223372036854775810ull},\n      {\"+0x0.000000000000200000000000p-1022\", 2ull},\n      {\"-0x0.000000000000200000000000p-1022\", 9223372036854775810ull},\n      {\"+0x0.000000000000200000000001p-1022\", 2ull},\n      {\"-0x0.000000000000200000000001p-1022\", 9223372036854775810ull},\n      {\"+0x0.00000000000027ffffffffffp-1022\", 2ull},\n      {\"-0x0.00000000000027ffffffffffp-1022\", 9223372036854775810ull},\n      {\"+0x0.000000000000280000000000p-1022\", 2ull},\n      {\"-0x0.000000000000280000000000p-1022\", 9223372036854775810ull},\n      {\"+0x1.000000000000280000000001p-1022\", 4503599627370499ull},\n      {\"-0x1.000000000000280000000001p-1022\", 9227875636482146307ull},\n      {\"+0x1.fffffffffffff4p1023\", 9218868437227405311ull},\n      {\"-0x1.fffffffffffff4p1023\", 18442240474082181119ull},\n      {\"+0x1.fffffffffffff7ffffffp1023\", 9218868437227405311ull},\n      {\"-0x1.fffffffffffff7ffffffp1023\", 18442240474082181119ull},\n  };\n\n  for (auto test : kTests) {\n    AssertHexDoubleEquals(test.output, test.input);\n  }\n}\n\nvoid AssertWriteUint128Equals(const v128& value, const std::string& expected) {\n  assert(expected.length() < 128);\n  char buffer[128];\n  WriteUint128(buffer, 128, value);\n  std::string actual(buffer, buffer + expected.length());\n  ASSERT_EQ(expected, actual);\n  ASSERT_EQ(buffer[expected.length()], '\\0');\n}\n\nTEST(WriteUint128, Basic) {\n  AssertWriteUint128Equals({0, 0, 0, 0}, \"0\");\n  AssertWriteUint128Equals({1, 0, 0, 0}, \"1\");\n  AssertWriteUint128Equals({0x100f0e0d, 0x0c0b0a09, 0x08070605, 0x04030201},\n                           \"5332529520247008778714484145835150861\");\n  AssertWriteUint128Equals({0x00112233, 0x44556677, 0x8899aabb, 0xccddeeff},\n                           \"272314856204801878456120017448021860915\");\n  AssertWriteUint128Equals({0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff},\n                           \"340282366920938463463374607431768211455\");\n  AssertWriteUint128Equals({0, 0, 1, 0}, \"18446744073709551616\");\n}\n\nTEST(WriteUint128, BufferTooSmall) {\n  {\n    char buffer[20];\n    WriteUint128(buffer, 20, {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff});\n    ASSERT_EQ(buffer[19], '\\0');\n    std::string actual(buffer, buffer + 19);\n    ASSERT_EQ(\"3402823669209384634\", actual);\n  }\n\n  {\n    char buffer[3];\n    WriteUint128(buffer, 3, {123, 0, 0, 0});\n    ASSERT_EQ(buffer[0], '1');\n    ASSERT_EQ(buffer[1], '2');\n    ASSERT_EQ(buffer[2], '\\0');\n  }\n}\n"
  },
  {
    "path": "src/test-option-parser.cc",
    "content": "// Copyright 2019 WebAssembly Community Group participants\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"gtest/gtest.h\"\n\n#include <string>\n\n#include \"wabt/option-parser.h\"\n\nusing namespace wabt;\n\n#define ERROR_ENDING \"\\nTry '--help' for more information.\"\n\nTEST(OptionParser, LongFlag) {\n  bool flag = false;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddOption(\"flag\", \"help\", [&]() { flag = true; });\n  const char* args[] = {\"prog name\", \"--flag\"};\n  parser.Parse(2, const_cast<char**>(args));\n  EXPECT_EQ(true, flag);\n}\n\nTEST(OptionParser, ShortAndLongFlag) {\n  int count = 0;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddOption('f', \"flag\", \"help\", [&]() { ++count; });\n  const char* args[] = {\"prog name\", \"-f\", \"--flag\", \"-f\", \"--flag\"};\n  parser.Parse(5, const_cast<char**>(args));\n  EXPECT_EQ(4, count);\n}\n\nTEST(OptionParser, ShortFlagCombined) {\n  int count = 0;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddOption('a', \"a\", \"help\", [&]() { count += 1; });\n  parser.AddOption('b', \"b\", \"help\", [&]() { count += 2; });\n  const char* args[] = {\"prog name\", \"-aa\", \"-abb\"};\n  parser.Parse(3, const_cast<char**>(args));\n  EXPECT_EQ(7, count);\n}\n\nTEST(OptionParser, UnknownShortOption) {\n  std::string error;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.SetErrorCallback([&](const char* msg) { error = msg; });\n  const char* args[] = {\"prog name\", \"-f\"};\n  parser.Parse(2, const_cast<char**>(args));\n  EXPECT_EQ(error, \"prog: unknown option '-f'\" ERROR_ENDING);\n}\n\nTEST(OptionParser, UnknownLongOption) {\n  std::string error;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.SetErrorCallback([&](const char* msg) { error = msg; });\n  const char* args[] = {\"prog name\", \"--foo\"};\n  parser.Parse(2, const_cast<char**>(args));\n  EXPECT_EQ(error, \"prog: unknown option '--foo'\" ERROR_ENDING);\n}\n\nTEST(OptionParser, ShortAndLongParam) {\n  std::string param;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddOption('p', \"param\", \"metavar\", \"help\",\n                   [&](const char* arg) { param += arg; });\n  const char* args[] = {\"prog name\", \"-p\", \"h\", \"--param\", \"el\", \"--param=lo\"};\n  parser.Parse(6, const_cast<char**>(args));\n  EXPECT_EQ(\"hello\", param);\n}\n\nTEST(OptionParser, MissingParam) {\n  std::string error;\n  std::string param;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.SetErrorCallback([&](const char* msg) { error = msg; });\n  parser.AddOption('p', \"param\", \"metavar\", \"help\",\n                   [&](const char* arg) { param = arg; });\n  const char* args[] = {\"prog name\", \"--param\"};\n  parser.Parse(2, const_cast<char**>(args));\n  EXPECT_EQ(\"\", param);\n  EXPECT_EQ(error, \"prog: option '--param' requires argument\" ERROR_ENDING);\n}\n\nTEST(OptionParser, MissingArgument) {\n  std::string error;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddArgument(\"arg\", OptionParser::ArgumentCount::One,\n                     [&](const char* arg) {});\n  parser.SetErrorCallback([&](const char* msg) { error = msg; });\n  const char* args[] = {\"prog name\"};\n  parser.Parse(1, const_cast<char**>(args));\n  EXPECT_EQ(error, \"prog: expected arg argument.\" ERROR_ENDING);\n}\n\nTEST(OptionParser, FlagCombinedAfterShortParam) {\n  std::string error;\n  std::string param;\n  bool has_x = false;\n\n  OptionParser parser(\"prog\", \"desc\");\n  parser.SetErrorCallback([&](const char* msg) { error = msg; });\n  parser.AddOption('p', \"p\", \"metavar\", \"help\",\n                   [&](const char* arg) { param = arg; });\n  parser.AddOption('x', \"x\", \"help\", [&]() { has_x = true; });\n  const char* args[] = {\"prog name\", \"-px\", \"stuff\"};\n  parser.Parse(3, const_cast<char**>(args));\n  EXPECT_EQ(\"\", param);\n  EXPECT_TRUE(has_x);\n  EXPECT_EQ(error, \"prog: unexpected argument 'stuff'\" ERROR_ENDING);\n}\n\nTEST(OptionParser, OneArgument) {\n  std::string argument;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddArgument(\"arg\", OptionParser::ArgumentCount::One,\n                     [&](const char* arg) { argument = arg; });\n  const char* args[] = {\"prog name\", \"hello\"};\n  parser.Parse(2, const_cast<char**>(args));\n  EXPECT_EQ(\"hello\", argument);\n}\n\nTEST(OptionParser, TooManyArguments) {\n  std::string error;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.SetErrorCallback([&](const char* msg) { error = msg; });\n  parser.AddArgument(\"arg\", OptionParser::ArgumentCount::One,\n                     [&](const char* arg) {});\n  const char* args[] = {\"prog name\", \"hello\", \"goodbye\"};\n  parser.Parse(3, const_cast<char**>(args));\n  EXPECT_EQ(error, \"prog: unexpected argument 'goodbye'\" ERROR_ENDING);\n}\n\nTEST(OptionParser, OneOrMoreArguments) {\n  std::string argument;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddArgument(\"arg\", OptionParser::ArgumentCount::OneOrMore,\n                     [&](const char* arg) { argument += arg; });\n  const char* args[] = {\"prog name\", \"hello\", \"goodbye\"};\n  parser.Parse(3, const_cast<char**>(args));\n  EXPECT_EQ(\"hellogoodbye\", argument);\n}\n\nTEST(OptionParser, ZeroOrMoreArguments) {\n  std::string argument;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddArgument(\"arg\", OptionParser::ArgumentCount::ZeroOrMore,\n                     [&](const char* arg) { argument += arg; });\n\n  const char* args_none[] = {\"prog name\"};\n  parser.Parse(1, const_cast<char**>(args_none));\n  EXPECT_EQ(\"\", argument);\n\n  const char* args_many[] = {\"prog name\", \"hello\", \"goodbye\"};\n  parser.Parse(3, const_cast<char**>(args_many));\n  EXPECT_EQ(\"hellogoodbye\", argument);\n}\n\nTEST(OptionParser, StopProccessing) {\n  std::string argument;\n  bool has_x = false;\n  OptionParser parser(\"prog\", \"desc\");\n  parser.AddArgument(\"arg\", OptionParser::ArgumentCount::ZeroOrMore,\n                     [&](const char* arg) { argument += arg; });\n  parser.AddOption('x', \"x\", \"help\", [&]() { has_x = true; });\n\n  const char* args_many[] = {\"prog name\", \"-x\", \"--\", \"foo\", \"-x\", \"-y\", \"bar\"};\n  parser.Parse(7, const_cast<char**>(args_many));\n  EXPECT_TRUE(has_x);\n  EXPECT_EQ(\"foo-x-ybar\", argument);\n}\n"
  },
  {
    "path": "src/test-utf8.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"gtest/gtest.h\"\n\n#include \"wabt/utf8.h\"\n\nusing namespace wabt;\n\nnamespace {\n\nvoid assert_is_valid_utf8(bool expected,\n                          int length,\n                          int cu0 = 0,\n                          int cu1 = 0,\n                          int cu2 = 0,\n                          int cu3 = 0) {\n  assert(length <= 4);\n  char buf[4] = {static_cast<char>(cu0), static_cast<char>(cu1),\n                 static_cast<char>(cu2), static_cast<char>(cu3)};\n  if (expected) {\n    // Make sure it fails if there are continuation bytes past the end of the\n    // string.\n    for (int bad_length = 1; bad_length < length; ++bad_length) {\n      ASSERT_FALSE(IsValidUtf8(buf, bad_length))\n          << cu0 << \", \" << cu1 << \", \" << cu2 << \", \" << cu3;\n    }\n  }\n\n  ASSERT_TRUE(expected == IsValidUtf8(buf, length))\n      << cu0 << \", \" << cu1 << \", \" << cu2 << \", \" << cu3;\n}\n\nbool is_in_range(int x, int low, int high) {\n  return x >= low && x < high;\n}\n\n}  // end anonymous namespace\n\n#define FOR_RANGE(var, low, high) for (int var = low; var < high; var++)\n#define FOR_EACH_BYTE(var) FOR_RANGE(var, 0, 0x100)\n\nTEST(utf8, valid_empty) {\n  assert_is_valid_utf8(true, 0);\n}\n\nTEST(utf8, valid_1_byte) {\n  FOR_RANGE(cu0, 0, 0x80) { assert_is_valid_utf8(true, 1, cu0); }\n}\n\nTEST(utf8, invalid_continuation_bytes) {\n  FOR_RANGE(cu0, 0x80, 0xc0) { assert_is_valid_utf8(false, 1, cu0); }\n}\n\nTEST(utf8, invalid_2_byte) {\n  FOR_RANGE(cu0, 0xc0, 0xc2) { assert_is_valid_utf8(false, 1, cu0); }\n}\n\nTEST(utf8, valid_2_bytes) {\n  FOR_RANGE(cu0, 0xc2, 0xe0) {\n    FOR_EACH_BYTE(cu1) {\n      bool is_valid = is_in_range(cu1, 0x80, 0xc0);\n      assert_is_valid_utf8(is_valid, 2, cu0, cu1);\n    }\n  }\n}\n\nTEST(utf8, valid_3_bytes_e0) {\n  int cu0 = 0xe0;\n  FOR_EACH_BYTE(cu1) {\n    FOR_EACH_BYTE(cu2) {\n      bool is_valid =\n          is_in_range(cu1, 0xa0, 0xc0) && is_in_range(cu2, 0x80, 0xc0);\n      assert_is_valid_utf8(is_valid, 3, cu0, cu1, cu2);\n    }\n  }\n}\n\nTEST(utf8, valid_3_bytes) {\n  FOR_RANGE(cu0, 0xe1, 0xf0) {\n    // Handle 0xed in valid_3_bytes_ed.\n    if (cu0 == 0xed) {\n      continue;\n    }\n\n    FOR_EACH_BYTE(cu1) {\n      FOR_EACH_BYTE(cu2) {\n        bool is_valid =\n            is_in_range(cu1, 0x80, 0xc0) && is_in_range(cu2, 0x80, 0xc0);\n        assert_is_valid_utf8(is_valid, 3, cu0, cu1, cu2);\n      }\n    }\n  }\n}\n\nTEST(utf8, valid_3_bytes_ed) {\n  int cu0 = 0xed;\n  FOR_EACH_BYTE(cu1) {\n    FOR_EACH_BYTE(cu2) {\n      bool is_valid =\n          is_in_range(cu1, 0x80, 0xa0) && is_in_range(cu2, 0x80, 0xc0);\n      assert_is_valid_utf8(is_valid, 3, cu0, cu1, cu2);\n    }\n  }\n}\n\nTEST(utf8, valid_4_bytes_f0) {\n  int cu0 = 0xf0;\n  FOR_EACH_BYTE(cu1) {\n    FOR_EACH_BYTE(cu2) {\n      FOR_EACH_BYTE(cu3) {\n        bool is_valid = is_in_range(cu1, 0x90, 0xc0) &&\n                        is_in_range(cu2, 0x80, 0xc0) &&\n                        is_in_range(cu3, 0x80, 0xc0);\n        assert_is_valid_utf8(is_valid, 4, cu0, cu1, cu2, cu3);\n      }\n    }\n  }\n}\n\nTEST(utf8, valid_4_bytes) {\n  FOR_RANGE(cu0, 0xf1, 0xf4) {\n    FOR_EACH_BYTE(cu1) {\n      FOR_EACH_BYTE(cu2) {\n        FOR_EACH_BYTE(cu3) {\n          bool is_valid = is_in_range(cu1, 0x80, 0xc0) &&\n                          is_in_range(cu2, 0x80, 0xc0) &&\n                          is_in_range(cu3, 0x80, 0xc0);\n          assert_is_valid_utf8(is_valid, 4, cu0, cu1, cu2, cu3);\n        }\n      }\n    }\n  }\n}\n\nTEST(utf8, valid_4_bytes_f4) {\n  int cu0 = 0xf4;\n  FOR_EACH_BYTE(cu1) {\n    FOR_EACH_BYTE(cu2) {\n      FOR_EACH_BYTE(cu3) {\n        bool is_valid = is_in_range(cu1, 0x80, 0x90) &&\n                        is_in_range(cu2, 0x80, 0xc0) &&\n                        is_in_range(cu3, 0x80, 0xc0);\n        assert_is_valid_utf8(is_valid, 4, cu0, cu1, cu2, cu3);\n      }\n    }\n  }\n}\n\nTEST(utf8, invalid_4_bytes) {\n  FOR_RANGE(cu0, 0xf5, 0x100) {\n    assert_is_valid_utf8(false, 4, cu0, 0x80, 0x80, 0x80);\n  }\n}\n"
  },
  {
    "path": "src/test-wast-parser.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"gtest/gtest.h\"\n\n#include <memory>\n\n#include \"wabt/cast.h\"\n#include \"wabt/wast-lexer.h\"\n#include \"wabt/wast-parser.h\"\n\nusing namespace wabt;\n\nnamespace {\n\nstd::string repeat(std::string s, size_t count) {\n  std::string result;\n  for (size_t i = 0; i < count; ++i) {\n    result += s;\n  }\n  return result;\n}\n\nErrors ParseInvalidModule(std::string text) {\n  Errors errors;\n  auto lexer =\n      WastLexer::CreateBufferLexer(\"test\", text.c_str(), text.size(), &errors);\n  std::unique_ptr<Module> module;\n  Features features;\n  WastParseOptions options(features);\n  Result result = ParseWatModule(lexer.get(), &module, &errors, &options);\n  EXPECT_EQ(Result::Error, result);\n\n  return errors;\n}\n\n}  // end of anonymous namespace\n\nTEST(WastParser, LongToken) {\n  std::string text;\n  text = \"(module (memory \";\n  text += repeat(\"a\", 0x5000);\n  text += \"))\";\n\n  Errors errors = ParseInvalidModule(text);\n  ASSERT_EQ(1u, errors.size());\n\n  ASSERT_EQ(ErrorLevel::Error, errors[0].error_level);\n  ASSERT_EQ(1, errors[0].loc.line);\n  ASSERT_EQ(17, errors[0].loc.first_column);\n  ASSERT_STREQ(\n      R\"(unexpected token \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...\", expected a natural number (e.g. 123).)\",\n      errors[0].message.c_str());\n}\n\nTEST(WastParser, LongTokenSpace) {\n  std::string text;\n  text = \"notparen\";\n  text += repeat(\" \", 0x10000);\n  text += \"notmodule\";\n\n  Errors errors = ParseInvalidModule(text);\n  ASSERT_EQ(2u, errors.size());\n\n  ASSERT_EQ(ErrorLevel::Error, errors[0].error_level);\n  ASSERT_EQ(1, errors[0].loc.line);\n  ASSERT_EQ(1, errors[0].loc.first_column);\n  ASSERT_STREQ(\n      R\"(unexpected token \"notparen\", expected a module field or a module.)\",\n      errors[0].message.c_str());\n\n  ASSERT_EQ(1, errors[1].loc.line);\n  ASSERT_EQ(65545, errors[1].loc.first_column);\n  ASSERT_STREQ(R\"(unexpected token notmodule, expected EOF.)\",\n               errors[1].message.c_str());\n}\n\nTEST(WastParser, Memory64Alignment) {\n  // from align.wast, the large align param should be OK with memory64 enabled\n  // TODO: this test can be deleted once the spec test suite is updated\n  // to include\n  // https://github.com/WebAssembly/testsuite/commit/4b24564c844e3d34bf46dfcb3c774ee5163e31cc\n  std::string text = R\"(\n  (module\n    (memory 1)\n    (func\n      i32.const 0\n      i32.load offset=0xFFFF_FFFF_FFFF_FFFF align=0x8000_0000_0000_0000\n      drop\n    )\n  ))\";\n\n  Features features;\n  features.enable_memory64();\n  WastParseOptions options(features);\n  Errors errors;\n  auto lexer =\n      WastLexer::CreateBufferLexer(\"test\", text.c_str(), text.size(), &errors);\n  std::unique_ptr<Script> script;\n\n  Result result = ParseWastScript(lexer.get(), &script, &errors, &options);\n  EXPECT_EQ(Result::Ok, result);\n}\n\nTEST(WastParser, InvalidBinaryModule) {\n  std::string text = R\"((module binary \"\\00asm\\bc\\0a\\00\\00\"))\";\n  std::vector<uint8_t> expected_data = {\n      0, 'a', 's', 'm', static_cast<uint8_t>('\\xbc'), '\\x0a', 0, 0};\n\n  Errors errors;\n  auto lexer =\n      WastLexer::CreateBufferLexer(\"test\", text.c_str(), text.size(), &errors);\n  std::unique_ptr<Script> script;\n  Features features;\n  WastParseOptions options(features);\n  options.parse_binary_modules = false;\n  Result result = ParseWastScript(lexer.get(), &script, &errors, &options);\n  EXPECT_EQ(result, Result::Ok);\n  EXPECT_EQ(0u, errors.size());\n  EXPECT_EQ(1u, script->commands.size());\n\n  Command* cmd = script->commands[0].get();\n  EXPECT_TRUE(isa<ScriptModuleCommand>(cmd));\n\n  auto* mod_cmd = cast<ScriptModuleCommand>(cmd);\n  ScriptModule* script_mod = mod_cmd->script_module.get();\n  EXPECT_NE(script_mod, nullptr);\n\n  EXPECT_TRUE(isa<BinaryScriptModule>(script_mod));\n  auto* binary_mod = cast<BinaryScriptModule>(script_mod);\n\n  EXPECT_EQ(expected_data, binary_mod->data);\n}\n"
  },
  {
    "path": "src/token.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/token.h\"\n\nnamespace wabt {\n\nconst char* GetTokenTypeName(TokenType token_type) {\n  static const char* s_names[] = {\n#define WABT_TOKEN(name, string) string,\n#define WABT_TOKEN_FIRST(name, string)\n#define WABT_TOKEN_LAST(name, string)\n#include \"wabt/token.def\"\n#undef WABT_TOKEN\n#undef WABT_TOKEN_FIRST\n#undef WABT_TOKEN_LAST\n  };\n\n  static_assert(\n      WABT_ARRAY_SIZE(s_names) == WABT_ENUM_COUNT(TokenType),\n      \"Expected TokenType names list length to match number of TokenTypes.\");\n\n  int x = static_cast<int>(token_type);\n  if (x < WABT_ENUM_COUNT(TokenType)) {\n    return s_names[x];\n  }\n\n  return \"Invalid\";\n}\n\nToken::Token(Location loc, TokenType token_type)\n    : loc(loc), token_type_(token_type) {\n  assert(IsTokenTypeBare(token_type_));\n}\n\nToken::Token(Location loc, TokenType token_type, Type type)\n    : loc(loc), token_type_(token_type) {\n  assert(HasType());\n  Construct(type_, type);\n}\n\nToken::Token(Location loc, TokenType token_type, std::string_view text)\n    : loc(loc), token_type_(token_type) {\n  assert(HasText());\n  Construct(text_, text);\n}\n\nToken::Token(Location loc, TokenType token_type, Opcode opcode)\n    : loc(loc), token_type_(token_type) {\n  assert(HasOpcode());\n  Construct(opcode_, opcode);\n}\n\nToken::Token(Location loc, TokenType token_type, const Literal& literal)\n    : loc(loc), token_type_(token_type) {\n  assert(HasLiteral());\n  Construct(literal_, literal);\n}\n\nstd::string Token::to_string() const {\n  if (IsTokenTypeBare(token_type_)) {\n    return GetTokenTypeName(token_type_);\n  } else if (HasLiteral()) {\n    return std::string(literal_.text);\n  } else if (HasOpcode()) {\n    return opcode_.GetName();\n  } else if (HasText()) {\n    return std::string(text_);\n  } else if (IsTokenTypeRefKind(token_type_)) {\n    return type_.GetRefKindName();\n  } else {\n    assert(HasType());\n    return type_.GetName();\n  }\n}\n\nstd::string Token::to_string_clamp(size_t max_length) const {\n  std::string s = to_string();\n  if (s.length() > max_length) {\n    return s.substr(0, max_length - 3) + \"...\";\n  } else {\n    return s;\n  }\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/tools/spectest-interp.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <algorithm>\n#include <cassert>\n#include <cinttypes>\n#include <cstdio>\n#include <cstdlib>\n#include <map>\n#include <memory>\n#include <string>\n#include <vector>\n\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader-nop.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/cast.h\"\n#include \"wabt/common.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/interp/binary-reader-interp.h\"\n#include \"wabt/interp/interp-util.h\"\n#include \"wabt/interp/interp.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/string-util.h\"\n#include \"wabt/validator.h\"\n#include \"wabt/wast-lexer.h\"\n#include \"wabt/wast-parser.h\"\n\nusing namespace wabt;\nusing namespace wabt::interp;\n\nstatic int s_verbose;\nstatic std::string s_infile;\nstatic Thread::Options s_thread_options;\nstatic Stream* s_trace_stream;\nstatic Features s_features;\n\nstatic std::unique_ptr<FileStream> s_log_stream;\nstatic std::unique_ptr<FileStream> s_stdout_stream;\n\nenum class RunVerbosity {\n  Quiet = 0,\n  Verbose = 1,\n};\n\nstatic const char s_description[] =\n    R\"(  read a Spectest JSON file, and run its tests in the interpreter.\n\nexamples:\n  # parse test.json and run the spec tests\n  $ spectest-interp test.json\n)\";\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"spectest-interp\", s_description);\n\n  parser.AddOption('v', \"verbose\", \"Use multiple times for more info\", []() {\n    s_verbose++;\n    s_log_stream = FileStream::CreateStderr();\n  });\n  s_features.AddOptions(&parser);\n  parser.AddOption('V', \"value-stack-size\", \"SIZE\",\n                   \"Size in elements of the value stack\",\n                   [](const std::string& argument) {\n                     // TODO(binji): validate.\n                     s_thread_options.value_stack_size = atoi(argument.c_str());\n                   });\n  parser.AddOption('C', \"call-stack-size\", \"SIZE\",\n                   \"Size in elements of the call stack\",\n                   [](const std::string& argument) {\n                     // TODO(binji): validate.\n                     s_thread_options.call_stack_size = atoi(argument.c_str());\n                   });\n  parser.AddOption('t', \"trace\", \"Trace execution\",\n                   []() { s_trace_stream = s_stdout_stream.get(); });\n\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) {\n                       s_infile = argument;\n                       ConvertBackslashToSlash(&s_infile);\n                     });\n  parser.Parse(argc, argv);\n}\n\nnamespace spectest {\n\nclass Command;\nusing CommandPtr = std::unique_ptr<Command>;\nusing CommandPtrVector = std::vector<CommandPtr>;\n\nclass Script {\n public:\n  std::string filename;\n  CommandPtrVector commands;\n};\n\nclass Command {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(Command);\n  Command() = delete;\n  virtual ~Command() = default;\n\n  CommandType type;\n  uint32_t line = 0;\n\n protected:\n  explicit Command(CommandType type) : type(type) {}\n};\n\ntemplate <CommandType TypeEnum>\nclass CommandMixin : public Command {\n public:\n  static bool classof(const Command* cmd) { return cmd->type == TypeEnum; }\n  CommandMixin() : Command(TypeEnum) {}\n};\n\nenum class ModuleType {\n  Text,\n  Binary,\n};\n\nclass ModuleCommand : public CommandMixin<CommandType::Module> {\n public:\n  ModuleType module = ModuleType::Binary;\n  std::string filename;\n  std::string name;\n};\n\nclass Action {\n public:\n  ActionType type = ActionType::Invoke;\n  std::string module_name;\n  std::string field_name;\n  ValueTypes types;\n  Values args;\n};\n\ntemplate <CommandType TypeEnum>\nclass ActionCommandBase : public CommandMixin<TypeEnum> {\n public:\n  Action action;\n};\n\nusing ActionCommand = ActionCommandBase<CommandType::Action>;\n\nclass RegisterCommand : public CommandMixin<CommandType::Register> {\n public:\n  std::string as;\n  std::string name;\n};\n\nstruct ExpectedValue {\n  TypedValue value;\n  Type lane_type;  // Only valid if value.type == Type::V128.\n  // Up to 4 NaN values used, depending on |value.type| and |lane_type|:\n  //   | type  | lane_type | valid                 |\n  //   | f32   |           | nan[0]                |\n  //   | f64   |           | nan[0]                |\n  //   | v128  | f32       | nan[0] through nan[3] |\n  //   | v128  | f64       | nan[0],nan[1]         |\n  //   | *     | *         | none valid            |\n  ExpectedNan nan[4];\n};\n\nint LaneCountFromType(Type type) {\n  switch (type) {\n    case Type::I8: return 16;\n    case Type::I16: return 8;\n    case Type::I32: return 4;\n    case Type::I64: return 2;\n    case Type::F32: return 4;\n    case Type::F64: return 2;\n    default: assert(false); return 0;\n  }\n}\n\nExpectedValue GetLane(const ExpectedValue& ev, int lane) {\n  assert(ev.value.type == Type::V128);\n  assert(lane < LaneCountFromType(ev.lane_type));\n\n  ExpectedValue result;\n  result.value.type = ev.lane_type;\n\n  v128 vec = ev.value.value.Get<v128>();\n\n  switch (ev.lane_type) {\n    case Type::I8:\n      result.nan[0] = ExpectedNan::None;\n      result.value.value.Set<u32>(vec.u8(lane));\n      break;\n\n    case Type::I16:\n      result.nan[0] = ExpectedNan::None;\n      result.value.value.Set<u32>(vec.u16(lane));\n      break;\n\n    case Type::I32:\n      result.nan[0] = ExpectedNan::None;\n      result.value.value.Set<u32>(vec.u32(lane));\n      break;\n\n    case Type::I64:\n      result.nan[0] = ExpectedNan::None;\n      result.value.value.Set<u64>(vec.u64(lane));\n      break;\n\n    case Type::F32:\n      result.nan[0] = ev.nan[lane];\n      result.value.value.Set<f32>(Bitcast<f32>(vec.f32_bits(lane)));\n      break;\n\n    case Type::F64:\n      result.nan[0] = ev.nan[lane];\n      result.value.value.Set<f64>(Bitcast<f64>(vec.f64_bits(lane)));\n      break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n  return result;\n}\n\nTypedValue GetLane(const TypedValue& tv, Type lane_type, int lane) {\n  assert(tv.type == Type::V128);\n  assert(lane < LaneCountFromType(lane_type));\n\n  TypedValue result;\n  result.type = lane_type;\n\n  v128 vec = tv.value.Get<v128>();\n\n  switch (lane_type) {\n    case Type::I8:\n      result.value.Set<u32>(vec.u8(lane));\n      break;\n\n    case Type::I16:\n      result.value.Set<u32>(vec.u16(lane));\n      break;\n\n    case Type::I32:\n      result.value.Set<u32>(vec.u32(lane));\n      break;\n\n    case Type::I64:\n      result.value.Set<u64>(vec.u64(lane));\n      break;\n\n    case Type::F32:\n      result.value.Set<f32>(Bitcast<f32>(vec.f32_bits(lane)));\n      break;\n\n    case Type::F64:\n      result.value.Set<f64>(Bitcast<f64>(vec.f64_bits(lane)));\n      break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n  return result;\n}\n\nbool CheckIR(const std::string& filename, bool validate) {\n  std::vector<uint8_t> file_data;\n\n  if (Failed(ReadFile(filename, &file_data))) {\n    return false;\n  }\n\n  const bool kReadDebugNames = true;\n  const bool kStopOnFirstError = true;\n  const bool kFailOnCustomSectionError = true;\n  ReadBinaryOptions options(s_features, s_log_stream.get(), kReadDebugNames,\n                            kStopOnFirstError, kFailOnCustomSectionError);\n\n  Errors errors;\n  wabt::Module module;\n  if (Failed(ReadBinaryIr(filename.c_str(), file_data.data(), file_data.size(),\n                          options, &errors, &module))) {\n    return false;\n  }\n\n  if (!validate) {\n    return true;\n  }\n\n  return Succeeded(\n      ValidateModule(&module, &errors, ValidateOptions{s_features}));\n}\n\nbool WellformedIR(const std::string& filename) {\n  return CheckIR(filename, false);\n}\n\nbool ValidIR(const std::string& filename) {\n  return CheckIR(filename, true);\n}\n\nclass AssertReturnCommand : public CommandMixin<CommandType::AssertReturn> {\n public:\n  Action action;\n  std::vector<ExpectedValue> expected;\n  bool expect_either;\n};\n\ntemplate <CommandType TypeEnum>\nclass AssertTrapCommandBase : public CommandMixin<TypeEnum> {\n public:\n  Action action;\n  std::string text;\n};\n\nusing AssertTrapCommand = AssertTrapCommandBase<CommandType::AssertTrap>;\nusing AssertExhaustionCommand =\n    AssertTrapCommandBase<CommandType::AssertExhaustion>;\n\ntemplate <CommandType TypeEnum>\nclass AssertModuleCommand : public CommandMixin<TypeEnum> {\n public:\n  ModuleType type = ModuleType::Binary;\n  std::string filename;\n  std::string text;\n};\n\nusing AssertMalformedCommand =\n    AssertModuleCommand<CommandType::AssertMalformed>;\nusing AssertInvalidCommand = AssertModuleCommand<CommandType::AssertInvalid>;\nusing AssertUnlinkableCommand =\n    AssertModuleCommand<CommandType::AssertUnlinkable>;\nusing AssertUninstantiableCommand =\n    AssertModuleCommand<CommandType::AssertUninstantiable>;\n\nclass AssertExceptionCommand\n    : public CommandMixin<CommandType::AssertException> {\n public:\n  Action action;\n};\n\n// An extremely simple JSON parser that only knows how to parse the expected\n// format from wat2wasm.\nclass JSONParser {\n public:\n  JSONParser() {}\n\n  wabt::Result ReadFile(std::string_view spec_json_filename);\n  wabt::Result ParseScript(Script* out_script);\n\n private:\n  void WABT_PRINTF_FORMAT(2, 3) PrintError(const char* format, ...);\n\n  // Whether to allow parsing of expectation-only forms (e.g. `nan:canonical`,\n  // `nan:arithmetic`, etc.)\n  enum class AllowExpected { No, Yes };\n\n  void PutbackChar();\n  int ReadChar();\n  void SkipWhitespace();\n  bool Match(const char* s);\n  wabt::Result Expect(const char* s);\n  wabt::Result ExpectKey(const char* key);\n  wabt::Result ParseUint32(uint32_t* out_int);\n  wabt::Result ParseString(std::string* out_string);\n  wabt::Result ParseKeyStringValue(const char* key, std::string* out_string);\n  wabt::Result ParseOptNameStringValue(std::string* out_string);\n  wabt::Result ParseLine(uint32_t* out_line_number);\n  wabt::Result ParseType(Type* out_type);\n  wabt::Result ParseTypeObject(Type* out_type);\n  wabt::Result ParseTypeVector(TypeVector* out_types);\n  wabt::Result ParseConst(TypedValue* out_value);\n  wabt::Result ParseI32Value(uint32_t* out_value, std::string_view value_str);\n  wabt::Result ParseI64Value(uint64_t* out_value, std::string_view value_str);\n  wabt::Result ParseF32Value(uint32_t* out_value,\n                             ExpectedNan* out_nan,\n                             std::string_view value_str,\n                             AllowExpected);\n  wabt::Result ParseF64Value(uint64_t* out_value,\n                             ExpectedNan* out_nan,\n                             std::string_view value_str,\n                             AllowExpected);\n  wabt::Result ParseLaneConstValue(Type lane_type,\n                                   int lane,\n                                   ExpectedValue* out_value,\n                                   std::string_view value_str,\n                                   AllowExpected);\n  wabt::Result ParseConstValue(Type type,\n                               Value* out_value,\n                               ExpectedNan* out_nan,\n                               std::string_view value_str,\n                               AllowExpected);\n  wabt::Result ParseConstVector(ValueTypes* out_types, Values* out_values);\n  wabt::Result ParseExpectedValue(ExpectedValue* out_value, AllowExpected);\n  wabt::Result ParseExpectedValues(std::vector<ExpectedValue>* out_values);\n  wabt::Result ParseAction(Action* out_action);\n  wabt::Result ParseActionResult();\n  wabt::Result ParseModuleType(ModuleType* out_type);\n\n  std::string CreateModulePath(std::string_view filename);\n  wabt::Result ParseFilename(std::string* out_filename);\n  wabt::Result ParseCommand(CommandPtr* out_command);\n\n  // Parsing info.\n  std::vector<uint8_t> json_data_;\n  size_t json_offset_ = 0;\n  Location loc_;\n  Location prev_loc_;\n  bool has_prev_loc_ = false;\n};\n\n#define EXPECT(x) CHECK_RESULT(Expect(x))\n#define EXPECT_KEY(x) CHECK_RESULT(ExpectKey(x))\n#define PARSE_KEY_STRING_VALUE(key, value) \\\n  CHECK_RESULT(ParseKeyStringValue(key, value))\n\nwabt::Result JSONParser::ReadFile(std::string_view spec_json_filename) {\n  loc_.filename = spec_json_filename;\n  loc_.line = 1;\n  loc_.first_column = 1;\n\n  return wabt::ReadFile(spec_json_filename, &json_data_);\n}\n\nvoid JSONParser::PrintError(const char* format, ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  fprintf(stderr, \"%s:%d:%d: %s\\n\", std::string(loc_.filename).c_str(),\n          loc_.line, loc_.first_column, buffer);\n}\n\nvoid JSONParser::PutbackChar() {\n  assert(has_prev_loc_);\n  json_offset_--;\n  loc_ = prev_loc_;\n  has_prev_loc_ = false;\n}\n\nint JSONParser::ReadChar() {\n  if (json_offset_ >= json_data_.size()) {\n    return -1;\n  }\n  prev_loc_ = loc_;\n  char c = json_data_[json_offset_++];\n  if (c == '\\n') {\n    loc_.line++;\n    loc_.first_column = 1;\n  } else {\n    loc_.first_column++;\n  }\n  has_prev_loc_ = true;\n  return c;\n}\n\nvoid JSONParser::SkipWhitespace() {\n  while (1) {\n    switch (ReadChar()) {\n      case -1:\n        return;\n\n      case ' ':\n      case '\\t':\n      case '\\n':\n      case '\\r':\n        break;\n\n      default:\n        PutbackChar();\n        return;\n    }\n  }\n}\n\nbool JSONParser::Match(const char* s) {\n  SkipWhitespace();\n  Location start_loc = loc_;\n  size_t start_offset = json_offset_;\n  while (*s && *s == ReadChar())\n    s++;\n\n  if (*s == 0) {\n    return true;\n  } else {\n    json_offset_ = start_offset;\n    loc_ = start_loc;\n    return false;\n  }\n}\n\nwabt::Result JSONParser::Expect(const char* s) {\n  if (Match(s)) {\n    return wabt::Result::Ok;\n  } else {\n    PrintError(\"expected %s\", s);\n    return wabt::Result::Error;\n  }\n}\n\nwabt::Result JSONParser::ExpectKey(const char* key) {\n  size_t keylen = strlen(key);\n  size_t quoted_len = keylen + 2 + 1;\n  char* quoted = static_cast<char*>(alloca(quoted_len));\n  snprintf(quoted, quoted_len, \"\\\"%s\\\"\", key);\n  EXPECT(quoted);\n  EXPECT(\":\");\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseUint32(uint32_t* out_int) {\n  uint32_t result = 0;\n  SkipWhitespace();\n  while (1) {\n    int c = ReadChar();\n    if (c >= '0' && c <= '9') {\n      uint32_t last_result = result;\n      result = result * 10 + static_cast<uint32_t>(c - '0');\n      if (result < last_result) {\n        PrintError(\"uint32 overflow\");\n        return wabt::Result::Error;\n      }\n    } else {\n      PutbackChar();\n      break;\n    }\n  }\n  *out_int = result;\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseString(std::string* out_string) {\n  out_string->clear();\n\n  SkipWhitespace();\n  if (ReadChar() != '\"') {\n    PrintError(\"expected string\");\n    return wabt::Result::Error;\n  }\n\n  while (1) {\n    int c = ReadChar();\n    if (c == '\"') {\n      break;\n    } else if (c == '\\\\') {\n      /* The only escape supported is \\uxxxx. */\n      c = ReadChar();\n      if (c != 'u') {\n        PrintError(\"expected escape: \\\\uxxxx\");\n        return wabt::Result::Error;\n      }\n      uint16_t code = 0;\n      for (int i = 0; i < 4; ++i) {\n        c = ReadChar();\n        int cval;\n        if (c >= '0' && c <= '9') {\n          cval = c - '0';\n        } else if (c >= 'a' && c <= 'f') {\n          cval = c - 'a' + 10;\n        } else if (c >= 'A' && c <= 'F') {\n          cval = c - 'A' + 10;\n        } else {\n          PrintError(\"expected hex char\");\n          return wabt::Result::Error;\n        }\n        code = (code << 4) + cval;\n      }\n\n      if (code < 256) {\n        *out_string += code;\n      } else {\n        PrintError(\"only escape codes < 256 allowed, got %u\\n\", code);\n      }\n    } else {\n      *out_string += c;\n    }\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseKeyStringValue(const char* key,\n                                             std::string* out_string) {\n  out_string->clear();\n  EXPECT_KEY(key);\n  return ParseString(out_string);\n}\n\nwabt::Result JSONParser::ParseOptNameStringValue(std::string* out_string) {\n  out_string->clear();\n  if (Match(\"\\\"name\\\"\")) {\n    EXPECT(\":\");\n    CHECK_RESULT(ParseString(out_string));\n    EXPECT(\",\");\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseLine(uint32_t* out_line_number) {\n  EXPECT_KEY(\"line\");\n  CHECK_RESULT(ParseUint32(out_line_number));\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseType(Type* out_type) {\n  std::string type_str;\n  CHECK_RESULT(ParseString(&type_str));\n\n  if (type_str == \"i32\") {\n    *out_type = Type::I32;\n  } else if (type_str == \"f32\") {\n    *out_type = Type::F32;\n  } else if (type_str == \"i64\") {\n    *out_type = Type::I64;\n  } else if (type_str == \"f64\") {\n    *out_type = Type::F64;\n  } else if (type_str == \"v128\") {\n    *out_type = Type::V128;\n  } else if (type_str == \"i8\") {\n    *out_type = Type::I8;\n  } else if (type_str == \"i16\") {\n    *out_type = Type::I16;\n  } else if (type_str == \"funcref\") {\n    *out_type = Type::FuncRef;\n  } else if (type_str == \"externref\") {\n    *out_type = Type::ExternRef;\n  } else if (type_str == \"exnref\") {\n    *out_type = Type::ExnRef;\n  } else {\n    PrintError(\"unknown type: \\\"%s\\\"\", type_str.c_str());\n    return wabt::Result::Error;\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseTypeObject(Type* out_type) {\n  EXPECT(\"{\");\n  EXPECT_KEY(\"type\");\n  CHECK_RESULT(ParseType(out_type));\n  EXPECT(\"}\");\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseTypeVector(TypeVector* out_types) {\n  out_types->clear();\n  EXPECT(\"[\");\n  bool first = true;\n  while (!Match(\"]\")) {\n    if (!first) {\n      EXPECT(\",\");\n    }\n    Type type;\n    CHECK_RESULT(ParseTypeObject(&type));\n    first = false;\n    out_types->push_back(type);\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseConst(TypedValue* out_value) {\n  ExpectedValue expected;\n  CHECK_RESULT(ParseExpectedValue(&expected, AllowExpected::No));\n  *out_value = expected.value;\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseI32Value(uint32_t* out_value,\n                                       std::string_view value_str) {\n  if (Failed(ParseInt32(value_str, out_value, ParseIntType::UnsignedOnly))) {\n    PrintError(\"invalid i32 literal\");\n    return wabt::Result::Error;\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseI64Value(uint64_t* out_value,\n                                       std::string_view value_str) {\n  if (Failed(ParseInt64(value_str, out_value, ParseIntType::UnsignedOnly))) {\n    PrintError(\"invalid i64 literal\");\n    return wabt::Result::Error;\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseF32Value(uint32_t* out_value,\n                                       ExpectedNan* out_nan,\n                                       std::string_view value_str,\n                                       AllowExpected allow_expected) {\n  if (allow_expected == AllowExpected::Yes) {\n    *out_value = 0;\n    if (value_str == \"nan:canonical\") {\n      *out_nan = ExpectedNan::Canonical;\n      return wabt::Result::Ok;\n    } else if (value_str == \"nan:arithmetic\") {\n      *out_nan = ExpectedNan::Arithmetic;\n      return wabt::Result::Ok;\n    }\n  }\n\n  *out_nan = ExpectedNan::None;\n  if (Failed(ParseInt32(value_str, out_value, ParseIntType::UnsignedOnly))) {\n    PrintError(\"invalid f32 literal\");\n    return wabt::Result::Error;\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseF64Value(uint64_t* out_value,\n                                       ExpectedNan* out_nan,\n                                       std::string_view value_str,\n                                       AllowExpected allow_expected) {\n  if (allow_expected == AllowExpected::Yes) {\n    *out_value = 0;\n    if (value_str == \"nan:canonical\") {\n      *out_nan = ExpectedNan::Canonical;\n      return wabt::Result::Ok;\n    } else if (value_str == \"nan:arithmetic\") {\n      *out_nan = ExpectedNan::Arithmetic;\n      return wabt::Result::Ok;\n    }\n  }\n\n  *out_nan = ExpectedNan::None;\n  if (Failed(ParseInt64(value_str, out_value, ParseIntType::UnsignedOnly))) {\n    PrintError(\"invalid f64 literal\");\n    return wabt::Result::Error;\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseLaneConstValue(Type lane_type,\n                                             int lane,\n                                             ExpectedValue* out_value,\n                                             std::string_view value_str,\n                                             AllowExpected allow_expected) {\n  v128 v = out_value->value.value.Get<v128>();\n\n  switch (lane_type) {\n    case Type::I8: {\n      uint32_t value;\n      CHECK_RESULT(ParseI32Value(&value, value_str));\n      v.set_u8(lane, value);\n      break;\n    }\n\n    case Type::I16: {\n      uint32_t value;\n      CHECK_RESULT(ParseI32Value(&value, value_str));\n      v.set_u16(lane, value);\n      break;\n    }\n\n    case Type::I32: {\n      uint32_t value;\n      CHECK_RESULT(ParseI32Value(&value, value_str));\n      v.set_u32(lane, value);\n      break;\n    }\n\n    case Type::I64: {\n      uint64_t value;\n      CHECK_RESULT(ParseI64Value(&value, value_str));\n      v.set_u64(lane, value);\n      break;\n    }\n\n    case Type::F32: {\n      ExpectedNan nan;\n      uint32_t value_bits;\n      CHECK_RESULT(ParseF32Value(&value_bits, &nan, value_str, allow_expected));\n      v.set_f32_bits(lane, value_bits);\n      assert(lane < 4);\n      out_value->nan[lane] = nan;\n      break;\n    }\n\n    case Type::F64: {\n      ExpectedNan nan;\n      uint64_t value_bits;\n      CHECK_RESULT(ParseF64Value(&value_bits, &nan, value_str, allow_expected));\n      v.set_f64_bits(lane, value_bits);\n      assert(lane < 2);\n      out_value->nan[lane] = nan;\n      break;\n    }\n\n    default:\n      PrintError(\"unknown concrete type: \\\"%s\\\"\", lane_type.GetName().c_str());\n      return wabt::Result::Error;\n  }\n\n  out_value->value.value.Set<v128>(v);\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseConstValue(Type type,\n                                         Value* out_value,\n                                         ExpectedNan* out_nan,\n                                         std::string_view value_str,\n                                         AllowExpected allow_expected) {\n  *out_nan = ExpectedNan::None;\n\n  switch (type) {\n    case Type::I32: {\n      uint32_t value;\n      CHECK_RESULT(ParseI32Value(&value, value_str));\n      out_value->Set(value);\n      break;\n    }\n\n    case Type::F32: {\n      uint32_t value_bits;\n      CHECK_RESULT(\n          ParseF32Value(&value_bits, out_nan, value_str, allow_expected));\n      out_value->Set(Bitcast<f32>(value_bits));\n      break;\n    }\n\n    case Type::I64: {\n      uint64_t value;\n      CHECK_RESULT(ParseI64Value(&value, value_str));\n      out_value->Set(value);\n      break;\n    }\n\n    case Type::F64: {\n      uint64_t value_bits;\n      CHECK_RESULT(\n          ParseF64Value(&value_bits, out_nan, value_str, allow_expected));\n      out_value->Set(Bitcast<f64>(value_bits));\n      break;\n    }\n\n    case Type::V128:\n      assert(false);  // Should use ParseLaneConstValue instead.\n      break;\n\n    case Type::FuncRef:\n      if (value_str == \"null\") {\n        out_value->Set(Ref::Null);\n      } else {\n        assert(allow_expected == AllowExpected::Yes);\n        out_value->Set(Ref{1});\n      }\n      break;\n\n    case Type::ExternRef:\n      if (value_str == \"null\") {\n        out_value->Set(Ref::Null);\n      } else {\n        uint32_t value;\n        CHECK_RESULT(ParseI32Value(&value, value_str));\n        // TODO: hack, just whatever ref is at this index; but skip null (which\n        // is always 0).\n        out_value->Set(Ref{value + 1});\n      }\n      break;\n\n    case Type::ExnRef:\n      if (value_str == \"null\") {\n        out_value->Set(Ref::Null);\n      } else {\n        // FIXME?\n        PrintError(\"NYI\");\n        return wabt::Result::Error;\n      }\n      break;\n\n    default:\n      PrintError(\"unknown concrete type: \\\"%s\\\"\", type.GetName().c_str());\n      return wabt::Result::Error;\n  }\n\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseExpectedValue(ExpectedValue* out_value,\n                                            AllowExpected allow_expected) {\n  Type type;\n  std::string value_str;\n  EXPECT(\"{\");\n  EXPECT_KEY(\"type\");\n  CHECK_RESULT(ParseType(&type));\n  EXPECT(\",\");\n  if (type == Type::V128) {\n    Type lane_type;\n    EXPECT_KEY(\"lane_type\");\n    CHECK_RESULT(ParseType(&lane_type));\n    EXPECT(\",\");\n    EXPECT_KEY(\"value\");\n    EXPECT(\"[\");\n\n    int lane_count = LaneCountFromType(lane_type);\n    for (int lane = 0; lane < lane_count; ++lane) {\n      CHECK_RESULT(ParseString(&value_str));\n      CHECK_RESULT(ParseLaneConstValue(lane_type, lane, out_value, value_str,\n                                       allow_expected));\n      if (lane < lane_count - 1) {\n        EXPECT(\",\");\n      }\n    }\n    EXPECT(\"]\");\n    out_value->value.type = type;\n    out_value->lane_type = lane_type;\n  } else {\n    PARSE_KEY_STRING_VALUE(\"value\", &value_str);\n    CHECK_RESULT(ParseConstValue(type, &out_value->value.value,\n                                 &out_value->nan[0], value_str,\n                                 allow_expected));\n    out_value->value.type = type;\n  }\n  EXPECT(\"}\");\n\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseExpectedValues(\n    std::vector<ExpectedValue>* out_values) {\n  out_values->clear();\n  EXPECT(\"[\");\n  bool first = true;\n  while (!Match(\"]\")) {\n    if (!first) {\n      EXPECT(\",\");\n    }\n    ExpectedValue value;\n    CHECK_RESULT(ParseExpectedValue(&value, AllowExpected::Yes));\n    out_values->push_back(value);\n    first = false;\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseConstVector(ValueTypes* out_types,\n                                          Values* out_values) {\n  out_values->clear();\n  EXPECT(\"[\");\n  bool first = true;\n  while (!Match(\"]\")) {\n    if (!first) {\n      EXPECT(\",\");\n    }\n    TypedValue tv;\n    CHECK_RESULT(ParseConst(&tv));\n    out_types->push_back(tv.type);\n    out_values->push_back(tv.value);\n    first = false;\n  }\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseAction(Action* out_action) {\n  EXPECT_KEY(\"action\");\n  EXPECT(\"{\");\n  EXPECT_KEY(\"type\");\n  if (Match(\"\\\"invoke\\\"\")) {\n    out_action->type = ActionType::Invoke;\n  } else {\n    EXPECT(\"\\\"get\\\"\");\n    out_action->type = ActionType::Get;\n  }\n  EXPECT(\",\");\n  if (Match(\"\\\"module\\\"\")) {\n    EXPECT(\":\");\n    CHECK_RESULT(ParseString(&out_action->module_name));\n    EXPECT(\",\");\n  }\n  PARSE_KEY_STRING_VALUE(\"field\", &out_action->field_name);\n  if (out_action->type == ActionType::Invoke) {\n    EXPECT(\",\");\n    EXPECT_KEY(\"args\");\n    CHECK_RESULT(ParseConstVector(&out_action->types, &out_action->args));\n  }\n  EXPECT(\"}\");\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseActionResult() {\n  // Not needed for wabt-interp, but useful for other parsers.\n  EXPECT_KEY(\"expected\");\n  TypeVector expected;\n  CHECK_RESULT(ParseTypeVector(&expected));\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseModuleType(ModuleType* out_type) {\n  std::string module_type_str;\n\n  PARSE_KEY_STRING_VALUE(\"module_type\", &module_type_str);\n  if (module_type_str == \"text\") {\n    *out_type = ModuleType::Text;\n    return wabt::Result::Ok;\n  } else if (module_type_str == \"binary\") {\n    *out_type = ModuleType::Binary;\n    return wabt::Result::Ok;\n  } else {\n    PrintError(\"unknown module type: \\\"%s\\\"\", module_type_str.c_str());\n    return wabt::Result::Error;\n  }\n}\n\nstatic std::string_view GetDirname(std::string_view path) {\n  // Strip everything after and including the last slash (or backslash), e.g.:\n  //\n  // s = \"foo/bar/baz\", => \"foo/bar\"\n  // s = \"/usr/local/include/stdio.h\", => \"/usr/local/include\"\n  // s = \"foo.bar\", => \"\"\n  // s = \"some\\windows\\directory\", => \"some\\windows\"\n  size_t last_slash = path.find_last_of('/');\n  size_t last_backslash = path.find_last_of('\\\\');\n  if (last_slash == std::string_view::npos) {\n    last_slash = 0;\n  }\n  if (last_backslash == std::string_view::npos) {\n    last_backslash = 0;\n  }\n\n  return path.substr(0, std::max(last_slash, last_backslash));\n}\n\nstd::string JSONParser::CreateModulePath(std::string_view filename) {\n  std::string_view spec_json_filename = loc_.filename;\n  std::string_view dirname = GetDirname(spec_json_filename);\n  std::string path;\n\n  if (dirname.size() == 0) {\n    path = std::string(filename);\n  } else {\n    path = dirname + \"/\" + filename;\n  }\n\n  ConvertBackslashToSlash(&path);\n  return path;\n}\n\nwabt::Result JSONParser::ParseFilename(std::string* out_filename) {\n  PARSE_KEY_STRING_VALUE(\"filename\", out_filename);\n  *out_filename = CreateModulePath(*out_filename);\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseCommand(CommandPtr* out_command) {\n  EXPECT(\"{\");\n  EXPECT_KEY(\"type\");\n  if (Match(\"\\\"module\\\"\")) {\n    auto command = std::make_unique<ModuleCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseOptNameStringValue(&command->name));\n    CHECK_RESULT(ParseFilename(&command->filename));\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"action\\\"\")) {\n    auto command = std::make_unique<ActionCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseAction(&command->action));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseActionResult());\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"register\\\"\")) {\n    auto command = std::make_unique<RegisterCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseOptNameStringValue(&command->name));\n    PARSE_KEY_STRING_VALUE(\"as\", &command->as);\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"assert_malformed\\\"\")) {\n    auto command = std::make_unique<AssertMalformedCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseFilename(&command->filename));\n    EXPECT(\",\");\n    PARSE_KEY_STRING_VALUE(\"text\", &command->text);\n    EXPECT(\",\");\n    CHECK_RESULT(ParseModuleType(&command->type));\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"assert_invalid\\\"\")) {\n    auto command = std::make_unique<AssertInvalidCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseFilename(&command->filename));\n    EXPECT(\",\");\n    PARSE_KEY_STRING_VALUE(\"text\", &command->text);\n    EXPECT(\",\");\n    CHECK_RESULT(ParseModuleType(&command->type));\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"assert_unlinkable\\\"\")) {\n    auto command = std::make_unique<AssertUnlinkableCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseFilename(&command->filename));\n    EXPECT(\",\");\n    PARSE_KEY_STRING_VALUE(\"text\", &command->text);\n    EXPECT(\",\");\n    CHECK_RESULT(ParseModuleType(&command->type));\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"assert_uninstantiable\\\"\")) {\n    auto command = std::make_unique<AssertUninstantiableCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseFilename(&command->filename));\n    EXPECT(\",\");\n    PARSE_KEY_STRING_VALUE(\"text\", &command->text);\n    EXPECT(\",\");\n    CHECK_RESULT(ParseModuleType(&command->type));\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"assert_return\\\"\")) {\n    auto command = std::make_unique<AssertReturnCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseAction(&command->action));\n    EXPECT(\",\");\n    if (Match(\"\\\"either\\\"\")) {\n      EXPECT(\":\");\n      command->expect_either = true;\n    } else {\n      EXPECT_KEY(\"expected\");\n    }\n    CHECK_RESULT(ParseExpectedValues(&command->expected));\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"assert_trap\\\"\")) {\n    auto command = std::make_unique<AssertTrapCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseAction(&command->action));\n    EXPECT(\",\");\n    PARSE_KEY_STRING_VALUE(\"text\", &command->text);\n    EXPECT(\",\");\n    CHECK_RESULT(ParseActionResult());\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"assert_exhaustion\\\"\")) {\n    auto command = std::make_unique<AssertExhaustionCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseAction(&command->action));\n    EXPECT(\",\");\n    PARSE_KEY_STRING_VALUE(\"text\", &command->text);\n    EXPECT(\",\");\n    CHECK_RESULT(ParseActionResult());\n    *out_command = std::move(command);\n  } else if (Match(\"\\\"assert_exception\\\"\")) {\n    if (!s_features.exceptions_enabled()) {\n      PrintError(\"invalid command: exceptions not allowed\");\n      return wabt::Result::Error;\n    }\n    auto command = std::make_unique<AssertExceptionCommand>();\n    EXPECT(\",\");\n    CHECK_RESULT(ParseLine(&command->line));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseAction(&command->action));\n    EXPECT(\",\");\n    CHECK_RESULT(ParseActionResult());\n    *out_command = std::move(command);\n  } else {\n    PrintError(\"unknown command type\");\n    return wabt::Result::Error;\n  }\n  EXPECT(\"}\");\n  return wabt::Result::Ok;\n}\n\nwabt::Result JSONParser::ParseScript(Script* out_script) {\n  EXPECT(\"{\");\n  PARSE_KEY_STRING_VALUE(\"source_filename\", &out_script->filename);\n  EXPECT(\",\");\n  EXPECT_KEY(\"commands\");\n  EXPECT(\"[\");\n  bool first = true;\n  while (!Match(\"]\")) {\n    CommandPtr command;\n    if (!first) {\n      EXPECT(\",\");\n    }\n    CHECK_RESULT(ParseCommand(&command));\n    out_script->commands.push_back(std::move(command));\n    first = false;\n  }\n  EXPECT(\"}\");\n  return wabt::Result::Ok;\n}\n\nstruct ActionResult {\n  ValueTypes types;\n  Values values;\n  Trap::Ptr trap;\n};\n\nclass CommandRunner {\n public:\n  CommandRunner();\n  wabt::Result Run(const Script& script);\n\n  int passed() const { return passed_; }\n  int total() const { return total_; }\n\n private:\n  using ExportMap = std::map<std::string, Extern::Ptr>;\n  using Registry = std::map<std::string, ExportMap>;\n\n  void WABT_PRINTF_FORMAT(3, 4)\n      PrintError(uint32_t line_number, const char* format, ...);\n  ActionResult RunAction(int line_number,\n                         const Action* action,\n                         RunVerbosity verbose);\n\n  interp::Module::Ptr ReadModule(std::string_view module_filename,\n                                 Errors* errors);\n  Extern::Ptr GetImport(const std::string&, const std::string&);\n  void PopulateImports(const interp::Module::Ptr&, RefVec*);\n  void PopulateExports(const Instance::Ptr&, ExportMap*);\n\n  wabt::Result OnModuleCommand(const ModuleCommand*);\n  wabt::Result OnActionCommand(const ActionCommand*);\n  wabt::Result OnRegisterCommand(const RegisterCommand*);\n  wabt::Result OnAssertMalformedCommand(const AssertMalformedCommand*);\n  wabt::Result OnAssertUnlinkableCommand(const AssertUnlinkableCommand*);\n  wabt::Result OnAssertInvalidCommand(const AssertInvalidCommand*);\n  wabt::Result OnAssertUninstantiableCommand(\n      const AssertUninstantiableCommand*);\n  wabt::Result OnAssertReturnCommand(const AssertReturnCommand*);\n  wabt::Result OnAssertTrapCommand(const AssertTrapCommand*);\n  wabt::Result OnAssertExhaustionCommand(const AssertExhaustionCommand*);\n  wabt::Result OnAssertExceptionCommand(const AssertExceptionCommand*);\n\n  wabt::Result CheckAssertReturnResult(const AssertReturnCommand* command,\n                                       int index,\n                                       ExpectedValue expected,\n                                       TypedValue actual,\n                                       bool print_error);\n\n  void TallyCommand(wabt::Result);\n\n  wabt::Result ReadTextModule(std::string_view module_filename,\n                              const std::string& header,\n                              bool validate);\n  wabt::Result ReadMalformedBinaryModule(std::string_view module_filename,\n                                         Errors* errors);\n  wabt::Result ReadMalformedModule(int line_number,\n                                   std::string_view module_filename,\n                                   ModuleType module_type,\n                                   const char* desc);\n  wabt::Result ReadInvalidModule(int line_number,\n                                 std::string_view module_filename,\n                                 ModuleType module_type,\n                                 const char* desc);\n  wabt::Result ReadUnlinkableModule(int line_number,\n                                    std::string_view module_filename,\n                                    ModuleType module_type,\n                                    const char* desc);\n\n  Store store_;\n  Registry registry_;   // Used when importing.\n  Registry instances_;  // Used when referencing module by name in invoke.\n  ExportMap last_instance_;\n  int passed_ = 0;\n  int total_ = 0;\n\n  std::string source_filename_;\n};\n\nCommandRunner::CommandRunner() : store_(s_features) {\n  auto&& spectest = registry_[\"spectest\"];\n\n  // Initialize print functions for the spec test.\n  struct {\n    const char* name;\n    interp::FuncType type;\n  } const print_funcs[] = {\n      {\"print\", interp::FuncType{{}, {}}},\n      {\"print_i32\", interp::FuncType{{ValueType::I32}, {}}},\n      {\"print_i64\", interp::FuncType{{ValueType::I64}, {}}},\n      {\"print_f32\", interp::FuncType{{ValueType::F32}, {}}},\n      {\"print_f64\", interp::FuncType{{ValueType::F64}, {}}},\n      {\"print_i32_f32\", interp::FuncType{{ValueType::I32, ValueType::F32}, {}}},\n      {\"print_f64_f64\", interp::FuncType{{ValueType::F64, ValueType::F64}, {}}},\n  };\n\n  for (auto&& print : print_funcs) {\n    auto import_name = StringPrintf(\"spectest.%s\", print.name);\n    spectest[print.name] =\n        HostFunc::New(store_, print.type,\n                      [=](Thread& inst, const Values& params, Values& results,\n                          Trap::Ptr* trap) -> wabt::Result {\n                        printf(\"called host \");\n                        WriteCall(s_stdout_stream.get(), import_name,\n                                  print.type, params, results, *trap);\n                        return wabt::Result::Ok;\n                      });\n  }\n\n  spectest[\"table\"] = interp::Table::New(\n      store_, TableType{ValueType::FuncRef, Limits{10, 20}}, Ref::Null);\n\n  spectest[\"table64\"] = interp::Table::New(\n      store_, TableType{ValueType::FuncRef, Limits{10, 20, false, true}},\n      Ref::Null);\n\n  spectest[\"memory\"] = interp::Memory::New(\n      store_, MemoryType{Limits{1, 2}, WABT_DEFAULT_PAGE_SIZE});\n\n  spectest[\"global_i32\"] =\n      interp::Global::New(store_, GlobalType{ValueType::I32, Mutability::Const},\n                          Value::Make(u32{666}));\n  spectest[\"global_i64\"] =\n      interp::Global::New(store_, GlobalType{ValueType::I64, Mutability::Const},\n                          Value::Make(u64{666}));\n  spectest[\"global_f32\"] =\n      interp::Global::New(store_, GlobalType{ValueType::F32, Mutability::Const},\n                          Value::Make(f32{666.6}));\n  spectest[\"global_f64\"] =\n      interp::Global::New(store_, GlobalType{ValueType::F64, Mutability::Const},\n                          Value::Make(f64{666.6}));\n}\n\nwabt::Result CommandRunner::Run(const Script& script) {\n  source_filename_ = script.filename;\n\n  for (const CommandPtr& command : script.commands) {\n    switch (command->type) {\n      case CommandType::Module:\n      case CommandType::ScriptModule:\n        TallyCommand(OnModuleCommand(cast<ModuleCommand>(command.get())));\n        break;\n\n      case CommandType::Action:\n        TallyCommand(OnActionCommand(cast<ActionCommand>(command.get())));\n        break;\n\n      case CommandType::Register:\n        if (Failed(OnRegisterCommand(cast<RegisterCommand>(command.get())))) {\n          PrintError(command->line, \"invalid register command\");\n          return wabt::Result::Error;\n        }\n        break;\n\n      case CommandType::AssertMalformed:\n        TallyCommand(OnAssertMalformedCommand(\n            cast<AssertMalformedCommand>(command.get())));\n        break;\n\n      case CommandType::AssertInvalid:\n        TallyCommand(\n            OnAssertInvalidCommand(cast<AssertInvalidCommand>(command.get())));\n        break;\n\n      case CommandType::AssertUnlinkable:\n        TallyCommand(OnAssertUnlinkableCommand(\n            cast<AssertUnlinkableCommand>(command.get())));\n        break;\n\n      case CommandType::AssertUninstantiable:\n        TallyCommand(OnAssertUninstantiableCommand(\n            cast<AssertUninstantiableCommand>(command.get())));\n        break;\n\n      case CommandType::AssertReturn:\n        TallyCommand(\n            OnAssertReturnCommand(cast<AssertReturnCommand>(command.get())));\n        break;\n\n      case CommandType::AssertTrap:\n        TallyCommand(\n            OnAssertTrapCommand(cast<AssertTrapCommand>(command.get())));\n        break;\n\n      case CommandType::AssertExhaustion:\n        TallyCommand(OnAssertExhaustionCommand(\n            cast<AssertExhaustionCommand>(command.get())));\n        break;\n\n      case CommandType::AssertException:\n        TallyCommand(OnAssertExceptionCommand(\n            cast<AssertExceptionCommand>(command.get())));\n        break;\n    }\n  }\n\n  return wabt::Result::Ok;\n}\n\nvoid CommandRunner::PrintError(uint32_t line_number, const char* format, ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  printf(\"%s:%u: %s\\n\", source_filename_.c_str(), line_number, buffer);\n}\n\nActionResult CommandRunner::RunAction(int line_number,\n                                      const Action* action,\n                                      RunVerbosity verbose) {\n  ExportMap& module = !action->module_name.empty()\n                          ? instances_[action->module_name]\n                          : last_instance_;\n  Extern::Ptr extern_ = module[action->field_name];\n  if (!extern_) {\n    PrintError(line_number, \"unknown invoke \\\"%s.%s\\\"\",\n               action->module_name.c_str(), action->field_name.c_str());\n    return {};\n  }\n\n  ActionResult result;\n\n  switch (action->type) {\n    case ActionType::Invoke: {\n      auto* func = cast<interp::Func>(extern_.get());\n      auto ok = func->Call(store_, action->args, result.values, &result.trap,\n                           s_trace_stream);\n      assert((ok == Result::Ok) == (!result.trap));\n      result.types = func->type().results;\n      if (verbose == RunVerbosity::Verbose) {\n        WriteCall(s_stdout_stream.get(), action->field_name, func->type(),\n                  action->args, result.values, result.trap);\n      }\n      break;\n    }\n\n    case ActionType::Get: {\n      auto* global = cast<interp::Global>(extern_.get());\n      result.values.push_back(global->Get());\n      result.types.push_back(global->type().type);\n      break;\n    }\n\n    default:\n      WABT_UNREACHABLE;\n  }\n\n  return result;\n}\n\nwabt::Result CommandRunner::ReadTextModule(std::string_view module_filename,\n                                           const std::string& header,\n                                           bool validate) {\n  std::vector<uint8_t> file_data;\n  wabt::Result result = ReadFile(module_filename, &file_data);\n  Errors errors;\n  std::unique_ptr<WastLexer> lexer = WastLexer::CreateBufferLexer(\n      module_filename, file_data.data(), file_data.size(), &errors);\n  if (Succeeded(result)) {\n    std::unique_ptr<wabt::Module> module;\n    WastParseOptions options(s_features);\n    result = ParseWatModule(lexer.get(), &module, &errors, &options);\n\n    if (validate && Succeeded(result)) {\n      result =\n          ValidateModule(module.get(), &errors, ValidateOptions{s_features});\n    }\n  }\n\n  auto line_finder = lexer->MakeLineFinder();\n  FormatErrorsToFile(errors, Location::Type::Text, line_finder.get(), stdout,\n                     header, PrintHeader::Once);\n  return result;\n}\n\ninterp::Module::Ptr CommandRunner::ReadModule(std::string_view module_filename,\n                                              Errors* errors) {\n  std::vector<uint8_t> file_data;\n\n  if (Failed(ReadFile(module_filename, &file_data))) {\n    return {};\n  }\n\n  const bool kReadDebugNames = true;\n  const bool kStopOnFirstError = true;\n  const bool kFailOnCustomSectionError = true;\n  ReadBinaryOptions options(s_features, s_log_stream.get(), kReadDebugNames,\n                            kStopOnFirstError, kFailOnCustomSectionError);\n  ModuleDesc module_desc;\n  if (Failed(ReadBinaryInterp(module_filename, file_data.data(),\n                              file_data.size(), options, errors,\n                              &module_desc))) {\n    return {};\n  }\n\n  if (s_verbose) {\n    module_desc.istream.Disassemble(s_stdout_stream.get());\n  }\n\n  return interp::Module::New(store_, module_desc);\n}\n\nwabt::Result CommandRunner::ReadInvalidModule(int line_number,\n                                              std::string_view module_filename,\n                                              ModuleType module_type,\n                                              const char* desc) {\n  std::string header = StringPrintf(\n      \"%s:%d: %s passed\", source_filename_.c_str(), line_number, desc);\n\n  switch (module_type) {\n    case ModuleType::Text: {\n      return ReadTextModule(module_filename, header, true);\n    }\n\n    case ModuleType::Binary: {\n      Errors errors;\n      auto module = ReadModule(module_filename, &errors);\n      if (!module) {\n        FormatErrorsToFile(errors, Location::Type::Binary, {}, stdout, header,\n                           PrintHeader::Once);\n        return wabt::Result::Error;\n      } else {\n        return wabt::Result::Ok;\n      }\n    }\n  }\n\n  WABT_UNREACHABLE;\n}\n\nwabt::Result CommandRunner::ReadMalformedBinaryModule(\n    std::string_view module_filename,\n    Errors* errors) {\n  std::vector<uint8_t> file_data;\n\n  CHECK_RESULT(ReadFile(module_filename, &file_data));\n\n  const bool kReadDebugNames = true;\n  const bool kStopOnFirstError = true;\n  const bool kFailOnCustomSectionError = true;\n  ReadBinaryOptions options(s_features, s_log_stream.get(), kReadDebugNames,\n                            kStopOnFirstError, kFailOnCustomSectionError);\n\n  class BinaryReaderErrorLogging : public BinaryReaderNop {\n    Errors* errors_;\n\n   public:\n    BinaryReaderErrorLogging(Errors* errors) : errors_(errors) {}\n\n    bool OnError(const Error& error) override {\n      errors_->push_back(error);\n      return true;\n    }\n  };\n\n  BinaryReaderErrorLogging reader_delegate{errors};\n  return ReadBinary(file_data.data(), file_data.size(), &reader_delegate,\n                    options);\n}\n\nwabt::Result CommandRunner::ReadMalformedModule(\n    int line_number,\n    std::string_view module_filename,\n    ModuleType module_type,\n    const char* desc) {\n  std::string header = StringPrintf(\n      \"%s:%d: %s passed\", source_filename_.c_str(), line_number, desc);\n\n  switch (module_type) {\n    case ModuleType::Text: {\n      return ReadTextModule(module_filename, header, false);\n    }\n\n    case ModuleType::Binary: {\n      Errors errors;\n      wabt::Result result = ReadMalformedBinaryModule(module_filename, &errors);\n      FormatErrorsToFile(errors, Location::Type::Binary, {}, stdout, header,\n                         PrintHeader::Once);\n      return result;\n    }\n  }\n\n  WABT_UNREACHABLE;\n}\n\nExtern::Ptr CommandRunner::GetImport(const std::string& module,\n                                     const std::string& name) {\n  auto mod_iter = registry_.find(module);\n  if (mod_iter != registry_.end()) {\n    auto extern_iter = mod_iter->second.find(name);\n    if (extern_iter != mod_iter->second.end()) {\n      return extern_iter->second;\n    }\n  }\n  return {};\n}\n\nvoid CommandRunner::PopulateImports(const interp::Module::Ptr& module,\n                                    RefVec* imports) {\n  for (auto&& import : module->desc().imports) {\n    auto extern_ = GetImport(import.type.module, import.type.name);\n    imports->push_back(extern_ ? extern_.ref() : Ref::Null);\n  }\n}\n\nvoid CommandRunner::PopulateExports(const Instance::Ptr& instance,\n                                    ExportMap* map) {\n  map->clear();\n  interp::Module::Ptr module{store_, instance->module()};\n  for (size_t i = 0; i < module->export_types().size(); ++i) {\n    const ExportType& export_type = module->export_types()[i];\n    (*map)[export_type.name] = store_.UnsafeGet<Extern>(instance->exports()[i]);\n  }\n}\n\nwabt::Result CommandRunner::OnModuleCommand(const ModuleCommand* command) {\n  Errors errors;\n  auto module = ReadModule(command->filename, &errors);\n  FormatErrorsToFile(errors, Location::Type::Binary);\n\n  if (!module) {\n    PrintError(command->line, \"error reading module: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  if (!ValidIR(command->filename)) {\n    PrintError(command->line, \"IR Validator thinks module is invalid: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  RefVec imports;\n  PopulateImports(module, &imports);\n\n  Trap::Ptr trap;\n  auto instance = Instance::Instantiate(store_, module.ref(), imports, &trap);\n  if (trap) {\n    assert(!instance);\n    PrintError(command->line, \"error instantiating module: \\\"%s\\\"\",\n               trap->message().c_str());\n    return wabt::Result::Error;\n  }\n\n  PopulateExports(instance, &last_instance_);\n  if (!command->name.empty()) {\n    instances_[command->name] = last_instance_;\n  }\n\n  return wabt::Result::Ok;\n}\n\nwabt::Result CommandRunner::OnActionCommand(const ActionCommand* command) {\n  ActionResult result =\n      RunAction(command->line, &command->action, RunVerbosity::Verbose);\n\n  if (result.trap) {\n    PrintError(command->line, \"unexpected trap: %s\",\n               result.trap->message().c_str());\n    return wabt::Result::Error;\n  }\n\n  return wabt::Result::Ok;\n}\n\nwabt::Result CommandRunner::OnAssertMalformedCommand(\n    const AssertMalformedCommand* command) {\n  wabt::Result result = ReadMalformedModule(command->line, command->filename,\n                                            command->type, \"assert_malformed\");\n  if (Succeeded(result)) {\n    PrintError(command->line, \"expected module to be malformed: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  if (WellformedIR(command->filename)) {\n    PrintError(command->line,\n               \"BinaryReaderIR thinks module is well-formed: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  return wabt::Result::Ok;\n}\n\nwabt::Result CommandRunner::OnRegisterCommand(const RegisterCommand* command) {\n  if (!command->name.empty()) {\n    auto instance_iter = instances_.find(command->name);\n    if (instance_iter == instances_.end()) {\n      PrintError(command->line, \"unknown module in register\");\n      return wabt::Result::Error;\n    }\n    registry_[command->as] = instance_iter->second;\n  } else {\n    registry_[command->as] = last_instance_;\n  }\n\n  return wabt::Result::Ok;\n}\n\nwabt::Result CommandRunner::OnAssertUnlinkableCommand(\n    const AssertUnlinkableCommand* command) {\n  Errors errors;\n  auto module = ReadModule(command->filename, &errors);\n\n  if (!module) {\n    PrintError(command->line, \"unable to compile unlinkable module: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  if (!ValidIR(command->filename)) {\n    PrintError(command->line, \"IR Validator thinks module is invalid: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  RefVec imports;\n  PopulateImports(module, &imports);\n\n  Trap::Ptr trap;\n  auto instance = Instance::Instantiate(store_, module.ref(), imports, &trap);\n  if (!trap) {\n    PrintError(command->line, \"expected module to be unlinkable: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  // TODO: Change to one-line error.\n  PrintError(command->line, \"assert_unlinkable passed:\\n  error: %s\",\n             trap->message().c_str());\n  return wabt::Result::Ok;\n}\n\nwabt::Result CommandRunner::OnAssertInvalidCommand(\n    const AssertInvalidCommand* command) {\n  wabt::Result result = ReadInvalidModule(command->line, command->filename,\n                                          command->type, \"assert_invalid\");\n  if (Succeeded(result)) {\n    PrintError(command->line, \"expected module to be invalid: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  if (ValidIR(command->filename)) {\n    PrintError(command->line, \"IR Validator thinks module is valid: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  return wabt::Result::Ok;\n}\n\nwabt::Result CommandRunner::OnAssertUninstantiableCommand(\n    const AssertUninstantiableCommand* command) {\n  Errors errors;\n  auto module = ReadModule(command->filename, &errors);\n\n  if (!module) {\n    PrintError(command->line, \"unable to compile uninstantiable module: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  if (!ValidIR(command->filename)) {\n    PrintError(command->line, \"IR Validator thinks module is invalid: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  RefVec imports;\n  PopulateImports(module, &imports);\n\n  Trap::Ptr trap;\n  auto instance = Instance::Instantiate(store_, module.ref(), imports, &trap);\n  if (!trap) {\n    PrintError(command->line, \"expected module to be uninstantiable: \\\"%s\\\"\",\n               command->filename.c_str());\n    return wabt::Result::Error;\n  }\n\n  // TODO: print error when assertion passes.\n#if 0\n  PrintError(command->line, \"assert_uninstantiable passed: %s\",\n             trap->message().c_str());\n#endif\n  return wabt::Result::Ok;\n}\n\nstatic bool WABT_VECTORCALL IsCanonicalNan(f32 val) {\n  const u32 kQuietNan = 0x7fc00000U;\n  const u32 kQuietNegNan = 0xffc00000U;\n  u32 bits = Bitcast<u32>(val);\n  return bits == kQuietNan || bits == kQuietNegNan;\n}\n\nstatic bool WABT_VECTORCALL IsCanonicalNan(f64 val) {\n  const u64 kQuietNan = 0x7ff8000000000000ULL;\n  const u64 kQuietNegNan = 0xfff8000000000000ULL;\n  u64 bits = Bitcast<u64>(val);\n  return bits == kQuietNan || bits == kQuietNegNan;\n}\n\nstatic bool WABT_VECTORCALL IsArithmeticNan(f32 val) {\n  const u32 kQuietNan = 0x7fc00000U;\n  return (Bitcast<u32>(val) & kQuietNan) == kQuietNan;\n}\n\nstatic bool WABT_VECTORCALL IsArithmeticNan(f64 val) {\n  const u64 kQuietNan = 0x7ff8000000000000ULL;\n  return (Bitcast<u64>(val) & kQuietNan) == kQuietNan;\n}\n\nstatic std::string ExpectedValueToString(const ExpectedValue& ev) {\n  // Extend TypedValueToString to print expected nan values too.\n  switch (ev.value.type) {\n    case Type::F32:\n    case Type::F64:\n      switch (ev.nan[0]) {\n        case ExpectedNan::None:\n          return TypedValueToString(ev.value);\n\n        case ExpectedNan::Arithmetic:\n          return StringPrintf(\"%s:nan:arithmetic\",\n                              ev.value.type.GetName().c_str());\n\n        case ExpectedNan::Canonical:\n          return StringPrintf(\"%s:nan:canonical\",\n                              ev.value.type.GetName().c_str());\n      }\n      break;\n\n    case Type::V128: {\n      int lane_count = LaneCountFromType(ev.lane_type);\n      std::string result = \"v128 \";\n      for (int lane = 0; lane < lane_count; ++lane) {\n        result += ExpectedValueToString(GetLane(ev, lane));\n      }\n      return result;\n    }\n\n    default:\n      break;\n  }\n  return TypedValueToString(ev.value);\n}\n\nwabt::Result CommandRunner::CheckAssertReturnResult(\n    const AssertReturnCommand* command,\n    int index,\n    ExpectedValue expected,\n    TypedValue actual,\n    bool print_error) {\n  assert(expected.value.type == actual.type ||\n         IsReference(expected.value.type));\n  bool ok = true;\n  switch (expected.value.type) {\n    case Type::I8:\n    case Type::I16:\n    case Type::I32:\n      ok = expected.value.value.Get<u32>() == actual.value.Get<u32>();\n      break;\n\n    case Type::I64:\n      ok = expected.value.value.Get<u64>() == actual.value.Get<u64>();\n      break;\n\n    case Type::F32:\n      switch (expected.nan[0]) {\n        case ExpectedNan::Arithmetic:\n          ok = IsArithmeticNan(actual.value.Get<f32>());\n          break;\n\n        case ExpectedNan::Canonical:\n          ok = IsCanonicalNan(actual.value.Get<f32>());\n          break;\n\n        case ExpectedNan::None:\n          ok = Bitcast<u32>(expected.value.value.Get<f32>()) ==\n               Bitcast<u32>(actual.value.Get<f32>());\n          break;\n      }\n      break;\n\n    case Type::F64:\n      switch (expected.nan[0]) {\n        case ExpectedNan::Arithmetic:\n          ok = IsArithmeticNan(actual.value.Get<f64>());\n          break;\n\n        case ExpectedNan::Canonical:\n          ok = IsCanonicalNan(actual.value.Get<f64>());\n          break;\n\n        case ExpectedNan::None:\n          ok = Bitcast<u64>(expected.value.value.Get<f64>()) ==\n               Bitcast<u64>(actual.value.Get<f64>());\n          break;\n      }\n      break;\n\n    case Type::V128: {\n      // Compare each lane as if it were its own value.\n      for (int lane = 0; lane < LaneCountFromType(expected.lane_type); ++lane) {\n        ExpectedValue lane_expected = GetLane(expected, lane);\n        TypedValue lane_actual = GetLane(actual, expected.lane_type, lane);\n\n        if (Failed(CheckAssertReturnResult(command, index, lane_expected,\n                                           lane_actual, false))) {\n          if (print_error) {\n            PrintError(command->line,\n                       \"mismatch in lane %u of result %u of assert_return: \"\n                       \"expected %s, got %s\",\n                       lane, index,\n                       ExpectedValueToString(lane_expected).c_str(),\n                       TypedValueToString(lane_actual).c_str());\n          }\n          ok = false;\n        }\n      }\n      break;\n    }\n\n    case Type::FuncRef:\n      // A funcref expectation only requires that the reference be a function,\n      // but it doesn't check the actual index.\n      ok = (actual.type == Type::FuncRef || actual.type == Type::RefNull);\n      break;\n\n    case Type::ExternRef:\n      ok = expected.value.value.Get<Ref>() == actual.value.Get<Ref>();\n      break;\n\n    case Type::ExnRef:\n      // FIXME is this correct?\n      ok = (actual.type == Type::ExnRef);\n      break;\n\n    default:\n      WABT_UNREACHABLE;\n  }\n\n  if (!ok && print_error) {\n    PrintError(command->line,\n               \"mismatch in result %u of assert_return: expected %s, got %s\",\n               index, ExpectedValueToString(expected).c_str(),\n               TypedValueToString(actual).c_str());\n  }\n  return ok ? wabt::Result::Ok : wabt::Result::Error;\n}\n\nwabt::Result CommandRunner::OnAssertReturnCommand(\n    const AssertReturnCommand* command) {\n  ActionResult action_result =\n      RunAction(command->line, &command->action, RunVerbosity::Quiet);\n\n  if (action_result.trap) {\n    PrintError(command->line, \"unexpected trap: %s\",\n               action_result.trap->message().c_str());\n    return wabt::Result::Error;\n  }\n\n  if (command->expect_either) {\n    if (action_result.values.size() != 1) {\n      PrintError(command->line,\n                 \"\\\"either\\\" requires single result but got %\" PRIzd,\n                 action_result.values.size());\n      return wabt::Result::Error;\n    }\n\n    TypedValue actual{action_result.types[0], action_result.values[0]};\n    for (size_t i = 0; i < command->expected.size(); ++i) {\n      const ExpectedValue& expected = command->expected[i];\n      if (Succeeded(\n              CheckAssertReturnResult(command, i, expected, actual, false))) {\n        return wabt::Result::Ok;\n      }\n    }\n    PrintError(command->line,\n               \"mismatch in result of assert_return: expected %s (%\" PRIzd\n               \" alternatives), got %s\",\n               ExpectedValueToString(command->expected[0]).c_str(),\n               command->expected.size(), TypedValueToString(actual).c_str());\n    return wabt::Result::Error;\n  } else {\n    if (action_result.values.size() != command->expected.size()) {\n      PrintError(command->line,\n                 \"result length mismatch in assert_return: expected %\" PRIzd\n                 \", got %\" PRIzd,\n                 command->expected.size(), action_result.values.size());\n      return wabt::Result::Error;\n    }\n\n    wabt::Result result = wabt::Result::Ok;\n    for (size_t i = 0; i < action_result.values.size(); ++i) {\n      const ExpectedValue& expected = command->expected[i];\n      TypedValue actual{action_result.types[i], action_result.values[i]};\n\n      result |= CheckAssertReturnResult(command, i, expected, actual, true);\n    }\n    return result;\n  }\n}\n\nwabt::Result CommandRunner::OnAssertTrapCommand(\n    const AssertTrapCommand* command) {\n  ActionResult result =\n      RunAction(command->line, &command->action, RunVerbosity::Quiet);\n  if (!result.trap) {\n    PrintError(command->line, \"expected trap: \\\"%s\\\"\", command->text.c_str());\n    return wabt::Result::Error;\n  }\n\n  PrintError(command->line, \"assert_trap passed: %s\",\n             result.trap->message().c_str());\n  return wabt::Result::Ok;\n}\n\nwabt::Result CommandRunner::OnAssertExhaustionCommand(\n    const AssertExhaustionCommand* command) {\n  ActionResult result =\n      RunAction(command->line, &command->action, RunVerbosity::Quiet);\n  if (!result.trap || result.trap->message() != \"call stack exhausted\") {\n    PrintError(command->line, \"expected trap: \\\"%s\\\"\", command->text.c_str());\n    return wabt::Result::Error;\n  }\n\n  // TODO: print message when assertion passes.\n#if 0\n  PrintError(command->line, \"assert_exhaustion passed: %s\",\n             result.trap->message().c_str());\n#endif\n  return wabt::Result::Ok;\n}\n\nwabt::Result CommandRunner::OnAssertExceptionCommand(\n    const AssertExceptionCommand* command) {\n  ActionResult result =\n      RunAction(command->line, &command->action, RunVerbosity::Quiet);\n  if (!result.trap || result.trap->message() != \"uncaught exception\") {\n    PrintError(command->line, \"expected an exception to be thrown\");\n    return wabt::Result::Error;\n  }\n  PrintError(command->line, \"assert_exception passed\");\n\n  return wabt::Result::Ok;\n}\n\nvoid CommandRunner::TallyCommand(wabt::Result result) {\n  if (Succeeded(result)) {\n    passed_++;\n  }\n  total_++;\n}\n\nstatic int ReadAndRunSpecJSON(std::string_view spec_json_filename) {\n  JSONParser parser;\n  if (parser.ReadFile(spec_json_filename) == wabt::Result::Error) {\n    return 1;\n  }\n\n  Script script;\n  if (parser.ParseScript(&script) == wabt::Result::Error) {\n    return 1;\n  }\n\n  CommandRunner runner;\n  if (runner.Run(script) == wabt::Result::Error) {\n    return 1;\n  }\n\n  printf(\"%d/%d tests passed.\\n\", runner.passed(), runner.total());\n  const int failed = runner.total() - runner.passed();\n  return failed;\n}\n\n}  // namespace spectest\n\nint ProgramMain(int argc, char** argv) {\n  InitStdio();\n  s_stdout_stream = FileStream::CreateStdout();\n\n  ParseOptions(argc, argv);\n  return spectest::ReadAndRunSpecJSON(s_infile);\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wasm-decompile.cc",
    "content": "/*\n * Copyright 2019 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <cinttypes>\n#include <cstdio>\n#include <cstdlib>\n\n#include \"wabt/apply-names.h\"\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/decompiler.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/generate-names.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/validator.h\"\n#include \"wabt/wast-lexer.h\"\n\nusing namespace wabt;\n\nint ProgramMain(int argc, char** argv) {\n  InitStdio();\n\n  std::string infile;\n  std::string outfile;\n  Features features;\n  DecompileOptions decompile_options;\n  bool fail_on_custom_section_error = true;\n\n  {\n    const char s_description[] =\n        \"  Read a file in the WebAssembly binary format, and convert it to\\n\"\n        \"  a decompiled text file.\\n\"\n        \"\\n\"\n        \"examples:\\n\"\n        \"  # parse binary file test.wasm and write text file test.dcmp\\n\"\n        \"  $ wasm-decompile test.wasm -o test.dcmp\\n\";\n    OptionParser parser(\"wasm-decompile\", s_description);\n    parser.AddOption(\n        'o', \"output\", \"FILENAME\",\n        \"Output file for the decompiled file, by default use stdout\",\n        [&](const char* argument) {\n          outfile = argument;\n          ConvertBackslashToSlash(&outfile);\n        });\n    features.AddOptions(&parser);\n    parser.AddOption(\"ignore-custom-section-errors\",\n                     \"Ignore errors in custom sections\",\n                     [&]() { fail_on_custom_section_error = false; });\n    parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                       [&](const char* argument) {\n                         infile = argument;\n                         ConvertBackslashToSlash(&infile);\n                       });\n    parser.Parse(argc, argv);\n  }\n\n  std::vector<uint8_t> file_data;\n  Result result = ReadFile(infile.c_str(), &file_data);\n  if (Succeeded(result)) {\n    Errors errors;\n    Module module;\n    const bool kStopOnFirstError = true;\n    ReadBinaryOptions options(features, nullptr, true, kStopOnFirstError,\n                              fail_on_custom_section_error);\n    result = ReadBinaryIr(infile.c_str(), file_data.data(), file_data.size(),\n                          options, &errors, &module);\n    if (Succeeded(result)) {\n      ValidateOptions options(features);\n      result = ValidateModule(&module, &errors, options);\n      if (Succeeded(result)) {\n        result =\n            GenerateNames(&module, static_cast<NameOpts>(NameOpts::AlphaNames));\n      }\n      if (Succeeded(result)) {\n        // Must be called after ReadBinaryIr & GenerateNames, and before\n        // ApplyNames, see comments at definition.\n        RenameAll(module);\n      }\n      if (Succeeded(result)) {\n        /* TODO(binji): This shouldn't fail; if a name can't be applied\n         * (because the index is invalid, say) it should just be skipped. */\n        Result dummy_result = ApplyNames(&module);\n        WABT_USE(dummy_result);\n      }\n      if (Succeeded(result)) {\n        auto s = Decompile(module, decompile_options);\n        FileStream stream(!outfile.empty() ? FileStream(outfile)\n                                           : FileStream(stdout));\n        stream.WriteData(s.data(), s.size());\n      }\n    }\n    FormatErrorsToFile(errors, Location::Type::Binary);\n  }\n  return result != Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wasm-interp.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <algorithm>\n#include <cassert>\n#include <cstdio>\n#include <cstdlib>\n#include <memory>\n#include <string>\n#include <vector>\n\n#include \"wabt/binary-reader.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/interp/binary-reader-interp.h\"\n#include \"wabt/interp/interp-util.h\"\n#include \"wabt/interp/interp-wasi.h\"\n#include \"wabt/interp/interp.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n\n#ifdef WITH_WASI\n#include \"uvwasi.h\"\n#endif\n\nusing namespace wabt;\nusing namespace wabt::interp;\n\nstruct FunctionCall {\n  std::string name;\n  Values args;\n};\n\n#define ERROR_EXIT_UNLESS(cond, ...) \\\n  do {                               \\\n    if (!(cond)) {                   \\\n      printf(__VA_ARGS__);           \\\n      exit(1);                       \\\n    }                                \\\n  } while (0);\n\nstatic int s_verbose;\nstatic const char* s_infile;\nstatic Thread::Options s_thread_options;\nstatic Stream* s_trace_stream;\nstatic bool s_run_all_exports;\nstatic bool s_host_print;\nstatic bool s_dummy_import_func;\nstatic Features s_features;\nstatic bool s_wasi;\nstatic std::vector<FunctionCall> s_run_exports;\nstatic std::vector<std::string> s_wasi_env;\nstatic std::vector<std::string> s_wasi_argv;\nstatic std::vector<std::string> s_wasi_dirs;\n\nstatic std::unique_ptr<FileStream> s_log_stream;\nstatic std::unique_ptr<FileStream> s_stdout_stream;\nstatic std::unique_ptr<FileStream> s_stderr_stream;\n\nstatic Store s_store;\n\nstatic const char s_description[] =\n    R\"(  read a file in the wasm binary format, and run in it a stack-based\n  interpreter.\n\nexamples:\n  # parse binary file test.wasm, and type-check it\n  $ wasm-interp test.wasm\n\n  # parse test.wasm and run all its exported functions\n  $ wasm-interp test.wasm --run-all-exports\n\n  # parse test.wasm, run the exported functions and trace the output\n  $ wasm-interp test.wasm --run-all-exports --trace\n\n  # parse test.wasm and run all its exported functions, setting the\n  # value stack size to 100 elements\n  $ wasm-interp test.wasm -V 100 --run-all-exports\n\n  # parse test.wasm, run specific exported function by name with argument\n  $ wasm-interp test.wasm -r \"func_sum\" -a \"i32:8\" -a \"i32:5\"\n)\";\n\nResult ParseWasmValue(std::string argument, Value& val) {\n  Result result = Result::Ok;\n\n  size_t cindex;\n  if (argument.empty() || (cindex = argument.find(':')) == std::string::npos) {\n    return wabt::Result::Error;\n  }\n\n  argument[cindex] = '\\0';\n  const char* ptype = argument.c_str();\n  const char* pval = argument.c_str() + cindex + 1;\n  const char* pval_end = ptype + argument.length();\n\n  if (strcmp(ptype, \"i32\") == 0) {\n    uint32_t parsed_value;\n    result |=\n        ParseInt32(pval, pval_end, &parsed_value, ParseIntType::UnsignedOnly);\n    val.Set(parsed_value);\n  }\n  if (strcmp(ptype, \"i64\") == 0) {\n    uint64_t parsed_value;\n    result |=\n        ParseInt64(pval, pval_end, &parsed_value, ParseIntType::UnsignedOnly);\n    val.Set(parsed_value);\n  }\n  if (strcmp(ptype, \"f32\") == 0) {\n    uint32_t parsed_value;\n    result |= ParseFloat(LiteralType::Float, pval, pval_end, &parsed_value);\n    val.Set(parsed_value);\n  }\n  if (strcmp(ptype, \"f64\") == 0) {\n    uint64_t parsed_value;\n    result |= ParseDouble(LiteralType::Float, pval, pval_end, &parsed_value);\n    val.Set(parsed_value);\n  }\n  return result;\n}\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"wasm-interp\", s_description);\n\n  parser.AddOption('v', \"verbose\", \"Use multiple times for more info\", []() {\n    s_verbose++;\n    s_log_stream = FileStream::CreateStderr();\n  });\n  s_features.AddOptions(&parser);\n  parser.AddOption('V', \"value-stack-size\", \"SIZE\",\n                   \"Size in elements of the value stack\",\n                   [](const std::string& argument) {\n                     // TODO(binji): validate.\n                     s_thread_options.value_stack_size = atoi(argument.c_str());\n                   });\n  parser.AddOption('C', \"call-stack-size\", \"SIZE\",\n                   \"Size in elements of the call stack\",\n                   [](const std::string& argument) {\n                     // TODO(binji): validate.\n                     s_thread_options.call_stack_size = atoi(argument.c_str());\n                   });\n  parser.AddOption('t', \"trace\", \"Trace execution\",\n                   []() { s_trace_stream = s_stdout_stream.get(); });\n  parser.AddOption('r', \"run-export\", \"FUNCTION\",\n                   \"Run exported function by name\",\n                   [](const std::string& argument) {\n                     FunctionCall func;\n                     func.name = argument;\n                     s_run_exports.push_back(func);\n                   });\n  parser.AddOption('a', \"argument\", \"ARGUMENT\",\n                   \"Add argument to an exported function execution\",\n                   [](const std::string& argument) {\n                     Value val;\n                     ERROR_EXIT_UNLESS(\n                         !s_run_exports.empty(),\n                         \"Cannot find a function execution for argument '%s'\\n\",\n                         argument.c_str());\n                     ERROR_EXIT_UNLESS(Succeeded(ParseWasmValue(argument, val)),\n                                       \"Failed to parse argument '%s'\\n\",\n                                       argument.c_str());\n                     s_run_exports.back().args.push_back(val);\n                   });\n  parser.AddOption(\"wasi\",\n                   \"Assume input module is WASI compliant (Export \"\n                   \" WASI API the the module and invoke _start function)\",\n                   []() { s_wasi = true; });\n  parser.AddOption(\n      'e', \"env\", \"ENV\",\n      \"Pass the given environment string in the WASI runtime\",\n      [](const std::string& argument) { s_wasi_env.push_back(argument); });\n  parser.AddOption(\n      'd', \"dir\", \"DIR\", \"Pass the given directory the the WASI runtime\",\n      [](const std::string& argument) { s_wasi_dirs.push_back(argument); });\n  parser.AddOption(\n      \"run-all-exports\",\n      \"Run all the exported functions, in order. Useful for testing\",\n      []() { s_run_all_exports = true; });\n  parser.AddOption(\"host-print\",\n                   \"Include an importable function named \\\"host.print\\\" for \"\n                   \"printing to stdout\",\n                   []() { s_host_print = true; });\n  parser.AddOption(\n      \"dummy-import-func\",\n      \"Provide a dummy implementation of all imported functions. The function \"\n      \"will log the call and return an appropriate zero value.\",\n      []() { s_dummy_import_func = true; });\n\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) { s_infile = argument; });\n  parser.AddArgument(\n      \"arg\", OptionParser::ArgumentCount::ZeroOrMore,\n      [](const char* argument) { s_wasi_argv.push_back(argument); });\n  parser.Parse(argc, argv);\n}\n\nResult RunSpecificExports(const Instance::Ptr& instance,\n                          Errors* errors,\n                          std::vector<FunctionCall>& calls) {\n  Result result = Result::Ok;\n\n  auto module = s_store.UnsafeGet<Module>(instance->module());\n  auto&& module_desc = module->desc();\n\n  for (auto&& export_ : module_desc.exports) {\n    for (auto& call_ : calls) {\n      if (export_.type.name == call_.name) {\n        ERROR_EXIT_UNLESS(export_.type.type->kind == ExternalKind::Func,\n                          \"Export '%s' is not a function\\n\",\n                          export_.type.name.c_str());\n\n        if (s_trace_stream) {\n          s_trace_stream->Writef(\">>> running export \\\"%s\\\":\\n\",\n                                 call_.name.c_str());\n        }\n        auto* func_type = cast<FuncType>(export_.type.type.get());\n        int params_size = func_type->params.size();\n        int args_size = call_.args.size();\n        ERROR_EXIT_UNLESS(params_size == args_size,\n                          \"Exported function '%s' expects %d arguments, but %d \"\n                          \"were provided\\n\",\n                          export_.type.name.c_str(), params_size, args_size);\n\n        auto func = s_store.UnsafeGet<Func>(instance->funcs()[export_.index]);\n        Values results;\n        Trap::Ptr trap;\n        result |=\n            func->Call(s_store, call_.args, results, &trap, s_trace_stream);\n        WriteCall(s_stdout_stream.get(), export_.type.name, *func_type,\n                  call_.args, results, trap);\n      }\n    }\n  }\n\n  return result;\n}\n\nResult RunAllExports(const Instance::Ptr& instance, Errors* errors) {\n  Result result = Result::Ok;\n\n  auto module = s_store.UnsafeGet<Module>(instance->module());\n  auto&& module_desc = module->desc();\n\n  for (auto&& export_ : module_desc.exports) {\n    if (export_.type.type->kind != ExternalKind::Func) {\n      continue;\n    }\n    auto* func_type = cast<FuncType>(export_.type.type.get());\n    if (func_type->params.empty()) {\n      if (s_trace_stream) {\n        s_trace_stream->Writef(\">>> running export \\\"%s\\\":\\n\",\n                               export_.type.name.c_str());\n      }\n      auto func = s_store.UnsafeGet<Func>(instance->funcs()[export_.index]);\n      Values params;\n      Values results;\n      Trap::Ptr trap;\n      result |= func->Call(s_store, params, results, &trap, s_trace_stream);\n      WriteCall(s_stdout_stream.get(), export_.type.name, *func_type, params,\n                results, trap);\n    }\n  }\n\n  return result;\n}\n\nstatic void BindImports(const Module::Ptr& module, RefVec& imports) {\n  auto* stream = s_stdout_stream.get();\n\n  for (auto&& import : module->desc().imports) {\n    if (import.type.type->kind == ExternKind::Func &&\n        ((s_host_print && import.type.module == \"host\" &&\n          import.type.name == \"print\") ||\n         s_dummy_import_func)) {\n      auto func_type = *cast<FuncType>(import.type.type.get());\n      auto import_name = StringPrintf(\"%s.%s\", import.type.module.c_str(),\n                                      import.type.name.c_str());\n\n      auto host_func = HostFunc::New(\n          s_store, func_type,\n          [=](Thread& thread, const Values& params, Values& results,\n              Trap::Ptr* trap) -> Result {\n            printf(\"called host \");\n            WriteCall(stream, import_name, func_type, params, results, *trap);\n            return Result::Ok;\n          });\n      imports.push_back(host_func.ref());\n      continue;\n    }\n\n    // By default, just push an null reference. This won't resolve, and\n    // instantiation will fail.\n    imports.push_back(Ref::Null);\n  }\n}\n\nstatic Result ReadModule(const char* module_filename,\n                         Errors* errors,\n                         Module::Ptr* out_module) {\n  auto* stream = s_stdout_stream.get();\n  std::vector<uint8_t> file_data;\n  CHECK_RESULT(ReadFile(module_filename, &file_data));\n\n  ModuleDesc module_desc;\n  const bool kReadDebugNames = true;\n  const bool kStopOnFirstError = true;\n  const bool kFailOnCustomSectionError = true;\n  ReadBinaryOptions options(s_features, s_log_stream.get(), kReadDebugNames,\n                            kStopOnFirstError, kFailOnCustomSectionError);\n  CHECK_RESULT(ReadBinaryInterp(module_filename, file_data.data(),\n                                file_data.size(), options, errors,\n                                &module_desc));\n\n  if (s_verbose) {\n    module_desc.istream.Disassemble(stream);\n  }\n\n  *out_module = Module::New(s_store, module_desc);\n  return Result::Ok;\n}\n\nstatic Result InstantiateModule(RefVec& imports,\n                                const Module::Ptr& module,\n                                Instance::Ptr* out_instance) {\n  RefPtr<Trap> trap;\n  *out_instance = Instance::Instantiate(s_store, module.ref(), imports, &trap);\n  if (!*out_instance) {\n    WriteTrap(s_stderr_stream.get(), \"error initializing module\", trap);\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nstatic Result ReadAndRunModule(const char* module_filename) {\n  Errors errors;\n  Module::Ptr module;\n  Result result = ReadModule(module_filename, &errors, &module);\n  if (!Succeeded(result)) {\n    FormatErrorsToFile(errors, Location::Type::Binary);\n    return result;\n  }\n\n  RefVec imports;\n\n#if WITH_WASI\n  uvwasi_t uvwasi;\n#endif\n\n  if (s_wasi) {\n#if WITH_WASI\n    uvwasi_errno_t err;\n    uvwasi_options_t init_options;\n\n    std::vector<const char*> argv;\n    argv.push_back(module_filename);\n    for (auto& s : s_wasi_argv) {\n      if (s_trace_stream) {\n        s_trace_stream->Writef(\"wasi: arg: \\\"%s\\\"\\n\", s.c_str());\n      }\n      argv.push_back(s.c_str());\n    }\n    argv.push_back(nullptr);\n\n    std::vector<const char*> envp;\n    for (auto& s : s_wasi_env) {\n      if (s_trace_stream) {\n        s_trace_stream->Writef(\"wasi: env: \\\"%s\\\"\\n\", s.c_str());\n      }\n      envp.push_back(s.c_str());\n    }\n    envp.push_back(nullptr);\n\n    std::vector<uvwasi_preopen_t> dirs;\n    for (auto& dir : s_wasi_dirs) {\n      if (s_trace_stream) {\n        s_trace_stream->Writef(\"wasi: dir: \\\"%s\\\"\\n\", dir.c_str());\n      }\n      dirs.push_back({dir.c_str(), dir.c_str()});\n    }\n\n    /* Setup the initialization options. */\n    init_options.in = 0;\n    init_options.out = 1;\n    init_options.err = 2;\n    init_options.fd_table_size = 3;\n    init_options.argc = argv.size() - 1;\n    init_options.argv = argv.data();\n    init_options.envp = envp.data();\n    init_options.preopenc = dirs.size();\n    init_options.preopens = dirs.data();\n    init_options.allocator = NULL;\n\n    err = uvwasi_init(&uvwasi, &init_options);\n    if (err != UVWASI_ESUCCESS) {\n      s_stderr_stream.get()->Writef(\"error initialiazing uvwasi: %d\\n\", err);\n      return Result::Error;\n    }\n    CHECK_RESULT(WasiBindImports(module, imports, s_stderr_stream.get(),\n                                 s_trace_stream));\n#else\n    s_stderr_stream.get()->Writef(\"wasi support not compiled in\\n\");\n    return Result::Error;\n#endif\n  } else {\n    BindImports(module, imports);\n  }\n\n  Instance::Ptr instance;\n  CHECK_RESULT(InstantiateModule(imports, module, &instance));\n\n  if (s_run_all_exports) {\n    RunAllExports(instance, &errors);\n  }\n\n  if (!s_run_exports.empty()) {\n    RunSpecificExports(instance, &errors, s_run_exports);\n  }\n#ifdef WITH_WASI\n  if (s_wasi) {\n    CHECK_RESULT(\n        WasiRunStart(instance, &uvwasi, s_stderr_stream.get(), s_trace_stream));\n  }\n#endif\n\n  return Result::Ok;\n}\n\nint ProgramMain(int argc, char** argv) {\n  InitStdio();\n  s_stdout_stream = FileStream::CreateStdout();\n  s_stderr_stream = FileStream::CreateStderr();\n\n  ParseOptions(argc, argv);\n  s_store.setFeatures(s_features);\n\n  wabt::Result result = ReadAndRunModule(s_infile);\n  return result != wabt::Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wasm-objdump.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cstdio>\n#include <cstdlib>\n#include <cstring>\n\n#include \"wabt/binary-reader-objdump.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/common.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n\nusing namespace wabt;\n\nstatic const char s_description[] =\n    R\"(  Print information about the contents of wasm binaries.\n\nexamples:\n  $ wasm-objdump test.wasm\n)\";\n\nstatic ObjdumpOptions s_objdump_options;\n\nstatic std::vector<const char*> s_infiles;\n\nstatic std::unique_ptr<FileStream> s_log_stream;\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"wasm-objdump\", s_description);\n\n  parser.AddOption('h', \"headers\", \"Print headers\",\n                   []() { s_objdump_options.headers = true; });\n  parser.AddOption(\n      'j', \"section\", \"SECTION\", \"Select just one section\",\n      [](const char* argument) { s_objdump_options.section_name = argument; });\n  parser.AddOption('s', \"full-contents\", \"Print raw section contents\",\n                   []() { s_objdump_options.raw = true; });\n  parser.AddOption('d', \"disassemble\", \"Disassemble function bodies\",\n                   []() { s_objdump_options.disassemble = true; });\n  parser.AddOption(\"debug\", \"Print extra debug information\", []() {\n    s_objdump_options.debug = true;\n    s_log_stream = FileStream::CreateStderr();\n    s_objdump_options.log_stream = s_log_stream.get();\n  });\n  parser.AddOption('x', \"details\", \"Show section details\",\n                   []() { s_objdump_options.details = true; });\n  parser.AddOption('r', \"reloc\", \"Show relocations inline with disassembly\",\n                   []() { s_objdump_options.relocs = true; });\n  parser.AddOption(0, \"section-offsets\",\n                   \"Print section offsets instead of file offsets \"\n                   \"in code disassembly\",\n                   []() { s_objdump_options.section_offsets = true; });\n  parser.AddArgument(\n      \"filename\", OptionParser::ArgumentCount::OneOrMore,\n      [](const char* argument) { s_infiles.push_back(argument); });\n\n  parser.Parse(argc, argv);\n}\n\nResult dump_file(const char* filename) {\n  std::vector<uint8_t> file_data;\n  CHECK_RESULT(ReadFile(filename, &file_data));\n\n  uint8_t* data = file_data.data();\n  size_t size = file_data.size();\n\n  // Perform serveral passed over the binary in order to print out different\n  // types of information.\n  s_objdump_options.filename = filename;\n  printf(\"\\n\");\n\n  ObjdumpState state;\n\n  Result result = Result::Ok;\n\n  // Pass 0: Prepass\n  s_objdump_options.mode = ObjdumpMode::Prepass;\n  result |= ReadBinaryObjdump(data, size, &s_objdump_options, &state);\n  s_objdump_options.log_stream = nullptr;\n\n  // Pass 1: Print the section headers\n  if (s_objdump_options.headers) {\n    s_objdump_options.mode = ObjdumpMode::Headers;\n    result |= ReadBinaryObjdump(data, size, &s_objdump_options, &state);\n  }\n\n  // Pass 2: Print extra information based on section type\n  if (s_objdump_options.details) {\n    s_objdump_options.mode = ObjdumpMode::Details;\n    result |= ReadBinaryObjdump(data, size, &s_objdump_options, &state);\n  }\n\n  // Pass 3: Disassemble code section\n  if (s_objdump_options.disassemble) {\n    s_objdump_options.mode = ObjdumpMode::Disassemble;\n    result |= ReadBinaryObjdump(data, size, &s_objdump_options, &state);\n  }\n\n  // Pass 4: Dump to raw contents of the sections\n  if (s_objdump_options.raw) {\n    s_objdump_options.mode = ObjdumpMode::RawData;\n    result |= ReadBinaryObjdump(data, size, &s_objdump_options, &state);\n  }\n\n  return result;\n}\n\nint ProgramMain(int argc, char** argv) {\n  InitStdio();\n\n  ParseOptions(argc, argv);\n  if (!s_objdump_options.headers && !s_objdump_options.details &&\n      !s_objdump_options.disassemble && !s_objdump_options.raw) {\n    fprintf(stderr, \"At least one of the following switches must be given:\\n\");\n    fprintf(stderr, \" -d/--disassemble\\n\");\n    fprintf(stderr, \" -h/--headers\\n\");\n    fprintf(stderr, \" -x/--details\\n\");\n    fprintf(stderr, \" -s/--full-contents\\n\");\n    return 1;\n  }\n\n  for (const char* filename : s_infiles) {\n    if (Failed(dump_file(filename))) {\n      return 1;\n    }\n  }\n\n  return 0;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wasm-stats.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <algorithm>\n#include <cassert>\n#include <cerrno>\n#include <cinttypes>\n#include <cstdio>\n#include <cstdlib>\n#include <iterator>\n#include <map>\n#include <vector>\n\n#include \"wabt/binary-reader-stats.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n\n#define ERROR(fmt, ...) \\\n  fprintf(stderr, \"%s:%d: \" fmt, __FILE__, __LINE__, __VA_ARGS__)\n\nusing namespace wabt;\n\nstatic int s_verbose;\nstatic const char* s_infile;\nstatic const char* s_outfile;\nstatic size_t s_cutoff = 0;\nstatic const char* s_separator = \": \";\n\nstatic ReadBinaryOptions s_read_binary_options;\nstatic std::unique_ptr<FileStream> s_log_stream;\nstatic Features s_features;\n\nstatic const char s_description[] =\n    R\"(  Read a file in the wasm binary format, and output stats.\n\nexamples:\n  # parse binary file test.wasm and write opcode dist file test.dist\n  $ wasm-stats test.wasm -o test.dist\n)\";\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"wasm-stats\", s_description);\n\n  parser.AddOption('v', \"verbose\", \"Use multiple times for more info\", []() {\n    s_verbose++;\n    s_log_stream = FileStream::CreateStderr();\n    s_read_binary_options.log_stream = s_log_stream.get();\n  });\n  s_features.AddOptions(&parser);\n  parser.AddOption('o', \"output\", \"FILENAME\",\n                   \"Output file for the stats, by default use stdout\",\n                   [](const char* argument) { s_outfile = argument; });\n  parser.AddOption(\n      'c', \"cutoff\", \"N\", \"Cutoff for reporting counts less than N\",\n      [](const std::string& argument) { s_cutoff = atol(argument.c_str()); });\n  parser.AddOption(\n      's', \"separator\", \"SEPARATOR\",\n      \"Separator text between element and count when reporting counts\",\n      [](const char* argument) { s_separator = argument; });\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::OneOrMore,\n                     [](const char* argument) { s_infile = argument; });\n  parser.Parse(argc, argv);\n}\n\ntemplate <typename T>\nstruct SortByCountDescending {\n  bool operator()(const T& lhs, const T& rhs) const {\n    return lhs.second > rhs.second;\n  }\n};\n\ntemplate <typename T>\nstruct WithinCutoff {\n  bool operator()(const T& pair) const { return pair.second >= s_cutoff; }\n};\n\nstatic size_t SumCounts(const OpcodeInfoCounts& info_counts) {\n  size_t sum = 0;\n  for (auto& [info, count] : info_counts) {\n    sum += count;\n  }\n  return sum;\n}\n\nvoid WriteCounts(Stream& stream, const OpcodeInfoCounts& info_counts) {\n  using OpcodeCountPair = std::pair<Opcode, size_t>;\n\n  std::map<Opcode, size_t> counts;\n  for (auto& [info, count] : info_counts) {\n    Opcode opcode = info.opcode();\n    counts[opcode] += count;\n  }\n\n  std::vector<OpcodeCountPair> sorted;\n  std::copy_if(counts.begin(), counts.end(), std::back_inserter(sorted),\n               WithinCutoff<OpcodeCountPair>());\n\n  // Use a stable sort to keep the elements with the same count in opcode\n  // order (since the Opcode map is sorted).\n  std::stable_sort(sorted.begin(), sorted.end(),\n                   SortByCountDescending<OpcodeCountPair>());\n\n  for (auto& [opcode, count] : sorted) {\n    stream.Writef(\"%s%s%\" PRIzd \"\\n\", opcode.GetName(), s_separator, count);\n  }\n}\n\nvoid WriteCountsWithImmediates(Stream& stream, const OpcodeInfoCounts& counts) {\n  // Remove const from the key type so we can sort below.\n  using OpcodeInfoCountPair =\n      std::pair<std::remove_const<OpcodeInfoCounts::key_type>::type,\n                OpcodeInfoCounts::mapped_type>;\n\n  std::vector<OpcodeInfoCountPair> sorted;\n  std::copy_if(counts.begin(), counts.end(), std::back_inserter(sorted),\n               WithinCutoff<OpcodeInfoCountPair>());\n\n  // Use a stable sort to keep the elements with the same count in opcode info\n  // order (since the OpcodeInfoCounts map is sorted).\n  std::stable_sort(sorted.begin(), sorted.end(),\n                   SortByCountDescending<OpcodeInfoCountPair>());\n\n  for (auto& [info, count] : sorted) {\n    info.Write(stream);\n    stream.Writef(\"%s%\" PRIzd \"\\n\", s_separator, count);\n  }\n}\n\nint ProgramMain(int argc, char** argv) {\n  InitStdio();\n  ParseOptions(argc, argv);\n\n  std::vector<uint8_t> file_data;\n  Result result = ReadFile(s_infile, &file_data);\n  if (Failed(result)) {\n    const char* input_name = s_infile ? s_infile : \"stdin\";\n    ERROR(\"Unable to parse: %s\", input_name);\n    return 1;\n  }\n\n  FileStream stream(s_outfile ? FileStream(s_outfile) : FileStream(stdout));\n\n  if (Succeeded(result)) {\n    OpcodeInfoCounts counts;\n    s_read_binary_options.features = s_features;\n    result = ReadBinaryOpcnt(file_data.data(), file_data.size(),\n                             s_read_binary_options, &counts);\n    if (Succeeded(result)) {\n      stream.Writef(\"Total opcodes: %\" PRIzd \"\\n\\n\", SumCounts(counts));\n\n      stream.Writef(\"Opcode counts:\\n\");\n      WriteCounts(stream, counts);\n\n      stream.Writef(\"\\nOpcode counts with immediates:\\n\");\n      WriteCountsWithImmediates(stream, counts);\n    }\n  }\n\n  return result != Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wasm-strip.cc",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n#include <set>\n\n#include \"wabt/binary-reader-nop.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/binary.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/leb128.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n\nusing namespace wabt;\n\nstatic std::string s_filename;\nstatic std::string s_outfile;\nstatic std::set<std::string_view> v_sections_to_keep{};\nstatic std::set<std::string_view> v_sections_to_remove{};\n\nstatic const char s_description[] =\n    R\"(  Remove sections of a WebAssembly binary file.\n\nexamples:\n  # Remove all custom sections from test.wasm\n  $ wasm-strip test.wasm\n)\";\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"wasm-strip\", s_description);\n\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) {\n                       s_filename = argument;\n                       ConvertBackslashToSlash(&s_filename);\n                     });\n  parser.AddOption('o', \"output\", \"FILE\", \"output wasm binary file\",\n                   [](const char* argument) { s_outfile = argument; });\n  parser.AddOption('k', \"keep-section\", \"SECTION NAME\",\n                   \"Section name to keep in the final output\",\n                   [](const char* value) {\n                     v_sections_to_keep.insert(std::string_view{value});\n                   });\n  parser.AddOption('R', \"remove-section\", \"SECTION NAME\",\n                   \"Section to specifically remove, including all the rest\",\n                   [](const char* value) {\n                     v_sections_to_remove.insert(std::string_view{value});\n                   });\n  parser.Parse(argc, argv);\n}\n\nclass BinaryReaderStrip : public BinaryReaderNop {\n public:\n  explicit BinaryReaderStrip(std::set<std::string_view> sections_to_keep,\n                             std::set<std::string_view> sections_to_remove,\n                             Errors* errors)\n      : errors_(errors),\n        sections_to_keep_(sections_to_keep),\n        sections_to_remove_(sections_to_remove),\n        section_start_(0) {\n    stream_.WriteU32(WABT_BINARY_MAGIC, \"WASM_BINARY_MAGIC\");\n    stream_.WriteU32(WABT_BINARY_VERSION, \"WASM_BINARY_VERSION\");\n  }\n\n  bool OnError(const Error& error) override {\n    errors_->push_back(error);\n    return true;\n  }\n\n  Result BeginSection(Index section_index,\n                      BinarySection section_type,\n                      Offset size) override {\n    section_start_ = state->offset;\n    if (section_type == BinarySection::Custom) {\n      return Result::Ok;\n    }\n    stream_.WriteU8Enum(section_type, \"section code\");\n    WriteU32Leb128(&stream_, size, \"section size\");\n    stream_.WriteData(state->data + state->offset, size, \"section data\");\n    return Result::Ok;\n  }\n\n  Result WriteToFile(std::string_view filename) {\n    return stream_.WriteToFile(filename);\n  }\n\n  Result BeginCustomSection(Index section_index,\n                            Offset size,\n                            std::string_view section_name) override {\n    if (sections_to_remove_.count(section_name) > 0) {\n      return Result::Ok;\n    }\n\n    if (sections_to_keep_.count(section_name) > 0 ||\n        !sections_to_remove_.empty()) {\n      stream_.WriteU8Enum(BinarySection::Custom, \"section code\");\n      WriteU32Leb128(&stream_, size, \"section size\");\n      stream_.WriteData(state->data + section_start_, size, \"section data\");\n    }\n    return Result::Ok;\n  }\n\n private:\n  MemoryStream stream_;\n  Errors* errors_;\n  std::set<std::string_view> sections_to_keep_;\n  std::set<std::string_view> sections_to_remove_;\n  Offset section_start_;\n};\n\nint ProgramMain(int argc, char** argv) {\n  Result result;\n\n  InitStdio();\n  ParseOptions(argc, argv);\n\n  std::vector<uint8_t> file_data;\n  result = ReadFile(s_filename.c_str(), &file_data);\n  if (Failed(result)) {\n    return Result::Error;\n  }\n\n  Errors errors;\n  Features features;\n  features.EnableAll();\n  const bool kReadDebugNames = false;\n  const bool kStopOnFirstError = true;\n  const bool kFailOnCustomSectionError = false;\n  ReadBinaryOptions options(features, nullptr, kReadDebugNames,\n                            kStopOnFirstError, kFailOnCustomSectionError);\n\n  BinaryReaderStrip reader(v_sections_to_keep, v_sections_to_remove, &errors);\n  result = ReadBinary(file_data.data(), file_data.size(), &reader, options);\n  FormatErrorsToFile(errors, Location::Type::Binary);\n  if (Failed(result)) {\n    return Result::Error;\n  }\n\n  if (s_outfile.empty()) {\n    s_outfile = s_filename;\n  }\n  return reader.WriteToFile(s_outfile);\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wasm-validate.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <cinttypes>\n#include <cstdio>\n#include <cstdlib>\n\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/validator.h\"\n#include \"wabt/wast-lexer.h\"\n\nusing namespace wabt;\n\nstatic int s_verbose;\nstatic std::string s_infile;\nstatic Features s_features;\nstatic bool s_read_debug_names = true;\nstatic bool s_fail_on_custom_section_error = true;\nstatic std::unique_ptr<FileStream> s_log_stream;\n\nstatic const char s_description[] =\n    R\"(  Read a file in the WebAssembly binary format, and validate it.\n\nexamples:\n  # validate binary file test.wasm\n  $ wasm-validate test.wasm\n)\";\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"wasm-validate\", s_description);\n\n  parser.AddOption('v', \"verbose\", \"Use multiple times for more info\", []() {\n    s_verbose++;\n    s_log_stream = FileStream::CreateStderr();\n  });\n  s_features.AddOptions(&parser);\n  parser.AddOption(\"no-debug-names\", \"Ignore debug names in the binary file\",\n                   []() { s_read_debug_names = false; });\n  parser.AddOption(\"ignore-custom-section-errors\",\n                   \"Ignore errors in custom sections\",\n                   []() { s_fail_on_custom_section_error = false; });\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) {\n                       s_infile = argument;\n                       ConvertBackslashToSlash(&s_infile);\n                     });\n  parser.Parse(argc, argv);\n}\n\nint ProgramMain(int argc, char** argv) {\n  Result result;\n\n  InitStdio();\n  ParseOptions(argc, argv);\n\n  std::vector<uint8_t> file_data;\n  result = ReadFile(s_infile.c_str(), &file_data);\n  if (Succeeded(result)) {\n    Errors errors;\n    Module module;\n    const bool kStopOnFirstError = true;\n    ReadBinaryOptions options(s_features, s_log_stream.get(),\n                              s_read_debug_names, kStopOnFirstError,\n                              s_fail_on_custom_section_error);\n    result = ReadBinaryIr(s_infile.c_str(), file_data.data(), file_data.size(),\n                          options, &errors, &module);\n    if (Succeeded(result)) {\n      ValidateOptions options(s_features);\n      result = ValidateModule(&module, &errors, options);\n    }\n    FormatErrorsToFile(errors, Location::Type::Binary);\n  }\n  return result != Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wasm2c.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <cinttypes>\n#include <cstdio>\n#include <cstdlib>\n\n#include \"wabt/apply-names.h\"\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/filenames.h\"\n#include \"wabt/generate-names.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/result.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/validator.h\"\n#include \"wabt/wast-lexer.h\"\n\n#include \"wabt/c-writer.h\"\n\nusing namespace wabt;\n\nstatic int s_verbose;\nstatic std::string s_infile;\nstatic std::string s_outfile;\nstatic unsigned int s_num_outputs = 1;\nstatic WriteCOptions s_write_c_options;\nstatic bool s_read_debug_names = true;\nstatic std::unique_ptr<FileStream> s_log_stream;\n\nstatic const char s_description[] =\n    R\"(  Read a file in the WebAssembly binary format, and convert it to\n  a C source file and header.\n\nexamples:\n  # parse binary file test.wasm and write test.c and test.h\n  $ wasm2c test.wasm -o test.c\n\n  # parse test.wasm, write test.c and test.h, but ignore the debug names, if any\n  $ wasm2c test.wasm --no-debug-names -o test.c\n)\";\n\nstatic const std::string supported_features[] = {\n    \"multi-memory\",      \"multi-value\",\n    \"sign-extension\",    \"saturating-float-to-int\",\n    \"exceptions\",        \"memory64\",\n    \"extended-const\",    \"simd\",\n    \"threads\",           \"tail-call\",\n    \"custom-page-sizes\", \"compact-imports\"};\n\nstatic bool IsFeatureSupported(const std::string& feature) {\n  return std::find(std::begin(supported_features), std::end(supported_features),\n                   feature) != std::end(supported_features);\n};\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"wasm2c\", s_description);\n\n  parser.AddOption('v', \"verbose\", \"Use multiple times for more info\", []() {\n    s_verbose++;\n    s_log_stream = FileStream::CreateStderr();\n  });\n  parser.AddOption(\n      'o', \"output\", \"FILENAME\",\n      \"Output file for the generated C source file, by default use stdout\",\n      [](const char* argument) {\n        s_outfile = argument;\n        ConvertBackslashToSlash(&s_outfile);\n      });\n  parser.AddOption(\n      '\\0', \"num-outputs\", \"NUM\", \"Number of output files to write\",\n      [](const char* argument) { s_num_outputs = atoi(argument); });\n  parser.AddOption(\n      'n', \"module-name\", \"MODNAME\",\n      \"Unique name for the module being generated. This name is prefixed to\\n\"\n      \"each of the generated C symbols. By default, the module name from the\\n\"\n      \"names section is used. If that is not present the name of the input\\n\"\n      \"file is used as the default.\\n\",\n      [](const char* argument) { s_write_c_options.module_name = argument; });\n  s_write_c_options.features.AddOptions(&parser);\n  parser.AddOption(\"no-debug-names\", \"Ignore debug names in the binary file\",\n                   []() { s_read_debug_names = false; });\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) {\n                       s_infile = argument;\n                       ConvertBackslashToSlash(&s_infile);\n                     });\n  parser.Parse(argc, argv);\n\n  bool any_non_supported_feature = false;\n#define WABT_FEATURE(variable, flag, default_, help)                   \\\n  any_non_supported_feature |=                                         \\\n      (s_write_c_options.features.variable##_enabled() != default_) && \\\n      s_write_c_options.features.variable##_enabled() &&               \\\n      !IsFeatureSupported(flag);\n#include \"wabt/feature.def\"\n#undef WABT_FEATURE\n\n  if (any_non_supported_feature) {\n    fprintf(stderr,\n            \"wasm2c currently only supports a limited set of features.\\n\");\n    exit(1);\n  }\n}\n\nResult Wasm2cMain(Errors& errors) {\n  if (s_num_outputs < 1) {\n    fprintf(stderr, \"Number of output files must be positive.\\n\");\n    return Result::Error;\n  }\n\n  std::vector<uint8_t> file_data;\n  CHECK_RESULT(ReadFile(s_infile.c_str(), &file_data));\n\n  Module module;\n  const bool kStopOnFirstError = true;\n  const bool kFailOnCustomSectionError = true;\n  ReadBinaryOptions options(s_write_c_options.features, s_log_stream.get(),\n                            s_read_debug_names, kStopOnFirstError,\n                            kFailOnCustomSectionError);\n  CHECK_RESULT(ReadBinaryIr(s_infile.c_str(), file_data.data(),\n                            file_data.size(), options, &errors, &module));\n  CHECK_RESULT(ValidateModule(&module, &errors, s_write_c_options.features));\n  CHECK_RESULT(GenerateNames(&module));\n  /* TODO(binji): This shouldn't fail; if a name can't be applied\n   * (because the index is invalid, say) it should just be skipped. */\n  ApplyNames(&module);\n\n  if (!s_outfile.empty()) {\n    std::string header_name_full =\n        std::string(wabt::StripExtension(s_outfile)) + \".h\";\n    std::vector<FileStream> c_streams;\n    if (s_num_outputs == 1) {\n      c_streams.emplace_back(s_outfile.c_str());\n    } else {\n      std::string output_prefix{wabt::StripExtension(s_outfile)};\n      for (unsigned int i = 0; i < s_num_outputs; i++) {\n        c_streams.emplace_back(output_prefix + \"_\" + std::to_string(i) + \".c\");\n      }\n    }\n    std::vector<Stream*> c_stream_ptrs;\n    for (auto& s : c_streams) {\n      c_stream_ptrs.emplace_back(&s);\n    }\n    FileStream h_stream(header_name_full);\n    std::string_view header_name = GetBasename(header_name_full);\n    if (s_write_c_options.module_name.empty()) {\n      s_write_c_options.module_name = module.name;\n      if (s_write_c_options.module_name.empty()) {\n        // In the absence of module name in the names section use the filename.\n        s_write_c_options.module_name = StripExtension(GetBasename(s_infile));\n      }\n    }\n    if (s_num_outputs == 1) {\n      CHECK_RESULT(WriteC(std::move(c_stream_ptrs), &h_stream, c_stream_ptrs[0],\n                          std::string(header_name).c_str(), \"\", &module,\n                          s_write_c_options));\n    } else {\n      std::string header_impl_name_full =\n          std::string(wabt::StripExtension(s_outfile)) + \"-impl.h\";\n      FileStream h_impl_stream(header_impl_name_full);\n      std::string_view header_impl_name = GetBasename(header_impl_name_full);\n      CHECK_RESULT(WriteC(std::move(c_stream_ptrs), &h_stream, &h_impl_stream,\n                          std::string(header_name).c_str(),\n                          std::string(header_impl_name).c_str(), &module,\n                          s_write_c_options));\n    }\n  } else {\n    FileStream stream(stdout);\n    CHECK_RESULT(WriteC({&stream}, &stream, &stream, \"wasm.h\", \"\", &module,\n                        s_write_c_options));\n  }\n\n  return Result::Ok;\n}\n\nint ProgramMain(int argc, char** argv) {\n  Result result;\n\n  InitStdio();\n  ParseOptions(argc, argv);\n\n  Errors errors;\n  result = Wasm2cMain(errors);\n  FormatErrorsToFile(errors, Location::Type::Binary);\n\n  return result != Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wasm2wat-fuzz.cc",
    "content": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// This file is copied from the oss-fuzz project:\n//\n// https://github.com/google/oss-fuzz/blob/master/projects/wabt/wasm2wat_fuzzer.cc\n\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/common.h\"\n#include \"wabt/ir.h\"\n\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n  wabt::ReadBinaryOptions options;\n  wabt::Errors errors;\n  wabt::Module module;\n  wabt::ReadBinaryIr(\"dummy filename\", data, size, options, &errors, &module);\n  return 0;\n}\n"
  },
  {
    "path": "src/tools/wasm2wat.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <cinttypes>\n#include <cstdio>\n#include <cstdlib>\n\n#include \"wabt/apply-names.h\"\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/generate-names.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/validator.h\"\n#include \"wabt/wast-lexer.h\"\n#include \"wabt/wat-writer.h\"\n\nusing namespace wabt;\n\nstatic int s_verbose;\nstatic std::string s_infile;\nstatic std::string s_outfile;\nstatic Features s_features;\nstatic bool s_generate_names;\nstatic bool s_fold_exprs;\nstatic bool s_inline_import;\nstatic bool s_inline_export;\nstatic bool s_read_debug_names = true;\nstatic bool s_fail_on_custom_section_error = true;\nstatic std::unique_ptr<FileStream> s_log_stream;\nstatic bool s_validate = true;\n\nstatic const char s_description[] =\n    R\"(  Read a file in the WebAssembly binary format, and convert it to\n  the WebAssembly text format.\n\nexamples:\n  # parse binary file test.wasm and write text file test.wast\n  $ wasm2wat test.wasm -o test.wat\n\n  # parse test.wasm, write test.wat, but ignore the debug names, if any\n  $ wasm2wat test.wasm --no-debug-names -o test.wat\n)\";\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"wasm2wat\", s_description);\n\n  parser.AddOption('v', \"verbose\", \"Use multiple times for more info\", []() {\n    s_verbose++;\n    s_log_stream = FileStream::CreateStderr();\n  });\n  parser.AddOption(\n      'o', \"output\", \"FILENAME\",\n      \"Output file for the generated wast file, by default use stdout\",\n      [](const char* argument) {\n        s_outfile = argument;\n        ConvertBackslashToSlash(&s_outfile);\n      });\n  parser.AddOption('f', \"fold-exprs\", \"Write folded expressions where possible\",\n                   []() { s_fold_exprs = true; });\n  s_features.AddOptions(&parser);\n  parser.AddOption(\"inline-exports\", \"Write all exports inline\",\n                   []() { s_inline_export = true; });\n  parser.AddOption(\"inline-imports\", \"Write all imports inline\",\n                   []() { s_inline_import = true; });\n  parser.AddOption(\"no-debug-names\", \"Ignore debug names in the binary file\",\n                   []() { s_read_debug_names = false; });\n  parser.AddOption(\"ignore-custom-section-errors\",\n                   \"Ignore errors in custom sections\",\n                   []() { s_fail_on_custom_section_error = false; });\n  parser.AddOption(\n      \"generate-names\",\n      \"Give auto-generated names to non-named functions, types, etc.\",\n      []() { s_generate_names = true; });\n  parser.AddOption(\"no-check\", \"Don't check for invalid modules\",\n                   []() { s_validate = false; });\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) {\n                       s_infile = argument;\n                       ConvertBackslashToSlash(&s_infile);\n                     });\n  parser.Parse(argc, argv);\n}\n\nint ProgramMain(int argc, char** argv) {\n  Result result;\n\n  InitStdio();\n  ParseOptions(argc, argv);\n\n  std::vector<uint8_t> file_data;\n  result = ReadFile(s_infile.c_str(), &file_data);\n  if (Succeeded(result)) {\n    Errors errors;\n    Module module;\n    const bool kStopOnFirstError = true;\n    ReadBinaryOptions options(s_features, s_log_stream.get(),\n                              s_read_debug_names, kStopOnFirstError,\n                              s_fail_on_custom_section_error);\n    result = ReadBinaryIr(s_infile.c_str(), file_data.data(), file_data.size(),\n                          options, &errors, &module);\n    if (Succeeded(result)) {\n      if (Succeeded(result) && s_validate) {\n        ValidateOptions options(s_features);\n        result = ValidateModule(&module, &errors, options);\n      }\n\n      if (s_generate_names) {\n        result = GenerateNames(&module);\n      }\n\n      if (Succeeded(result)) {\n        /* TODO(binji): This shouldn't fail; if a name can't be applied\n         * (because the index is invalid, say) it should just be skipped. */\n        Result dummy_result = ApplyNames(&module);\n        WABT_USE(dummy_result);\n      }\n\n      if (Succeeded(result)) {\n        WriteWatOptions wat_options(s_features);\n        wat_options.fold_exprs = s_fold_exprs;\n        wat_options.inline_import = s_inline_import;\n        wat_options.inline_export = s_inline_export;\n        FileStream stream(!s_outfile.empty() ? FileStream(s_outfile)\n                                             : FileStream(stdout));\n        result = WriteWat(&stream, &module, wat_options);\n      }\n    }\n    FormatErrorsToFile(errors, Location::Type::Binary);\n  }\n  return result != Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wast2json.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <cstdarg>\n#include <cstdint>\n#include <cstdio>\n#include <cstdlib>\n#include <string>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/binary-writer-spec.h\"\n#include \"wabt/binary-writer.h\"\n#include \"wabt/common.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/filenames.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/resolve-names.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/validator.h\"\n#include \"wabt/wast-parser.h\"\n\nusing namespace wabt;\n\nstatic const char* s_infile;\nstatic std::string s_outfile;\nstatic int s_verbose;\nstatic WriteBinaryOptions s_write_binary_options;\nstatic bool s_validate = true;\nstatic bool s_debug_parsing;\nstatic Features s_features;\n\nstatic std::unique_ptr<FileStream> s_log_stream;\n\nstatic const char s_description[] =\n    R\"(  read a file in the wasm spec test format, check it for errors, and\n  convert it to a JSON file and associated wasm binary files.\n\nexamples:\n  # parse spec-test.wast, and write files to spec-test.json. Modules are\n  # written to spec-test.0.wasm, spec-test.1.wasm, etc.\n  $ wast2json spec-test.wast -o spec-test.json\n)\";\n\nstatic void ParseOptions(int argc, char* argv[]) {\n  OptionParser parser(\"wast2json\", s_description);\n\n  parser.AddOption('v', \"verbose\", \"Use multiple times for more info\", []() {\n    s_verbose++;\n    s_log_stream = FileStream::CreateStderr();\n  });\n  parser.AddOption(\"debug-parser\", \"Turn on debugging the parser of wast files\",\n                   []() { s_debug_parsing = true; });\n  s_features.AddOptions(&parser);\n  parser.AddOption('o', \"output\", \"FILE\", \"output JSON file\",\n                   [](const char* argument) { s_outfile = argument; });\n  parser.AddOption(\n      'r', \"relocatable\",\n      \"Create a relocatable wasm binary (suitable for linking with e.g. lld)\",\n      []() { s_write_binary_options.relocatable = true; });\n  parser.AddOption(\n      \"no-canonicalize-leb128s\",\n      \"Write all LEB128 sizes as 5-bytes instead of their minimal size\",\n      []() { s_write_binary_options.canonicalize_lebs = false; });\n  parser.AddOption(\"debug-names\",\n                   \"Write debug names to the generated binary file\",\n                   []() { s_write_binary_options.write_debug_names = true; });\n  parser.AddOption(\"no-check\", \"Don't check for invalid modules\",\n                   []() { s_validate = false; });\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) { s_infile = argument; });\n\n  parser.Parse(argc, argv);\n}\n\nstatic std::string DefaultOuputName(std::string_view input_name) {\n  // Strip existing extension and add .json\n  std::string result(StripExtension(GetBasename(input_name)));\n  result += \".json\";\n\n  return result;\n}\n\nint ProgramMain(int argc, char** argv) {\n  InitStdio();\n\n  ParseOptions(argc, argv);\n\n  std::vector<uint8_t> file_data;\n  Result result = ReadFile(s_infile, &file_data);\n  Errors errors;\n  std::unique_ptr<WastLexer> lexer = WastLexer::CreateBufferLexer(\n      s_infile, file_data.data(), file_data.size(), &errors);\n  if (Failed(result)) {\n    WABT_FATAL(\"unable to read file: %s\\n\", s_infile);\n  }\n\n  std::unique_ptr<Script> script;\n  WastParseOptions parse_wast_options(s_features);\n  result = ParseWastScript(lexer.get(), &script, &errors, &parse_wast_options);\n\n  if (Succeeded(result) && s_validate) {\n    ValidateOptions options(s_features);\n    result = ValidateScript(script.get(), &errors, options);\n  }\n\n  if (Succeeded(result)) {\n    if (s_outfile.empty()) {\n      s_outfile = DefaultOuputName(s_infile);\n    }\n\n    std::vector<FilenameMemoryStreamPair> module_streams;\n    MemoryStream json_stream;\n\n    std::string output_basename(StripExtension(s_outfile));\n    s_write_binary_options.features = s_features;\n    result = WriteBinarySpecScript(&json_stream, script.get(), s_infile,\n                                   output_basename, s_write_binary_options,\n                                   &module_streams, s_log_stream.get());\n\n    if (Succeeded(result)) {\n      result = json_stream.WriteToFile(s_outfile);\n    }\n\n    if (Succeeded(result)) {\n      for (const auto& pair : module_streams) {\n        result = pair.stream->WriteToFile(pair.filename);\n        if (!Succeeded(result)) {\n          break;\n        }\n      }\n    }\n  }\n\n  auto line_finder = lexer->MakeLineFinder();\n  FormatErrorsToFile(errors, Location::Type::Text, line_finder.get());\n\n  return result != Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wat-desugar.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <cstdarg>\n#include <cstdint>\n#include <cstdio>\n#include <cstdlib>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/apply-names.h\"\n#include \"wabt/common.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/generate-names.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/wast-parser.h\"\n#include \"wabt/wat-writer.h\"\n\nusing namespace wabt;\n\nstatic const char* s_infile;\nstatic const char* s_outfile;\nstatic bool s_debug_parsing;\nstatic bool s_fold_exprs;\nstatic bool s_generate_names;\nstatic bool s_inline_import;\nstatic bool s_inline_export;\nstatic Features s_features;\n\nstatic const char s_description[] =\n    R\"(  read a file in the wasm s-expression format and format it.\n\nexamples:\n  # write output to stdout\n  $ wat-desugar test.wat\n\n  # write output to test2.wat\n  $ wat-desugar test.wat -o test2.wat\n\n  # generate names for indexed variables\n  $ wat-desugar --generate-names test.wat\n)\";\n\nstatic void ParseOptions(int argc, char** argv) {\n  OptionParser parser(\"wat-desugar\", s_description);\n\n  parser.AddOption('o', \"output\", \"FILE\", \"Output file for the formatted file\",\n                   [](const char* argument) { s_outfile = argument; });\n  parser.AddOption(\"debug-parser\", \"Turn on debugging the parser of wat files\",\n                   []() { s_debug_parsing = true; });\n  parser.AddOption('f', \"fold-exprs\", \"Write folded expressions where possible\",\n                   []() { s_fold_exprs = true; });\n  parser.AddOption(\"inline-exports\", \"Write all exports inline\",\n                   []() { s_inline_export = true; });\n  parser.AddOption(\"inline-imports\", \"Write all imports inline\",\n                   []() { s_inline_import = true; });\n  s_features.AddOptions(&parser);\n  parser.AddOption(\n      \"generate-names\",\n      \"Give auto-generated names to non-named functions, types, etc.\",\n      []() { s_generate_names = true; });\n\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) { s_infile = argument; });\n  parser.Parse(argc, argv);\n}\n\nint ProgramMain(int argc, char** argv) {\n  InitStdio();\n  ParseOptions(argc, argv);\n\n  std::vector<uint8_t> file_data;\n  Result result = ReadFile(s_infile, &file_data);\n  if (Failed(result)) {\n    WABT_FATAL(\"unable to read %s\\n\", s_infile);\n  }\n\n  Errors errors;\n  std::unique_ptr<WastLexer> lexer(WastLexer::CreateBufferLexer(\n      s_infile, file_data.data(), file_data.size(), &errors));\n\n  std::unique_ptr<Script> script;\n  WastParseOptions parse_wast_options(s_features);\n  result = ParseWastScript(lexer.get(), &script, &errors, &parse_wast_options);\n  auto line_finder = lexer->MakeLineFinder();\n  FormatErrorsToFile(errors, Location::Type::Text);\n\n  if (Succeeded(result)) {\n    Module* module = script->GetFirstModule();\n    if (!module) {\n      WABT_FATAL(\"no module in file.\\n\");\n    }\n\n    if (s_generate_names) {\n      result = GenerateNames(module);\n    }\n\n    if (Succeeded(result)) {\n      result = ApplyNames(module);\n    }\n\n    if (Succeeded(result)) {\n      WriteWatOptions wat_options(s_features);\n      wat_options.fold_exprs = s_fold_exprs;\n      wat_options.inline_import = s_inline_import;\n      wat_options.inline_export = s_inline_export;\n      FileStream stream(s_outfile ? FileStream(s_outfile) : FileStream(stdout));\n      result = WriteWat(&stream, module, wat_options);\n    }\n  }\n\n  return result != Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tools/wat2wasm.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <cassert>\n#include <cstdarg>\n#include <cstdint>\n#include <cstdio>\n#include <cstdlib>\n#include <string>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/binary-writer.h\"\n#include \"wabt/common.h\"\n#include \"wabt/error-formatter.h\"\n#include \"wabt/feature.h\"\n#include \"wabt/filenames.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/option-parser.h\"\n#include \"wabt/resolve-names.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/validator.h\"\n#include \"wabt/wast-parser.h\"\n\nusing namespace wabt;\n\nstatic const char* s_infile;\nstatic std::string s_outfile;\nstatic bool s_dump_module;\nstatic int s_verbose;\nstatic WriteBinaryOptions s_write_binary_options;\nstatic bool s_validate = true;\nstatic bool s_debug_parsing;\nstatic Features s_features;\n\nstatic std::unique_ptr<FileStream> s_log_stream;\n\nstatic const char s_description[] =\n    R\"(  read a file in the wasm text format, check it for errors, and\n  convert it to the wasm binary format.\n\nexamples:\n  # parse test.wat and write to .wasm binary file with the same name\n  $ wat2wasm test.wat\n\n  # parse test.wat and write to binary file test.wasm\n  $ wat2wasm test.wat -o test.wasm\n\n  # parse spec-test.wast, and write verbose output to stdout (including\n  # the meaning of every byte)\n  $ wat2wasm spec-test.wast -v\n)\";\n\nstatic void ParseOptions(int argc, char* argv[]) {\n  OptionParser parser(\"wat2wasm\", s_description);\n\n  parser.AddOption('v', \"verbose\", \"Use multiple times for more info\", []() {\n    s_verbose++;\n    s_log_stream = FileStream::CreateStderr();\n  });\n  parser.AddOption(\"debug-parser\", \"Turn on debugging the parser of wat files\",\n                   []() { s_debug_parsing = true; });\n  parser.AddOption('d', \"dump-module\",\n                   \"Print a hexdump of the module to stdout\",\n                   []() { s_dump_module = true; });\n  s_features.AddOptions(&parser);\n  parser.AddOption('o', \"output\", \"FILE\",\n                   \"Output wasm binary file. Use \\\"-\\\" to write to stdout.\",\n                   [](const char* argument) { s_outfile = argument; });\n  parser.AddOption(\n      'r', \"relocatable\",\n      \"Create a relocatable wasm binary (suitable for linking with e.g. lld)\",\n      []() { s_write_binary_options.relocatable = true; });\n  parser.AddOption(\n      \"no-canonicalize-leb128s\",\n      \"Write all LEB128 sizes as 5-bytes instead of their minimal size\",\n      []() { s_write_binary_options.canonicalize_lebs = false; });\n  parser.AddOption(\"debug-names\",\n                   \"Write debug names to the generated binary file\",\n                   []() { s_write_binary_options.write_debug_names = true; });\n  parser.AddOption(\"no-check\", \"Don't check for invalid modules\",\n                   []() { s_validate = false; });\n  parser.AddArgument(\"filename\", OptionParser::ArgumentCount::One,\n                     [](const char* argument) { s_infile = argument; });\n\n  parser.Parse(argc, argv);\n}\n\nstatic void WriteBufferToFile(std::string_view filename,\n                              const OutputBuffer& buffer) {\n  if (s_dump_module) {\n    std::unique_ptr<FileStream> stream = FileStream::CreateStdout();\n    if (s_verbose) {\n      stream->Writef(\";; dump\\n\");\n    }\n    if (!buffer.data.empty()) {\n      stream->WriteMemoryDump(buffer.data.data(), buffer.data.size());\n    }\n  }\n\n  if (filename == \"-\") {\n    buffer.WriteToStdout();\n  } else {\n    buffer.WriteToFile(filename);\n  }\n}\n\nstatic std::string DefaultOuputName(std::string_view input_name) {\n  // Strip existing extension and add .wasm\n  std::string result(StripExtension(GetBasename(input_name)));\n  result += kWasmExtension;\n\n  return result;\n}\n\nint ProgramMain(int argc, char** argv) {\n  InitStdio();\n\n  ParseOptions(argc, argv);\n\n  std::vector<uint8_t> file_data;\n  Result result = ReadFile(s_infile, &file_data);\n  Errors errors;\n  std::unique_ptr<WastLexer> lexer = WastLexer::CreateBufferLexer(\n      s_infile, file_data.data(), file_data.size(), &errors);\n  if (Failed(result)) {\n    WABT_FATAL(\"unable to read file: %s\\n\", s_infile);\n  }\n\n  std::unique_ptr<Module> module;\n  WastParseOptions parse_wast_options(s_features);\n  result = ParseWatModule(lexer.get(), &module, &errors, &parse_wast_options);\n\n  if (Succeeded(result) && s_validate) {\n    ValidateOptions options(s_features);\n    result = ValidateModule(module.get(), &errors, options);\n  }\n\n  if (Succeeded(result)) {\n    MemoryStream stream(s_log_stream.get());\n    s_write_binary_options.features = s_features;\n    result = WriteBinaryModule(&stream, module.get(), s_write_binary_options);\n\n    if (Succeeded(result)) {\n      if (s_outfile.empty()) {\n        s_outfile = DefaultOuputName(s_infile);\n      }\n      WriteBufferToFile(s_outfile.c_str(), stream.output_buffer());\n    }\n  }\n\n  auto line_finder = lexer->MakeLineFinder();\n  FormatErrorsToFile(errors, Location::Type::Text, line_finder.get());\n\n  return result != Result::Ok;\n}\n\nint main(int argc, char** argv) {\n  WABT_TRY\n  return ProgramMain(argc, argv);\n  WABT_CATCH_BAD_ALLOC_AND_EXIT\n}\n"
  },
  {
    "path": "src/tracing.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#define WABT_TRACING 1\n#include \"wabt/tracing.h\"\n\nnamespace {\n\nsize_t indent = 0;\nconst char* indent_text = \"  \";\n\nvoid Fill() {\n  for (size_t i = 0; i < indent; ++i)\n    fputs(indent_text, stderr);\n}\n\nvoid Indent() {\n  Fill();\n  ++indent;\n}\n\nvoid Dedent() {\n  if (indent) {\n    --indent;\n  }\n  Fill();\n}\n\n}  // end of anonymous namespace\n\nnamespace wabt {\n\n// static\n\nTraceScope::TraceScope(const char* method) : method_(method) {\n  PrintEnter(method);\n  PrintNewline();\n}\n\nTraceScope::~TraceScope() {\n  Dedent();\n  fputs(\"<- \", stderr);\n  fputs(method_, stderr);\n  fputc('\\n', stderr);\n}\n\nvoid TraceScope::PrintEnter(const char* method) {\n  Indent();\n  fputs(\"-> \", stderr);\n  fputs(method, stderr);\n  fputs(\"(\", stderr);\n}\n\nvoid TraceScope::PrintNewline() {\n  fputs(\")\\n\", stderr);\n}\n\n}  // end of namespace wabt\n"
  },
  {
    "path": "src/type-checker.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/type-checker.h\"\n\n#include <cinttypes>\n\nnamespace wabt {\n\nnamespace {\n\nstd::string TypesToString(const TypeVector& types,\n                          const char* prefix = nullptr) {\n  std::string result = \"[\";\n  if (prefix) {\n    result += prefix;\n  }\n\n  for (size_t i = 0; i < types.size(); ++i) {\n    Type ty = types[i];\n    // NOTE: Reference (and GetName) is also used by (e.g.) objdump, which does\n    // not apply validation. do this here so as to not break that.\n    if (ty.IsReferenceWithIndex() && ty.GetReferenceIndex() == kInvalidIndex) {\n      result += \"reference\";\n    } else {\n      result += types[i].GetName();\n    }\n    if (i < types.size() - 1) {\n      result += \", \";\n    }\n  }\n  result += \"]\";\n  return result;\n}\n\n}  // end anonymous namespace\n\nTypeChecker::Label::Label(LabelType label_type,\n                          const TypeVector& param_types,\n                          const TypeVector& result_types,\n                          size_t limit)\n    : label_type(label_type),\n      param_types(param_types),\n      result_types(result_types),\n      type_stack_limit(limit),\n      unreachable(false) {}\n\nvoid TypeChecker::PrintError(const char* fmt, ...) {\n  if (error_callback_) {\n    WABT_SNPRINTF_ALLOCA(buffer, length, fmt);\n    error_callback_(buffer);\n  }\n}\n\nResult TypeChecker::GetLabel(Index depth, Label** out_label) {\n  if (depth >= label_stack_.size()) {\n    assert(label_stack_.size() > 0);\n    PrintError(\"invalid depth: %\" PRIindex \" (max %\" PRIzd \")\", depth,\n               label_stack_.size() - 1);\n    *out_label = nullptr;\n    return Result::Error;\n  }\n  *out_label = &label_stack_[label_stack_.size() - depth - 1];\n  return Result::Ok;\n}\n\nResult TypeChecker::GetRethrowLabel(Index depth, Label** out_label) {\n  if (Failed(GetLabel(depth, out_label))) {\n    return Result::Error;\n  }\n\n  if ((*out_label)->label_type == LabelType::Catch) {\n    return Result::Ok;\n  }\n\n  std::string candidates;\n  for (Index idx = 0; idx < label_stack_.size(); idx++) {\n    LabelType type = label_stack_[label_stack_.size() - idx - 1].label_type;\n    if (type == LabelType::Catch) {\n      if (!candidates.empty()) {\n        candidates.append(\", \");\n      }\n      candidates.append(std::to_string(idx));\n    }\n  }\n\n  if (candidates.empty()) {\n    PrintError(\"rethrow not in try catch block\");\n  } else {\n    PrintError(\"invalid rethrow depth: %\" PRIindex \" (catches: %s)\", depth,\n               candidates.c_str());\n  }\n  *out_label = nullptr;\n  return Result::Error;\n}\n\nResult TypeChecker::GetCatchCount(Index depth, Index* out_count) {\n  Label* unused;\n  if (Failed(GetLabel(depth, &unused))) {\n    return Result::Error;\n  }\n\n  Index catch_count = 0;\n  for (Index idx = 0; idx <= depth; idx++) {\n    LabelType type = label_stack_[label_stack_.size() - idx - 1].label_type;\n    if (type == LabelType::Catch) {\n      catch_count++;\n    }\n  }\n  *out_count = catch_count;\n\n  return Result::Ok;\n}\n\nResult TypeChecker::TopLabel(Label** out_label) {\n  return GetLabel(0, out_label);\n}\n\nbool TypeChecker::IsUnreachable() {\n  Label* label;\n  if (Failed(TopLabel(&label))) {\n    return true;\n  }\n  return label->unreachable;\n}\n\nvoid TypeChecker::ResetTypeStackToLabel(Label* label) {\n  type_stack_.resize(label->type_stack_limit);\n}\n\nResult TypeChecker::SetUnreachable() {\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n  label->unreachable = true;\n  ResetTypeStackToLabel(label);\n  return Result::Ok;\n}\n\nvoid TypeChecker::PushLabel(LabelType label_type,\n                            const TypeVector& param_types,\n                            const TypeVector& result_types) {\n  label_stack_.emplace_back(label_type, param_types, result_types,\n                            type_stack_.size());\n}\n\nResult TypeChecker::PopLabel() {\n  label_stack_.pop_back();\n  return Result::Ok;\n}\n\nResult TypeChecker::CheckLabelType(Label* label, LabelType label_type) {\n  return label->label_type == label_type ? Result::Ok : Result::Error;\n}\n\nResult TypeChecker::Check2LabelTypes(Label* label,\n                                     LabelType label_type1,\n                                     LabelType label_type2) {\n  return label->label_type == label_type1 || label->label_type == label_type2\n             ? Result::Ok\n             : Result::Error;\n}\n\nResult TypeChecker::GetThisFunctionLabel(Label** label) {\n  return GetLabel(label_stack_.size() - 1, label);\n}\n\nResult TypeChecker::PeekType(Index depth, Type* out_type) {\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n\n  if (label->type_stack_limit + depth >= type_stack_.size()) {\n    *out_type = Type::Any;\n    return label->unreachable ? Result::Ok : Result::Error;\n  }\n  *out_type = type_stack_[type_stack_.size() - depth - 1];\n  return Result::Ok;\n}\n\nResult TypeChecker::PeekAndCheckType(Index depth, Type expected) {\n  Type actual = Type::Any;\n  Result result = PeekType(depth, &actual);\n  return result | CheckType(actual, expected);\n}\n\nResult TypeChecker::DropTypes(size_t drop_count) {\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n  if (label->type_stack_limit + drop_count > type_stack_.size()) {\n    ResetTypeStackToLabel(label);\n    return label->unreachable ? Result::Ok : Result::Error;\n  }\n  type_stack_.erase(type_stack_.end() - drop_count, type_stack_.end());\n  return Result::Ok;\n}\n\nvoid TypeChecker::PushType(Type type) {\n  if (type != Type::Void) {\n    type_stack_.push_back(type);\n  }\n}\n\nvoid TypeChecker::PushTypes(const TypeVector& types) {\n  for (Type type : types) {\n    PushType(type);\n  }\n}\n\nResult TypeChecker::CheckTypeStackEnd(const char* desc) {\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n  Result result = (type_stack_.size() == label->type_stack_limit)\n                      ? Result::Ok\n                      : Result::Error;\n  PrintStackIfFailedV(result, desc, {}, /*is_end=*/true);\n  return result;\n}\n\nstatic bool CompareTypeVector(\n    const std::map<Index, TypeChecker::FuncType>& func_types,\n    const TypeVector& left,\n    const TypeVector& right) {\n  size_t size = left.size();\n\n  if (size != right.size()) {\n    return false;\n  }\n\n  for (size_t i = 0; i < size; i++) {\n    const Type& left_type = left[i];\n    const Type& right_type = right[i];\n\n    if (left_type != right_type) {\n      if (!left_type.IsReferenceWithIndex() ||\n          left_type != static_cast<Type::Enum>(right_type)) {\n        return false;\n      }\n\n      const TypeChecker::FuncType& left_func_type =\n          func_types.at(left_type.GetReferenceIndex());\n      const TypeChecker::FuncType& right_func_type =\n          func_types.at(right_type.GetReferenceIndex());\n\n      // Circular references were checked during validation.\n      if (!CompareTypeVector(func_types, left_func_type.params,\n                             right_func_type.params) ||\n          !CompareTypeVector(func_types, left_func_type.results,\n                             right_func_type.results)) {\n        return false;\n      }\n    }\n  }\n\n  return true;\n}\n\nResult TypeChecker::CheckType(Type actual, Type expected) {\n  if (expected == Type::Any || actual == Type::Any) {\n    return Result::Ok;\n  }\n\n  Type::Enum actual_type = actual;\n  Type::Enum expected_type = expected;\n\n  if (actual_type == expected_type) {\n    switch (actual_type) {\n      case Type::ExternRef:\n      case Type::FuncRef:\n        return (expected.IsNullableNonTypedRef() ||\n                !actual.IsNullableNonTypedRef())\n                   ? Result::Ok\n                   : Result::Error;\n\n      case Type::Reference:\n      case Type::Ref:\n      case Type::RefNull:\n        break;\n\n      default:\n        return Result::Ok;\n    }\n  }\n\n  if (!actual.IsReferenceWithIndex()) {\n    return Result::Error;\n  }\n\n  if (expected_type == Type::FuncRef) {\n    return (actual == Type::Ref || expected.IsNullableNonTypedRef())\n               ? Result::Ok\n               : Result::Error;\n  }\n\n  if (!expected.IsReferenceWithIndex()) {\n    return Result::Error;\n  }\n\n  if (expected_type == Type::Ref && actual_type == Type::RefNull) {\n    return Result::Error;\n  }\n\n  FuncType& actual_func_type = func_types_[actual.GetReferenceIndex()];\n  FuncType& expected_func_type = func_types_[expected.GetReferenceIndex()];\n\n  if (CompareTypeVector(func_types_, actual_func_type.params,\n                        expected_func_type.params) &&\n      CompareTypeVector(func_types_, actual_func_type.results,\n                        expected_func_type.results)) {\n    return Result::Ok;\n  }\n\n  return Result::Error;\n}\n\nResult TypeChecker::CheckTypes(const TypeVector& actual,\n                               const TypeVector& expected) {\n  if (actual.size() != expected.size()) {\n    return Result::Error;\n  } else {\n    Result result = Result::Ok;\n    for (size_t i = 0; i < actual.size(); i++)\n      result |= CheckType(actual[i], expected[i]);\n    return result;\n  }\n}\n\nResult TypeChecker::CheckSignature(const TypeVector& sig, const char* desc) {\n  Result result = Result::Ok;\n  for (size_t i = 0; i < sig.size(); ++i) {\n    result |= PeekAndCheckType(sig.size() - i - 1, sig[i]);\n  }\n  PrintStackIfFailedV(result, desc, sig, /*is_end=*/false);\n  return result;\n}\n\nResult TypeChecker::CheckReturnSignature(const TypeVector& actual,\n                                         const TypeVector& expected,\n                                         const char* desc) {\n  Result result = CheckTypes(actual, expected);\n  if (Failed(result)) {\n    PrintError(\"return signatures have inconsistent types: expected %s, got %s\",\n               TypesToString(expected).c_str(), TypesToString(actual).c_str());\n  }\n  return result;\n}\n\nResult TypeChecker::PopAndCheckSignature(const TypeVector& sig,\n                                         const char* desc) {\n  Result result = CheckSignature(sig, desc);\n  result |= DropTypes(sig.size());\n  return result;\n}\n\nResult TypeChecker::PopAndCheckCall(const TypeVector& param_types,\n                                    const TypeVector& result_types,\n                                    const char* desc) {\n  Result result = CheckSignature(param_types, desc);\n  result |= DropTypes(param_types.size());\n  PushTypes(result_types);\n  return result;\n}\n\nResult TypeChecker::PopAndCheckReturnCall(const TypeVector& result_types,\n                                          const char* desc) {\n  Label* func_label;\n  CHECK_RESULT(GetThisFunctionLabel(&func_label));\n  Result result =\n      CheckReturnSignature(result_types, func_label->result_types, desc);\n\n  CHECK_RESULT(SetUnreachable());\n  return result;\n}\n\nResult TypeChecker::PopAndCheck1Type(Type expected, const char* desc) {\n  Result result = Result::Ok;\n  result |= PeekAndCheckType(0, expected);\n  PrintStackIfFailed(result, desc, expected);\n  result |= DropTypes(1);\n  return result;\n}\n\nResult TypeChecker::PopAndCheck2Types(Type expected1,\n                                      Type expected2,\n                                      const char* desc) {\n  Result result = Result::Ok;\n  result |= PeekAndCheckType(0, expected2);\n  result |= PeekAndCheckType(1, expected1);\n  PrintStackIfFailed(result, desc, expected1, expected2);\n  result |= DropTypes(2);\n  return result;\n}\n\nResult TypeChecker::PopAndCheck3Types(Type expected1,\n                                      Type expected2,\n                                      Type expected3,\n                                      const char* desc) {\n  Result result = Result::Ok;\n  result |= PeekAndCheckType(0, expected3);\n  result |= PeekAndCheckType(1, expected2);\n  result |= PeekAndCheckType(2, expected1);\n  PrintStackIfFailed(result, desc, expected1, expected2, expected3);\n  result |= DropTypes(3);\n  return result;\n}\n\nResult TypeChecker::PopAndCheck4Types(Type expected1,\n                                      Type expected2,\n                                      Type expected3,\n                                      Type expected4,\n                                      const char* desc) {\n  Result result = Result::Ok;\n  result |= PeekAndCheckType(0, expected4);\n  result |= PeekAndCheckType(1, expected3);\n  result |= PeekAndCheckType(2, expected2);\n  result |= PeekAndCheckType(3, expected1);\n  PrintStackIfFailed(result, desc, expected1, expected2, expected3, expected4);\n  result |= DropTypes(4);\n  return result;\n}\n\nResult TypeChecker::PopAndCheckReference(Type* actual, const char* desc) {\n  *actual = Type::Any;\n  Result result = PeekType(0, actual);\n\n  // Type::Any is a valid value for dead code, and replacing\n  // it with anything might break the syntax checker.\n  if (*actual != Type::Any && !actual->IsRef()) {\n    result = Result::Error;\n  }\n\n  PrintStackIfFailed(result, desc, Type::FuncRef);\n  result |= DropTypes(1);\n  return result;\n}\n\n// Some paramater types depend on the memory being used.\n// For example load/store operands, or memory.fill operands.\nstatic Type GetMemoryParam(Type param, const Limits* limits) {\n  return limits ? limits->IndexType() : param;\n}\n\nResult TypeChecker::CheckOpcode1(Opcode opcode, const Limits* limits) {\n  Result result = PopAndCheck1Type(\n      GetMemoryParam(opcode.GetParamType1(), limits), opcode.GetName());\n  PushType(opcode.GetResultType());\n  PushType(opcode.GetResultType2());\n  return result;\n}\n\nResult TypeChecker::CheckOpcode2(Opcode opcode, const Limits* limits) {\n  Result result =\n      PopAndCheck2Types(GetMemoryParam(opcode.GetParamType1(), limits),\n                        opcode.GetParamType2(), opcode.GetName());\n  PushType(opcode.GetResultType());\n  PushType(opcode.GetResultType2());\n  return result;\n}\n\nResult TypeChecker::CheckOpcode3(Opcode opcode,\n                                 const Limits* limits1,\n                                 const Limits* limits2,\n                                 const Limits* limits3) {\n  Result result = PopAndCheck3Types(\n      GetMemoryParam(opcode.GetParamType1(), limits1),\n      GetMemoryParam(opcode.GetParamType2(), limits2),\n      GetMemoryParam(opcode.GetParamType3(), limits3), opcode.GetName());\n  PushType(opcode.GetResultType());\n  PushType(opcode.GetResultType2());\n  return result;\n}\n\nResult TypeChecker::CheckOpcode4(Opcode opcode,\n                                 const Limits* limits1,\n                                 const Limits* limits2,\n                                 const Limits* limits3,\n                                 const Limits* limits4) {\n  Result result = PopAndCheck4Types(\n      GetMemoryParam(opcode.GetParamType1(), limits1),\n      GetMemoryParam(opcode.GetParamType2(), limits2),\n      GetMemoryParam(opcode.GetParamType2(), limits3),\n      GetMemoryParam(opcode.GetParamType3(), limits4), opcode.GetName());\n  PushType(opcode.GetResultType());\n  PushType(opcode.GetResultType2());\n  return result;\n}\n\nvoid TypeChecker::PrintStackIfFailedV(Result result,\n                                      const char* desc,\n                                      const TypeVector& expected,\n                                      bool is_end) {\n  if (Succeeded(result)) {\n    return;\n  }\n\n  size_t limit = 0;\n  Label* label;\n  if (Succeeded(TopLabel(&label))) {\n    limit = label->type_stack_limit;\n  }\n\n  TypeVector actual;\n  size_t max_depth = type_stack_.size() - limit;\n\n  // In general we want to print as many values of the actual stack as were\n  // expected. However, if the stack was expected to be empty, we should\n  // print some amount of the actual stack.\n  size_t actual_size;\n  if (expected.size() == 0) {\n    // Don't print too many elements if the stack is really deep.\n    const size_t kMaxActualStackToPrint = 4;\n    actual_size = std::min(kMaxActualStackToPrint, max_depth);\n  } else {\n    actual_size = std::min(expected.size(), max_depth);\n  }\n\n  bool incomplete_actual_stack = actual_size != max_depth;\n\n  for (size_t i = 0; i < actual_size; ++i) {\n    Type type;\n    Result result = PeekType(actual_size - i - 1, &type);\n    WABT_USE(result);\n    assert(Succeeded(result));\n    actual.push_back(type);\n  }\n\n  std::string message = \"type mismatch in \";\n  if (is_end) {\n    message = \"type mismatch at end of \";\n  }\n  message += desc;\n  message += \", expected \";\n  message += TypesToString(expected);\n  message += \" but got \";\n  message += TypesToString(actual, incomplete_actual_stack ? \"... \" : nullptr);\n\n  PrintError(\"%s\", message.c_str());\n}\n\nResult TypeChecker::BeginFunction(const TypeVector& sig) {\n  type_stack_.clear();\n  label_stack_.clear();\n  PushLabel(LabelType::Func, TypeVector(), sig);\n  return Result::Ok;\n}\n\nResult TypeChecker::OnAtomicLoad(Opcode opcode, const Limits& limits) {\n  return CheckOpcode1(opcode, &limits);\n}\n\nResult TypeChecker::OnAtomicStore(Opcode opcode, const Limits& limits) {\n  return CheckOpcode2(opcode, &limits);\n}\n\nResult TypeChecker::OnAtomicRmw(Opcode opcode, const Limits& limits) {\n  return CheckOpcode2(opcode, &limits);\n}\n\nResult TypeChecker::OnAtomicRmwCmpxchg(Opcode opcode, const Limits& limits) {\n  return CheckOpcode3(opcode, &limits);\n}\n\nResult TypeChecker::OnAtomicWait(Opcode opcode, const Limits& limits) {\n  return CheckOpcode3(opcode, &limits);\n}\n\nResult TypeChecker::OnAtomicFence(uint32_t consistency_model) {\n  return Result::Ok;\n}\n\nResult TypeChecker::OnAtomicNotify(Opcode opcode, const Limits& limits) {\n  return CheckOpcode2(opcode, &limits);\n}\n\nResult TypeChecker::OnBinary(Opcode opcode) {\n  return CheckOpcode2(opcode);\n}\n\nResult TypeChecker::OnQuaternary(Opcode opcode) {\n  return CheckOpcode4(opcode);\n}\n\nResult TypeChecker::OnBlock(const TypeVector& param_types,\n                            const TypeVector& result_types) {\n  Result result = PopAndCheckSignature(param_types, \"block\");\n  PushLabel(LabelType::Block, param_types, result_types);\n  PushTypes(param_types);\n  return result;\n}\n\nResult TypeChecker::OnBr(Index depth) {\n  Result result = Result::Ok;\n  Label* label;\n  CHECK_RESULT(GetLabel(depth, &label));\n  result |= CheckSignature(label->br_types(), \"br\");\n  CHECK_RESULT(SetUnreachable());\n  return result;\n}\n\nResult TypeChecker::OnBrIf(Index depth) {\n  Result result = PopAndCheck1Type(Type::I32, \"br_if\");\n  Label* label;\n  CHECK_RESULT(GetLabel(depth, &label));\n  result |= PopAndCheckSignature(label->br_types(), \"br_if\");\n  PushTypes(label->br_types());\n  return result;\n}\n\nstatic Type convertRefNullToRef(Type type) {\n  if (type == Type::ExternRef || type == Type::FuncRef) {\n    return Type(type, Type::ReferenceNonNull);\n  }\n\n  assert(type.IsReferenceWithIndex());\n  return Type(Type::Ref, type.GetReferenceIndex());\n}\n\nResult TypeChecker::OnBrOnNonNull(Index depth) {\n  Type actual;\n  CHECK_RESULT(PopAndCheckReference(&actual, \"br_on_non_null\"));\n  if (actual != Type::Any) {\n    PushType(convertRefNullToRef(actual));\n  }\n\n  Label* label;\n  CHECK_RESULT(GetLabel(depth, &label));\n  Result result = PopAndCheckSignature(label->br_types(), \"br_on_non_null\");\n  PushTypes(label->br_types());\n\n  if (actual != Type::Any) {\n    result |= DropTypes(1);\n  }\n  return result;\n}\n\nResult TypeChecker::OnBrOnNull(Index depth) {\n  Type actual;\n  CHECK_RESULT(PopAndCheckReference(&actual, \"br_on_null\"));\n\n  Label* label;\n  CHECK_RESULT(GetLabel(depth, &label));\n  Result result = PopAndCheckSignature(label->br_types(), \"br_on_null\");\n  PushTypes(label->br_types());\n\n  if (actual != Type::Any) {\n    actual = convertRefNullToRef(actual);\n  }\n  PushType(actual);\n  return result;\n}\n\nResult TypeChecker::BeginBrTable() {\n  br_table_sig_ = nullptr;\n  return PopAndCheck1Type(Type::I32, \"br_table\");\n}\n\nResult TypeChecker::OnBrTableTarget(Index depth) {\n  Result result = Result::Ok;\n  Label* label;\n  CHECK_RESULT(GetLabel(depth, &label));\n  TypeVector& label_sig = label->br_types();\n  result |= CheckSignature(label_sig, \"br_table\");\n\n  // Make sure this label's signature is consistent with the previous labels'\n  // signatures.\n  if (br_table_sig_ == nullptr) {\n    br_table_sig_ = &label_sig;\n  } else {\n    if (br_table_sig_->size() != label_sig.size()) {\n      result |= Result::Error;\n      PrintError(\"br_table labels have inconsistent types: expected %s, got %s\",\n                 TypesToString(*br_table_sig_).c_str(),\n                 TypesToString(label_sig).c_str());\n    }\n  }\n\n  return result;\n}\n\nResult TypeChecker::EndBrTable() {\n  return SetUnreachable();\n}\n\nResult TypeChecker::OnCall(const TypeVector& param_types,\n                           const TypeVector& result_types) {\n  return PopAndCheckCall(param_types, result_types, \"call\");\n}\n\nResult TypeChecker::OnCallIndirect(const TypeVector& param_types,\n                                   const TypeVector& result_types,\n                                   const Limits& table_limits) {\n  Result result = PopAndCheck1Type(table_limits.is_64 ? Type::I64 : Type::I32,\n                                   \"call_indirect\");\n  result |= PopAndCheckCall(param_types, result_types, \"call_indirect\");\n  return result;\n}\n\nResult TypeChecker::OnCallRef(Type type,\n                              const TypeVector& param_types,\n                              const TypeVector& result_types) {\n  Result result = PopAndCheck1Type(type, \"call_ref\");\n  result |= PopAndCheckCall(param_types, result_types, \"call_ref\");\n  return result;\n}\n\nResult TypeChecker::OnReturnCall(const TypeVector& param_types,\n                                 const TypeVector& result_types) {\n  Result result = PopAndCheckSignature(param_types, \"return_call\");\n  result |= PopAndCheckReturnCall(result_types, \"return_call\");\n  return result;\n}\n\nResult TypeChecker::OnReturnCallIndirect(const TypeVector& param_types,\n                                         const TypeVector& result_types) {\n  Result result = PopAndCheck1Type(Type::I32, \"return_call_indirect\");\n\n  result |= PopAndCheckSignature(param_types, \"return_call_indirect\");\n  result |= PopAndCheckReturnCall(result_types, \"return_call_indirect\");\n  return result;\n}\n\nResult TypeChecker::OnReturnCallRef(Type type,\n                                    const TypeVector& param_types,\n                                    const TypeVector& result_types) {\n  Result result = PopAndCheck1Type(type, \"return_call_ref\");\n\n  result |= PopAndCheckSignature(param_types, \"return_call_ref\");\n  result |= PopAndCheckReturnCall(result_types, \"return_call_ref\");\n  return result;\n}\n\nResult TypeChecker::OnCompare(Opcode opcode) {\n  return CheckOpcode2(opcode);\n}\n\nResult TypeChecker::OnCatch(const TypeVector& sig) {\n  Result result = Result::Ok;\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n  result |= Check2LabelTypes(label, LabelType::Try, LabelType::Catch);\n  result |= PopAndCheckSignature(label->result_types, \"try block\");\n  result |= CheckTypeStackEnd(\"try block\");\n  ResetTypeStackToLabel(label);\n  label->label_type = LabelType::Catch;\n  label->unreachable = false;\n  PushTypes(sig);\n  return result;\n}\n\nResult TypeChecker::OnConst(Type type) {\n  PushType(type);\n  return Result::Ok;\n}\n\nResult TypeChecker::OnConvert(Opcode opcode) {\n  return CheckOpcode1(opcode);\n}\n\nResult TypeChecker::OnDelegate(Index depth) {\n  Result result = Result::Ok;\n  Label* label;\n  // Delegate starts counting after the current try, as the delegate\n  // instruction is not actually in the try block.\n  CHECK_RESULT(GetLabel(depth + 1, &label));\n\n  Label* try_label;\n  CHECK_RESULT(TopLabel(&try_label));\n  result |= CheckLabelType(try_label, LabelType::Try);\n  result |= PopAndCheckSignature(try_label->result_types, \"try block\");\n  result |= CheckTypeStackEnd(\"try block\");\n  ResetTypeStackToLabel(try_label);\n\n  // Since an end instruction does not follow a delegate, we push\n  // the block results here and pop the label.\n  PushTypes(try_label->result_types);\n  PopLabel();\n  return result;\n}\n\nResult TypeChecker::OnDrop() {\n  Result result = Result::Ok;\n  result |= DropTypes(1);\n  PrintStackIfFailed(result, \"drop\", Type::Any);\n  return result;\n}\n\nResult TypeChecker::OnElse() {\n  Result result = Result::Ok;\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n  result |= CheckLabelType(label, LabelType::If);\n  result |= PopAndCheckSignature(label->result_types, \"`if true` branch\");\n  result |= CheckTypeStackEnd(\"`if true` branch\");\n  ResetTypeStackToLabel(label);\n  PushTypes(label->param_types);\n  label->label_type = LabelType::Else;\n  label->unreachable = false;\n  return result;\n}\n\nResult TypeChecker::OnEnd(Label* label,\n                          const char* sig_desc,\n                          const char* end_desc) {\n  Result result = Result::Ok;\n  result |= PopAndCheckSignature(label->result_types, sig_desc);\n  result |= CheckTypeStackEnd(end_desc);\n  ResetTypeStackToLabel(label);\n  PushTypes(label->result_types);\n  PopLabel();\n  return result;\n}\n\nResult TypeChecker::OnEnd() {\n  Result result = Result::Ok;\n  static const char* s_label_type_name[] = {\n      \"function\", \"initializer expression\", \"block\", \"loop\",\n      \"if\",       \"`if false` branch\",      \"try\",   \"try table\",\n      \"try catch\"};\n  WABT_STATIC_ASSERT(WABT_ARRAY_SIZE(s_label_type_name) == kLabelTypeCount);\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n  assert(static_cast<int>(label->label_type) < kLabelTypeCount);\n  if (label->label_type == LabelType::If) {\n    // An if without an else will just pass the params through, so the result\n    // types must be the same as the param types. It has the same behavior as\n    // an empty else block.\n    CHECK_RESULT(OnElse());\n  }\n\n  const char* desc = s_label_type_name[static_cast<int>(label->label_type)];\n  result |= OnEnd(label, desc, desc);\n  return result;\n}\n\nResult TypeChecker::OnIf(const TypeVector& param_types,\n                         const TypeVector& result_types) {\n  Result result = PopAndCheck1Type(Type::I32, \"if\");\n  result |= PopAndCheckSignature(param_types, \"if\");\n  PushLabel(LabelType::If, param_types, result_types);\n  PushTypes(param_types);\n  return result;\n}\n\nResult TypeChecker::OnGlobalGet(Type type) {\n  PushType(type);\n  return Result::Ok;\n}\n\nResult TypeChecker::OnGlobalSet(Type type) {\n  return PopAndCheck1Type(type, \"global.set\");\n}\n\nResult TypeChecker::OnLoad(Opcode opcode, const Limits& limits) {\n  return CheckOpcode1(opcode, &limits);\n}\n\nResult TypeChecker::OnLocalGet(Type type) {\n  PushType(type);\n  return Result::Ok;\n}\n\nResult TypeChecker::OnLocalSet(Type type) {\n  return PopAndCheck1Type(type, \"local.set\");\n}\n\nResult TypeChecker::OnLocalTee(Type type) {\n  Result result = Result::Ok;\n  result |= PopAndCheck1Type(type, \"local.tee\");\n  PushType(type);\n  return result;\n}\n\nResult TypeChecker::OnLoop(const TypeVector& param_types,\n                           const TypeVector& result_types) {\n  Result result = PopAndCheckSignature(param_types, \"loop\");\n  PushLabel(LabelType::Loop, param_types, result_types);\n  PushTypes(param_types);\n  return result;\n}\n\nResult TypeChecker::OnMemoryCopy(const Limits& dst_limits,\n                                 const Limits& src_limits) {\n  Limits size_limits = src_limits;\n  // The memory64 proposal specifies that the type of the size argument should\n  // be the mimimum of the two memory types.\n  if (src_limits.is_64 && !dst_limits.is_64) {\n    size_limits = dst_limits;\n  }\n  return CheckOpcode3(Opcode::MemoryCopy, &dst_limits, &src_limits,\n                      &size_limits);\n}\n\nResult TypeChecker::OnDataDrop(uint32_t segment) {\n  return Result::Ok;\n}\n\nResult TypeChecker::OnMemoryFill(const Limits& limits) {\n  return CheckOpcode3(Opcode::MemoryFill, &limits, nullptr, &limits);\n}\n\nResult TypeChecker::OnMemoryGrow(const Limits& limits) {\n  Result result = PopAndCheck1Type(limits.IndexType(), \"memory.grow\");\n  PushType(limits.IndexType());\n  return result;\n}\n\nResult TypeChecker::OnMemoryInit(uint32_t segment, const Limits& limits) {\n  return CheckOpcode3(Opcode::MemoryInit, &limits);\n}\n\nResult TypeChecker::OnMemorySize(const Limits& limits) {\n  PushType(limits.IndexType());\n  return Result::Ok;\n}\n\nResult TypeChecker::OnTableCopy(const Limits& dst_limits,\n                                const Limits& src_limits) {\n  Limits size_limits = src_limits;\n  // The memory64 proposal specifies that the type of the size argument should\n  // be the mimimum of the two table types.\n  if (src_limits.is_64 && !dst_limits.is_64) {\n    size_limits = dst_limits;\n  }\n  return CheckOpcode3(Opcode::TableCopy, &dst_limits, &src_limits,\n                      &size_limits);\n}\n\nResult TypeChecker::OnElemDrop(uint32_t segment) {\n  return Result::Ok;\n}\n\nResult TypeChecker::OnTableInit(uint32_t segment, const Limits& limits) {\n  return CheckOpcode3(Opcode::TableInit, &limits);\n}\n\nResult TypeChecker::OnTableGet(Type elem_type, const Limits& limits) {\n  Result result = CheckOpcode1(Opcode::TableGet, &limits);\n  PushType(elem_type);\n  return result;\n}\n\nResult TypeChecker::OnTableSet(Type elem_type, const Limits& limits) {\n  return PopAndCheck2Types(limits.IndexType(), elem_type, \"table.set\");\n}\n\nResult TypeChecker::OnTableGrow(Type elem_type, const Limits& limits) {\n  Result result =\n      PopAndCheck2Types(elem_type, limits.IndexType(), \"table.grow\");\n  PushType(limits.IndexType());\n  return result;\n}\n\nResult TypeChecker::OnTableSize(const Limits& limits) {\n  PushType(limits.IndexType());\n  return Result::Ok;\n}\n\nResult TypeChecker::OnTableFill(Type elem_type, const Limits& limits) {\n  return PopAndCheck3Types(limits.IndexType(), elem_type, limits.IndexType(),\n                           \"table.fill\");\n}\n\nResult TypeChecker::OnRefAsNonNullExpr() {\n  Type actual;\n  CHECK_RESULT(PopAndCheckReference(&actual, \"ref.as_non_null\"));\n  if (actual != Type::Any) {\n    actual = convertRefNullToRef(actual);\n  }\n  PushType(actual);\n  return Result::Ok;\n}\n\nResult TypeChecker::OnRefFuncExpr(Index func_type) {\n  PushType(Type(Type::Ref, func_type));\n  return Result::Ok;\n}\n\nResult TypeChecker::OnRefNullExpr(Type type) {\n  PushType(type);\n  return Result::Ok;\n}\n\nResult TypeChecker::OnRefIsNullExpr() {\n  Type type;\n  Result result = PeekType(0, &type);\n  if (!type.IsRef()) {\n    type = Type(Type::Reference, kInvalidIndex);\n  }\n  result |= PopAndCheck1Type(type, \"ref.is_null\");\n  PushType(Type::I32);\n  return result;\n}\n\nResult TypeChecker::OnRethrow(Index depth) {\n  Result result = Result::Ok;\n  Label* label;\n  CHECK_RESULT(GetRethrowLabel(depth, &label));\n  CHECK_RESULT(SetUnreachable());\n  return result;\n}\n\nResult TypeChecker::OnThrow(const TypeVector& sig) {\n  Result result = Result::Ok;\n  result |= PopAndCheckSignature(sig, \"throw\");\n  CHECK_RESULT(SetUnreachable());\n  return result;\n}\n\nResult TypeChecker::OnThrowRef() {\n  Result result = Result::Ok;\n  result |= PopAndCheck1Type(Type::ExnRef, \"throw_ref\");\n  CHECK_RESULT(SetUnreachable());\n  return result;\n}\n\nResult TypeChecker::OnReturn() {\n  Result result = Result::Ok;\n  Label* func_label;\n  CHECK_RESULT(GetThisFunctionLabel(&func_label));\n  result |= PopAndCheckSignature(func_label->result_types, \"return\");\n  CHECK_RESULT(SetUnreachable());\n  return result;\n}\n\nResult TypeChecker::OnSelect(const TypeVector& expected) {\n  Result result = Result::Ok;\n  Type type1 = Type::Any;\n  Type type2 = Type::Any;\n  Type result_type = Type::Any;\n  result |= PeekAndCheckType(0, Type::I32);\n  result |= PeekType(1, &type1);\n  result |= PeekType(2, &type2);\n  if (expected.empty()) {\n    if (type1.IsRef() || type2.IsRef()) {\n      result = Result::Error;\n    } else {\n      result |= CheckType(type1, type2);\n      result_type = type1;\n    }\n  } else {\n    assert(expected.size() == 1);\n    result |= CheckType(type1, expected[0]);\n    result |= CheckType(type2, expected[0]);\n    result_type = expected[0];\n  }\n  PrintStackIfFailed(result, \"select\", result_type, result_type, Type::I32);\n  result |= DropTypes(3);\n  PushType(result_type);\n  return result;\n}\n\nResult TypeChecker::OnStore(Opcode opcode, const Limits& limits) {\n  return CheckOpcode2(opcode, &limits);\n}\n\nResult TypeChecker::OnTry(const TypeVector& param_types,\n                          const TypeVector& result_types) {\n  Result result = PopAndCheckSignature(param_types, \"try\");\n  PushLabel(LabelType::Try, param_types, result_types);\n  PushTypes(param_types);\n  return result;\n}\n\nResult TypeChecker::BeginTryTable(const TypeVector& param_types) {\n  Result result = PopAndCheckSignature(param_types, \"try_table\");\n  return result;\n}\n\nResult TypeChecker::OnTryTableCatch(const TypeVector& sig, Index depth) {\n  Result result = Result::Ok;\n  Label* label;\n  CHECK_RESULT(GetLabel(depth, &label));\n  TypeVector& label_sig = label->br_types();\n  result |= CheckTypes(label_sig, sig);\n  if (Failed(result)) {\n    PrintError(\"catch signature doesn't match target: expected %s, got %s\",\n               TypesToString(sig).c_str(), TypesToString(label_sig).c_str());\n  }\n  return result;\n}\n\nResult TypeChecker::EndTryTable(const TypeVector& param_types,\n                                const TypeVector& result_types) {\n  PushLabel(LabelType::TryTable, param_types, result_types);\n  PushTypes(param_types);\n  return Result::Ok;\n}\n\nResult TypeChecker::OnUnary(Opcode opcode) {\n  return CheckOpcode1(opcode);\n}\n\nResult TypeChecker::OnTernary(Opcode opcode) {\n  return CheckOpcode3(opcode);\n}\n\nResult TypeChecker::OnSimdLaneOp(Opcode opcode, uint64_t lane_idx) {\n  Result result = Result::Ok;\n  uint32_t lane_count = opcode.GetSimdLaneCount();\n  if (lane_idx >= lane_count) {\n    PrintError(\"lane index must be less than %d (got %\" PRIu64 \")\", lane_count,\n               lane_idx);\n    result = Result::Error;\n  }\n\n  switch (opcode) {\n    case Opcode::I8X16ExtractLaneS:\n    case Opcode::I8X16ExtractLaneU:\n    case Opcode::I16X8ExtractLaneS:\n    case Opcode::I16X8ExtractLaneU:\n    case Opcode::I32X4ExtractLane:\n    case Opcode::F32X4ExtractLane:\n    case Opcode::I64X2ExtractLane:\n    case Opcode::F64X2ExtractLane:\n      result |= CheckOpcode1(opcode);\n      break;\n    case Opcode::I8X16ReplaceLane:\n    case Opcode::I16X8ReplaceLane:\n    case Opcode::I32X4ReplaceLane:\n    case Opcode::F32X4ReplaceLane:\n    case Opcode::I64X2ReplaceLane:\n    case Opcode::F64X2ReplaceLane:\n      result |= CheckOpcode2(opcode);\n      break;\n    default:\n      WABT_UNREACHABLE;\n  }\n  return result;\n}\n\nResult TypeChecker::OnSimdLoadLane(Opcode opcode,\n                                   const Limits& limits,\n                                   uint64_t lane_idx) {\n  Result result = Result::Ok;\n  uint32_t lane_count = opcode.GetSimdLaneCount();\n  if (lane_idx >= lane_count) {\n    PrintError(\"lane index must be less than %d (got %\" PRIu64 \")\", lane_count,\n               lane_idx);\n    result = Result::Error;\n  }\n  result |= CheckOpcode2(opcode, &limits);\n  return result;\n}\n\nResult TypeChecker::OnSimdStoreLane(Opcode opcode,\n                                    const Limits& limits,\n                                    uint64_t lane_idx) {\n  Result result = Result::Ok;\n  uint32_t lane_count = opcode.GetSimdLaneCount();\n  if (lane_idx >= lane_count) {\n    PrintError(\"lane index must be less than %d (got %\" PRIu64 \")\", lane_count,\n               lane_idx);\n    result = Result::Error;\n  }\n  result |= CheckOpcode2(opcode, &limits);\n  return result;\n}\n\nResult TypeChecker::OnSimdShuffleOp(Opcode opcode, v128 lane_idx) {\n  Result result = Result::Ok;\n  uint8_t simd_data[16];\n  memcpy(simd_data, &lane_idx, 16);\n  for (int i = 0; i < 16; i++) {\n    if (simd_data[i] >= 32) {\n      PrintError(\"lane index must be less than 32 (got %d)\", simd_data[i]);\n      result = Result::Error;\n    }\n  }\n\n  result |= CheckOpcode2(opcode);\n  return result;\n}\n\nResult TypeChecker::OnUnreachable() {\n  return SetUnreachable();\n}\n\nResult TypeChecker::EndFunction() {\n  Result result = Result::Ok;\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n  result |= CheckLabelType(label, LabelType::Func);\n  result |= OnEnd(label, \"implicit return\", \"function\");\n  return result;\n}\n\nResult TypeChecker::BeginInitExpr(Type type) {\n  type_stack_.clear();\n  label_stack_.clear();\n  PushLabel(LabelType::InitExpr, TypeVector(), {type});\n  return Result::Ok;\n}\n\nResult TypeChecker::EndInitExpr() {\n  Result result = Result::Ok;\n  Label* label;\n  CHECK_RESULT(TopLabel(&label));\n  result |= CheckLabelType(label, LabelType::InitExpr);\n  result |= OnEnd(label, \"initializer expression\", \"initializer expression\");\n  return result;\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/utf8.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/utf8.h\"\n\n#include <cstdint>\n\nnamespace wabt {\n\nnamespace {\n\n// clang-format off\nconst int s_utf8_length[256] = {\n // 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 0x00\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 0x10\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 0x20\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 0x30\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 0x40\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 0x50\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 0x60\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  // 0x70\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 0x80\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 0x90\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 0xa0\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 0xb0\n    0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,  // 0xc0\n    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,  // 0xd0\n    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,  // 0xe0\n    4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 0xf0\n};\n// clang-format on\n\n// Returns true if this is a valid continuation byte.\nbool IsCont(uint8_t c) {\n  return (c & 0xc0) == 0x80;\n}\n\n}  // end anonymous namespace\n\nbool IsValidUtf8(const char* s, size_t s_length) {\n  const uint8_t* p = reinterpret_cast<const uint8_t*>(s);\n  const uint8_t* end = p + s_length;\n  while (p < end) {\n    uint8_t cu0 = *p;\n    int length = s_utf8_length[cu0];\n    if (p + length > end) {\n      return false;\n    }\n\n    switch (length) {\n      case 0:\n        return false;\n\n      case 1:\n        p++;\n        break;\n\n      case 2:\n        p++;\n        if (!IsCont(*p++)) {\n          return false;\n        }\n        break;\n\n      case 3: {\n        p++;\n        uint8_t cu1 = *p++;\n        uint8_t cu2 = *p++;\n        if (!(IsCont(cu1) && IsCont(cu2)) ||\n            (cu0 == 0xe0 && cu1 < 0xa0) ||  // Overlong encoding.\n            (cu0 == 0xed && cu1 >= 0xa0))   // UTF-16 surrogate halves.\n          return false;\n        break;\n      }\n\n      case 4: {\n        p++;\n        uint8_t cu1 = *p++;\n        uint8_t cu2 = *p++;\n        uint8_t cu3 = *p++;\n        if (!(IsCont(cu1) && IsCont(cu2) && IsCont(cu3)) ||\n            (cu0 == 0xf0 && cu1 < 0x90) ||  // Overlong encoding.\n            (cu0 == 0xf4 && cu1 >= 0x90))   // Code point >= 0x11000.\n          return false;\n        break;\n      }\n    }\n  }\n  return true;\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/validator.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/validator.h\"\n\n#include <cassert>\n#include <cinttypes>\n#include <cstdarg>\n#include <cstdio>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/binary-reader.h\"\n#include \"wabt/cast.h\"\n#include \"wabt/expr-visitor.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/shared-validator.h\"\n\nnamespace wabt {\n\nnamespace {\n\nclass ScriptValidator {\n public:\n  WABT_DISALLOW_COPY_AND_ASSIGN(ScriptValidator);\n  ScriptValidator(Errors*, const Script*, const ValidateOptions& options);\n\n  Result CheckScript();\n\n private:\n  struct ActionResult {\n    enum class Kind {\n      Error,\n      Types,\n      Type,\n    } kind;\n\n    union {\n      const TypeVector* types;\n      Type type;\n    };\n  };\n\n  void WABT_PRINTF_FORMAT(3, 4)\n      PrintError(const Location* loc, const char* fmt, ...);\n  void CheckTypeIndex(const Location* loc,\n                      Type actual,\n                      Type expected,\n                      const char* desc,\n                      Index index,\n                      const char* index_kind);\n  void CheckResultTypes(const Location* loc,\n                        const TypeVector& actual,\n                        const TypeVector& expected,\n                        const char* desc);\n  void CheckExpectation(const Location* loc,\n                        const TypeVector& result_types,\n                        const ConstVector& expected,\n                        const char* desc);\n  void CheckExpectationTypes(const Location* loc,\n                             const TypeVector& result_types,\n                             const Expectation* expect,\n                             const char* desc);\n\n  const TypeVector* CheckInvoke(const InvokeAction* action);\n  Result CheckGet(const GetAction* action, Type* out_type);\n  ActionResult CheckAction(const Action* action);\n  void CheckCommand(const Command* command);\n\n  const ValidateOptions& options_;\n  Errors* errors_ = nullptr;\n  const Script* script_ = nullptr;\n\n  Result result_ = Result::Ok;\n};\n\nclass Validator : public ExprVisitor::Delegate {\n public:\n  Validator(Errors*, const Module* module, const ValidateOptions& options);\n\n  Result CheckModule();\n\n  Result OnBinaryExpr(BinaryExpr*) override;\n  Result OnQuaternaryExpr(QuaternaryExpr*) override;\n  Result BeginBlockExpr(BlockExpr*) override;\n  Result EndBlockExpr(BlockExpr*) override;\n  Result OnBrExpr(BrExpr*) override;\n  Result OnBrIfExpr(BrIfExpr*) override;\n  Result OnBrOnNonNullExpr(BrOnNonNullExpr*) override;\n  Result OnBrOnNullExpr(BrOnNullExpr*) override;\n  Result OnBrTableExpr(BrTableExpr*) override;\n  Result OnCallExpr(CallExpr*) override;\n  Result OnCallIndirectExpr(CallIndirectExpr*) override;\n  Result OnCallRefExpr(CallRefExpr*) override;\n  Result OnCodeMetadataExpr(CodeMetadataExpr*) override;\n  Result OnCompareExpr(CompareExpr*) override;\n  Result OnConstExpr(ConstExpr*) override;\n  Result OnConvertExpr(ConvertExpr*) override;\n  Result OnDropExpr(DropExpr*) override;\n  Result OnGlobalGetExpr(GlobalGetExpr*) override;\n  Result OnGlobalSetExpr(GlobalSetExpr*) override;\n  Result BeginIfExpr(IfExpr*) override;\n  Result AfterIfTrueExpr(IfExpr*) override;\n  Result EndIfExpr(IfExpr*) override;\n  Result OnLoadExpr(LoadExpr*) override;\n  Result OnLocalGetExpr(LocalGetExpr*) override;\n  Result OnLocalSetExpr(LocalSetExpr*) override;\n  Result OnLocalTeeExpr(LocalTeeExpr*) override;\n  Result BeginLoopExpr(LoopExpr*) override;\n  Result EndLoopExpr(LoopExpr*) override;\n  Result OnMemoryCopyExpr(MemoryCopyExpr*) override;\n  Result OnDataDropExpr(DataDropExpr*) override;\n  Result OnMemoryFillExpr(MemoryFillExpr*) override;\n  Result OnMemoryGrowExpr(MemoryGrowExpr*) override;\n  Result OnMemoryInitExpr(MemoryInitExpr*) override;\n  Result OnMemorySizeExpr(MemorySizeExpr*) override;\n  Result OnTableCopyExpr(TableCopyExpr*) override;\n  Result OnElemDropExpr(ElemDropExpr*) override;\n  Result OnTableInitExpr(TableInitExpr*) override;\n  Result OnTableGetExpr(TableGetExpr*) override;\n  Result OnTableSetExpr(TableSetExpr*) override;\n  Result OnTableGrowExpr(TableGrowExpr*) override;\n  Result OnTableSizeExpr(TableSizeExpr*) override;\n  Result OnTableFillExpr(TableFillExpr*) override;\n  Result OnRefAsNonNullExpr(RefAsNonNullExpr*) override;\n  Result OnRefFuncExpr(RefFuncExpr*) override;\n  Result OnRefNullExpr(RefNullExpr*) override;\n  Result OnRefIsNullExpr(RefIsNullExpr*) override;\n  Result OnNopExpr(NopExpr*) override;\n  Result OnReturnExpr(ReturnExpr*) override;\n  Result OnReturnCallExpr(ReturnCallExpr*) override;\n  Result OnReturnCallIndirectExpr(ReturnCallIndirectExpr*) override;\n  Result OnReturnCallRefExpr(ReturnCallRefExpr*) override;\n  Result OnSelectExpr(SelectExpr*) override;\n  Result OnStoreExpr(StoreExpr*) override;\n  Result OnUnaryExpr(UnaryExpr*) override;\n  Result OnUnreachableExpr(UnreachableExpr*) override;\n  Result BeginTryExpr(TryExpr*) override;\n  Result OnCatchExpr(TryExpr*, Catch*) override;\n  Result OnDelegateExpr(TryExpr*) override;\n  Result EndTryExpr(TryExpr*) override;\n  Result BeginTryTableExpr(TryTableExpr*) override;\n  Result EndTryTableExpr(TryTableExpr*) override;\n  Result OnThrowExpr(ThrowExpr*) override;\n  Result OnThrowRefExpr(ThrowRefExpr*) override;\n  Result OnRethrowExpr(RethrowExpr*) override;\n  Result OnAtomicWaitExpr(AtomicWaitExpr*) override;\n  Result OnAtomicFenceExpr(AtomicFenceExpr*) override;\n  Result OnAtomicNotifyExpr(AtomicNotifyExpr*) override;\n  Result OnAtomicLoadExpr(AtomicLoadExpr*) override;\n  Result OnAtomicStoreExpr(AtomicStoreExpr*) override;\n  Result OnAtomicRmwExpr(AtomicRmwExpr*) override;\n  Result OnAtomicRmwCmpxchgExpr(AtomicRmwCmpxchgExpr*) override;\n  Result OnTernaryExpr(TernaryExpr*) override;\n  Result OnSimdLaneOpExpr(SimdLaneOpExpr*) override;\n  Result OnSimdLoadLaneExpr(SimdLoadLaneExpr*) override;\n  Result OnSimdStoreLaneExpr(SimdStoreLaneExpr*) override;\n  Result OnSimdShuffleOpExpr(SimdShuffleOpExpr*) override;\n  Result OnLoadSplatExpr(LoadSplatExpr*) override;\n  Result OnLoadZeroExpr(LoadZeroExpr*) override;\n\n private:\n  Type GetDeclarationType(const FuncDeclaration&);\n  Var GetFuncTypeIndex(const Location&, const FuncDeclaration&);\n\n  const ValidateOptions& options_;\n  Errors* errors_ = nullptr;\n  SharedValidator validator_;\n  const Module* current_module_ = nullptr;\n  Result result_ = Result::Ok;\n};\n\nScriptValidator::ScriptValidator(Errors* errors,\n                                 const Script* script,\n                                 const ValidateOptions& options)\n    : options_(options), errors_(errors), script_(script) {}\n\nvoid ScriptValidator::PrintError(const Location* loc, const char* format, ...) {\n  result_ = Result::Error;\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  errors_->emplace_back(ErrorLevel::Error, *loc, buffer);\n}\n\nstatic Result CheckType(Type actual, Type expected) {\n  // Script validator (strict) type compare\n  if (expected == Type::Any || actual == Type::Any) {\n    return Result::Ok;\n  }\n\n  Type::Enum actual_type = actual;\n  Type::Enum expected_type = expected;\n\n  if (actual_type == expected_type) {\n    switch (actual_type) {\n      case Type::ExternRef:\n      case Type::FuncRef:\n        return (expected.IsNullableNonTypedRef() ||\n                !actual.IsNullableNonTypedRef())\n                   ? Result::Ok\n                   : Result::Error;\n\n      case Type::Reference:\n      case Type::Ref:\n      case Type::RefNull:\n        if (actual == expected) {\n          return Result::Ok;\n        }\n        break;\n\n      default:\n        return Result::Ok;\n    }\n  }\n\n  if (actual_type == Type::FuncRef && expected_type == Type::RefNull) {\n    // The ref.null constant should be a valid value to any\n    // (ref null...) definition, regarless of its actual type.\n    return Result::Ok;\n  }\n\n  return Result::Error;\n}\n\nvoid ScriptValidator::CheckTypeIndex(const Location* loc,\n                                     Type actual,\n                                     Type expected,\n                                     const char* desc,\n                                     Index index,\n                                     const char* index_kind) {\n  if (Failed(CheckType(actual, expected))) {\n    PrintError(loc,\n               \"type mismatch for %s %\" PRIindex \" of %s. got %s, expected %s\",\n               index_kind, index, desc, actual.GetName().c_str(),\n               expected.GetName().c_str());\n  }\n}\n\nvoid ScriptValidator::CheckResultTypes(const Location* loc,\n                                       const TypeVector& actual,\n                                       const TypeVector& expected,\n                                       const char* desc) {\n  if (actual.size() == expected.size()) {\n    for (size_t i = 0; i < actual.size(); ++i) {\n      CheckTypeIndex(loc, actual[i], expected[i], desc, i, \"result\");\n    }\n  } else {\n    PrintError(loc, \"expected %\" PRIzd \" results, got %\" PRIzd, expected.size(),\n               actual.size());\n  }\n}\n\nvoid ScriptValidator::CheckExpectation(const Location* loc,\n                                       const TypeVector& result_types,\n                                       const ConstVector& expected,\n                                       const char* desc) {\n  // Here we take the concrete expected output types verify those actains\n  // the types that are the result of the action.\n  TypeVector actual_types;\n  for (auto ex : expected) {\n    actual_types.push_back(ex.type());\n  }\n  CheckResultTypes(loc, actual_types, result_types, desc);\n}\n\nvoid ScriptValidator::CheckExpectationTypes(const Location* loc,\n                                            const TypeVector& result_types,\n                                            const Expectation* expect,\n                                            const char* desc) {\n  switch (expect->type()) {\n    case ExpectationType::Values: {\n      CheckExpectation(loc, result_types, expect->expected, desc);\n      break;\n    }\n\n    case ExpectationType::Either: {\n      auto* either = cast<EitherExpectation>(expect);\n      for (auto alt : either->expected) {\n        CheckExpectation(loc, result_types, {alt}, desc);\n      }\n      break;\n    }\n  }\n}\n\nType Validator::GetDeclarationType(const FuncDeclaration& decl) {\n  if (decl.has_func_type) {\n    return Type(decl.type_var.index());\n  }\n  if (decl.sig.param_types.empty()) {\n    if (decl.sig.result_types.empty()) {\n      return Type::Void;\n    }\n    if (decl.sig.result_types.size() == 1) {\n      return decl.sig.result_types[0];\n    }\n  }\n  return Type(current_module_->GetFuncTypeIndex(decl));\n}\n\nVar Validator::GetFuncTypeIndex(const Location& default_loc,\n                                const FuncDeclaration& decl) {\n  if (decl.has_func_type) {\n    return decl.type_var;\n  }\n  return Var(current_module_->GetFuncTypeIndex(decl), default_loc);\n}\n\nResult Validator::OnBinaryExpr(BinaryExpr* expr) {\n  result_ |= validator_.OnBinary(expr->loc, expr->opcode);\n  return Result::Ok;\n}\n\nResult Validator::OnQuaternaryExpr(QuaternaryExpr* expr) {\n  result_ |= validator_.OnQuaternary(expr->loc, expr->opcode);\n  return Result::Ok;\n}\n\nResult Validator::BeginBlockExpr(BlockExpr* expr) {\n  result_ |=\n      validator_.OnBlock(expr->loc, GetDeclarationType(expr->block.decl));\n  return Result::Ok;\n}\n\nResult Validator::EndBlockExpr(BlockExpr* expr) {\n  result_ |= validator_.OnEnd(expr->block.end_loc);\n  return Result::Ok;\n}\n\nResult Validator::OnBrExpr(BrExpr* expr) {\n  result_ |= validator_.OnBr(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnBrIfExpr(BrIfExpr* expr) {\n  result_ |= validator_.OnBrIf(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnBrOnNonNullExpr(BrOnNonNullExpr* expr) {\n  result_ |= validator_.OnBrOnNonNull(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnBrOnNullExpr(BrOnNullExpr* expr) {\n  result_ |= validator_.OnBrOnNull(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnBrTableExpr(BrTableExpr* expr) {\n  result_ |= validator_.BeginBrTable(expr->loc);\n  for (const Var& var : expr->targets) {\n    result_ |= validator_.OnBrTableTarget(expr->loc, var);\n  }\n  result_ |= validator_.OnBrTableTarget(expr->loc, expr->default_target);\n  result_ |= validator_.EndBrTable(expr->loc);\n  return Result::Ok;\n}\n\nResult Validator::OnCallExpr(CallExpr* expr) {\n  result_ |= validator_.OnCall(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnCallIndirectExpr(CallIndirectExpr* expr) {\n  result_ |= validator_.OnCallIndirect(\n      expr->loc, GetFuncTypeIndex(expr->loc, expr->decl), expr->table);\n  return Result::Ok;\n}\n\nResult Validator::OnCallRefExpr(CallRefExpr* expr) {\n  result_ |= validator_.OnCallRef(expr->loc, expr->sig_type);\n  return Result::Ok;\n}\n\nResult Validator::OnCodeMetadataExpr(CodeMetadataExpr* expr) {\n  return Result::Ok;\n}\n\nResult Validator::OnCompareExpr(CompareExpr* expr) {\n  result_ |= validator_.OnCompare(expr->loc, expr->opcode);\n  return Result::Ok;\n}\n\nResult Validator::OnConstExpr(ConstExpr* expr) {\n  result_ |= validator_.OnConst(expr->loc, expr->const_.type());\n  return Result::Ok;\n}\n\nResult Validator::OnConvertExpr(ConvertExpr* expr) {\n  result_ |= validator_.OnConvert(expr->loc, expr->opcode);\n  return Result::Ok;\n}\n\nResult Validator::OnDropExpr(DropExpr* expr) {\n  result_ |= validator_.OnDrop(expr->loc);\n  return Result::Ok;\n}\n\nResult Validator::OnGlobalGetExpr(GlobalGetExpr* expr) {\n  result_ |= validator_.OnGlobalGet(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnGlobalSetExpr(GlobalSetExpr* expr) {\n  result_ |= validator_.OnGlobalSet(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::BeginIfExpr(IfExpr* expr) {\n  result_ |= validator_.OnIf(expr->loc, GetDeclarationType(expr->true_.decl));\n  return Result::Ok;\n}\n\nResult Validator::AfterIfTrueExpr(IfExpr* expr) {\n  if (!expr->false_.empty()) {\n    result_ |= validator_.OnElse(expr->true_.end_loc);\n  }\n  return Result::Ok;\n}\n\nResult Validator::EndIfExpr(IfExpr* expr) {\n  result_ |= validator_.OnEnd(expr->false_.empty() ? expr->true_.end_loc\n                                                   : expr->false_end_loc);\n  return Result::Ok;\n}\n\nResult Validator::OnLoadExpr(LoadExpr* expr) {\n  result_ |=\n      validator_.OnLoad(expr->loc, expr->opcode, expr->memidx,\n                        expr->opcode.GetAlignment(expr->align), expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnLocalGetExpr(LocalGetExpr* expr) {\n  result_ |= validator_.OnLocalGet(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnLocalSetExpr(LocalSetExpr* expr) {\n  result_ |= validator_.OnLocalSet(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnLocalTeeExpr(LocalTeeExpr* expr) {\n  result_ |= validator_.OnLocalTee(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::BeginLoopExpr(LoopExpr* expr) {\n  result_ |= validator_.OnLoop(expr->loc, GetDeclarationType(expr->block.decl));\n  return Result::Ok;\n}\n\nResult Validator::EndLoopExpr(LoopExpr* expr) {\n  result_ |= validator_.OnEnd(expr->block.end_loc);\n  return Result::Ok;\n}\n\nResult Validator::OnMemoryCopyExpr(MemoryCopyExpr* expr) {\n  result_ |=\n      validator_.OnMemoryCopy(expr->loc, expr->destmemidx, expr->srcmemidx);\n  return Result::Ok;\n}\n\nResult Validator::OnDataDropExpr(DataDropExpr* expr) {\n  result_ |= validator_.OnDataDrop(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnMemoryFillExpr(MemoryFillExpr* expr) {\n  result_ |= validator_.OnMemoryFill(expr->loc, expr->memidx);\n  return Result::Ok;\n}\n\nResult Validator::OnMemoryGrowExpr(MemoryGrowExpr* expr) {\n  result_ |= validator_.OnMemoryGrow(expr->loc, expr->memidx);\n  return Result::Ok;\n}\n\nResult Validator::OnMemoryInitExpr(MemoryInitExpr* expr) {\n  result_ |= validator_.OnMemoryInit(expr->loc, expr->var, expr->memidx);\n  return Result::Ok;\n}\n\nResult Validator::OnMemorySizeExpr(MemorySizeExpr* expr) {\n  result_ |= validator_.OnMemorySize(expr->loc, expr->memidx);\n  return Result::Ok;\n}\n\nResult Validator::OnTableCopyExpr(TableCopyExpr* expr) {\n  result_ |=\n      validator_.OnTableCopy(expr->loc, expr->dst_table, expr->src_table);\n  return Result::Ok;\n}\n\nResult Validator::OnElemDropExpr(ElemDropExpr* expr) {\n  result_ |= validator_.OnElemDrop(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnTableInitExpr(TableInitExpr* expr) {\n  result_ |=\n      validator_.OnTableInit(expr->loc, expr->segment_index, expr->table_index);\n  return Result::Ok;\n}\n\nResult Validator::OnTableGetExpr(TableGetExpr* expr) {\n  result_ |= validator_.OnTableGet(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnTableSetExpr(TableSetExpr* expr) {\n  result_ |= validator_.OnTableSet(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnTableGrowExpr(TableGrowExpr* expr) {\n  result_ |= validator_.OnTableGrow(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnTableSizeExpr(TableSizeExpr* expr) {\n  result_ |= validator_.OnTableSize(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnTableFillExpr(TableFillExpr* expr) {\n  result_ |= validator_.OnTableFill(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnRefAsNonNullExpr(RefAsNonNullExpr* expr) {\n  result_ |= validator_.OnRefAsNonNull(expr->loc);\n  return Result::Ok;\n}\n\nResult Validator::OnRefFuncExpr(RefFuncExpr* expr) {\n  result_ |= validator_.OnRefFunc(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnRefNullExpr(RefNullExpr* expr) {\n  result_ |= validator_.OnRefNull(expr->loc, expr->type);\n  return Result::Ok;\n}\n\nResult Validator::OnRefIsNullExpr(RefIsNullExpr* expr) {\n  result_ |= validator_.OnRefIsNull(expr->loc);\n  return Result::Ok;\n}\n\nResult Validator::OnNopExpr(NopExpr* expr) {\n  result_ |= validator_.OnNop(expr->loc);\n  return Result::Ok;\n}\n\nResult Validator::OnReturnExpr(ReturnExpr* expr) {\n  result_ |= validator_.OnReturn(expr->loc);\n  return Result::Ok;\n}\n\nResult Validator::OnReturnCallExpr(ReturnCallExpr* expr) {\n  result_ |= validator_.OnReturnCall(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnReturnCallIndirectExpr(ReturnCallIndirectExpr* expr) {\n  result_ |= validator_.OnReturnCallIndirect(\n      expr->loc, GetFuncTypeIndex(expr->loc, expr->decl), expr->table);\n  return Result::Ok;\n}\n\nResult Validator::OnReturnCallRefExpr(ReturnCallRefExpr* expr) {\n  result_ |= validator_.OnReturnCallRef(expr->loc, expr->sig_type);\n  return Result::Ok;\n}\n\nResult Validator::OnSelectExpr(SelectExpr* expr) {\n  result_ |= validator_.OnSelect(expr->loc, expr->result_type.size(),\n                                 expr->result_type.data());\n  return Result::Ok;\n}\n\nResult Validator::OnStoreExpr(StoreExpr* expr) {\n  result_ |=\n      validator_.OnStore(expr->loc, expr->opcode, expr->memidx,\n                         expr->opcode.GetAlignment(expr->align), expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnUnaryExpr(UnaryExpr* expr) {\n  result_ |= validator_.OnUnary(expr->loc, expr->opcode);\n  return Result::Ok;\n}\n\nResult Validator::OnUnreachableExpr(UnreachableExpr* expr) {\n  result_ |= validator_.OnUnreachable(expr->loc);\n  return Result::Ok;\n}\n\nResult Validator::BeginTryExpr(TryExpr* expr) {\n  result_ |= validator_.OnTry(expr->loc, GetDeclarationType(expr->block.decl));\n  return Result::Ok;\n}\n\nResult Validator::OnCatchExpr(TryExpr*, Catch* catch_) {\n  result_ |= validator_.OnCatch(catch_->loc, catch_->var, catch_->IsCatchAll());\n  return Result::Ok;\n}\n\nResult Validator::OnDelegateExpr(TryExpr* expr) {\n  result_ |= validator_.OnDelegate(expr->loc, expr->delegate_target);\n  return Result::Ok;\n}\n\nResult Validator::EndTryExpr(TryExpr* expr) {\n  result_ |= validator_.OnEnd(expr->block.end_loc);\n  return Result::Ok;\n}\n\nResult Validator::BeginTryTableExpr(TryTableExpr* expr) {\n  result_ |=\n      validator_.BeginTryTable(expr->loc, GetDeclarationType(expr->block.decl));\n  for (const TableCatch& catch_ : expr->catches) {\n    result_ |= validator_.OnTryTableCatch(expr->loc, catch_);\n  }\n  result_ |=\n      validator_.EndTryTable(expr->loc, GetDeclarationType(expr->block.decl));\n  return Result::Ok;\n}\n\nResult Validator::EndTryTableExpr(TryTableExpr* expr) {\n  result_ |= validator_.OnEnd(expr->block.end_loc);\n  return Result::Ok;\n}\n\nResult Validator::OnThrowExpr(ThrowExpr* expr) {\n  result_ |= validator_.OnThrow(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnThrowRefExpr(ThrowRefExpr* expr) {\n  result_ |= validator_.OnThrowRef(expr->loc);\n  return Result::Ok;\n}\n\nResult Validator::OnRethrowExpr(RethrowExpr* expr) {\n  result_ |= validator_.OnRethrow(expr->loc, expr->var);\n  return Result::Ok;\n}\n\nResult Validator::OnAtomicWaitExpr(AtomicWaitExpr* expr) {\n  result_ |= validator_.OnAtomicWait(expr->loc, expr->opcode, expr->memidx,\n                                     expr->opcode.GetAlignment(expr->align),\n                                     expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnAtomicFenceExpr(AtomicFenceExpr* expr) {\n  result_ |= validator_.OnAtomicFence(expr->loc, expr->consistency_model);\n  return Result::Ok;\n}\n\nResult Validator::OnAtomicNotifyExpr(AtomicNotifyExpr* expr) {\n  result_ |= validator_.OnAtomicNotify(expr->loc, expr->opcode, expr->memidx,\n                                       expr->opcode.GetAlignment(expr->align),\n                                       expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnAtomicLoadExpr(AtomicLoadExpr* expr) {\n  result_ |= validator_.OnAtomicLoad(expr->loc, expr->opcode, expr->memidx,\n                                     expr->opcode.GetAlignment(expr->align),\n                                     expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnAtomicStoreExpr(AtomicStoreExpr* expr) {\n  result_ |= validator_.OnAtomicStore(expr->loc, expr->opcode, expr->memidx,\n                                      expr->opcode.GetAlignment(expr->align),\n                                      expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnAtomicRmwExpr(AtomicRmwExpr* expr) {\n  result_ |= validator_.OnAtomicRmw(expr->loc, expr->opcode, expr->memidx,\n                                    expr->opcode.GetAlignment(expr->align),\n                                    expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnAtomicRmwCmpxchgExpr(AtomicRmwCmpxchgExpr* expr) {\n  result_ |= validator_.OnAtomicRmwCmpxchg(\n      expr->loc, expr->opcode, expr->memidx,\n      expr->opcode.GetAlignment(expr->align), expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnTernaryExpr(TernaryExpr* expr) {\n  result_ |= validator_.OnTernary(expr->loc, expr->opcode);\n  return Result::Ok;\n}\n\nResult Validator::OnSimdLaneOpExpr(SimdLaneOpExpr* expr) {\n  result_ |= validator_.OnSimdLaneOp(expr->loc, expr->opcode, expr->val);\n  return Result::Ok;\n}\n\nResult Validator::OnSimdLoadLaneExpr(SimdLoadLaneExpr* expr) {\n  result_ |= validator_.OnSimdLoadLane(expr->loc, expr->opcode, expr->memidx,\n                                       expr->opcode.GetAlignment(expr->align),\n                                       expr->offset, expr->val);\n  return Result::Ok;\n}\n\nResult Validator::OnSimdStoreLaneExpr(SimdStoreLaneExpr* expr) {\n  result_ |= validator_.OnSimdStoreLane(expr->loc, expr->opcode, expr->memidx,\n                                        expr->opcode.GetAlignment(expr->align),\n                                        expr->offset, expr->val);\n  return Result::Ok;\n}\n\nResult Validator::OnSimdShuffleOpExpr(SimdShuffleOpExpr* expr) {\n  result_ |= validator_.OnSimdShuffleOp(expr->loc, expr->opcode, expr->val);\n  return Result::Ok;\n}\n\nResult Validator::OnLoadSplatExpr(LoadSplatExpr* expr) {\n  result_ |= validator_.OnLoadSplat(expr->loc, expr->opcode, expr->memidx,\n                                    expr->opcode.GetAlignment(expr->align),\n                                    expr->offset);\n  return Result::Ok;\n}\n\nResult Validator::OnLoadZeroExpr(LoadZeroExpr* expr) {\n  result_ |= validator_.OnLoadZero(expr->loc, expr->opcode, expr->memidx,\n                                   expr->opcode.GetAlignment(expr->align),\n                                   expr->offset);\n  return Result::Ok;\n}\n\nValidator::Validator(Errors* errors,\n                     const Module* module,\n                     const ValidateOptions& options)\n    : options_(options),\n      errors_(errors),\n      validator_(errors_, options_),\n      current_module_(module) {}\n\nResult Validator::CheckModule() {\n  const Module* module = current_module_;\n\n  // Type section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<TypeModuleField>(&field)) {\n      switch (f->type->kind()) {\n        case TypeEntryKind::Func: {\n          FuncType* func_type = cast<FuncType>(f->type.get());\n          result_ |= validator_.OnFuncType(\n              field.loc, func_type->sig.param_types.size(),\n              func_type->sig.param_types.data(),\n              func_type->sig.result_types.size(),\n              func_type->sig.result_types.data(),\n              module->GetFuncTypeIndex(func_type->sig));\n          break;\n        }\n\n        case TypeEntryKind::Struct: {\n          StructType* struct_type = cast<StructType>(f->type.get());\n          TypeMutVector type_muts;\n          for (auto&& field : struct_type->fields) {\n            type_muts.push_back(TypeMut{field.type, field.mutable_});\n          }\n          result_ |= validator_.OnStructType(field.loc, type_muts.size(),\n                                             type_muts.data());\n          break;\n        }\n\n        case TypeEntryKind::Array: {\n          ArrayType* array_type = cast<ArrayType>(f->type.get());\n          result_ |= validator_.OnArrayType(\n              field.loc,\n              TypeMut{array_type->field.type, array_type->field.mutable_});\n          break;\n        }\n      }\n    }\n  }\n\n  // Import section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<ImportModuleField>(&field)) {\n      switch (f->import->kind()) {\n        case ExternalKind::Func: {\n          auto&& func = cast<FuncImport>(f->import.get())->func;\n          result_ |= validator_.OnFunction(\n              field.loc, GetFuncTypeIndex(field.loc, func.decl));\n          break;\n        }\n\n        case ExternalKind::Table: {\n          auto&& table = cast<TableImport>(f->import.get())->table;\n          result_ |= validator_.OnTable(\n              field.loc, table.elem_type, table.elem_limits,\n              TableImportStatus::TableIsImported,\n              TableInitExprStatus::TableWithoutInitExpression);\n          break;\n        }\n\n        case ExternalKind::Memory: {\n          auto&& memory = cast<MemoryImport>(f->import.get())->memory;\n          result_ |= validator_.OnMemory(field.loc, memory.page_limits,\n                                         memory.page_size);\n          break;\n        }\n\n        case ExternalKind::Global: {\n          auto&& global = cast<GlobalImport>(f->import.get())->global;\n          result_ |= validator_.OnGlobalImport(field.loc, global.type,\n                                               global.mutable_);\n          break;\n        }\n\n        case ExternalKind::Tag: {\n          auto&& tag = cast<TagImport>(f->import.get())->tag;\n          result_ |= validator_.OnTag(field.loc,\n                                      GetFuncTypeIndex(field.loc, tag.decl));\n          break;\n        }\n      }\n    }\n  }\n\n  // Func section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<FuncModuleField>(&field)) {\n      result_ |= validator_.OnFunction(\n          field.loc, GetFuncTypeIndex(field.loc, f->func.decl));\n    }\n  }\n\n  // Table section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<TableModuleField>(&field)) {\n      TableInitExprStatus init_provided =\n          f->table.init_expr.empty()\n              ? TableInitExprStatus::TableWithoutInitExpression\n              : TableInitExprStatus::TableWithInitExpression;\n      result_ |= validator_.OnTable(\n          field.loc, f->table.elem_type, f->table.elem_limits,\n          TableImportStatus::TableIsNotImported, init_provided);\n\n      // Init expr.\n      if (init_provided == TableInitExprStatus::TableWithInitExpression) {\n        result_ |= validator_.BeginInitExpr(field.loc, f->table.elem_type);\n        ExprVisitor visitor(this);\n        result_ |=\n            visitor.VisitExprList(const_cast<ExprList&>(f->table.init_expr));\n        result_ |= validator_.EndInitExpr();\n      }\n    }\n  }\n\n  // Memory section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<MemoryModuleField>(&field)) {\n      result_ |= validator_.OnMemory(field.loc, f->memory.page_limits,\n                                     f->memory.page_size);\n    }\n  }\n\n  // Global section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<GlobalModuleField>(&field)) {\n      result_ |=\n          validator_.OnGlobal(field.loc, f->global.type, f->global.mutable_);\n\n      // Init expr.\n      result_ |= validator_.BeginInitExpr(field.loc, f->global.type);\n      ExprVisitor visitor(this);\n      result_ |=\n          visitor.VisitExprList(const_cast<ExprList&>(f->global.init_expr));\n      result_ |= validator_.EndInitExpr();\n    }\n  }\n\n  // Tag section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<TagModuleField>(&field)) {\n      result_ |=\n          validator_.OnTag(field.loc, GetFuncTypeIndex(field.loc, f->tag.decl));\n    }\n  }\n\n  // Export section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<ExportModuleField>(&field)) {\n      result_ |= validator_.OnExport(field.loc, f->export_.kind, f->export_.var,\n                                     f->export_.name);\n    }\n  }\n\n  // Start section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<StartModuleField>(&field)) {\n      result_ |= validator_.OnStart(field.loc, f->start);\n    }\n  }\n\n  // Elem segment section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<ElemSegmentModuleField>(&field)) {\n      result_ |= validator_.OnElemSegment(field.loc, f->elem_segment.table_var,\n                                          f->elem_segment.kind);\n\n      result_ |= validator_.OnElemSegmentElemType(field.loc,\n                                                  f->elem_segment.elem_type);\n\n      // Init expr.\n      if (f->elem_segment.kind == SegmentKind::Active) {\n        Type offset_type = Type::I32;\n        Index table_index = module->GetTableIndex(f->elem_segment.table_var);\n        if (table_index < module->tables.size() &&\n            module->tables[table_index]->elem_limits.is_64) {\n          offset_type = Type::I64;\n        }\n        result_ |= validator_.BeginInitExpr(field.loc, offset_type);\n        ExprVisitor visitor(this);\n        result_ |= visitor.VisitExprList(\n            const_cast<ExprList&>(f->elem_segment.offset));\n        result_ |= validator_.EndInitExpr();\n      }\n\n      // Element expr.\n      for (auto&& elem_expr : f->elem_segment.elem_exprs) {\n        result_ |= validator_.BeginInitExpr(elem_expr.front().loc,\n                                            f->elem_segment.elem_type);\n        ExprVisitor visitor(this);\n        result_ |= visitor.VisitExprList(const_cast<ExprList&>(elem_expr));\n        result_ |= validator_.EndInitExpr();\n      }\n    }\n  }\n\n  // DataCount section.\n  validator_.OnDataCount(module->data_segments.size());\n\n  // Code section.\n  Index func_index = module->num_func_imports;\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<FuncModuleField>(&field)) {\n      const Location& body_start = f->func.loc;\n      const Location& body_end =\n          f->func.exprs.empty() ? body_start : f->func.exprs.back().loc;\n      result_ |= validator_.BeginFunctionBody(body_start, func_index++);\n\n      for (auto&& decl : f->func.local_types.decls()) {\n        result_ |= validator_.OnLocalDecl(body_start, decl.second, decl.first);\n      }\n\n      ExprVisitor visitor(this);\n      result_ |= visitor.VisitExprList(const_cast<ExprList&>(f->func.exprs));\n      result_ |= validator_.EndFunctionBody(body_end);\n    }\n  }\n\n  // Data segment section.\n  for (const ModuleField& field : module->fields) {\n    if (auto* f = dyn_cast<DataSegmentModuleField>(&field)) {\n      result_ |= validator_.OnDataSegment(field.loc, f->data_segment.memory_var,\n                                          f->data_segment.kind);\n\n      // Init expr.\n      if (f->data_segment.kind == SegmentKind::Active) {\n        Type offset_type = Type::I32;\n        Index memory_index = module->GetMemoryIndex(f->data_segment.memory_var);\n        if (memory_index < module->memories.size() &&\n            module->memories[memory_index]->page_limits.is_64) {\n          offset_type = Type::I64;\n        }\n        result_ |= validator_.BeginInitExpr(field.loc, offset_type);\n        ExprVisitor visitor(this);\n        result_ |= visitor.VisitExprList(\n            const_cast<ExprList&>(f->data_segment.offset));\n        result_ |= validator_.EndInitExpr();\n      }\n    }\n  }\n\n  result_ |= validator_.EndModule();\n\n  return result_;\n}\n\n// Returns the result type of the invoked function, checked by the caller;\n// returning nullptr means that another error occured first, so the result type\n// should be ignored.\nconst TypeVector* ScriptValidator::CheckInvoke(const InvokeAction* action) {\n  const Module* module = script_->GetModule(action->module_var);\n  if (!module) {\n    PrintError(&action->loc, \"unknown module\");\n    return nullptr;\n  }\n\n  const Export* export_ = module->GetExport(action->name);\n  if (!export_) {\n    PrintError(&action->loc, \"unknown function export \\\"%s\\\"\",\n               action->name.c_str());\n    return nullptr;\n  }\n\n  const Func* func = module->GetFunc(export_->var);\n  if (!func) {\n    // This error will have already been reported, just skip it.\n    return nullptr;\n  }\n\n  size_t actual_args = action->args.size();\n  size_t expected_args = func->GetNumParams();\n  if (expected_args != actual_args) {\n    PrintError(&action->loc,\n               \"too %s parameters to function. got %\" PRIzd\n               \", expected %\" PRIzd,\n               actual_args > expected_args ? \"many\" : \"few\", actual_args,\n               expected_args);\n    return nullptr;\n  }\n  for (size_t i = 0; i < actual_args; ++i) {\n    const Const* const_ = &action->args[i];\n    CheckTypeIndex(&const_->loc, const_->type(), func->GetParamType(i),\n                   \"invoke\", i, \"argument\");\n  }\n\n  return &func->decl.sig.result_types;\n}\n\nResult ScriptValidator::CheckGet(const GetAction* action, Type* out_type) {\n  const Module* module = script_->GetModule(action->module_var);\n  if (!module) {\n    PrintError(&action->loc, \"unknown module\");\n    return Result::Error;\n  }\n\n  const Export* export_ = module->GetExport(action->name);\n  if (!export_) {\n    PrintError(&action->loc, \"unknown global export \\\"%s\\\"\",\n               action->name.c_str());\n    return Result::Error;\n  }\n\n  const Global* global = module->GetGlobal(export_->var);\n  if (!global) {\n    // This error will have already been reported, just skip it.\n    return Result::Error;\n  }\n\n  *out_type = global->type;\n  return Result::Ok;\n}\n\nScriptValidator::ActionResult ScriptValidator::CheckAction(\n    const Action* action) {\n  ActionResult result;\n  ZeroMemory(result);\n\n  switch (action->type()) {\n    case ActionType::Invoke:\n      result.types = CheckInvoke(cast<InvokeAction>(action));\n      result.kind =\n          result.types ? ActionResult::Kind::Types : ActionResult::Kind::Error;\n      break;\n\n    case ActionType::Get:\n      if (Succeeded(CheckGet(cast<GetAction>(action), &result.type))) {\n        result.kind = ActionResult::Kind::Type;\n      } else {\n        result.kind = ActionResult::Kind::Error;\n      }\n      break;\n  }\n\n  return result;\n}\n\nvoid ScriptValidator::CheckCommand(const Command* command) {\n  switch (command->type) {\n    case CommandType::Module: {\n      Validator module_validator(errors_, &cast<ModuleCommand>(command)->module,\n                                 options_);\n      module_validator.CheckModule();\n      break;\n    }\n\n    case CommandType::ScriptModule: {\n      Validator module_validator(\n          errors_, &cast<ScriptModuleCommand>(command)->module, options_);\n      module_validator.CheckModule();\n      break;\n    }\n\n    case CommandType::Action:\n      // Ignore result type.\n      CheckAction(cast<ActionCommand>(command)->action.get());\n      break;\n\n    case CommandType::Register:\n    case CommandType::AssertMalformed:\n    case CommandType::AssertInvalid:\n    case CommandType::AssertUnlinkable:\n    case CommandType::AssertUninstantiable:\n      // Ignore.\n      break;\n\n    case CommandType::AssertReturn: {\n      auto* assert_return_command = cast<AssertReturnCommand>(command);\n      const Action* action = assert_return_command->action.get();\n      ActionResult result = CheckAction(action);\n      const Expectation* expected = assert_return_command->expected.get();\n      switch (result.kind) {\n        case ActionResult::Kind::Types:\n          CheckExpectationTypes(&action->loc, *result.types, expected,\n                                \"action\");\n          break;\n\n        case ActionResult::Kind::Type:\n          CheckExpectationTypes(&action->loc, {result.type}, expected,\n                                \"action\");\n          break;\n\n        case ActionResult::Kind::Error:\n          // Error occurred, don't do any further checks.\n          break;\n      }\n      break;\n    }\n\n    case CommandType::AssertTrap:\n      // ignore result type.\n      CheckAction(cast<AssertTrapCommand>(command)->action.get());\n      break;\n    case CommandType::AssertExhaustion:\n      // ignore result type.\n      CheckAction(cast<AssertExhaustionCommand>(command)->action.get());\n      break;\n    case CommandType::AssertException:\n      // ignore result type.\n      CheckAction(cast<AssertExceptionCommand>(command)->action.get());\n      break;\n  }\n}\n\nResult ScriptValidator::CheckScript() {\n  for (const std::unique_ptr<Command>& command : script_->commands)\n    CheckCommand(command.get());\n  return result_;\n}\n\n}  // end anonymous namespace\n\nResult ValidateScript(const Script* script,\n                      Errors* errors,\n                      const ValidateOptions& options) {\n  ScriptValidator validator(errors, script, options);\n\n  return validator.CheckScript();\n}\n\nResult ValidateModule(const Module* module,\n                      Errors* errors,\n                      const ValidateOptions& options) {\n  Validator validator(errors, module, options);\n\n  return validator.CheckModule();\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/wabt.post.js",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst WABT_OK = 0;\nconst WABT_ERROR = 1;\n\n/// features and default enabled state\nconst FEATURES = Object.freeze({\n  'exceptions': false,\n  'mutable_globals': true,\n  'sat_float_to_int': true,\n  'sign_extension': true,\n  'simd': true,\n  'threads': false,\n  'function_references': false,\n  'multi_value': true,\n  'tail_call': false,\n  'bulk_memory': true,\n  'reference_types': true,\n  'annotations': false,\n  'code_metadata': false,\n  'gc': false,\n  'memory64': false,\n  'multi_memory': false,\n  'extended_const': false,\n  'relaxed_simd': false,\n  'custom_page_sizes': false,\n  'compact_imports': false,\n  'wide_arithmetic': false,\n});\n\n\n/// Allocate memory in the Module.\nfunction malloc(size) {\n  const addr = Module._malloc(size);\n  if (addr == 0) {\n    throw new Error('out of memory');\n  }\n  return addr;\n}\n\n/// Convert an ArrayBuffer/TypedArray/string into a buffer that can be\n/// used by the Module.\nfunction allocateBuffer(buf) {\n  let addr;\n  let size;\n  if (buf instanceof ArrayBuffer) {\n    size = buf.byteLength;\n    addr = malloc(size);\n    new Uint8Array(HEAPU8.buffer, addr, size).set(new Uint8Array(buf));\n  } else if (ArrayBuffer.isView(buf)) {\n    size = buf.byteLength;\n    addr = malloc(size);\n    new Uint8Array(HEAPU8.buffer, addr, size)\n        .set(new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength));\n  } else if (typeof buf == 'string') {\n    addr = stringToNewUTF8(buf);\n    size = lengthBytesUTF8(buf);\n  } else {\n    throw new Error('unknown buffer type: ' + buf);\n  }\n  return {addr: addr, size: size};\n}\n\n\n/// Features\nclass Features {\n  constructor(obj = {}) {\n    this.addr = Module._wabt_new_features();\n    for (const [f, v] of Object.entries(FEATURES)) {\n      this[f] = obj[f] ?? v;\n    }\n  }\n\n  destroy() {\n    Module._wabt_destroy_features(this.addr);\n  }\n}\n\nObject.keys(FEATURES).forEach(function(feature) {\n  Object.defineProperty(Features.prototype, feature, {\n    enumerable: true,\n    get: function() {\n      return Module['_wabt_' + feature + '_enabled'](this.addr);\n    },\n    set: function(newValue) {\n      Module['_wabt_set_' + feature + '_enabled'](this.addr, newValue | 0);\n    }\n  });\n});\n\n\n/// Lexer\nclass Lexer {\n  constructor(filename, buffer, errors) {\n    this.filename = stringToNewUTF8(filename);\n    this.bufferObj = allocateBuffer(buffer);\n    this.addr = Module._wabt_new_wast_buffer_lexer(\n        this.filename, this.bufferObj.addr, this.bufferObj.size, errors.addr);\n  }\n\n  destroy() {\n    Module._wabt_destroy_wast_lexer(this.addr);\n    Module._free(this.bufferObj.addr);\n    Module._free(this.filename);\n  }\n}\n\n\n/// OutputBuffer\nclass OutputBuffer {\n  constructor(addr) {\n    this.addr = addr;\n  }\n\n  toTypedArray() {\n    if (!this.addr) {\n      return null;\n    }\n\n    const addr = Module._wabt_output_buffer_get_data(this.addr);\n    const size = Module._wabt_output_buffer_get_size(this.addr);\n    const buffer = new Uint8Array(size);\n    buffer.set(new Uint8Array(HEAPU8.buffer, addr, size));\n    return buffer;\n  }\n\n  toString() {\n    if (!this.addr) {\n      return '';\n    }\n\n    const addr = Module._wabt_output_buffer_get_data(this.addr);\n    const size = Module._wabt_output_buffer_get_size(this.addr);\n    return UTF8ToString(addr, size);\n  }\n\n  destroy() {\n    Module._wabt_destroy_output_buffer(this.addr);\n  }\n}\n\n\n/// Errors\nclass Errors {\n  constructor(kind) {\n    this.kind = kind;\n    this.addr = Module._wabt_new_errors();\n  }\n\n  format(lexer = null) {\n    let buffer;\n    switch (this.kind) {\n      case 'text':\n        buffer = new OutputBuffer(\n            Module._wabt_format_text_errors(this.addr, lexer.addr));\n        break;\n      case 'binary':\n        buffer = new OutputBuffer(Module._wabt_format_binary_errors(this.addr));\n        break;\n      default:\n        throw new Error(`Invalid Errors kind: ${this.kind}`);\n    }\n    const message = buffer.toString();\n    buffer.destroy();\n    return message;\n  }\n\n  destroy() {\n    Module._wabt_destroy_errors(this.addr);\n  }\n}\n\n\n/// parseWat\nfunction parseWat(filename, buffer, options) {\n  let errors = new Errors('text');\n  let lexer = new Lexer(filename, buffer, errors);\n  const features = new Features(options || {});\n\n  let parseResult_addr;\n  try {\n    parseResult_addr =\n        Module._wabt_parse_wat(lexer.addr, features.addr, errors.addr);\n\n    const result = Module._wabt_parse_wat_result_get_result(parseResult_addr);\n    if (result !== WABT_OK) {\n      throw new Error('parseWat failed:\\n' + errors.format(lexer));\n    }\n\n    const module_addr =\n        Module._wabt_parse_wat_result_release_module(parseResult_addr);\n    const wasmModule = new WasmModule(module_addr, errors, lexer);\n    // Clear errors and lexer so they aren't destroyed below.\n    errors = null;\n    lexer = null;\n    return wasmModule;\n  } finally {\n    Module._wabt_destroy_parse_wat_result(parseResult_addr);\n    features.destroy();\n    if (errors) {\n      errors.destroy();\n    }\n    if (lexer) {\n      lexer.destroy();\n    }\n  }\n}\n\n\n// readWasm\nfunction readWasm(buffer, options = {}) {\n  const bufferObj = allocateBuffer(buffer);\n  let errors = new Errors('binary');\n  const readDebugNames = options.readDebugNames ?? false;\n  const check = options.check ?? true;\n  const features = new Features(options);\n\n  let readBinaryResult_addr;\n  try {\n    readBinaryResult_addr = Module._wabt_read_binary(\n        bufferObj.addr, bufferObj.size, readDebugNames, features.addr,\n        errors.addr);\n\n    const result =\n        Module._wabt_read_binary_result_get_result(readBinaryResult_addr);\n    if (check && result !== WABT_OK) {\n      throw new Error('readWasm failed:\\n' + errors.format());\n    }\n\n    const module_addr =\n        Module._wabt_read_binary_result_release_module(readBinaryResult_addr);\n    const wasmModule = new WasmModule(module_addr, errors);\n    // Clear errors so it isn't destroyed below.\n    errors = null;\n    return wasmModule;\n  } finally {\n    Module._wabt_destroy_read_binary_result(readBinaryResult_addr);\n    features.destroy();\n    if (errors) {\n      errors.destroy();\n    }\n    Module._free(bufferObj.addr);\n  }\n}\n\n\n// WasmModule (can't call it Module because emscripten has claimed it.)\nclass WasmModule {\n  constructor(module_addr, errors, lexer = null) {\n    this.module_addr = module_addr;\n    this.errors = errors;\n    this.lexer = lexer;\n  }\n\n  validate(options) {\n    const features = new Features(options || {});\n    try {\n      const result = Module._wabt_validate_module(\n          this.module_addr, features.addr, this.errors.addr);\n      if (result !== WABT_OK) {\n        throw new Error('validate failed:\\n' + this.errors.format(this.lexer));\n      }\n    } finally {\n      features.destroy();\n    }\n  }\n\n  generateNames() {\n    const result = Module._wabt_generate_names_module(this.module_addr);\n    if (result !== WABT_OK) {\n      throw new Error('generateNames failed.');\n    }\n  }\n\n  applyNames() {\n    const result = Module._wabt_apply_names_module(this.module_addr);\n    if (result !== WABT_OK) {\n      throw new Error('applyNames failed.');\n    }\n  }\n\n  toText(options = {}) {\n    const foldExprs = options.foldExprs ?? false;\n    const inlineExport = options.inlineExport ?? false;\n\n    const writeModuleResult_addr = Module._wabt_write_text_module(\n        this.module_addr, foldExprs, inlineExport);\n\n    const result =\n        Module._wabt_write_module_result_get_result(writeModuleResult_addr);\n\n    let outputBuffer;\n    try {\n      if (result !== WABT_OK) {\n        throw new Error('toText failed.');\n      }\n\n      outputBuffer = new OutputBuffer(\n          Module._wabt_write_module_result_release_output_buffer(\n              writeModuleResult_addr));\n\n      return outputBuffer.toString();\n\n    } finally {\n      if (outputBuffer) {\n        outputBuffer.destroy();\n      }\n      Module._wabt_destroy_write_module_result(writeModuleResult_addr);\n    }\n  }\n\n  toBinary(options = {}) {\n    const log = options.log ?? false;\n    const canonicalize_lebs = options.canonicalize_lebs ?? true;\n    const relocatable = options.relocatable ?? false;\n    const write_debug_names = options.write_debug_names ?? false;\n\n    const writeModuleResult_addr = Module._wabt_write_binary_module(\n        this.module_addr, log, canonicalize_lebs, relocatable,\n        write_debug_names);\n\n    const result =\n        Module._wabt_write_module_result_get_result(writeModuleResult_addr);\n\n    let binaryOutputBuffer;\n    let logOutputBuffer;\n    try {\n      if (result !== WABT_OK) {\n        throw new Error('toBinary failed.');\n      }\n\n      binaryOutputBuffer = new OutputBuffer(\n          Module._wabt_write_module_result_release_output_buffer(\n              writeModuleResult_addr));\n      logOutputBuffer = new OutputBuffer(\n          Module._wabt_write_module_result_release_log_output_buffer(\n              writeModuleResult_addr));\n\n      return {\n        buffer: binaryOutputBuffer.toTypedArray(),\n        log: logOutputBuffer.toString()\n      };\n\n    } finally {\n      if (binaryOutputBuffer) {\n        binaryOutputBuffer.destroy();\n      }\n      if (logOutputBuffer) {\n        logOutputBuffer.destroy();\n      }\n      Module._wabt_destroy_write_module_result(writeModuleResult_addr);\n    }\n  }\n\n  destroy() {\n    Module._wabt_destroy_module(this.module_addr);\n    if (this.errors) {\n      this.errors.destroy();\n    }\n    if (this.lexer) {\n      this.lexer.destroy();\n    }\n  }\n}\n\nModule['parseWat'] = parseWat;\nModule['readWasm'] = readWasm;\nModule['FEATURES'] = FEATURES;\n"
  },
  {
    "path": "src/wast-lexer.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/wast-lexer.h\"\n\n#include <cassert>\n#include <cstdio>\n\n#include \"wabt/config.h\"\n\n#include \"wabt/lexer-source.h\"\n\n#define ERROR(...) Error(GetLocation(), __VA_ARGS__)\n\nnamespace wabt {\n\nnamespace {\n\n#if __clang__\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wimplicit-fallthrough\"\n#endif\n#include \"prebuilt/lexer-keywords.cc\"\n#if __clang__\n#pragma clang diagnostic pop\n#endif\n\n}  // namespace\n\nWastLexer::WastLexer(std::unique_ptr<LexerSource> source,\n                     std::string_view filename,\n                     Errors* errors)\n    : source_(std::move(source)),\n      filename_(filename),\n      line_(1),\n      buffer_(static_cast<const char*>(source_->data())),\n      buffer_end_(buffer_ + source_->size()),\n      line_start_(buffer_),\n      token_start_(buffer_),\n      cursor_(buffer_),\n      errors_(errors) {}\n\n// static\nstd::unique_ptr<WastLexer> WastLexer::CreateBufferLexer(\n    std::string_view filename,\n    const void* data,\n    size_t size,\n    Errors* errors) {\n  return std::make_unique<WastLexer>(std::make_unique<LexerSource>(data, size),\n                                     filename, errors);\n}\n\nToken WastLexer::GetToken() {\n  while (true) {\n    token_start_ = cursor_;\n    switch (PeekChar()) {\n      case kEof:\n        return BareToken(TokenType::Eof);\n\n      case '(':\n        if (MatchString(\"(;\")) {\n          if (ReadBlockComment()) {\n            continue;\n          }\n          return BareToken(TokenType::Eof);\n        } else if (MatchString(\"(@\")) {\n          GetIdChars();\n          // offset=2 to skip the \"(@\" prefix\n          return TextToken(TokenType::LparAnn, 2);\n        } else {\n          ReadChar();\n          return BareToken(TokenType::Lpar);\n        }\n        break;\n\n      case ')':\n        ReadChar();\n        return BareToken(TokenType::Rpar);\n\n      case ';':\n        if (MatchString(\";;\")) {\n          if (ReadLineComment()) {\n            continue;\n          }\n          return BareToken(TokenType::Eof);\n        } else {\n          ReadChar();\n          ERROR(\"unexpected char\");\n          continue;\n        }\n        break;\n\n      case ' ':\n      case '\\t':\n      case '\\r':\n      case '\\n':\n        ReadWhitespace();\n        continue;\n\n      case '\"':\n        return GetStringToken(TokenType::Text);\n\n      case '+':\n      case '-':\n        ReadChar();\n        switch (PeekChar()) {\n          case 'i':\n            return GetInfToken();\n\n          case 'n':\n            return GetNanToken();\n\n          case '0':\n            return MatchString(\"0x\") ? GetHexNumberToken(TokenType::Int)\n                                     : GetNumberToken(TokenType::Int);\n          case '1':\n          case '2':\n          case '3':\n          case '4':\n          case '5':\n          case '6':\n          case '7':\n          case '8':\n          case '9':\n            return GetNumberToken(TokenType::Int);\n\n          default:\n            return GetReservedToken();\n        }\n        break;\n\n      case '0':\n        return MatchString(\"0x\") ? GetHexNumberToken(TokenType::Nat)\n                                 : GetNumberToken(TokenType::Nat);\n\n      case '1':\n      case '2':\n      case '3':\n      case '4':\n      case '5':\n      case '6':\n      case '7':\n      case '8':\n      case '9':\n        return GetNumberToken(TokenType::Nat);\n\n      case '$':\n        ReadChar();\n        if (PeekChar() == '\"') {\n          return GetStringToken(TokenType::Var);\n        }\n        return GetIdChars();  // Initial $ is idchar, so this produces id token\n\n      case 'a':\n        return GetNameEqNumToken(\"align=\", TokenType::AlignEqNat);\n\n      case 'i':\n        return GetInfToken();\n\n      case 'n':\n        return GetNanToken();\n\n      case 'o':\n        return GetNameEqNumToken(\"offset=\", TokenType::OffsetEqNat);\n\n      default:\n        if (IsKeyword(PeekChar())) {\n          return GetKeywordToken();\n        } else if (IsIdChar(PeekChar())) {\n          return GetReservedToken();\n        } else {\n          ReadChar();\n          ERROR(\"unexpected char\");\n          continue;\n        }\n    }\n  }\n}\n\nLocation WastLexer::GetLocation() {\n  auto column = [this](const char* p) {\n    return std::max(1, static_cast<int>(p - line_start_ + 1));\n  };\n  return Location(filename_, line_, column(token_start_), column(cursor_));\n}\n\nstd::string_view WastLexer::GetText(size_t offset) {\n  // Bounds checks are necessary because token_start may have been moved\n  // (e.g. if GetStringToken found a newline and reset token_start to\n  // point at it).\n\n  if (token_start_ + offset >= buffer_end_)\n    return {};\n\n  if (cursor_ <= token_start_ + offset)\n    return {};\n\n  return std::string_view(token_start_ + offset,\n                          (cursor_ - token_start_) - offset);\n}\n\nToken WastLexer::BareToken(TokenType token_type) {\n  return Token(GetLocation(), token_type);\n}\n\nToken WastLexer::LiteralToken(TokenType token_type, LiteralType literal_type) {\n  return Token(GetLocation(), token_type, Literal(literal_type, GetText()));\n}\n\nToken WastLexer::TextToken(TokenType token_type, size_t offset) {\n  return Token(GetLocation(), token_type, GetText(offset));\n}\n\nint WastLexer::PeekChar() {\n  return cursor_ < buffer_end_ ? static_cast<uint8_t>(*cursor_) : kEof;\n}\n\nint WastLexer::ReadChar() {\n  return cursor_ < buffer_end_ ? static_cast<uint8_t>(*cursor_++) : kEof;\n}\n\nbool WastLexer::MatchChar(char c) {\n  if (PeekChar() == c) {\n    ReadChar();\n    return true;\n  }\n  return false;\n}\n\nbool WastLexer::MatchString(std::string_view s) {\n  const char* saved_cursor = cursor_;\n  for (char c : s) {\n    if (ReadChar() != c) {\n      cursor_ = saved_cursor;\n      return false;\n    }\n  }\n  return true;\n}\n\nvoid WastLexer::Newline() {\n  line_++;\n  line_start_ = cursor_;\n}\n\nbool WastLexer::ReadBlockComment() {\n  int nesting = 1;\n  while (true) {\n    switch (ReadChar()) {\n      case kEof:\n        ERROR(\"EOF in block comment\");\n        return false;\n\n      case ';':\n        if (MatchChar(')') && --nesting == 0) {\n          return true;\n        }\n        break;\n\n      case '(':\n        if (MatchChar(';')) {\n          nesting++;\n        }\n        break;\n\n      case '\\n':\n        Newline();\n        break;\n    }\n  }\n}\n\nbool WastLexer::ReadLineComment() {\n  while (true) {\n    switch (ReadChar()) {\n      case kEof:\n        return false;\n\n      case '\\r':\n        if (PeekChar() == '\\n') {\n          ReadChar();\n        }\n        Newline();\n        return true;\n\n      case '\\n':\n        Newline();\n        return true;\n    }\n  }\n}\n\nvoid WastLexer::ReadWhitespace() {\n  while (true) {\n    switch (PeekChar()) {\n      case ' ':\n      case '\\t':\n      case '\\r':\n        ReadChar();\n        break;\n\n      case '\\n':\n        ReadChar();\n        Newline();\n        break;\n\n      default:\n        return;\n    }\n  }\n}\n\nToken WastLexer::GetStringToken(TokenType token_type) {\n  const char* saved_token_start = token_start_;\n  bool has_error = false;\n  bool in_string = true;\n  ReadChar();\n  while (in_string) {\n    switch (ReadChar()) {\n      case kEof:\n        return BareToken(TokenType::Eof);\n\n      case '\\n':\n        token_start_ = cursor_ - 1;\n        ERROR(\"newline in string\");\n        has_error = true;\n        Newline();\n        continue;\n\n      case '\"':\n        if (PeekChar() == '\"') {\n          ERROR(\"invalid string token\");\n          has_error = true;\n        }\n        in_string = false;\n        break;\n\n      case '\\\\': {\n        switch (ReadChar()) {\n          case 't':\n          case 'n':\n          case 'r':\n          case '\"':\n          case '\\'':\n          case '\\\\':\n            // Valid escape.\n            break;\n\n          case '0':\n          case '1':\n          case '2':\n          case '3':\n          case '4':\n          case '5':\n          case '6':\n          case '7':\n          case '8':\n          case '9':\n          case 'a':\n          case 'b':\n          case 'c':\n          case 'd':\n          case 'e':\n          case 'f':\n          case 'A':\n          case 'B':\n          case 'C':\n          case 'D':\n          case 'E':\n          case 'F':  // Hex byte escape.\n            if (IsHexDigit(PeekChar())) {\n              ReadChar();\n            } else {\n              token_start_ = cursor_ - 2;\n              goto error;\n            }\n            break;\n\n          case 'u': {\n            token_start_ = cursor_ - 2;\n            if (ReadChar() != '{') {\n              goto error;\n            }\n\n            // Value must be a valid unicode scalar value.\n            uint32_t digit;\n            uint32_t scalar_value = 0;\n\n            while (IsHexDigit(PeekChar())) {\n              ParseHexdigit(*cursor_++, &digit);\n\n              scalar_value = (scalar_value << 4) | digit;\n              // Maximum value of a unicode code point.\n              if (scalar_value >= 0x110000) {\n                goto error;\n              }\n            }\n\n            if (PeekChar() != '}') {\n              goto error;\n            }\n\n            // Scalars between 0xd800 and 0xdfff are not allowed.\n            if ((scalar_value >= 0xd800 && scalar_value < 0xe000) ||\n                token_start_ == cursor_ - 3) {\n              ReadChar();\n              goto error;\n            }\n            break;\n          }\n\n          default:\n            token_start_ = cursor_ - 2;\n            goto error;\n\n          error:\n            ERROR(\"bad escape \\\"%.*s\\\"\",\n                  static_cast<int>(cursor_ - token_start_), token_start_);\n            has_error = true;\n            break;\n        }\n        break;\n      }\n    }\n  }\n  token_start_ = saved_token_start;\n  if (has_error) {\n    return Token(GetLocation(), TokenType::Invalid);\n  }\n\n  return TextToken(token_type);\n}\n\n// static\nbool WastLexer::IsCharClass(int c, CharClass bit) {\n  // Generated by the following python script:\n  //\n  //   def Range(c, lo, hi): return lo <= c <= hi\n  //   def IsDigit(c): return Range(c, '0', '9')\n  //   def IsHexDigit(c): return IsDigit(c) or Range(c.lower(), 'a', 'f')\n  //   def IsKeyword(c): return Range(c, 'a', 'z')\n  //   def IsIdChar(c): return Range(c, '!', '~') and c not in '\"(),;[]{}'\n  //\n  //   print ([0] + [\n  //       (8 if IsDigit(c) else 0) |\n  //       (4 if IsHexDigit(c) else 0) |\n  //       (2 if IsKeyword(c) else 0) |\n  //       (1 if IsIdChar(c) else 0)\n  //       for c in map(chr, range(0, 127))\n  //   ])\n  static const char kCharClasses[257] = {\n      0,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,\n      0,  0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  1,  0,  1,  1,\n      1,  1,  1, 0, 0, 1, 1, 0, 1, 1, 1, 13, 13, 13, 13, 13, 13, 13, 13,\n      13, 13, 1, 0, 1, 1, 1, 1, 1, 5, 5, 5,  5,  5,  5,  1,  1,  1,  1,\n      1,  1,  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  1,  1,  1,  1,  0,  1,  0,\n      1,  1,  1, 7, 7, 7, 7, 7, 7, 3, 3, 3,  3,  3,  3,  3,  3,  3,  3,\n      3,  3,  3, 3, 3, 3, 3, 3, 3, 3, 0, 1,  0,  1,\n  };\n\n  assert(c >= -1 && c < 256);\n  return (kCharClasses[c + 1] & static_cast<int>(bit)) != 0;\n}\n\nbool WastLexer::ReadNum() {\n  if (IsDigit(PeekChar())) {\n    ReadChar();\n    return MatchChar('_') || IsDigit(PeekChar()) ? ReadNum() : true;\n  }\n  return false;\n}\n\nbool WastLexer::ReadHexNum() {\n  if (IsHexDigit(PeekChar())) {\n    ReadChar();\n    return MatchChar('_') || IsHexDigit(PeekChar()) ? ReadHexNum() : true;\n  }\n  return false;\n}\n\nWastLexer::ReservedChars WastLexer::ReadReservedChars() {\n  ReservedChars ret{ReservedChars::None};\n  while (true) {\n    auto peek = PeekChar();\n    if (IsIdChar(peek)) {\n      ReadChar();\n      if (ret == ReservedChars::None) {\n        ret = ReservedChars::Id;\n      }\n    } else if (peek == '\"') {\n      GetStringToken(TokenType::Text);\n      ret = ReservedChars::Some;\n    } else {\n      break;\n    }\n  }\n  return ret;\n}\n\nvoid WastLexer::ReadSign() {\n  if (PeekChar() == '+' || PeekChar() == '-') {\n    ReadChar();\n  }\n}\n\nToken WastLexer::GetNumberToken(TokenType token_type) {\n  if (ReadNum()) {\n    if (MatchChar('.')) {\n      token_type = TokenType::Float;\n      if (IsDigit(PeekChar()) && !ReadNum()) {\n        return GetReservedToken();\n      }\n    }\n    if (MatchChar('e') || MatchChar('E')) {\n      token_type = TokenType::Float;\n      ReadSign();\n      if (!ReadNum()) {\n        return GetReservedToken();\n      }\n    }\n    if (NoTrailingReservedChars()) {\n      if (token_type == TokenType::Float) {\n        return LiteralToken(token_type, LiteralType::Float);\n      } else {\n        return LiteralToken(token_type, LiteralType::Int);\n      }\n    }\n  }\n  return GetReservedToken();\n}\n\nToken WastLexer::GetHexNumberToken(TokenType token_type) {\n  if (ReadHexNum()) {\n    if (MatchChar('.')) {\n      token_type = TokenType::Float;\n      if (IsHexDigit(PeekChar()) && !ReadHexNum()) {\n        return GetReservedToken();\n      }\n    }\n    if (MatchChar('p') || MatchChar('P')) {\n      token_type = TokenType::Float;\n      ReadSign();\n      if (!ReadNum()) {\n        return GetReservedToken();\n      }\n    }\n    if (NoTrailingReservedChars()) {\n      if (token_type == TokenType::Float) {\n        return LiteralToken(token_type, LiteralType::Hexfloat);\n      } else {\n        return LiteralToken(token_type, LiteralType::Int);\n      }\n    }\n  }\n  return GetReservedToken();\n}\n\nToken WastLexer::GetInfToken() {\n  if (MatchString(\"inf\")) {\n    if (NoTrailingReservedChars()) {\n      return LiteralToken(TokenType::Float, LiteralType::Infinity);\n    }\n    return GetReservedToken();\n  }\n  return GetKeywordToken();\n}\n\nToken WastLexer::GetNanToken() {\n  if (MatchString(\"nan\")) {\n    if (MatchChar(':')) {\n      if (MatchString(\"0x\") && ReadHexNum() && NoTrailingReservedChars()) {\n        return LiteralToken(TokenType::Float, LiteralType::Nan);\n      }\n    } else if (NoTrailingReservedChars()) {\n      return LiteralToken(TokenType::Float, LiteralType::Nan);\n    }\n  }\n  return GetKeywordToken();\n}\n\nToken WastLexer::GetNameEqNumToken(std::string_view name,\n                                   TokenType token_type) {\n  if (MatchString(name)) {\n    if (MatchString(\"0x\")) {\n      if (ReadHexNum() && NoTrailingReservedChars()) {\n        return TextToken(token_type, name.size());\n      }\n    } else if (ReadNum() && NoTrailingReservedChars()) {\n      return TextToken(token_type, name.size());\n    }\n  }\n  return GetKeywordToken();\n}\n\nToken WastLexer::GetIdChars() {\n  if (ReadReservedChars() != ReservedChars::Some) {\n    return TextToken(TokenType::Var);\n  }\n\n  return TextToken(TokenType::Reserved);\n}\n\nToken WastLexer::GetKeywordToken() {\n  ReadReservedChars();\n  TokenInfo* info =\n      Perfect_Hash::InWordSet(token_start_, cursor_ - token_start_);\n  if (!info) {\n    return TextToken(TokenType::Reserved);\n  }\n  if (IsTokenTypeBare(info->token_type)) {\n    return BareToken(info->token_type);\n  } else if (IsTokenTypeType(info->token_type) ||\n             IsTokenTypeRefKind(info->token_type)) {\n    return Token(GetLocation(), info->token_type, info->value_type);\n  } else {\n    assert(IsTokenTypeOpcode(info->token_type));\n    return Token(GetLocation(), info->token_type, info->opcode);\n  }\n}\n\nToken WastLexer::GetReservedToken() {\n  ReadReservedChars();\n  return TextToken(TokenType::Reserved);\n}\n\nvoid WastLexer::Error(Location loc, const char* format, ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  errors_->emplace_back(ErrorLevel::Error, loc, buffer);\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/wast-parser.cc",
    "content": "/*\n * Copyright 2017 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/wast-parser.h\"\n\n#include \"wabt/binary-reader-ir.h\"\n#include \"wabt/binary-reader.h\"\n#include \"wabt/cast.h\"\n#include \"wabt/expr-visitor.h\"\n#include \"wabt/resolve-names.h\"\n#include \"wabt/stream.h\"\n#include \"wabt/utf8.h\"\n#include \"wabt/validator.h\"\n\n#define WABT_TRACING 0\n#include \"wabt/tracing.h\"\n\n#define EXPECT(token_type) CHECK_RESULT(Expect(TokenType::token_type))\n\nnamespace wabt {\n\nnamespace {\n\nstatic const size_t kMaxErrorTokenLength = 80;\n\nbool IsPowerOfTwo(Address x) {\n  return x && ((x & (x - 1)) == 0);\n}\n\ntemplate <typename OutputIter>\nvoid RemoveEscapes(std::string_view text, OutputIter dest) {\n  // Remove surrounding quotes; if any. This may be empty if the string was\n  // invalid (e.g. if it contained a bad escape sequence).\n  if (text.size() <= 2) {\n    return;\n  }\n\n  const char* src = text.data();\n  const char* end = text.data() + text.size() - 1;\n\n  // For identifiers, keep the starting $ character.\n  if (*src == '$') {\n    *dest++ = '$';\n    src++;\n  }\n  // Remove the starting quote. The loop below is correct\n  // even if this increase reaches the end of an invalid string.\n  src++;\n\n  while (src < end) {\n    if (*src == '\\\\') {\n      src++;\n      switch (*src) {\n        case 'n':\n          *dest++ = '\\n';\n          break;\n        case 'r':\n          *dest++ = '\\r';\n          break;\n        case 't':\n          *dest++ = '\\t';\n          break;\n        case '\\\\':\n          *dest++ = '\\\\';\n          break;\n        case '\\'':\n          *dest++ = '\\'';\n          break;\n        case '\\\"':\n          *dest++ = '\\\"';\n          break;\n        case 'u': {\n          // The string should be validated already,\n          // so this must be a valid unicode escape sequence.\n          uint32_t digit;\n          uint32_t scalar_value = 0;\n\n          // Skip u and { characters.\n          src += 2;\n\n          do {\n            if (Succeeded(ParseHexdigit(src[0], &digit))) {\n              scalar_value = (scalar_value << 4) | digit;\n            } else {\n              assert(0);\n            }\n            src++;\n          } while (src[0] != '}');\n\n          // Maximum value of a unicode scalar value\n          assert(scalar_value < 0x110000);\n\n          // Encode the unicode scalar value as UTF8 sequence\n          if (scalar_value < 0x80) {\n            *dest++ = static_cast<uint8_t>(scalar_value);\n          } else {\n            if (scalar_value < 0x800) {\n              *dest++ = static_cast<uint8_t>(0xc0 | (scalar_value >> 6));\n            } else {\n              if (scalar_value < 0x10000) {\n                *dest++ = static_cast<uint8_t>(0xe0 | (scalar_value >> 12));\n              } else {\n                *dest++ = static_cast<uint8_t>(0xf0 | (scalar_value >> 18));\n                *dest++ =\n                    static_cast<uint8_t>(0x80 | ((scalar_value >> 12) & 0x3f));\n              }\n\n              *dest++ =\n                  static_cast<uint8_t>(0x80 | ((scalar_value >> 6) & 0x3f));\n            }\n\n            *dest++ = static_cast<uint8_t>(0x80 | (scalar_value & 0x3f));\n          }\n          break;\n        }\n        default: {\n          // The string should be validated already, so we know this is a hex\n          // sequence.\n          uint32_t hi;\n          uint32_t lo;\n          if (Succeeded(ParseHexdigit(src[0], &hi)) &&\n              Succeeded(ParseHexdigit(src[1], &lo))) {\n            *dest++ = (hi << 4) | lo;\n          } else {\n            assert(0);\n          }\n          src++;\n          break;\n        }\n      }\n      src++;\n    } else {\n      *dest++ = *src++;\n    }\n  }\n}\n\nusing TextVector = std::vector<std::string_view>;\n\ntemplate <typename OutputIter>\nvoid RemoveEscapes(const TextVector& texts, OutputIter out) {\n  for (std::string_view text : texts)\n    RemoveEscapes(text, out);\n}\n\nbool IsPlainInstr(TokenType token_type) {\n  switch (token_type) {\n    case TokenType::Unreachable:\n    case TokenType::Nop:\n    case TokenType::Drop:\n    case TokenType::Select:\n    case TokenType::Br:\n    case TokenType::BrIf:\n    case TokenType::BrOnNonNull:\n    case TokenType::BrOnNull:\n    case TokenType::BrTable:\n    case TokenType::Return:\n    case TokenType::ReturnCall:\n    case TokenType::ReturnCallIndirect:\n    case TokenType::ReturnCallRef:\n    case TokenType::Call:\n    case TokenType::CallIndirect:\n    case TokenType::CallRef:\n    case TokenType::LocalGet:\n    case TokenType::LocalSet:\n    case TokenType::LocalTee:\n    case TokenType::GlobalGet:\n    case TokenType::GlobalSet:\n    case TokenType::Load:\n    case TokenType::Store:\n    case TokenType::Const:\n    case TokenType::Unary:\n    case TokenType::Binary:\n    case TokenType::Quaternary:\n    case TokenType::Compare:\n    case TokenType::Convert:\n    case TokenType::MemoryCopy:\n    case TokenType::DataDrop:\n    case TokenType::MemoryFill:\n    case TokenType::MemoryGrow:\n    case TokenType::MemoryInit:\n    case TokenType::MemorySize:\n    case TokenType::TableCopy:\n    case TokenType::ElemDrop:\n    case TokenType::TableInit:\n    case TokenType::TableGet:\n    case TokenType::TableSet:\n    case TokenType::TableGrow:\n    case TokenType::TableSize:\n    case TokenType::TableFill:\n    case TokenType::Throw:\n    case TokenType::ThrowRef:\n    case TokenType::Rethrow:\n    case TokenType::RefAsNonNull:\n    case TokenType::RefFunc:\n    case TokenType::RefNull:\n    case TokenType::RefIsNull:\n    case TokenType::AtomicLoad:\n    case TokenType::AtomicStore:\n    case TokenType::AtomicRmw:\n    case TokenType::AtomicRmwCmpxchg:\n    case TokenType::AtomicNotify:\n    case TokenType::AtomicFence:\n    case TokenType::AtomicWait:\n    case TokenType::Ternary:\n    case TokenType::SimdLaneOp:\n    case TokenType::SimdLoadLane:\n    case TokenType::SimdStoreLane:\n    case TokenType::SimdShuffleOp:\n      return true;\n    default:\n      return false;\n  }\n}\n\nbool IsBlockInstr(TokenType token_type) {\n  switch (token_type) {\n    case TokenType::Block:\n    case TokenType::Loop:\n    case TokenType::If:\n    case TokenType::Try:\n    case TokenType::TryTable:\n      return true;\n    default:\n      return false;\n  }\n}\n\nbool IsPlainOrBlockInstr(TokenType token_type) {\n  return IsPlainInstr(token_type) || IsBlockInstr(token_type);\n}\n\nbool IsExpr(TokenTypePair pair) {\n  return pair[0] == TokenType::Lpar && IsPlainOrBlockInstr(pair[1]);\n}\n\nbool IsInstr(TokenTypePair pair) {\n  return IsPlainOrBlockInstr(pair[0]) || IsExpr(pair);\n}\n\nbool IsLparAnn(TokenTypePair pair) {\n  return pair[0] == TokenType::LparAnn;\n}\n\nbool IsCatch(TokenType token_type) {\n  return token_type == TokenType::Catch || token_type == TokenType::CatchAll;\n}\n\nbool IsTryTableCatch(TokenTypePair pair) {\n  return pair[0] == TokenType::Lpar &&\n         (pair[1] == TokenType::Catch || pair[1] == TokenType::CatchAll ||\n          pair[1] == TokenType::CatchRef || pair[1] == TokenType::CatchAllRef);\n}\n\nbool IsModuleField(TokenTypePair pair) {\n  if (pair[0] != TokenType::Lpar) {\n    return false;\n  }\n\n  switch (pair[1]) {\n    case TokenType::Data:\n    case TokenType::Elem:\n    case TokenType::Tag:\n    case TokenType::Export:\n    case TokenType::Func:\n    case TokenType::Type:\n    case TokenType::Global:\n    case TokenType::Import:\n    case TokenType::Memory:\n    case TokenType::Start:\n    case TokenType::Table:\n      return true;\n    default:\n      return false;\n  }\n}\n\nbool IsCommand(TokenTypePair pair) {\n  if (pair[0] != TokenType::Lpar) {\n    return false;\n  }\n\n  switch (pair[1]) {\n    case TokenType::AssertException:\n    case TokenType::AssertExhaustion:\n    case TokenType::AssertInvalid:\n    case TokenType::AssertMalformed:\n    case TokenType::AssertReturn:\n    case TokenType::AssertTrap:\n    case TokenType::AssertUnlinkable:\n    case TokenType::Get:\n    case TokenType::Invoke:\n    case TokenType::Input:\n    case TokenType::Module:\n    case TokenType::Output:\n    case TokenType::Register:\n      return true;\n    default:\n      return false;\n  }\n}\n\nbool IsEmptySignature(const FuncSignature& sig) {\n  return sig.result_types.empty() && sig.param_types.empty();\n}\n\nbool ResolveFuncTypeWithEmptySignature(const Module& module,\n                                       FuncDeclaration* decl) {\n  // Resolve func type variables where the signature was not specified\n  // explicitly, e.g.: (func (type 1) ...)\n  if (decl->has_func_type && IsEmptySignature(decl->sig)) {\n    const FuncType* func_type = module.GetFuncType(decl->type_var);\n    if (func_type) {\n      decl->sig = func_type->sig;\n      return true;\n    }\n  }\n  return false;\n}\n\nvoid ResolveImplicitlyDefinedFunctionType(const Location& loc,\n                                          Module* module,\n                                          const FuncDeclaration& decl) {\n  // Resolve implicitly defined function types, e.g.: (func (param i32) ...)\n  if (!decl.has_func_type) {\n    Index func_type_index = module->GetFuncTypeIndex(decl.sig);\n    if (func_type_index == kInvalidIndex) {\n      auto func_type_field = std::make_unique<TypeModuleField>(loc);\n      auto func_type = std::make_unique<FuncType>();\n      func_type->sig = decl.sig;\n      func_type_field->type = std::move(func_type);\n      module->AppendField(std::move(func_type_field));\n    }\n  }\n}\n\nResult CheckTypeIndex(const Location& loc,\n                      Type actual,\n                      Type expected,\n                      const char* desc,\n                      Index index,\n                      const char* index_kind,\n                      Errors* errors) {\n  // Types must match exactly; no subtyping should be allowed.\n  if (actual != expected) {\n    errors->emplace_back(\n        ErrorLevel::Error, loc,\n        StringPrintf(\"type mismatch for %s %\" PRIindex\n                     \" of %s. got %s, expected %s\",\n                     index_kind, index, desc, actual.GetName().c_str(),\n                     expected.GetName().c_str()));\n    return Result::Error;\n  }\n  return Result::Ok;\n}\n\nResult CheckTypes(const Location& loc,\n                  const TypeVector& actual,\n                  const TypeVector& expected,\n                  const char* desc,\n                  const char* index_kind,\n                  Errors* errors) {\n  Result result = Result::Ok;\n  if (actual.size() == expected.size()) {\n    for (size_t i = 0; i < actual.size(); ++i) {\n      result |= CheckTypeIndex(loc, actual[i], expected[i], desc, i, index_kind,\n                               errors);\n    }\n  } else {\n    errors->emplace_back(\n        ErrorLevel::Error, loc,\n        StringPrintf(\"expected %\" PRIzd \" %ss, got %\" PRIzd, expected.size(),\n                     index_kind, actual.size()));\n    result = Result::Error;\n  }\n  return result;\n}\n\nResult CheckFuncTypeVarMatchesExplicit(const Location& loc,\n                                       const Module& module,\n                                       const FuncDeclaration& decl,\n                                       Errors* errors) {\n  Result result = Result::Ok;\n  if (decl.has_func_type) {\n    const FuncType* func_type = module.GetFuncType(decl.type_var);\n    if (func_type) {\n      result |=\n          CheckTypes(loc, decl.sig.result_types, func_type->sig.result_types,\n                     \"function\", \"result\", errors);\n      result |=\n          CheckTypes(loc, decl.sig.param_types, func_type->sig.param_types,\n                     \"function\", \"argument\", errors);\n    } else if (!(decl.sig.param_types.empty() &&\n                 decl.sig.result_types.empty())) {\n      // We want to check whether the function type at the explicit index\n      // matches the given param and result types. If they were omitted then\n      // they'll be resolved automatically (see\n      // ResolveFuncTypeWithEmptySignature), but if they are provided then we\n      // have to check. If we get here then the type var is invalid, so we\n      // can't check whether they match.\n      if (decl.type_var.is_index()) {\n        errors->emplace_back(ErrorLevel::Error, loc,\n                             StringPrintf(\"invalid func type index %\" PRIindex,\n                                          decl.type_var.index()));\n      } else {\n        errors->emplace_back(ErrorLevel::Error, loc,\n                             StringPrintf(\"expected func type identifier %s\",\n                                          decl.type_var.name().c_str()));\n      }\n      result = Result::Error;\n    }\n  }\n  return result;\n}\n\nbool IsInlinableFuncSignature(const FuncSignature& sig) {\n  return sig.GetNumParams() == 0 && sig.GetNumResults() <= 1;\n}\n\nclass ResolveFuncTypesExprVisitorDelegate : public ExprVisitor::DelegateNop {\n public:\n  explicit ResolveFuncTypesExprVisitorDelegate(Module* module, Errors* errors)\n      : module_(module), errors_(errors) {}\n\n  void ResolveBlockDeclaration(const Location& loc, BlockDeclaration* decl) {\n    ResolveFuncTypeWithEmptySignature(*module_, decl);\n    if (!IsInlinableFuncSignature(decl->sig)) {\n      ResolveImplicitlyDefinedFunctionType(loc, module_, *decl);\n    }\n  }\n\n  Result BeginBlockExpr(BlockExpr* expr) override {\n    ResolveBlockDeclaration(expr->loc, &expr->block.decl);\n    return CheckFuncTypeVarMatchesExplicit(expr->loc, *module_,\n                                           expr->block.decl, errors_);\n  }\n\n  Result BeginIfExpr(IfExpr* expr) override {\n    ResolveBlockDeclaration(expr->loc, &expr->true_.decl);\n    return CheckFuncTypeVarMatchesExplicit(expr->loc, *module_,\n                                           expr->true_.decl, errors_);\n  }\n\n  Result BeginLoopExpr(LoopExpr* expr) override {\n    ResolveBlockDeclaration(expr->loc, &expr->block.decl);\n    return CheckFuncTypeVarMatchesExplicit(expr->loc, *module_,\n                                           expr->block.decl, errors_);\n  }\n\n  Result BeginTryExpr(TryExpr* expr) override {\n    ResolveBlockDeclaration(expr->loc, &expr->block.decl);\n    return CheckFuncTypeVarMatchesExplicit(expr->loc, *module_,\n                                           expr->block.decl, errors_);\n  }\n\n  Result OnCallIndirectExpr(CallIndirectExpr* expr) override {\n    ResolveFuncTypeWithEmptySignature(*module_, &expr->decl);\n    ResolveImplicitlyDefinedFunctionType(expr->loc, module_, expr->decl);\n    return CheckFuncTypeVarMatchesExplicit(expr->loc, *module_, expr->decl,\n                                           errors_);\n  }\n\n  Result OnReturnCallIndirectExpr(ReturnCallIndirectExpr* expr) override {\n    ResolveFuncTypeWithEmptySignature(*module_, &expr->decl);\n    ResolveImplicitlyDefinedFunctionType(expr->loc, module_, expr->decl);\n    return CheckFuncTypeVarMatchesExplicit(expr->loc, *module_, expr->decl,\n                                           errors_);\n  }\n\n private:\n  Module* module_;\n  Errors* errors_;\n};\n\nResult ResolveFuncTypes(Module* module, Errors* errors) {\n  Result result = Result::Ok;\n  for (ModuleField& field : module->fields) {\n    Func* func = nullptr;\n    FuncDeclaration* decl = nullptr;\n    if (auto* func_field = dyn_cast<FuncModuleField>(&field)) {\n      func = &func_field->func;\n      decl = &func->decl;\n    } else if (auto* tag_field = dyn_cast<TagModuleField>(&field)) {\n      decl = &tag_field->tag.decl;\n    } else if (auto* import_field = dyn_cast<ImportModuleField>(&field)) {\n      if (auto* func_import =\n              dyn_cast<FuncImport>(import_field->import.get())) {\n        // Only check the declaration, not the function itself, since it is an\n        // import.\n        decl = &func_import->func.decl;\n      } else if (auto* tag_import =\n                     dyn_cast<TagImport>(import_field->import.get())) {\n        decl = &tag_import->tag.decl;\n      } else {\n        continue;\n      }\n    } else {\n      continue;\n    }\n\n    bool has_func_type_and_empty_signature = false;\n\n    if (decl) {\n      has_func_type_and_empty_signature =\n          ResolveFuncTypeWithEmptySignature(*module, decl);\n      ResolveImplicitlyDefinedFunctionType(field.loc, module, *decl);\n      result |=\n          CheckFuncTypeVarMatchesExplicit(field.loc, *module, *decl, errors);\n    }\n\n    if (func) {\n      if (has_func_type_and_empty_signature) {\n        // The call to ResolveFuncTypeWithEmptySignature may have updated the\n        // function signature so there are parameters. Since parameters and\n        // local variables share the same index space, we need to increment the\n        // local indexes bound to a given name by the number of parameters in\n        // the function.\n        for (auto& [name, binding] : func->bindings) {\n          binding.index += func->GetNumParams();\n        }\n      }\n\n      ResolveFuncTypesExprVisitorDelegate delegate(module, errors);\n      ExprVisitor visitor(&delegate);\n      result |= visitor.VisitFunc(func);\n    }\n  }\n  return result;\n}\n\nvoid AppendInlineExportFields(Module* module,\n                              ModuleFieldList* fields,\n                              Index index) {\n  Location last_field_loc = module->fields.back().loc;\n\n  for (ModuleField& field : *fields) {\n    auto* export_field = cast<ExportModuleField>(&field);\n    export_field->export_.var = Var(index, last_field_loc);\n  }\n\n  module->AppendFields(fields);\n}\n\n}  // End of anonymous namespace\n\nWastParser::WastParser(WastLexer* lexer,\n                       Errors* errors,\n                       WastParseOptions* options)\n    : lexer_(lexer), errors_(errors), options_(options) {}\n\nvoid WastParser::Error(Location loc, const char* format, ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  errors_->emplace_back(ErrorLevel::Error, loc, buffer);\n}\n\nToken WastParser::GetToken() {\n  if (tokens_.empty()) {\n    tokens_.push_back(lexer_->GetToken());\n  }\n  return tokens_.front();\n}\n\nLocation WastParser::GetLocation() {\n  return GetToken().loc;\n}\n\nTokenType WastParser::Peek(size_t n) {\n  assert(n <= 1);\n  while (tokens_.size() <= n) {\n    Token cur = lexer_->GetToken();\n    if (cur.token_type() != TokenType::LparAnn) {\n      tokens_.push_back(cur);\n    } else {\n      // Custom annotation. For now, discard until matching Rpar, unless it is\n      // a code metadata annotation or custom section. In those cases, we know\n      // how to parse it.\n      if (!options_->features.annotations_enabled()) {\n        Error(cur.loc, \"annotations not enabled: %s\", cur.to_string().c_str());\n        tokens_.push_back(Token(cur.loc, TokenType::Invalid));\n        continue;\n      }\n      if ((options_->features.code_metadata_enabled() &&\n           cur.text().find(\"metadata.code.\") == 0) ||\n          cur.text() == \"custom\") {\n        tokens_.push_back(cur);\n        continue;\n      }\n      int indent = 1;\n      while (indent > 0) {\n        cur = lexer_->GetToken();\n        switch (cur.token_type()) {\n          case TokenType::Lpar:\n          case TokenType::LparAnn:\n            indent++;\n            break;\n\n          case TokenType::Rpar:\n            indent--;\n            break;\n\n          case TokenType::Eof:\n            indent = 0;\n            Error(cur.loc, \"unterminated annotation\");\n            break;\n\n          default:\n            break;\n        }\n      }\n    }\n  }\n  return tokens_.at(n).token_type();\n}\n\nTokenTypePair WastParser::PeekPair() {\n  return TokenTypePair{{Peek(), Peek(1)}};\n}\n\nbool WastParser::PeekMatch(TokenType type, size_t n) {\n  return Peek(n) == type;\n}\n\nbool WastParser::PeekMatchLpar(TokenType type) {\n  return Peek() == TokenType::Lpar && Peek(1) == type;\n}\n\nbool WastParser::PeekMatchExpr() {\n  return IsExpr(PeekPair());\n}\n\nbool WastParser::PeekMatchRefType() {\n  return (options_->features.function_references_enabled() ||\n          options_->features.exceptions_enabled()) &&\n         PeekMatchLpar(TokenType::Ref);\n}\n\nbool WastParser::PeekMatchVar() {\n  TokenType token_type = Peek(0);\n  return token_type == TokenType::Nat || token_type == TokenType::Var;\n}\n\nbool WastParser::Match(TokenType type) {\n  if (PeekMatch(type)) {\n    Consume();\n    return true;\n  }\n  return false;\n}\n\nbool WastParser::MatchLpar(TokenType type) {\n  if (PeekMatchLpar(type)) {\n    Consume();\n    Consume();\n    return true;\n  }\n  return false;\n}\n\nResult WastParser::Expect(TokenType type) {\n  if (!Match(type)) {\n    Token token = Consume();\n    Error(token.loc, \"unexpected token %s, expected %s.\",\n          token.to_string_clamp(kMaxErrorTokenLength).c_str(),\n          GetTokenTypeName(type));\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nToken WastParser::Consume() {\n  assert(!tokens_.empty());\n  Token token = tokens_.front();\n  tokens_.pop_front();\n  return token;\n}\n\nResult WastParser::Synchronize(SynchronizeFunc func) {\n  static const int kMaxConsumed = 10;\n  for (int i = 0; i < kMaxConsumed; ++i) {\n    if (func(PeekPair())) {\n      return Result::Ok;\n    }\n\n    Token token = Consume();\n    if (token.token_type() == TokenType::Reserved) {\n      Error(token.loc, \"unexpected token %s.\",\n            token.to_string_clamp(kMaxErrorTokenLength).c_str());\n    }\n  }\n\n  return Result::Error;\n}\n\nvoid WastParser::ErrorUnlessOpcodeEnabled(const Token& token) {\n  Opcode opcode = token.opcode();\n  if (!opcode.IsEnabled(options_->features)) {\n    Error(token.loc, \"opcode not allowed: %s\", opcode.GetName());\n  }\n}\n\nResult WastParser::ErrorExpected(const std::vector<std::string>& expected,\n                                 const char* example) {\n  GetToken();\n  Token token = Consume();\n  std::string expected_str;\n  if (!expected.empty()) {\n    expected_str = \", expected \";\n    for (size_t i = 0; i < expected.size(); ++i) {\n      if (i != 0) {\n        if (i == expected.size() - 1) {\n          expected_str += \" or \";\n        } else {\n          expected_str += \", \";\n        }\n      }\n\n      expected_str += expected[i];\n    }\n\n    if (example) {\n      expected_str += \" (e.g. \";\n      expected_str += example;\n      expected_str += \")\";\n    }\n  }\n\n  Error(token.loc, \"unexpected token \\\"%s\\\"%s.\",\n        token.to_string_clamp(kMaxErrorTokenLength).c_str(),\n        expected_str.c_str());\n  return Result::Error;\n}\n\nResult WastParser::ErrorIfLpar(const std::vector<std::string>& expected,\n                               const char* example) {\n  if (Match(TokenType::Lpar)) {\n    return ErrorExpected(expected, example);\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseVarText(Token& token, std::string* out_text) {\n  // Parses and validates identifiers.\n  assert(token.token_type() == TokenType::Var);\n\n  if (token.text().length() >= 2) {\n    if (token.text()[1] != '\"') {\n      *out_text = std::string(token.text());\n      return Result::Ok;\n    }\n\n    if (!options_->features.annotations_enabled()) {\n      Error(token.loc,\n            \"quoted identifiers are not supported without annotations\");\n      return Result::Error;\n    }\n\n    RemoveEscapes(token.text(), std::back_inserter(*out_text));\n    size_t length = out_text->length();\n\n    if (length >= 2) {\n      if (!IsValidUtf8(out_text->data(), length)) {\n        Error(token.loc, \"quoted identifier has an invalid utf-8 encoding\");\n        return Result::Error;\n      }\n      return Result::Ok;\n    }\n  }\n\n  Error(token.loc, \"empty identifier.\");\n  return Result::Error;\n}\n\nResult WastParser::ParseBindVarOpt(std::string* name) {\n  WABT_TRACE(ParseBindVarOpt);\n  if (!PeekMatch(TokenType::Var)) {\n    return Result::Ok;\n  }\n  Token token = Consume();\n  return ParseVarText(token, name);\n}\n\nResult WastParser::ParseVar(Var* out_var) {\n  WABT_TRACE(ParseVar);\n  if (PeekMatch(TokenType::Nat)) {\n    Token token = Consume();\n    std::string_view sv = token.literal().text;\n    uint64_t index = kInvalidIndex;\n    if (Failed(ParseUint64(sv, &index))) {\n      // Print an error, but don't fail parsing.\n      Error(token.loc, \"invalid int \\\"\" PRIstringview \"\\\"\",\n            WABT_PRINTF_STRING_VIEW_ARG(sv));\n    }\n\n    *out_var = Var(index, token.loc);\n    return Result::Ok;\n  } else if (PeekMatch(TokenType::Var)) {\n    Token token = Consume();\n    if (token.text().length() >= 2 && token.text()[1] != '\"') {\n      *out_var = Var(token.text(), token.loc);\n      return Result::Ok;\n    }\n\n    std::string name;\n    CHECK_RESULT(ParseVarText(token, &name));\n    *out_var = Var(name, token.loc);\n    return Result::Ok;\n  } else {\n    return ErrorExpected({\"a numeric index\", \"a name\"}, \"12 or $foo\");\n  }\n}\n\nResult WastParser::ParseVarOpt(Var* out_var, Var default_var) {\n  WABT_TRACE(ParseVarOpt);\n  if (PeekMatchVar()) {\n    return ParseVar(out_var);\n  }\n\n  *out_var = default_var;\n  return Result::Ok;\n}\n\nResult WastParser::ParseOffsetExpr(ExprList* out_expr_list) {\n  WABT_TRACE(ParseOffsetExpr);\n  if (!ParseOffsetExprOpt(out_expr_list)) {\n    return ErrorExpected({\"an offset expr\"}, \"(i32.const 123)\");\n  }\n  return Result::Ok;\n}\n\nbool WastParser::ParseOffsetExprOpt(ExprList* out_expr_list) {\n  WABT_TRACE(ParseOffsetExprOpt);\n  if (MatchLpar(TokenType::Offset)) {\n    CHECK_RESULT(ParseTerminatingInstrList(out_expr_list));\n    EXPECT(Rpar);\n    return true;\n  } else if (PeekMatchExpr()) {\n    CHECK_RESULT(ParseExpr(out_expr_list));\n    return true;\n  } else {\n    return false;\n  }\n}\n\nResult WastParser::ParseTextList(std::vector<uint8_t>* out_data) {\n  WABT_TRACE(ParseTextList);\n  if (!ParseTextListOpt(out_data)) {\n    // TODO(binji): Add error message here.\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nbool WastParser::ParseTextListOpt(std::vector<uint8_t>* out_data) {\n  WABT_TRACE(ParseTextListOpt);\n  TextVector texts;\n  while (PeekMatch(TokenType::Text))\n    texts.push_back(Consume().text());\n\n  RemoveEscapes(texts, std::back_inserter(*out_data));\n  return !texts.empty();\n}\n\nResult WastParser::ParseVarList(VarVector* out_var_list) {\n  WABT_TRACE(ParseVarList);\n  Var var;\n  while (PeekMatchVar()) {\n    CHECK_RESULT(ParseVar(&var));\n    out_var_list->emplace_back(var);\n  }\n  if (out_var_list->empty()) {\n    return ErrorExpected({\"a var\"}, \"12 or $foo\");\n  } else {\n    return Result::Ok;\n  }\n}\n\nbool WastParser::ParseElemExprOpt(ExprList* out_elem_expr) {\n  WABT_TRACE(ParseElemExprOpt);\n  bool item = MatchLpar(TokenType::Item);\n  ExprList exprs;\n  if (item) {\n    if (ParseTerminatingInstrList(&exprs) != Result::Ok) {\n      return false;\n    }\n    EXPECT(Rpar);\n  } else {\n    if (!IsExpr(PeekPair()) || ParseExpr(&exprs) != Result::Ok) {\n      return false;\n    }\n  }\n  if (!exprs.size()) {\n    return false;\n  }\n  *out_elem_expr = std::move(exprs);\n  return true;\n}\n\nbool WastParser::ParseElemExprListOpt(ExprListVector* out_list) {\n  ExprList elem_expr;\n  while (ParseElemExprOpt(&elem_expr)) {\n    out_list->push_back(std::move(elem_expr));\n  }\n  return !out_list->empty();\n}\n\nResult WastParser::ParseElemExprVarListOpt(ExprListVector* out_list) {\n  WABT_TRACE(ParseElemExprVarListOpt);\n  Var var;\n  ExprList init_expr;\n  while (PeekMatchVar()) {\n    CHECK_RESULT(ParseVar(&var));\n    init_expr.push_back(std::make_unique<RefFuncExpr>(var));\n    out_list->push_back(std::move(init_expr));\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseRefDeclaration(Var* out_type) {\n  EXPECT(Lpar);\n  EXPECT(Ref);\n\n  Type::Enum opt_type = Type::Reference;\n\n  if (options_->features.function_references_enabled()) {\n    opt_type = Type::Ref;\n\n    if (Match(TokenType::Null)) {\n      opt_type = Type::RefNull;\n    }\n  }\n\n  if (PeekMatch(TokenType::Func) || PeekMatch(TokenType::Extern)) {\n    TokenType token = Consume().token_type();\n    out_type->set_opt_type(token == TokenType::Func ? Type::FuncRef\n                                                    : Type::ExternRef);\n    out_type->set_index(opt_type == Type::Ref ? Type::ReferenceNonNull\n                                              : Type::ReferenceOrNull);\n  } else {\n    CHECK_RESULT(ParseVar(out_type));\n    out_type->set_opt_type(opt_type);\n  }\n\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseValueType(Var* out_type) {\n  WABT_TRACE(ParseValueType);\n\n  if (PeekMatchRefType()) {\n    return ParseRefDeclaration(out_type);\n  }\n\n  if (!PeekMatch(TokenType::ValueType)) {\n    return ErrorExpected(\n        {\"i32\", \"i64\", \"f32\", \"f64\", \"v128\", \"externref\", \"exnref\", \"funcref\"});\n  }\n\n  Token token = Consume();\n  Type type = token.type();\n  bool is_enabled;\n  switch (type) {\n    case Type::V128:\n      is_enabled = options_->features.simd_enabled();\n      break;\n    case Type::FuncRef:\n    case Type::ExternRef:\n      is_enabled = options_->features.reference_types_enabled();\n      break;\n    case Type::ExnRef:\n      is_enabled = options_->features.exceptions_enabled();\n      break;\n    default:\n      is_enabled = true;\n      break;\n  }\n\n  if (!is_enabled) {\n    Error(token.loc, \"value type not allowed: %s\", type.GetName().c_str());\n    return Result::Error;\n  }\n\n  *out_type = Var(0, GetLocation());\n  out_type->set_opt_type(type);\n  return Result::Ok;\n}\n\nResult WastParser::ParseValueTypeList(TypeVector* out_type_list,\n                                      ReferenceVars* type_vars) {\n  WABT_TRACE(ParseValueTypeList);\n  while (true) {\n    if (!PeekMatchRefType() && !PeekMatch(TokenType::ValueType)) {\n      break;\n    }\n\n    Var type;\n    CHECK_RESULT(ParseValueType(&type));\n\n    if (type.is_index()) {\n      out_type_list->push_back(type.to_type());\n    } else {\n      assert(type.is_name());\n      assert(options_->features.function_references_enabled());\n      type_vars->push_back(ReferenceVar(out_type_list->size(), type));\n      out_type_list->push_back(Type(type.opt_type(), kInvalidIndex));\n    }\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseRefKind(Var* out_type) {\n  WABT_TRACE(ParseRefKind);\n\n  if (options_->features.function_references_enabled() &&\n      (PeekMatch(TokenType::Nat) || PeekMatch(TokenType::Var))) {\n    CHECK_RESULT(ParseVar(out_type));\n\n    out_type->set_opt_type(Type::RefNull);\n    return Result::Ok;\n  }\n\n  if (!IsTokenTypeRefKind(Peek())) {\n    return ErrorExpected({\"func\", \"extern\", \"exn\"});\n  }\n\n  Token token = Consume();\n  Type type = token.type();\n\n  if ((type == Type::ExternRef &&\n       !options_->features.reference_types_enabled()) ||\n      ((type == Type::Struct || type == Type::Array) &&\n       !options_->features.gc_enabled())) {\n    Error(token.loc, \"value type not allowed: %s\", type.GetName().c_str());\n    return Result::Error;\n  }\n\n  *out_type = Var(0, GetLocation());\n  out_type->set_opt_type(type);\n  return Result::Ok;\n}\n\nResult WastParser::ParseRefType(Var* out_type) {\n  WABT_TRACE(ParseRefType);\n  if (PeekMatchRefType()) {\n    return ParseRefDeclaration(out_type);\n  }\n\n  if (!PeekMatch(TokenType::ValueType)) {\n    return ErrorExpected({\"funcref\", \"externref\", \"exnref\"});\n  }\n\n  Token token = Consume();\n  Type type = token.type();\n  if (!CheckRefType(type)) {\n    Error(token.loc, \"value type not allowed: %s\", type.GetName().c_str());\n    return Result::Error;\n  }\n\n  *out_type = Var(0, GetLocation());\n  out_type->set_opt_type(type);\n  return Result::Ok;\n}\n\nbool WastParser::ParseRefTypeOpt(Var* out_type, Result& result) {\n  WABT_TRACE(ParseRefTypeOpt);\n\n  if (PeekMatchRefType()) {\n    result |= ParseRefDeclaration(out_type);\n    return true;\n  }\n\n  if (!PeekMatch(TokenType::ValueType)) {\n    return false;\n  }\n\n  Token token = Consume();\n  Type type = token.type();\n  if (!CheckRefType(type)) {\n    Error(token.loc, \"value type not allowed: %s\", type.GetName().c_str());\n    result = Result::Error;\n    return true;\n  }\n\n  *out_type = Var(0, GetLocation());\n  out_type->set_opt_type(type);\n  return true;\n}\n\nResult WastParser::ParseQuotedText(std::string* text, bool check_utf8) {\n  WABT_TRACE(ParseQuotedText);\n  if (!PeekMatch(TokenType::Text)) {\n    return ErrorExpected({\"a quoted string\"}, \"\\\"foo\\\"\");\n  }\n\n  Token token = Consume();\n  RemoveEscapes(token.text(), std::back_inserter(*text));\n  if (check_utf8 && !IsValidUtf8(text->data(), text->length())) {\n    Error(token.loc, \"quoted string has an invalid utf-8 encoding\");\n  }\n  return Result::Ok;\n}\n\nbool WastParser::ParseOffsetOpt(Address* out_offset) {\n  WABT_TRACE(ParseOffsetOpt);\n  if (PeekMatch(TokenType::OffsetEqNat)) {\n    Token token = Consume();\n    uint64_t offset64;\n    std::string_view sv = token.text();\n    if (Failed(ParseInt64(sv, &offset64, ParseIntType::SignedAndUnsigned))) {\n      Error(token.loc, \"invalid offset \\\"\" PRIstringview \"\\\"\",\n            WABT_PRINTF_STRING_VIEW_ARG(sv));\n    }\n    // With memory64, offsets > UINT32_MAX for i32 memories are no longer\n    // malformed (just invalid)\n    if ((!options_->features.memory64_enabled()) && (offset64 > UINT32_MAX)) {\n      Error(token.loc, \"offset must be less than or equal to 0xffffffff\");\n    }\n    *out_offset = offset64;\n    return true;\n  } else {\n    *out_offset = 0;\n    return false;\n  }\n}\n\nbool WastParser::ParseAlignOpt(Address* out_align) {\n  WABT_TRACE(ParseAlignOpt);\n  if (PeekMatch(TokenType::AlignEqNat)) {\n    Token token = Consume();\n    std::string_view sv = token.text();\n    if (Failed(ParseInt64(sv, out_align, ParseIntType::UnsignedOnly))) {\n      Error(token.loc, \"invalid alignment \\\"\" PRIstringview \"\\\"\",\n            WABT_PRINTF_STRING_VIEW_ARG(sv));\n    }\n\n    if (!IsPowerOfTwo(*out_align)) {\n      Error(token.loc, \"alignment must be power-of-two\");\n    }\n\n    return true;\n  } else {\n    *out_align = WABT_USE_NATURAL_ALIGNMENT;\n    return false;\n  }\n}\n\nResult WastParser::ParseMemidx(Location loc, Var* out_memidx) {\n  WABT_TRACE(ParseMemidx);\n  if (PeekMatchLpar(TokenType::Memory)) {\n    if (!options_->features.multi_memory_enabled()) {\n      Error(loc, \"Specifying memory variable is not allowed\");\n      return Result::Error;\n    }\n    EXPECT(Lpar);\n    EXPECT(Memory);\n    CHECK_RESULT(ParseVar(out_memidx));\n    EXPECT(Rpar);\n  } else {\n    if (PeekMatchVar() && !options_->features.multi_memory_enabled()) {\n      Error(loc, \"Specifying memory variable is not allowed\");\n      return Result::Error;\n    }\n    return ParseVarOpt(out_memidx, Var(0, loc));\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseLimitsIndex(Limits* out_limits) {\n  WABT_TRACE(ParseLimitsIndex);\n\n  if (PeekMatch(TokenType::ValueType)) {\n    if (GetToken().type() == Type::I64) {\n      Consume();\n      out_limits->is_64 = true;\n    } else if (GetToken().type() == Type::I32) {\n      Consume();\n      out_limits->is_64 = false;\n    }\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseLimits(Limits* out_limits) {\n  WABT_TRACE(ParseLimits);\n\n  CHECK_RESULT(ParseNat(&out_limits->initial, out_limits->is_64));\n  if (PeekMatch(TokenType::Nat)) {\n    CHECK_RESULT(ParseNat(&out_limits->max, out_limits->is_64));\n    out_limits->has_max = true;\n  } else {\n    out_limits->has_max = false;\n  }\n\n  if (Match(TokenType::Shared)) {\n    out_limits->is_shared = true;\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParsePageSize(uint32_t* out_page_size) {\n  WABT_TRACE(ParsePageSize);\n\n  Result result = Result::Ok;\n\n  if (PeekMatchLpar(TokenType::PageSize)) {\n    if (!options_->features.custom_page_sizes_enabled()) {\n      Error(GetLocation(), \"Specifying memory page size is not allowed\");\n      return Result::Error;\n    }\n    EXPECT(Lpar);\n    EXPECT(PageSize);\n    auto token = GetToken();\n    if (!token.HasLiteral()) {\n      Error(GetLocation(), \"malformed custom page size\");\n      return Result::Error;\n    }\n    auto sv = token.literal().text;\n    result |= ParseInt32(sv, out_page_size, ParseIntType::UnsignedOnly);\n    if (*out_page_size > UINT32_MAX || *out_page_size <= 0 ||\n        (*out_page_size & (*out_page_size - 1))) {\n      Error(GetLocation(), \"malformed custom page size\");\n      return Result::Error;\n    }\n    Consume();\n    EXPECT(Rpar);\n  }\n\n  return result;\n}\n\nResult WastParser::ParseNat(uint64_t* out_nat, bool is_64) {\n  WABT_TRACE(ParseNat);\n  if (!PeekMatch(TokenType::Nat)) {\n    return ErrorExpected({\"a natural number\"}, \"123\");\n  }\n\n  Token token = Consume();\n  std::string_view sv = token.literal().text;\n  if (Failed(ParseUint64(sv, out_nat)) || (!is_64 && *out_nat > 0xffffffffu)) {\n    Error(token.loc, \"invalid int \\\"\" PRIstringview \"\\\"\",\n          WABT_PRINTF_STRING_VIEW_ARG(sv));\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseModule(std::unique_ptr<Module>* out_module) {\n  WABT_TRACE(ParseModule);\n  auto module = std::make_unique<Module>();\n\n  if (PeekMatchLpar(TokenType::Module)) {\n    // Starts with \"(module\". Allow text and binary modules, but no quoted\n    // modules.\n    CommandPtr command;\n    CHECK_RESULT(ParseModuleCommand(nullptr, &command));\n    if (isa<ModuleCommand>(command.get())) {\n      auto module_command = cast<ModuleCommand>(std::move(command));\n      *module = std::move(module_command->module);\n    } else {\n      assert(isa<ScriptModuleCommand>(command.get()));\n      auto module_command = cast<ScriptModuleCommand>(std::move(command));\n      *module = std::move(module_command->module);\n    }\n  } else if (IsModuleField(PeekPair()) || PeekIsCustom()) {\n    // Parse an inline module (i.e. one with no surrounding (module)).\n    CHECK_RESULT(ParseModuleFieldList(module.get()));\n  } else if (PeekMatch(TokenType::Eof)) {\n    errors_->emplace_back(ErrorLevel::Warning, GetLocation(), \"empty module\");\n  } else {\n    ConsumeIfLpar();\n    ErrorExpected({\"a module field\", \"a module\"});\n  }\n\n  EXPECT(Eof);\n  if (!HasError()) {\n    *out_module = std::move(module);\n    return Result::Ok;\n  } else {\n    return Result::Error;\n  }\n}\n\nResult WastParser::ParseScript(std::unique_ptr<Script>* out_script) {\n  WABT_TRACE(ParseScript);\n  auto script = std::make_unique<Script>();\n\n  // Don't consume the Lpar yet, even though it is required. This way the\n  // sub-parser functions (e.g. ParseFuncModuleField) can consume it and keep\n  // the parsing structure more regular.\n  if (IsModuleField(PeekPair()) || PeekIsCustom()) {\n    // Parse an inline module (i.e. one with no surrounding (module)).\n    auto command = std::make_unique<ModuleCommand>();\n    command->module.loc = GetLocation();\n    CHECK_RESULT(ParseModuleFieldList(&command->module));\n    script->commands.emplace_back(std::move(command));\n  } else if (IsCommand(PeekPair())) {\n    CHECK_RESULT(ParseCommandList(script.get(), &script->commands));\n  } else if (PeekMatch(TokenType::Eof)) {\n    errors_->emplace_back(ErrorLevel::Warning, GetLocation(), \"empty script\");\n  } else {\n    ConsumeIfLpar();\n    ErrorExpected({\"a module field\", \"a command\"});\n  }\n\n  EXPECT(Eof);\n  if (!HasError()) {\n    *out_script = std::move(script);\n    return Result::Ok;\n  } else {\n    return Result::Error;\n  }\n}\n\nResult WastParser::ParseCustomSectionAnnotation(Module* module) {\n  WABT_TRACE(ParseCustomSectionAnnotation);\n  Location loc = GetLocation();\n  Token token = Consume();\n  if (token.text() != \"custom\") {\n    assert(\n        !\"ParseCustomSectionAnnotation should only be called if PeekIsCustom() is true\");\n    return Result::Error;\n  }\n  std::string section_name;\n  CHECK_RESULT(ParseQuotedText(&section_name));\n  if (Match(TokenType::Lpar)) {\n    if (!PeekMatch(TokenType::After) && !PeekMatch(TokenType::Before)) {\n      return ErrorExpected({\"before\", \"after\"});\n    }\n    Consume();\n    switch (Peek()) {\n      case TokenType::Function:\n      case TokenType::Type:\n      case TokenType::Import:\n      case TokenType::Export:\n      case TokenType::Table:\n      case TokenType::Global:\n      case TokenType::Elem:\n      case TokenType::Data:\n      case TokenType::Memory:\n      case TokenType::Code:\n      case TokenType::Start: {\n        Consume();\n        break;\n      }\n      default: {\n        return ErrorExpected({\"type\", \"import\", \"function\", \"table\", \"memory\",\n                              \"global\", \"export\", \"start\", \"elem\", \"code\",\n                              \"data\"});\n      }\n    }\n    EXPECT(Rpar);\n  }\n  std::vector<uint8_t> data;\n  CHECK_RESULT(ParseTextList(&data));\n  EXPECT(Rpar);\n\n  Custom custom = Custom(loc, section_name, data);\n  module->customs.push_back(custom);\n\n  return Result::Ok;\n}\n\nbool WastParser::PeekIsCustom() {\n  // If IsLparAnn succeeds, tokens_.front() must have text, as it is an LparAnn\n  // token.\n  return options_->features.annotations_enabled() && IsLparAnn(PeekPair()) &&\n         tokens_.front().text() == \"custom\";\n}\n\nResult WastParser::ResolveTargetRefType(const Module& module,\n                                        Type* type,\n                                        const Var& var,\n                                        Errors* errors) {\n  assert(type->IsReferenceWithIndex() && !var.is_index());\n\n  if (type->GetReferenceIndex() != kInvalidIndex) {\n    // Type has either a name or an absolute index. The former might\n    // be resolved earlier, and the latter does not need any resolving.\n    return Result::Ok;\n  }\n\n  Index type_index = module.type_bindings.FindIndex(var.name());\n\n  if (type_index != kInvalidIndex) {\n    *type = Type(static_cast<Type::Enum>(*type), type_index);\n    return Result::Ok;\n  }\n\n  errors->emplace_back(\n      ErrorLevel::Error, var.loc,\n      StringPrintf(\"undefined reference type name %s\", var.name().c_str()));\n  return Result::Ok;\n}\n\nResult WastParser::ResolveTargetTypeVector(const Module& module,\n                                           TypeVector* types,\n                                           ReferenceVars* ref_vars,\n                                           Errors* errors) {\n  Result result = Result::Ok;\n\n  for (auto& ref_var : *ref_vars) {\n    uint32_t index = ref_var.index;\n\n    // The index of resolved variables is converted to kInvalidIndex.\n    if (index == kInvalidIndex) {\n      continue;\n    }\n\n    ref_var.index = kInvalidIndex;\n\n    assert(index < types->size());\n    result |= ResolveTargetRefType(module, types->data() + index, ref_var.var,\n                                   errors);\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseModuleFieldList(Module* module) {\n  WABT_TRACE(ParseModuleFieldList);\n\n  // Reset module-specific state.\n  resolve_ref_types_.clear();\n  resolve_type_vectors_.clear();\n  resolve_funcs_.clear();\n\n  while (IsModuleField(PeekPair()) || PeekIsCustom()) {\n    if (PeekIsCustom()) {\n      CHECK_RESULT(ParseCustomSectionAnnotation(module));\n      continue;\n    }\n    if (Failed(ParseModuleField(module))) {\n      CHECK_RESULT(Synchronize(IsModuleField));\n    }\n  }\n\n  // Module parsing is completed, type names can be resolved now.\n  Result result = Result::Ok;\n\n  for (auto it : resolve_ref_types_) {\n    result |= ResolveTargetRefType(*module, it.target_type, it.var, errors_);\n  }\n\n  for (auto it : resolve_type_vectors_) {\n    result |=\n        ResolveTargetTypeVector(*module, it.target_vector, &it.vars, errors_);\n  }\n\n  for (auto it : resolve_funcs_) {\n    result |= ResolveTargetTypeVector(*module, &it.types, &it.vars, errors_);\n    it.target_func->local_types.Set(it.types);\n  }\n\n  CHECK_RESULT(result);\n  CHECK_RESULT(ResolveFuncTypes(module, errors_));\n  CHECK_RESULT(ResolveNamesModule(module, errors_));\n  return Result::Ok;\n}\n\nResult WastParser::ParseModuleField(Module* module) {\n  WABT_TRACE(ParseModuleField);\n  switch (Peek(1)) {\n    case TokenType::Data:   return ParseDataModuleField(module);\n    case TokenType::Elem:   return ParseElemModuleField(module);\n    case TokenType::Tag:    return ParseTagModuleField(module);\n    case TokenType::Export: return ParseExportModuleField(module);\n    case TokenType::Func:   return ParseFuncModuleField(module);\n    case TokenType::Type:   return ParseTypeModuleField(module);\n    case TokenType::Global: return ParseGlobalModuleField(module);\n    case TokenType::Import: return ParseImportModuleField(module);\n    case TokenType::Memory: return ParseMemoryModuleField(module);\n    case TokenType::Start:  return ParseStartModuleField(module);\n    case TokenType::Table:  return ParseTableModuleField(module);\n    default:\n      assert(\n          !\"ParseModuleField should only be called if IsModuleField() is true\");\n      return Result::Error;\n  }\n}\n\nResult WastParser::ParseDataModuleField(Module* module) {\n  WABT_TRACE(ParseDataModuleField);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Data);\n  std::string name;\n  CHECK_RESULT(ParseBindVarOpt(&name));\n  auto field = std::make_unique<DataSegmentModuleField>(loc, name);\n\n  if (PeekMatchLpar(TokenType::Memory)) {\n    EXPECT(Lpar);\n    EXPECT(Memory);\n    CHECK_RESULT(ParseVar(&field->data_segment.memory_var));\n    EXPECT(Rpar);\n    CHECK_RESULT(ParseOffsetExpr(&field->data_segment.offset));\n  } else if (PeekMatchVar()) {\n    CHECK_RESULT(ParseVar(&field->data_segment.memory_var));\n    CHECK_RESULT(ParseOffsetExpr(&field->data_segment.offset));\n  } else {\n    field->data_segment.memory_var = Var(0, loc);\n\n    if (!ParseOffsetExprOpt(&field->data_segment.offset)) {\n      if (!options_->features.bulk_memory_enabled()) {\n        Error(loc, \"passive data segments are not allowed\");\n        return Result::Error;\n      }\n\n      field->data_segment.kind = SegmentKind::Passive;\n    }\n  }\n\n  ParseTextListOpt(&field->data_segment.data);\n  EXPECT(Rpar);\n  module->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult WastParser::ParseElemModuleField(Module* module) {\n  WABT_TRACE(ParseElemModuleField);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Elem);\n\n  // With MVP text format the name here was intended to refer to the table\n  // that the elem segment was part of, but we never did anything with this name\n  // since there was only one table anyway.\n  // With bulk-memory enabled this introduces a new name for the particular\n  // elem segment.\n  std::string initial_name;\n  CHECK_RESULT(ParseBindVarOpt(&initial_name));\n\n  std::string segment_name = initial_name;\n  if (!options_->features.bulk_memory_enabled()) {\n    segment_name = \"\";\n  }\n  auto field = std::make_unique<ElemSegmentModuleField>(loc, segment_name);\n  if (options_->features.reference_types_enabled() &&\n      Match(TokenType::Declare)) {\n    field->elem_segment.kind = SegmentKind::Declared;\n  }\n\n  // Optional table specifier\n  if (options_->features.bulk_memory_enabled()) {\n    if (PeekMatchLpar(TokenType::Table)) {\n      EXPECT(Lpar);\n      EXPECT(Table);\n      CHECK_RESULT(ParseVar(&field->elem_segment.table_var));\n      EXPECT(Rpar);\n    } else {\n      CHECK_RESULT(ParseVarOpt(&field->elem_segment.table_var, Var(0, loc)));\n    }\n  } else {\n    if (!initial_name.empty()) {\n      field->elem_segment.table_var = Var(initial_name, loc);\n    } else {\n      CHECK_RESULT(ParseVarOpt(&field->elem_segment.table_var, Var(0, loc)));\n    }\n  }\n\n  // Parse offset expression, if not declared/passive segment.\n  if (options_->features.bulk_memory_enabled()) {\n    if (field->elem_segment.kind != SegmentKind::Declared &&\n        !ParseOffsetExprOpt(&field->elem_segment.offset)) {\n      field->elem_segment.kind = SegmentKind::Passive;\n    }\n  } else {\n    CHECK_RESULT(ParseOffsetExpr(&field->elem_segment.offset));\n  }\n\n  Result result;\n  Var elem_type;\n  if (ParseRefTypeOpt(&elem_type, result)) {\n    CHECK_RESULT(result);\n    VarToType(elem_type, &field->elem_segment.elem_type);\n    ParseElemExprListOpt(&field->elem_segment.elem_exprs);\n  } else {\n    field->elem_segment.elem_type =\n        Type(Type::FuncRef, options_->features.function_references_enabled()\n                                ? Type::ReferenceNonNull\n                                : Type::ReferenceOrNull);\n    if (PeekMatch(TokenType::Func)) {\n      EXPECT(Func);\n    }\n    CHECK_RESULT(ParseElemExprVarListOpt(&field->elem_segment.elem_exprs));\n  }\n  EXPECT(Rpar);\n  module->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult WastParser::ParseTagModuleField(Module* module) {\n  WABT_TRACE(ParseTagModuleField);\n  if (!options_->features.exceptions_enabled()) {\n    Error(Consume().loc, \"tag not allowed\");\n    return Result::Error;\n  }\n  EXPECT(Lpar);\n  EXPECT(Tag);\n  Location loc = GetLocation();\n\n  std::string name;\n  CHECK_RESULT(ParseBindVarOpt(&name));\n\n  ModuleFieldList export_fields;\n  CHECK_RESULT(ParseInlineExports(&export_fields, ExternalKind::Tag));\n\n  if (PeekMatchLpar(TokenType::Import)) {\n    CheckImportOrdering(module);\n    auto import = std::make_unique<TagImport>(name);\n    Tag& tag = import->tag;\n    CHECK_RESULT(ParseInlineImport(import.get()));\n    CHECK_RESULT(ParseTypeUseOpt(&tag.decl));\n    CHECK_RESULT(ParseUnboundFuncSignature(&tag.decl.sig));\n    CHECK_RESULT(ErrorIfLpar({\"type\", \"param\", \"result\"}));\n    auto field =\n        std::make_unique<ImportModuleField>(std::move(import), GetLocation());\n    module->AppendField(std::move(field));\n  } else {\n    auto field = std::make_unique<TagModuleField>(loc, name);\n    CHECK_RESULT(ParseTypeUseOpt(&field->tag.decl));\n    CHECK_RESULT(ParseUnboundFuncSignature(&field->tag.decl.sig));\n    module->AppendField(std::move(field));\n  }\n\n  AppendInlineExportFields(module, &export_fields, module->tags.size() - 1);\n\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseExportModuleField(Module* module) {\n  WABT_TRACE(ParseExportModuleField);\n  EXPECT(Lpar);\n  auto field = std::make_unique<ExportModuleField>(GetLocation());\n  EXPECT(Export);\n  CHECK_RESULT(ParseQuotedText(&field->export_.name));\n  CHECK_RESULT(ParseExportDesc(&field->export_));\n  EXPECT(Rpar);\n  module->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult WastParser::ParseFuncModuleField(Module* module) {\n  WABT_TRACE(ParseFuncModuleField);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Func);\n  std::string name;\n  CHECK_RESULT(ParseBindVarOpt(&name));\n\n  ModuleFieldList export_fields;\n  CHECK_RESULT(ParseInlineExports(&export_fields, ExternalKind::Func));\n\n  if (PeekMatchLpar(TokenType::Import)) {\n    CheckImportOrdering(module);\n    auto import = std::make_unique<FuncImport>(name);\n    Func& func = import->func;\n    CHECK_RESULT(ParseInlineImport(import.get()));\n    CHECK_RESULT(ParseTypeUseOpt(&func.decl));\n    CHECK_RESULT(ParseFuncSignature(&func.decl.sig, &func.bindings));\n    CHECK_RESULT(ErrorIfLpar({\"type\", \"param\", \"result\"}));\n    auto field =\n        std::make_unique<ImportModuleField>(std::move(import), GetLocation());\n    module->AppendField(std::move(field));\n  } else {\n    auto field = std::make_unique<FuncModuleField>(loc, name);\n    Func& func = field->func;\n    func.loc = GetLocation();\n    CHECK_RESULT(ParseTypeUseOpt(&func.decl));\n    CHECK_RESULT(ParseFuncSignature(&func.decl.sig, &func.bindings));\n\n    ResolveFunc references(&func);\n\n    CHECK_RESULT(ParseBoundValueTypeList(TokenType::Local, &references.types,\n                                         &func.bindings, &references.vars,\n                                         func.GetNumParams()));\n\n    if (references.vars.empty()) {\n      // No named references in the list, local types can be processed now.\n      func.local_types.Set(references.types);\n    } else {\n      resolve_funcs_.push_back(references);\n    }\n\n    CHECK_RESULT(ParseTerminatingInstrList(&func.exprs));\n    module->AppendField(std::move(field));\n  }\n\n  AppendInlineExportFields(module, &export_fields, module->funcs.size() - 1);\n\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseTypeModuleField(Module* module) {\n  WABT_TRACE(ParseTypeModuleField);\n  EXPECT(Lpar);\n  auto field = std::make_unique<TypeModuleField>(GetLocation());\n  EXPECT(Type);\n\n  std::string name;\n  CHECK_RESULT(ParseBindVarOpt(&name));\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n\n  if (Match(TokenType::Func)) {\n    auto func_type = std::make_unique<FuncType>(name);\n    BindingHash bindings;\n    CHECK_RESULT(ParseFuncSignature(&func_type->sig, &bindings));\n    CHECK_RESULT(ErrorIfLpar({\"param\", \"result\"}));\n    field->type = std::move(func_type);\n  } else if (Match(TokenType::Struct)) {\n    if (!options_->features.gc_enabled()) {\n      Error(loc, \"struct not allowed\");\n      return Result::Error;\n    }\n    auto struct_type = std::make_unique<StructType>(name);\n    CHECK_RESULT(ParseFieldList(&struct_type->fields));\n    field->type = std::move(struct_type);\n  } else if (Match(TokenType::Array)) {\n    if (!options_->features.gc_enabled()) {\n      Error(loc, \"array type not allowed\");\n    }\n    auto array_type = std::make_unique<ArrayType>(name);\n    CHECK_RESULT(ParseField(&array_type->field));\n    field->type = std::move(array_type);\n  } else {\n    return ErrorExpected({\"func\", \"struct\", \"array\"});\n  }\n\n  EXPECT(Rpar);\n  EXPECT(Rpar);\n  module->AppendField(std::move(field));\n  return Result::Ok;\n}\n\nResult WastParser::ParseField(Field* field) {\n  WABT_TRACE(ParseField);\n  auto parse_mut_valuetype = [&]() -> Result {\n    // TODO: Share with ParseGlobalType?\n    if (MatchLpar(TokenType::Mut)) {\n      field->mutable_ = true;\n      Var type;\n      CHECK_RESULT(ParseValueType(&type));\n      field->type = Type(type.opt_type());\n      EXPECT(Rpar);\n    } else {\n      field->mutable_ = false;\n      Var type;\n      CHECK_RESULT(ParseValueType(&type));\n      field->type = Type(type.opt_type());\n    }\n    return Result::Ok;\n  };\n\n  if (MatchLpar(TokenType::Field)) {\n    CHECK_RESULT(ParseBindVarOpt(&field->name));\n    CHECK_RESULT(parse_mut_valuetype());\n    EXPECT(Rpar);\n  } else {\n    CHECK_RESULT(parse_mut_valuetype());\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseFieldList(std::vector<Field>* fields) {\n  WABT_TRACE(ParseFieldList);\n  while (PeekMatch(TokenType::ValueType) || PeekMatch(TokenType::Lpar)) {\n    Field field;\n    CHECK_RESULT(ParseField(&field));\n    fields->push_back(field);\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseGlobalModuleField(Module* module) {\n  WABT_TRACE(ParseGlobalModuleField);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Global);\n  std::string name;\n  CHECK_RESULT(ParseBindVarOpt(&name));\n\n  ModuleFieldList export_fields;\n  CHECK_RESULT(ParseInlineExports(&export_fields, ExternalKind::Global));\n\n  if (PeekMatchLpar(TokenType::Import)) {\n    CheckImportOrdering(module);\n    auto import = std::make_unique<GlobalImport>(name);\n    CHECK_RESULT(ParseInlineImport(import.get()));\n    CHECK_RESULT(ParseGlobalType(&import->global));\n    auto field =\n        std::make_unique<ImportModuleField>(std::move(import), GetLocation());\n    module->AppendField(std::move(field));\n  } else {\n    auto field = std::make_unique<GlobalModuleField>(loc, name);\n    CHECK_RESULT(ParseGlobalType(&field->global));\n    CHECK_RESULT(ParseTerminatingInstrList(&field->global.init_expr));\n    module->AppendField(std::move(field));\n  }\n\n  AppendInlineExportFields(module, &export_fields, module->globals.size() - 1);\n\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseImportModuleField(Module* module) {\n  WABT_TRACE(ParseImportModuleField);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  CheckImportOrdering(module);\n  EXPECT(Import);\n  std::string module_name;\n  std::string field_name;\n  CHECK_RESULT(ParseQuotedText(&module_name));\n  CHECK_RESULT(ParseQuotedText(&field_name));\n  EXPECT(Lpar);\n\n  std::unique_ptr<ImportModuleField> field;\n  std::string name;\n\n  switch (Peek()) {\n    case TokenType::Func: {\n      Consume();\n      CHECK_RESULT(ParseBindVarOpt(&name));\n      auto import = std::make_unique<FuncImport>(name);\n      CHECK_RESULT(ParseTypeUseOpt(&import->func.decl));\n      CHECK_RESULT(\n          ParseFuncSignature(&import->func.decl.sig, &import->func.bindings));\n      CHECK_RESULT(ErrorIfLpar({\"param\", \"result\"}));\n      EXPECT(Rpar);\n      field = std::make_unique<ImportModuleField>(std::move(import), loc);\n      break;\n    }\n\n    case TokenType::Table: {\n      Consume();\n      CHECK_RESULT(ParseBindVarOpt(&name));\n      auto import = std::make_unique<TableImport>(name);\n      CHECK_RESULT(ParseLimitsIndex(&import->table.elem_limits));\n      CHECK_RESULT(ParseLimits(&import->table.elem_limits));\n      Var elem_type;\n      CHECK_RESULT(ParseRefType(&elem_type));\n      VarToType(elem_type, &import->table.elem_type);\n      EXPECT(Rpar);\n      field = std::make_unique<ImportModuleField>(std::move(import), loc);\n      break;\n    }\n\n    case TokenType::Memory: {\n      Consume();\n      CHECK_RESULT(ParseBindVarOpt(&name));\n      auto import = std::make_unique<MemoryImport>(name);\n      import->memory.page_size = WABT_DEFAULT_PAGE_SIZE;\n      CHECK_RESULT(ParseLimitsIndex(&import->memory.page_limits));\n      CHECK_RESULT(ParseLimits(&import->memory.page_limits));\n      CHECK_RESULT(ParsePageSize(&import->memory.page_size));\n      EXPECT(Rpar);\n      field = std::make_unique<ImportModuleField>(std::move(import), loc);\n      break;\n    }\n\n    case TokenType::Global: {\n      Consume();\n      CHECK_RESULT(ParseBindVarOpt(&name));\n      auto import = std::make_unique<GlobalImport>(name);\n      CHECK_RESULT(ParseGlobalType(&import->global));\n      EXPECT(Rpar);\n      field = std::make_unique<ImportModuleField>(std::move(import), loc);\n      break;\n    }\n\n    case TokenType::Tag: {\n      Consume();\n      CHECK_RESULT(ParseBindVarOpt(&name));\n      auto import = std::make_unique<TagImport>(name);\n      CHECK_RESULT(ParseTypeUseOpt(&import->tag.decl));\n      CHECK_RESULT(ParseUnboundFuncSignature(&import->tag.decl.sig));\n      EXPECT(Rpar);\n      field = std::make_unique<ImportModuleField>(std::move(import), loc);\n      break;\n    }\n\n    default:\n      return ErrorExpected({\"an external kind\"});\n  }\n\n  field->import->module_name = module_name;\n  field->import->field_name = field_name;\n\n  module->AppendField(std::move(field));\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseMemoryModuleField(Module* module) {\n  WABT_TRACE(ParseMemoryModuleField);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Memory);\n  std::string name;\n  CHECK_RESULT(ParseBindVarOpt(&name));\n\n  ModuleFieldList export_fields;\n  CHECK_RESULT(ParseInlineExports(&export_fields, ExternalKind::Memory));\n\n  if (PeekMatchLpar(TokenType::Import)) {\n    CheckImportOrdering(module);\n    auto import = std::make_unique<MemoryImport>(name);\n    import->memory.page_size = WABT_DEFAULT_PAGE_SIZE;\n    CHECK_RESULT(ParseInlineImport(import.get()));\n    CHECK_RESULT(ParseLimitsIndex(&import->memory.page_limits));\n    CHECK_RESULT(ParseLimits(&import->memory.page_limits));\n    CHECK_RESULT(ParsePageSize(&import->memory.page_size));\n    auto field =\n        std::make_unique<ImportModuleField>(std::move(import), GetLocation());\n    module->AppendField(std::move(field));\n  } else {\n    auto field = std::make_unique<MemoryModuleField>(loc, name);\n    field->memory.page_size = WABT_DEFAULT_PAGE_SIZE;\n    CHECK_RESULT(ParseLimitsIndex(&field->memory.page_limits));\n    if (PeekMatchLpar(TokenType::PageSize)) {\n      // this is the data abbreviation (no limits)\n      CHECK_RESULT(ParsePageSize(&field->memory.page_size));\n      if (!PeekMatchLpar(TokenType::Data)) {\n        ConsumeIfLpar();\n        return ErrorExpected({\"inline data segment\"});\n      }\n    }\n    if (MatchLpar(TokenType::Data)) {\n      auto data_segment_field = std::make_unique<DataSegmentModuleField>(loc);\n      DataSegment& data_segment = data_segment_field->data_segment;\n      data_segment.memory_var = Var(module->memories.size(), GetLocation());\n      data_segment.offset.push_back(std::make_unique<ConstExpr>(\n          field->memory.page_limits.is_64 ? Const::I64(0) : Const::I32(0)));\n      data_segment.offset.back().loc = loc;\n      ParseTextListOpt(&data_segment.data);\n      EXPECT(Rpar);\n\n      uint32_t num_pages = WABT_BYTES_TO_MIN_PAGES(data_segment.data.size(),\n                                                   field->memory.page_size);\n      field->memory.page_limits.initial = num_pages;\n      field->memory.page_limits.max = num_pages;\n      field->memory.page_limits.has_max = true;\n\n      module->AppendField(std::move(field));\n      module->AppendField(std::move(data_segment_field));\n    } else {\n      CHECK_RESULT(ParseLimits(&field->memory.page_limits));\n      CHECK_RESULT(ParsePageSize(&field->memory.page_size));\n      module->AppendField(std::move(field));\n    }\n  }\n\n  AppendInlineExportFields(module, &export_fields, module->memories.size() - 1);\n\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseStartModuleField(Module* module) {\n  WABT_TRACE(ParseStartModuleField);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  if (module->starts.size() > 0) {\n    Error(loc, \"multiple start sections\");\n    return Result::Error;\n  }\n  EXPECT(Start);\n  Var var;\n  CHECK_RESULT(ParseVar(&var));\n  EXPECT(Rpar);\n  module->AppendField(std::make_unique<StartModuleField>(var, loc));\n  return Result::Ok;\n}\n\nResult WastParser::ParseTableModuleField(Module* module) {\n  WABT_TRACE(ParseTableModuleField);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Table);\n  std::string name;\n  CHECK_RESULT(ParseBindVarOpt(&name));\n\n  ModuleFieldList export_fields;\n  CHECK_RESULT(ParseInlineExports(&export_fields, ExternalKind::Table));\n\n  if (PeekMatchLpar(TokenType::Import)) {\n    CheckImportOrdering(module);\n    auto import = std::make_unique<TableImport>(name);\n    CHECK_RESULT(ParseInlineImport(import.get()));\n    CHECK_RESULT(ParseLimitsIndex(&import->table.elem_limits));\n    CHECK_RESULT(ParseLimits(&import->table.elem_limits));\n    Var elem_type;\n    CHECK_RESULT(ParseRefType(&elem_type));\n    VarToType(elem_type, &import->table.elem_type);\n    auto field =\n        std::make_unique<ImportModuleField>(std::move(import), GetLocation());\n    module->AppendField(std::move(field));\n  } else {\n    auto field = std::make_unique<TableModuleField>(loc, name);\n    auto& table = field->table;\n    CHECK_RESULT(ParseLimitsIndex(&table.elem_limits));\n    if (PeekMatch(TokenType::ValueType) || PeekMatchRefType()) {\n      Var elem_type;\n      CHECK_RESULT(ParseRefType(&elem_type));\n\n      EXPECT(Lpar);\n      EXPECT(Elem);\n\n      auto elem_segment_field = std::make_unique<ElemSegmentModuleField>(loc);\n      ElemSegment& elem_segment = elem_segment_field->elem_segment;\n      elem_segment.table_var = Var(module->tables.size(), GetLocation());\n      auto offset = table.elem_limits.is_64 ? Const::I64(0) : Const::I32(0);\n      elem_segment.offset.push_back(std::make_unique<ConstExpr>(offset));\n      elem_segment.offset.back().loc = loc;\n      VarToType(elem_type, &elem_segment.elem_type);\n      // Syntax is either an optional list of var (legacy), or a non-empty list\n      // of elem expr.\n      ExprList elem_expr;\n      if (ParseElemExprOpt(&elem_expr)) {\n        elem_segment.elem_exprs.push_back(std::move(elem_expr));\n        // Parse the rest.\n        ParseElemExprListOpt(&elem_segment.elem_exprs);\n      } else {\n        CHECK_RESULT(ParseElemExprVarListOpt(&elem_segment.elem_exprs));\n      }\n      EXPECT(Rpar);\n\n      table.elem_limits.initial = elem_segment.elem_exprs.size();\n      table.elem_limits.max = elem_segment.elem_exprs.size();\n      table.elem_limits.has_max = true;\n      VarToType(elem_type, &table.elem_type);\n      module->AppendField(std::move(field));\n      module->AppendField(std::move(elem_segment_field));\n    } else {\n      CHECK_RESULT(ParseLimits(&table.elem_limits));\n      Var elem_type;\n      CHECK_RESULT(ParseRefType(&elem_type));\n      VarToType(elem_type, &table.elem_type);\n      if (PeekMatch(TokenType::Lpar)) {\n        CHECK_RESULT(ParseTerminatingInstrList(&table.init_expr));\n      }\n      module->AppendField(std::move(field));\n    }\n  }\n\n  AppendInlineExportFields(module, &export_fields, module->tables.size() - 1);\n\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseExportDesc(Export* export_) {\n  WABT_TRACE(ParseExportDesc);\n  EXPECT(Lpar);\n  switch (Peek()) {\n    case TokenType::Func:   export_->kind = ExternalKind::Func; break;\n    case TokenType::Table:  export_->kind = ExternalKind::Table; break;\n    case TokenType::Memory: export_->kind = ExternalKind::Memory; break;\n    case TokenType::Global: export_->kind = ExternalKind::Global; break;\n    case TokenType::Tag:    export_->kind = ExternalKind::Tag; break;\n    default:\n      return ErrorExpected({\"an external kind\"});\n  }\n  Consume();\n  CHECK_RESULT(ParseVar(&export_->var));\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseInlineExports(ModuleFieldList* fields,\n                                      ExternalKind kind) {\n  WABT_TRACE(ParseInlineExports);\n  while (PeekMatchLpar(TokenType::Export)) {\n    EXPECT(Lpar);\n    auto field = std::make_unique<ExportModuleField>(GetLocation());\n    field->export_.kind = kind;\n    EXPECT(Export);\n    CHECK_RESULT(ParseQuotedText(&field->export_.name));\n    EXPECT(Rpar);\n    fields->push_back(std::move(field));\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseInlineImport(Import* import) {\n  WABT_TRACE(ParseInlineImport);\n  EXPECT(Lpar);\n  EXPECT(Import);\n  CHECK_RESULT(ParseQuotedText(&import->module_name));\n  CHECK_RESULT(ParseQuotedText(&import->field_name));\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseTypeUseOpt(FuncDeclaration* decl) {\n  WABT_TRACE(ParseTypeUseOpt);\n  if (MatchLpar(TokenType::Type)) {\n    decl->has_func_type = true;\n    CHECK_RESULT(ParseVar(&decl->type_var));\n    EXPECT(Rpar);\n  } else {\n    decl->has_func_type = false;\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseFuncSignature(FuncSignature* sig,\n                                      BindingHash* param_bindings) {\n  WABT_TRACE(ParseFuncSignature);\n\n  ResolveTypeVector param_references(&sig->param_types);\n  ResolveTypeVector result_references(&sig->result_types);\n\n  CHECK_RESULT(ParseBoundValueTypeList(TokenType::Param, &sig->param_types,\n                                       param_bindings, &param_references.vars));\n  CHECK_RESULT(ParseResultList(&sig->result_types, &result_references.vars));\n\n  if (!param_references.vars.empty()) {\n    resolve_type_vectors_.push_back(param_references);\n  }\n\n  if (!result_references.vars.empty()) {\n    resolve_type_vectors_.push_back(result_references);\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseUnboundFuncSignature(FuncSignature* sig) {\n  WABT_TRACE(ParseUnboundFuncSignature);\n\n  ResolveTypeVector param_references(&sig->param_types);\n  ResolveTypeVector result_references(&sig->result_types);\n\n  CHECK_RESULT(ParseUnboundValueTypeList(TokenType::Param, &sig->param_types,\n                                         &param_references.vars));\n  CHECK_RESULT(ParseResultList(&sig->result_types, &result_references.vars));\n\n  if (!param_references.vars.empty()) {\n    resolve_type_vectors_.push_back(param_references);\n  }\n\n  if (!result_references.vars.empty()) {\n    resolve_type_vectors_.push_back(result_references);\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseBoundValueTypeList(TokenType token,\n                                           TypeVector* types,\n                                           BindingHash* bindings,\n                                           ReferenceVars* type_vars,\n                                           Index binding_index_offset) {\n  WABT_TRACE(ParseBoundValueTypeList);\n  while (MatchLpar(token)) {\n    if (PeekMatch(TokenType::Var)) {\n      std::string name;\n      Var type;\n      Location loc = GetLocation();\n      CHECK_RESULT(ParseBindVarOpt(&name));\n      CHECK_RESULT(ParseValueType(&type));\n      bindings->emplace(name,\n                        Binding(loc, binding_index_offset + types->size()));\n      if (type.is_index()) {\n        types->push_back(type.to_type());\n      } else {\n        assert(type.is_name());\n        assert(options_->features.function_references_enabled());\n        type_vars->push_back(ReferenceVar(types->size(), type));\n        types->push_back(Type(type.opt_type(), kInvalidIndex));\n      }\n    } else {\n      CHECK_RESULT(ParseValueTypeList(types, type_vars));\n    }\n    EXPECT(Rpar);\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseUnboundValueTypeList(TokenType token,\n                                             TypeVector* types,\n                                             ReferenceVars* type_vars) {\n  WABT_TRACE(ParseUnboundValueTypeList);\n  while (MatchLpar(token)) {\n    CHECK_RESULT(ParseValueTypeList(types, type_vars));\n    EXPECT(Rpar);\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseResultList(TypeVector* result_types,\n                                   ReferenceVars* type_vars) {\n  WABT_TRACE(ParseResultList);\n  return ParseUnboundValueTypeList(TokenType::Result, result_types, type_vars);\n}\n\nResult WastParser::ParseInstrList(ExprList* exprs) {\n  WABT_TRACE(ParseInstrList);\n  ExprList new_exprs;\n  while (true) {\n    auto pair = PeekPair();\n    if (IsInstr(pair)) {\n      if (Succeeded(ParseInstr(&new_exprs))) {\n        exprs->splice(exprs->end(), new_exprs);\n      } else {\n        CHECK_RESULT(Synchronize(IsInstr));\n      }\n    } else if (IsLparAnn(pair)) {\n      if (Succeeded(ParseCodeMetadataAnnotation(&new_exprs))) {\n        exprs->splice(exprs->end(), new_exprs);\n      } else {\n        CHECK_RESULT(Synchronize(IsLparAnn));\n      }\n    } else {\n      break;\n    }\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseTerminatingInstrList(ExprList* exprs) {\n  WABT_TRACE(ParseTerminatingInstrList);\n  Result result = ParseInstrList(exprs);\n  // An InstrList often has no further Lpar following it, because it would have\n  // gobbled it up. So if there is a following Lpar it is an error. If we\n  // handle it here we can produce a nicer error message.\n  CHECK_RESULT(ErrorIfLpar({\"an instr\"}));\n  return result;\n}\n\nResult WastParser::ParseInstr(ExprList* exprs) {\n  WABT_TRACE(ParseInstr);\n  if (IsPlainInstr(Peek())) {\n    std::unique_ptr<Expr> expr;\n    CHECK_RESULT(ParsePlainInstr(&expr));\n    exprs->push_back(std::move(expr));\n    return Result::Ok;\n  } else if (IsBlockInstr(Peek())) {\n    std::unique_ptr<Expr> expr;\n    CHECK_RESULT(ParseBlockInstr(&expr));\n    exprs->push_back(std::move(expr));\n    return Result::Ok;\n  } else if (PeekMatchExpr()) {\n    return ParseExpr(exprs);\n  } else {\n    assert(!\"ParseInstr should only be called when IsInstr() is true\");\n    return Result::Error;\n  }\n}\n\nResult WastParser::ParseCodeMetadataAnnotation(ExprList* exprs) {\n  WABT_TRACE(ParseCodeMetadataAnnotation);\n  Token tk = Consume();\n  std::string_view name = tk.text();\n  name.remove_prefix(sizeof(\"metadata.code.\") - 1);\n  std::string data_text;\n  CHECK_RESULT(ParseQuotedText(&data_text, false));\n  std::vector<uint8_t> data(data_text.begin(), data_text.end());\n  exprs->push_back(std::make_unique<CodeMetadataExpr>(name, std::move(data)));\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParsePlainInstrVar(Location loc,\n                                      std::unique_ptr<Expr>* out_expr) {\n  Var var;\n  CHECK_RESULT(ParseVar(&var));\n  out_expr->reset(new T(var, loc));\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParseMemoryInstrVar(Location loc,\n                                       std::unique_ptr<Expr>* out_expr) {\n  Var memidx;\n  Var var;\n  if (PeekMatchLpar(TokenType::Memory)) {\n    if (!options_->features.multi_memory_enabled()) {\n      Error(loc, \"Specifying memory variable is not allowed\");\n      return Result::Error;\n    }\n    CHECK_RESULT(ParseMemidx(loc, &memidx));\n    CHECK_RESULT(ParseVar(&var));\n    out_expr->reset(new T(var, memidx, loc));\n  } else {\n    CHECK_RESULT(ParseVar(&memidx));\n    if (PeekMatchVar()) {\n      CHECK_RESULT(ParseVar(&var));\n      if (!options_->features.multi_memory_enabled()) {\n        Error(loc, \"Specifiying memory variable is not allowed\");\n        return Result::Error;\n      }\n      out_expr->reset(new T(var, memidx, loc));\n    } else {\n      out_expr->reset(new T(memidx, Var(0, loc), loc));\n    }\n  }\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParseLoadStoreInstr(Location loc,\n                                       Token token,\n                                       std::unique_ptr<Expr>* out_expr) {\n  Opcode opcode = token.opcode();\n  Var memidx;\n  Address offset;\n  Address align;\n  CHECK_RESULT(ParseMemidx(loc, &memidx));\n  ParseOffsetOpt(&offset);\n  ParseAlignOpt(&align);\n  out_expr->reset(new T(opcode, memidx, align, offset, loc));\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParseSIMDLoadStoreInstr(Location loc,\n                                           Token token,\n                                           std::unique_ptr<Expr>* out_expr) {\n  ErrorUnlessOpcodeEnabled(token);\n\n  Var memidx(0, loc);\n\n  if (options_->features.multi_memory_enabled()) {\n    // We have to be a little careful when reading the memeory index.\n    // If there is just a single integer folloing the instruction that\n    // represents the lane index, so we check for either a pair of intergers\n    // or an integers followed by offset= or align=.\n    bool try_read_mem_index = true;\n    if (PeekMatch(TokenType::Nat)) {\n      // The next token could be a memory index or a lane index\n      if (!PeekMatch(TokenType::OffsetEqNat, 1) &&\n          !PeekMatch(TokenType::AlignEqNat, 1) &&\n          !PeekMatch(TokenType::Nat, 1)) {\n        try_read_mem_index = false;\n      }\n    }\n    if (try_read_mem_index) {\n      CHECK_RESULT(ParseMemidx(loc, &memidx));\n    }\n  }\n  Address offset;\n  Address align;\n  ParseOffsetOpt(&offset);\n  ParseAlignOpt(&align);\n\n  uint64_t lane_idx = 0;\n  Result result = ParseSimdLane(loc, &lane_idx);\n\n  if (Failed(result)) {\n    return Result::Error;\n  }\n\n  out_expr->reset(new T(token.opcode(), memidx, align, offset, lane_idx, loc));\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParseMemoryExpr(Location loc,\n                                   std::unique_ptr<Expr>* out_expr) {\n  Var memidx;\n  CHECK_RESULT(ParseMemidx(loc, &memidx));\n  out_expr->reset(new T(memidx, loc));\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParseMemoryBinaryExpr(Location loc,\n                                         std::unique_ptr<Expr>* out_expr) {\n  Var destmemidx;\n  Var srcmemidx;\n  CHECK_RESULT(ParseMemidx(loc, &destmemidx));\n  CHECK_RESULT(ParseMemidx(loc, &srcmemidx));\n  out_expr->reset(new T(destmemidx, srcmemidx, loc));\n  return Result::Ok;\n}\n\nResult WastParser::ParseSimdLane(Location loc, uint64_t* lane_idx) {\n  if (!PeekMatch(TokenType::Nat) && !PeekMatch(TokenType::Int)) {\n    return ErrorExpected({\"a natural number in range [0, 32)\"});\n  }\n\n  Literal literal = Consume().literal();\n\n  Result result =\n      ParseInt64(literal.text, lane_idx, ParseIntType::UnsignedOnly);\n\n  if (Failed(result)) {\n    Error(loc, \"invalid literal \\\"\" PRIstringview \"\\\"\",\n          WABT_PRINTF_STRING_VIEW_ARG(literal.text));\n    return Result::Error;\n  }\n\n  // The valid range is only [0, 32), but it's only malformed if it can't\n  // fit in a byte.\n  if (*lane_idx > 255) {\n    Error(loc, \"lane index \\\"\" PRIstringview \"\\\" out-of-range [0, 32)\",\n          WABT_PRINTF_STRING_VIEW_ARG(literal.text));\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParsePlainInstr(std::unique_ptr<Expr>* out_expr) {\n  WABT_TRACE(ParsePlainInstr);\n  Location loc = GetLocation();\n  switch (Peek()) {\n    case TokenType::Unreachable:\n      Consume();\n      out_expr->reset(new UnreachableExpr(loc));\n      break;\n\n    case TokenType::Nop:\n      Consume();\n      out_expr->reset(new NopExpr(loc));\n      break;\n\n    case TokenType::Drop:\n      Consume();\n      out_expr->reset(new DropExpr(loc));\n      break;\n\n    case TokenType::Select: {\n      Consume();\n      auto expr = std::make_unique<SelectExpr>(loc);\n      ResolveTypeVector result_type(&expr->result_type);\n      if (options_->features.reference_types_enabled() &&\n          PeekMatchLpar(TokenType::Result)) {\n        CHECK_RESULT(ParseResultList(&expr->result_type, &result_type.vars));\n      }\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::Br:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<BrExpr>(loc, out_expr));\n      break;\n\n    case TokenType::BrIf:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<BrIfExpr>(loc, out_expr));\n      break;\n\n    case TokenType::BrOnNonNull:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<BrOnNonNullExpr>(loc, out_expr));\n      break;\n\n    case TokenType::BrOnNull:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<BrOnNullExpr>(loc, out_expr));\n      break;\n\n    case TokenType::BrTable: {\n      Consume();\n      auto expr = std::make_unique<BrTableExpr>(loc);\n      CHECK_RESULT(ParseVarList(&expr->targets));\n      expr->default_target = expr->targets.back();\n      expr->targets.pop_back();\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::Return:\n      Consume();\n      out_expr->reset(new ReturnExpr(loc));\n      break;\n\n    case TokenType::Call:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<CallExpr>(loc, out_expr));\n      break;\n\n    case TokenType::CallIndirect: {\n      Consume();\n      auto expr = std::make_unique<CallIndirectExpr>(loc);\n      CHECK_RESULT(ParseVarOpt(&expr->table, Var(0, loc)));\n      CHECK_RESULT(ParseTypeUseOpt(&expr->decl));\n      CHECK_RESULT(ParseUnboundFuncSignature(&expr->decl.sig));\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::CallRef: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      auto expr = std::make_unique<CallRefExpr>(loc);\n      CHECK_RESULT(ParseVar(&expr->sig_type));\n      expr->sig_type.set_opt_type(Type::RefNull);\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::ReturnCall:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParsePlainInstrVar<ReturnCallExpr>(loc, out_expr));\n      break;\n\n    case TokenType::ReturnCallIndirect: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      auto expr = std::make_unique<ReturnCallIndirectExpr>(loc);\n      CHECK_RESULT(ParseVarOpt(&expr->table, Var(0, loc)));\n      CHECK_RESULT(ParseTypeUseOpt(&expr->decl));\n      CHECK_RESULT(ParseUnboundFuncSignature(&expr->decl.sig));\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::ReturnCallRef: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      auto expr = std::make_unique<ReturnCallRefExpr>(loc);\n      CHECK_RESULT(ParseVar(&expr->sig_type));\n      expr->sig_type.set_opt_type(Type::RefNull);\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::LocalGet:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<LocalGetExpr>(loc, out_expr));\n      break;\n\n    case TokenType::LocalSet:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<LocalSetExpr>(loc, out_expr));\n      break;\n\n    case TokenType::LocalTee:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<LocalTeeExpr>(loc, out_expr));\n      break;\n\n    case TokenType::GlobalGet:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<GlobalGetExpr>(loc, out_expr));\n      break;\n\n    case TokenType::GlobalSet:\n      Consume();\n      CHECK_RESULT(ParsePlainInstrVar<GlobalSetExpr>(loc, out_expr));\n      break;\n\n    case TokenType::Load:\n      CHECK_RESULT(ParseLoadStoreInstr<LoadExpr>(loc, Consume(), out_expr));\n      break;\n\n    case TokenType::Store:\n      CHECK_RESULT(ParseLoadStoreInstr<StoreExpr>(loc, Consume(), out_expr));\n      break;\n\n    case TokenType::Const: {\n      Const const_;\n      CHECK_RESULT(ParseConst(&const_, ConstType::Normal));\n      out_expr->reset(new ConstExpr(const_, loc));\n      break;\n    }\n\n    case TokenType::Unary: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      out_expr->reset(new UnaryExpr(token.opcode(), loc));\n      break;\n    }\n\n    case TokenType::Binary: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      out_expr->reset(new BinaryExpr(token.opcode(), loc));\n      break;\n    }\n\n    case TokenType::Quaternary: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      out_expr->reset(new QuaternaryExpr(token.opcode(), loc));\n      break;\n    }\n\n    case TokenType::Compare:\n      out_expr->reset(new CompareExpr(Consume().opcode(), loc));\n      break;\n\n    case TokenType::Convert: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      out_expr->reset(new ConvertExpr(token.opcode(), loc));\n      break;\n    }\n\n    case TokenType::MemoryCopy:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParseMemoryBinaryExpr<MemoryCopyExpr>(loc, out_expr));\n      break;\n\n    case TokenType::MemoryFill:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParseMemoryExpr<MemoryFillExpr>(loc, out_expr));\n      break;\n\n    case TokenType::DataDrop:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParsePlainInstrVar<DataDropExpr>(loc, out_expr));\n      break;\n\n    case TokenType::MemoryInit:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParseMemoryInstrVar<MemoryInitExpr>(loc, out_expr));\n      break;\n\n    case TokenType::MemorySize:\n      Consume();\n      CHECK_RESULT(ParseMemoryExpr<MemorySizeExpr>(loc, out_expr));\n      break;\n\n    case TokenType::MemoryGrow:\n      Consume();\n      CHECK_RESULT(ParseMemoryExpr<MemoryGrowExpr>(loc, out_expr));\n      break;\n\n    case TokenType::TableCopy: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      Var dst(0, loc);\n      Var src(0, loc);\n      if (options_->features.reference_types_enabled()) {\n        CHECK_RESULT(ParseVarOpt(&dst, dst));\n        CHECK_RESULT(ParseVarOpt(&src, src));\n      }\n      out_expr->reset(new TableCopyExpr(dst, src, loc));\n      break;\n    }\n\n    case TokenType::ElemDrop:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParsePlainInstrVar<ElemDropExpr>(loc, out_expr));\n      break;\n\n    case TokenType::TableInit: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      Var segment_index(0, loc);\n      CHECK_RESULT(ParseVar(&segment_index));\n      Var table_index(0, loc);\n      if (PeekMatchVar()) {\n        CHECK_RESULT(ParseVar(&table_index));\n        // Here are the two forms:\n        //\n        //   table.init $elemidx ...\n        //   table.init $tableidx $elemidx ...\n        //\n        // So if both indexes are provided, we need to swap them.\n        std::swap(segment_index, table_index);\n      }\n      out_expr->reset(new TableInitExpr(segment_index, table_index, loc));\n      break;\n    }\n\n    case TokenType::TableGet: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      Var table_index(0, loc);\n      CHECK_RESULT(ParseVarOpt(&table_index, table_index));\n      out_expr->reset(new TableGetExpr(table_index, loc));\n      break;\n    }\n\n    case TokenType::TableSet: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      Var table_index(0, loc);\n      CHECK_RESULT(ParseVarOpt(&table_index, table_index));\n      out_expr->reset(new TableSetExpr(table_index, loc));\n      break;\n    }\n\n    case TokenType::TableGrow: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      Var table_index(0, loc);\n      CHECK_RESULT(ParseVarOpt(&table_index, table_index));\n      out_expr->reset(new TableGrowExpr(table_index, loc));\n      break;\n    }\n\n    case TokenType::TableSize: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      Var table_index(0, loc);\n      CHECK_RESULT(ParseVarOpt(&table_index, table_index));\n      out_expr->reset(new TableSizeExpr(table_index, loc));\n      break;\n    }\n\n    case TokenType::TableFill: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      Var table_index(0, loc);\n      CHECK_RESULT(ParseVarOpt(&table_index, table_index));\n      out_expr->reset(new TableFillExpr(table_index, loc));\n      break;\n    }\n\n    case TokenType::RefAsNonNull:\n      ErrorUnlessOpcodeEnabled(Consume());\n      out_expr->reset(new RefAsNonNullExpr(Opcode::RefAsNonNull, loc));\n      break;\n\n    case TokenType::RefFunc:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParsePlainInstrVar<RefFuncExpr>(loc, out_expr));\n      break;\n\n    case TokenType::RefNull: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      Var type;\n      CHECK_RESULT(ParseRefKind(&type));\n      out_expr->reset(new RefNullExpr(type, loc));\n      break;\n    }\n\n    case TokenType::RefIsNull:\n      ErrorUnlessOpcodeEnabled(Consume());\n      out_expr->reset(new RefIsNullExpr(loc));\n      break;\n\n    case TokenType::Throw:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParsePlainInstrVar<ThrowExpr>(loc, out_expr));\n      break;\n\n    case TokenType::ThrowRef:\n      ErrorUnlessOpcodeEnabled(Consume());\n      out_expr->reset(new ThrowRefExpr(loc));\n      break;\n\n    case TokenType::Rethrow:\n      ErrorUnlessOpcodeEnabled(Consume());\n      CHECK_RESULT(ParsePlainInstrVar<RethrowExpr>(loc, out_expr));\n      break;\n\n    case TokenType::AtomicNotify: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      CHECK_RESULT(ParseLoadStoreInstr<AtomicNotifyExpr>(loc, token, out_expr));\n      break;\n    }\n\n    case TokenType::AtomicFence: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      uint32_t consistency_model = 0x0;\n      out_expr->reset(new AtomicFenceExpr(consistency_model, loc));\n      break;\n    }\n\n    case TokenType::AtomicWait: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      CHECK_RESULT(ParseLoadStoreInstr<AtomicWaitExpr>(loc, token, out_expr));\n      break;\n    }\n\n    case TokenType::AtomicLoad: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      CHECK_RESULT(ParseLoadStoreInstr<AtomicLoadExpr>(loc, token, out_expr));\n      break;\n    }\n\n    case TokenType::AtomicStore: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      CHECK_RESULT(ParseLoadStoreInstr<AtomicStoreExpr>(loc, token, out_expr));\n      break;\n    }\n\n    case TokenType::AtomicRmw: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      CHECK_RESULT(ParseLoadStoreInstr<AtomicRmwExpr>(loc, token, out_expr));\n      break;\n    }\n\n    case TokenType::AtomicRmwCmpxchg: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      CHECK_RESULT(\n          ParseLoadStoreInstr<AtomicRmwCmpxchgExpr>(loc, token, out_expr));\n      break;\n    }\n\n    case TokenType::Ternary: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      out_expr->reset(new TernaryExpr(token.opcode(), loc));\n      break;\n    }\n\n    case TokenType::SimdLaneOp: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n\n      uint64_t lane_idx = 0;\n      Result result = ParseSimdLane(loc, &lane_idx);\n\n      if (Failed(result)) {\n        return Result::Error;\n      }\n\n      out_expr->reset(new SimdLaneOpExpr(token.opcode(), lane_idx, loc));\n      break;\n    }\n\n    case TokenType::SimdLoadLane: {\n      CHECK_RESULT(\n          ParseSIMDLoadStoreInstr<SimdLoadLaneExpr>(loc, Consume(), out_expr));\n      break;\n    }\n\n    case TokenType::SimdStoreLane: {\n      CHECK_RESULT(\n          ParseSIMDLoadStoreInstr<SimdStoreLaneExpr>(loc, Consume(), out_expr));\n      break;\n    }\n\n    case TokenType::SimdShuffleOp: {\n      Token token = Consume();\n      ErrorUnlessOpcodeEnabled(token);\n      v128 values;\n      for (int lane = 0; lane < 16; ++lane) {\n        Location loc = GetLocation();\n        uint64_t lane_idx;\n        Result result = ParseSimdLane(loc, &lane_idx);\n        if (Failed(result)) {\n          return Result::Error;\n        }\n\n        values.set_u8(lane, static_cast<uint8_t>(lane_idx));\n      }\n\n      out_expr->reset(new SimdShuffleOpExpr(token.opcode(), values, loc));\n      break;\n    }\n\n    default:\n      assert(\n          !\"ParsePlainInstr should only be called when IsPlainInstr() is true\");\n      return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseSimdV128Const(Const* const_,\n                                      TokenType token_type,\n                                      ConstType const_type) {\n  WABT_TRACE(ParseSimdV128Const);\n\n  uint8_t lane_count = 0;\n  bool integer = true;\n  switch (token_type) {\n    case TokenType::I8X16: { lane_count = 16; break; }\n    case TokenType::I16X8: { lane_count = 8; break; }\n    case TokenType::I32X4: { lane_count = 4; break; }\n    case TokenType::I64X2: { lane_count = 2; break; }\n    case TokenType::F32X4: { lane_count = 4; integer = false; break; }\n    case TokenType::F64X2: { lane_count = 2; integer = false; break; }\n    default: {\n      Error(const_->loc,\n            \"Unexpected type at start of simd constant. \"\n            \"Expected one of: i8x16, i16x8, i32x4, i64x2, f32x4, f64x2. \"\n            \"Found \\\"%s\\\".\",\n            GetTokenTypeName(token_type));\n      return Result::Error;\n    }\n  }\n  Consume();\n\n  const_->loc = GetLocation();\n\n  for (int lane = 0; lane < lane_count; ++lane) {\n    Location loc = GetLocation();\n\n    // Check that the lane literal type matches the element type of the v128:\n    Token token = GetToken();\n    switch (token.token_type()) {\n      case TokenType::Nat:\n      case TokenType::Int:\n        // OK.\n        break;\n\n      case TokenType::Float:\n      case TokenType::NanArithmetic:\n      case TokenType::NanCanonical:\n        if (integer) {\n          goto error;\n        }\n        break;\n\n      error:\n      default:\n        if (integer) {\n          return ErrorExpected({\"a Nat or Integer literal\"}, \"123\");\n        } else {\n          return ErrorExpected({\"a Float literal\"}, \"42.0\");\n        }\n    }\n\n    Result result;\n\n    // For each type, parse the next literal, bound check it, and write it to\n    // the array of bytes:\n    if (integer) {\n      std::string_view sv = Consume().literal().text;\n\n      switch (lane_count) {\n        case 16: {\n          uint8_t value = 0;\n          result = ParseInt8(sv, &value, ParseIntType::SignedAndUnsigned);\n          const_->set_v128_u8(lane, value);\n          break;\n        }\n        case 8: {\n          uint16_t value = 0;\n          result = ParseInt16(sv, &value, ParseIntType::SignedAndUnsigned);\n          const_->set_v128_u16(lane, value);\n          break;\n        }\n        case 4: {\n          uint32_t value = 0;\n          result = ParseInt32(sv, &value, ParseIntType::SignedAndUnsigned);\n          const_->set_v128_u32(lane, value);\n          break;\n        }\n        case 2: {\n          uint64_t value = 0;\n          result = ParseInt64(sv, &value, ParseIntType::SignedAndUnsigned);\n          const_->set_v128_u64(lane, value);\n          break;\n        }\n      }\n    } else {\n      Const lane_const_;\n      switch (lane_count) {\n        case 4:\n          result = ParseF32(&lane_const_, const_type);\n          const_->set_v128_f32(lane, lane_const_.f32_bits());\n          break;\n\n        case 2:\n          result = ParseF64(&lane_const_, const_type);\n          const_->set_v128_f64(lane, lane_const_.f64_bits());\n          break;\n      }\n\n      const_->set_expected_nan(lane, lane_const_.expected_nan());\n    }\n\n    if (Failed(result)) {\n      Error(loc, \"invalid literal \\\"%s\\\"\", token.to_string().c_str());\n      return Result::Error;\n    }\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseExpectedNan(ExpectedNan* expected) {\n  WABT_TRACE(ParseExpectedNan);\n  TokenType token_type = Peek();\n  switch (token_type) {\n    case TokenType::NanArithmetic:\n      *expected = ExpectedNan::Arithmetic;\n      break;\n    case TokenType::NanCanonical:\n      *expected = ExpectedNan::Canonical;\n      break;\n    default:\n      return Result::Error;\n  }\n  Consume();\n  return Result::Ok;\n}\n\nResult WastParser::ParseF32(Const* const_, ConstType const_type) {\n  ExpectedNan expected;\n  if (const_type == ConstType::Expectation &&\n      Succeeded(ParseExpectedNan(&expected))) {\n    const_->set_f32(expected);\n    return Result::Ok;\n  }\n\n  auto token = Consume();\n  if (!token.HasLiteral()) {\n    return Result::Error;\n  }\n\n  auto literal = token.literal();\n  uint32_t f32_bits = 0;\n  Result result = ParseFloat(literal.type, literal.text, &f32_bits);\n  const_->set_f32(f32_bits);\n  return result;\n}\n\nResult WastParser::ParseF64(Const* const_, ConstType const_type) {\n  ExpectedNan expected;\n  if (const_type == ConstType::Expectation &&\n      Succeeded(ParseExpectedNan(&expected))) {\n    const_->set_f64(expected);\n    return Result::Ok;\n  }\n\n  auto token = Consume();\n  if (!token.HasLiteral()) {\n    return Result::Error;\n  }\n\n  auto literal = token.literal();\n  uint64_t f64_bits = 0;\n  Result result = ParseDouble(literal.type, literal.text, &f64_bits);\n  const_->set_f64(f64_bits);\n  return result;\n}\n\nResult WastParser::ParseConst(Const* const_, ConstType const_type) {\n  WABT_TRACE(ParseConst);\n  Token opcode_token = Consume();\n  Opcode opcode = opcode_token.opcode();\n  const_->loc = GetLocation();\n  Token token = GetToken();\n\n  // V128 is fully handled by ParseSimdV128Const:\n  if (opcode != Opcode::V128Const) {\n    switch (token.token_type()) {\n      case TokenType::Nat:\n      case TokenType::Int:\n      case TokenType::Float:\n        // OK.\n        break;\n      case TokenType::NanArithmetic:\n      case TokenType::NanCanonical:\n        break;\n      default:\n        return ErrorExpected({\"a numeric literal\"}, \"123, -45, 6.7e8\");\n    }\n  }\n\n  Result result;\n  switch (opcode) {\n    case Opcode::I32Const: {\n      auto token = Consume();\n      if (!token.HasLiteral()) {\n        result = Result::Error;\n        break;\n      }\n      auto sv = token.literal().text;\n      uint32_t u32;\n      result = ParseInt32(sv, &u32, ParseIntType::SignedAndUnsigned);\n      const_->set_u32(u32);\n      break;\n    }\n\n    case Opcode::I64Const: {\n      auto token = Consume();\n      if (!token.HasLiteral()) {\n        result = Result::Error;\n        break;\n      }\n      auto sv = token.literal().text;\n      uint64_t u64;\n      result = ParseInt64(sv, &u64, ParseIntType::SignedAndUnsigned);\n      const_->set_u64(u64);\n      break;\n    }\n\n    case Opcode::F32Const:\n      result = ParseF32(const_, const_type);\n      break;\n\n    case Opcode::F64Const:\n      result = ParseF64(const_, const_type);\n      break;\n\n    case Opcode::V128Const:\n      ErrorUnlessOpcodeEnabled(opcode_token);\n      // Parse V128 Simd Const (16 bytes).\n      result = ParseSimdV128Const(const_, token.token_type(), const_type);\n      // ParseSimdV128Const report error already, just return here if parser get\n      // errors.\n      if (Failed(result)) {\n        return Result::Error;\n      }\n      break;\n\n    default:\n      assert(!\"ParseConst called with invalid opcode\");\n      return Result::Error;\n  }\n\n  if (Failed(result)) {\n    Error(const_->loc, \"invalid literal \\\"%s\\\"\", token.to_string().c_str());\n    // Return if parser get errors.\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseExternref(Const* const_) {\n  WABT_TRACE(ParseExternref);\n  Token token = Consume();\n  if (!options_->features.reference_types_enabled()) {\n    Error(token.loc, \"externref not allowed\");\n    return Result::Error;\n  }\n\n  Literal literal;\n  std::string_view sv;\n  const_->loc = GetLocation();\n  TokenType token_type = Peek();\n\n  switch (token_type) {\n    case TokenType::Nat:\n    case TokenType::Int: {\n      literal = Consume().literal();\n      sv = literal.text;\n      break;\n    }\n    default:\n      return ErrorExpected({\"a numeric literal\"}, \"123\");\n  }\n\n  uint64_t ref_bits;\n  Result result = ParseInt64(sv, &ref_bits, ParseIntType::UnsignedOnly);\n\n  if (ref_bits != 0 && options_->features.function_references_enabled()) {\n    const_->set_extern(static_cast<uintptr_t>(ref_bits));\n  } else {\n    const_->set_externref(static_cast<uintptr_t>(ref_bits));\n  }\n\n  if (Failed(result)) {\n    Error(const_->loc, \"invalid literal \\\"\" PRIstringview \"\\\"\",\n          WABT_PRINTF_STRING_VIEW_ARG(literal.text));\n    // Return if parser get errors.\n    return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseConstList(ConstVector* consts, ConstType type) {\n  WABT_TRACE(ParseConstList);\n  while (PeekMatchLpar(TokenType::Const) || PeekMatchLpar(TokenType::RefNull) ||\n         PeekMatchLpar(TokenType::RefExtern) ||\n         PeekMatchLpar(TokenType::RefFunc)) {\n    Consume();\n    Const const_;\n    switch (Peek()) {\n      case TokenType::Const:\n        CHECK_RESULT(ParseConst(&const_, type));\n        break;\n      case TokenType::RefNull: {\n        auto token = Consume();\n        Var type;\n        if (Peek() != TokenType::Rpar) {\n          CHECK_RESULT(ParseRefKind(&type));\n        }\n        ErrorUnlessOpcodeEnabled(token);\n        const_.loc = GetLocation();\n        const_.set_null(type.has_opt_type() ? type.opt_type() : Type::FuncRef);\n        break;\n      }\n      case TokenType::RefFunc: {\n        auto token = Consume();\n        ErrorUnlessOpcodeEnabled(token);\n        const_.loc = GetLocation();\n        const_.set_funcref();\n        break;\n      }\n      case TokenType::RefExtern:\n        CHECK_RESULT(ParseExternref(&const_));\n        break;\n      default:\n        assert(!\"unreachable\");\n        return Result::Error;\n    }\n    EXPECT(Rpar);\n    consts->push_back(const_);\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseBlockInstr(std::unique_ptr<Expr>* out_expr) {\n  WABT_TRACE(ParseBlockInstr);\n  Location loc = GetLocation();\n\n  switch (Peek()) {\n    case TokenType::Block: {\n      Consume();\n      auto expr = std::make_unique<BlockExpr>(loc);\n      CHECK_RESULT(ParseLabelOpt(&expr->block.label));\n      CHECK_RESULT(ParseBlock(&expr->block));\n      EXPECT(End);\n      CHECK_RESULT(ParseEndLabelOpt(expr->block.label));\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::Loop: {\n      Consume();\n      auto expr = std::make_unique<LoopExpr>(loc);\n      CHECK_RESULT(ParseLabelOpt(&expr->block.label));\n      CHECK_RESULT(ParseBlock(&expr->block));\n      EXPECT(End);\n      CHECK_RESULT(ParseEndLabelOpt(expr->block.label));\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::If: {\n      Consume();\n      auto expr = std::make_unique<IfExpr>(loc);\n      CHECK_RESULT(ParseLabelOpt(&expr->true_.label));\n      CHECK_RESULT(ParseBlock(&expr->true_));\n      if (Match(TokenType::Else)) {\n        CHECK_RESULT(ParseEndLabelOpt(expr->true_.label));\n        CHECK_RESULT(ParseTerminatingInstrList(&expr->false_));\n        expr->false_end_loc = GetLocation();\n      }\n      EXPECT(End);\n      CHECK_RESULT(ParseEndLabelOpt(expr->true_.label));\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::Try: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      auto expr = std::make_unique<TryExpr>(loc);\n      CatchVector catches;\n      CHECK_RESULT(ParseLabelOpt(&expr->block.label));\n      CHECK_RESULT(ParseBlock(&expr->block));\n      if (IsCatch(Peek())) {\n        CHECK_RESULT(ParseCatchInstrList(&expr->catches));\n        expr->kind = TryKind::Catch;\n      } else if (PeekMatch(TokenType::Delegate)) {\n        Consume();\n        Var var;\n        CHECK_RESULT(ParseVar(&var));\n        expr->delegate_target = var;\n        expr->kind = TryKind::Delegate;\n      }\n      CHECK_RESULT(ErrorIfLpar({\"a valid try clause\"}));\n      expr->block.end_loc = GetLocation();\n      if (expr->kind != TryKind::Delegate) {\n        EXPECT(End);\n      }\n      CHECK_RESULT(ParseEndLabelOpt(expr->block.label));\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    case TokenType::TryTable: {\n      ErrorUnlessOpcodeEnabled(Consume());\n      auto expr = std::make_unique<TryTableExpr>(loc);\n      CHECK_RESULT(ParseLabelOpt(&expr->block.label));\n      CHECK_RESULT(ParseBlockDeclaration(&expr->block.decl));\n      CHECK_RESULT(ParseTryTableCatches(&expr->catches));\n      CHECK_RESULT(ParseInstrList(&expr->block.exprs));\n      EXPECT(End);\n      CHECK_RESULT(ParseEndLabelOpt(expr->block.label));\n      *out_expr = std::move(expr);\n      break;\n    }\n\n    default:\n      assert(\n          !\"ParseBlockInstr should only be called when IsBlockInstr() is true\");\n      return Result::Error;\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseLabelOpt(std::string* out_label) {\n  WABT_TRACE(ParseLabelOpt);\n  if (PeekMatch(TokenType::Var)) {\n    Token token = Consume();\n    ParseVarText(token, out_label);\n  } else {\n    out_label->clear();\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseEndLabelOpt(const std::string& begin_label) {\n  WABT_TRACE(ParseEndLabelOpt);\n  Location loc = GetLocation();\n  std::string end_label;\n  CHECK_RESULT(ParseLabelOpt(&end_label));\n  if (!end_label.empty()) {\n    if (begin_label.empty()) {\n      Error(loc, \"unexpected label \\\"%s\\\"\", end_label.c_str());\n    } else if (begin_label != end_label) {\n      Error(loc, \"mismatching label \\\"%s\\\" != \\\"%s\\\"\", begin_label.c_str(),\n            end_label.c_str());\n    }\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseBlockDeclaration(BlockDeclaration* decl) {\n  WABT_TRACE(ParseBlockDeclaration);\n  CHECK_RESULT(ParseTypeUseOpt(decl));\n  CHECK_RESULT(ParseUnboundFuncSignature(&decl->sig));\n  return Result::Ok;\n}\n\nResult WastParser::ParseBlock(Block* block) {\n  WABT_TRACE(ParseBlock);\n  CHECK_RESULT(ParseBlockDeclaration(&block->decl));\n  CHECK_RESULT(ParseInstrList(&block->exprs));\n  block->end_loc = GetLocation();\n  return Result::Ok;\n}\n\nResult WastParser::ParseExprList(ExprList* exprs) {\n  WABT_TRACE(ParseExprList);\n  ExprList new_exprs;\n  while (PeekMatchExpr()) {\n    if (Succeeded(ParseExpr(&new_exprs))) {\n      exprs->splice(exprs->end(), new_exprs);\n    } else {\n      CHECK_RESULT(Synchronize(IsExpr));\n    }\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseExpr(ExprList* exprs) {\n  WABT_TRACE(ParseExpr);\n  if (!PeekMatch(TokenType::Lpar)) {\n    return Result::Error;\n  }\n\n  if (IsPlainInstr(Peek(1))) {\n    Consume();\n    std::unique_ptr<Expr> expr;\n    CHECK_RESULT(ParsePlainInstr(&expr));\n    CHECK_RESULT(ParseExprList(exprs));\n    CHECK_RESULT(ErrorIfLpar({\"an expr\"}));\n    exprs->push_back(std::move(expr));\n  } else {\n    Location loc = GetLocation();\n\n    switch (Peek(1)) {\n      case TokenType::Block: {\n        Consume();\n        Consume();\n        auto expr = std::make_unique<BlockExpr>(loc);\n        CHECK_RESULT(ParseLabelOpt(&expr->block.label));\n        CHECK_RESULT(ParseBlock(&expr->block));\n        exprs->push_back(std::move(expr));\n        break;\n      }\n\n      case TokenType::Loop: {\n        Consume();\n        Consume();\n        auto expr = std::make_unique<LoopExpr>(loc);\n        CHECK_RESULT(ParseLabelOpt(&expr->block.label));\n        CHECK_RESULT(ParseBlock(&expr->block));\n        exprs->push_back(std::move(expr));\n        break;\n      }\n\n      case TokenType::If: {\n        Consume();\n        Consume();\n        auto expr = std::make_unique<IfExpr>(loc);\n\n        CHECK_RESULT(ParseLabelOpt(&expr->true_.label));\n        CHECK_RESULT(ParseBlockDeclaration(&expr->true_.decl));\n\n        while (PeekMatchExpr()) {\n          ExprList cond;\n          CHECK_RESULT(ParseExpr(&cond));\n          exprs->splice(exprs->end(), cond);\n        }\n\n        EXPECT(Lpar);\n        if (!Match(TokenType::Then)) {\n          return ErrorExpected({\"then block\"}, \"(then ...)\");\n        }\n\n        CHECK_RESULT(ParseTerminatingInstrList(&expr->true_.exprs));\n        expr->true_.end_loc = GetLocation();\n        EXPECT(Rpar);\n\n        if (MatchLpar(TokenType::Else)) {\n          CHECK_RESULT(ParseTerminatingInstrList(&expr->false_));\n          EXPECT(Rpar);\n        }\n        expr->false_end_loc = GetLocation();\n\n        exprs->push_back(std::move(expr));\n        break;\n      }\n\n      case TokenType::Try: {\n        Consume();\n        ErrorUnlessOpcodeEnabled(Consume());\n\n        auto expr = std::make_unique<TryExpr>(loc);\n        CHECK_RESULT(ParseLabelOpt(&expr->block.label));\n        CHECK_RESULT(ParseBlockDeclaration(&expr->block.decl));\n        EXPECT(Lpar);\n        EXPECT(Do);\n        CHECK_RESULT(ParseInstrList(&expr->block.exprs));\n        EXPECT(Rpar);\n        if (PeekMatch(TokenType::Lpar)) {\n          Consume();\n          TokenType type = Peek();\n          switch (type) {\n            case TokenType::Catch:\n            case TokenType::CatchAll:\n              CHECK_RESULT(ParseCatchExprList(&expr->catches));\n              expr->kind = TryKind::Catch;\n              break;\n            case TokenType::Delegate: {\n              Consume();\n              Var var;\n              CHECK_RESULT(ParseVar(&var));\n              expr->delegate_target = var;\n              expr->kind = TryKind::Delegate;\n              EXPECT(Rpar);\n              break;\n            }\n            default:\n              ErrorExpected({\"catch\", \"catch_all\", \"delegate\"});\n              break;\n          }\n        }\n        CHECK_RESULT(ErrorIfLpar({\"a valid try clause\"}));\n        expr->block.end_loc = GetLocation();\n        exprs->push_back(std::move(expr));\n        break;\n      }\n\n      case TokenType::TryTable: {\n        Consume();\n        ErrorUnlessOpcodeEnabled(Consume());\n        auto expr = std::make_unique<TryTableExpr>(loc);\n        CHECK_RESULT(ParseLabelOpt(&expr->block.label));\n        CHECK_RESULT(ParseBlockDeclaration(&expr->block.decl));\n        CHECK_RESULT(ParseTryTableCatches(&expr->catches));\n        CHECK_RESULT(ParseInstrList(&expr->block.exprs));\n        expr->block.end_loc = GetLocation();\n        exprs->push_back(std::move(expr));\n        break;\n      }\n\n      default:\n        assert(!\"ParseExpr should only be called when IsExpr() is true\");\n        return Result::Error;\n    }\n  }\n\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseCatchInstrList(CatchVector* catches) {\n  WABT_TRACE(ParseCatchInstrList);\n  bool parsedCatch = false;\n  bool parsedCatchAll = false;\n\n  while (IsCatch(Peek())) {\n    Catch catch_(GetLocation());\n\n    auto token = Consume();\n    if (token.token_type() == TokenType::Catch) {\n      CHECK_RESULT(ParseVar(&catch_.var));\n    } else {\n      if (parsedCatchAll) {\n        Error(token.loc, \"multiple catch_all clauses not allowed\");\n        return Result::Error;\n      }\n      parsedCatchAll = true;\n    }\n\n    CHECK_RESULT(ParseInstrList(&catch_.exprs));\n    catches->push_back(std::move(catch_));\n    parsedCatch = true;\n  }\n\n  if (!parsedCatch) {\n    return ErrorExpected({\"catch\"});\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseCatchExprList(CatchVector* catches) {\n  WABT_TRACE(ParseCatchExprList);\n  bool parsedCatchAll = false;\n\n  do {\n    Catch catch_(GetLocation());\n\n    auto token = Consume();\n    if (token.token_type() == TokenType::Catch) {\n      CHECK_RESULT(ParseVar(&catch_.var));\n    } else {\n      if (parsedCatchAll) {\n        Error(token.loc, \"multiple catch_all clauses not allowed\");\n        return Result::Error;\n      }\n      parsedCatchAll = true;\n    }\n\n    CHECK_RESULT(ParseTerminatingInstrList(&catch_.exprs));\n    EXPECT(Rpar);\n    catches->push_back(std::move(catch_));\n  } while (Match(TokenType::Lpar) && IsCatch(Peek()));\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseTryTableCatches(TryTableVector* catches) {\n  WABT_TRACE(ParseTryTableCatches);\n\n  while (IsTryTableCatch(PeekPair())) {\n    Consume();\n    TableCatch catch_(GetLocation());\n    auto token = Consume();\n    switch (token.token_type()) {\n      case TokenType::Catch:\n        catch_.kind = CatchKind::Catch;\n        break;\n      case TokenType::CatchRef:\n        catch_.kind = CatchKind::CatchRef;\n        break;\n      case TokenType::CatchAll:\n        catch_.kind = CatchKind::CatchAll;\n        break;\n      case TokenType::CatchAllRef:\n        catch_.kind = CatchKind::CatchAllRef;\n        break;\n      default:\n        WABT_UNREACHABLE;\n    }\n    if (catch_.kind == CatchKind::Catch || catch_.kind == CatchKind::CatchRef) {\n      CHECK_RESULT(ParseVar(&catch_.tag));\n    }\n    CHECK_RESULT(ParseVar(&catch_.target));\n    EXPECT(Rpar);\n    catches->push_back(std::move(catch_));\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseGlobalType(Global* global) {\n  WABT_TRACE(ParseGlobalType);\n  if (MatchLpar(TokenType::Mut)) {\n    global->mutable_ = true;\n    Var type;\n    CHECK_RESULT(ParseValueType(&type));\n    VarToType(type, &global->type);\n    CHECK_RESULT(ErrorIfLpar({\"i32\", \"i64\", \"f32\", \"f64\"}));\n    EXPECT(Rpar);\n  } else {\n    Var type;\n    CHECK_RESULT(ParseValueType(&type));\n    VarToType(type, &global->type);\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseCommandList(Script* script,\n                                    CommandPtrVector* commands) {\n  WABT_TRACE(ParseCommandList);\n  while (IsCommand(PeekPair())) {\n    CommandPtr command;\n    if (Succeeded(ParseCommand(script, &command))) {\n      commands->push_back(std::move(command));\n    } else {\n      CHECK_RESULT(Synchronize(IsCommand));\n    }\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseCommand(Script* script, CommandPtr* out_command) {\n  WABT_TRACE(ParseCommand);\n  switch (Peek(1)) {\n    case TokenType::AssertException:\n      return ParseAssertExceptionCommand(out_command);\n\n    case TokenType::AssertExhaustion:\n      return ParseAssertExhaustionCommand(out_command);\n\n    case TokenType::AssertInvalid:\n      return ParseAssertInvalidCommand(out_command);\n\n    case TokenType::AssertMalformed:\n      return ParseAssertMalformedCommand(out_command);\n\n    case TokenType::AssertReturn:\n      return ParseAssertReturnCommand(out_command);\n\n    case TokenType::AssertTrap:\n      return ParseAssertTrapCommand(out_command);\n\n    case TokenType::AssertUnlinkable:\n      return ParseAssertUnlinkableCommand(out_command);\n\n    case TokenType::Get:\n    case TokenType::Invoke:\n      return ParseActionCommand(out_command);\n\n    case TokenType::Module:\n      return ParseModuleCommand(script, out_command);\n\n    case TokenType::Register:\n      return ParseRegisterCommand(out_command);\n\n    case TokenType::Input:\n      return ParseInputCommand(out_command);\n\n    case TokenType::Output:\n      return ParseOutputCommand(out_command);\n\n    default:\n      assert(!\"ParseCommand should only be called when IsCommand() is true\");\n      return Result::Error;\n  }\n}\n\nResult WastParser::ParseAssertExceptionCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertExceptionCommand);\n  return ParseAssertActionCommand<AssertExceptionCommand>(\n      TokenType::AssertException, out_command);\n}\n\nResult WastParser::ParseAssertExhaustionCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertExhaustionCommand);\n  return ParseAssertActionTextCommand<AssertExhaustionCommand>(\n      TokenType::AssertExhaustion, out_command);\n}\n\nResult WastParser::ParseAssertInvalidCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertInvalidCommand);\n  return ParseAssertScriptModuleCommand<AssertInvalidCommand>(\n      TokenType::AssertInvalid, out_command);\n}\n\nResult WastParser::ParseAssertMalformedCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertMalformedCommand);\n  return ParseAssertScriptModuleCommand<AssertMalformedCommand>(\n      TokenType::AssertMalformed, out_command);\n}\n\nResult WastParser::ParseAssertReturnCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertReturnCommand);\n  EXPECT(Lpar);\n  EXPECT(AssertReturn);\n  auto command = std::make_unique<AssertReturnCommand>();\n  CHECK_RESULT(ParseAction(&command->action));\n  CHECK_RESULT(ParseExpectedValues(&command->expected));\n  EXPECT(Rpar);\n  *out_command = std::move(command);\n  return Result::Ok;\n}\n\nResult WastParser::ParseAssertTrapCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertTrapCommand);\n  EXPECT(Lpar);\n  EXPECT(AssertTrap);\n  if (PeekMatchLpar(TokenType::Module)) {\n    auto command = std::make_unique<AssertUninstantiableCommand>();\n    CHECK_RESULT(ParseScriptModule(&command->module));\n    CHECK_RESULT(ParseQuotedText(&command->text));\n    *out_command = std::move(command);\n  } else {\n    auto command = std::make_unique<AssertTrapCommand>();\n    CHECK_RESULT(ParseAction(&command->action));\n    CHECK_RESULT(ParseQuotedText(&command->text));\n    *out_command = std::move(command);\n  }\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseAssertUnlinkableCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertUnlinkableCommand);\n  return ParseAssertScriptModuleCommand<AssertUnlinkableCommand>(\n      TokenType::AssertUnlinkable, out_command);\n}\n\nResult WastParser::ParseActionCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseActionCommand);\n  auto command = std::make_unique<ActionCommand>();\n  CHECK_RESULT(ParseAction(&command->action));\n  *out_command = std::move(command);\n  return Result::Ok;\n}\n\nResult WastParser::ParseModuleCommand(Script* script, CommandPtr* out_command) {\n  WABT_TRACE(ParseModuleCommand);\n  std::unique_ptr<ScriptModule> script_module;\n  CHECK_RESULT(ParseScriptModule(&script_module));\n\n  Module* module = nullptr;\n\n  switch (script_module->type()) {\n    case ScriptModuleType::Text: {\n      auto command = std::make_unique<ModuleCommand>();\n      module = &command->module;\n      *module = std::move(cast<TextScriptModule>(script_module.get())->module);\n      *out_command = std::move(command);\n      break;\n    }\n\n    case ScriptModuleType::Binary: {\n      auto command = std::make_unique<ScriptModuleCommand>();\n      module = &command->module;\n      auto* bsm = cast<BinaryScriptModule>(script_module.get());\n      ReadBinaryOptions options;\n#if WABT_TRACING\n      auto log_stream = FileStream::CreateStdout();\n      options.log_stream = log_stream.get();\n#endif\n      options.features = options_->features;\n      Errors errors;\n      const char* filename = \"<text>\";\n      if (options_->parse_binary_modules) {\n        ReadBinaryIr(filename, bsm->data.data(), bsm->data.size(), options,\n                     &errors, module);\n      }\n      module->name = bsm->name;\n      module->loc = bsm->loc;\n      for (const auto& error : errors) {\n        if (error.loc.offset == kInvalidOffset) {\n          Error(bsm->loc, \"error in binary module: %s\", error.message.c_str());\n        } else {\n          Error(bsm->loc, \"error in binary module: @0x%08\" PRIzx \": %s\",\n                error.loc.offset, error.message.c_str());\n        }\n      }\n\n      command->script_module = std::move(script_module);\n      *out_command = std::move(command);\n      break;\n    }\n\n    case ScriptModuleType::Quoted:\n      auto command = std::make_unique<ModuleCommand>();\n      module = &command->module;\n      auto* qsm = cast<QuotedScriptModule>(script_module.get());\n      Errors errors;\n      const char* filename = \"<text>\";\n      std::unique_ptr<Module> m;\n      std::unique_ptr<WastLexer> lexer = WastLexer::CreateBufferLexer(\n          filename, qsm->data.data(), qsm->data.size(), &errors);\n      auto result = ParseWatModule(lexer.get(), &m, &errors, options_);\n      for (const auto& error : errors) {\n        if (error.loc.offset == kInvalidOffset) {\n          Error(qsm->loc, \"error in quoted module: %s\", error.message.c_str());\n        } else {\n          Error(qsm->loc, \"error in quoted module: @0x%08\" PRIzx \": %s\",\n                error.loc.offset, error.message.c_str());\n        }\n      }\n      if (Succeeded(result)) {\n        *module = std::move(*m.get());\n      }\n      *out_command = std::move(command);\n      break;\n  }\n\n  // script is nullptr when ParseModuleCommand is called from ParseModule.\n  if (script) {\n    Index command_index = script->commands.size();\n\n    if (!module->name.empty()) {\n      script->module_bindings.emplace(module->name,\n                                      Binding(module->loc, command_index));\n    }\n\n    last_module_index_ = command_index;\n  }\n\n  return Result::Ok;\n}\n\nResult WastParser::ParseRegisterCommand(CommandPtr* out_command) {\n  WABT_TRACE(ParseRegisterCommand);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Register);\n  std::string text;\n  Var var;\n  CHECK_RESULT(ParseQuotedText(&text));\n  CHECK_RESULT(ParseVarOpt(&var, Var(last_module_index_, loc)));\n  EXPECT(Rpar);\n  out_command->reset(new RegisterCommand(text, var));\n  return Result::Ok;\n}\n\nResult WastParser::ParseInputCommand(CommandPtr*) {\n  // Parse the input command, but always fail since this command is not\n  // actually supported.\n  WABT_TRACE(ParseInputCommand);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Input);\n  Error(loc, \"input command is not supported\");\n  Var var;\n  std::string text;\n  CHECK_RESULT(ParseVarOpt(&var));\n  CHECK_RESULT(ParseQuotedText(&text));\n  EXPECT(Rpar);\n  return Result::Error;\n}\n\nResult WastParser::ParseOutputCommand(CommandPtr*) {\n  // Parse the output command, but always fail since this command is not\n  // actually supported.\n  WABT_TRACE(ParseOutputCommand);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Output);\n  Error(loc, \"output command is not supported\");\n  Var var;\n  std::string text;\n  CHECK_RESULT(ParseVarOpt(&var));\n  if (Peek() == TokenType::Text) {\n    CHECK_RESULT(ParseQuotedText(&text));\n  }\n  EXPECT(Rpar);\n  return Result::Error;\n}\n\nResult WastParser::ParseAction(ActionPtr* out_action) {\n  WABT_TRACE(ParseAction);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n\n  switch (Peek()) {\n    case TokenType::Invoke: {\n      Consume();\n      auto action = std::make_unique<InvokeAction>(loc);\n      CHECK_RESULT(\n          ParseVarOpt(&action->module_var, Var(last_module_index_, loc)));\n      CHECK_RESULT(ParseQuotedText(&action->name));\n      CHECK_RESULT(ParseConstList(&action->args, ConstType::Normal));\n      *out_action = std::move(action);\n      break;\n    }\n\n    case TokenType::Get: {\n      Consume();\n      auto action = std::make_unique<GetAction>(loc);\n      CHECK_RESULT(\n          ParseVarOpt(&action->module_var, Var(last_module_index_, loc)));\n      CHECK_RESULT(ParseQuotedText(&action->name));\n      *out_action = std::move(action);\n      break;\n    }\n\n    default:\n      return ErrorExpected({\"invoke\", \"get\"});\n  }\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseExpectedValues(ExpectationPtr* expectation) {\n  WABT_TRACE(ParseExpectedValues);\n  Location loc = GetLocation();\n  if (PeekMatchLpar(TokenType::Either)) {\n    auto either = std::make_unique<EitherExpectation>(loc);\n    CHECK_RESULT(ParseEither(&either->expected));\n    *expectation = std::move(either);\n  } else {\n    auto values = std::make_unique<ValueExpectation>(loc);\n    CHECK_RESULT(ParseConstList(&values->expected, ConstType::Expectation));\n    *expectation = std::move(values);\n  }\n  return Result::Ok;\n}\n\nResult WastParser::ParseEither(ConstVector* alternatives) {\n  WABT_TRACE(ParseEither);\n  MatchLpar(TokenType::Either);\n  CHECK_RESULT(ParseConstList(alternatives, ConstType::Expectation));\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\nResult WastParser::ParseScriptModule(\n    std::unique_ptr<ScriptModule>* out_module) {\n  WABT_TRACE(ParseScriptModule);\n  EXPECT(Lpar);\n  Location loc = GetLocation();\n  EXPECT(Module);\n  std::string name;\n  CHECK_RESULT(ParseBindVarOpt(&name));\n\n  switch (Peek()) {\n    case TokenType::Bin: {\n      Consume();\n      std::vector<uint8_t> data;\n      // TODO(binji): The spec allows this to be empty, switch to\n      // ParseTextListOpt.\n      CHECK_RESULT(ParseTextList(&data));\n\n      auto bsm = std::make_unique<BinaryScriptModule>();\n      bsm->name = name;\n      bsm->loc = loc;\n      bsm->data = std::move(data);\n      *out_module = std::move(bsm);\n      break;\n    }\n\n    case TokenType::Quote: {\n      Consume();\n      std::vector<uint8_t> data;\n      // TODO(binji): The spec allows this to be empty, switch to\n      // ParseTextListOpt.\n      CHECK_RESULT(ParseTextList(&data));\n\n      auto qsm = std::make_unique<QuotedScriptModule>();\n      qsm->name = name;\n      qsm->loc = loc;\n      qsm->data = std::move(data);\n      *out_module = std::move(qsm);\n      break;\n    }\n\n    default: {\n      auto tsm = std::make_unique<TextScriptModule>();\n      tsm->module.name = name;\n      tsm->module.loc = loc;\n      if (IsModuleField(PeekPair()) || PeekIsCustom()) {\n        CHECK_RESULT(ParseModuleFieldList(&tsm->module));\n      } else if (!PeekMatch(TokenType::Rpar)) {\n        ConsumeIfLpar();\n        return ErrorExpected({\"a module field\"});\n      }\n      *out_module = std::move(tsm);\n      break;\n    }\n  }\n\n  EXPECT(Rpar);\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParseAssertActionCommand(TokenType token_type,\n                                            CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertActionCommand);\n  EXPECT(Lpar);\n  CHECK_RESULT(Expect(token_type));\n  auto command = std::make_unique<T>();\n  CHECK_RESULT(ParseAction(&command->action));\n  EXPECT(Rpar);\n  *out_command = std::move(command);\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParseAssertActionTextCommand(TokenType token_type,\n                                                CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertActionTextCommand);\n  EXPECT(Lpar);\n  CHECK_RESULT(Expect(token_type));\n  auto command = std::make_unique<T>();\n  CHECK_RESULT(ParseAction(&command->action));\n  CHECK_RESULT(ParseQuotedText(&command->text));\n  EXPECT(Rpar);\n  *out_command = std::move(command);\n  return Result::Ok;\n}\n\ntemplate <typename T>\nResult WastParser::ParseAssertScriptModuleCommand(TokenType token_type,\n                                                  CommandPtr* out_command) {\n  WABT_TRACE(ParseAssertScriptModuleCommand);\n  EXPECT(Lpar);\n  CHECK_RESULT(Expect(token_type));\n  auto command = std::make_unique<T>();\n  CHECK_RESULT(ParseScriptModule(&command->module));\n  CHECK_RESULT(ParseQuotedText(&command->text));\n  EXPECT(Rpar);\n  *out_command = std::move(command);\n  return Result::Ok;\n}\n\nvoid WastParser::CheckImportOrdering(Module* module) {\n  if (module->funcs.size() != module->num_func_imports ||\n      module->tables.size() != module->num_table_imports ||\n      module->memories.size() != module->num_memory_imports ||\n      module->globals.size() != module->num_global_imports ||\n      module->tags.size() != module->num_tag_imports) {\n    Error(GetLocation(),\n          \"imports must occur before all non-import definitions\");\n  }\n}\n\nbool WastParser::HasError() const {\n  return std::any_of(errors_->begin(), errors_->end(), [](const auto& x) {\n    return x.error_level == ErrorLevel::Error;\n  });\n}\n\nbool WastParser::CheckRefType(Type::Enum type) {\n  switch (type) {\n    case Type::FuncRef:\n      return true;\n    case Type::ExternRef:\n      return options_->features.reference_types_enabled();\n    case Type::ExnRef:\n      return options_->features.exceptions_enabled();\n    default:\n      assert(!Type::EnumIsNonTypedRef(type));\n      return false;\n  }\n}\n\nvoid WastParser::VarToType(const Var& var, Type* type) {\n  if (!Type::EnumIsReferenceWithIndex(var.opt_type()) || var.is_index()) {\n    *type = var.to_type();\n    return;\n  }\n\n  *type = Type(var.opt_type(), kInvalidIndex);\n  resolve_ref_types_.push_back(ResolveRefType(type, var));\n}\n\nvoid WastParser::TokenQueue::push_back(Token t) {\n  assert(!tokens[!i]);\n  tokens[!i] = t;\n  if (empty()) {\n    i = !i;\n  }\n}\n\nvoid WastParser::TokenQueue::pop_front() {\n  assert(tokens[i]);\n  tokens[i].reset();\n  i = !i;\n}\n\nconst Token& WastParser::TokenQueue::at(size_t n) const {\n  assert(n <= 1);\n  return tokens[i ^ static_cast<bool>(n)].value();\n}\n\nconst Token& WastParser::TokenQueue::front() const {\n  return at(0);\n}\n\nbool WastParser::TokenQueue::empty() const {\n  return !tokens[i];\n}\n\nsize_t WastParser::TokenQueue::size() const {\n  return empty() ? 0 : 1 + tokens[!i].has_value();\n}\n\nResult ParseWatModule(WastLexer* lexer,\n                      std::unique_ptr<Module>* out_module,\n                      Errors* errors,\n                      WastParseOptions* options) {\n  assert(out_module != nullptr);\n  assert(options != nullptr);\n  WastParser parser(lexer, errors, options);\n  CHECK_RESULT(parser.ParseModule(out_module));\n  return Result::Ok;\n}\n\nResult ParseWastScript(WastLexer* lexer,\n                       std::unique_ptr<Script>* out_script,\n                       Errors* errors,\n                       WastParseOptions* options) {\n  assert(out_script != nullptr);\n  assert(options != nullptr);\n  WastParser parser(lexer, errors, options);\n  CHECK_RESULT(parser.ParseScript(out_script));\n  CHECK_RESULT(ResolveNamesScript(out_script->get(), errors));\n  return Result::Ok;\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "src/wat-writer.cc",
    "content": "/*\n * Copyright 2016 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wabt/wat-writer.h\"\n\n#include <algorithm>\n#include <array>\n#include <cassert>\n#include <cinttypes>\n#include <cstdarg>\n#include <cstdio>\n#include <iterator>\n#include <map>\n#include <string>\n#include <vector>\n\n#include \"wabt/cast.h\"\n#include \"wabt/common.h\"\n#include \"wabt/expr-visitor.h\"\n#include \"wabt/ir-util.h\"\n#include \"wabt/ir.h\"\n#include \"wabt/literal.h\"\n#include \"wabt/stream.h\"\n\n#define WABT_TRACING 0\n#include \"wabt/tracing.h\"\n\n#define INDENT_SIZE 2\n#define NO_FORCE_NEWLINE 0\n#define FORCE_NEWLINE 1\n\nnamespace wabt {\n\nnamespace {\n\nstatic const uint8_t s_is_char_escaped[] = {\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n\n// This table matches the characters allowed by wast-lexer.cc for `symbol`.\n// The disallowed printable characters are: \"(),;[]{} and <space>.\nstatic const uint8_t s_valid_name_chars[256] = {\n    //         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n    /* 0x00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    /* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n    /* 0x20 */ 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1,\n    /* 0x30 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,\n    /* 0x40 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    /* 0x50 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1,\n    /* 0x60 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    /* 0x70 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,\n};\n\nenum class NextChar {\n  None,\n  Space,\n  Newline,\n  ForceNewline,\n};\n\nstruct ExprTree {\n  explicit ExprTree(const Expr* expr, Index result_count)\n      : expr(expr), result_count(result_count) {}\n\n  const Expr* expr;\n  std::vector<ExprTree> children;\n  Index result_count;\n};\n\nclass WatWriter : ModuleContext {\n public:\n  WatWriter(Stream* stream,\n            const WriteWatOptions& options,\n            const Module& module)\n      : ModuleContext(module), options_(options), stream_(stream) {}\n\n  Result WriteModule();\n\n private:\n  void Indent();\n  void Dedent();\n  void WriteIndent();\n  void WriteNextChar();\n  void WriteDataWithNextChar(const void* src, size_t size);\n  void Writef(const char* format, ...);\n  void WritePutc(char c);\n  void WritePuts(const char* s, NextChar next_char);\n  void WritePutsSpace(const char* s);\n  void WritePutsNewline(const char* s);\n  void WriteNewline(bool force);\n  void WriteOpen(const char* name, NextChar next_char);\n  void WriteOpenNewline(const char* name);\n  void WriteOpenSpace(const char* name);\n  void WriteClose(NextChar next_char);\n  void WriteCloseNewline();\n  void WriteCloseSpace();\n  void WriteString(const std::string& str, NextChar next_char);\n  void WriteName(std::string_view str, NextChar next_char);\n  void WriteNameOrIndex(std::string_view str, Index index, NextChar next_char);\n  void WriteQuotedData(const void* data, size_t length);\n  void WriteQuotedString(std::string_view str, NextChar next_char);\n  void WriteVar(const Var& var, NextChar next_char);\n  void WriteVarUnlessZero(const Var& var, NextChar next_char);\n  void WriteMemoryVarUnlessZero(const Var& memidx, NextChar next_char);\n  void WriteTwoMemoryVarsUnlessBothZero(const Var& srcmemidx,\n                                        const Var& destmemidx,\n                                        NextChar next_char);\n  void WriteBrVar(const Var& var, NextChar next_char);\n  void WriteRefKind(Type type, NextChar next_char);\n  void WriteType(Type type, NextChar next_char);\n  void WriteTypes(const TypeVector& types, const char* name);\n  void WriteFuncSigSpace(const FuncSignature& func_sig);\n  void WriteBeginBlock(LabelType label_type,\n                       const Block& block,\n                       const char* text);\n  void WriteEndBlock();\n  void WriteConst(const Const& const_);\n  void WriteExpr(const Expr* expr);\n  template <typename T>\n  void WriteLoadStoreExpr(const Expr* expr);\n  template <typename T>\n  void WriteMemoryLoadStoreExpr(const Expr* expr);\n  void WriteExprList(const ExprList& exprs);\n  void WriteInitExpr(const ExprList& expr);\n  template <typename T>\n  void WriteTypeBindings(const char* prefix,\n                         const T& types,\n                         const std::vector<std::string>& index_to_name,\n                         Index binding_index_offset = 0);\n  void WriteBeginFunc(const Func& func);\n  void WriteFunc(const Func& func);\n  void WriteBeginGlobal(const Global& global);\n  void WriteGlobal(const Global& global);\n  void WriteTag(const Tag& tag);\n  void WriteLimits(const Limits& limits);\n  void WriteTable(const Table& table);\n  void WriteElemSegment(const ElemSegment& segment);\n  void WriteMemory(const Memory& memory);\n  void WriteDataSegment(const DataSegment& segment);\n  void WriteImport(const Import& import);\n  void WriteExport(const Export& export_);\n  void WriteTypeEntry(const TypeEntry& type);\n  void WriteField(const Field& field);\n  void WriteStartFunction(const Var& start);\n  void WriteCustom(const Custom& custom);\n\n  class ExprVisitorDelegate;\n\n  void PushExpr(const Expr* expr, Index operand_count, Index result_count);\n  void FlushExprTree(const ExprTree& expr_tree);\n  void FlushExprTreeVector(const std::vector<ExprTree>&);\n  void FlushExprTreeStack();\n  void WriteFoldedExpr(const Expr*);\n  void WriteFoldedExprList(const ExprList&);\n\n  void BuildInlineExportMap();\n  void WriteInlineExports(ExternalKind, Index);\n  bool IsInlineExport(const Export& export_);\n  void BuildInlineImportMap();\n  void WriteInlineImport(ExternalKind, Index);\n\n  const WriteWatOptions& options_;\n  Stream* stream_ = nullptr;\n  Result result_ = Result::Ok;\n  int indent_ = 0;\n  NextChar next_char_ = NextChar::None;\n  std::vector<ExprTree> expr_tree_stack_;\n  std::multimap<std::pair<ExternalKind, Index>, const Export*>\n      inline_export_map_;\n  std::vector<const Import*> inline_import_map_[kExternalKindCount];\n\n  Index func_index_ = 0;\n  Index global_index_ = 0;\n  Index table_index_ = 0;\n  Index memory_index_ = 0;\n  Index type_index_ = 0;\n  Index tag_index_ = 0;\n  Index data_segment_index_ = 0;\n  Index elem_segment_index_ = 0;\n};\n\nvoid WatWriter::Indent() {\n  indent_ += INDENT_SIZE;\n}\n\nvoid WatWriter::Dedent() {\n  indent_ -= INDENT_SIZE;\n  assert(indent_ >= 0);\n}\n\nvoid WatWriter::WriteIndent() {\n  static char s_indent[] =\n      \"                                                                       \"\n      \"                                                                       \";\n  static size_t s_indent_len = sizeof(s_indent) - 1;\n  size_t to_write = indent_;\n  while (to_write >= s_indent_len) {\n    stream_->WriteData(s_indent, s_indent_len);\n    to_write -= s_indent_len;\n  }\n  if (to_write > 0) {\n    stream_->WriteData(s_indent, to_write);\n  }\n}\n\nvoid WatWriter::WriteNextChar() {\n  switch (next_char_) {\n    case NextChar::Space:\n      stream_->WriteChar(' ');\n      break;\n    case NextChar::Newline:\n    case NextChar::ForceNewline:\n      stream_->WriteChar('\\n');\n      WriteIndent();\n      break;\n    case NextChar::None:\n      break;\n  }\n  next_char_ = NextChar::None;\n}\n\nvoid WatWriter::WriteDataWithNextChar(const void* src, size_t size) {\n  WriteNextChar();\n  stream_->WriteData(src, size);\n}\n\nvoid WABT_PRINTF_FORMAT(2, 3) WatWriter::Writef(const char* format, ...) {\n  WABT_SNPRINTF_ALLOCA(buffer, length, format);\n  /* default to following space */\n  WriteDataWithNextChar(buffer, length);\n  next_char_ = NextChar::Space;\n}\n\nvoid WatWriter::WritePutc(char c) {\n  stream_->WriteChar(c);\n}\n\nvoid WatWriter::WritePuts(const char* s, NextChar next_char) {\n  size_t len = strlen(s);\n  WriteDataWithNextChar(s, len);\n  next_char_ = next_char;\n}\n\nvoid WatWriter::WritePutsSpace(const char* s) {\n  WritePuts(s, NextChar::Space);\n}\n\nvoid WatWriter::WritePutsNewline(const char* s) {\n  WritePuts(s, NextChar::Newline);\n}\n\nvoid WatWriter::WriteNewline(bool force) {\n  if (next_char_ == NextChar::ForceNewline) {\n    WriteNextChar();\n  }\n  next_char_ = force ? NextChar::ForceNewline : NextChar::Newline;\n}\n\nvoid WatWriter::WriteOpen(const char* name, NextChar next_char) {\n  WritePuts(\"(\", NextChar::None);\n  WritePuts(name, next_char);\n  Indent();\n}\n\nvoid WatWriter::WriteOpenNewline(const char* name) {\n  WriteOpen(name, NextChar::Newline);\n}\n\nvoid WatWriter::WriteOpenSpace(const char* name) {\n  WriteOpen(name, NextChar::Space);\n}\n\nvoid WatWriter::WriteClose(NextChar next_char) {\n  if (next_char_ != NextChar::ForceNewline) {\n    next_char_ = NextChar::None;\n  }\n  Dedent();\n  WritePuts(\")\", next_char);\n}\n\nvoid WatWriter::WriteCloseNewline() {\n  WriteClose(NextChar::Newline);\n}\n\nvoid WatWriter::WriteCloseSpace() {\n  WriteClose(NextChar::Space);\n}\n\nvoid WatWriter::WriteString(const std::string& str, NextChar next_char) {\n  WritePuts(str.c_str(), next_char);\n}\n\nvoid WatWriter::WriteName(std::string_view str, NextChar next_char) {\n  // Debug names must begin with a $ for for wast file to be valid\n  assert(!str.empty() && str.front() == '$');\n  bool has_invalid_chars = std::any_of(\n      str.begin(), str.end(), [](uint8_t c) { return !s_valid_name_chars[c]; });\n\n  if (has_invalid_chars) {\n    std::string valid_str;\n    std::transform(str.begin(), str.end(), std::back_inserter(valid_str),\n                   [](uint8_t c) { return s_valid_name_chars[c] ? c : '_'; });\n    WriteDataWithNextChar(valid_str.data(), valid_str.length());\n  } else {\n    WriteDataWithNextChar(str.data(), str.length());\n  }\n\n  next_char_ = next_char;\n}\n\nvoid WatWriter::WriteNameOrIndex(std::string_view str,\n                                 Index index,\n                                 NextChar next_char) {\n  if (!str.empty()) {\n    WriteName(str, next_char);\n  } else {\n    Writef(\"(;%u;)\", index);\n  }\n}\n\nvoid WatWriter::WriteQuotedData(const void* data, size_t length) {\n  const uint8_t* u8_data = static_cast<const uint8_t*>(data);\n  static const char s_hexdigits[] = \"0123456789abcdef\";\n  WriteNextChar();\n  WritePutc('\\\"');\n  for (size_t i = 0; i < length; ++i) {\n    uint8_t c = u8_data[i];\n    if (s_is_char_escaped[c]) {\n      WritePutc('\\\\');\n      WritePutc(s_hexdigits[c >> 4]);\n      WritePutc(s_hexdigits[c & 0xf]);\n    } else {\n      WritePutc(c);\n    }\n  }\n  WritePutc('\\\"');\n  next_char_ = NextChar::Space;\n}\n\nvoid WatWriter::WriteQuotedString(std::string_view str, NextChar next_char) {\n  WriteQuotedData(str.data(), str.length());\n  next_char_ = next_char;\n}\n\nvoid WatWriter::WriteVar(const Var& var, NextChar next_char) {\n  if (var.is_index()) {\n    Writef(\"%\" PRIindex, var.index());\n    next_char_ = next_char;\n  } else {\n    WriteName(var.name(), next_char);\n  }\n}\n\nbool VarIsZero(const Var& var) {\n  return var.is_index() && var.index() == 0;\n}\n\nvoid WatWriter::WriteVarUnlessZero(const Var& var, NextChar next_char) {\n  if (!VarIsZero(var)) {\n    WriteVar(var, next_char);\n  }\n}\n\nvoid WatWriter::WriteMemoryVarUnlessZero(const Var& memidx,\n                                         NextChar next_char) {\n  if (module.GetMemoryIndex(memidx) != 0) {\n    WriteVar(memidx, next_char);\n  } else {\n    next_char_ = next_char;\n  }\n}\n\nvoid WatWriter::WriteTwoMemoryVarsUnlessBothZero(const Var& srcmemidx,\n                                                 const Var& destmemidx,\n                                                 NextChar next_char) {\n  if (module.GetMemoryIndex(srcmemidx) != 0 ||\n      module.GetMemoryIndex(destmemidx) != 0) {\n    WriteVar(srcmemidx, NextChar::Space);\n    WriteVar(destmemidx, next_char);\n  } else {\n    next_char_ = next_char;\n  }\n}\n\nvoid WatWriter::WriteBrVar(const Var& var, NextChar next_char) {\n  if (var.is_index()) {\n    if (var.index() < GetLabelStackSize()) {\n      Writef(\"%\" PRIindex \" (;@%\" PRIindex \";)\", var.index(),\n             GetLabelStackSize() - var.index() - 1);\n    } else {\n      Writef(\"%\" PRIindex \" (; INVALID ;)\", var.index());\n    }\n    next_char_ = next_char;\n  } else {\n    WriteString(var.name(), next_char);\n  }\n}\n\nvoid WatWriter::WriteRefKind(Type type, NextChar next_char) {\n  WritePuts(type.GetRefKindName(), next_char);\n}\n\nvoid WatWriter::WriteType(Type type, NextChar next_char) {\n  WritePuts(type.GetName().c_str(), next_char);\n}\n\nvoid WatWriter::WriteTypes(const TypeVector& types, const char* name) {\n  if (types.size()) {\n    if (name) {\n      WriteOpenSpace(name);\n    }\n    for (Type type : types) {\n      WriteType(type, NextChar::Space);\n    }\n    if (name) {\n      WriteCloseSpace();\n    }\n  }\n}\n\nvoid WatWriter::WriteFuncSigSpace(const FuncSignature& func_sig) {\n  WriteTypes(func_sig.param_types, \"param\");\n  WriteTypes(func_sig.result_types, \"result\");\n}\n\nvoid WatWriter::WriteBeginBlock(LabelType label_type,\n                                const Block& block,\n                                const char* text) {\n  WritePutsSpace(text);\n  bool has_label = !block.label.empty();\n  if (has_label) {\n    WriteString(block.label, NextChar::Space);\n  }\n  WriteTypes(block.decl.sig.param_types, \"param\");\n  WriteTypes(block.decl.sig.result_types, \"result\");\n  if (!has_label) {\n    Writef(\" ;; label = @%\" PRIindex, GetLabelStackSize());\n  }\n  WriteNewline(FORCE_NEWLINE);\n  BeginBlock(label_type, block);\n  Indent();\n}\n\nvoid WatWriter::WriteEndBlock() {\n  Dedent();\n  EndBlock();\n  WritePutsNewline(Opcode::End_Opcode.GetName());\n}\n\nvoid WatWriter::WriteConst(const Const& const_) {\n  switch (const_.type()) {\n    case Type::I32:\n      WritePutsSpace(Opcode::I32Const_Opcode.GetName());\n      Writef(\"%d\", static_cast<int32_t>(const_.u32()));\n      WriteNewline(NO_FORCE_NEWLINE);\n      break;\n\n    case Type::I64:\n      WritePutsSpace(Opcode::I64Const_Opcode.GetName());\n      Writef(\"%\" PRId64, static_cast<int64_t>(const_.u64()));\n      WriteNewline(NO_FORCE_NEWLINE);\n      break;\n\n    case Type::F32: {\n      WritePutsSpace(Opcode::F32Const_Opcode.GetName());\n      char buffer[128];\n      WriteFloatHex(buffer, 128, const_.f32_bits());\n      WritePutsSpace(buffer);\n      Writef(\"(;=%g;)\", Bitcast<float>(const_.f32_bits()));\n      WriteNewline(NO_FORCE_NEWLINE);\n      break;\n    }\n\n    case Type::F64: {\n      WritePutsSpace(Opcode::F64Const_Opcode.GetName());\n      char buffer[128];\n      WriteDoubleHex(buffer, 128, const_.f64_bits());\n      WritePutsSpace(buffer);\n      Writef(\"(;=%g;)\", Bitcast<double>(const_.f64_bits()));\n      WriteNewline(NO_FORCE_NEWLINE);\n      break;\n    }\n\n    case Type::V128: {\n      WritePutsSpace(Opcode::V128Const_Opcode.GetName());\n      auto vec = const_.vec128();\n      Writef(\"i32x4 0x%08x 0x%08x 0x%08x 0x%08x\", vec.u32(0), vec.u32(1),\n             vec.u32(2), vec.u32(3));\n      WriteNewline(NO_FORCE_NEWLINE);\n      break;\n    }\n\n    default:\n      assert(0);\n      break;\n  }\n}\n\ntemplate <typename T>\nvoid WatWriter::WriteLoadStoreExpr(const Expr* expr) {\n  auto typed_expr = cast<T>(expr);\n  WritePutsSpace(typed_expr->opcode.GetName());\n  if (typed_expr->offset) {\n    Writef(\"offset=%\" PRIaddress, typed_expr->offset);\n  }\n  if (!typed_expr->opcode.IsNaturallyAligned(typed_expr->align)) {\n    Writef(\"align=%\" PRIaddress, typed_expr->align);\n  }\n  WriteNewline(NO_FORCE_NEWLINE);\n}\n\ntemplate <typename T>\nvoid WatWriter::WriteMemoryLoadStoreExpr(const Expr* expr) {\n  auto typed_expr = cast<T>(expr);\n  WritePutsSpace(typed_expr->opcode.GetName());\n  WriteMemoryVarUnlessZero(typed_expr->memidx, NextChar::Space);\n  if (typed_expr->offset) {\n    Writef(\"offset=%\" PRIaddress, typed_expr->offset);\n  }\n  if (!typed_expr->opcode.IsNaturallyAligned(typed_expr->align)) {\n    Writef(\"align=%\" PRIaddress, typed_expr->align);\n  }\n  WriteNewline(NO_FORCE_NEWLINE);\n}\n\nclass WatWriter::ExprVisitorDelegate : public ExprVisitor::Delegate {\n public:\n  explicit ExprVisitorDelegate(WatWriter* writer) : writer_(writer) {}\n\n  Result OnBinaryExpr(BinaryExpr*) override;\n  Result OnQuaternaryExpr(QuaternaryExpr*) override;\n  Result BeginBlockExpr(BlockExpr*) override;\n  Result EndBlockExpr(BlockExpr*) override;\n  Result OnBrExpr(BrExpr*) override;\n  Result OnBrIfExpr(BrIfExpr*) override;\n  Result OnBrOnNonNullExpr(BrOnNonNullExpr*) override;\n  Result OnBrOnNullExpr(BrOnNullExpr*) override;\n  Result OnBrTableExpr(BrTableExpr*) override;\n  Result OnCallExpr(CallExpr*) override;\n  Result OnCallIndirectExpr(CallIndirectExpr*) override;\n  Result OnCallRefExpr(CallRefExpr*) override;\n  Result OnCodeMetadataExpr(CodeMetadataExpr*) override;\n  Result OnCompareExpr(CompareExpr*) override;\n  Result OnConstExpr(ConstExpr*) override;\n  Result OnConvertExpr(ConvertExpr*) override;\n  Result OnDropExpr(DropExpr*) override;\n  Result OnGlobalGetExpr(GlobalGetExpr*) override;\n  Result OnGlobalSetExpr(GlobalSetExpr*) override;\n  Result BeginIfExpr(IfExpr*) override;\n  Result AfterIfTrueExpr(IfExpr*) override;\n  Result EndIfExpr(IfExpr*) override;\n  Result OnLoadExpr(LoadExpr*) override;\n  Result OnLocalGetExpr(LocalGetExpr*) override;\n  Result OnLocalSetExpr(LocalSetExpr*) override;\n  Result OnLocalTeeExpr(LocalTeeExpr*) override;\n  Result BeginLoopExpr(LoopExpr*) override;\n  Result EndLoopExpr(LoopExpr*) override;\n  Result OnMemoryCopyExpr(MemoryCopyExpr*) override;\n  Result OnDataDropExpr(DataDropExpr*) override;\n  Result OnMemoryFillExpr(MemoryFillExpr*) override;\n  Result OnMemoryGrowExpr(MemoryGrowExpr*) override;\n  Result OnMemoryInitExpr(MemoryInitExpr*) override;\n  Result OnMemorySizeExpr(MemorySizeExpr*) override;\n  Result OnTableCopyExpr(TableCopyExpr*) override;\n  Result OnElemDropExpr(ElemDropExpr*) override;\n  Result OnTableInitExpr(TableInitExpr*) override;\n  Result OnTableGetExpr(TableGetExpr*) override;\n  Result OnTableSetExpr(TableSetExpr*) override;\n  Result OnTableGrowExpr(TableGrowExpr*) override;\n  Result OnTableSizeExpr(TableSizeExpr*) override;\n  Result OnTableFillExpr(TableFillExpr*) override;\n  Result OnRefAsNonNullExpr(RefAsNonNullExpr*) override;\n  Result OnRefFuncExpr(RefFuncExpr*) override;\n  Result OnRefNullExpr(RefNullExpr*) override;\n  Result OnRefIsNullExpr(RefIsNullExpr*) override;\n  Result OnNopExpr(NopExpr*) override;\n  Result OnReturnExpr(ReturnExpr*) override;\n  Result OnReturnCallExpr(ReturnCallExpr*) override;\n  Result OnReturnCallIndirectExpr(ReturnCallIndirectExpr*) override;\n  Result OnReturnCallRefExpr(ReturnCallRefExpr*) override;\n  Result OnSelectExpr(SelectExpr*) override;\n  Result OnStoreExpr(StoreExpr*) override;\n  Result OnUnaryExpr(UnaryExpr*) override;\n  Result OnUnreachableExpr(UnreachableExpr*) override;\n  Result BeginTryExpr(TryExpr*) override;\n  Result BeginTryTableExpr(TryTableExpr*) override;\n  Result EndTryTableExpr(TryTableExpr*) override;\n  Result OnCatchExpr(TryExpr*, Catch*) override;\n  Result OnDelegateExpr(TryExpr*) override;\n  Result EndTryExpr(TryExpr*) override;\n  Result OnThrowExpr(ThrowExpr*) override;\n  Result OnThrowRefExpr(ThrowRefExpr*) override;\n  Result OnRethrowExpr(RethrowExpr*) override;\n  Result OnAtomicWaitExpr(AtomicWaitExpr*) override;\n  Result OnAtomicFenceExpr(AtomicFenceExpr*) override;\n  Result OnAtomicNotifyExpr(AtomicNotifyExpr*) override;\n  Result OnAtomicLoadExpr(AtomicLoadExpr*) override;\n  Result OnAtomicStoreExpr(AtomicStoreExpr*) override;\n  Result OnAtomicRmwExpr(AtomicRmwExpr*) override;\n  Result OnAtomicRmwCmpxchgExpr(AtomicRmwCmpxchgExpr*) override;\n  Result OnTernaryExpr(TernaryExpr*) override;\n  Result OnSimdLaneOpExpr(SimdLaneOpExpr*) override;\n  Result OnSimdLoadLaneExpr(SimdLoadLaneExpr*) override;\n  Result OnSimdStoreLaneExpr(SimdStoreLaneExpr*) override;\n  Result OnSimdShuffleOpExpr(SimdShuffleOpExpr*) override;\n  Result OnLoadSplatExpr(LoadSplatExpr*) override;\n  Result OnLoadZeroExpr(LoadZeroExpr*) override;\n\n private:\n  WatWriter* writer_;\n};\n\nResult WatWriter::ExprVisitorDelegate::OnBinaryExpr(BinaryExpr* expr) {\n  writer_->WritePutsNewline(expr->opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnTernaryExpr(TernaryExpr* expr) {\n  writer_->WritePutsNewline(expr->opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnQuaternaryExpr(QuaternaryExpr* expr) {\n  writer_->WritePutsNewline(expr->opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::BeginBlockExpr(BlockExpr* expr) {\n  writer_->WriteBeginBlock(LabelType::Block, expr->block,\n                           Opcode::Block_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::EndBlockExpr(BlockExpr* expr) {\n  writer_->WriteEndBlock();\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnBrExpr(BrExpr* expr) {\n  writer_->WritePutsSpace(Opcode::Br_Opcode.GetName());\n  writer_->WriteBrVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnBrIfExpr(BrIfExpr* expr) {\n  writer_->WritePutsSpace(Opcode::BrIf_Opcode.GetName());\n  writer_->WriteBrVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnBrOnNonNullExpr(\n    BrOnNonNullExpr* expr) {\n  writer_->WritePutsSpace(Opcode::BrOnNonNull_Opcode.GetName());\n  writer_->WriteBrVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnBrOnNullExpr(BrOnNullExpr* expr) {\n  writer_->WritePutsSpace(Opcode::BrOnNull_Opcode.GetName());\n  writer_->WriteBrVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnBrTableExpr(BrTableExpr* expr) {\n  writer_->WritePutsSpace(Opcode::BrTable_Opcode.GetName());\n  for (const Var& var : expr->targets) {\n    writer_->WriteBrVar(var, NextChar::Space);\n  }\n  writer_->WriteBrVar(expr->default_target, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnCallExpr(CallExpr* expr) {\n  writer_->WritePutsSpace(Opcode::Call_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnCallIndirectExpr(\n    CallIndirectExpr* expr) {\n  writer_->WritePutsSpace(Opcode::CallIndirect_Opcode.GetName());\n  writer_->WriteVarUnlessZero(expr->table, NextChar::Space);\n  writer_->WriteOpenSpace(\"type\");\n  const auto type_var =\n      expr->decl.has_func_type\n          ? expr->decl.type_var\n          : Var{writer_->module.GetFuncTypeIndex(expr->decl), expr->loc};\n  writer_->WriteVar(type_var, NextChar::Newline);\n  writer_->WriteCloseNewline();\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnCallRefExpr(CallRefExpr* expr) {\n  writer_->WritePutsSpace(Opcode::CallRef_Opcode.GetName());\n  writer_->WriteVar(expr->sig_type, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnCodeMetadataExpr(\n    CodeMetadataExpr* expr) {\n  writer_->WriteOpen(\"@metadata.code.\", NextChar::None);\n  writer_->WriteDataWithNextChar(expr->name.data(), expr->name.size());\n  writer_->WritePutc(' ');\n  writer_->WriteQuotedData(expr->data.data(), expr->data.size());\n  writer_->WriteCloseSpace();\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnCompareExpr(CompareExpr* expr) {\n  writer_->WritePutsNewline(expr->opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnConstExpr(ConstExpr* expr) {\n  writer_->WriteConst(expr->const_);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnConvertExpr(ConvertExpr* expr) {\n  writer_->WritePutsNewline(expr->opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnDropExpr(DropExpr* expr) {\n  writer_->WritePutsNewline(Opcode::Drop_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnGlobalGetExpr(GlobalGetExpr* expr) {\n  writer_->WritePutsSpace(Opcode::GlobalGet_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnGlobalSetExpr(GlobalSetExpr* expr) {\n  writer_->WritePutsSpace(Opcode::GlobalSet_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::BeginIfExpr(IfExpr* expr) {\n  writer_->WriteBeginBlock(LabelType::If, expr->true_,\n                           Opcode::If_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::AfterIfTrueExpr(IfExpr* expr) {\n  if (!expr->false_.empty()) {\n    writer_->Dedent();\n    writer_->WritePutsSpace(Opcode::Else_Opcode.GetName());\n    writer_->Indent();\n    writer_->WriteNewline(FORCE_NEWLINE);\n  }\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::EndIfExpr(IfExpr* expr) {\n  writer_->WriteEndBlock();\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnLoadExpr(LoadExpr* expr) {\n  writer_->WriteMemoryLoadStoreExpr<LoadExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnLocalGetExpr(LocalGetExpr* expr) {\n  writer_->WritePutsSpace(Opcode::LocalGet_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnLocalSetExpr(LocalSetExpr* expr) {\n  writer_->WritePutsSpace(Opcode::LocalSet_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnLocalTeeExpr(LocalTeeExpr* expr) {\n  writer_->WritePutsSpace(Opcode::LocalTee_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::BeginLoopExpr(LoopExpr* expr) {\n  writer_->WriteBeginBlock(LabelType::Loop, expr->block,\n                           Opcode::Loop_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::EndLoopExpr(LoopExpr* expr) {\n  writer_->WriteEndBlock();\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnMemoryCopyExpr(MemoryCopyExpr* expr) {\n  writer_->WritePutsSpace(Opcode::MemoryCopy_Opcode.GetName());\n  writer_->WriteTwoMemoryVarsUnlessBothZero(expr->destmemidx, expr->srcmemidx,\n                                            NextChar::Space);\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnDataDropExpr(DataDropExpr* expr) {\n  writer_->WritePutsSpace(Opcode::DataDrop_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnMemoryFillExpr(MemoryFillExpr* expr) {\n  writer_->WritePutsSpace(Opcode::MemoryFill_Opcode.GetName());\n  writer_->WriteMemoryVarUnlessZero(expr->memidx, NextChar::Space);\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnMemoryGrowExpr(MemoryGrowExpr* expr) {\n  writer_->WritePutsSpace(Opcode::MemoryGrow_Opcode.GetName());\n  writer_->WriteMemoryVarUnlessZero(expr->memidx, NextChar::Space);\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnMemorySizeExpr(MemorySizeExpr* expr) {\n  writer_->WritePutsSpace(Opcode::MemorySize_Opcode.GetName());\n  writer_->WriteMemoryVarUnlessZero(expr->memidx, NextChar::Space);\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnMemoryInitExpr(MemoryInitExpr* expr) {\n  writer_->WritePutsSpace(Opcode::MemoryInit_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Space);\n  writer_->WriteMemoryVarUnlessZero(expr->memidx, NextChar::Space);\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnTableCopyExpr(TableCopyExpr* expr) {\n  writer_->WritePutsSpace(Opcode::TableCopy_Opcode.GetName());\n  if (!(VarIsZero(expr->dst_table) && VarIsZero(expr->src_table))) {\n    writer_->WriteVar(expr->dst_table, NextChar::Space);\n    writer_->WriteVar(expr->src_table, NextChar::Space);\n  }\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnElemDropExpr(ElemDropExpr* expr) {\n  writer_->WritePutsSpace(Opcode::ElemDrop_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnTableInitExpr(TableInitExpr* expr) {\n  writer_->WritePutsSpace(Opcode::TableInit_Opcode.GetName());\n  writer_->WriteVarUnlessZero(expr->table_index, NextChar::Space);\n  writer_->WriteVar(expr->segment_index, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnTableGetExpr(TableGetExpr* expr) {\n  writer_->WritePutsSpace(Opcode::TableGet_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnTableSetExpr(TableSetExpr* expr) {\n  writer_->WritePutsSpace(Opcode::TableSet_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnTableGrowExpr(TableGrowExpr* expr) {\n  writer_->WritePutsSpace(Opcode::TableGrow_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnTableSizeExpr(TableSizeExpr* expr) {\n  writer_->WritePutsSpace(Opcode::TableSize_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnTableFillExpr(TableFillExpr* expr) {\n  writer_->WritePutsSpace(Opcode::TableFill_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnRefAsNonNullExpr(\n    RefAsNonNullExpr* expr) {\n  writer_->WritePutsNewline(Opcode::RefAsNonNull_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnRefFuncExpr(RefFuncExpr* expr) {\n  writer_->WritePutsSpace(Opcode::RefFunc_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnRefNullExpr(RefNullExpr* expr) {\n  writer_->WritePutsSpace(Opcode::RefNull_Opcode.GetName());\n  if (expr->type.opt_type() != Type::RefNull) {\n    assert(!Type(expr->type.opt_type()).IsReferenceWithIndex());\n    writer_->WriteRefKind(expr->type.opt_type(), NextChar::Newline);\n  } else {\n    writer_->WriteVar(expr->type, NextChar::Newline);\n  }\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnRefIsNullExpr(RefIsNullExpr* expr) {\n  writer_->WritePutsNewline(Opcode::RefIsNull_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnNopExpr(NopExpr* expr) {\n  writer_->WritePutsNewline(Opcode::Nop_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnReturnExpr(ReturnExpr* expr) {\n  writer_->WritePutsNewline(Opcode::Return_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnReturnCallExpr(ReturnCallExpr* expr) {\n  writer_->WritePutsSpace(Opcode::ReturnCall_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnReturnCallIndirectExpr(\n    ReturnCallIndirectExpr* expr) {\n  writer_->WritePutsSpace(Opcode::ReturnCallIndirect_Opcode.GetName());\n  writer_->WriteOpenSpace(\"type\");\n  const auto type_var =\n      expr->decl.has_func_type\n          ? expr->decl.type_var\n          : Var{writer_->module.GetFuncTypeIndex(expr->decl), expr->loc};\n  writer_->WriteVar(type_var, NextChar::Space);\n  writer_->WriteCloseNewline();\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnReturnCallRefExpr(\n    ReturnCallRefExpr* expr) {\n  writer_->WritePutsSpace(Opcode::ReturnCallRef_Opcode.GetName());\n  writer_->WriteVar(expr->sig_type, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnSelectExpr(SelectExpr* expr) {\n  writer_->WritePutsSpace(Opcode::Select_Opcode.GetName());\n  if (!expr->result_type.empty()) {\n    writer_->WriteTypes(expr->result_type, \"result\");\n  }\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnStoreExpr(StoreExpr* expr) {\n  writer_->WriteMemoryLoadStoreExpr<StoreExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnUnaryExpr(UnaryExpr* expr) {\n  writer_->WritePutsNewline(expr->opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnUnreachableExpr(\n    UnreachableExpr* expr) {\n  writer_->WritePutsNewline(Opcode::Unreachable_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::BeginTryTableExpr(TryTableExpr* expr) {\n  // copied from WriteBeginBlock, try_table needs to push label *after*\n  // writing catches\n  writer_->WritePutsSpace(Opcode::TryTable_Opcode.GetName());\n  bool has_label = !expr->block.label.empty();\n  if (has_label) {\n    writer_->WriteString(expr->block.label, NextChar::Space);\n  }\n  writer_->WriteTypes(expr->block.decl.sig.param_types, \"param\");\n  writer_->WriteTypes(expr->block.decl.sig.result_types, \"result\");\n  if (!has_label) {\n    writer_->Writef(\" ;; label = @%\" PRIindex, writer_->GetLabelStackSize());\n  }\n  writer_->WriteNewline(FORCE_NEWLINE);\n  writer_->Indent();\n  for (const auto& catch_ : expr->catches) {\n    writer_->WritePuts(\"(\", NextChar::None);\n    switch (catch_.kind) {\n      case CatchKind::Catch:\n        writer_->WritePutsSpace(\"catch\");\n        break;\n      case CatchKind::CatchRef:\n        writer_->WritePutsSpace(\"catch_ref\");\n        break;\n      case CatchKind::CatchAll:\n        writer_->WritePutsSpace(\"catch_all\");\n        break;\n      case CatchKind::CatchAllRef:\n        writer_->WritePutsSpace(\"catch_all_ref\");\n        break;\n    }\n    if (catch_.kind == CatchKind::Catch || catch_.kind == CatchKind::CatchRef) {\n      writer_->WriteVar(catch_.tag, NextChar::Space);\n    }\n    writer_->WriteBrVar(catch_.target, NextChar::None);\n    writer_->WritePuts(\")\", NextChar::Newline);\n  }\n  writer_->BeginBlock(LabelType::TryTable, expr->block);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::EndTryTableExpr(TryTableExpr* expr) {\n  writer_->WriteEndBlock();\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::BeginTryExpr(TryExpr* expr) {\n  writer_->WriteBeginBlock(LabelType::Try, expr->block,\n                           Opcode::Try_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnCatchExpr(TryExpr* expr,\n                                                   Catch* catch_) {\n  writer_->Dedent();\n  if (catch_->IsCatchAll()) {\n    writer_->WritePutsNewline(Opcode::CatchAll_Opcode.GetName());\n  } else {\n    writer_->WritePutsSpace(Opcode::Catch_Opcode.GetName());\n    writer_->WriteVar(catch_->var, NextChar::Newline);\n  }\n  writer_->Indent();\n  writer_->SetTopLabelType(LabelType::Catch);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnDelegateExpr(TryExpr* expr) {\n  writer_->Dedent();\n  writer_->EndBlock();\n  writer_->WritePutsSpace(Opcode::Delegate_Opcode.GetName());\n  writer_->WriteVar(expr->delegate_target, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::EndTryExpr(TryExpr* expr) {\n  writer_->WriteEndBlock();\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnThrowExpr(ThrowExpr* expr) {\n  writer_->WritePutsSpace(Opcode::Throw_Opcode.GetName());\n  writer_->WriteVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnThrowRefExpr(ThrowRefExpr* expr) {\n  writer_->WritePutsNewline(Opcode::ThrowRef_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnRethrowExpr(RethrowExpr* expr) {\n  writer_->WritePutsSpace(Opcode::Rethrow_Opcode.GetName());\n  writer_->WriteBrVar(expr->var, NextChar::Newline);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnAtomicWaitExpr(AtomicWaitExpr* expr) {\n  writer_->WriteLoadStoreExpr<AtomicWaitExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnAtomicFenceExpr(\n    AtomicFenceExpr* expr) {\n  assert(expr->consistency_model == 0);\n  writer_->WritePutsNewline(Opcode::AtomicFence_Opcode.GetName());\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnAtomicNotifyExpr(\n    AtomicNotifyExpr* expr) {\n  writer_->WriteLoadStoreExpr<AtomicNotifyExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnAtomicLoadExpr(AtomicLoadExpr* expr) {\n  writer_->WriteLoadStoreExpr<AtomicLoadExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnAtomicStoreExpr(\n    AtomicStoreExpr* expr) {\n  writer_->WriteLoadStoreExpr<AtomicStoreExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnAtomicRmwExpr(AtomicRmwExpr* expr) {\n  writer_->WriteLoadStoreExpr<AtomicRmwExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnAtomicRmwCmpxchgExpr(\n    AtomicRmwCmpxchgExpr* expr) {\n  writer_->WriteLoadStoreExpr<AtomicRmwCmpxchgExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnSimdLaneOpExpr(SimdLaneOpExpr* expr) {\n  writer_->WritePutsSpace(expr->opcode.GetName());\n  writer_->Writef(\"%\" PRIu64, (expr->val));\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnSimdLoadLaneExpr(\n    SimdLoadLaneExpr* expr) {\n  writer_->WritePutsSpace(expr->opcode.GetName());\n  writer_->WriteMemoryVarUnlessZero(expr->memidx, NextChar::Space);\n  if (expr->offset) {\n    writer_->Writef(\"offset=%\" PRIaddress, expr->offset);\n  }\n  if (!expr->opcode.IsNaturallyAligned(expr->align)) {\n    writer_->Writef(\"align=%\" PRIaddress, expr->align);\n  }\n  writer_->Writef(\"%\" PRIu64, (expr->val));\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnSimdStoreLaneExpr(\n    SimdStoreLaneExpr* expr) {\n  writer_->WritePutsSpace(expr->opcode.GetName());\n  writer_->WriteMemoryVarUnlessZero(expr->memidx, NextChar::Space);\n  if (expr->offset) {\n    writer_->Writef(\"offset=%\" PRIaddress, expr->offset);\n  }\n  if (!expr->opcode.IsNaturallyAligned(expr->align)) {\n    writer_->Writef(\"align=%\" PRIaddress, expr->align);\n  }\n  writer_->Writef(\"%\" PRIu64, (expr->val));\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnSimdShuffleOpExpr(\n    SimdShuffleOpExpr* expr) {\n  writer_->WritePutsSpace(expr->opcode.GetName());\n  std::array<uint8_t, 16> values = Bitcast<std::array<uint8_t, 16>>(expr->val);\n  for (int32_t lane = 0; lane < 16; ++lane) {\n#if WABT_BIG_ENDIAN\n    writer_->Writef(\"%u\", values[15 - lane]);\n#else\n    writer_->Writef(\"%u\", values[lane]);\n#endif\n  }\n  writer_->WriteNewline(NO_FORCE_NEWLINE);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnLoadSplatExpr(LoadSplatExpr* expr) {\n  writer_->WriteLoadStoreExpr<LoadSplatExpr>(expr);\n  return Result::Ok;\n}\n\nResult WatWriter::ExprVisitorDelegate::OnLoadZeroExpr(LoadZeroExpr* expr) {\n  writer_->WriteLoadStoreExpr<LoadZeroExpr>(expr);\n  return Result::Ok;\n}\n\nvoid WatWriter::WriteExpr(const Expr* expr) {\n  WABT_TRACE(WriteExprList);\n  ExprVisitorDelegate delegate(this);\n  ExprVisitor visitor(&delegate);\n  visitor.VisitExpr(const_cast<Expr*>(expr));\n}\n\nvoid WatWriter::WriteExprList(const ExprList& exprs) {\n  WABT_TRACE(WriteExprList);\n  ExprVisitorDelegate delegate(this);\n  ExprVisitor visitor(&delegate);\n  visitor.VisitExprList(const_cast<ExprList&>(exprs));\n}\n\nvoid WatWriter::WriteFoldedExpr(const Expr* expr) {\n  WABT_TRACE_ARGS(WriteFoldedExpr, \"%s\", GetExprTypeName(*expr));\n  auto arity = GetExprArity(*expr);\n  PushExpr(expr, arity.nargs, arity.nreturns);\n}\n\nvoid WatWriter::WriteFoldedExprList(const ExprList& exprs) {\n  WABT_TRACE(WriteFoldedExprList);\n  for (const Expr& expr : exprs) {\n    WriteFoldedExpr(&expr);\n  }\n}\n\nvoid WatWriter::PushExpr(const Expr* expr,\n                         Index operand_count,\n                         Index result_count) {\n  WABT_TRACE_ARGS(PushExpr, \"%s, %\" PRIindex \", %\" PRIindex \"\",\n                  GetExprTypeName(*expr), operand_count, result_count);\n\n  // Try to pop operand off the expr stack to use as this expr's children. One\n  // expr can have multiple return values (with the multi-value extension), so\n  // we have to iterate over each in reverse.\n\n  auto first_operand = expr_tree_stack_.end();\n\n  Index current_count = 0;\n  if (operand_count > 0) {\n    for (auto iter = expr_tree_stack_.rbegin(); iter != expr_tree_stack_.rend();\n         ++iter) {\n      assert(iter->result_count > 0);\n      current_count += iter->result_count;\n\n      if (current_count == operand_count) {\n        first_operand = iter.base() - 1;\n        break;\n      } else if (current_count > operand_count) {\n        // We went over the number of operands this instruction wants; this can\n        // only happen when there are expressions on the stack with a\n        // result_count > 1. When this happens we can't fold, since any result\n        // we produce will not make sense.\n        break;\n      }\n    }\n  }\n\n  ExprTree tree(expr, result_count);\n\n  if (current_count == operand_count && operand_count > 0) {\n    auto last_operand = expr_tree_stack_.end();\n    std::move(first_operand, last_operand, std::back_inserter(tree.children));\n    expr_tree_stack_.erase(first_operand, last_operand);\n  }\n\n  expr_tree_stack_.emplace_back(std::move(tree));\n  if (current_count > operand_count || result_count == 0) {\n    FlushExprTreeStack();\n  }\n}\n\nvoid WatWriter::FlushExprTree(const ExprTree& expr_tree) {\n  WABT_TRACE_ARGS(FlushExprTree, \"%s\", GetExprTypeName(*expr_tree.expr));\n  switch (expr_tree.expr->type()) {\n    case ExprType::Block:\n      WritePuts(\"(\", NextChar::None);\n      WriteBeginBlock(LabelType::Block, cast<BlockExpr>(expr_tree.expr)->block,\n                      Opcode::Block_Opcode.GetName());\n      WriteFoldedExprList(cast<BlockExpr>(expr_tree.expr)->block.exprs);\n      FlushExprTreeStack();\n      WriteCloseNewline();\n      EndBlock();\n      break;\n\n    case ExprType::Loop:\n      WritePuts(\"(\", NextChar::None);\n      WriteBeginBlock(LabelType::Loop, cast<LoopExpr>(expr_tree.expr)->block,\n                      Opcode::Loop_Opcode.GetName());\n      WriteFoldedExprList(cast<LoopExpr>(expr_tree.expr)->block.exprs);\n      FlushExprTreeStack();\n      WriteCloseNewline();\n      EndBlock();\n      break;\n\n    case ExprType::If: {\n      auto if_expr = cast<IfExpr>(expr_tree.expr);\n      WritePuts(\"(\", NextChar::None);\n      WriteBeginBlock(LabelType::If, if_expr->true_,\n                      Opcode::If_Opcode.GetName());\n      FlushExprTreeVector(expr_tree.children);\n      WriteOpenNewline(\"then\");\n      WriteFoldedExprList(if_expr->true_.exprs);\n      FlushExprTreeStack();\n      WriteCloseNewline();\n      if (!if_expr->false_.empty()) {\n        WriteOpenNewline(\"else\");\n        WriteFoldedExprList(if_expr->false_);\n        FlushExprTreeStack();\n        WriteCloseNewline();\n      }\n      WriteCloseNewline();\n      EndBlock();\n      break;\n    }\n\n    case ExprType::Try: {\n      auto try_expr = cast<TryExpr>(expr_tree.expr);\n      WritePuts(\"(\", NextChar::None);\n      WriteBeginBlock(LabelType::Try, try_expr->block,\n                      Opcode::Try_Opcode.GetName());\n      WriteOpenNewline(\"do\");\n      FlushExprTreeVector(expr_tree.children);\n      WriteFoldedExprList(try_expr->block.exprs);\n      FlushExprTreeStack();\n      WriteCloseNewline();\n      switch (try_expr->kind) {\n        case TryKind::Catch:\n          for (const Catch& catch_ : try_expr->catches) {\n            WritePuts(\"(\", NextChar::None);\n            if (catch_.IsCatchAll()) {\n              WritePutsNewline(\"catch_all\");\n            } else {\n              WritePutsSpace(Opcode::Catch_Opcode.GetName());\n              WriteVar(catch_.var, NextChar::Newline);\n            }\n            Indent();\n            WriteFoldedExprList(catch_.exprs);\n            FlushExprTreeStack();\n            WriteCloseNewline();\n          }\n          break;\n        case TryKind::Delegate:\n          WritePuts(\"(\", NextChar::None);\n          WritePutsSpace(Opcode::Delegate_Opcode.GetName());\n          WriteVar(try_expr->delegate_target, NextChar::None);\n          WritePuts(\")\", NextChar::Newline);\n          break;\n        case TryKind::Plain:\n          // Nothing to do.\n          break;\n      }\n      WriteCloseNewline();\n      EndBlock();\n      break;\n    }\n\n    case ExprType::TryTable: {\n      auto try_table_expr = cast<TryTableExpr>(expr_tree.expr);\n\n      WritePuts(\"(\", NextChar::None);\n      // copied from WriteBeginBlock, try_table needs to push label *after*\n      // writing catches\n      WritePutsSpace(Opcode::TryTable_Opcode.GetName());\n      bool has_label = !try_table_expr->block.label.empty();\n      if (has_label) {\n        WriteString(try_table_expr->block.label, NextChar::Space);\n      }\n      WriteTypes(try_table_expr->block.decl.sig.param_types, \"param\");\n      WriteTypes(try_table_expr->block.decl.sig.result_types, \"result\");\n      if (!has_label) {\n        Writef(\" ;; label = @%\" PRIindex, GetLabelStackSize());\n      }\n      WriteNewline(FORCE_NEWLINE);\n      Indent();\n\n      for (const auto& catch_ : try_table_expr->catches) {\n        WritePuts(\"(\", NextChar::None);\n        switch (catch_.kind) {\n          case CatchKind::Catch:\n            WritePutsSpace(\"catch\");\n            break;\n          case CatchKind::CatchRef:\n            WritePutsSpace(\"catch_ref\");\n            break;\n          case CatchKind::CatchAll:\n            WritePutsSpace(\"catch_all\");\n            break;\n          case CatchKind::CatchAllRef:\n            WritePutsSpace(\"catch_all_ref\");\n            break;\n        }\n        if (catch_.kind == CatchKind::Catch ||\n            catch_.kind == CatchKind::CatchRef) {\n          WriteVar(catch_.tag, NextChar::Space);\n        }\n        WriteBrVar(catch_.target, NextChar::None);\n        WritePuts(\")\", NextChar::Newline);\n      }\n\n      BeginBlock(LabelType::TryTable, try_table_expr->block);\n\n      WriteFoldedExprList(try_table_expr->block.exprs);\n      FlushExprTreeStack();\n      WriteCloseNewline();\n      EndBlock();\n      break;\n    }\n\n    default: {\n      WritePuts(\"(\", NextChar::None);\n      WriteExpr(expr_tree.expr);\n      Indent();\n      FlushExprTreeVector(expr_tree.children);\n      WriteCloseNewline();\n      break;\n    }\n  }\n}\n\nvoid WatWriter::FlushExprTreeVector(const std::vector<ExprTree>& expr_trees) {\n  WABT_TRACE_ARGS(FlushExprTreeVector, \"%zu\", expr_trees.size());\n  for (auto expr_tree : expr_trees) {\n    FlushExprTree(expr_tree);\n  }\n}\n\nvoid WatWriter::FlushExprTreeStack() {\n  std::vector<ExprTree> stack_copy(std::move(expr_tree_stack_));\n  expr_tree_stack_.clear();\n  FlushExprTreeVector(stack_copy);\n}\n\nvoid WatWriter::WriteInitExpr(const ExprList& expr) {\n  if (!expr.empty()) {\n    WritePuts(\"(\", NextChar::None);\n    WriteExprList(expr);\n    /* clear the next char, so we don't write a newline after the expr */\n    next_char_ = NextChar::None;\n    WritePuts(\")\", NextChar::Space);\n  }\n}\n\ntemplate <typename T>\nvoid WatWriter::WriteTypeBindings(const char* prefix,\n                                  const T& types,\n                                  const std::vector<std::string>& index_to_name,\n                                  Index binding_index_offset) {\n  /* named params/locals must be specified by themselves, but nameless\n   * params/locals can be compressed, e.g.:\n   *   (param $foo i32)\n   *   (param i32 i64 f32)\n   */\n  bool first = true;\n  bool prev_has_name = false;\n  size_t index = 0;\n  for (Type type : types) {\n    const std::string& name = index_to_name[binding_index_offset + index];\n    bool has_name = !name.empty();\n    if ((has_name || prev_has_name) && !first) {\n      WriteCloseSpace();\n    }\n    if (has_name || prev_has_name || first) {\n      WriteOpenSpace(prefix);\n    }\n    if (has_name) {\n      WriteString(name, NextChar::Space);\n    }\n    WriteType(type, NextChar::Space);\n    prev_has_name = has_name;\n    first = false;\n    ++index;\n  }\n  if (types.size() != 0) {\n    WriteCloseSpace();\n  }\n}\n\nvoid WatWriter::WriteBeginFunc(const Func& func) {\n  WriteOpenSpace(\"func\");\n  WriteNameOrIndex(func.name, func_index_, NextChar::Space);\n  WriteInlineExports(ExternalKind::Func, func_index_);\n  WriteInlineImport(ExternalKind::Func, func_index_);\n  if (func.decl.has_func_type) {\n    WriteOpenSpace(\"type\");\n    WriteVar(func.decl.type_var, NextChar::None);\n    WriteCloseSpace();\n  }\n\n  if (module.IsImport(ExternalKind::Func, Var(func_index_, Location()))) {\n    // Imported functions can be written a few ways:\n    //\n    //   1. (import \"module\" \"field\" (func (type 0)))\n    //   2. (import \"module\" \"field\" (func (param i32) (result i32)))\n    //   3. (func (import \"module\" \"field\") (type 0))\n    //   4. (func (import \"module\" \"field\") (param i32) (result i32))\n    //   5. (func (import \"module\" \"field\") (type 0) (param i32) (result i32))\n    //\n    // Note that the text format does not allow including the param/result\n    // explicitly when using the \"(import...\" syntax (#1 and #2).\n    if (options_.inline_import || !func.decl.has_func_type) {\n      WriteFuncSigSpace(func.decl.sig);\n    }\n  }\n  func_index_++;\n}\n\nvoid WatWriter::WriteFunc(const Func& func) {\n  WriteBeginFunc(func);\n  std::vector<std::string> index_to_name;\n  MakeTypeBindingReverseMapping(func.GetNumParamsAndLocals(), func.bindings,\n                                &index_to_name);\n  WriteTypeBindings(\"param\", func.decl.sig.param_types, index_to_name);\n  WriteTypes(func.decl.sig.result_types, \"result\");\n  WriteNewline(NO_FORCE_NEWLINE);\n  if (func.local_types.size()) {\n    WriteTypeBindings(\"local\", func.local_types, index_to_name,\n                      func.GetNumParams());\n  }\n  WriteNewline(NO_FORCE_NEWLINE);\n  BeginFunc(func);\n  if (options_.fold_exprs) {\n    WriteFoldedExprList(func.exprs);\n    FlushExprTreeStack();\n  } else {\n    WriteExprList(func.exprs);\n  }\n  EndFunc();\n  WriteCloseNewline();\n}\n\nvoid WatWriter::WriteBeginGlobal(const Global& global) {\n  WriteOpenSpace(\"global\");\n  WriteNameOrIndex(global.name, global_index_, NextChar::Space);\n  WriteInlineExports(ExternalKind::Global, global_index_);\n  WriteInlineImport(ExternalKind::Global, global_index_);\n  if (global.mutable_) {\n    WriteOpenSpace(\"mut\");\n    WriteType(global.type, NextChar::Space);\n    WriteCloseSpace();\n  } else {\n    WriteType(global.type, NextChar::Space);\n  }\n  global_index_++;\n}\n\nvoid WatWriter::WriteGlobal(const Global& global) {\n  WriteBeginGlobal(global);\n  WriteInitExpr(global.init_expr);\n  WriteCloseNewline();\n}\n\nvoid WatWriter::WriteTag(const Tag& tag) {\n  WriteOpenSpace(\"tag\");\n  WriteNameOrIndex(tag.name, tag_index_, NextChar::Space);\n  WriteInlineExports(ExternalKind::Tag, tag_index_);\n  WriteInlineImport(ExternalKind::Tag, tag_index_);\n  if (tag.decl.has_func_type) {\n    WriteOpenSpace(\"type\");\n    WriteVar(tag.decl.type_var, NextChar::None);\n    WriteCloseSpace();\n  }\n  WriteTypes(tag.decl.sig.param_types, \"param\");\n  ++tag_index_;\n  WriteCloseNewline();\n}\n\nvoid WatWriter::WriteLimits(const Limits& limits) {\n  if (limits.is_64) {\n    Writef(\"i64\");\n  }\n  Writef(\"%\" PRIu64, limits.initial);\n  if (limits.has_max) {\n    Writef(\"%\" PRIu64, limits.max);\n  }\n  if (limits.is_shared) {\n    Writef(\"shared\");\n  }\n}\n\nvoid WatWriter::WriteTable(const Table& table) {\n  WriteOpenSpace(\"table\");\n  WriteNameOrIndex(table.name, table_index_, NextChar::Space);\n  WriteInlineExports(ExternalKind::Table, table_index_);\n  WriteInlineImport(ExternalKind::Table, table_index_);\n  WriteLimits(table.elem_limits);\n  WriteType(table.elem_type, NextChar::None);\n  WriteCloseNewline();\n  table_index_++;\n}\n\nvoid WatWriter::WriteElemSegment(const ElemSegment& segment) {\n  WriteOpenSpace(\"elem\");\n  // The first name we encounter here, pre-bulk-memory, was intended to refer to\n  // the table while segment names were not supported at all.  For this reason\n  // we cannot emit a segment name here without bulk-memory enabled, otherwise\n  // the name will be assumed to be the name of a table and parsing will fail.\n  if (options_.features.bulk_memory_enabled()) {\n    WriteNameOrIndex(segment.name, elem_segment_index_, NextChar::Space);\n  } else {\n    Writef(\"(;%u;)\", elem_segment_index_);\n  }\n\n  uint8_t flags = segment.GetFlags(\n      &module, options_.features.function_references_enabled());\n\n  if ((flags & (SegPassive | SegExplicitIndex)) == SegExplicitIndex) {\n    WriteOpenSpace(\"table\");\n    WriteVar(segment.table_var, NextChar::Space);\n    WriteCloseSpace();\n  }\n\n  if (!(flags & SegPassive)) {\n    WriteInitExpr(segment.offset);\n  }\n\n  if ((flags & SegDeclared) == SegDeclared) {\n    WritePuts(\"declare\", NextChar::Space);\n  }\n\n  if (flags & SegUseElemExprs) {\n    WriteType(segment.elem_type, NextChar::Space);\n  } else {\n    assert(segment.elem_type == Type::FuncRef);\n    WritePuts(\"func\", NextChar::Space);\n  }\n\n  for (const ExprList& expr : segment.elem_exprs) {\n    if (flags & SegUseElemExprs) {\n      WriteInitExpr(expr);\n    } else {\n      assert(expr.size() == 1);\n      assert(expr.front().type() == ExprType::RefFunc);\n      WriteVar(cast<const RefFuncExpr>(&expr.front())->var, NextChar::Space);\n    }\n  }\n  WriteCloseNewline();\n  elem_segment_index_++;\n}\n\nvoid WatWriter::WriteMemory(const Memory& memory) {\n  WriteOpenSpace(\"memory\");\n  WriteNameOrIndex(memory.name, memory_index_, NextChar::Space);\n  WriteInlineExports(ExternalKind::Memory, memory_index_);\n  WriteInlineImport(ExternalKind::Memory, memory_index_);\n  WriteLimits(memory.page_limits);\n  if (memory.page_size != WABT_DEFAULT_PAGE_SIZE) {\n    WriteOpenSpace(\"pagesize\");\n    Writef(\"%u\", memory.page_size);\n    WriteCloseSpace();\n  }\n  WriteCloseNewline();\n  memory_index_++;\n}\n\nvoid WatWriter::WriteDataSegment(const DataSegment& segment) {\n  WriteOpenSpace(\"data\");\n  WriteNameOrIndex(segment.name, data_segment_index_, NextChar::Space);\n  if (segment.kind != SegmentKind::Passive) {\n    if (module.GetMemoryIndex(segment.memory_var) != 0) {\n      WriteOpenSpace(\"memory\");\n      WriteVar(segment.memory_var, NextChar::Space);\n      WriteCloseSpace();\n    }\n    WriteInitExpr(segment.offset);\n  }\n  WriteQuotedData(segment.data.data(), segment.data.size());\n  WriteCloseNewline();\n  data_segment_index_++;\n}\n\nvoid WatWriter::WriteImport(const Import& import) {\n  if (!options_.inline_import) {\n    WriteOpenSpace(\"import\");\n    WriteQuotedString(import.module_name, NextChar::Space);\n    WriteQuotedString(import.field_name, NextChar::Space);\n  }\n\n  switch (import.kind()) {\n    case ExternalKind::Func:\n      WriteBeginFunc(cast<FuncImport>(&import)->func);\n      WriteCloseSpace();\n      break;\n\n    case ExternalKind::Table:\n      WriteTable(cast<TableImport>(&import)->table);\n      break;\n\n    case ExternalKind::Memory:\n      WriteMemory(cast<MemoryImport>(&import)->memory);\n      break;\n\n    case ExternalKind::Global:\n      WriteBeginGlobal(cast<GlobalImport>(&import)->global);\n      WriteCloseSpace();\n      break;\n\n    case ExternalKind::Tag:\n      WriteTag(cast<TagImport>(&import)->tag);\n      break;\n  }\n\n  if (options_.inline_import) {\n    WriteNewline(NO_FORCE_NEWLINE);\n  } else {\n    WriteCloseNewline();\n  }\n}\n\nvoid WatWriter::WriteExport(const Export& export_) {\n  if (options_.inline_export && IsInlineExport(export_)) {\n    return;\n  }\n  WriteOpenSpace(\"export\");\n  WriteQuotedString(export_.name, NextChar::Space);\n  WriteOpenSpace(GetKindName(export_.kind));\n  WriteVar(export_.var, NextChar::Space);\n  WriteCloseSpace();\n  WriteCloseNewline();\n}\n\nvoid WatWriter::WriteTypeEntry(const TypeEntry& type) {\n  WriteOpenSpace(\"type\");\n  WriteNameOrIndex(type.name, type_index_++, NextChar::Space);\n  switch (type.kind()) {\n    case TypeEntryKind::Func:\n      WriteOpenSpace(\"func\");\n      WriteFuncSigSpace(cast<FuncType>(&type)->sig);\n      WriteCloseSpace();\n      break;\n\n    case TypeEntryKind::Struct: {\n      auto* struct_type = cast<StructType>(&type);\n      WriteOpenSpace(\"struct\");\n      Index field_index = 0;\n      for (auto&& field : struct_type->fields) {\n        // TODO: Write shorthand if there is no name.\n        WriteOpenSpace(\"field\");\n        WriteNameOrIndex(field.name, field_index++, NextChar::Space);\n        WriteField(field);\n        WriteCloseSpace();\n      }\n      WriteCloseSpace();\n      break;\n    }\n\n    case TypeEntryKind::Array: {\n      auto* array_type = cast<ArrayType>(&type);\n      WriteOpenSpace(\"array\");\n      WriteField(array_type->field);\n      WriteCloseSpace();\n      break;\n    }\n  }\n  WriteCloseNewline();\n}\n\nvoid WatWriter::WriteField(const Field& field) {\n  if (field.mutable_) {\n    WriteOpenSpace(\"mut\");\n  }\n  WriteType(field.type, NextChar::Space);\n  if (field.mutable_) {\n    WriteCloseSpace();\n  }\n}\n\nvoid WatWriter::WriteStartFunction(const Var& start) {\n  WriteOpenSpace(\"start\");\n  WriteVar(start, NextChar::None);\n  WriteCloseNewline();\n}\n\nvoid WatWriter::WriteCustom(const Custom& custom) {\n  WriteOpenSpace(\"@custom\");\n  WriteQuotedString(custom.name, NextChar::Space);\n  WriteQuotedData(custom.data.data(), custom.data.size());\n  WriteCloseNewline();\n}\n\nResult WatWriter::WriteModule() {\n  BuildInlineExportMap();\n  BuildInlineImportMap();\n  WriteOpenSpace(\"module\");\n  if (module.name.empty()) {\n    WriteNewline(NO_FORCE_NEWLINE);\n  } else {\n    WriteName(module.name, NextChar::Newline);\n  }\n  for (const ModuleField& field : module.fields) {\n    switch (field.type()) {\n      case ModuleFieldType::Func:\n        WriteFunc(cast<FuncModuleField>(&field)->func);\n        break;\n      case ModuleFieldType::Global:\n        WriteGlobal(cast<GlobalModuleField>(&field)->global);\n        break;\n      case ModuleFieldType::Import:\n        WriteImport(*cast<ImportModuleField>(&field)->import);\n        break;\n      case ModuleFieldType::Tag:\n        WriteTag(cast<TagModuleField>(&field)->tag);\n        break;\n      case ModuleFieldType::Export:\n        WriteExport(cast<ExportModuleField>(&field)->export_);\n        break;\n      case ModuleFieldType::Table:\n        WriteTable(cast<TableModuleField>(&field)->table);\n        break;\n      case ModuleFieldType::ElemSegment:\n        WriteElemSegment(cast<ElemSegmentModuleField>(&field)->elem_segment);\n        break;\n      case ModuleFieldType::Memory:\n        WriteMemory(cast<MemoryModuleField>(&field)->memory);\n        break;\n      case ModuleFieldType::DataSegment:\n        WriteDataSegment(cast<DataSegmentModuleField>(&field)->data_segment);\n        break;\n      case ModuleFieldType::Type:\n        WriteTypeEntry(*cast<TypeModuleField>(&field)->type);\n        break;\n      case ModuleFieldType::Start:\n        WriteStartFunction(cast<StartModuleField>(&field)->start);\n        break;\n    }\n  }\n  if (options_.features.annotations_enabled()) {\n    for (const Custom& custom : module.customs) {\n      WriteCustom(custom);\n    }\n  }\n  WriteCloseNewline();\n  /* force the newline to be written */\n  WriteNextChar();\n  return result_;\n}\n\nvoid WatWriter::BuildInlineExportMap() {\n  if (!options_.inline_export) {\n    return;\n  }\n\n  for (Export* export_ : module.exports) {\n    Index index = kInvalidIndex;\n\n    // Exported imports can't be written with inline exports, unless the\n    // imports are also inline. For example, the following is invalid:\n    //\n    //   (import \"module\" \"field\" (func (export \"e\")))\n    //\n    // But this is valid:\n    //\n    //   (func (export \"e\") (import \"module\" \"field\"))\n    //\n    if (!options_.inline_import && module.IsImport(*export_)) {\n      continue;\n    }\n\n    switch (export_->kind) {\n      case ExternalKind::Func:\n        index = module.GetFuncIndex(export_->var);\n        break;\n\n      case ExternalKind::Table:\n        index = module.GetTableIndex(export_->var);\n        break;\n\n      case ExternalKind::Memory:\n        index = module.GetMemoryIndex(export_->var);\n        break;\n\n      case ExternalKind::Global:\n        index = module.GetGlobalIndex(export_->var);\n        break;\n\n      case ExternalKind::Tag:\n        index = module.GetTagIndex(export_->var);\n        break;\n    }\n\n    if (index != kInvalidIndex) {\n      auto key = std::make_pair(export_->kind, index);\n      inline_export_map_.insert(std::make_pair(key, export_));\n    }\n  }\n}\n\nvoid WatWriter::WriteInlineExports(ExternalKind kind, Index index) {\n  if (!options_.inline_export) {\n    return;\n  }\n\n  auto iter_pair = inline_export_map_.equal_range(std::make_pair(kind, index));\n  for (auto iter = iter_pair.first; iter != iter_pair.second; ++iter) {\n    const Export* export_ = iter->second;\n    WriteOpenSpace(\"export\");\n    WriteQuotedString(export_->name, NextChar::None);\n    WriteCloseSpace();\n  }\n}\n\nbool WatWriter::IsInlineExport(const Export& export_) {\n  Index index{};\n  switch (export_.kind) {\n    case ExternalKind::Func:\n      index = module.GetFuncIndex(export_.var);\n      break;\n\n    case ExternalKind::Table:\n      index = module.GetTableIndex(export_.var);\n      break;\n\n    case ExternalKind::Memory:\n      index = module.GetMemoryIndex(export_.var);\n      break;\n\n    case ExternalKind::Global:\n      index = module.GetGlobalIndex(export_.var);\n      break;\n\n    case ExternalKind::Tag:\n      index = module.GetTagIndex(export_.var);\n      break;\n  }\n\n  return inline_export_map_.find(std::make_pair(export_.kind, index)) !=\n         inline_export_map_.end();\n}\n\nvoid WatWriter::BuildInlineImportMap() {\n  if (!options_.inline_import) {\n    return;\n  }\n\n  for (const Import* import : module.imports) {\n    inline_import_map_[static_cast<size_t>(import->kind())].push_back(import);\n  }\n}\n\nvoid WatWriter::WriteInlineImport(ExternalKind kind, Index index) {\n  if (!options_.inline_import) {\n    return;\n  }\n\n  size_t kind_index = static_cast<size_t>(kind);\n\n  if (index >= inline_import_map_[kind_index].size()) {\n    return;\n  }\n\n  const Import* import = inline_import_map_[kind_index][index];\n  WriteOpenSpace(\"import\");\n  WriteQuotedString(import->module_name, NextChar::Space);\n  WriteQuotedString(import->field_name, NextChar::Space);\n  WriteCloseSpace();\n}\n\n}  // end anonymous namespace\n\nResult WriteWat(Stream* stream,\n                const Module* module,\n                const WriteWatOptions& options) {\n  WatWriter wat_writer(stream, options, *module);\n  return wat_writer.WriteModule();\n}\n\n}  // namespace wabt\n"
  },
  {
    "path": "test/README.md",
    "content": "# Tests\n\nThe `test` directory contains all tests, as well as scripts for running the\ntests.\n\nAll end-to-end tests are written using a text format that is parsed by\n`test/run-tests.py`. All files with the extension `.txt` recursively under the\n`test` directory will be run as tests.\n\nThe test runner itself is written in python and requires python 3.5 or above.\n\n## Running the test suite\n\nTo run all the tests with default configuration:\n\n```console\n$ make test\n```\n\nEvery make target has a matching `test-*` target.\n\n```console\n$ make gcc-debug-asan\n$ make test-gcc-debug-asan\n$ make clang-release\n$ make test-clang-release\n...\n```\n\nYou can also run the Python test runner script directly:\n\n```console\n$ test/run-tests.py\n```\n\nTo run a subset of the tests, use a glob-like syntax:\n\n```console\n$ test/run-tests.py const -v\n+ dump/const.txt (0.002s)\n+ parse/assert/bad-assertreturn-non-const.txt (0.003s)\n+ parse/expr/bad-const-i32-overflow.txt (0.002s)\n+ parse/expr/bad-const-f32-trailing.txt (0.004s)\n+ parse/expr/bad-const-i32-garbage.txt (0.005s)\n+ parse/expr/bad-const-i32-trailing.txt (0.003s)\n+ parse/expr/bad-const-i32-underflow.txt (0.003s)\n+ parse/expr/bad-const-i64-overflow.txt (0.002s)\n+ parse/expr/bad-const-i32-just-negative-sign.txt (0.004s)\n+ parse/expr/const.txt (0.002s)\n[+10|-0|%100] (0.11s)\n\n$ test/run-tests.py expr*const*i32 -v\n+ parse/expr/bad-const-i32-just-negative-sign.txt (0.002s)\n+ parse/expr/bad-const-i32-overflow.txt (0.003s)\n+ parse/expr/bad-const-i32-underflow.txt (0.002s)\n+ parse/expr/bad-const-i32-garbage.txt (0.004s)\n+ parse/expr/bad-const-i32-trailing.txt (0.002s)\n[+5|-0|%100] (0.11s)\n```\n\nWhen tests are broken, they will give you the expected stdout/stderr as a diff:\n\n```console\n$ <whoops, turned addition into subtraction in the interpreter>\n$ test/run-tests.py interp/binary\n- interp/binary.txt\n  STDOUT MISMATCH:\n  --- expected\n  +++ actual\n  @@ -1,4 +1,4 @@\n  -i32_add() => i32:3\n  +i32_add() => i32:4294967295\n   i32_sub() => i32:16\n   i32_mul() => i32:21\n   i32_div_s() => i32:4294967294\n\n**** FAILED ******************************************************************\n- interp/binary.txt\n[+0|-1|%100] (0.13s)\n```\n\n## Test file format\n\nThe test format is straightforward:\n\n```wast\n;;; KEY1: VALUE1A VALUE1B...\n;;; KEY2: VALUE2A VALUE2B...\n(input (to)\n  (the executable))\n(;; STDOUT ;;;\nexpected stdout\n;;; STDOUT ;;)\n(;; STDERR ;;;\nexpected stderr\n;;; STDERR ;;)\n```\n\nThe test runner will copy the input to a temporary file and pass it as an\nargument to the executable (which by default is `out/wat2wasm`).\n\nThe currently supported list of keys:\n\n- `TOOL`: a set of preconfigured keys, see below.\n- `RUN`: the executable to run, defaults to out/wat2wasm\n- `STDIN_FILE`: the file to use for STDIN instead of the contents of this file.\n- `ARGS`: additional args to pass to the executable\n- `ARGS{N}`: additional args to the Nth `RUN` command (zero-based)\n- `ARGS*`: additional args to all `RUN` commands\n- `STDIN`: name of a file to be read and used stdin of the executable\n- `ENV`: environment variables to set, separated by spaces\n- `ERROR`: the expected return value from the executable, defaults to 0\n- `SLOW`: if defined, this test's timeout is increased (currently by 3x).\n- `SKIP`: if defined, this test is not run. You can use the value as a comment.\n- `TODO`,`NOTE`: useful place to put additional info about the test.\n\nThe currently supported list of tools (see\n[run-tests.py](https://github.com/WebAssembly/wabt/blob/master/test/run-tests.py#L44)):\n\n- `wat2wasm`: parse a wasm text file and validate it.\n- `wat-desugar`: parse the wasm text file and rewrite it in the canonical text\n  format.\n- `run-objdump`: parse a wasm text file, convert it to binary, then run\n  `wasm-objdump` on it.\n- `run-objdump-gen-wasm`: parse a \"gen-wasm\" text file, convert it to binary,\n  then run `wasm-objdump` on it.\n- `run-objdump-spec`: parse a wast spec test file, convert it to JSON and a\n  collection of `.wasm` files, then run `wasm-objdump`. Note that the `.wasm`\n  files are not automatically passed to `wasm-objdump`, so each test must\n  specify them manually: `%(temp_file)s.0.wasm %(temp_file)s.1.wasm`, etc.\n- `run-roundtrip`: parse a wasm text file, convert it to binary, convert it\n  back to text, then finally convert it back to binary and compare the two\n  binary results. If the `--stdout` flag is passed, the final conversion to\n  binary is skipped and the resulting text is displayed instead.\n- `run-interp`: parse a wasm text file, convert it to binary, then run\n  `wasm-interp` on this binary, which runs all exported functions in an\n  interpreter\n- `run-interp-spec`: parse a spec test text file, convert it to a JSON file and\n  a collection of `.wasm` and `.wast` files, then run `wasm-interp` on the JSON\n  file.\n- `run-gen-wasm`: parse a \"gen-wasm\" text file (which can describe invalid\n  binary files), then parse via `wasm2wat` and display the result\n- `run-gen-wasm-interp`: parse a \"gen-wasm\" text file, generate a wasm file,\n  the run `wasm-interp` on it, which runes all exported functions in an\n  interpreter.\n- `run-gen-wasm-decompile`: parse a \"gen-wasm\" text file (which can describe\n  invalid binary files), then parse via `wasm-decompile` and display the result.\n- `run-stats`: parse a wasm text file, convert it to binary, then display\n  stats.\n- `run-gen-spec-js`: parse wasm spec test text file, convert it to a JSON file\n  and a collection of `.wasm` and `.wast` files, then take all of these files\n  and generate a JavaScript file that will execute the same tests.\n- `run-spec-wasm2c`: similar to `run-gen-spec-js`, but the output instead will\n  be C source files, that are then compiled with the default C compiler (`cc`).\n  Finally, the native executable is run.\n- `run-wasm-decompile`: parse wat with `wat2wasm` then `wasm-decompile`.\n\n\n## Test subdirectories\n\nTests must be placed in the test/ directory, and must have the extension\n`.txt`. The subdirectory structure is mostly for convenience, so for example\nyou can type `test/run-tests.py interp` to run all the interpreter tests.\nThere's otherwise no logic attached to a test being in a given directory.\n\nHere is a brief description of the tests are contained in each top-level\nsubdirectory:\n\n- `binary`: Tests binary files that are impossible to generate via wat2wasm.\n  Typically these are illegal binary files, to ensure binary file reading is\n  robust.\n- `desugar`: Tests the `wat-desugar` tool.\n- `dump`: Tests the verbose output of `wat2wasm` and the output of\n  `wasm-objdump`.\n- `exceptions`: Tests the new experimental exceptions feature.\n- `gen-spec-js`: Tests the gen-spec-js tool, which converts a spec test into a\n  JavaScript file.\n- `help`: Tests the output of running with the `--help` flag on each tool.\n- `interp`: Tests the `wasm-interp` tool.\n- `stats`: Tests the `wasm-stats` tool.\n- `parse`: Tests parsing via the `wat2wasm` tool.\n- `regress`: Various regression tests that are irregular and don't fit\n  naturally in the other directories.\n- `roundtrip`: Tests that roundtripping the text to binary and back to text\n  works properly. Also contains tests of the binary reader when the generated\n  binary file is valid (if the file is invalid, it will be generated by\n  `gen-wasm.py` and should be placed in the `binary` directory instead).\n- `spec`: All of the spec core tests. These tests are auto-generated by the\n  `update-spec-tests.py` script.\n- `typecheck`: Tests the wast validation in the `wat2wasm` tool.\n\n## Writing New Tests\n\nTry to make the test names self explanatory, and try to test only one thing.\nAlso make sure that tests that are expected to fail start with `bad-`.\n\nWhen you first write a test, it's easiest if you omit the expected stdout and\nstderr. You can have the test harness fill it in for you automatically. First\nlet's write our test:\n\n```sh\n$ cat > test/my-awesome-test.txt << HERE\n;;; TOOL: run-interp-spec\n(module\n  (export \"add2\" 0)\n  (func (param i32) (result i32)\n    (i32.add (local.get 0) (i32.const 2))))\n(assert_return (invoke \"add2\" (i32.const 4)) (i32.const 6))\n(assert_return (invoke \"add2\" (i32.const -2)) (i32.const 0))\nHERE\n```\n\nIf we run it, it will fail:\n\n```\n- my-awesome-test.txt\n  STDOUT MISMATCH:\n  --- expected\n  +++ actual\n  @@ -0,0 +1 @@\n  +2/2 tests passed.\n\n**** FAILED ******************************************************************\n- my-awesome-test.txt\n[+0|-1|%100] (0.03s)\n```\n\nWe can rebase it automatically with the `-r` flag. Running the test again shows\nthat the expected stdout has been added:\n\n```console\n$ test/run-tests.py my-awesome-test -r\n[+1|-0|%100] (0.03s)\n$ test/run-tests.py my-awesome-test\n[+1|-0|%100] (0.03s)\n$ tail -n 3 test/my-awesome-test.txt\n(;; STDOUT ;;;\n2/2 tests passed.\n;;; STDOUT ;;)\n```\n"
  },
  {
    "path": "test/binary/annotations-custom-sections.txt",
    "content": ";;; TOOL: run-gen-wasm\n;;; ARGS: --enable-annotations\nmagic\nversion\nsection(\"foo\") { \"hello\" }\n(;; STDOUT ;;;\n(module\n  (@custom \"foo\" \"hello\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-alignment.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(MEMORY) { count[1] flags[0] min[1] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const leb_i32(0)\n    i32.load align[65] offset[0]\n    drop\n  }\n}\n(;; STDERR ;;;\n0000020: error: multi_memory not allowed\n0000020: error: multi_memory not allowed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-brtable-too-big.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    br_table leb_i32(0xffffffff)  ;; invalid target count\n    0 0 0 ;; first few targets\n  }\n}\n(;; STDERR ;;;\n000001d: error: invalid br_table target count 4294967295, only 4 bytes left in section\n000001d: error: invalid br_table target count 4294967295, only 4 bytes left in section\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-call-indirect-reserved.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --disable-reference-types\n;;; ARGS2: --disable-reference-types\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0]}\nsection(FUNCTION) { count[1] type[0] }\nsection(TABLE) { count[1] funcref flags[0] init[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 0\n    ;; The call_indirect reserved byte must be a single 0 byte. Using a long\n    ;; leb128 encoding of 0 is not valid.\n    call_indirect\n      index[leb_i32(0)]\n      reserved[0x80 0]\n  }\n}\n(;; STDERR ;;;\n0000022: error: call_indirect reserved value must be 0\n0000022: error: call_indirect reserved value must be 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-callindirect-invalid-sig.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(TABLE) { count[1] funcref flags[0] min[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 0\n    call_indirect leb_i32(100) 0\n  }\n}\n(;; STDERR ;;;\nout/test/binary/bad-callindirect-invalid-sig/bad-callindirect-invalid-sig.wasm:0000023: error: function type variable out of range: 100 (max 1)\nout/test/binary/bad-callindirect-invalid-sig/bad-callindirect-invalid-sig.wasm:0000023: error: function type variable out of range: 100 (max 1)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-code-metadata-function-count.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[1] i32\n}\nsection(FUNCTION) {\n  count[1]\n  type[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(\"metadata.code.test\") {\n  function_count[2]\n  function_index[0]\n  ann_count[1]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n}\n\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n}\n\n(;; STDERR ;;;\n0000033: warning: unable to read u32 leb128: function index\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-code-metadata-function-count.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nMemory[1]:\n - memory[0] pages: initial=0\nCustom:\n - name: \"metadata.code.test\"\n   - func[0]:\n    - meta[1]:\n     - 0000000: 01                                       .\nCode[1]:\n - func[0] size=5\n\nCode Disassembly:\n\n000037 func[0]:\n 000038: 41 01                      | i32.const 1\n 00003a: 0f                         | return\n 00003b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-code-metadata-function-duplicate.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[1] i32\n}\nsection(FUNCTION) {\n  count[1]\n  type[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(\"metadata.code.test\") {\n  function_count[2]\n  function_index[0]\n  ann_count[1]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n  function_index[0]\n  ann_count[0]\n}\n\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n}\n\n(;; STDERR ;;;\n0000034: warning: duplicate function index: 0\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-code-metadata-function-duplicate.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nMemory[1]:\n - memory[0] pages: initial=0\nCustom:\n - name: \"metadata.code.test\"\n   - func[0]:\n    - meta[1]:\n     - 0000000: 01                                       .\nCode[1]:\n - func[0] size=5\n\nCode Disassembly:\n\n000039 func[0]:\n 00003a: 41 01                      | i32.const 1\n 00003c: 0f                         | return\n 00003d: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-code-metadata-function-index.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[1] i32\n}\nsection(FUNCTION) {\n  count[1]\n  type[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(\"metadata.code.test\") {\n  function_count[1]\n  function_index[2]\n  ann_count[1]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n}\n\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n}\n\n(;; STDERR ;;;\n000002f: warning: invalid function index: 2\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-code-metadata-function-index.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nMemory[1]:\n - memory[0] pages: initial=0\nCustom:\n - name: \"metadata.code.test\"\nCode[1]:\n - func[0] size=5\n\nCode Disassembly:\n\n000037 func[0]:\n 000038: 41 01                      | i32.const 1\n 00003a: 0f                         | return\n 00003b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-code-metadata-function-out-of-order.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[1] i32\n}\nsection(FUNCTION) {\n  count[2]\n  type[0]\n  type[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(\"metadata.code.test\") {\n  function_count[2]\n  function_index[1]\n  ann_count[1]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n  function_index[0]\n  ann_count[1]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n}\n\nsection(CODE) {\n  count[2]\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n}\n\n(;; STDERR ;;;\n0000035: warning: function index out of order: 0\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-code-metadata-function-out-of-order.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[2]:\n - func[0] sig=0\n - func[1] sig=0\nMemory[1]:\n - memory[0] pages: initial=0\nCustom:\n - name: \"metadata.code.test\"\n   - func[1]:\n    - meta[1]:\n     - 0000000: 01                                       .\nCode[2]:\n - func[0] size=5\n - func[1] size=5\n\nCode Disassembly:\n\n00003d func[0]:\n 00003e: 41 01                      | i32.const 1\n 000040: 0f                         | return\n 000041: 0b                         | end\n000043 func[1]:\n 000044: 41 01                      | i32.const 1\n 000046: 0f                         | return\n 000047: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-code-metadata-instance-count.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[1] i32\n}\nsection(FUNCTION) {\n  count[1]\n  type[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(\"metadata.code.test\") {\n  function_count[1]\n  function_index[0]\n  ann_count[2]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n}\n\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n}\n\n(;; STDERR ;;;\n0000033: warning: unable to read u32 leb128: code offset\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-code-metadata-instance-count.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nMemory[1]:\n - memory[0] pages: initial=0\nCustom:\n - name: \"metadata.code.test\"\n   - func[0]:\n    - meta[1]:\n     - 0000000: 01                                       .\nCode[1]:\n - func[0] size=5\n\nCode Disassembly:\n\n000037 func[0]:\n 000038: 41 01                      | i32.const 1\n 00003a: 0f                         | return\n 00003b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-code-metadata-instance-duplicate.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[1] i32\n}\nsection(FUNCTION) {\n  count[1]\n  type[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(\"metadata.code.test\") {\n  function_count[1]\n  function_index[0]\n  ann_count[2]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n}\n\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n}\n\n(;; STDERR ;;;\n0000034: warning: duplicate code offset: 1\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-code-metadata-instance-duplicate.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nMemory[1]:\n - memory[0] pages: initial=0\nCustom:\n - name: \"metadata.code.test\"\n   - func[0]:\n    - meta[1]:\n     - 0000000: 01                                       .\nCode[1]:\n - func[0] size=5\n\nCode Disassembly:\n\n00003a func[0]:\n 00003b: 41 01                      | i32.const 1\n 00003d: 0f                         | return\n 00003e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-code-metadata-instance-out-of-order.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[1] i32\n}\nsection(FUNCTION) {\n  count[1]\n  type[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(\"metadata.code.test\") {\n  function_count[1]\n  function_index[0]\n  ann_count[2]\n  ann_offset[3]\n  ann_data_size[1]\n  ann_data[1]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n}\n\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n}\n\n(;; STDERR ;;;\n0000034: warning: code offset out of order: 1\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-code-metadata-instance-out-of-order.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nMemory[1]:\n - memory[0] pages: initial=0\nCustom:\n - name: \"metadata.code.test\"\n   - func[0]:\n    - meta[3]:\n     - 0000000: 01                                       .\nCode[1]:\n - func[0] size=5\n\nCode Disassembly:\n\n00003a func[0]:\n 00003b: 41 01                      | i32.const 1\n 00003d: 0f                         | return\n 00003e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-data-count-mismatch.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[1]\n}\nsection(DATACOUNT) {\n  count[2]\n}\nsection(DATA) {\n  count[1]\n  memory_index[0]\n  offset[i32.const 0 end]\n  data[str(\"whoops\")]\n}\n(;; STDERR ;;;\n0000013: error: data segment count does not equal count in DataCount section\n0000013: error: data segment count does not equal count in DataCount section\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-data-count-order-after-code.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(CODE) { count[0] }\nsection(DATACOUNT) { count[0] }\n(;; STDERR ;;;\n000000d: error: section DataCount out of order\n000000d: error: section DataCount out of order\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-data-count-order-before-elem.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(DATACOUNT) { count[0] }\nsection(ELEM) { count[0] }\n(;; STDERR ;;;\n000000d: error: section Elem out of order\n000000d: error: section Elem out of order\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-data-drop-no-data-count.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    data.drop 0\n  }\n}\nsection(DATA) {\n  count[1]\n  flags[1]\n  data[str(\"\")]\n}\n(;; STDERR ;;;\n0000019: error: data.drop requires data count section\n0000019: error: data.drop requires data count section\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-data-invalid-memidx.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --disable-bulk-memory\n;;; ARGS2: --disable-bulk-memory\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(DATA) {\n  count[1]\n  memory_index[1]\n  offset[i32.const 0 end]\n  data[str(\"\")]\n}\n(;; STDERR ;;;\n0000011: error: invalid memory index 1: bulk memory not allowed\n0000011: error: invalid memory index 1: bulk memory not allowed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-data-size.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ERROR: 1\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(DATA) {\n  count[1]\n  memory_index[0]\n  offset[i32.const 0 end]\n  data[str(\"overflow\")]\n}\n(;; STDERR ;;;\nerror initializing module: out of bounds memory access: data segment is out of bounds: [0, 8) >= max value 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-data-without-memory.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(DATA) {\n  count[1]\n  memory_index[0]\n  offset[i32.const 0 end]\n  data[str(\"\")]\n}\nsection(DATACOUNT) { count[1] }\n(;; STDERR ;;;\n0000012: error: section DataCount out of order\n0000012: error: section DataCount out of order\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-duplicate-section-around-custom.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[0] }\nsection(\"foo\") { 1 2 3 4 }\nsection(TYPE) { count[0] }\n(;; STDERR ;;;\n0000017: error: multiple Type sections\n0000017: error: multiple Type sections\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-duplicate-section.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[0] }\nsection(TYPE) { count[0] }\n(;; STDERR ;;;\n000000d: error: multiple Type sections\n000000d: error: multiple Type sections\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-duplicate-subsection.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    count[0]\n  }\n  section(NAME_FUNCTION) {\n    count[0]\n  }\n}\n(;; STDERR ;;;\n0000028: error: duplicate sub-section\n0000028: error: duplicate sub-section\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-elem-flags.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TABLE) {\n  count[1]\n  funcref\n  has_max[0]\n  initial[0]\n}\nsection(ELEM) {\n  count[1]\n  flags[8]\n}\n(;; STDERR ;;;\n0000012: error: invalid elem segment flags: 0x8\n0000012: error: invalid elem segment flags: 0x8\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-export-func.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] sig[0] }\nsection(EXPORT) { count[1] str(\"foo\") func_kind func[1] }\nsection(CODE) { count[1] func { locals[0] } }\n(;; STDERR ;;;\nout/test/binary/bad-export-func/bad-export-func.wasm:000001b: error: function variable out of range: 1 (max 1)\nout/test/binary/bad-export-func/bad-export-func.wasm:000001b: error: function variable out of range: 1 (max 1)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-export-out-of-range.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] sig[0] }\nsection(EXPORT) { count[1] str(\"foo\") func_kind func[leb_u32(4294967295)] }\nsection(CODE) { count[1] func { locals[0] } }\n(;; STDERR ;;;\nout/test/binary/bad-export-out-of-range/bad-export-out-of-range.wasm:000001f: error: function variable out of range: 4294967295 (max 1)\nout/test/binary/bad-export-out-of-range/bad-export-out-of-range.wasm:000001f: error: function variable out of range: 4294967295 (max 1)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-extra-end.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    end\n    end\n  }\n}\n(;; STDERR ;;;\n0000019: error: function body shorter than given size\n0000019: error: function body shorter than given size\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-func-with-struct-type.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --enable-gc\n;;; ARGS2: --enable-gc\nmagic\nversion\nsection(TYPE) { count[1] struct field_count[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) { count[1] func { locals[0] } }\n(;; STDERR ;;;\nout/test/binary/bad-func-with-struct-type/bad-func-with-struct-type.wasm:0000011: error: type 0 is not a function\nout/test/binary/bad-func-with-struct-type/bad-func-with-struct-type.wasm:0000011: error: type 0 is not a function\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-function-body-count.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[2] func[0] func[0] }\nsection(CODE) {\n  count[1]\n  func { locals[0] }\n}\n(;; STDERR ;;;\n0000016: error: function signature count != function body count\n0000016: error: function signature count != function body count\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-function-body-size.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ERROR: 1\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] sig[0] }\nsection(CODE) {\n  count[1]\n  0x02 ;; malformed 2 byte function body size (should be 4)\n    locals[0]\n    i32.const\n    leb_i32(42)\n    drop\n}\n(;; STDERR ;;;\n0000019: error: function body must end with END opcode\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-function-count-missing-code-section.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[2] func[0] func[0] }\n(;; STDERR ;;;\n0000013: error: function signature count != function body count\n0000013: error: function signature count != function body count\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-function-local-type.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] sig[0] }\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[1]\n    locals[1] void\n  }\n}\n(;; STDERR ;;;\n0000019: error: expected valid local type\n0000019: error: expected valid local type\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-function-names-too-many.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] sig[0] }\nsection(CODE) { count[1] func { locals[0] nop } }\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    count[2]\n    index[0]\n    str(\"f\")\n    index[1]\n    str(\"g\")\n  }\n}\n(;; STDERR ;;;\nerror: expected function name count (2) <= function count (1)\n0000023: error: OnFunctionNamesCount callback failed\nerror: expected function name count (2) <= function count (1)\n0000023: error: OnFunctionNamesCount callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-function-param-type.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[1] void results[0]\n}\n(;; STDERR ;;;\n000000e: error: expected valid param type (got -0x40)\n000000e: error: expected valid param type (got -0x40)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-function-result-type.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[1] i32 results[1] void\n}\n(;; STDERR ;;;\n0000010: error: expected valid result type (got -0x40)\n0000010: error: expected valid result type (got -0x40)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-function-sig.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[1] i32 results[1] i32 }\nsection(FUNCTION) { count[1] type[1] }\nsection(CODE) { count[1] func { locals[0] } }\n(;; STDERR ;;;\nout/test/binary/bad-function-sig/bad-function-sig.wasm:0000014: error: function type variable out of range: 1 (max 1)\nout/test/binary/bad-function-sig/bad-function-sig.wasm:0000014: error: function type variable out of range: 1 (max 1)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-import-kind.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(IMPORT) { count[1] str(\"module\") str(\"func\") dummy[5] }\n(;; STDERR ;;;\n0000018: error: invalid import external kind: 5\n0000018: error: invalid import external kind: 5\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-import-sig.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(IMPORT) { count[1] str(\"module\") str(\"func\") func_kind type[1] }\n(;; STDERR ;;;\nout/test/binary/bad-import-sig/bad-import-sig.wasm:0000020: error: function type variable out of range: 1 (max 1)\nout/test/binary/bad-import-sig/bad-import-sig.wasm:0000020: error: function type variable out of range: 1 (max 1)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-init-expr-callindirect.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\nmagic\nversion\nsection(GLOBAL) {\n  count[1]\n  type[i32] mut[0] init_expr[call_indirect 0 0 end]\n}\n(;; STDOUT ;;;\n\nbad-init-expr-callindirect.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nGlobal[1]:\n - global[0] i32 mutable=0 - init <INVALID>\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-interp-returncallindirect-invalid-sig.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ARGS1: --enable-tail-call\n;;; ERROR: 1\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(TABLE) { count[1] funcref flags[0] min[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 0\n    return_call_indirect leb_i32(100) 0\n  }\n}\n(;; STDERR ;;;\nout/test/binary/bad-interp-returncallindirect-invalid-sig/bad-interp-returncallindirect-invalid-sig.wasm:0000023: error: function type variable out of range: 100 (max 1)\n0000023: error: OnReturnCallIndirectExpr callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-linking-data-segment-index.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) { count[1] has_max[0] initial[0] }\nsection(DATA) {\n  count[1]\n  memory_index[0]\n  offset[i32.const 0 end]\n  data[str(\"foo\")]\n}\n\nsection(\"linking\") {\n  metadata_version[2]\n\n  section(LINKING_SYMBOL_TABLE) {\n    num_symbols[1]\n\n    type[1]\n    flags[1]\n    str(\"data OOB\")\n    segment[1] ;; OOB\n    offset[0]\n    size[0]\n  }\n}\n(;; STDERR ;;;\nerror: invalid data segment index: 1\n0000034: error: OnDataSymbol callback failed\nerror: invalid data segment index: 1\n0000034: error: OnDataSymbol callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-linking-function-index.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) { count[1] func { locals[0] } }\n\nsection(\"linking\") {\n  metadata_version[2]\n\n  section(LINKING_SYMBOL_TABLE) {\n    num_symbols[1]\n\n    type[0]\n    flags[1]\n    index[1]\n    str(\"func OOB\")\n  }\n}\n(;; STDERR ;;;\nerror: invalid function index: 1\n0000032: error: OnFunctionSymbol callback failed\nerror: invalid function index: 1\n0000032: error: OnFunctionSymbol callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-linking-global-index.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(GLOBAL) {\n  count[1]\n  type[i32] mut[0] init_expr[i32.const 0 end]\n}\n\nsection(\"linking\") {\n  metadata_version[2]\n\n  section(LINKING_SYMBOL_TABLE) {\n    num_symbols[1]\n\n    type[2]\n    flags[1]\n    index[1]\n    str(\"global OOB\")\n  }\n}\n(;; STDERR ;;;\nerror: invalid global index: 1\n000002c: error: OnGlobalSymbol callback failed\nerror: invalid global index: 1\n000002c: error: OnGlobalSymbol callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-linking-metadata.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ERROR: 1\nmagic\nversion\nsection(\"linking\") {\n  metadata_version[99]\n}\n(;; STDERR ;;;\n0000013: error: invalid linking metadata version: 99\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-linking-tag-index.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --enable-exceptions\n;;; ARGS2: --enable-exceptions\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(TAG) {\n  count[1]\n  attr[0]\n  sig[0]\n}\n\nsection(\"linking\") {\n  metadata_version[2]\n\n  section(LINKING_SYMBOL_TABLE) {\n    num_symbols[1]\n\n    type[4]\n    flags[1]\n    index[1]\n    str(\"tag OOB\")\n  }\n}\n(;; STDERR ;;;\nerror: invalid tag index: 1\n000002c: error: OnTagSymbol callback failed\nerror: invalid tag index: 1\n000002c: error: OnTagSymbol callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-logging-basic.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ARGS: -v\n;;; ERROR: 1\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[0]\n  func {  ;; error\n    return\n  }\n}\n(;; STDERR ;;;\nBeginModule(version: 1)\n  BeginTypeSection(4)\n    OnTypeCount(1)\n    OnFuncType(index: 0, params: [], results: [])\n  EndTypeSection\n  BeginFunctionSection(2)\n    OnFunctionCount(1)\n    OnFunction(index: 0, sig_index: 0)\n  EndFunctionSection\n  BeginCodeSection(4)\n0000015: error: function signature count != function body count\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-magic.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nversion\n(;; STDERR ;;;\n0000004: error: bad magic value\n0000004: error: bad magic value\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-grow-reserved.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0]}\nsection(FUNCTION) { count[1] type[0] }\nsection(MEMORY) { count[1] flags[0] init[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 0\n    ;; The memory.grow reserved byte must be a single 0 byte. Using a long\n    ;; leb128 encoding of 0 is not valid.\n    memory.grow reserved[0x80 0]\n    drop\n  }\n}\n(;; STDERR ;;;\n0000020: error: memory.grow reserved value must be 0\n0000020: error: memory.grow reserved value must be 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-init-max-size.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  has_max[1]\n  initial[2]\n  max[1]\n}\n(;; STDERR ;;;\nout/test/binary/bad-memory-init-max-size/bad-memory-init-max-size.wasm:000000e: error: max pages (1) must be >= initial pages (2)\nout/test/binary/bad-memory-init-max-size/bad-memory-init-max-size.wasm:000000e: error: max pages (1) must be >= initial pages (2)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-init-no-data-count.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[leb_u32(0)]\n}\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const leb_i32(0)\n    i32.const leb_i32(0)\n    i32.const leb_i32(0)\n    memory.init 0 0\n  }\n}\nsection(DATA) {\n  count[1]\n  flags[1]\n  data[str(\"\")]\n}\n(;; STDERR ;;;\n0000024: error: memory.init requires data count section\n0000024: error: memory.init requires data count section\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-init-size.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[leb_u32(65537)]\n}\n(;; STDERR ;;;\nout/test/binary/bad-memory-init-size/bad-memory-init-size.wasm:000000f: error: initial pages (65537) must be <= (65536)\nout/test/binary/bad-memory-init-size/bad-memory-init-size.wasm:000000f: error: initial pages (65537) must be <= (65536)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-limits-flag-is64.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  flags[4]\n}\n(;; STDERR ;;;\n000000c: error: memory64 not allowed\n000000c: error: memory64 not allowed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-limits-flag-leb128.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  flags[0x81 0]\n}\n(;; STDERR ;;;\n000000c: error: malformed memory limits flag: 129\n000000c: error: malformed memory limits flag: 129\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-limits-flag-shared.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  flags[2]\n}\n(;; STDERR ;;;\n000000c: error: memory may not be shared: threads not allowed\n000000c: error: memory may not be shared: threads not allowed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-limits-flag.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  flags[16]\n}\n(;; STDERR ;;;\n000000c: error: malformed memory limits flag: 16\n000000c: error: malformed memory limits flag: 16\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-max-size.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  has_max[1]\n  initial[0]\n  max[leb_u32(65537)]\n}\n(;; STDERR ;;;\nout/test/binary/bad-memory-max-size/bad-memory-max-size.wasm:0000010: error: max pages (65537) must be <= (65536)\nout/test/binary/bad-memory-max-size/bad-memory-max-size.wasm:0000010: error: max pages (65537) must be <= (65536)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-memory-size-reserved.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0]}\nsection(FUNCTION) { count[1] type[0] }\nsection(MEMORY) { count[1] flags[0] init[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    ;; The memory.size reserved byte must be a single 0 byte. Using a long\n    ;; leb128 encoding of 0 is not valid.\n    memory.size reserved[0x80 0]\n    drop\n  }\n}\n(;; STDERR ;;;\n000001e: error: memory.size reserved value must be 0\n000001e: error: memory.size reserved value must be 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-multiple-catch-all.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --enable-exceptions\n;;; ARGS2: --enable-exceptions\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    try 0\n    catch_all\n    catch_all\n    end\n  }\n}\n(;; STDERR ;;;\nerror: only one catch_all allowed in try block\n000001b: error: OnCatchAllExpr callback failed\nerror: only one catch_all allowed in try block\n000001b: error: OnCatchAllExpr callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-name-section-invalid-index.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[8]\n    str(\"$F0\")\n  }\n}\n(;; STDERR ;;;\n0000028: error: invalid function index: 8\n0000028: error: invalid function index: 8\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-name-section-location.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[0]\n    str(\"F0\")\n  }\n}\nsection(CODE) {\n  count[1]\n  func { locals[0] }\n}\n(;; STDERR ;;;\n0000022: error: Code section can not occur after Name section\n0000022: error: Code section can not occur after Name section\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-names-duplicate-locals.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[2] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[0]\n    str(\"F0\")\n  }\n  section(NAME_LOCALS) {\n    func_count[1]\n    index[0]\n    local_count[2]\n    index[0]\n    str(\"L0\")\n    index[0]\n    str(\"L1\")\n  }\n}\n(;; STDERR ;;;\n0000035: error: duplicate local index: 0\n0000035: error: duplicate local index: 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-names-duplicates.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[2] type[0] type[0] }\nsection(CODE) {\n  count[2]\n  func { locals[decl_count[0]] }\n  func { locals[decl_count[0]] }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[2]\n    index[0]\n    str(\"F0\")\n    index[0]\n    str(\"F1\")\n  }\n}\n(;; STDERR ;;;\n000002c: error: duplicate function name: 0\n000002c: error: duplicate function name: 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-names-function-locals-out-of-order.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[2] type[0] type[0] }\nsection(CODE) {\n  count[2]\n  func { locals[decl_count[1] i32_count[2] i32] }\n  func { locals[decl_count[1] i32_count[2] i32] }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[2]\n    index[0]\n    str(\"F0\")\n    index[1]\n    str(\"F2\")\n  }\n\n  section(NAME_LOCALS) {\n    func_count[2]\n    func_index[1]\n    local_count[1]\n    local_index[0]\n    str(\"L0\")\n\n    func_index[0]\n    local_count[1]\n    local_index[0]\n    str(\"L0\")\n  }\n}\n(;; STDERR ;;;\n000003d: error: locals function index out of order: 0\n000003d: error: locals function index out of order: 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-names-locals-out-of-order.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[2] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[0]\n    str(\"F0\")\n  }\n\n  section(NAME_LOCALS) {\n    func_count[1]\n    func_index[0]\n\n    local_count[2]\n    local_index[1]\n    str(\"L1\")\n    local_index[0]\n    str(\"L0\")\n  }\n}\n(;; STDERR ;;;\n0000004: error: bad magic value\n0000004: error: bad magic value\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-names-out-of-order.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;; names section out of order (1 first, then 0) which is an error.\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[2] type[0] type[0] }\nsection(CODE) {\n  count[2]\n  func { locals[decl_count[0]] }\n  func { locals[decl_count[0]] }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[2]\n    index[1]\n    str(\"F1\")\n    index[0]\n    str(\"F0\")\n  }\n}\n(;; STDERR ;;;\n000002c: error: function index out of order: 0\n000002c: error: function index out of order: 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-op-after-end.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    end\n    nop\n  }\n}\n(;; STDERR ;;;\n0000019: error: function body shorter than given size\n0000019: error: function body shorter than given size\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-opcode-prefix.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    invalid_op[0xfe 0x7f]\n  }\n}\n(;; STDERR ;;;\n000001a: error: unexpected opcode: 0xfe 0x7f\n000001a: error: unexpected opcode: 0xfe 0x7f\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-opcode.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\n;;; ERROR: 1\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    invalid_op[0xff]\n  }\n}\n(;; STDERR ;;;\n0000019: error: unexpected opcode: 0xff\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-opcode.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nCode[1]:\n - func[0] size=3\n\nCode Disassembly:\n\n000017 func[0]:\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-reference-indicies.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --enable-function-references\n;;; ARGS2: --enable-function-references\nmagic\nversion\nsection(TYPE) {\n  count[2]\n  function params[1] reference 10 results[1] reference 20\n  function params[0] results[0]\n}\nsection(FUNCTION) { count[1] sig[1] }\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[1]\n    locals[1] reference 30\n  }\n}\n(;; STDERR ;;;\nout/test/binary/bad-reference-indicies/bad-reference-indicies.wasm:0000012: error: reference 10 is out of range (max: 0) in params\nout/test/binary/bad-reference-indicies/bad-reference-indicies.wasm:0000012: error: reference 20 is out of range (max: 0) in results\nout/test/binary/bad-reference-indicies/bad-reference-indicies.wasm:000001d: error: reference 30 is out of range (max: 2) in locals\nout/test/binary/bad-reference-indicies/bad-reference-indicies.wasm:0000012: error: reference 10 is out of range (max: 0) in params\nout/test/binary/bad-reference-indicies/bad-reference-indicies.wasm:0000012: error: reference 20 is out of range (max: 0) in results\nout/test/binary/bad-reference-indicies/bad-reference-indicies.wasm:000001d: error: reference 30 is out of range (max: 2) in locals\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-reloc-type.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(\"reloc.BAD\") {\n  reloc_section[0]\n  reloc_count[1]\n  reloc_type[leb_i32(0xffffffff)]\n  reloc_offset[0]\n  reloc_index[0]\n}\n(;; STDERR ;;;\n0000023: warning: unknown reloc type: <error_reloc_type>\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-reloc-type.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nCustom:\n - name: \"reloc.BAD\"\n  - relocations for section: 0 (Type) [1]\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-relocs.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(\"reloc.BAD\") {\n  reloc_section[99]\n  reloc_count[0]\n}\n(;; STDERR ;;;\ninvalid relocation section index: 99\n0000016: warning: OnRelocCount callback failed\ninvalid relocation section index: 99\ninvalid relocation section index: 99\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-relocs.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nCustom:\n - name: \"reloc.BAD\"\n  - relocations for section: 99 () [0]\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-returncall-invalid-func.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ARGS1: --enable-tail-call\n;;; ERROR: 1\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(TABLE) { count[1] funcref flags[0] min[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 0\n    return_call leb_i32(100) 0\n  }\n}\n(;; STDERR ;;;\nout/test/binary/bad-returncall-invalid-func/bad-returncall-invalid-func.wasm:0000022: error: function variable out of range: 100 (max 1)\n0000022: error: OnReturnCallExpr callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-returncallindirect-invalid-sig.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --enable-tail-call\n;;; ARGS2: --enable-tail-call\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(TABLE) { count[1] funcref flags[0] min[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 0\n    return_call_indirect leb_i32(100) 0\n  }\n}\n(;; STDERR ;;;\nout/test/binary/bad-returncallindirect-invalid-sig/bad-returncallindirect-invalid-sig.wasm:0000023: error: function type variable out of range: 100 (max 1)\nout/test/binary/bad-returncallindirect-invalid-sig/bad-returncallindirect-invalid-sig.wasm:0000023: error: function type variable out of range: 100 (max 1)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-returncallindirect-reserved.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --disable-reference-types --enable-tail-call\n;;; ARGS2: --disable-reference-types --enable-tail-call\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0]}\nsection(FUNCTION) { count[1] type[0] }\nsection(TABLE) { count[1] funcref flags[0] init[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 0\n    ;; The call_indirect reserved byte must be a single 0 byte. Using a long\n    ;; leb128 encoding of 0 is not valid.\n    return_call_indirect\n      index[leb_i32(0)]\n      reserved[0x80 0]\n  }\n}\n(;; STDERR ;;;\n0000022: error: return_call_indirect reserved value must be 0\n0000022: error: return_call_indirect reserved value must be 0\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-section-code-leb128.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection_code[0x81 0]  ;; Section code is not LEB128 encoded\nsection_size[1]\ntype_count[0]\n(;; STDERR ;;;\n000000a: error: invalid section code: 129\n000000a: error: invalid section code: 129\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-section-ends-early.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection_code[TYPE]\nsection_len[5]\ncount[0]\ndummy[0]\ndummy[0]\ndummy[0]\ndummy[0]\ndummy[0]\ndummy[0]\ndummy[0]\ndummy[0]\n(;; STDERR ;;;\n000000b: error: unfinished section (expected end: 0xf)\n000000b: error: unfinished section (expected end: 0xf)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-section-size-zero.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection_code[1] section_size[0]\n;; garbage after the section; shouldn't be read\n1 2 3 4 5\n(;; STDERR ;;;\n000000a: error: unable to read u32 leb128: type count\n000000a: error: unable to read u32 leb128: type count\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-segment-no-memory.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(DATA) {\n  count[1]\n  addr[i32.const 0 end]\n  data[str(\"hi\")]\n}\n(;; STDERR ;;;\n000000c: error: invalid data segment flags: 0x41\n000000c: error: invalid data segment flags: 0x41\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-start-func.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] sig[0] }\nsection(START) { func[1] }\nsection(CODE) { count[1] func { locals[0] } }\n(;; STDERR ;;;\nout/test/binary/bad-start-func/bad-start-func.wasm:0000015: error: function variable out of range: 1 (max 1)\nout/test/binary/bad-start-func/bad-start-func.wasm:0000015: error: function variable out of range: 1 (max 1)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-subsection-out-of-order.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  section(NAME_LOCALS) {\n    count[0]\n  }\n\n  section(NAME_FUNCTION) {\n    count[0]\n  }\n}\n(;; STDERR ;;;\n0000028: error: out-of-order sub-section\n0000028: error: out-of-order sub-section\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-subsection-size.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  subsection[1]\n  length[1]  ;; length is too short\n  func_count[1]\n  index[0]\n  str(\"$F0\")\n}\n(;; STDERR ;;;\n0000027: error: invalid name count 1, only 0 bytes left in section\n0000027: error: invalid name count 1, only 0 bytes left in section\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-subsection-unfinished.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[0]\n    str(\"$F0\")\n\n    data[1]  ;; extra unused data\n  }\n}\n(;; STDERR ;;;\n000002c: error: unfinished sub-section (expected end: 0x2d)\n000002c: error: unfinished sub-section (expected end: 0x2d)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-table-limits-flag-is64.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TABLE) {\n  count[1]\n  funcref\n  flags[4]\n}\n(;; STDERR ;;;\n000000d: error: memory64 not allowed\n000000d: error: memory64 not allowed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-table-limits-flag.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TABLE) {\n  count[1]\n  funcref\n  flags[8]\n}\n(;; STDERR ;;;\n000000d: error: malformed table limits flag: 8\n000000d: error: malformed table limits flag: 8\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-tag-after-global.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --enable-exceptions\n;;; ARGS2: --enable-exceptions\nmagic\nversion\nsection(GLOBAL) { count[0] }\nsection(TAG) { count[0] }\n(;; STDERR ;;;\n000000d: error: section Tag out of order\n000000d: error: section Tag out of order\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-tag-before-memory.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --enable-exceptions\n;;; ARGS2: --enable-exceptions\nmagic\nversion\nsection(TAG) { count[0] }\nsection(MEMORY) { count[0] }\n(;; STDERR ;;;\n000000d: error: section Memory out of order\n000000d: error: section Memory out of order\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-too-many-locals.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\n;;; ERROR: 1\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals [\n      decl_count[2]\n      leb_u32(0xffffffff) i32\n      leb_u32(1) i64\n    ]\n  }\n}\n(;; STDERR ;;;\n000001e: error: local count must be <= 0xffffffff\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-too-many-locals.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nFunction[1]:\n - func[0] sig=0\nCode[1]:\n - func[0] size=10\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: ff ff ff ff 0f 7f          | local[0..4294967294] type=i32\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-type-form.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  0x20\n}\n(;; STDERR ;;;\n000000c: error: unexpected type form (got 0x20)\n000000c: error: unexpected type form (got 0x20)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-typecheck-fail.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i64 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 1\n  }\n}\n\n(;; STDERR ;;;\nout/test/binary/bad-typecheck-fail/bad-typecheck-fail.wasm:000001a: error: type mismatch in implicit return, expected [i64] but got [i32]\nout/test/binary/bad-typecheck-fail/bad-typecheck-fail.wasm:000001a: error: type mismatch in implicit return, expected [i64] but got [i32]\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-typecheck-missing-drop.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 1\n    i32.const 2\n    i32.add\n  }\n}\n(;; STDERR ;;;\nout/test/binary/bad-typecheck-missing-drop/bad-typecheck-missing-drop.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32]\nout/test/binary/bad-typecheck-missing-drop/bad-typecheck-missing-drop.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32]\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/bad-unfinished-section.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\n;;; ERROR: 1\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[0] }\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[1]\n}\nsection(CODE) {\n  count[0]\n  data[str(\"extra_data_in_code_section\")]\n}\nsection(DATA) {\n  count[1]\n  memory_index[0]\n  offset[i32.const 0 end]\n  data[str(\"somedata\")]\n}\n(;; STDERR ;;;\n0000019: error: unfinished section (expected end: 0x34)\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbad-unfinished-section.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nFunction[0]:\nMemory[1]:\n - memory[0] pages: initial=1\nCode[0]:\nData[1]:\n - segment[0] memory=0 size=8 - init i32=0\n  - 0000000: 736f 6d65 6461 7461                      somedata\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/bad-version.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\n0xe 0 0 0\n(;; STDERR ;;;\n0000008: error: bad wasm file version: 0xe (expected 0x1)\n0000008: error: bad wasm file version: 0xe (expected 0x1)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/basic.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(EXPORT) { count[1] str(\"main\") func_kind func[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const\n    leb_i32(-420)\n    return\n  }\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (func (;0;) (type 0) (result i32)\n    i32.const -420\n    return)\n  (export \"main\" (func 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/code-metadata-section.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[1] i32\n}\nsection(FUNCTION) {\n  count[1]\n  type[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(\"metadata.code.test\") {\n  function_count[1]\n  function_index[0]\n  ann_count[1]\n  ann_offset[1]\n  ann_data_size[1]\n  ann_data[1]\n}\n\nsection(CODE) {\n  count[1]\n  func {\n    local_decls[0]\n    i32.const 1\n    return\n  }\n}\n(;; STDOUT ;;;\n\ncode-metadata-section.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nMemory[1]:\n - memory[0] pages: initial=0\nCustom:\n - name: \"metadata.code.test\"\n   - func[0]:\n    - meta[1]:\n     - 0000000: 01                                       .\nCode[1]:\n - func[0] size=5\n\nCode Disassembly:\n\n000037 func[0]:\n 000038: 41 01                      | i32.const 1\n 00003a: 0f                         | return\n 00003b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/compact-imports.txt",
    "content": ";;; TOOL: run-gen-wasm\n;;; ARGS: -v\n;;; ARGS1: --enable-compact-import\n;;; ARGS2: --enable-compact-import\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(IMPORT) {\n  count[6]\n  str(\"mod\") str(\"func\") func_kind type[0]\n  str(\"mod\") str(\"\") compact[0x7F]\n  count[3]\n  str(\"func2\") func_kind type[0]\n  str(\"func3\") func_kind type[0]\n  str(\"func4\") func_kind type[0]\n  str(\"mod\") str(\"\") compact[0x7E]\n  func_kind\n  count[2]\n  str(\"func5\") type[0]\n  str(\"func6\") type[0]\n}\n(;; STDERR ;;;\nBeginModule(version: 1)\n  BeginTypeSection(5)\n    OnTypeCount(1)\n    OnFuncType(index: 0, params: [], results: [i32])\n  EndTypeSection\n  BeginImportSection(65)\n    OnImportCount(6)\n    OnImport(index: 0, kind: func, module: \"mod\", field: \"func\")\n    OnImportFunc(import_index: 0, func_index: 0, sig_index: 0)\n    OnImport(index: 1, kind: func, module: \"mod\", field: \"func2\")\n    OnImportFunc(import_index: 1, func_index: 1, sig_index: 0)\n    OnImport(index: 2, kind: func, module: \"mod\", field: \"func3\")\n    OnImportFunc(import_index: 2, func_index: 2, sig_index: 0)\n    OnImport(index: 3, kind: func, module: \"mod\", field: \"func4\")\n    OnImportFunc(import_index: 3, func_index: 3, sig_index: 0)\n    OnImport(index: 4, kind: func, module: \"mod\", field: \"func5\")\n    OnImportFunc(import_index: 4, func_index: 4, sig_index: 0)\n    OnImport(index: 5, kind: func, module: \"mod\", field: \"func6\")\n    OnImportFunc(import_index: 5, func_index: 5, sig_index: 0)\n  EndImportSection\nEndModule\n;;; STDERR ;;)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (import \"mod\" \"func\" (func (;0;) (type 0)))\n  (import \"mod\" \"func2\" (func (;1;) (type 0)))\n  (import \"mod\" \"func3\" (func (;2;) (type 0)))\n  (import \"mod\" \"func4\" (func (;3;) (type 0)))\n  (import \"mod\" \"func5\" (func (;4;) (type 0)))\n  (import \"mod\" \"func6\" (func (;5;) (type 0))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/duplicate-func-names.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[3] type[0] type[0] type[0] }\nsection(CODE) {\n  count[3]\n  func { locals[decl_count[0]] }\n  func { locals[decl_count[0]] }\n  func { locals[decl_count[0]] }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[3]\n    index[0] str(\"F1\")\n    index[1] str(\"F1\")\n    index[2] str(\"F1\")\n  }\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func $F1 (type 0))\n  (func $F1.1 (type 0))\n  (func $F1.2 (type 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/duplicate-local-names.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func { locals[decl_count[1] i32_count[2] i32] }\n}\nsection(\"name\") {\n  section(NAME_LOCALS) {\n    func_count[1]\n    index[0]\n    local_count[2]\n    index[0]\n    str(\"L\")\n    index[1]\n    str(\"L\")\n  }\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (local $L i32) (local $L.1 i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/dylink-section.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(\"dylink\") {\n  mem_size[5]\n  mem_align[1]\n  table_size[3]\n  table_align[2]\n  needed_count[2]\n  str(\"libfoo.so\")\n  str(\"libbar.so\")\n}\n(;; STDOUT ;;;\n\ndylink-section.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nCustom:\n - name: \"dylink\"\n - mem_size     : 5\n - mem_p2align  : 1\n - table_size   : 3\n - table_p2align: 2\n - needed_dynlibs[2]:\n  - libfoo.so\n  - libbar.so\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/dylink0-section.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(\"dylink.0\") {\n  section(DYLINK_MEM_INFO) {\n    mem_size[5]\n    mem_align[1]\n    table_size[3]\n    table_align[2]\n  }\n\n  section(DYLINK_NEEDED) {\n    needed_count[2]\n    str(\"libfoo.so\")\n    str(\"libbar.so\")\n  }\n\n  section(DYLINK_EXPORT_INFO) {\n    count[2]\n    str(\"foo\")\n    flags[0]\n    str(\"foo2\")\n    flags[0]\n  }\n\n  section(DYLINK_IMPORT_INFO) {\n    count[2]\n    str(\"env\")\n    str(\"bar\")\n    flags[0]\n    str(\"env\")\n    str(\"baz\")\n    flags[0]\n  }\n}\n(;; STDOUT ;;;\n\ndylink0-section.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nCustom:\n - name: \"dylink.0\"\n - mem_size     : 5\n - mem_p2align  : 1\n - table_size   : 3\n - table_p2align: 2\n - needed_dynlibs[2]:\n  - libfoo.so\n  - libbar.so\n - exports[2]:\n  - foo [ binding=global vis=default ]\n  - foo2 [ binding=global vis=default ]\n - imports[2]:\n  - env.bar [ binding=global vis=default ]\n  - env.baz [ binding=global vis=default ]\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/function-local-count-zero.txt",
    "content": ";;; TOOL: run-gen-wasm\n;;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[2] sig[0] sig[0] }\nsection(CODE) {\n  count[2]\n  func {\n    local_decls[1]\n    locals[0] i32\n  }\n  func {\n    local_decls[4]\n    locals[1] i64\n    locals[0] i32\n    locals[2] f64\n    locals[0] f32\n  }\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0))\n  (func (;1;) (type 0)\n    (local i64 f64 f64)))\n\nfunction-local-count-zero.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nFunction[2]:\n - func[0] sig=0\n - func[1] sig=0\nCode[2]:\n - func[0] size=4\n - func[1] size=10\n\nCode Disassembly:\n\n000017 func[0]:\n 000018: 00 7f                      | local[] type=i32\n 00001a: 0b                         | end\n00001c func[1]:\n 00001d: 01 7e                      | local[0] type=i64\n 00001f: 00 7f                      | local[] type=i32\n 000021: 02 7c                      | local[1..2] type=f64\n 000023: 00 7d                      | local[] type=f32\n 000025: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/gen-wasm-parse-error.txt",
    "content": ";;; RUN: %(gen_wasm_py)s %(in_file)s\n;;; ERROR: 1\nsection(TYPE) { foo }\n(;; STDERR ;;;\n3: syntax error, LexToken(RBRACE,'}',3,22)\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/ignore-custom-section-error-objdump.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(\"linking\") {\n  metadata_version[2]\n  2 3 4 5 6 7\n}\n\n;; Some dummy data to make sure the module is still parsed after the invalid\n;; linking section.\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    return\n  }\n}\n(;; STDERR ;;;\n0000019: warning: unable to read u32 leb128: subsection size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nignore-custom-section-error-objdump.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nCustom:\n - name: \"linking\"\nType[1]:\n - type[0] () -> nil\nFunction[1]:\n - func[0] sig=0\nCode[1]:\n - func[0] size=3\n\nCode Disassembly:\n\n000027 func[0]:\n 000028: 0f                         | return\n 000029: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/ignore-custom-section-error-wasm2wat.txt",
    "content": ";;; TOOL: run-gen-wasm\n;;; ARGS1: --ignore-custom-section-errors\n;;; ARGS2: --ignore-custom-section-errors\nmagic\nversion\nsection(\"linking\") {\n  metadata_version[2]\n  2 3 4 5 6 7\n}\n\n;; Some dummy data to make sure the module is still parsed after the invalid\n;; linking section.\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    return\n  }\n}\n(;; STDERR ;;;\n0000019: warning: unable to read u32 leb128: subsection size\n0000019: warning: unable to read u32 leb128: subsection size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    return))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/invalid-name.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const 42\n  }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[0]\n    str(\"hi hello hey\")\n  }\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (func $hi_hello_hey (type 0) (result i32)\n    i32.const 42))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/linking-section.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\n;;; RUN: %(wasm-validate)s %(temp_file)s.wasm --enable-all\nmagic\nversion\nsection(TYPE) {\n  count[1]\n  function params[0] results[0]\n}\nsection(FUNCTION) {\n  count[1]\n  type[0]\n}\nsection(TABLE) {\n  count[1]\n  funcref\n  has_max[0]\n  initial[0]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(TAG) {\n  count[1]\n  attr[0]\n  sig[0]\n}\nsection(GLOBAL) {\n  count[1]\n  type[i32] met[0] init_expr[i32.const 0 end]\n}\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    return\n  }\n}\nsection(DATA) {\n  count[2]\n  memory_index[0]\n  offset[i32.const 0 end]\n  data[str(\"foo\")]\n  memory_index[0]\n  offset[i32.const 10 end]\n  data[str(\"bar\")]\n}\nsection(\"linking\") {\n  metadata_version[2]\n\n  section(LINKING_SEGMENT_INFO) {\n    count[3]\n    str(\"data1\")\n    p2align[2]\n    flags[1]\n    str(\"data2\")\n    p2align[3]\n    flags[10]\n    str(\"data3\")\n    p2align[2]\n    flags[4]\n  }\n\n  section(LINKING_INIT_FUNCTIONS) {\n    count[2]\n    priority[5]\n    func[1]\n    priority[6]\n    func[0]\n  }\n\n  section(LINKING_SYMBOL_TABLE) {\n    num_symbols[6]\n\n    type[0]\n    flags[1]\n    index[0]\n    str(\"func_sym\")\n\n    type[2]\n    flags[2]\n    index[0]\n    str(\"global_sym\")\n\n    type[1]\n    flags[leb_i32(260)]\n    str(\"data_sym\")\n    segment[1]\n    offset[2]\n    size[1]\n\n    type[1]\n    flags[leb_i32(512)]\n    str(\"absolute_data_sym\")\n    segment[0]\n    offset[leb_i32(1024)]\n    size[0]\n\n    type[0]\n    flags[0x10]\n    index[0]\n\n    type[5]\n    flags[1]\n    index[0]\n    str(\"table_sym\")\n  }\n\n  section(LINKING_COMDAT_INFO) {\n    num_comdats[2]\n\n    str(\"comdat1\")\n    flags[0]\n    num_entries[1]\n\n    kind[0]\n    index[1]\n\n    str(\"comdat2\")\n    flags[0]\n    num_entries[2]\n\n    kind[1]\n    index[2]\n\n    kind[1]\n    index[3]\n  }\n}\n(;; STDOUT ;;;\n\nlinking-section.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nFunction[1]:\n - func[0] sig=0 <func_sym>\nTable[1]:\n - table[0] type=funcref initial=0 <table_sym>\nMemory[1]:\n - memory[0] pages: initial=0\nTag[1]:\n - tag[0] sig=0\nGlobal[1]:\n - global[0] i32 mutable=0 <global_sym> - init i32=0\nCode[1]:\n - func[0] size=3 <func_sym>\nData[2]:\n - segment[0] <data1> memory=0 size=3 - init i32=0\n  - 0000000: 666f 6f                                  foo\n - segment[1] <data2> memory=0 size=3 - init i32=10\n  - 000000a: 6261 72                                  bar\nCustom:\n - name: \"linking\"\n  - segment info [count=3]\n   - 0: data1 p2align=2 [ STRINGS ]\n   - 1: data2 p2align=3 [ TLS unknown_flags=0x8 ]\n   - 2: data3 p2align=2 [ RETAIN ]\n  - init functions [count=2]\n   - 1: priority=5 <global_sym>\n   - 0: priority=6 <func_sym>\n  - symbol table [count=6]\n   - 0: F <func_sym> func=0 [ binding=weak vis=default ]\n   - 1: G <global_sym> global=0 [ binding=local vis=default ]\n   - 2: D <data_sym> segment=1 offset=2 size=1 [ tls binding=global vis=hidden ]\n   - 3: D <absolute_data_sym> address=1024 size=0 [ abs binding=global vis=default ]\n   - 4: F <func_sym> func=0 [ undefined binding=global vis=default ]\n   - 5: T <table_sym> table=0 [ binding=weak vis=default ]\n  - comdat groups [count=2]\n   - comdat1: [count=1]\n    - segment[1] <data2>\n   - comdat2: [count=2]\n    - func[2]\n    - func[3]\n\nCode Disassembly:\n\n00002e func[0] <func_sym>:\n 00002f: 0f                         | return\n 000030: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/missing-code-section-empty-function-section.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(FUNCTION) { count[0] }\n(;; STDOUT ;;;\n(module)\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/missing-function-section-empty-code-section.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(CODE) { count[0] }\n(;; STDOUT ;;;\n(module)\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/names.txt",
    "content": ";;; TOOL: run-gen-wasm\n;;; ARGS2: --generate-names\n;; NOTE: same test as in test/decompile/names.txt\nmagic\nversion\nsection(TYPE) {\n  count[2]\n  function params[0] results[1] i32\n  function params[0] results[0]\n}\nsection(FUNCTION) {\n  count[4]\n  type[0]\n  type[1]\n  type[1]\n  type[1]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(GLOBAL) {\n  count[2]\n  ;; This has both a sym and export name, prefer sym.\n  type[i32] mut[0] init_expr[i32.const 0 end]\n  ;; This only has an export name.\n  type[i32] mut[0] init_expr[i32.const 0 end]\n}\nsection(EXPORT) {\n  count[5]\n  str(\"F1_EXPORT\") func_kind func[1]\n  str(\"F2_EXPORT\") func_kind func[2]\n  str(\"F3_EXPORT\") func_kind func[3]\n  str(\"G0_EXPORT\") global_kind global[0]\n  str(\"G1_EXPORT\") global_kind global[1]\n}\nsection(CODE) {\n  count[4]\n  ;; Test name section.\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n  ;; Test naming priorities\n  ;; If there's a name section name, prefer that over sym/export.\n  func { locals[0] }\n  ;; If there's no name section name, prefer sym over export.\n  func { locals[0] }\n  ;; If there's only export, use that.\n  func { locals[0] }\n}\nsection(DATA) {\n  count[2]\n  ;; These can only be named thru symbols.\n  memory_index[0]\n  offset[i32.const 0 end]\n  data[str(\"foo\")]\n  memory_index[0]\n  offset[i32.const 10 end]\n  data[str(\"bar\")]\n}\nsection(\"name\") {\n  section(NAME_MODULE) {\n    str(\"M0\")\n  }\n  section(NAME_FUNCTION) {\n    func_count[2]\n    index[0]\n    str(\"F0\")\n    index[1]\n    str(\"F1_NS\")\n  }\n  section(NAME_LOCALS) {\n    func_count[1]\n    index[0]\n    local_count[1]\n    index[0]\n    str(\"L0\")\n  }\n}\nsection(\"linking\") {\n  metadata_version[2]\n  section(LINKING_SYMBOL_TABLE) {\n    num_symbols[5]\n    type[0] flags[1] index[1] str(\"F1_SYM\")\n    type[0] flags[1] index[2] str(\"F2_SYM\")\n    type[2] flags[1] index[0] str(\"G0_SYM\")\n\n    type[1] flags[4] str(\"D0_SYM\") segment[0] offset[0] size[1]\n    type[1] flags[4] str(\"D1_SYM\") segment[1] offset[0] size[1]\n  }\n}\n(;; STDOUT ;;;\n(module $M0\n  (type $t0 (func (result i32)))\n  (type $t1 (func))\n  (func $F0 (type $t0) (result i32)\n    (local $L0 i32)\n    local.get $L0)\n  (func $F1_NS (type $t1))\n  (func $F2_SYM (type $t1))\n  (func $F3_EXPORT (type $t1))\n  (memory $M0 0)\n  (global $G0_SYM i32 (i32.const 0))\n  (global $G1_EXPORT i32 (i32.const 0))\n  (export \"F1_EXPORT\" (func $F1_NS))\n  (export \"F2_EXPORT\" (func $F2_SYM))\n  (export \"F3_EXPORT\" (func $F3_EXPORT))\n  (export \"G0_EXPORT\" (global $G0_SYM))\n  (export \"G1_EXPORT\" (global $G1_EXPORT))\n  (data $D0_SYM (i32.const 0) \"foo\")\n  (data $D1_SYM (i32.const 10) \"bar\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/no-global-names.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(GLOBAL) {\n  count[1]\n  type[i32] mut[0] init_expr[i32.const 0 end]\n}\nsection(EXPORT) {\n  count[2]\n  str(\"bar\") func_kind func[0]\n  str(\"d_glob\") global_kind global[0]\n}\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    return\n  }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[0]\n    str(\"bar\")\n  }\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func $bar (type 0)\n    return)\n  (global (;0;) i32 (i32.const 0))\n  (export \"bar\" (func $bar))\n  (export \"d_glob\" (global 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/no-names.txt",
    "content": ";;; TOOL: run-gen-wasm\n;;; ARGS: --no-debug-names\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[0]\n    str(\"$F0\")\n  }\n\n  section(NAME_LOCALS) {\n    func_count[1]\n    index[0]\n    local_count[1]\n    index[0]\n    str(\"$L0\")\n  }\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (func (;0;) (type 0) (result i32)\n    (local i32)\n    local.get 0))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/relocs.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(\"mysection\") {}\nsection(\"linking\") {\n  metadata_version[2]\n\n  section(LINKING_SYMBOL_TABLE) {\n    num_symbols[1]\n\n    type[3]\n    flags[0]\n    index[1]\n  }\n}\nsection(\"reloc.TYPE\") {\n  reloc_section[0]\n  reloc_count[0]\n}\nsection(\"reloc.mysection\") {\n  reloc_section[1]\n  reloc_count[1]\n\n  reloc_type[8]\n  reloc_offset[0]\n  reloc_symbol[0]\n  reloc_addend[0]\n}\n(;; STDOUT ;;;\n\nrelocs.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nCustom:\n - name: \"mysection\"\nCustom:\n - name: \"linking\"\n  - symbol table [count=1]\n   - 0: S <mysection> section=1 [ binding=global vis=default ]\nCustom:\n - name: \"reloc.TYPE\"\n  - relocations for section: 0 (Type) [0]\nCustom:\n - name: \"reloc.mysection\"\n  - relocations for section: 1 (mysection) [1]\n   - R_WASM_FUNCTION_OFFSET_I32 offset=00000000(file=0x00003d) symbol=0 <mysection>\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/target-features-section.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS: -x\nmagic\nversion\nsection(\"target_features\") {\n  count[3]\n  prefix['-']\n  str(\"foo\")\n  prefix['+']\n  str(\"bar\")\n  prefix['=']\n  str(\"baz\")\n}\n(;; STDOUT ;;;\n\ntarget-features-section.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nCustom:\n - name: \"target_features\"\n  - [-] foo\n  - [+] bar\n  - [=] baz\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/binary/unrecognized-layer.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\n0xe 0 0x2 0\n(;; STDERR ;;;\n0000008: error: unsupported wasm layer: 0x2\n0000008: error: unsupported wasm layer: 0x2\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/unsupported-component.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\n0xd 0 0x1 0\n(;; STDERR ;;;\n0000008: error: wasm components are not yet supported in this tool\n0000008: error: wasm components are not yet supported in this tool\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/binary/user-section.txt",
    "content": ";;; TOOL: run-gen-wasm\n;;; ARGS: -v\nmagic\nversion\nsection(\"foo\") { count[4] }\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(\"bar\") { count[5] }\nsection(\"foo\") { count[6] }\n(;; STDERR ;;;\nBeginModule(version: 1)\n  BeginCustomSection('foo', size: 5)\n    BeginGenericCustomSection(5)\n      OnGenericCustomSection(name: \"foo\", size: 1)\n    EndGenericCustomSection\n  EndCustomSection\n  BeginTypeSection(5)\n    OnTypeCount(1)\n    OnFuncType(index: 0, params: [], results: [i32])\n  EndTypeSection\n  BeginCustomSection('bar', size: 5)\n    BeginGenericCustomSection(5)\n      OnGenericCustomSection(name: \"bar\", size: 1)\n    EndGenericCustomSection\n  EndCustomSection\n  BeginCustomSection('foo', size: 5)\n    BeginGenericCustomSection(5)\n      OnGenericCustomSection(name: \"foo\", size: 1)\n    EndGenericCustomSection\n  EndCustomSection\nEndModule\n;;; STDERR ;;)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/decompile/basic.txt",
    "content": ";;; TOOL: run-wasm-decompile\n\n(module\n  (import \"ns\" \"fi\" (func))\n  (import \"ns\" \"g3\" (global i32))\n  (import \"ns\" \"tab3\" (table 0 12 funcref))\n  ;; (import \"ns\" \"m1\" (memory 1))  ;; Can test only 1 at a time :(\n\n  (memory (export \"m2\") 1)\n\n  (global $g1 (mut i32) (i32.const 10))\n  (global (export \"g2\") (mut i32) (i32.const 11))\n\n  (table $tab1 0 10 funcref)\n  (table (export \"tab2\") 0 11 funcref)\n\n  (data 0 (offset (i32.const 0)) \"Hello, World!\\n\\00\")\n  (data 0 (offset (i32.const 100)) \"abcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyz\")\n  (data 0 (offset (i32.const 200)) \"hi\")  ;; Too short for data derived name\n  (data 0 (offset (i32.const 300)) \"Hello, World!\\n\\00\")  ;; Duplicate.\n\n  (func $f (param i32 i32) (result i32) (local i64 f32 f64)\n    i64.const 8\n    local.set 2\n    f32.const 6.0\n    local.set 3\n    f64.const 7.0\n    local.tee 4\n    f64.const 10.0\n    f64.lt\n    if\n      i32.const 1\n      i32.const 2\n      i32.load offset=3 align=1\n      i32.const 5\n      i32.add\n      i32.store offset=4\n    end\n    local.get 0\n    global.get $g1\n    i32.add\n    i32.const 9\n    call $f\n    drop\n    loop\n      block\n        i32.const 0\n        if (result i32)\n          i32.const 1\n        else\n          i32.const 2\n        end\n        br_if 0\n        br 1\n      end\n      i32.const 1\n      br_if 0\n    end\n    i32.const 1\n    i32.const 2\n    i32.const 1\n    i32.const 1\n    i32.eq\n    select\n    drop\n    block\n      block\n        block\n          block\n            block\n              local.get 0\n              br_table 3 2 1 0 4\n              unreachable\n            end\n            i32.const 100\n            return\n          end\n          i32.const 101\n          return\n        end\n        i32.const 102\n        return\n      end\n      i32.const 103\n      return\n    end\n    i32.const 104\n    drop\n    i32.const 1\n    block (param i32)   ;; block with input\n      br_if 0\n    end\n    block (result i32)  ;; block as an exp.\n    i32.const 2\n    i32.const 0\n    br_if 0\n    drop\n    i32.const 3\n    end\n    local.set 0\n    nop\n    ref.null func\n    ref.is_null\n    drop\n    i32.const 0  ;; fi\n    call_indirect\n    i32.const 0\n    if\n    else\n    end\n    i32.const 0\n  )\n  (func $g (param) (result) (local i32)\n    ;; This is rare, but requires special handling: uses of local outside scope\n    ;; of first definition.\n    loop\n      i32.const 1\n      local.tee 0\n      br_if 0\n    end\n    local.get 0\n    drop\n  )\n  ;; LLD outputs a name section with de-mangled C++ function signatures as names,\n  ;; so have to make sure special chars get removed.\n  (func (export \"void signature-&<>(int a)\") (param) (result))\n  (func (export \"void signature-&[](int a)\") (param) (result))\n  (func $not-exported (param) (result))\n  (export \"f\" (func $f))\n)\n\n(;; STDOUT ;;;\nexport memory m2(initial: 1, max: 0);\n\nimport global ns_g3:int;\nglobal g_b:int = 10;\nexport global g2:int = 11;\n\nimport table ns_tab3:funcref;\ntable T_b:funcref(min: 0, max: 10);\nexport table tab2:funcref(min: 0, max: 11);\n\ndata d_HelloWorld(offset: 0) = \"Hello, World!\\0a\\00\";\ndata d_abcdefghijklmnoqrstuvwxyzabc(offset: 100) =\n  \"abcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstu\"\n  \"vwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmno\"\n  \"qrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghij\"\n  \"klmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyzabcdefghijklmnoqrstuvwxyz\";\ndata d_c(offset: 200) = \"hi\";\ndata d_d(offset: 300) = \"Hello, World!\\0a\\00\";\n\nimport function ns_fi(); // func0\n\nexport function f(a:int, b:int):int { // func1\n  var c:long = 8L;\n  var d:float = 6.0f;\n  var e:double = 7.0;\n  if (e < 10.0) { d_HelloWorld[5@4]:int = d_HelloWorld[5]:int@1 + 5 }\n  f(a + g_b, 9);\n  loop L_b {\n    if (if (0) { 1 } else { 2 }) goto B_c;\n    continue L_b;\n    label B_c:\n    if (1) continue L_b;\n  }\n  select_if(1, 2, 1 == 1);\n  br_table[B_f, B_g, B_h, B_i, ..B_e](a);\n  unreachable;\n  label B_i:\n  return 100;\n  label B_h:\n  return 101;\n  label B_g:\n  return 102;\n  label B_f:\n  return 103;\n  label B_e:\n  104;\n  if (1) goto B_j;\n  label B_j:\n  a = {\n        2;\n        if (0) goto B_k;\n        3;\n        label B_k:\n      }\n  nop;\n  is_null(null);\n  call_indirect(0);\n  if (0) {}\n  return 0;\n}\n\nfunction f_c() { // func2\n  var a:int;\n  loop L_a {\n    a = 1;\n    if (a) continue L_a;\n  }\n  a;\n}\n\nfunction signature() { // func3\n}\n\nfunction signature_1() { // func4\n}\n\nfunction f_f() { // func5\n}\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/decompile/code-metadata.txt",
    "content": ";;; TOOL: run-wasm-decompile\n\n(module\n  (func $f (param i32) (result i32)\n    i32.const 1234\n    local.get 0\n    (@metadata.code.test \"aa\\01a\") i32.add\n    return))\n\n(;; STDOUT ;;;\nfunction f_a(a:int):int { // func0\n  let t0 = a;\n  // @metadata.code.test \"aa\\01a\";\n  return 1234 + t0;\n}\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/decompile/loadstore.txt",
    "content": ";;; TOOL: run-wasm-decompile\n\n(module\n  (memory $m1 1)\n\n  (data 0 (offset (i32.const 10)) \"Hello, World!\\n\\00\")\n\n  (func $f (param i32 i32) (result) (local i32 i32 i32 i32 i32 i32)\n    ;; Test regular accesses that become a struct.\n    local.get 0\n    f32.load offset=0\n    local.get 2\n    f32.load offset=0\n    f32.add\n    local.get 0\n    f32.load offset=4\n    local.get 2\n    f32.load offset=4\n    f32.add\n    f32.add\n    drop\n    local.get 1\n    i64.load16_u offset=0\n    local.get 3\n    i64.load16_u offset=0\n    i64.add\n    local.get 1\n    i64.load offset=8\n    local.get 3\n    i64.load offset=8\n    i64.add\n    i64.add\n    drop\n    ;; Test things that do not become a struct for various reasons.\n    ;; 1) Mixed type access.\n    local.get 4\n    i32.load offset=0\n    drop\n    local.get 4\n    f32.load offset=0\n    drop\n    ;; 2) Mixed size access.\n    local.get 5\n    i32.load offset=0\n    drop\n    local.get 5\n    i32.load16_s offset=0\n    drop\n    ;; 3) Mixed align requirement access.\n    local.get 6\n    i32.load offset=0\n    drop\n    local.get 6\n    i32.load offset=0 align=1\n    drop\n    ;; 4) Unaligned access / access with unexpected gaps.\n    local.get 7\n    f32.load offset=1 align=1\n    drop\n    ;; Test index rewriting.\n    ;; code that does (base + (index << 2))[0]:int is super common.\n    local.get 0\n    local.get 1\n    i32.const 2\n    i32.shl\n    i32.add\n    local.get 0\n    local.get 1\n    i32.const 2\n    i32.shl\n    i32.add\n    i32.load offset=0\n    i32.store offset=0\n    ;; Same with non-zero offsets.\n    local.get 0\n    local.get 1\n    i32.const 2\n    i32.shl\n    i32.add\n    local.get 0\n    local.get 1\n    i32.const 2\n    i32.shl\n    i32.add\n    i32.load offset=4\n    i32.store offset=4\n    ;; If the shift amount does not match, it doesn't work.\n    local.get 0\n    local.get 1\n    i32.const 3\n    i32.shl\n    i32.add\n    local.get 0\n    local.get 1\n    i32.const 2\n    i32.shl\n    i32.add\n    i32.load offset=4\n    i32.store offset=4\n    ;; Test naming of absolute addresses referring to data sections.\n    i32.const 16\n    i32.load8_u offset=1  ;; Refers to the 'W'\n    drop\n  )\n  (export \"f\" (func $f))\n)\n\n(;; STDOUT ;;;\nmemory M_a(initial: 1, max: 0);\n\ndata d_HelloWorld(offset: 10) = \"Hello, World!\\0a\\00\";\n\nexport function f(a:{ a:float, b:float }, b:{ a:ushort, b:long }) { // func0\n  var c:{ a:float, b:float }\n  var d:{ a:ushort, b:long }\n  var e:int;\n  var f:int;\n  var g:int;\n  var h:float_ptr@1;\n  a.a + c.a + a.b + c.b;\n  b.a + d.a + b.b + d.b;\n  e[0]:int;\n  e[0]:float;\n  f[0]:int;\n  f[0]:short;\n  g[0]:int;\n  g[0]:int@1;\n  h[1];\n  a[b]:int = a[b]:int;\n  a[b + 1]:int = a[b + 1]:int;\n  (a + (b << 3))[1]:int = a[b + 1]:int;\n  d_HelloWorld[7]:ubyte;\n}\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/decompile/names.txt",
    "content": ";;; TOOL: run-gen-wasm-decompile\n;; NOTE: same test as in test/binary/names.txt\nmagic\nversion\nsection(TYPE) {\n  count[2]\n  function params[0] results[1] i32\n  function params[0] results[0]\n}\nsection(FUNCTION) {\n  count[4]\n  type[0]\n  type[1]\n  type[1]\n  type[1]\n}\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(GLOBAL) {\n  count[2]\n  ;; This has both a sym and export name, prefer sym.\n  type[i32] mut[0] init_expr[i32.const 0 end]\n  ;; This only has an export name.\n  type[i32] mut[0] init_expr[i32.const 0 end]\n}\nsection(EXPORT) {\n  count[5]\n  str(\"F1_EXPORT\") func_kind func[1]\n  str(\"F2_EXPORT\") func_kind func[2]\n  str(\"F3_EXPORT\") func_kind func[3]\n  str(\"G0_EXPORT\") global_kind global[0]\n  str(\"G1_EXPORT\") global_kind global[1]\n}\nsection(CODE) {\n  count[4]\n  ;; Test name section.\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n  ;; Test naming priorities\n  ;; If there's a name section name, prefer that over sym/export.\n  func { locals[0] }\n  ;; If there's no name section name, prefer sym over export.\n  func { locals[0] }\n  ;; If there's only export, use that.\n  func { locals[0] }\n}\nsection(DATA) {\n  count[2]\n  ;; These can only be named thru symbols.\n  memory_index[0]\n  offset[i32.const 0 end]\n  data[str(\"Hello, World!\")]\n  memory_index[0]\n  offset[i32.const 10 end]\n  data[str(\"bar\")]\n}\nsection(\"name\") {\n  section(NAME_MODULE) {\n    str(\"M0\")\n  }\n  section(NAME_FUNCTION) {\n    func_count[2]\n    index[0]\n    str(\"F0\")\n    index[1]\n    str(\"F1_NS\")\n  }\n  section(NAME_LOCALS) {\n    func_count[1]\n    index[0]\n    local_count[1]\n    index[0]\n    str(\"L0\")\n  }\n}\nsection(\"linking\") {\n  metadata_version[2]\n  section(LINKING_SYMBOL_TABLE) {\n    num_symbols[5]\n    type[0] flags[1] index[1] str(\"F1_SYM\")\n    type[0] flags[1] index[2] str(\"F2_SYM\")\n    type[2] flags[1] index[0] str(\"G0_SYM\")\n\n    type[1] flags[4] str(\"D0_SYM\") segment[0] offset[0] size[1]\n    type[1] flags[4] str(\"D1_SYM\") segment[1] offset[0] size[1]\n  }\n}\n(;; STDOUT ;;;\nmemory M_a(initial: 0, max: 0);\n\nglobal G0_SYM:int = 0;\nexport global G1_EXPORT:int = 0;\n\ndata D0_SYM(offset: 0) = \"Hello, World!\";\ndata D1_SYM(offset: 10) = \"bar\";\n\nfunction F0():int { // func0\n  var L0:int;\n  return L0;\n}\n\nfunction F1_NS() { // func1\n}\n\nfunction F2_SYM() { // func2\n}\n\nexport function F3_EXPORT() { // func3\n}\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/decompile/passive-data.txt",
    "content": ";;; TOOL: run-wasm-decompile\n(memory 1)\n(data $p \"x\")\n(;; STDOUT ;;;\nmemory M_a(initial: 1, max: 0);\n\ndata d_a(passive) = \"x\";\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/decompile/precedence.txt",
    "content": "  ;;; TOOL: run-wasm-decompile\n\n(module\n  (memory $m1 1)\n\n  (func $precedence (param) (result)\n    ;; some exp in order that will generate no parens\n    i32.const 0\n    i32.load offset=0\n    i32.const 1\n    i32.mul\n    i32.const 2\n    i32.add\n    i32.const 3\n    i32.shl\n    i32.const 4\n    i32.eq\n    i32.const 5\n    i32.and\n    drop\n    ;; some exp in reverse order that will generate parens.\n    i32.const 6\n    i32.const 5\n    i32.and\n    i32.const 4\n    i32.eq\n    i32.const 3\n    i32.shl\n    i32.const 2\n    i32.add\n    i32.const 1\n    i32.mul\n    i32.load offset=0\n    drop\n  )\n  (export \"precedence\" (func $precedence))\n)\n\n(;; STDOUT ;;;\nmemory M_a(initial: 1, max: 0);\n\nexport function precedence() { // func0\n  0[0]:int * 1 + 2 << 3 == 4 & 5;\n  (((((6 & 5) == 4) << 3) + 2) * 1)[0]:int;\n}\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/decompile/stack-flush.txt",
    "content": ";;; TOOL: run-wasm-decompile\n\n(module\n  (memory 1)\n  (func $f (param i32 i32) (result i32) (local i64 f32 f64)\n    ;; Two-level flushing to stack with code that can't be reordered.\n    call $s\n    call $s\n    drop\n    call $s\n    call $s\n    call $s\n    drop\n    i32.add\n    drop\n    drop\n    ;; Two level flushing with constants that can be re-ordered.\n    i32.const 14\n    i32.const 15\n    drop\n    i32.const 11\n    i32.const 12\n    i32.const 13\n    drop\n    i32.add\n    drop\n    drop\n    ;; Multi-value examples.\n    call $mv\n    call $mv\n    drop\n    i32.add\n    drop\n    drop\n    call $mv\n    i32.eq\n  )\n  (func $s (param) (result i32)\n    i32.const 1\n  )\n  (func $mv (param) (result i32 i32)\n    i32.const 1\n    i32.const 2\n  )\n  (export \"f\" (func $f))\n  (export \"s\" (func $s))\n  (export \"mv\" (func $mv))\n)\n\n(;; STDOUT ;;;\nmemory M_a(initial: 1, max: 0);\n\nexport function f(a:int, b:int):int { // func0\n  let t0 = s();\n  s();\n  let t1, t2 = s(), s();\n  s();\n  t1 + t2;\n  t0;\n  15;\n  13;\n  11 + 12;\n  14;\n  let t3, t4 = mv();\n  let t5, t6 = mv();\n  t6;\n  t4 + t5;\n  t3;\n  let t7, t8 = mv();\n  return t7 == t8;\n}\n\nexport function s():int { // func1\n  return 1\n}\n\nexport function mv():(int, int) { // func2\n  return 1, 2\n}\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/desugar/basic.txt",
    "content": ";;; TOOL: wat-desugar\n(module\n  (import \"foo\" \"bar\" (func (result i32)))\n\n  (global i32 (i32.const 1))\n\n  (table funcref (elem 0))\n\n  (memory (data \"hello\"))\n\n  (func (result i32)\n    (i32.add (call 0) (i32.load8_s (i32.const 1)))))\n(;; STDOUT ;;;\n(module\n  (import \"foo\" \"bar\" (func (;0;) (result i32)))\n  (global (;0;) i32 (i32.const 1))\n  (table (;0;) 1 1 funcref)\n  (elem (;0;) (i32.const 0) func 0)\n  (memory (;0;) 1 1)\n  (data (;0;) (i32.const 0) \"hello\")\n  (func (;1;) (result i32)\n    call 0\n    i32.const 1\n    i32.load8_s\n    i32.add)\n  (type (;0;) (func (result i32))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/desugar/call_indirect.txt",
    "content": ";;; TOOL: wat-desugar\n(table 0 funcref)\n(func\n i32.const 0\n i32.const 0\n i32.const 0\n i32.const 0\n call_indirect (type 0)\n call_indirect\n call_indirect (param i32))\n(;; STDOUT ;;;\n(module\n  (table (;0;) 0 funcref)\n  (func (;0;)\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    call_indirect (type 0)\n    call_indirect (type 0)\n    call_indirect (type 1))\n  (type (;0;) (func))\n  (type (;1;) (func (param i32))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/desugar/implicit-func-type.txt",
    "content": ";;; TOOL: wat-desugar\n(module\n  ;; The implicitly defined function type should come before the function,\n  ;; otherwise the function will not \"see\" it and define its own.\n  (func (param i32)\n    nop)\n\n  ;; This won't define a new function type, it will reuse the one above.\n  (func (param i32)\n    nop))\n(;; STDOUT ;;;\n(module\n  (func (;0;) (param i32)\n    nop)\n  (func (;1;) (param i32)\n    nop)\n  (type (;0;) (func (param i32))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/desugar/locals.txt",
    "content": ";;; TOOL: wat-desugar\n(module\n  (type (func (param i32) (result i32)))\n  (func (type 0) (local $var i32)\n        (local.get 0)\n        (local.tee $var)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32) (result i32)))\n  (func (;0;) (type 0) (param i32) (result i32)\n    (local $var i32)\n    local.get 0\n    local.tee $var))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/desugar/try.txt",
    "content": ";;; TOOL: wat-desugar\n;;; ARGS: --enable-exceptions\n(module\n  (tag $ex (param i32))\n  (func (result i32)\n    try $try1 (result i32)\n      nop\n      i32.const 7\n    catch $ex\n      nop\n    end\n  )\n)\n(;; STDOUT ;;;\n(module\n  (tag $ex (param i32))\n  (func (;0;) (result i32)\n    try $try1 (result i32)\n      nop\n      i32.const 7\n    catch $ex\n      nop\n    end)\n  (type (;0;) (func (param i32)))\n  (type (;1;) (func (result i32))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/array.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: --enable-gc\n;;; ARGS1: -x\n(type (array i32))\n(type (array (mut i64)))\n(;; STDOUT ;;;\n\narray.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[2]:\n - type[0] (array i32)\n - type[1] (array (mut i64))\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/atomic.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: --enable-threads\n\n(module\n  (memory 1 1 shared)\n  (func\n    i32.const 0 i32.const 0 memory.atomic.notify drop\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop\n\n    i32.const 0 i32.atomic.load drop\n    i32.const 0 i64.atomic.load drop\n    i32.const 0 i32.atomic.load8_u drop\n    i32.const 0 i32.atomic.load16_u drop\n    i32.const 0 i64.atomic.load8_u drop\n    i32.const 0 i64.atomic.load16_u drop\n    i32.const 0 i64.atomic.load32_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.store\n    i32.const 0 i64.const 0 i64.atomic.store\n    i32.const 0 i32.const 0 i32.atomic.store8\n    i32.const 0 i32.const 0 i32.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store8\n    i32.const 0 i64.const 0 i64.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store32\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.add drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.add drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.and drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.and drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.or drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.or drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop\n\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop\n\n))\n(;; STDOUT ;;;\n\natomic.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001e func[0]:\n 00001f: 41 00                      | i32.const 0\n 000021: 41 00                      | i32.const 0\n 000023: fe 00 02 00                | memory.atomic.notify 2 0\n 000027: 1a                         | drop\n 000028: 41 00                      | i32.const 0\n 00002a: 41 00                      | i32.const 0\n 00002c: 42 00                      | i64.const 0\n 00002e: fe 01 02 00                | memory.atomic.wait32 2 0\n 000032: 1a                         | drop\n 000033: 41 00                      | i32.const 0\n 000035: 42 00                      | i64.const 0\n 000037: 42 00                      | i64.const 0\n 000039: fe 02 03 00                | memory.atomic.wait64 3 0\n 00003d: 1a                         | drop\n 00003e: 41 00                      | i32.const 0\n 000040: fe 10 02 00                | i32.atomic.load 2 0\n 000044: 1a                         | drop\n 000045: 41 00                      | i32.const 0\n 000047: fe 11 03 00                | i64.atomic.load 3 0\n 00004b: 1a                         | drop\n 00004c: 41 00                      | i32.const 0\n 00004e: fe 12 00 00                | i32.atomic.load8_u 0 0\n 000052: 1a                         | drop\n 000053: 41 00                      | i32.const 0\n 000055: fe 13 01 00                | i32.atomic.load16_u 1 0\n 000059: 1a                         | drop\n 00005a: 41 00                      | i32.const 0\n 00005c: fe 14 00 00                | i64.atomic.load8_u 0 0\n 000060: 1a                         | drop\n 000061: 41 00                      | i32.const 0\n 000063: fe 15 01 00                | i64.atomic.load16_u 1 0\n 000067: 1a                         | drop\n 000068: 41 00                      | i32.const 0\n 00006a: fe 16 02 00                | i64.atomic.load32_u 2 0\n 00006e: 1a                         | drop\n 00006f: 41 00                      | i32.const 0\n 000071: 41 00                      | i32.const 0\n 000073: fe 17 02 00                | i32.atomic.store 2 0\n 000077: 41 00                      | i32.const 0\n 000079: 42 00                      | i64.const 0\n 00007b: fe 18 03 00                | i64.atomic.store 3 0\n 00007f: 41 00                      | i32.const 0\n 000081: 41 00                      | i32.const 0\n 000083: fe 19 00 00                | i32.atomic.store8 0 0\n 000087: 41 00                      | i32.const 0\n 000089: 41 00                      | i32.const 0\n 00008b: fe 1a 01 00                | i32.atomic.store16 1 0\n 00008f: 41 00                      | i32.const 0\n 000091: 42 00                      | i64.const 0\n 000093: fe 1b 00 00                | i64.atomic.store8 0 0\n 000097: 41 00                      | i32.const 0\n 000099: 42 00                      | i64.const 0\n 00009b: fe 1c 01 00                | i64.atomic.store16 1 0\n 00009f: 41 00                      | i32.const 0\n 0000a1: 42 00                      | i64.const 0\n 0000a3: fe 1d 02 00                | i64.atomic.store32 2 0\n 0000a7: 41 00                      | i32.const 0\n 0000a9: 41 00                      | i32.const 0\n 0000ab: fe 1e 02 00                | i32.atomic.rmw.add 2 0\n 0000af: 1a                         | drop\n 0000b0: 41 00                      | i32.const 0\n 0000b2: 42 00                      | i64.const 0\n 0000b4: fe 1f 03 00                | i64.atomic.rmw.add 3 0\n 0000b8: 1a                         | drop\n 0000b9: 41 00                      | i32.const 0\n 0000bb: 41 00                      | i32.const 0\n 0000bd: fe 20 00 00                | i32.atomic.rmw8.add_u 0 0\n 0000c1: 1a                         | drop\n 0000c2: 41 00                      | i32.const 0\n 0000c4: 41 00                      | i32.const 0\n 0000c6: fe 21 01 00                | i32.atomic.rmw16.add_u 1 0\n 0000ca: 1a                         | drop\n 0000cb: 41 00                      | i32.const 0\n 0000cd: 42 00                      | i64.const 0\n 0000cf: fe 22 00 00                | i64.atomic.rmw8.add_u 0 0\n 0000d3: 1a                         | drop\n 0000d4: 41 00                      | i32.const 0\n 0000d6: 42 00                      | i64.const 0\n 0000d8: fe 23 01 00                | i64.atomic.rmw16.add_u 1 0\n 0000dc: 1a                         | drop\n 0000dd: 41 00                      | i32.const 0\n 0000df: 42 00                      | i64.const 0\n 0000e1: fe 24 02 00                | i64.atomic.rmw32.add_u 2 0\n 0000e5: 1a                         | drop\n 0000e6: 41 00                      | i32.const 0\n 0000e8: 41 00                      | i32.const 0\n 0000ea: fe 25 02 00                | i32.atomic.rmw.sub 2 0\n 0000ee: 1a                         | drop\n 0000ef: 41 00                      | i32.const 0\n 0000f1: 42 00                      | i64.const 0\n 0000f3: fe 26 03 00                | i64.atomic.rmw.sub 3 0\n 0000f7: 1a                         | drop\n 0000f8: 41 00                      | i32.const 0\n 0000fa: 41 00                      | i32.const 0\n 0000fc: fe 27 00 00                | i32.atomic.rmw8.sub_u 0 0\n 000100: 1a                         | drop\n 000101: 41 00                      | i32.const 0\n 000103: 41 00                      | i32.const 0\n 000105: fe 28 01 00                | i32.atomic.rmw16.sub_u 1 0\n 000109: 1a                         | drop\n 00010a: 41 00                      | i32.const 0\n 00010c: 42 00                      | i64.const 0\n 00010e: fe 29 00 00                | i64.atomic.rmw8.sub_u 0 0\n 000112: 1a                         | drop\n 000113: 41 00                      | i32.const 0\n 000115: 42 00                      | i64.const 0\n 000117: fe 2a 01 00                | i64.atomic.rmw16.sub_u 1 0\n 00011b: 1a                         | drop\n 00011c: 41 00                      | i32.const 0\n 00011e: 42 00                      | i64.const 0\n 000120: fe 2b 02 00                | i64.atomic.rmw32.sub_u 2 0\n 000124: 1a                         | drop\n 000125: 41 00                      | i32.const 0\n 000127: 41 00                      | i32.const 0\n 000129: fe 2c 02 00                | i32.atomic.rmw.and 2 0\n 00012d: 1a                         | drop\n 00012e: 41 00                      | i32.const 0\n 000130: 42 00                      | i64.const 0\n 000132: fe 2d 03 00                | i64.atomic.rmw.and 3 0\n 000136: 1a                         | drop\n 000137: 41 00                      | i32.const 0\n 000139: 41 00                      | i32.const 0\n 00013b: fe 2e 00 00                | i32.atomic.rmw8.and_u 0 0\n 00013f: 1a                         | drop\n 000140: 41 00                      | i32.const 0\n 000142: 41 00                      | i32.const 0\n 000144: fe 2f 01 00                | i32.atomic.rmw16.and_u 1 0\n 000148: 1a                         | drop\n 000149: 41 00                      | i32.const 0\n 00014b: 42 00                      | i64.const 0\n 00014d: fe 30 00 00                | i64.atomic.rmw8.and_u 0 0\n 000151: 1a                         | drop\n 000152: 41 00                      | i32.const 0\n 000154: 42 00                      | i64.const 0\n 000156: fe 31 01 00                | i64.atomic.rmw16.and_u 1 0\n 00015a: 1a                         | drop\n 00015b: 41 00                      | i32.const 0\n 00015d: 42 00                      | i64.const 0\n 00015f: fe 32 02 00                | i64.atomic.rmw32.and_u 2 0\n 000163: 1a                         | drop\n 000164: 41 00                      | i32.const 0\n 000166: 41 00                      | i32.const 0\n 000168: fe 33 02 00                | i32.atomic.rmw.or 2 0\n 00016c: 1a                         | drop\n 00016d: 41 00                      | i32.const 0\n 00016f: 42 00                      | i64.const 0\n 000171: fe 34 03 00                | i64.atomic.rmw.or 3 0\n 000175: 1a                         | drop\n 000176: 41 00                      | i32.const 0\n 000178: 41 00                      | i32.const 0\n 00017a: fe 35 00 00                | i32.atomic.rmw8.or_u 0 0\n 00017e: 1a                         | drop\n 00017f: 41 00                      | i32.const 0\n 000181: 41 00                      | i32.const 0\n 000183: fe 36 01 00                | i32.atomic.rmw16.or_u 1 0\n 000187: 1a                         | drop\n 000188: 41 00                      | i32.const 0\n 00018a: 42 00                      | i64.const 0\n 00018c: fe 37 00 00                | i64.atomic.rmw8.or_u 0 0\n 000190: 1a                         | drop\n 000191: 41 00                      | i32.const 0\n 000193: 42 00                      | i64.const 0\n 000195: fe 38 01 00                | i64.atomic.rmw16.or_u 1 0\n 000199: 1a                         | drop\n 00019a: 41 00                      | i32.const 0\n 00019c: 42 00                      | i64.const 0\n 00019e: fe 39 02 00                | i64.atomic.rmw32.or_u 2 0\n 0001a2: 1a                         | drop\n 0001a3: 41 00                      | i32.const 0\n 0001a5: 41 00                      | i32.const 0\n 0001a7: fe 3a 02 00                | i32.atomic.rmw.xor 2 0\n 0001ab: 1a                         | drop\n 0001ac: 41 00                      | i32.const 0\n 0001ae: 42 00                      | i64.const 0\n 0001b0: fe 3b 03 00                | i64.atomic.rmw.xor 3 0\n 0001b4: 1a                         | drop\n 0001b5: 41 00                      | i32.const 0\n 0001b7: 41 00                      | i32.const 0\n 0001b9: fe 3c 00 00                | i32.atomic.rmw8.xor_u 0 0\n 0001bd: 1a                         | drop\n 0001be: 41 00                      | i32.const 0\n 0001c0: 41 00                      | i32.const 0\n 0001c2: fe 3d 01 00                | i32.atomic.rmw16.xor_u 1 0\n 0001c6: 1a                         | drop\n 0001c7: 41 00                      | i32.const 0\n 0001c9: 42 00                      | i64.const 0\n 0001cb: fe 3e 00 00                | i64.atomic.rmw8.xor_u 0 0\n 0001cf: 1a                         | drop\n 0001d0: 41 00                      | i32.const 0\n 0001d2: 42 00                      | i64.const 0\n 0001d4: fe 3f 01 00                | i64.atomic.rmw16.xor_u 1 0\n 0001d8: 1a                         | drop\n 0001d9: 41 00                      | i32.const 0\n 0001db: 42 00                      | i64.const 0\n 0001dd: fe 40 02 00                | i64.atomic.rmw32.xor_u 2 0\n 0001e1: 1a                         | drop\n 0001e2: 41 00                      | i32.const 0\n 0001e4: 41 00                      | i32.const 0\n 0001e6: fe 41 02 00                | i32.atomic.rmw.xchg 2 0\n 0001ea: 1a                         | drop\n 0001eb: 41 00                      | i32.const 0\n 0001ed: 42 00                      | i64.const 0\n 0001ef: fe 42 03 00                | i64.atomic.rmw.xchg 3 0\n 0001f3: 1a                         | drop\n 0001f4: 41 00                      | i32.const 0\n 0001f6: 41 00                      | i32.const 0\n 0001f8: fe 43 00 00                | i32.atomic.rmw8.xchg_u 0 0\n 0001fc: 1a                         | drop\n 0001fd: 41 00                      | i32.const 0\n 0001ff: 41 00                      | i32.const 0\n 000201: fe 44 01 00                | i32.atomic.rmw16.xchg_u 1 0\n 000205: 1a                         | drop\n 000206: 41 00                      | i32.const 0\n 000208: 42 00                      | i64.const 0\n 00020a: fe 45 00 00                | i64.atomic.rmw8.xchg_u 0 0\n 00020e: 1a                         | drop\n 00020f: 41 00                      | i32.const 0\n 000211: 42 00                      | i64.const 0\n 000213: fe 46 01 00                | i64.atomic.rmw16.xchg_u 1 0\n 000217: 1a                         | drop\n 000218: 41 00                      | i32.const 0\n 00021a: 42 00                      | i64.const 0\n 00021c: fe 47 02 00                | i64.atomic.rmw32.xchg_u 2 0\n 000220: 1a                         | drop\n 000221: 41 00                      | i32.const 0\n 000223: 41 00                      | i32.const 0\n 000225: 41 00                      | i32.const 0\n 000227: fe 48 02 00                | i32.atomic.rmw.cmpxchg 2 0\n 00022b: 1a                         | drop\n 00022c: 41 00                      | i32.const 0\n 00022e: 42 00                      | i64.const 0\n 000230: 42 00                      | i64.const 0\n 000232: fe 49 03 00                | i64.atomic.rmw.cmpxchg 3 0\n 000236: 1a                         | drop\n 000237: 41 00                      | i32.const 0\n 000239: 41 00                      | i32.const 0\n 00023b: 41 00                      | i32.const 0\n 00023d: fe 4a 00 00                | i32.atomic.rmw8.cmpxchg_u 0 0\n 000241: 1a                         | drop\n 000242: 41 00                      | i32.const 0\n 000244: 41 00                      | i32.const 0\n 000246: 41 00                      | i32.const 0\n 000248: fe 4b 01 00                | i32.atomic.rmw16.cmpxchg_u 1 0\n 00024c: 1a                         | drop\n 00024d: 41 00                      | i32.const 0\n 00024f: 42 00                      | i64.const 0\n 000251: 42 00                      | i64.const 0\n 000253: fe 4c 00 00                | i64.atomic.rmw8.cmpxchg_u 0 0\n 000257: 1a                         | drop\n 000258: 41 00                      | i32.const 0\n 00025a: 42 00                      | i64.const 0\n 00025c: 42 00                      | i64.const 0\n 00025e: fe 4d 01 00                | i64.atomic.rmw16.cmpxchg_u 1 0\n 000262: 1a                         | drop\n 000263: 41 00                      | i32.const 0\n 000265: 42 00                      | i64.const 0\n 000267: 42 00                      | i64.const 0\n 000269: fe 4e 02 00                | i64.atomic.rmw32.cmpxchg_u 2 0\n 00026d: 1a                         | drop\n 00026e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/bad-directory.txt",
    "content": ";;; RUN: %(wasm-objdump)s -d third_party/\n;;; ERROR: 1\n(;; STDERR ;;;\nthird_party/: is a directory\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/dump/bad-version-logging.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: --debug\n;;; ERROR1: 1\nmagic\n0xe 0 0 0\n(;; STDERR ;;;\n0000008: error: bad wasm file version: 0xe (expected 0x1)\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/bad-version.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ERROR1: 1\nmagic\n0xe 0 0 0\n(;; STDERR ;;;\n0000008: error: bad wasm file version: 0xe (expected 0x1)\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/basic.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: --headers\n(module\n  (memory 1)\n  (func $f (param i32 i32) (result i32)\n    i32.const 0\n    i32.const 0\n    i32.load\n    i32.const 1\n    i32.add\n    i32.store\n    local.get 0\n    local.get 1\n    i32.add)\n  (export \"f\" (func $f)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 02                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 7f                                        ; i32\n000000f: 01                                        ; num results\n0000010: 7f                                        ; i32\n0000009: 07                                        ; FIXUP section size\n; section \"Function\" (3)\n0000011: 03                                        ; section code\n0000012: 00                                        ; section size (guess)\n0000013: 01                                        ; num functions\n0000014: 00                                        ; function 0 signature index\n0000012: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000015: 05                                        ; section code\n0000016: 00                                        ; section size (guess)\n0000017: 01                                        ; num memories\n; memory 0\n0000018: 00                                        ; limits: flags\n0000019: 01                                        ; limits: initial\n0000016: 03                                        ; FIXUP section size\n; section \"Export\" (7)\n000001a: 07                                        ; section code\n000001b: 00                                        ; section size (guess)\n000001c: 01                                        ; num exports\n000001d: 01                                        ; string length\n000001e: 66                                       f  ; export name\n000001f: 00                                        ; export kind\n0000020: 00                                        ; export func index\n000001b: 05                                        ; FIXUP section size\n; section \"Code\" (10)\n0000021: 0a                                        ; section code\n0000022: 00                                        ; section size (guess)\n0000023: 01                                        ; num functions\n; function body 0\n0000024: 00                                        ; func body size (guess)\n0000025: 00                                        ; local decl count\n0000026: 41                                        ; i32.const\n0000027: 00                                        ; i32 literal\n0000028: 41                                        ; i32.const\n0000029: 00                                        ; i32 literal\n000002a: 28                                        ; i32.load\n000002b: 02                                        ; alignment\n000002c: 00                                        ; load offset\n000002d: 41                                        ; i32.const\n000002e: 01                                        ; i32 literal\n000002f: 6a                                        ; i32.add\n0000030: 36                                        ; i32.store\n0000031: 02                                        ; alignment\n0000032: 00                                        ; store offset\n0000033: 20                                        ; local.get\n0000034: 00                                        ; local index\n0000035: 20                                        ; local.get\n0000036: 01                                        ; local index\n0000037: 6a                                        ; i32.add\n0000038: 0b                                        ; end\n0000024: 14                                        ; FIXUP func body size\n0000022: 16                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbasic.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x00000011 (size=0x00000007) count: 1\n Function start=0x00000013 end=0x00000015 (size=0x00000002) count: 1\n   Memory start=0x00000017 end=0x0000001a (size=0x00000003) count: 1\n   Export start=0x0000001c end=0x00000021 (size=0x00000005) count: 1\n     Code start=0x00000023 end=0x00000039 (size=0x00000016) count: 1\n\nCode Disassembly:\n\n000025 func[0] <f>:\n 000026: 41 00                      | i32.const 0\n 000028: 41 00                      | i32.const 0\n 00002a: 28 02 00                   | i32.load 2 0\n 00002d: 41 01                      | i32.const 1\n 00002f: 6a                         | i32.add\n 000030: 36 02 00                   | i32.store 2 0\n 000033: 20 00                      | local.get 0\n 000035: 20 01                      | local.get 1\n 000037: 6a                         | i32.add\n 000038: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/basic_dump_only.txt",
    "content": ";;; TOOL: run-objdump\n(module\n  (memory 1)\n  (func $f (param i32 i32) (result i32)\n    i32.const 0\n    i32.const 0\n    i32.load\n    i32.const 1\n    i32.add\n    i32.store\n    local.get 0\n    local.get 1\n    i32.add)\n  (export \"f\" (func $f)))\n(;; STDOUT ;;;\n\nbasic_dump_only.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000025 func[0] <f>:\n 000026: 41 00                      | i32.const 0\n 000028: 41 00                      | i32.const 0\n 00002a: 28 02 00                   | i32.load 2 0\n 00002d: 41 01                      | i32.const 1\n 00002f: 6a                         | i32.add\n 000030: 36 02 00                   | i32.store 2 0\n 000033: 20 00                      | local.get 0\n 000035: 20 01                      | local.get 1\n 000037: 6a                         | i32.add\n 000038: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/binary.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    i32.const 0\n    i32.rotr\n    i32.const 0\n    i32.rotl\n    i32.const 0\n    i32.shr_s\n    i32.const 0\n    i32.shr_u\n    i32.const 0\n    i32.shl\n    i32.const 0\n    i32.xor\n    i32.const 0\n    i32.or\n    i32.const 0\n    i32.and\n    i32.const 0\n    i32.rem_u\n    i32.const 0\n    i32.rem_s\n    i32.const 0\n    i32.div_u\n    i32.const 0\n    i32.div_s\n    i32.const 0\n    i32.mul\n    i32.const 0\n    i32.sub\n    i32.const 0\n    i32.add\n    drop\n    i64.const 0\n    i64.const 0\n    i64.rotr\n    i64.const 0\n    i64.rotl\n    i64.const 0\n    i64.shr_s\n    i64.const 0\n    i64.shr_u\n    i64.const 0\n    i64.shl\n    i64.const 0\n    i64.xor\n    i64.const 0\n    i64.or\n    i64.const 0\n    i64.and\n    i64.const 0\n    i64.rem_u\n    i64.const 0\n    i64.rem_s\n    i64.const 0\n    i64.div_u\n    i64.const 0\n    i64.div_s\n    i64.const 0\n    i64.mul\n    i64.const 0\n    i64.sub\n    i64.const 0\n    i64.add\n    drop\n    f32.const 0\n    f32.const 0\n    f32.copysign\n    f32.const 0\n    f32.max\n    f32.const 0\n    f32.min\n    f32.const 0\n    f32.div\n    f32.const 0\n    f32.mul\n    f32.const 0\n    f32.sub\n    f32.const 0\n    f32.add\n    drop\n    f64.const 0\n    f64.const 0\n    f64.copysign\n    f64.const 0\n    f64.max\n    f64.const 0\n    f64.min\n    f64.const 0\n    f64.div\n    f64.const 0\n    f64.mul\n    f64.const 0\n    f64.sub\n    f64.const 0\n    f64.add\n    drop\n\n))\n\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: 41                                        ; i32.const\n000001a: 00                                        ; i32 literal\n000001b: 78                                        ; i32.rotr\n000001c: 41                                        ; i32.const\n000001d: 00                                        ; i32 literal\n000001e: 77                                        ; i32.rotl\n000001f: 41                                        ; i32.const\n0000020: 00                                        ; i32 literal\n0000021: 75                                        ; i32.shr_s\n0000022: 41                                        ; i32.const\n0000023: 00                                        ; i32 literal\n0000024: 76                                        ; i32.shr_u\n0000025: 41                                        ; i32.const\n0000026: 00                                        ; i32 literal\n0000027: 74                                        ; i32.shl\n0000028: 41                                        ; i32.const\n0000029: 00                                        ; i32 literal\n000002a: 73                                        ; i32.xor\n000002b: 41                                        ; i32.const\n000002c: 00                                        ; i32 literal\n000002d: 72                                        ; i32.or\n000002e: 41                                        ; i32.const\n000002f: 00                                        ; i32 literal\n0000030: 71                                        ; i32.and\n0000031: 41                                        ; i32.const\n0000032: 00                                        ; i32 literal\n0000033: 70                                        ; i32.rem_u\n0000034: 41                                        ; i32.const\n0000035: 00                                        ; i32 literal\n0000036: 6f                                        ; i32.rem_s\n0000037: 41                                        ; i32.const\n0000038: 00                                        ; i32 literal\n0000039: 6e                                        ; i32.div_u\n000003a: 41                                        ; i32.const\n000003b: 00                                        ; i32 literal\n000003c: 6d                                        ; i32.div_s\n000003d: 41                                        ; i32.const\n000003e: 00                                        ; i32 literal\n000003f: 6c                                        ; i32.mul\n0000040: 41                                        ; i32.const\n0000041: 00                                        ; i32 literal\n0000042: 6b                                        ; i32.sub\n0000043: 41                                        ; i32.const\n0000044: 00                                        ; i32 literal\n0000045: 6a                                        ; i32.add\n0000046: 1a                                        ; drop\n0000047: 42                                        ; i64.const\n0000048: 00                                        ; i64 literal\n0000049: 42                                        ; i64.const\n000004a: 00                                        ; i64 literal\n000004b: 8a                                        ; i64.rotr\n000004c: 42                                        ; i64.const\n000004d: 00                                        ; i64 literal\n000004e: 89                                        ; i64.rotl\n000004f: 42                                        ; i64.const\n0000050: 00                                        ; i64 literal\n0000051: 87                                        ; i64.shr_s\n0000052: 42                                        ; i64.const\n0000053: 00                                        ; i64 literal\n0000054: 88                                        ; i64.shr_u\n0000055: 42                                        ; i64.const\n0000056: 00                                        ; i64 literal\n0000057: 86                                        ; i64.shl\n0000058: 42                                        ; i64.const\n0000059: 00                                        ; i64 literal\n000005a: 85                                        ; i64.xor\n000005b: 42                                        ; i64.const\n000005c: 00                                        ; i64 literal\n000005d: 84                                        ; i64.or\n000005e: 42                                        ; i64.const\n000005f: 00                                        ; i64 literal\n0000060: 83                                        ; i64.and\n0000061: 42                                        ; i64.const\n0000062: 00                                        ; i64 literal\n0000063: 82                                        ; i64.rem_u\n0000064: 42                                        ; i64.const\n0000065: 00                                        ; i64 literal\n0000066: 81                                        ; i64.rem_s\n0000067: 42                                        ; i64.const\n0000068: 00                                        ; i64 literal\n0000069: 80                                        ; i64.div_u\n000006a: 42                                        ; i64.const\n000006b: 00                                        ; i64 literal\n000006c: 7f                                        ; i64.div_s\n000006d: 42                                        ; i64.const\n000006e: 00                                        ; i64 literal\n000006f: 7e                                        ; i64.mul\n0000070: 42                                        ; i64.const\n0000071: 00                                        ; i64 literal\n0000072: 7d                                        ; i64.sub\n0000073: 42                                        ; i64.const\n0000074: 00                                        ; i64 literal\n0000075: 7c                                        ; i64.add\n0000076: 1a                                        ; drop\n0000077: 43                                        ; f32.const\n0000078: 0000 0000                                 ; f32 literal\n000007c: 43                                        ; f32.const\n000007d: 0000 0000                                 ; f32 literal\n0000081: 98                                        ; f32.copysign\n0000082: 43                                        ; f32.const\n0000083: 0000 0000                                 ; f32 literal\n0000087: 97                                        ; f32.max\n0000088: 43                                        ; f32.const\n0000089: 0000 0000                                 ; f32 literal\n000008d: 96                                        ; f32.min\n000008e: 43                                        ; f32.const\n000008f: 0000 0000                                 ; f32 literal\n0000093: 95                                        ; f32.div\n0000094: 43                                        ; f32.const\n0000095: 0000 0000                                 ; f32 literal\n0000099: 94                                        ; f32.mul\n000009a: 43                                        ; f32.const\n000009b: 0000 0000                                 ; f32 literal\n000009f: 93                                        ; f32.sub\n00000a0: 43                                        ; f32.const\n00000a1: 0000 0000                                 ; f32 literal\n00000a5: 92                                        ; f32.add\n00000a6: 1a                                        ; drop\n00000a7: 44                                        ; f64.const\n00000a8: 0000 0000 0000 0000                       ; f64 literal\n00000b0: 44                                        ; f64.const\n00000b1: 0000 0000 0000 0000                       ; f64 literal\n00000b9: a6                                        ; f64.copysign\n00000ba: 44                                        ; f64.const\n00000bb: 0000 0000 0000 0000                       ; f64 literal\n00000c3: a5                                        ; f64.max\n00000c4: 44                                        ; f64.const\n00000c5: 0000 0000 0000 0000                       ; f64 literal\n00000cd: a4                                        ; f64.min\n00000ce: 44                                        ; f64.const\n00000cf: 0000 0000 0000 0000                       ; f64 literal\n00000d7: a3                                        ; f64.div\n00000d8: 44                                        ; f64.const\n00000d9: 0000 0000 0000 0000                       ; f64 literal\n00000e1: a2                                        ; f64.mul\n00000e2: 44                                        ; f64.const\n00000e3: 0000 0000 0000 0000                       ; f64 literal\n00000eb: a1                                        ; f64.sub\n00000ec: 44                                        ; f64.const\n00000ed: 0000 0000 0000 0000                       ; f64 literal\n00000f5: a0                                        ; f64.add\n00000f6: 1a                                        ; drop\n00000f7: 0b                                        ; end\n; move data: [16, f8) -> [17, f9)\n0000015: e201                                      ; FIXUP func body size\n; move data: [14, f9) -> [15, fa)\n0000013: e501                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbinary.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 41 00                      | i32.const 0\n 00001b: 41 00                      | i32.const 0\n 00001d: 78                         | i32.rotr\n 00001e: 41 00                      | i32.const 0\n 000020: 77                         | i32.rotl\n 000021: 41 00                      | i32.const 0\n 000023: 75                         | i32.shr_s\n 000024: 41 00                      | i32.const 0\n 000026: 76                         | i32.shr_u\n 000027: 41 00                      | i32.const 0\n 000029: 74                         | i32.shl\n 00002a: 41 00                      | i32.const 0\n 00002c: 73                         | i32.xor\n 00002d: 41 00                      | i32.const 0\n 00002f: 72                         | i32.or\n 000030: 41 00                      | i32.const 0\n 000032: 71                         | i32.and\n 000033: 41 00                      | i32.const 0\n 000035: 70                         | i32.rem_u\n 000036: 41 00                      | i32.const 0\n 000038: 6f                         | i32.rem_s\n 000039: 41 00                      | i32.const 0\n 00003b: 6e                         | i32.div_u\n 00003c: 41 00                      | i32.const 0\n 00003e: 6d                         | i32.div_s\n 00003f: 41 00                      | i32.const 0\n 000041: 6c                         | i32.mul\n 000042: 41 00                      | i32.const 0\n 000044: 6b                         | i32.sub\n 000045: 41 00                      | i32.const 0\n 000047: 6a                         | i32.add\n 000048: 1a                         | drop\n 000049: 42 00                      | i64.const 0\n 00004b: 42 00                      | i64.const 0\n 00004d: 8a                         | i64.rotr\n 00004e: 42 00                      | i64.const 0\n 000050: 89                         | i64.rotl\n 000051: 42 00                      | i64.const 0\n 000053: 87                         | i64.shr_s\n 000054: 42 00                      | i64.const 0\n 000056: 88                         | i64.shr_u\n 000057: 42 00                      | i64.const 0\n 000059: 86                         | i64.shl\n 00005a: 42 00                      | i64.const 0\n 00005c: 85                         | i64.xor\n 00005d: 42 00                      | i64.const 0\n 00005f: 84                         | i64.or\n 000060: 42 00                      | i64.const 0\n 000062: 83                         | i64.and\n 000063: 42 00                      | i64.const 0\n 000065: 82                         | i64.rem_u\n 000066: 42 00                      | i64.const 0\n 000068: 81                         | i64.rem_s\n 000069: 42 00                      | i64.const 0\n 00006b: 80                         | i64.div_u\n 00006c: 42 00                      | i64.const 0\n 00006e: 7f                         | i64.div_s\n 00006f: 42 00                      | i64.const 0\n 000071: 7e                         | i64.mul\n 000072: 42 00                      | i64.const 0\n 000074: 7d                         | i64.sub\n 000075: 42 00                      | i64.const 0\n 000077: 7c                         | i64.add\n 000078: 1a                         | drop\n 000079: 43 00 00 00 00             | f32.const 0x0p+0\n 00007e: 43 00 00 00 00             | f32.const 0x0p+0\n 000083: 98                         | f32.copysign\n 000084: 43 00 00 00 00             | f32.const 0x0p+0\n 000089: 97                         | f32.max\n 00008a: 43 00 00 00 00             | f32.const 0x0p+0\n 00008f: 96                         | f32.min\n 000090: 43 00 00 00 00             | f32.const 0x0p+0\n 000095: 95                         | f32.div\n 000096: 43 00 00 00 00             | f32.const 0x0p+0\n 00009b: 94                         | f32.mul\n 00009c: 43 00 00 00 00             | f32.const 0x0p+0\n 0000a1: 93                         | f32.sub\n 0000a2: 43 00 00 00 00             | f32.const 0x0p+0\n 0000a7: 92                         | f32.add\n 0000a8: 1a                         | drop\n 0000a9: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000b2: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000bb: a6                         | f64.copysign\n 0000bc: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000c5: a5                         | f64.max\n 0000c6: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000cf: a4                         | f64.min\n 0000d0: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000d9: a3                         | f64.div\n 0000da: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000e3: a2                         | f64.mul\n 0000e4: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000ed: a1                         | f64.sub\n 0000ee: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000f7: a0                         | f64.add\n 0000f8: 1a                         | drop\n 0000f9: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/block-257-exprs-br.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block $foo\n      ;; 1..64\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 65..128\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 129..192\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 193..256\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 257..258\n      br $foo  ;; should be depth 1\n      br 0     ;; also depth 1\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 01                                        ; nop\n000001a: 01                                        ; nop\n000001b: 01                                        ; nop\n000001c: 01                                        ; nop\n000001d: 01                                        ; nop\n000001e: 01                                        ; nop\n000001f: 01                                        ; nop\n0000020: 01                                        ; nop\n0000021: 01                                        ; nop\n0000022: 01                                        ; nop\n0000023: 01                                        ; nop\n0000024: 01                                        ; nop\n0000025: 01                                        ; nop\n0000026: 01                                        ; nop\n0000027: 01                                        ; nop\n0000028: 01                                        ; nop\n0000029: 01                                        ; nop\n000002a: 01                                        ; nop\n000002b: 01                                        ; nop\n000002c: 01                                        ; nop\n000002d: 01                                        ; nop\n000002e: 01                                        ; nop\n000002f: 01                                        ; nop\n0000030: 01                                        ; nop\n0000031: 01                                        ; nop\n0000032: 01                                        ; nop\n0000033: 01                                        ; nop\n0000034: 01                                        ; nop\n0000035: 01                                        ; nop\n0000036: 01                                        ; nop\n0000037: 01                                        ; nop\n0000038: 01                                        ; nop\n0000039: 01                                        ; nop\n000003a: 01                                        ; nop\n000003b: 01                                        ; nop\n000003c: 01                                        ; nop\n000003d: 01                                        ; nop\n000003e: 01                                        ; nop\n000003f: 01                                        ; nop\n0000040: 01                                        ; nop\n0000041: 01                                        ; nop\n0000042: 01                                        ; nop\n0000043: 01                                        ; nop\n0000044: 01                                        ; nop\n0000045: 01                                        ; nop\n0000046: 01                                        ; nop\n0000047: 01                                        ; nop\n0000048: 01                                        ; nop\n0000049: 01                                        ; nop\n000004a: 01                                        ; nop\n000004b: 01                                        ; nop\n000004c: 01                                        ; nop\n000004d: 01                                        ; nop\n000004e: 01                                        ; nop\n000004f: 01                                        ; nop\n0000050: 01                                        ; nop\n0000051: 01                                        ; nop\n0000052: 01                                        ; nop\n0000053: 01                                        ; nop\n0000054: 01                                        ; nop\n0000055: 01                                        ; nop\n0000056: 01                                        ; nop\n0000057: 01                                        ; nop\n0000058: 01                                        ; nop\n0000059: 01                                        ; nop\n000005a: 01                                        ; nop\n000005b: 01                                        ; nop\n000005c: 01                                        ; nop\n000005d: 01                                        ; nop\n000005e: 01                                        ; nop\n000005f: 01                                        ; nop\n0000060: 01                                        ; nop\n0000061: 01                                        ; nop\n0000062: 01                                        ; nop\n0000063: 01                                        ; nop\n0000064: 01                                        ; nop\n0000065: 01                                        ; nop\n0000066: 01                                        ; nop\n0000067: 01                                        ; nop\n0000068: 01                                        ; nop\n0000069: 01                                        ; nop\n000006a: 01                                        ; nop\n000006b: 01                                        ; nop\n000006c: 01                                        ; nop\n000006d: 01                                        ; nop\n000006e: 01                                        ; nop\n000006f: 01                                        ; nop\n0000070: 01                                        ; nop\n0000071: 01                                        ; nop\n0000072: 01                                        ; nop\n0000073: 01                                        ; nop\n0000074: 01                                        ; nop\n0000075: 01                                        ; nop\n0000076: 01                                        ; nop\n0000077: 01                                        ; nop\n0000078: 01                                        ; nop\n0000079: 01                                        ; nop\n000007a: 01                                        ; nop\n000007b: 01                                        ; nop\n000007c: 01                                        ; nop\n000007d: 01                                        ; nop\n000007e: 01                                        ; nop\n000007f: 01                                        ; nop\n0000080: 01                                        ; nop\n0000081: 01                                        ; nop\n0000082: 01                                        ; nop\n0000083: 01                                        ; nop\n0000084: 01                                        ; nop\n0000085: 01                                        ; nop\n0000086: 01                                        ; nop\n0000087: 01                                        ; nop\n0000088: 01                                        ; nop\n0000089: 01                                        ; nop\n000008a: 01                                        ; nop\n000008b: 01                                        ; nop\n000008c: 01                                        ; nop\n000008d: 01                                        ; nop\n000008e: 01                                        ; nop\n000008f: 01                                        ; nop\n0000090: 01                                        ; nop\n0000091: 01                                        ; nop\n0000092: 01                                        ; nop\n0000093: 01                                        ; nop\n0000094: 01                                        ; nop\n0000095: 01                                        ; nop\n0000096: 01                                        ; nop\n0000097: 01                                        ; nop\n0000098: 01                                        ; nop\n0000099: 01                                        ; nop\n000009a: 01                                        ; nop\n000009b: 01                                        ; nop\n000009c: 01                                        ; nop\n000009d: 01                                        ; nop\n000009e: 01                                        ; nop\n000009f: 01                                        ; nop\n00000a0: 01                                        ; nop\n00000a1: 01                                        ; nop\n00000a2: 01                                        ; nop\n00000a3: 01                                        ; nop\n00000a4: 01                                        ; nop\n00000a5: 01                                        ; nop\n00000a6: 01                                        ; nop\n00000a7: 01                                        ; nop\n00000a8: 01                                        ; nop\n00000a9: 01                                        ; nop\n00000aa: 01                                        ; nop\n00000ab: 01                                        ; nop\n00000ac: 01                                        ; nop\n00000ad: 01                                        ; nop\n00000ae: 01                                        ; nop\n00000af: 01                                        ; nop\n00000b0: 01                                        ; nop\n00000b1: 01                                        ; nop\n00000b2: 01                                        ; nop\n00000b3: 01                                        ; nop\n00000b4: 01                                        ; nop\n00000b5: 01                                        ; nop\n00000b6: 01                                        ; nop\n00000b7: 01                                        ; nop\n00000b8: 01                                        ; nop\n00000b9: 01                                        ; nop\n00000ba: 01                                        ; nop\n00000bb: 01                                        ; nop\n00000bc: 01                                        ; nop\n00000bd: 01                                        ; nop\n00000be: 01                                        ; nop\n00000bf: 01                                        ; nop\n00000c0: 01                                        ; nop\n00000c1: 01                                        ; nop\n00000c2: 01                                        ; nop\n00000c3: 01                                        ; nop\n00000c4: 01                                        ; nop\n00000c5: 01                                        ; nop\n00000c6: 01                                        ; nop\n00000c7: 01                                        ; nop\n00000c8: 01                                        ; nop\n00000c9: 01                                        ; nop\n00000ca: 01                                        ; nop\n00000cb: 01                                        ; nop\n00000cc: 01                                        ; nop\n00000cd: 01                                        ; nop\n00000ce: 01                                        ; nop\n00000cf: 01                                        ; nop\n00000d0: 01                                        ; nop\n00000d1: 01                                        ; nop\n00000d2: 01                                        ; nop\n00000d3: 01                                        ; nop\n00000d4: 01                                        ; nop\n00000d5: 01                                        ; nop\n00000d6: 01                                        ; nop\n00000d7: 01                                        ; nop\n00000d8: 01                                        ; nop\n00000d9: 01                                        ; nop\n00000da: 01                                        ; nop\n00000db: 01                                        ; nop\n00000dc: 01                                        ; nop\n00000dd: 01                                        ; nop\n00000de: 01                                        ; nop\n00000df: 01                                        ; nop\n00000e0: 01                                        ; nop\n00000e1: 01                                        ; nop\n00000e2: 01                                        ; nop\n00000e3: 01                                        ; nop\n00000e4: 01                                        ; nop\n00000e5: 01                                        ; nop\n00000e6: 01                                        ; nop\n00000e7: 01                                        ; nop\n00000e8: 01                                        ; nop\n00000e9: 01                                        ; nop\n00000ea: 01                                        ; nop\n00000eb: 01                                        ; nop\n00000ec: 01                                        ; nop\n00000ed: 01                                        ; nop\n00000ee: 01                                        ; nop\n00000ef: 01                                        ; nop\n00000f0: 01                                        ; nop\n00000f1: 01                                        ; nop\n00000f2: 01                                        ; nop\n00000f3: 01                                        ; nop\n00000f4: 01                                        ; nop\n00000f5: 01                                        ; nop\n00000f6: 01                                        ; nop\n00000f7: 01                                        ; nop\n00000f8: 01                                        ; nop\n00000f9: 01                                        ; nop\n00000fa: 01                                        ; nop\n00000fb: 01                                        ; nop\n00000fc: 01                                        ; nop\n00000fd: 01                                        ; nop\n00000fe: 01                                        ; nop\n00000ff: 01                                        ; nop\n0000100: 01                                        ; nop\n0000101: 01                                        ; nop\n0000102: 01                                        ; nop\n0000103: 01                                        ; nop\n0000104: 01                                        ; nop\n0000105: 01                                        ; nop\n0000106: 01                                        ; nop\n0000107: 01                                        ; nop\n0000108: 01                                        ; nop\n0000109: 01                                        ; nop\n000010a: 01                                        ; nop\n000010b: 01                                        ; nop\n000010c: 01                                        ; nop\n000010d: 01                                        ; nop\n000010e: 01                                        ; nop\n000010f: 01                                        ; nop\n0000110: 01                                        ; nop\n0000111: 01                                        ; nop\n0000112: 01                                        ; nop\n0000113: 01                                        ; nop\n0000114: 01                                        ; nop\n0000115: 01                                        ; nop\n0000116: 01                                        ; nop\n0000117: 01                                        ; nop\n0000118: 01                                        ; nop\n0000119: 0c                                        ; br\n000011a: 00                                        ; break depth\n000011b: 0c                                        ; br\n000011c: 00                                        ; break depth\n000011d: 0b                                        ; end\n000011e: 0b                                        ; end\n; move data: [16, 11f) -> [17, 120)\n0000015: 8902                                      ; FIXUP func body size\n; move data: [14, 120) -> [15, 121)\n0000013: 8c02                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nblock-257-exprs-br.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 02 40                      | block\n 00001b: 01                         |   nop\n 00001c: 01                         |   nop\n 00001d: 01                         |   nop\n 00001e: 01                         |   nop\n 00001f: 01                         |   nop\n 000020: 01                         |   nop\n 000021: 01                         |   nop\n 000022: 01                         |   nop\n 000023: 01                         |   nop\n 000024: 01                         |   nop\n 000025: 01                         |   nop\n 000026: 01                         |   nop\n 000027: 01                         |   nop\n 000028: 01                         |   nop\n 000029: 01                         |   nop\n 00002a: 01                         |   nop\n 00002b: 01                         |   nop\n 00002c: 01                         |   nop\n 00002d: 01                         |   nop\n 00002e: 01                         |   nop\n 00002f: 01                         |   nop\n 000030: 01                         |   nop\n 000031: 01                         |   nop\n 000032: 01                         |   nop\n 000033: 01                         |   nop\n 000034: 01                         |   nop\n 000035: 01                         |   nop\n 000036: 01                         |   nop\n 000037: 01                         |   nop\n 000038: 01                         |   nop\n 000039: 01                         |   nop\n 00003a: 01                         |   nop\n 00003b: 01                         |   nop\n 00003c: 01                         |   nop\n 00003d: 01                         |   nop\n 00003e: 01                         |   nop\n 00003f: 01                         |   nop\n 000040: 01                         |   nop\n 000041: 01                         |   nop\n 000042: 01                         |   nop\n 000043: 01                         |   nop\n 000044: 01                         |   nop\n 000045: 01                         |   nop\n 000046: 01                         |   nop\n 000047: 01                         |   nop\n 000048: 01                         |   nop\n 000049: 01                         |   nop\n 00004a: 01                         |   nop\n 00004b: 01                         |   nop\n 00004c: 01                         |   nop\n 00004d: 01                         |   nop\n 00004e: 01                         |   nop\n 00004f: 01                         |   nop\n 000050: 01                         |   nop\n 000051: 01                         |   nop\n 000052: 01                         |   nop\n 000053: 01                         |   nop\n 000054: 01                         |   nop\n 000055: 01                         |   nop\n 000056: 01                         |   nop\n 000057: 01                         |   nop\n 000058: 01                         |   nop\n 000059: 01                         |   nop\n 00005a: 01                         |   nop\n 00005b: 01                         |   nop\n 00005c: 01                         |   nop\n 00005d: 01                         |   nop\n 00005e: 01                         |   nop\n 00005f: 01                         |   nop\n 000060: 01                         |   nop\n 000061: 01                         |   nop\n 000062: 01                         |   nop\n 000063: 01                         |   nop\n 000064: 01                         |   nop\n 000065: 01                         |   nop\n 000066: 01                         |   nop\n 000067: 01                         |   nop\n 000068: 01                         |   nop\n 000069: 01                         |   nop\n 00006a: 01                         |   nop\n 00006b: 01                         |   nop\n 00006c: 01                         |   nop\n 00006d: 01                         |   nop\n 00006e: 01                         |   nop\n 00006f: 01                         |   nop\n 000070: 01                         |   nop\n 000071: 01                         |   nop\n 000072: 01                         |   nop\n 000073: 01                         |   nop\n 000074: 01                         |   nop\n 000075: 01                         |   nop\n 000076: 01                         |   nop\n 000077: 01                         |   nop\n 000078: 01                         |   nop\n 000079: 01                         |   nop\n 00007a: 01                         |   nop\n 00007b: 01                         |   nop\n 00007c: 01                         |   nop\n 00007d: 01                         |   nop\n 00007e: 01                         |   nop\n 00007f: 01                         |   nop\n 000080: 01                         |   nop\n 000081: 01                         |   nop\n 000082: 01                         |   nop\n 000083: 01                         |   nop\n 000084: 01                         |   nop\n 000085: 01                         |   nop\n 000086: 01                         |   nop\n 000087: 01                         |   nop\n 000088: 01                         |   nop\n 000089: 01                         |   nop\n 00008a: 01                         |   nop\n 00008b: 01                         |   nop\n 00008c: 01                         |   nop\n 00008d: 01                         |   nop\n 00008e: 01                         |   nop\n 00008f: 01                         |   nop\n 000090: 01                         |   nop\n 000091: 01                         |   nop\n 000092: 01                         |   nop\n 000093: 01                         |   nop\n 000094: 01                         |   nop\n 000095: 01                         |   nop\n 000096: 01                         |   nop\n 000097: 01                         |   nop\n 000098: 01                         |   nop\n 000099: 01                         |   nop\n 00009a: 01                         |   nop\n 00009b: 01                         |   nop\n 00009c: 01                         |   nop\n 00009d: 01                         |   nop\n 00009e: 01                         |   nop\n 00009f: 01                         |   nop\n 0000a0: 01                         |   nop\n 0000a1: 01                         |   nop\n 0000a2: 01                         |   nop\n 0000a3: 01                         |   nop\n 0000a4: 01                         |   nop\n 0000a5: 01                         |   nop\n 0000a6: 01                         |   nop\n 0000a7: 01                         |   nop\n 0000a8: 01                         |   nop\n 0000a9: 01                         |   nop\n 0000aa: 01                         |   nop\n 0000ab: 01                         |   nop\n 0000ac: 01                         |   nop\n 0000ad: 01                         |   nop\n 0000ae: 01                         |   nop\n 0000af: 01                         |   nop\n 0000b0: 01                         |   nop\n 0000b1: 01                         |   nop\n 0000b2: 01                         |   nop\n 0000b3: 01                         |   nop\n 0000b4: 01                         |   nop\n 0000b5: 01                         |   nop\n 0000b6: 01                         |   nop\n 0000b7: 01                         |   nop\n 0000b8: 01                         |   nop\n 0000b9: 01                         |   nop\n 0000ba: 01                         |   nop\n 0000bb: 01                         |   nop\n 0000bc: 01                         |   nop\n 0000bd: 01                         |   nop\n 0000be: 01                         |   nop\n 0000bf: 01                         |   nop\n 0000c0: 01                         |   nop\n 0000c1: 01                         |   nop\n 0000c2: 01                         |   nop\n 0000c3: 01                         |   nop\n 0000c4: 01                         |   nop\n 0000c5: 01                         |   nop\n 0000c6: 01                         |   nop\n 0000c7: 01                         |   nop\n 0000c8: 01                         |   nop\n 0000c9: 01                         |   nop\n 0000ca: 01                         |   nop\n 0000cb: 01                         |   nop\n 0000cc: 01                         |   nop\n 0000cd: 01                         |   nop\n 0000ce: 01                         |   nop\n 0000cf: 01                         |   nop\n 0000d0: 01                         |   nop\n 0000d1: 01                         |   nop\n 0000d2: 01                         |   nop\n 0000d3: 01                         |   nop\n 0000d4: 01                         |   nop\n 0000d5: 01                         |   nop\n 0000d6: 01                         |   nop\n 0000d7: 01                         |   nop\n 0000d8: 01                         |   nop\n 0000d9: 01                         |   nop\n 0000da: 01                         |   nop\n 0000db: 01                         |   nop\n 0000dc: 01                         |   nop\n 0000dd: 01                         |   nop\n 0000de: 01                         |   nop\n 0000df: 01                         |   nop\n 0000e0: 01                         |   nop\n 0000e1: 01                         |   nop\n 0000e2: 01                         |   nop\n 0000e3: 01                         |   nop\n 0000e4: 01                         |   nop\n 0000e5: 01                         |   nop\n 0000e6: 01                         |   nop\n 0000e7: 01                         |   nop\n 0000e8: 01                         |   nop\n 0000e9: 01                         |   nop\n 0000ea: 01                         |   nop\n 0000eb: 01                         |   nop\n 0000ec: 01                         |   nop\n 0000ed: 01                         |   nop\n 0000ee: 01                         |   nop\n 0000ef: 01                         |   nop\n 0000f0: 01                         |   nop\n 0000f1: 01                         |   nop\n 0000f2: 01                         |   nop\n 0000f3: 01                         |   nop\n 0000f4: 01                         |   nop\n 0000f5: 01                         |   nop\n 0000f6: 01                         |   nop\n 0000f7: 01                         |   nop\n 0000f8: 01                         |   nop\n 0000f9: 01                         |   nop\n 0000fa: 01                         |   nop\n 0000fb: 01                         |   nop\n 0000fc: 01                         |   nop\n 0000fd: 01                         |   nop\n 0000fe: 01                         |   nop\n 0000ff: 01                         |   nop\n 000100: 01                         |   nop\n 000101: 01                         |   nop\n 000102: 01                         |   nop\n 000103: 01                         |   nop\n 000104: 01                         |   nop\n 000105: 01                         |   nop\n 000106: 01                         |   nop\n 000107: 01                         |   nop\n 000108: 01                         |   nop\n 000109: 01                         |   nop\n 00010a: 01                         |   nop\n 00010b: 01                         |   nop\n 00010c: 01                         |   nop\n 00010d: 01                         |   nop\n 00010e: 01                         |   nop\n 00010f: 01                         |   nop\n 000110: 01                         |   nop\n 000111: 01                         |   nop\n 000112: 01                         |   nop\n 000113: 01                         |   nop\n 000114: 01                         |   nop\n 000115: 01                         |   nop\n 000116: 01                         |   nop\n 000117: 01                         |   nop\n 000118: 01                         |   nop\n 000119: 01                         |   nop\n 00011a: 01                         |   nop\n 00011b: 0c 00                      |   br 0\n 00011d: 0c 00                      |   br 0\n 00011f: 0b                         | end\n 000120: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/block-257-exprs.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block\n      ;; 1..64\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 65..128\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      \n      ;; 129..192\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 193..256\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 257\n      nop\n   end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 01                                        ; nop\n000001a: 01                                        ; nop\n000001b: 01                                        ; nop\n000001c: 01                                        ; nop\n000001d: 01                                        ; nop\n000001e: 01                                        ; nop\n000001f: 01                                        ; nop\n0000020: 01                                        ; nop\n0000021: 01                                        ; nop\n0000022: 01                                        ; nop\n0000023: 01                                        ; nop\n0000024: 01                                        ; nop\n0000025: 01                                        ; nop\n0000026: 01                                        ; nop\n0000027: 01                                        ; nop\n0000028: 01                                        ; nop\n0000029: 01                                        ; nop\n000002a: 01                                        ; nop\n000002b: 01                                        ; nop\n000002c: 01                                        ; nop\n000002d: 01                                        ; nop\n000002e: 01                                        ; nop\n000002f: 01                                        ; nop\n0000030: 01                                        ; nop\n0000031: 01                                        ; nop\n0000032: 01                                        ; nop\n0000033: 01                                        ; nop\n0000034: 01                                        ; nop\n0000035: 01                                        ; nop\n0000036: 01                                        ; nop\n0000037: 01                                        ; nop\n0000038: 01                                        ; nop\n0000039: 01                                        ; nop\n000003a: 01                                        ; nop\n000003b: 01                                        ; nop\n000003c: 01                                        ; nop\n000003d: 01                                        ; nop\n000003e: 01                                        ; nop\n000003f: 01                                        ; nop\n0000040: 01                                        ; nop\n0000041: 01                                        ; nop\n0000042: 01                                        ; nop\n0000043: 01                                        ; nop\n0000044: 01                                        ; nop\n0000045: 01                                        ; nop\n0000046: 01                                        ; nop\n0000047: 01                                        ; nop\n0000048: 01                                        ; nop\n0000049: 01                                        ; nop\n000004a: 01                                        ; nop\n000004b: 01                                        ; nop\n000004c: 01                                        ; nop\n000004d: 01                                        ; nop\n000004e: 01                                        ; nop\n000004f: 01                                        ; nop\n0000050: 01                                        ; nop\n0000051: 01                                        ; nop\n0000052: 01                                        ; nop\n0000053: 01                                        ; nop\n0000054: 01                                        ; nop\n0000055: 01                                        ; nop\n0000056: 01                                        ; nop\n0000057: 01                                        ; nop\n0000058: 01                                        ; nop\n0000059: 01                                        ; nop\n000005a: 01                                        ; nop\n000005b: 01                                        ; nop\n000005c: 01                                        ; nop\n000005d: 01                                        ; nop\n000005e: 01                                        ; nop\n000005f: 01                                        ; nop\n0000060: 01                                        ; nop\n0000061: 01                                        ; nop\n0000062: 01                                        ; nop\n0000063: 01                                        ; nop\n0000064: 01                                        ; nop\n0000065: 01                                        ; nop\n0000066: 01                                        ; nop\n0000067: 01                                        ; nop\n0000068: 01                                        ; nop\n0000069: 01                                        ; nop\n000006a: 01                                        ; nop\n000006b: 01                                        ; nop\n000006c: 01                                        ; nop\n000006d: 01                                        ; nop\n000006e: 01                                        ; nop\n000006f: 01                                        ; nop\n0000070: 01                                        ; nop\n0000071: 01                                        ; nop\n0000072: 01                                        ; nop\n0000073: 01                                        ; nop\n0000074: 01                                        ; nop\n0000075: 01                                        ; nop\n0000076: 01                                        ; nop\n0000077: 01                                        ; nop\n0000078: 01                                        ; nop\n0000079: 01                                        ; nop\n000007a: 01                                        ; nop\n000007b: 01                                        ; nop\n000007c: 01                                        ; nop\n000007d: 01                                        ; nop\n000007e: 01                                        ; nop\n000007f: 01                                        ; nop\n0000080: 01                                        ; nop\n0000081: 01                                        ; nop\n0000082: 01                                        ; nop\n0000083: 01                                        ; nop\n0000084: 01                                        ; nop\n0000085: 01                                        ; nop\n0000086: 01                                        ; nop\n0000087: 01                                        ; nop\n0000088: 01                                        ; nop\n0000089: 01                                        ; nop\n000008a: 01                                        ; nop\n000008b: 01                                        ; nop\n000008c: 01                                        ; nop\n000008d: 01                                        ; nop\n000008e: 01                                        ; nop\n000008f: 01                                        ; nop\n0000090: 01                                        ; nop\n0000091: 01                                        ; nop\n0000092: 01                                        ; nop\n0000093: 01                                        ; nop\n0000094: 01                                        ; nop\n0000095: 01                                        ; nop\n0000096: 01                                        ; nop\n0000097: 01                                        ; nop\n0000098: 01                                        ; nop\n0000099: 01                                        ; nop\n000009a: 01                                        ; nop\n000009b: 01                                        ; nop\n000009c: 01                                        ; nop\n000009d: 01                                        ; nop\n000009e: 01                                        ; nop\n000009f: 01                                        ; nop\n00000a0: 01                                        ; nop\n00000a1: 01                                        ; nop\n00000a2: 01                                        ; nop\n00000a3: 01                                        ; nop\n00000a4: 01                                        ; nop\n00000a5: 01                                        ; nop\n00000a6: 01                                        ; nop\n00000a7: 01                                        ; nop\n00000a8: 01                                        ; nop\n00000a9: 01                                        ; nop\n00000aa: 01                                        ; nop\n00000ab: 01                                        ; nop\n00000ac: 01                                        ; nop\n00000ad: 01                                        ; nop\n00000ae: 01                                        ; nop\n00000af: 01                                        ; nop\n00000b0: 01                                        ; nop\n00000b1: 01                                        ; nop\n00000b2: 01                                        ; nop\n00000b3: 01                                        ; nop\n00000b4: 01                                        ; nop\n00000b5: 01                                        ; nop\n00000b6: 01                                        ; nop\n00000b7: 01                                        ; nop\n00000b8: 01                                        ; nop\n00000b9: 01                                        ; nop\n00000ba: 01                                        ; nop\n00000bb: 01                                        ; nop\n00000bc: 01                                        ; nop\n00000bd: 01                                        ; nop\n00000be: 01                                        ; nop\n00000bf: 01                                        ; nop\n00000c0: 01                                        ; nop\n00000c1: 01                                        ; nop\n00000c2: 01                                        ; nop\n00000c3: 01                                        ; nop\n00000c4: 01                                        ; nop\n00000c5: 01                                        ; nop\n00000c6: 01                                        ; nop\n00000c7: 01                                        ; nop\n00000c8: 01                                        ; nop\n00000c9: 01                                        ; nop\n00000ca: 01                                        ; nop\n00000cb: 01                                        ; nop\n00000cc: 01                                        ; nop\n00000cd: 01                                        ; nop\n00000ce: 01                                        ; nop\n00000cf: 01                                        ; nop\n00000d0: 01                                        ; nop\n00000d1: 01                                        ; nop\n00000d2: 01                                        ; nop\n00000d3: 01                                        ; nop\n00000d4: 01                                        ; nop\n00000d5: 01                                        ; nop\n00000d6: 01                                        ; nop\n00000d7: 01                                        ; nop\n00000d8: 01                                        ; nop\n00000d9: 01                                        ; nop\n00000da: 01                                        ; nop\n00000db: 01                                        ; nop\n00000dc: 01                                        ; nop\n00000dd: 01                                        ; nop\n00000de: 01                                        ; nop\n00000df: 01                                        ; nop\n00000e0: 01                                        ; nop\n00000e1: 01                                        ; nop\n00000e2: 01                                        ; nop\n00000e3: 01                                        ; nop\n00000e4: 01                                        ; nop\n00000e5: 01                                        ; nop\n00000e6: 01                                        ; nop\n00000e7: 01                                        ; nop\n00000e8: 01                                        ; nop\n00000e9: 01                                        ; nop\n00000ea: 01                                        ; nop\n00000eb: 01                                        ; nop\n00000ec: 01                                        ; nop\n00000ed: 01                                        ; nop\n00000ee: 01                                        ; nop\n00000ef: 01                                        ; nop\n00000f0: 01                                        ; nop\n00000f1: 01                                        ; nop\n00000f2: 01                                        ; nop\n00000f3: 01                                        ; nop\n00000f4: 01                                        ; nop\n00000f5: 01                                        ; nop\n00000f6: 01                                        ; nop\n00000f7: 01                                        ; nop\n00000f8: 01                                        ; nop\n00000f9: 01                                        ; nop\n00000fa: 01                                        ; nop\n00000fb: 01                                        ; nop\n00000fc: 01                                        ; nop\n00000fd: 01                                        ; nop\n00000fe: 01                                        ; nop\n00000ff: 01                                        ; nop\n0000100: 01                                        ; nop\n0000101: 01                                        ; nop\n0000102: 01                                        ; nop\n0000103: 01                                        ; nop\n0000104: 01                                        ; nop\n0000105: 01                                        ; nop\n0000106: 01                                        ; nop\n0000107: 01                                        ; nop\n0000108: 01                                        ; nop\n0000109: 01                                        ; nop\n000010a: 01                                        ; nop\n000010b: 01                                        ; nop\n000010c: 01                                        ; nop\n000010d: 01                                        ; nop\n000010e: 01                                        ; nop\n000010f: 01                                        ; nop\n0000110: 01                                        ; nop\n0000111: 01                                        ; nop\n0000112: 01                                        ; nop\n0000113: 01                                        ; nop\n0000114: 01                                        ; nop\n0000115: 01                                        ; nop\n0000116: 01                                        ; nop\n0000117: 01                                        ; nop\n0000118: 01                                        ; nop\n0000119: 01                                        ; nop\n000011a: 0b                                        ; end\n000011b: 0b                                        ; end\n; move data: [16, 11c) -> [17, 11d)\n0000015: 8602                                      ; FIXUP func body size\n; move data: [14, 11d) -> [15, 11e)\n0000013: 8902                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nblock-257-exprs.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 02 40                      | block\n 00001b: 01                         |   nop\n 00001c: 01                         |   nop\n 00001d: 01                         |   nop\n 00001e: 01                         |   nop\n 00001f: 01                         |   nop\n 000020: 01                         |   nop\n 000021: 01                         |   nop\n 000022: 01                         |   nop\n 000023: 01                         |   nop\n 000024: 01                         |   nop\n 000025: 01                         |   nop\n 000026: 01                         |   nop\n 000027: 01                         |   nop\n 000028: 01                         |   nop\n 000029: 01                         |   nop\n 00002a: 01                         |   nop\n 00002b: 01                         |   nop\n 00002c: 01                         |   nop\n 00002d: 01                         |   nop\n 00002e: 01                         |   nop\n 00002f: 01                         |   nop\n 000030: 01                         |   nop\n 000031: 01                         |   nop\n 000032: 01                         |   nop\n 000033: 01                         |   nop\n 000034: 01                         |   nop\n 000035: 01                         |   nop\n 000036: 01                         |   nop\n 000037: 01                         |   nop\n 000038: 01                         |   nop\n 000039: 01                         |   nop\n 00003a: 01                         |   nop\n 00003b: 01                         |   nop\n 00003c: 01                         |   nop\n 00003d: 01                         |   nop\n 00003e: 01                         |   nop\n 00003f: 01                         |   nop\n 000040: 01                         |   nop\n 000041: 01                         |   nop\n 000042: 01                         |   nop\n 000043: 01                         |   nop\n 000044: 01                         |   nop\n 000045: 01                         |   nop\n 000046: 01                         |   nop\n 000047: 01                         |   nop\n 000048: 01                         |   nop\n 000049: 01                         |   nop\n 00004a: 01                         |   nop\n 00004b: 01                         |   nop\n 00004c: 01                         |   nop\n 00004d: 01                         |   nop\n 00004e: 01                         |   nop\n 00004f: 01                         |   nop\n 000050: 01                         |   nop\n 000051: 01                         |   nop\n 000052: 01                         |   nop\n 000053: 01                         |   nop\n 000054: 01                         |   nop\n 000055: 01                         |   nop\n 000056: 01                         |   nop\n 000057: 01                         |   nop\n 000058: 01                         |   nop\n 000059: 01                         |   nop\n 00005a: 01                         |   nop\n 00005b: 01                         |   nop\n 00005c: 01                         |   nop\n 00005d: 01                         |   nop\n 00005e: 01                         |   nop\n 00005f: 01                         |   nop\n 000060: 01                         |   nop\n 000061: 01                         |   nop\n 000062: 01                         |   nop\n 000063: 01                         |   nop\n 000064: 01                         |   nop\n 000065: 01                         |   nop\n 000066: 01                         |   nop\n 000067: 01                         |   nop\n 000068: 01                         |   nop\n 000069: 01                         |   nop\n 00006a: 01                         |   nop\n 00006b: 01                         |   nop\n 00006c: 01                         |   nop\n 00006d: 01                         |   nop\n 00006e: 01                         |   nop\n 00006f: 01                         |   nop\n 000070: 01                         |   nop\n 000071: 01                         |   nop\n 000072: 01                         |   nop\n 000073: 01                         |   nop\n 000074: 01                         |   nop\n 000075: 01                         |   nop\n 000076: 01                         |   nop\n 000077: 01                         |   nop\n 000078: 01                         |   nop\n 000079: 01                         |   nop\n 00007a: 01                         |   nop\n 00007b: 01                         |   nop\n 00007c: 01                         |   nop\n 00007d: 01                         |   nop\n 00007e: 01                         |   nop\n 00007f: 01                         |   nop\n 000080: 01                         |   nop\n 000081: 01                         |   nop\n 000082: 01                         |   nop\n 000083: 01                         |   nop\n 000084: 01                         |   nop\n 000085: 01                         |   nop\n 000086: 01                         |   nop\n 000087: 01                         |   nop\n 000088: 01                         |   nop\n 000089: 01                         |   nop\n 00008a: 01                         |   nop\n 00008b: 01                         |   nop\n 00008c: 01                         |   nop\n 00008d: 01                         |   nop\n 00008e: 01                         |   nop\n 00008f: 01                         |   nop\n 000090: 01                         |   nop\n 000091: 01                         |   nop\n 000092: 01                         |   nop\n 000093: 01                         |   nop\n 000094: 01                         |   nop\n 000095: 01                         |   nop\n 000096: 01                         |   nop\n 000097: 01                         |   nop\n 000098: 01                         |   nop\n 000099: 01                         |   nop\n 00009a: 01                         |   nop\n 00009b: 01                         |   nop\n 00009c: 01                         |   nop\n 00009d: 01                         |   nop\n 00009e: 01                         |   nop\n 00009f: 01                         |   nop\n 0000a0: 01                         |   nop\n 0000a1: 01                         |   nop\n 0000a2: 01                         |   nop\n 0000a3: 01                         |   nop\n 0000a4: 01                         |   nop\n 0000a5: 01                         |   nop\n 0000a6: 01                         |   nop\n 0000a7: 01                         |   nop\n 0000a8: 01                         |   nop\n 0000a9: 01                         |   nop\n 0000aa: 01                         |   nop\n 0000ab: 01                         |   nop\n 0000ac: 01                         |   nop\n 0000ad: 01                         |   nop\n 0000ae: 01                         |   nop\n 0000af: 01                         |   nop\n 0000b0: 01                         |   nop\n 0000b1: 01                         |   nop\n 0000b2: 01                         |   nop\n 0000b3: 01                         |   nop\n 0000b4: 01                         |   nop\n 0000b5: 01                         |   nop\n 0000b6: 01                         |   nop\n 0000b7: 01                         |   nop\n 0000b8: 01                         |   nop\n 0000b9: 01                         |   nop\n 0000ba: 01                         |   nop\n 0000bb: 01                         |   nop\n 0000bc: 01                         |   nop\n 0000bd: 01                         |   nop\n 0000be: 01                         |   nop\n 0000bf: 01                         |   nop\n 0000c0: 01                         |   nop\n 0000c1: 01                         |   nop\n 0000c2: 01                         |   nop\n 0000c3: 01                         |   nop\n 0000c4: 01                         |   nop\n 0000c5: 01                         |   nop\n 0000c6: 01                         |   nop\n 0000c7: 01                         |   nop\n 0000c8: 01                         |   nop\n 0000c9: 01                         |   nop\n 0000ca: 01                         |   nop\n 0000cb: 01                         |   nop\n 0000cc: 01                         |   nop\n 0000cd: 01                         |   nop\n 0000ce: 01                         |   nop\n 0000cf: 01                         |   nop\n 0000d0: 01                         |   nop\n 0000d1: 01                         |   nop\n 0000d2: 01                         |   nop\n 0000d3: 01                         |   nop\n 0000d4: 01                         |   nop\n 0000d5: 01                         |   nop\n 0000d6: 01                         |   nop\n 0000d7: 01                         |   nop\n 0000d8: 01                         |   nop\n 0000d9: 01                         |   nop\n 0000da: 01                         |   nop\n 0000db: 01                         |   nop\n 0000dc: 01                         |   nop\n 0000dd: 01                         |   nop\n 0000de: 01                         |   nop\n 0000df: 01                         |   nop\n 0000e0: 01                         |   nop\n 0000e1: 01                         |   nop\n 0000e2: 01                         |   nop\n 0000e3: 01                         |   nop\n 0000e4: 01                         |   nop\n 0000e5: 01                         |   nop\n 0000e6: 01                         |   nop\n 0000e7: 01                         |   nop\n 0000e8: 01                         |   nop\n 0000e9: 01                         |   nop\n 0000ea: 01                         |   nop\n 0000eb: 01                         |   nop\n 0000ec: 01                         |   nop\n 0000ed: 01                         |   nop\n 0000ee: 01                         |   nop\n 0000ef: 01                         |   nop\n 0000f0: 01                         |   nop\n 0000f1: 01                         |   nop\n 0000f2: 01                         |   nop\n 0000f3: 01                         |   nop\n 0000f4: 01                         |   nop\n 0000f5: 01                         |   nop\n 0000f6: 01                         |   nop\n 0000f7: 01                         |   nop\n 0000f8: 01                         |   nop\n 0000f9: 01                         |   nop\n 0000fa: 01                         |   nop\n 0000fb: 01                         |   nop\n 0000fc: 01                         |   nop\n 0000fd: 01                         |   nop\n 0000fe: 01                         |   nop\n 0000ff: 01                         |   nop\n 000100: 01                         |   nop\n 000101: 01                         |   nop\n 000102: 01                         |   nop\n 000103: 01                         |   nop\n 000104: 01                         |   nop\n 000105: 01                         |   nop\n 000106: 01                         |   nop\n 000107: 01                         |   nop\n 000108: 01                         |   nop\n 000109: 01                         |   nop\n 00010a: 01                         |   nop\n 00010b: 01                         |   nop\n 00010c: 01                         |   nop\n 00010d: 01                         |   nop\n 00010e: 01                         |   nop\n 00010f: 01                         |   nop\n 000110: 01                         |   nop\n 000111: 01                         |   nop\n 000112: 01                         |   nop\n 000113: 01                         |   nop\n 000114: 01                         |   nop\n 000115: 01                         |   nop\n 000116: 01                         |   nop\n 000117: 01                         |   nop\n 000118: 01                         |   nop\n 000119: 01                         |   nop\n 00011a: 01                         |   nop\n 00011b: 01                         |   nop\n 00011c: 0b                         | end\n 00011d: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/block-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block (result i32 i32)\n      i32.const 1\n      i32.const 2\n    end\n    return)\n\n  (func\n    i32.const 0\n    block (param i32)\n      drop\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n; func type 1\n000000e: 60                                        ; func\n000000f: 00                                        ; num params\n0000010: 02                                        ; num results\n0000011: 7f                                        ; i32\n0000012: 7f                                        ; i32\n; func type 2\n0000013: 60                                        ; func\n0000014: 01                                        ; num params\n0000015: 7f                                        ; i32\n0000016: 00                                        ; num results\n0000009: 0d                                        ; FIXUP section size\n; section \"Function\" (3)\n0000017: 03                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 02                                        ; num functions\n000001a: 00                                        ; function 0 signature index\n000001b: 00                                        ; function 1 signature index\n0000018: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n000001c: 0a                                        ; section code\n000001d: 00                                        ; section size (guess)\n000001e: 02                                        ; num functions\n; function body 0\n000001f: 00                                        ; func body size (guess)\n0000020: 00                                        ; local decl count\n0000021: 02                                        ; block\n0000022: 01                                        ; block type function index\n0000023: 41                                        ; i32.const\n0000024: 01                                        ; i32 literal\n0000025: 41                                        ; i32.const\n0000026: 02                                        ; i32 literal\n0000027: 0b                                        ; end\n0000028: 0f                                        ; return\n0000029: 0b                                        ; end\n000001f: 0a                                        ; FIXUP func body size\n; function body 1\n000002a: 00                                        ; func body size (guess)\n000002b: 00                                        ; local decl count\n000002c: 41                                        ; i32.const\n000002d: 00                                        ; i32 literal\n000002e: 02                                        ; block\n000002f: 02                                        ; block type function index\n0000030: 1a                                        ; drop\n0000031: 0b                                        ; end\n0000032: 0b                                        ; end\n000002a: 08                                        ; FIXUP func body size\n000001d: 15                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nblock-multi.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000020 func[0]:\n 000021: 02 01                      | block type[1]\n 000023: 41 01                      |   i32.const 1\n 000025: 41 02                      |   i32.const 2\n 000027: 0b                         | end\n 000028: 0f                         | return\n 000029: 0b                         | end\n00002b func[1]:\n 00002c: 41 00                      | i32.const 0\n 00002e: 02 02                      | block type[2]\n 000030: 1a                         |   drop\n 000031: 0b                         | end\n 000032: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/block.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block\n      nop\n      nop\n      nop\n    end)\n\n  (func (result i32)\n    block (result i32)\n      i32.const 1\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n; func type 1\n000000e: 60                                        ; func\n000000f: 00                                        ; num params\n0000010: 01                                        ; num results\n0000011: 7f                                        ; i32\n0000009: 08                                        ; FIXUP section size\n; section \"Function\" (3)\n0000012: 03                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 02                                        ; num functions\n0000015: 00                                        ; function 0 signature index\n0000016: 01                                        ; function 1 signature index\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 02                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 02                                        ; block\n000001d: 40                                        ; void\n000001e: 01                                        ; nop\n000001f: 01                                        ; nop\n0000020: 01                                        ; nop\n0000021: 0b                                        ; end\n0000022: 0b                                        ; end\n000001a: 08                                        ; FIXUP func body size\n; function body 1\n0000023: 00                                        ; func body size (guess)\n0000024: 00                                        ; local decl count\n0000025: 02                                        ; block\n0000026: 7f                                        ; i32\n0000027: 41                                        ; i32.const\n0000028: 01                                        ; i32 literal\n0000029: 0b                                        ; end\n000002a: 0b                                        ; end\n0000023: 07                                        ; FIXUP func body size\n0000018: 12                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nblock.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 02 40                      | block\n 00001e: 01                         |   nop\n 00001f: 01                         |   nop\n 000020: 01                         |   nop\n 000021: 0b                         | end\n 000022: 0b                         | end\n000024 func[1]:\n 000025: 02 7f                      | block i32\n 000027: 41 01                      |   i32.const 1\n 000029: 0b                         | end\n 00002a: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/br-block-named.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block $outer           ;; 3\n      loop                 ;; 2\n        block              ;; 1\n          i32.const 0\n          drop \n          block $inner     ;; 0\n            br $inner\n            br $outer\n          end\n        end\n      end\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 03                                        ; loop\n000001a: 40                                        ; void\n000001b: 02                                        ; block\n000001c: 40                                        ; void\n000001d: 41                                        ; i32.const\n000001e: 00                                        ; i32 literal\n000001f: 1a                                        ; drop\n0000020: 02                                        ; block\n0000021: 40                                        ; void\n0000022: 0c                                        ; br\n0000023: 00                                        ; break depth\n0000024: 0c                                        ; br\n0000025: 03                                        ; break depth\n0000026: 0b                                        ; end\n0000027: 0b                                        ; end\n0000028: 0b                                        ; end\n0000029: 0b                                        ; end\n000002a: 0b                                        ; end\n0000015: 15                                        ; FIXUP func body size\n0000013: 17                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbr-block-named.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 02 40                      | block\n 000019: 03 40                      |   loop\n 00001b: 02 40                      |     block\n 00001d: 41 00                      |       i32.const 0\n 00001f: 1a                         |       drop\n 000020: 02 40                      |       block\n 000022: 0c 00                      |         br 0\n 000024: 0c 03                      |         br 3\n 000026: 0b                         |       end\n 000027: 0b                         |     end\n 000028: 0b                         |   end\n 000029: 0b                         | end\n 00002a: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/br-block.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func                     ;; depth\n    block $outer           ;; 4\n      loop                 ;; 2 loop, 3 exit\n        block              ;; 1\n          i32.const 0\n          drop \n          block $inner     ;; 0\n            br 0\n            br 1\n            br 2\n            br 3\n          end\n        end\n      end\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 03                                        ; loop\n000001a: 40                                        ; void\n000001b: 02                                        ; block\n000001c: 40                                        ; void\n000001d: 41                                        ; i32.const\n000001e: 00                                        ; i32 literal\n000001f: 1a                                        ; drop\n0000020: 02                                        ; block\n0000021: 40                                        ; void\n0000022: 0c                                        ; br\n0000023: 00                                        ; break depth\n0000024: 0c                                        ; br\n0000025: 01                                        ; break depth\n0000026: 0c                                        ; br\n0000027: 02                                        ; break depth\n0000028: 0c                                        ; br\n0000029: 03                                        ; break depth\n000002a: 0b                                        ; end\n000002b: 0b                                        ; end\n000002c: 0b                                        ; end\n000002d: 0b                                        ; end\n000002e: 0b                                        ; end\n0000015: 19                                        ; FIXUP func body size\n0000013: 1b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbr-block.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 02 40                      | block\n 000019: 03 40                      |   loop\n 00001b: 02 40                      |     block\n 00001d: 41 00                      |       i32.const 0\n 00001f: 1a                         |       drop\n 000020: 02 40                      |       block\n 000022: 0c 00                      |         br 0\n 000024: 0c 01                      |         br 1\n 000026: 0c 02                      |         br 2\n 000028: 0c 03                      |         br 3\n 00002a: 0b                         |       end\n 00002b: 0b                         |     end\n 00002c: 0b                         |   end\n 00002d: 0b                         | end\n 00002e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/br-loop-inner-expr.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (result i32)\n    block $exit (result i32)\n      loop $cont (result i32)\n        i32.const 1\n        if \n          br $cont\n        end\n        i32.const 3\n        if\n          i32.const 4 \n          br $exit\n        end\n        i32.const 5\n      end\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7f                                        ; i32\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000013: 0a                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num functions\n; function body 0\n0000016: 00                                        ; func body size (guess)\n0000017: 00                                        ; local decl count\n0000018: 02                                        ; block\n0000019: 7f                                        ; i32\n000001a: 03                                        ; loop\n000001b: 7f                                        ; i32\n000001c: 41                                        ; i32.const\n000001d: 01                                        ; i32 literal\n000001e: 04                                        ; if\n000001f: 40                                        ; void\n0000020: 0c                                        ; br\n0000021: 01                                        ; break depth\n0000022: 0b                                        ; end\n0000023: 41                                        ; i32.const\n0000024: 03                                        ; i32 literal\n0000025: 04                                        ; if\n0000026: 40                                        ; void\n0000027: 41                                        ; i32.const\n0000028: 04                                        ; i32 literal\n0000029: 0c                                        ; br\n000002a: 02                                        ; break depth\n000002b: 0b                                        ; end\n000002c: 41                                        ; i32.const\n000002d: 05                                        ; i32 literal\n000002e: 0b                                        ; end\n000002f: 0b                                        ; end\n0000030: 0b                                        ; end\n0000016: 1a                                        ; FIXUP func body size\n0000014: 1c                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbr-loop-inner-expr.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000017 func[0]:\n 000018: 02 7f                      | block i32\n 00001a: 03 7f                      |   loop i32\n 00001c: 41 01                      |     i32.const 1\n 00001e: 04 40                      |     if\n 000020: 0c 01                      |       br 1\n 000022: 0b                         |     end\n 000023: 41 03                      |     i32.const 3\n 000025: 04 40                      |     if\n 000027: 41 04                      |       i32.const 4\n 000029: 0c 02                      |       br 2\n 00002b: 0b                         |     end\n 00002c: 41 05                      |     i32.const 5\n 00002e: 0b                         |   end\n 00002f: 0b                         | end\n 000030: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/br-loop-inner.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    (block $exit (loop $cont\n      (if (i32.const 1)\n        (then (br $exit)))\n      (if (i32.const 2)\n        (then (br $cont)))))))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 03                                        ; loop\n000001a: 40                                        ; void\n000001b: 41                                        ; i32.const\n000001c: 01                                        ; i32 literal\n000001d: 04                                        ; if\n000001e: 40                                        ; void\n000001f: 0c                                        ; br\n0000020: 02                                        ; break depth\n0000021: 0b                                        ; end\n0000022: 41                                        ; i32.const\n0000023: 02                                        ; i32 literal\n0000024: 04                                        ; if\n0000025: 40                                        ; void\n0000026: 0c                                        ; br\n0000027: 01                                        ; break depth\n0000028: 0b                                        ; end\n0000029: 0b                                        ; end\n000002a: 0b                                        ; end\n000002b: 0b                                        ; end\n0000015: 16                                        ; FIXUP func body size\n0000013: 18                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbr-loop-inner.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 02 40                      | block\n 000019: 03 40                      |   loop\n 00001b: 41 01                      |     i32.const 1\n 00001d: 04 40                      |     if\n 00001f: 0c 02                      |       br 2\n 000021: 0b                         |     end\n 000022: 41 02                      |     i32.const 2\n 000024: 04 40                      |     if\n 000026: 0c 01                      |       br 1\n 000028: 0b                         |     end\n 000029: 0b                         |   end\n 00002a: 0b                         | end\n 00002b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/br-loop.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    loop $cont\n      i32.const 1\n      if \n        br $cont\n      end\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 03                                        ; loop\n0000018: 40                                        ; void\n0000019: 41                                        ; i32.const\n000001a: 01                                        ; i32 literal\n000001b: 04                                        ; if\n000001c: 40                                        ; void\n000001d: 0c                                        ; br\n000001e: 01                                        ; break depth\n000001f: 0b                                        ; end\n0000020: 0b                                        ; end\n0000021: 0b                                        ; end\n0000015: 0c                                        ; FIXUP func body size\n0000013: 0e                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbr-loop.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 03 40                      | loop\n 000019: 41 01                      |   i32.const 1\n 00001b: 04 40                      |   if\n 00001d: 0c 01                      |     br 1\n 00001f: 0b                         |   end\n 000020: 0b                         | end\n 000021: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/brif-loop.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    loop $cont\n      i32.const 0\n      br_if $cont\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 03                                        ; loop\n0000018: 40                                        ; void\n0000019: 41                                        ; i32.const\n000001a: 00                                        ; i32 literal\n000001b: 0d                                        ; br_if\n000001c: 00                                        ; break depth\n000001d: 0b                                        ; end\n000001e: 0b                                        ; end\n0000015: 09                                        ; FIXUP func body size\n0000013: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbrif-loop.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 03 40                      | loop\n 000019: 41 00                      |   i32.const 0\n 00001b: 0d 00                      |   br_if 0\n 00001d: 0b                         | end\n 00001e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/brif.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block $foo\n      i32.const 1\n      br_if $foo\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 41                                        ; i32.const\n000001a: 01                                        ; i32 literal\n000001b: 0d                                        ; br_if\n000001c: 00                                        ; break depth\n000001d: 0b                                        ; end\n000001e: 0b                                        ; end\n0000015: 09                                        ; FIXUP func body size\n0000013: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbrif.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 02 40                      | block\n 000019: 41 01                      |   i32.const 1\n 00001b: 0d 00                      |   br_if 0\n 00001d: 0b                         | end\n 00001e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/brtable-empty.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block\n      i32.const 0  \n      br_table 0 \n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 41                                        ; i32.const\n000001a: 00                                        ; i32 literal\n000001b: 0e                                        ; br_table\n000001c: 00                                        ; num targets\n000001d: 00                                        ; break depth for default\n000001e: 0b                                        ; end\n000001f: 0b                                        ; end\n0000015: 0a                                        ; FIXUP func body size\n0000013: 0c                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbrtable-empty.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 02 40                      | block\n 000019: 41 00                      |   i32.const 0\n 00001b: 0e 00 00                   |   br_table 0\n 00001e: 0b                         | end\n 00001f: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/brtable.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block\n      block\n        block\n          i32.const 0 \n          br_table 0 1 0 \n        end\n        ;; case 0\n        i32.const 1\n        drop\n        i32.const 2\n        drop\n        br 1  ;; topmost block\n      end\n      ;; case 1\n      ;; fallthrough\n    end\n    i32.const 3\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 02                                        ; block\n000001a: 40                                        ; void\n000001b: 02                                        ; block\n000001c: 40                                        ; void\n000001d: 41                                        ; i32.const\n000001e: 00                                        ; i32 literal\n000001f: 0e                                        ; br_table\n0000020: 02                                        ; num targets\n0000021: 00                                        ; break depth\n0000022: 01                                        ; break depth\n0000023: 00                                        ; break depth for default\n0000024: 0b                                        ; end\n0000025: 41                                        ; i32.const\n0000026: 01                                        ; i32 literal\n0000027: 1a                                        ; drop\n0000028: 41                                        ; i32.const\n0000029: 02                                        ; i32 literal\n000002a: 1a                                        ; drop\n000002b: 0c                                        ; br\n000002c: 01                                        ; break depth\n000002d: 0b                                        ; end\n000002e: 0b                                        ; end\n000002f: 41                                        ; i32.const\n0000030: 03                                        ; i32 literal\n0000031: 1a                                        ; drop\n0000032: 0b                                        ; end\n0000015: 1d                                        ; FIXUP func body size\n0000013: 1f                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nbrtable.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 02 40                      | block\n 000019: 02 40                      |   block\n 00001b: 02 40                      |     block\n 00001d: 41 00                      |       i32.const 0\n 00001f: 0e 02 00 01 00             |       br_table 0 1 0\n 000024: 0b                         |     end\n 000025: 41 01                      |     i32.const 1\n 000027: 1a                         |     drop\n 000028: 41 02                      |     i32.const 2\n 00002a: 1a                         |     drop\n 00002b: 0c 01                      |     br 1\n 00002d: 0b                         |   end\n 00002e: 0b                         | end\n 00002f: 41 03                      | i32.const 3\n 000031: 1a                         | drop\n 000032: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/bulk-memory.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: --debug-names\n\n(module\n  (memory 1)\n  (data $mydata \"a\")\n  (func\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n    data.drop 0\n    i32.const 0 i32.const 0 i32.const 0 memory.copy\n    i32.const 0 i32.const 0 i32.const 0 memory.fill\n  )\n\n  (table 1 funcref)\n  (elem func 0)\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n    elem.drop 0\n    i32.const 0 i32.const 0 i32.const 0 table.copy\n  )\n)\n(;; STDOUT ;;;\n\nbulk-memory.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00002c func[0]:\n 00002d: 41 00                      | i32.const 0\n 00002f: 41 00                      | i32.const 0\n 000031: 41 00                      | i32.const 0\n 000033: fc 08 00 00                | memory.init 0 0 <mydata>\n 000037: fc 09 00                   | data.drop 0 <mydata>\n 00003a: 41 00                      | i32.const 0\n 00003c: 41 00                      | i32.const 0\n 00003e: 41 00                      | i32.const 0\n 000040: fc 0a 00 00                | memory.copy 0 0\n 000044: 41 00                      | i32.const 0\n 000046: 41 00                      | i32.const 0\n 000048: 41 00                      | i32.const 0\n 00004a: fc 0b 00                   | memory.fill 0\n 00004d: 0b                         | end\n00004f func[1]:\n 000050: 41 00                      | i32.const 0\n 000052: 41 00                      | i32.const 0\n 000054: 41 00                      | i32.const 0\n 000056: fc 0c 00 00                | table.init 0 0\n 00005a: fc 0d 00                   | elem.drop 0\n 00005d: 41 00                      | i32.const 0\n 00005f: 41 00                      | i32.const 0\n 000061: 41 00                      | i32.const 0\n 000063: fc 0e 00 00                | table.copy 0 0\n 000067: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/bulk-memory64.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  (memory i64 1)\n  (data \"a\")\n  (func\n    i64.const 0 i32.const 0 i32.const 0 memory.init 0\n    data.drop 0\n    i64.const 0 i64.const 0 i64.const 0 memory.copy\n    i64.const 0 i32.const 0 i64.const 0 memory.fill\n  )\n\n  (table 1 funcref)\n  (elem func 0)\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n    elem.drop 0\n    i32.const 0 i32.const 0 i32.const 0 table.copy\n  )\n)\n(;; STDOUT ;;;\n\nbulk-memory64.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00002c func[0]:\n 00002d: 42 00                      | i64.const 0\n 00002f: 41 00                      | i32.const 0\n 000031: 41 00                      | i32.const 0\n 000033: fc 08 00 00                | memory.init 0 0\n 000037: fc 09 00                   | data.drop 0\n 00003a: 42 00                      | i64.const 0\n 00003c: 42 00                      | i64.const 0\n 00003e: 42 00                      | i64.const 0\n 000040: fc 0a 00 00                | memory.copy 0 0\n 000044: 42 00                      | i64.const 0\n 000046: 41 00                      | i32.const 0\n 000048: 42 00                      | i64.const 0\n 00004a: fc 0b 00                   | memory.fill 0\n 00004d: 0b                         | end\n00004f func[1]:\n 000050: 41 00                      | i32.const 0\n 000052: 41 00                      | i32.const 0\n 000054: 41 00                      | i32.const 0\n 000056: fc 0c 00 00                | table.init 0 0\n 00005a: fc 0d 00                   | elem.drop 0\n 00005d: 41 00                      | i32.const 0\n 00005f: 41 00                      | i32.const 0\n 000061: 41 00                      | i32.const 0\n 000063: fc 0e 00 00                | table.copy 0 0\n 000067: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/call.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (param i32)\n     i32.const 1\n     call 0))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000013: 0a                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num functions\n; function body 0\n0000016: 00                                        ; func body size (guess)\n0000017: 00                                        ; local decl count\n0000018: 41                                        ; i32.const\n0000019: 01                                        ; i32 literal\n000001a: 10                                        ; call\n000001b: 00                                        ; function index\n000001c: 0b                                        ; end\n0000016: 06                                        ; FIXUP func body size\n0000014: 08                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ncall.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000017 func[0]:\n 000018: 41 01                      | i32.const 1\n 00001a: 10 00                      | call 0\n 00001c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/call_ref.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-function-references\n\n(module\n  (func (export \"main\") (result i32)\n    i32.const 10\n    ref.func $foo\n    call_ref 0\n  )\n  (func $foo (param $x i32) (result i32)\n    (i32.add (local.get $x)\n             (i32.const 19))\n  )\n  (elem declare func $foo)\n  (type (func (param i32) (result i32)))\n)\n\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 01                                        ; num results\n000000f: 7f                                        ; i32\n; func type 1\n0000010: 60                                        ; func\n0000011: 00                                        ; num params\n0000012: 01                                        ; num results\n0000013: 7f                                        ; i32\n0000009: 0a                                        ; FIXUP section size\n; section \"Function\" (3)\n0000014: 03                                        ; section code\n0000015: 00                                        ; section size (guess)\n0000016: 02                                        ; num functions\n0000017: 01                                        ; function 0 signature index\n0000018: 00                                        ; function 1 signature index\n0000015: 03                                        ; FIXUP section size\n; section \"Export\" (7)\n0000019: 07                                        ; section code\n000001a: 00                                        ; section size (guess)\n000001b: 01                                        ; num exports\n000001c: 04                                        ; string length\n000001d: 6d61 696e                                main  ; export name\n0000021: 00                                        ; export kind\n0000022: 00                                        ; export func index\n000001a: 08                                        ; FIXUP section size\n; section \"Elem\" (9)\n0000023: 09                                        ; section code\n0000024: 00                                        ; section size (guess)\n0000025: 01                                        ; num elem segments\n; elem segment header 0\n0000026: 03                                        ; segment flags\n0000027: 00                                        ; elem list type\n0000028: 01                                        ; num elems\n0000029: 01                                        ; elem function index\n0000024: 05                                        ; FIXUP section size\n; section \"Code\" (10)\n000002a: 0a                                        ; section code\n000002b: 00                                        ; section size (guess)\n000002c: 02                                        ; num functions\n; function body 0\n000002d: 00                                        ; func body size (guess)\n000002e: 00                                        ; local decl count\n000002f: 41                                        ; i32.const\n0000030: 0a                                        ; i32 literal\n0000031: d2                                        ; ref.func\n0000032: 01                                        ; function index\n0000033: 14                                        ; call_ref\n0000034: 00                                        ; signature index\n0000035: 0b                                        ; end\n000002d: 08                                        ; FIXUP func body size\n; function body 1\n0000036: 00                                        ; func body size (guess)\n0000037: 00                                        ; local decl count\n0000038: 20                                        ; local.get\n0000039: 00                                        ; local index\n000003a: 41                                        ; i32.const\n000003b: 13                                        ; i32 literal\n000003c: 6a                                        ; i32.add\n000003d: 0b                                        ; end\n0000036: 07                                        ; FIXUP func body size\n000002b: 12                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ncall_ref.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00002e func[0] <main>:\n 00002f: 41 0a                      | i32.const 10\n 000031: d2 01                      | ref.func 1\n 000033: 14 00                      | call_ref (ref null 0)\n 000035: 0b                         | end\n000037 func[1]:\n 000038: 20 00                      | local.get 0\n 00003a: 41 13                      | i32.const 19\n 00003c: 6a                         | i32.add\n 00003d: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/callimport.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (import \"foo\" \"bar\" (func (param i32 f32) (result i32)))\n  (func (result i32)\n    ;; call imported func\n    i32.const 1\n    f32.const 2\n    call 0\n    drop\n    ;; call local func\n    call 1))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 02                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 7d                                        ; f32\n000000f: 01                                        ; num results\n0000010: 7f                                        ; i32\n; func type 1\n0000011: 60                                        ; func\n0000012: 00                                        ; num params\n0000013: 01                                        ; num results\n0000014: 7f                                        ; i32\n0000009: 0b                                        ; FIXUP section size\n; section \"Import\" (2)\n0000015: 02                                        ; section code\n0000016: 00                                        ; section size (guess)\n0000017: 01                                        ; num imports\n; import header 0\n0000018: 03                                        ; string length\n0000019: 666f 6f                                  foo  ; import module name\n000001c: 03                                        ; string length\n000001d: 6261 72                                  bar  ; import field name\n0000020: 00                                        ; import kind\n0000021: 00                                        ; import signature index\n0000016: 0b                                        ; FIXUP section size\n; section \"Function\" (3)\n0000022: 03                                        ; section code\n0000023: 00                                        ; section size (guess)\n0000024: 01                                        ; num functions\n0000025: 01                                        ; function 0 signature index\n0000023: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000026: 0a                                        ; section code\n0000027: 00                                        ; section size (guess)\n0000028: 01                                        ; num functions\n; function body 0\n0000029: 00                                        ; func body size (guess)\n000002a: 00                                        ; local decl count\n000002b: 41                                        ; i32.const\n000002c: 01                                        ; i32 literal\n000002d: 43                                        ; f32.const\n000002e: 0000 0040                                 ; f32 literal\n0000032: 10                                        ; call\n0000033: 00                                        ; function index\n0000034: 1a                                        ; drop\n0000035: 10                                        ; call\n0000036: 01                                        ; function index\n0000037: 0b                                        ; end\n0000029: 0e                                        ; FIXUP func body size\n0000027: 10                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ncallimport.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00002a func[1]:\n 00002b: 41 01                      | i32.const 1\n 00002d: 43 00 00 00 40             | f32.const 0x1p+1\n 000032: 10 00                      | call 0 <foo.bar>\n 000034: 1a                         | drop\n 000035: 10 01                      | call 1\n 000037: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/callindirect.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (type $t (func (param i32)))\n  (func $f (type $t)\n    i32.const 0\n    i32.const 0\n    call_indirect (type $t))\n  (table funcref (elem $f)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Table\" (4)\n0000013: 04                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num tables\n; table 0\n0000016: 70                                        ; funcref\n0000017: 01                                        ; limits: flags\n0000018: 01                                        ; limits: initial\n0000019: 01                                        ; limits: max\n0000014: 05                                        ; FIXUP section size\n; section \"Elem\" (9)\n000001a: 09                                        ; section code\n000001b: 00                                        ; section size (guess)\n000001c: 01                                        ; num elem segments\n; elem segment header 0\n000001d: 00                                        ; segment flags\n000001e: 41                                        ; i32.const\n000001f: 00                                        ; i32 literal\n0000020: 0b                                        ; end\n0000021: 01                                        ; num elems\n0000022: 00                                        ; elem function index\n000001b: 07                                        ; FIXUP section size\n; section \"Code\" (10)\n0000023: 0a                                        ; section code\n0000024: 00                                        ; section size (guess)\n0000025: 01                                        ; num functions\n; function body 0\n0000026: 00                                        ; func body size (guess)\n0000027: 00                                        ; local decl count\n0000028: 41                                        ; i32.const\n0000029: 00                                        ; i32 literal\n000002a: 41                                        ; i32.const\n000002b: 00                                        ; i32 literal\n000002c: 11                                        ; call_indirect\n000002d: 00                                        ; signature index\n000002e: 00                                        ; table index\n000002f: 0b                                        ; end\n0000026: 09                                        ; FIXUP func body size\n0000024: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ncallindirect.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000027 func[0]:\n 000028: 41 00                      | i32.const 0\n 00002a: 41 00                      | i32.const 0\n 00002c: 11 00 00                   | call_indirect 0 (type 0)\n 00002f: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/cast.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    f32.reinterpret_i32\n    drop\n    f32.const 0\n    i32.reinterpret_f32\n    drop\n    i64.const 0\n    f64.reinterpret_i64 \n    drop\n    f64.const 0\n    i64.reinterpret_f64\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: be                                        ; f32.reinterpret_i32\n000001a: 1a                                        ; drop\n000001b: 43                                        ; f32.const\n000001c: 0000 0000                                 ; f32 literal\n0000020: bc                                        ; i32.reinterpret_f32\n0000021: 1a                                        ; drop\n0000022: 42                                        ; i64.const\n0000023: 00                                        ; i64 literal\n0000024: bf                                        ; f64.reinterpret_i64\n0000025: 1a                                        ; drop\n0000026: 44                                        ; f64.const\n0000027: 0000 0000 0000 0000                       ; f64 literal\n000002f: bd                                        ; i64.reinterpret_f64\n0000030: 1a                                        ; drop\n0000031: 0b                                        ; end\n0000015: 1c                                        ; FIXUP func body size\n0000013: 1e                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ncast.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 41 00                      | i32.const 0\n 000019: be                         | f32.reinterpret_i32\n 00001a: 1a                         | drop\n 00001b: 43 00 00 00 00             | f32.const 0x0p+0\n 000020: bc                         | i32.reinterpret_f32\n 000021: 1a                         | drop\n 000022: 42 00                      | i64.const 0\n 000024: bf                         | f64.reinterpret_i64\n 000025: 1a                         | drop\n 000026: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 00002f: bd                         | i64.reinterpret_f64\n 000030: 1a                         | drop\n 000031: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/code-metadata.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: --enable-annotations --enable-code-metadata\n;;; ARGS1: --headers --details\n(module\n  (func $f (param i32) (result i32)\n    i32.const 1234\n    local.get 0\n    (@metadata.code.test \"aa\\01a\") i32.add\n    return))\n(;; STDOUT ;;;\n\ncode-metadata.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x00000010 (size=0x00000006) count: 1\n Function start=0x00000012 end=0x00000014 (size=0x00000002) count: 1\n   Custom start=0x00000016 end=0x00000032 (size=0x0000001c) \"metadata.code.test\"\n     Code start=0x00000034 end=0x0000003f (size=0x0000000b) count: 1\n\nSection Details:\n\nType[1]:\n - type[0] (i32) -> i32\nFunction[1]:\n - func[0] sig=0\nCustom:\n - name: \"metadata.code.test\"\n   - func[0]:\n    - meta[6]:\n     - 0000000: 6161 0161                                aa.a\nCode[1]:\n - func[0] size=9\n\nCode Disassembly:\n\n000036 func[0]:\n 000037: 41 d2 09                   | i32.const 1234\n 00003a: 20 00                      | local.get 0\n 00003c: 6a                         | i32.add\n 00003d: 0f                         | return\n 00003e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/compact-imports.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-compact-imports\n;;; ARGS1: -x\n(module\n  (import \"mod1\" \"test\" (func (param i32 i64 f32 f64)))\n  (import \"mod1\" \"test2\" (func (param i32) (result i32)))\n  (import \"mod2\" \"testmem\" (memory 0))\n  (import \"mod2\" \"testtable\" (table 0 funcref))\n  (import \"mod1\" \"testtag\" (tag (param i32)))\n  (import \"mod1\" \"func\" (func (param i32 i64 f32 f64)))\n)\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 04                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 7e                                        ; i64\n000000f: 7d                                        ; f32\n0000010: 7c                                        ; f64\n0000011: 00                                        ; num results\n; func type 1\n0000012: 60                                        ; func\n0000013: 01                                        ; num params\n0000014: 7f                                        ; i32\n0000015: 01                                        ; num results\n0000016: 7f                                        ; i32\n; func type 2\n0000017: 60                                        ; func\n0000018: 01                                        ; num params\n0000019: 7f                                        ; i32\n000001a: 00                                        ; num results\n0000009: 11                                        ; FIXUP section size\n; section \"Import\" (2)\n000001b: 02                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 06                                        ; num imports\n; import header 0\n000001e: 04                                        ; string length\n000001f: 6d6f 6431                                mod1  ; import module name\n0000023: 00                                        ; string length\n0000024: 7f                                        ; compact import marker\n0000025: 02                                        ; import group size\n; compact import header 0\n0000026: 04                                        ; string length\n0000027: 7465 7374                                test  ; import field name\n000002b: 00                                        ; import kind\n000002c: 00                                        ; import signature index\n; compact import header 1\n000002d: 05                                        ; string length\n000002e: 7465 7374 32                             test2  ; import field name\n0000033: 00                                        ; import kind\n0000034: 01                                        ; import signature index\n; import header 2\n0000035: 04                                        ; string length\n0000036: 6d6f 6432                                mod2  ; import module name\n000003a: 00                                        ; string length\n000003b: 7f                                        ; compact import marker\n000003c: 02                                        ; import group size\n; compact import header 2\n000003d: 07                                        ; string length\n000003e: 7465 7374 6d65 6d                        testmem  ; import field name\n0000045: 02                                        ; import kind\n0000046: 00                                        ; limits: flags\n0000047: 00                                        ; limits: initial\n; compact import header 3\n0000048: 09                                        ; string length\n0000049: 7465 7374 7461 626c 65                   testtable  ; import field name\n0000052: 01                                        ; import kind\n0000053: 70                                        ; funcref\n0000054: 00                                        ; limits: flags\n0000055: 00                                        ; limits: initial\n; import header 4\n0000056: 04                                        ; string length\n0000057: 6d6f 6431                                mod1  ; import module name\n000005b: 00                                        ; string length\n000005c: 7f                                        ; compact import marker\n000005d: 02                                        ; import group size\n; compact import header 4\n000005e: 07                                        ; string length\n000005f: 7465 7374 7461 67                        testtag  ; import field name\n0000066: 04                                        ; import kind\n0000067: 00                                        ; tag attribute\n0000068: 02                                        ; tag signature index\n; compact import header 5\n0000069: 04                                        ; string length\n000006a: 6675 6e63                                func  ; import field name\n000006e: 00                                        ; import kind\n000006f: 00                                        ; import signature index\n000001c: 53                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ncompact-imports.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[3]:\n - type[0] (i32, i64, f32, f64) -> nil\n - type[1] (i32) -> i32\n - type[2] (i32) -> nil\nImport[6]:\n - func[0] sig=0 <mod1.test> <- mod1.test\n - func[1] sig=1 <mod1.test2> <- mod1.test2\n - memory[0] pages: initial=0 <- mod2.testmem\n - table[0] type=funcref initial=0 <- mod2.testtable\n - tag[0] sig=2 <mod1.testtag> <- mod1.testtag\n - func[2] sig=0 <mod1.func> <- mod1.func\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/compare.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    i32.const 0\n    i32.ge_u\n    i32.const 0\n    i32.ge_s\n    i32.const 0\n    i32.gt_u\n    i32.const 0\n    i32.gt_s\n    i32.const 0\n    i32.le_u\n    i32.const 0\n    i32.le_s\n    i32.const 0\n    i32.lt_u\n    i32.const 0\n    i32.lt_s\n    i32.const 0\n    i32.ne\n    i32.const 0\n    i32.eq\n    drop\n   \n    ;; all comparisons return i32, so these tests can't be chained like the one\n    ;; above\n    i64.const 0\n    i64.const 0\n    i64.eq\n    drop\n    i64.const 0\n    i64.const 0\n    i64.ne\n    drop\n    i64.const 0\n    i64.const 0\n    i64.lt_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.lt_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.le_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.le_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.gt_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.gt_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.ge_s \n    drop\n    i64.const 0\n    i64.const 0\n    i64.ge_u\n    drop\n    f32.const 0\n    f32.const 0\n    f32.eq\n    drop\n    f32.const 0 \n    f32.const 0\n    f32.ne\n    drop\n    f32.const 0\n    f32.const 0\n    f32.lt\n    drop\n    f32.const 0\n    f32.const 0\n    f32.le\n    drop\n    f32.const 0\n    f32.const 0\n    f32.gt \n    drop\n    f32.const 0\n    f32.const 0\n    f32.ge\n    drop\n    f64.const 0\n    f64.const 0\n    f64.eq\n    drop\n    f64.const 0\n    f64.const 0 \n    f64.ne\n    drop\n    f64.const 0\n    f64.const 0\n    f64.lt\n    drop\n    f64.const 0\n    f64.const 0\n    f64.le\n    drop\n    f64.const 0\n    f64.const 0\n    f64.gt\n    drop\n    f64.const 0\n    f64.const 0\n    f64.ge\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: 41                                        ; i32.const\n000001a: 00                                        ; i32 literal\n000001b: 4f                                        ; i32.ge_u\n000001c: 41                                        ; i32.const\n000001d: 00                                        ; i32 literal\n000001e: 4e                                        ; i32.ge_s\n000001f: 41                                        ; i32.const\n0000020: 00                                        ; i32 literal\n0000021: 4b                                        ; i32.gt_u\n0000022: 41                                        ; i32.const\n0000023: 00                                        ; i32 literal\n0000024: 4a                                        ; i32.gt_s\n0000025: 41                                        ; i32.const\n0000026: 00                                        ; i32 literal\n0000027: 4d                                        ; i32.le_u\n0000028: 41                                        ; i32.const\n0000029: 00                                        ; i32 literal\n000002a: 4c                                        ; i32.le_s\n000002b: 41                                        ; i32.const\n000002c: 00                                        ; i32 literal\n000002d: 49                                        ; i32.lt_u\n000002e: 41                                        ; i32.const\n000002f: 00                                        ; i32 literal\n0000030: 48                                        ; i32.lt_s\n0000031: 41                                        ; i32.const\n0000032: 00                                        ; i32 literal\n0000033: 47                                        ; i32.ne\n0000034: 41                                        ; i32.const\n0000035: 00                                        ; i32 literal\n0000036: 46                                        ; i32.eq\n0000037: 1a                                        ; drop\n0000038: 42                                        ; i64.const\n0000039: 00                                        ; i64 literal\n000003a: 42                                        ; i64.const\n000003b: 00                                        ; i64 literal\n000003c: 51                                        ; i64.eq\n000003d: 1a                                        ; drop\n000003e: 42                                        ; i64.const\n000003f: 00                                        ; i64 literal\n0000040: 42                                        ; i64.const\n0000041: 00                                        ; i64 literal\n0000042: 52                                        ; i64.ne\n0000043: 1a                                        ; drop\n0000044: 42                                        ; i64.const\n0000045: 00                                        ; i64 literal\n0000046: 42                                        ; i64.const\n0000047: 00                                        ; i64 literal\n0000048: 53                                        ; i64.lt_s\n0000049: 1a                                        ; drop\n000004a: 42                                        ; i64.const\n000004b: 00                                        ; i64 literal\n000004c: 42                                        ; i64.const\n000004d: 00                                        ; i64 literal\n000004e: 54                                        ; i64.lt_u\n000004f: 1a                                        ; drop\n0000050: 42                                        ; i64.const\n0000051: 00                                        ; i64 literal\n0000052: 42                                        ; i64.const\n0000053: 00                                        ; i64 literal\n0000054: 57                                        ; i64.le_s\n0000055: 1a                                        ; drop\n0000056: 42                                        ; i64.const\n0000057: 00                                        ; i64 literal\n0000058: 42                                        ; i64.const\n0000059: 00                                        ; i64 literal\n000005a: 58                                        ; i64.le_u\n000005b: 1a                                        ; drop\n000005c: 42                                        ; i64.const\n000005d: 00                                        ; i64 literal\n000005e: 42                                        ; i64.const\n000005f: 00                                        ; i64 literal\n0000060: 55                                        ; i64.gt_s\n0000061: 1a                                        ; drop\n0000062: 42                                        ; i64.const\n0000063: 00                                        ; i64 literal\n0000064: 42                                        ; i64.const\n0000065: 00                                        ; i64 literal\n0000066: 56                                        ; i64.gt_u\n0000067: 1a                                        ; drop\n0000068: 42                                        ; i64.const\n0000069: 00                                        ; i64 literal\n000006a: 42                                        ; i64.const\n000006b: 00                                        ; i64 literal\n000006c: 59                                        ; i64.ge_s\n000006d: 1a                                        ; drop\n000006e: 42                                        ; i64.const\n000006f: 00                                        ; i64 literal\n0000070: 42                                        ; i64.const\n0000071: 00                                        ; i64 literal\n0000072: 5a                                        ; i64.ge_u\n0000073: 1a                                        ; drop\n0000074: 43                                        ; f32.const\n0000075: 0000 0000                                 ; f32 literal\n0000079: 43                                        ; f32.const\n000007a: 0000 0000                                 ; f32 literal\n000007e: 5b                                        ; f32.eq\n000007f: 1a                                        ; drop\n0000080: 43                                        ; f32.const\n0000081: 0000 0000                                 ; f32 literal\n0000085: 43                                        ; f32.const\n0000086: 0000 0000                                 ; f32 literal\n000008a: 5c                                        ; f32.ne\n000008b: 1a                                        ; drop\n000008c: 43                                        ; f32.const\n000008d: 0000 0000                                 ; f32 literal\n0000091: 43                                        ; f32.const\n0000092: 0000 0000                                 ; f32 literal\n0000096: 5d                                        ; f32.lt\n0000097: 1a                                        ; drop\n0000098: 43                                        ; f32.const\n0000099: 0000 0000                                 ; f32 literal\n000009d: 43                                        ; f32.const\n000009e: 0000 0000                                 ; f32 literal\n00000a2: 5f                                        ; f32.le\n00000a3: 1a                                        ; drop\n00000a4: 43                                        ; f32.const\n00000a5: 0000 0000                                 ; f32 literal\n00000a9: 43                                        ; f32.const\n00000aa: 0000 0000                                 ; f32 literal\n00000ae: 5e                                        ; f32.gt\n00000af: 1a                                        ; drop\n00000b0: 43                                        ; f32.const\n00000b1: 0000 0000                                 ; f32 literal\n00000b5: 43                                        ; f32.const\n00000b6: 0000 0000                                 ; f32 literal\n00000ba: 60                                        ; f32.ge\n00000bb: 1a                                        ; drop\n00000bc: 44                                        ; f64.const\n00000bd: 0000 0000 0000 0000                       ; f64 literal\n00000c5: 44                                        ; f64.const\n00000c6: 0000 0000 0000 0000                       ; f64 literal\n00000ce: 61                                        ; f64.eq\n00000cf: 1a                                        ; drop\n00000d0: 44                                        ; f64.const\n00000d1: 0000 0000 0000 0000                       ; f64 literal\n00000d9: 44                                        ; f64.const\n00000da: 0000 0000 0000 0000                       ; f64 literal\n00000e2: 62                                        ; f64.ne\n00000e3: 1a                                        ; drop\n00000e4: 44                                        ; f64.const\n00000e5: 0000 0000 0000 0000                       ; f64 literal\n00000ed: 44                                        ; f64.const\n00000ee: 0000 0000 0000 0000                       ; f64 literal\n00000f6: 63                                        ; f64.lt\n00000f7: 1a                                        ; drop\n00000f8: 44                                        ; f64.const\n00000f9: 0000 0000 0000 0000                       ; f64 literal\n0000101: 44                                        ; f64.const\n0000102: 0000 0000 0000 0000                       ; f64 literal\n000010a: 65                                        ; f64.le\n000010b: 1a                                        ; drop\n000010c: 44                                        ; f64.const\n000010d: 0000 0000 0000 0000                       ; f64 literal\n0000115: 44                                        ; f64.const\n0000116: 0000 0000 0000 0000                       ; f64 literal\n000011e: 64                                        ; f64.gt\n000011f: 1a                                        ; drop\n0000120: 44                                        ; f64.const\n0000121: 0000 0000 0000 0000                       ; f64 literal\n0000129: 44                                        ; f64.const\n000012a: 0000 0000 0000 0000                       ; f64 literal\n0000132: 66                                        ; f64.ge\n0000133: 1a                                        ; drop\n0000134: 0b                                        ; end\n; move data: [16, 135) -> [17, 136)\n0000015: 9f02                                      ; FIXUP func body size\n; move data: [14, 136) -> [15, 137)\n0000013: a202                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ncompare.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 41 00                      | i32.const 0\n 00001b: 41 00                      | i32.const 0\n 00001d: 4f                         | i32.ge_u\n 00001e: 41 00                      | i32.const 0\n 000020: 4e                         | i32.ge_s\n 000021: 41 00                      | i32.const 0\n 000023: 4b                         | i32.gt_u\n 000024: 41 00                      | i32.const 0\n 000026: 4a                         | i32.gt_s\n 000027: 41 00                      | i32.const 0\n 000029: 4d                         | i32.le_u\n 00002a: 41 00                      | i32.const 0\n 00002c: 4c                         | i32.le_s\n 00002d: 41 00                      | i32.const 0\n 00002f: 49                         | i32.lt_u\n 000030: 41 00                      | i32.const 0\n 000032: 48                         | i32.lt_s\n 000033: 41 00                      | i32.const 0\n 000035: 47                         | i32.ne\n 000036: 41 00                      | i32.const 0\n 000038: 46                         | i32.eq\n 000039: 1a                         | drop\n 00003a: 42 00                      | i64.const 0\n 00003c: 42 00                      | i64.const 0\n 00003e: 51                         | i64.eq\n 00003f: 1a                         | drop\n 000040: 42 00                      | i64.const 0\n 000042: 42 00                      | i64.const 0\n 000044: 52                         | i64.ne\n 000045: 1a                         | drop\n 000046: 42 00                      | i64.const 0\n 000048: 42 00                      | i64.const 0\n 00004a: 53                         | i64.lt_s\n 00004b: 1a                         | drop\n 00004c: 42 00                      | i64.const 0\n 00004e: 42 00                      | i64.const 0\n 000050: 54                         | i64.lt_u\n 000051: 1a                         | drop\n 000052: 42 00                      | i64.const 0\n 000054: 42 00                      | i64.const 0\n 000056: 57                         | i64.le_s\n 000057: 1a                         | drop\n 000058: 42 00                      | i64.const 0\n 00005a: 42 00                      | i64.const 0\n 00005c: 58                         | i64.le_u\n 00005d: 1a                         | drop\n 00005e: 42 00                      | i64.const 0\n 000060: 42 00                      | i64.const 0\n 000062: 55                         | i64.gt_s\n 000063: 1a                         | drop\n 000064: 42 00                      | i64.const 0\n 000066: 42 00                      | i64.const 0\n 000068: 56                         | i64.gt_u\n 000069: 1a                         | drop\n 00006a: 42 00                      | i64.const 0\n 00006c: 42 00                      | i64.const 0\n 00006e: 59                         | i64.ge_s\n 00006f: 1a                         | drop\n 000070: 42 00                      | i64.const 0\n 000072: 42 00                      | i64.const 0\n 000074: 5a                         | i64.ge_u\n 000075: 1a                         | drop\n 000076: 43 00 00 00 00             | f32.const 0x0p+0\n 00007b: 43 00 00 00 00             | f32.const 0x0p+0\n 000080: 5b                         | f32.eq\n 000081: 1a                         | drop\n 000082: 43 00 00 00 00             | f32.const 0x0p+0\n 000087: 43 00 00 00 00             | f32.const 0x0p+0\n 00008c: 5c                         | f32.ne\n 00008d: 1a                         | drop\n 00008e: 43 00 00 00 00             | f32.const 0x0p+0\n 000093: 43 00 00 00 00             | f32.const 0x0p+0\n 000098: 5d                         | f32.lt\n 000099: 1a                         | drop\n 00009a: 43 00 00 00 00             | f32.const 0x0p+0\n 00009f: 43 00 00 00 00             | f32.const 0x0p+0\n 0000a4: 5f                         | f32.le\n 0000a5: 1a                         | drop\n 0000a6: 43 00 00 00 00             | f32.const 0x0p+0\n 0000ab: 43 00 00 00 00             | f32.const 0x0p+0\n 0000b0: 5e                         | f32.gt\n 0000b1: 1a                         | drop\n 0000b2: 43 00 00 00 00             | f32.const 0x0p+0\n 0000b7: 43 00 00 00 00             | f32.const 0x0p+0\n 0000bc: 60                         | f32.ge\n 0000bd: 1a                         | drop\n 0000be: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000c7: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000d0: 61                         | f64.eq\n 0000d1: 1a                         | drop\n 0000d2: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000db: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000e4: 62                         | f64.ne\n 0000e5: 1a                         | drop\n 0000e6: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000ef: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000f8: 63                         | f64.lt\n 0000f9: 1a                         | drop\n 0000fa: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000103: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 00010c: 65                         | f64.le\n 00010d: 1a                         | drop\n 00010e: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000117: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000120: 64                         | f64.gt\n 000121: 1a                         | drop\n 000122: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 00012b: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000134: 66                         | f64.ge\n 000135: 1a                         | drop\n 000136: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/const.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    drop\n    i32.const -2147483648\n    drop\n    i32.const 4294967295\n    drop\n    i32.const -0x80000000\n    drop\n    i32.const 0xffffffff\n    drop\n    i64.const 0\n    drop\n    i64.const -9223372036854775808\n    drop\n    i64.const 18446744073709551615\n    drop\n    i64.const -0x8000000000000000\n    drop\n    i64.const 0xffffffffffffffff\n    drop\n    f32.const 0.0\n    drop\n    f32.const 1e23\n    drop\n    f32.const 1.234567e-5\n    drop\n    f32.const nan\n    drop\n    f32.const -nan\n    drop\n    f32.const +nan\n    drop\n    f32.const nan:0xabc\n    drop\n    f32.const -nan:0xabc\n    drop\n    f32.const +nan:0xabc\n    drop\n    f32.const inf\n    drop\n    f32.const -inf\n    drop\n    f32.const +inf\n    drop\n    f32.const -0x1p-1\n    drop\n    f32.const 0x1.921fb6p+2\n    drop\n    f64.const 0.0\n    drop\n    f64.const -0.987654321\n    drop\n    f64.const 6.283185307179586\n    drop\n    f64.const nan\n    drop\n    f64.const -nan\n    drop\n    f64.const +nan\n    drop\n    f64.const nan:0xabc\n    drop\n    f64.const -nan:0xabc\n    drop\n    f64.const +nan:0xabc\n    drop\n    f64.const inf\n    drop\n    f64.const -inf\n    drop\n    f64.const +inf\n    drop\n    f64.const -0x1p-1\n    drop\n    f64.const 0x1.921fb54442d18p+2\n    drop ))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: 1a                                        ; drop\n000001a: 41                                        ; i32.const\n000001b: 8080 8080 78                              ; i32 literal\n0000020: 1a                                        ; drop\n0000021: 41                                        ; i32.const\n0000022: 7f                                        ; i32 literal\n0000023: 1a                                        ; drop\n0000024: 41                                        ; i32.const\n0000025: 8080 8080 78                              ; i32 literal\n000002a: 1a                                        ; drop\n000002b: 41                                        ; i32.const\n000002c: 7f                                        ; i32 literal\n000002d: 1a                                        ; drop\n000002e: 42                                        ; i64.const\n000002f: 00                                        ; i64 literal\n0000030: 1a                                        ; drop\n0000031: 42                                        ; i64.const\n0000032: 8080 8080 8080 8080 807f                  ; i64 literal\n000003c: 1a                                        ; drop\n000003d: 42                                        ; i64.const\n000003e: 7f                                        ; i64 literal\n000003f: 1a                                        ; drop\n0000040: 42                                        ; i64.const\n0000041: 8080 8080 8080 8080 807f                  ; i64 literal\n000004b: 1a                                        ; drop\n000004c: 42                                        ; i64.const\n000004d: 7f                                        ; i64 literal\n000004e: 1a                                        ; drop\n000004f: 43                                        ; f32.const\n0000050: 0000 0000                                 ; f32 literal\n0000054: 1a                                        ; drop\n0000055: 43                                        ; f32.const\n0000056: 1668 a965                                 ; f32 literal\n000005a: 1a                                        ; drop\n000005b: 43                                        ; f32.const\n000005c: 4020 4f37                                 ; f32 literal\n0000060: 1a                                        ; drop\n0000061: 43                                        ; f32.const\n0000062: 0000 c07f                                 ; f32 literal\n0000066: 1a                                        ; drop\n0000067: 43                                        ; f32.const\n0000068: 0000 c0ff                                 ; f32 literal\n000006c: 1a                                        ; drop\n000006d: 43                                        ; f32.const\n000006e: 0000 c07f                                 ; f32 literal\n0000072: 1a                                        ; drop\n0000073: 43                                        ; f32.const\n0000074: bc0a 807f                                 ; f32 literal\n0000078: 1a                                        ; drop\n0000079: 43                                        ; f32.const\n000007a: bc0a 80ff                                 ; f32 literal\n000007e: 1a                                        ; drop\n000007f: 43                                        ; f32.const\n0000080: bc0a 807f                                 ; f32 literal\n0000084: 1a                                        ; drop\n0000085: 43                                        ; f32.const\n0000086: 0000 807f                                 ; f32 literal\n000008a: 1a                                        ; drop\n000008b: 43                                        ; f32.const\n000008c: 0000 80ff                                 ; f32 literal\n0000090: 1a                                        ; drop\n0000091: 43                                        ; f32.const\n0000092: 0000 807f                                 ; f32 literal\n0000096: 1a                                        ; drop\n0000097: 43                                        ; f32.const\n0000098: 0000 00bf                                 ; f32 literal\n000009c: 1a                                        ; drop\n000009d: 43                                        ; f32.const\n000009e: db0f c940                                 ; f32 literal\n00000a2: 1a                                        ; drop\n00000a3: 44                                        ; f64.const\n00000a4: 0000 0000 0000 0000                       ; f64 literal\n00000ac: 1a                                        ; drop\n00000ad: 44                                        ; f64.const\n00000ae: b856 0e3c dd9a efbf                       ; f64 literal\n00000b6: 1a                                        ; drop\n00000b7: 44                                        ; f64.const\n00000b8: 182d 4454 fb21 1940                       ; f64 literal\n00000c0: 1a                                        ; drop\n00000c1: 44                                        ; f64.const\n00000c2: 0000 0000 0000 f87f                       ; f64 literal\n00000ca: 1a                                        ; drop\n00000cb: 44                                        ; f64.const\n00000cc: 0000 0000 0000 f8ff                       ; f64 literal\n00000d4: 1a                                        ; drop\n00000d5: 44                                        ; f64.const\n00000d6: 0000 0000 0000 f87f                       ; f64 literal\n00000de: 1a                                        ; drop\n00000df: 44                                        ; f64.const\n00000e0: bc0a 0000 0000 f07f                       ; f64 literal\n00000e8: 1a                                        ; drop\n00000e9: 44                                        ; f64.const\n00000ea: bc0a 0000 0000 f0ff                       ; f64 literal\n00000f2: 1a                                        ; drop\n00000f3: 44                                        ; f64.const\n00000f4: bc0a 0000 0000 f07f                       ; f64 literal\n00000fc: 1a                                        ; drop\n00000fd: 44                                        ; f64.const\n00000fe: 0000 0000 0000 f07f                       ; f64 literal\n0000106: 1a                                        ; drop\n0000107: 44                                        ; f64.const\n0000108: 0000 0000 0000 f0ff                       ; f64 literal\n0000110: 1a                                        ; drop\n0000111: 44                                        ; f64.const\n0000112: 0000 0000 0000 f07f                       ; f64 literal\n000011a: 1a                                        ; drop\n000011b: 44                                        ; f64.const\n000011c: 0000 0000 0000 e0bf                       ; f64 literal\n0000124: 1a                                        ; drop\n0000125: 44                                        ; f64.const\n0000126: 182d 4454 fb21 1940                       ; f64 literal\n000012e: 1a                                        ; drop\n000012f: 0b                                        ; end\n; move data: [16, 130) -> [17, 131)\n0000015: 9a02                                      ; FIXUP func body size\n; move data: [14, 131) -> [15, 132)\n0000013: 9d02                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nconst.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 41 00                      | i32.const 0\n 00001b: 1a                         | drop\n 00001c: 41 80 80 80 80 78          | i32.const 2147483648\n 000022: 1a                         | drop\n 000023: 41 7f                      | i32.const 4294967295\n 000025: 1a                         | drop\n 000026: 41 80 80 80 80 78          | i32.const 2147483648\n 00002c: 1a                         | drop\n 00002d: 41 7f                      | i32.const 4294967295\n 00002f: 1a                         | drop\n 000030: 42 00                      | i64.const 0\n 000032: 1a                         | drop\n 000033: 42 80 80 80 80 80 80 80 80 | i64.const 9223372036854775808\n 00003c: 80 7f                      | \n 00003e: 1a                         | drop\n 00003f: 42 7f                      | i64.const 18446744073709551615\n 000041: 1a                         | drop\n 000042: 42 80 80 80 80 80 80 80 80 | i64.const 9223372036854775808\n 00004b: 80 7f                      | \n 00004d: 1a                         | drop\n 00004e: 42 7f                      | i64.const 18446744073709551615\n 000050: 1a                         | drop\n 000051: 43 00 00 00 00             | f32.const 0x0p+0\n 000056: 1a                         | drop\n 000057: 43 16 68 a9 65             | f32.const 0x1.52d02cp+76\n 00005c: 1a                         | drop\n 00005d: 43 40 20 4f 37             | f32.const 0x1.9e408p-17\n 000062: 1a                         | drop\n 000063: 43 00 00 c0 7f             | f32.const nan\n 000068: 1a                         | drop\n 000069: 43 00 00 c0 ff             | f32.const -nan\n 00006e: 1a                         | drop\n 00006f: 43 00 00 c0 7f             | f32.const nan\n 000074: 1a                         | drop\n 000075: 43 bc 0a 80 7f             | f32.const nan:0xabc\n 00007a: 1a                         | drop\n 00007b: 43 bc 0a 80 ff             | f32.const -nan:0xabc\n 000080: 1a                         | drop\n 000081: 43 bc 0a 80 7f             | f32.const nan:0xabc\n 000086: 1a                         | drop\n 000087: 43 00 00 80 7f             | f32.const inf\n 00008c: 1a                         | drop\n 00008d: 43 00 00 80 ff             | f32.const -inf\n 000092: 1a                         | drop\n 000093: 43 00 00 80 7f             | f32.const inf\n 000098: 1a                         | drop\n 000099: 43 00 00 00 bf             | f32.const -0x1p-1\n 00009e: 1a                         | drop\n 00009f: 43 db 0f c9 40             | f32.const 0x1.921fb6p+2\n 0000a4: 1a                         | drop\n 0000a5: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 0000ae: 1a                         | drop\n 0000af: 44 b8 56 0e 3c dd 9a ef bf | f64.const -0x1.f9add3c0e56b8p-1\n 0000b8: 1a                         | drop\n 0000b9: 44 18 2d 44 54 fb 21 19 40 | f64.const 0x1.921fb54442d18p+2\n 0000c2: 1a                         | drop\n 0000c3: 44 00 00 00 00 00 00 f8 7f | f64.const nan\n 0000cc: 1a                         | drop\n 0000cd: 44 00 00 00 00 00 00 f8 ff | f64.const -nan\n 0000d6: 1a                         | drop\n 0000d7: 44 00 00 00 00 00 00 f8 7f | f64.const nan\n 0000e0: 1a                         | drop\n 0000e1: 44 bc 0a 00 00 00 00 f0 7f | f64.const nan:0xabc\n 0000ea: 1a                         | drop\n 0000eb: 44 bc 0a 00 00 00 00 f0 ff | f64.const -nan:0xabc\n 0000f4: 1a                         | drop\n 0000f5: 44 bc 0a 00 00 00 00 f0 7f | f64.const nan:0xabc\n 0000fe: 1a                         | drop\n 0000ff: 44 00 00 00 00 00 00 f0 7f | f64.const inf\n 000108: 1a                         | drop\n 000109: 44 00 00 00 00 00 00 f0 ff | f64.const -inf\n 000112: 1a                         | drop\n 000113: 44 00 00 00 00 00 00 f0 7f | f64.const inf\n 00011c: 1a                         | drop\n 00011d: 44 00 00 00 00 00 00 e0 bf | f64.const -0x1p-1\n 000126: 1a                         | drop\n 000127: 44 18 2d 44 54 fb 21 19 40 | f64.const 0x1.921fb54442d18p+2\n 000130: 1a                         | drop\n 000131: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/convert-sat.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    f32.const 0\n    i32.trunc_sat_f32_s\n    drop\n\n    f32.const 0\n    i32.trunc_sat_f32_u\n    drop\n\n    f64.const 0\n    i32.trunc_sat_f64_s\n    drop\n\n    f64.const 0\n    i32.trunc_sat_f64_u\n    drop\n\n    f32.const 0\n    i64.trunc_sat_f32_s\n    drop\n\n    f32.const 0\n    i64.trunc_sat_f32_u\n    drop\n\n    f64.const 0\n    i64.trunc_sat_f64_s\n    drop\n\n    f64.const 0\n    i64.trunc_sat_f64_u\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 43                                        ; f32.const\n0000018: 0000 0000                                 ; f32 literal\n000001c: fc                                        ; prefix\n000001d: 00                                        ; i32.trunc_sat_f32_s\n000001e: 1a                                        ; drop\n000001f: 43                                        ; f32.const\n0000020: 0000 0000                                 ; f32 literal\n0000024: fc                                        ; prefix\n0000025: 01                                        ; i32.trunc_sat_f32_u\n0000026: 1a                                        ; drop\n0000027: 44                                        ; f64.const\n0000028: 0000 0000 0000 0000                       ; f64 literal\n0000030: fc                                        ; prefix\n0000031: 02                                        ; i32.trunc_sat_f64_s\n0000032: 1a                                        ; drop\n0000033: 44                                        ; f64.const\n0000034: 0000 0000 0000 0000                       ; f64 literal\n000003c: fc                                        ; prefix\n000003d: 03                                        ; i32.trunc_sat_f64_u\n000003e: 1a                                        ; drop\n000003f: 43                                        ; f32.const\n0000040: 0000 0000                                 ; f32 literal\n0000044: fc                                        ; prefix\n0000045: 04                                        ; i64.trunc_sat_f32_s\n0000046: 1a                                        ; drop\n0000047: 43                                        ; f32.const\n0000048: 0000 0000                                 ; f32 literal\n000004c: fc                                        ; prefix\n000004d: 05                                        ; i64.trunc_sat_f32_u\n000004e: 1a                                        ; drop\n000004f: 44                                        ; f64.const\n0000050: 0000 0000 0000 0000                       ; f64 literal\n0000058: fc                                        ; prefix\n0000059: 06                                        ; i64.trunc_sat_f64_s\n000005a: 1a                                        ; drop\n000005b: 44                                        ; f64.const\n000005c: 0000 0000 0000 0000                       ; f64 literal\n0000064: fc                                        ; prefix\n0000065: 07                                        ; i64.trunc_sat_f64_u\n0000066: 1a                                        ; drop\n0000067: 0b                                        ; end\n0000015: 52                                        ; FIXUP func body size\n0000013: 54                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nconvert-sat.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 43 00 00 00 00             | f32.const 0x0p+0\n 00001c: fc 00                      | i32.trunc_sat_f32_s\n 00001e: 1a                         | drop\n 00001f: 43 00 00 00 00             | f32.const 0x0p+0\n 000024: fc 01                      | i32.trunc_sat_f32_u\n 000026: 1a                         | drop\n 000027: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000030: fc 02                      | i32.trunc_sat_f64_s\n 000032: 1a                         | drop\n 000033: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 00003c: fc 03                      | i32.trunc_sat_f64_u\n 00003e: 1a                         | drop\n 00003f: 43 00 00 00 00             | f32.const 0x0p+0\n 000044: fc 04                      | i64.trunc_sat_f32_s\n 000046: 1a                         | drop\n 000047: 43 00 00 00 00             | f32.const 0x0p+0\n 00004c: fc 05                      | i64.trunc_sat_f32_u\n 00004e: 1a                         | drop\n 00004f: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000058: fc 06                      | i64.trunc_sat_f64_s\n 00005a: 1a                         | drop\n 00005b: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000064: fc 07                      | i64.trunc_sat_f64_u\n 000066: 1a                         | drop\n 000067: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/convert.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    f64.convert_i32_u\n    i32.trunc_f64_u\n    f64.convert_i32_s\n    i32.trunc_f64_s\n    f32.convert_i32_u\n    i32.trunc_f32_u\n    f32.convert_i32_s\n    i32.trunc_f32_s\n    i64.extend_i32_u\n    i32.wrap_i64\n    drop\n     \n    i32.const 0\n    i64.extend_i32_s\n    f64.convert_i64_u\n    i64.trunc_f64_u\n    f64.convert_i64_s\n    i64.trunc_f64_s\n    f32.convert_i64_u\n    i64.trunc_f32_u\n    f32.convert_i64_s\n    i64.trunc_f32_s\n    drop\n\n    f32.const 0\n    f64.promote_f32\n    f32.demote_f64\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: b8                                        ; f64.convert_i32_u\n000001a: ab                                        ; i32.trunc_f64_u\n000001b: b7                                        ; f64.convert_i32_s\n000001c: aa                                        ; i32.trunc_f64_s\n000001d: b3                                        ; f32.convert_i32_u\n000001e: a9                                        ; i32.trunc_f32_u\n000001f: b2                                        ; f32.convert_i32_s\n0000020: a8                                        ; i32.trunc_f32_s\n0000021: ad                                        ; i64.extend_i32_u\n0000022: a7                                        ; i32.wrap_i64\n0000023: 1a                                        ; drop\n0000024: 41                                        ; i32.const\n0000025: 00                                        ; i32 literal\n0000026: ac                                        ; i64.extend_i32_s\n0000027: ba                                        ; f64.convert_i64_u\n0000028: b1                                        ; i64.trunc_f64_u\n0000029: b9                                        ; f64.convert_i64_s\n000002a: b0                                        ; i64.trunc_f64_s\n000002b: b5                                        ; f32.convert_i64_u\n000002c: af                                        ; i64.trunc_f32_u\n000002d: b4                                        ; f32.convert_i64_s\n000002e: ae                                        ; i64.trunc_f32_s\n000002f: 1a                                        ; drop\n0000030: 43                                        ; f32.const\n0000031: 0000 0000                                 ; f32 literal\n0000035: bb                                        ; f64.promote_f32\n0000036: b6                                        ; f32.demote_f64\n0000037: 1a                                        ; drop\n0000038: 0b                                        ; end\n0000015: 23                                        ; FIXUP func body size\n0000013: 25                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nconvert.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 41 00                      | i32.const 0\n 000019: b8                         | f64.convert_i32_u\n 00001a: ab                         | i32.trunc_f64_u\n 00001b: b7                         | f64.convert_i32_s\n 00001c: aa                         | i32.trunc_f64_s\n 00001d: b3                         | f32.convert_i32_u\n 00001e: a9                         | i32.trunc_f32_u\n 00001f: b2                         | f32.convert_i32_s\n 000020: a8                         | i32.trunc_f32_s\n 000021: ad                         | i64.extend_i32_u\n 000022: a7                         | i32.wrap_i64\n 000023: 1a                         | drop\n 000024: 41 00                      | i32.const 0\n 000026: ac                         | i64.extend_i32_s\n 000027: ba                         | f64.convert_i64_u\n 000028: b1                         | i64.trunc_f64_u\n 000029: b9                         | f64.convert_i64_s\n 00002a: b0                         | i64.trunc_f64_s\n 00002b: b5                         | f32.convert_i64_u\n 00002c: af                         | i64.trunc_f32_u\n 00002d: b4                         | f32.convert_i64_s\n 00002e: ae                         | i64.trunc_f32_s\n 00002f: 1a                         | drop\n 000030: 43 00 00 00 00             | f32.const 0x0p+0\n 000035: bb                         | f64.promote_f32\n 000036: b6                         | f32.demote_f64\n 000037: 1a                         | drop\n 000038: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/data-count-section-removed.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS1: -hx\n(module\n  (memory 1)\n  (data \"hi\")\n  ;; No data count section, since there is no instruction that requires it.\n)\n(;; STDOUT ;;;\n\ndata-count-section-removed.wasm:\tfile format wasm 0x1\n\nSections:\n\n   Memory start=0x0000000a end=0x0000000d (size=0x00000003) count: 1\n     Data start=0x0000000f end=0x00000014 (size=0x00000005) count: 1\n\nSection Details:\n\nMemory[1]:\n - memory[0] pages: initial=1\nData[1]:\n - segment[0] passive size=2\n  - 0000000: 6869                                     hi\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/data-count-section.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS1: -hx\n(module\n  (memory 1)\n  (data \"hi\")\n\n  ;; include an instruction that requires the DataCount section, otherwise it\n  ;; will be removed.\n  (func data.drop 0)\n)\n(;; STDOUT ;;;\n\ndata-count-section.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000e (size=0x00000004) count: 1\n Function start=0x00000010 end=0x00000012 (size=0x00000002) count: 1\n   Memory start=0x00000014 end=0x00000017 (size=0x00000003) count: 1\nDataCount start=0x00000019 end=0x0000001a (size=0x00000001) count: 1\n     Code start=0x0000001c end=0x00000023 (size=0x00000007) count: 1\n     Data start=0x00000025 end=0x0000002a (size=0x00000005) count: 1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nFunction[1]:\n - func[0] sig=0\nMemory[1]:\n - memory[0] pages: initial=1\nDataCount:\n - data count: 1\nCode[1]:\n - func[0] size=5\nData[1]:\n - segment[0] passive size=2\n  - 0000000: 6869                                     hi\n\nCode Disassembly:\n\n00001e func[0]:\n 00001f: fc 09 00                   | data.drop 0\n 000022: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/debug-import-names.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --debug-names\n;;; ARGS1: --headers -x\n(module\n  (import \"bar\" \"foo\" (func $foo)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Import\" (2)\n000000e: 02                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num imports\n; import header 0\n0000011: 03                                        ; string length\n0000012: 6261 72                                  bar  ; import module name\n0000015: 03                                        ; string length\n0000016: 666f 6f                                  foo  ; import field name\n0000019: 00                                        ; import kind\n000001a: 00                                        ; import signature index\n000000f: 0b                                        ; FIXUP section size\n; section \"name\"\n000001b: 00                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 04                                        ; string length\n000001e: 6e61 6d65                                name  ; custom section name\n0000022: 01                                        ; name subsection type\n0000023: 00                                        ; subsection size (guess)\n0000024: 01                                        ; num names\n0000025: 00                                        ; elem index\n0000026: 03                                        ; string length\n0000027: 666f 6f                                  foo  ; elem name 0\n0000023: 06                                        ; FIXUP subsection size\n000002a: 02                                        ; local name type\n000002b: 00                                        ; subsection size (guess)\n000002c: 01                                        ; num functions\n000002d: 00                                        ; function index\n000002e: 00                                        ; num locals\n000002b: 03                                        ; FIXUP subsection size\n000001c: 12                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ndebug-import-names.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000e (size=0x00000004) count: 1\n   Import start=0x00000010 end=0x0000001b (size=0x0000000b) count: 1\n   Custom start=0x0000001d end=0x0000002f (size=0x00000012) \"name\"\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nImport[1]:\n - func[0] sig=0 <foo> <- bar.foo\nCustom:\n - name: \"name\"\n - func[0] <foo>\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/debug-names.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --debug-names\n;;; ARGS1: -x\n(module\n  (func $F1 (param $F1P0 i32)\n    (local $F1L1 f32)\n    (local $F1L2 i32)\n    (local i32))\n\n  ;; An unnamed function with a named param\n  (func (param $F2P0 f32))\n\n  (func $F2 (param $F3P0 f32)\n    (local $F3L1 f64)\n    (local i64)\n    (local $F3L3 i64)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 01                                        ; num params\n0000011: 7d                                        ; f32\n0000012: 00                                        ; num results\n0000009: 09                                        ; FIXUP section size\n; section \"Function\" (3)\n0000013: 03                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 03                                        ; num functions\n0000016: 00                                        ; function 0 signature index\n0000017: 01                                        ; function 1 signature index\n0000018: 01                                        ; function 2 signature index\n0000014: 04                                        ; FIXUP section size\n; section \"Code\" (10)\n0000019: 0a                                        ; section code\n000001a: 00                                        ; section size (guess)\n000001b: 03                                        ; num functions\n; function body 0\n000001c: 00                                        ; func body size (guess)\n000001d: 02                                        ; local decl count\n000001e: 01                                        ; local type count\n000001f: 7d                                        ; f32\n0000020: 02                                        ; local type count\n0000021: 7f                                        ; i32\n0000022: 0b                                        ; end\n000001c: 06                                        ; FIXUP func body size\n; function body 1\n0000023: 00                                        ; func body size (guess)\n0000024: 00                                        ; local decl count\n0000025: 0b                                        ; end\n0000023: 02                                        ; FIXUP func body size\n; function body 2\n0000026: 00                                        ; func body size (guess)\n0000027: 02                                        ; local decl count\n0000028: 01                                        ; local type count\n0000029: 7c                                        ; f64\n000002a: 02                                        ; local type count\n000002b: 7e                                        ; i64\n000002c: 0b                                        ; end\n0000026: 06                                        ; FIXUP func body size\n000001a: 12                                        ; FIXUP section size\n; section \"name\"\n000002d: 00                                        ; section code\n000002e: 00                                        ; section size (guess)\n000002f: 04                                        ; string length\n0000030: 6e61 6d65                                name  ; custom section name\n0000034: 01                                        ; name subsection type\n0000035: 00                                        ; subsection size (guess)\n0000036: 02                                        ; num names\n0000037: 00                                        ; elem index\n0000038: 02                                        ; string length\n0000039: 4631                                     F1  ; elem name 0\n000003b: 02                                        ; elem index\n000003c: 02                                        ; string length\n000003d: 4632                                     F2  ; elem name 2\n0000035: 09                                        ; FIXUP subsection size\n000003f: 02                                        ; local name type\n0000040: 00                                        ; subsection size (guess)\n0000041: 03                                        ; num functions\n0000042: 00                                        ; function index\n0000043: 03                                        ; num locals\n0000044: 00                                        ; local index\n0000045: 04                                        ; string length\n0000046: 4631 5030                                F1P0  ; local name 0\n000004a: 01                                        ; local index\n000004b: 04                                        ; string length\n000004c: 4631 4c31                                F1L1  ; local name 1\n0000050: 02                                        ; local index\n0000051: 04                                        ; string length\n0000052: 4631 4c32                                F1L2  ; local name 2\n0000056: 01                                        ; function index\n0000057: 01                                        ; num locals\n0000058: 00                                        ; local index\n0000059: 04                                        ; string length\n000005a: 4632 5030                                F2P0  ; local name 0\n000005e: 02                                        ; function index\n000005f: 03                                        ; num locals\n0000060: 00                                        ; local index\n0000061: 04                                        ; string length\n0000062: 4633 5030                                F3P0  ; local name 0\n0000066: 01                                        ; local index\n0000067: 04                                        ; string length\n0000068: 4633 4c31                                F3L1  ; local name 1\n000006c: 03                                        ; local index\n000006d: 04                                        ; string length\n000006e: 4633 4c33                                F3L3  ; local name 3\n0000040: 31                                        ; FIXUP subsection size\n000002e: 43                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ndebug-names.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[2]:\n - type[0] (i32) -> nil\n - type[1] (f32) -> nil\nFunction[3]:\n - func[0] sig=0 <F1>\n - func[1] sig=1\n - func[2] sig=1 <F2>\nCode[3]:\n - func[0] size=6 <F1>\n - func[1] size=2\n - func[2] size=6 <F2>\nCustom:\n - name: \"name\"\n - func[0] <F1>\n - func[2] <F2>\n - func[0] local[0] <F1P0>\n - func[0] local[1] <F1L1>\n - func[0] local[2] <F1L2>\n - func[1] local[0] <F2P0>\n - func[2] local[0] <F3P0>\n - func[2] local[1] <F3L1>\n - func[2] local[3] <F3L3>\n\nCode Disassembly:\n\n00001d func[0] <F1>:\n 00001e: 01 7d                      | local[1] type=f32\n 000020: 02 7f                      | local[2..3] type=i32\n 000022: 0b                         | end\n000024 func[1]:\n 000025: 0b                         | end\n000027 func[2] <F2>:\n 000028: 01 7c                      | local[1] type=f64\n 00002a: 02 7e                      | local[2..3] type=i64\n 00002c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/dedupe-sig.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (type (func (param i32) (result i64)))\n  (import \"foo\" \"bar\" (func (param i32) (result i64)))\n  (func (param i32) (result i64) \n    i64.const 0))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 01                                        ; num results\n000000f: 7e                                        ; i64\n0000009: 06                                        ; FIXUP section size\n; section \"Import\" (2)\n0000010: 02                                        ; section code\n0000011: 00                                        ; section size (guess)\n0000012: 01                                        ; num imports\n; import header 0\n0000013: 03                                        ; string length\n0000014: 666f 6f                                  foo  ; import module name\n0000017: 03                                        ; string length\n0000018: 6261 72                                  bar  ; import field name\n000001b: 00                                        ; import kind\n000001c: 00                                        ; import signature index\n0000011: 0b                                        ; FIXUP section size\n; section \"Function\" (3)\n000001d: 03                                        ; section code\n000001e: 00                                        ; section size (guess)\n000001f: 01                                        ; num functions\n0000020: 00                                        ; function 0 signature index\n000001e: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000021: 0a                                        ; section code\n0000022: 00                                        ; section size (guess)\n0000023: 01                                        ; num functions\n; function body 0\n0000024: 00                                        ; func body size (guess)\n0000025: 00                                        ; local decl count\n0000026: 42                                        ; i64.const\n0000027: 00                                        ; i64 literal\n0000028: 0b                                        ; end\n0000024: 04                                        ; FIXUP func body size\n0000022: 06                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ndedupe-sig.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000025 func[1]:\n 000026: 42 00                      | i64.const 0\n 000028: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/drop.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: 1a                                        ; drop\n000001a: 0b                                        ; end\n0000015: 05                                        ; FIXUP func body size\n0000013: 07                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ndrop.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 41 00                      | i32.const 0\n 000019: 1a                         | drop\n 00001a: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/elem-mvp-compat-named.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; NOTE: referring to table 0 by name should still be MVP compatible\n(module\n  (table $t 1 funcref)\n  (elem $t (i32.const 0)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Table\" (4)\n0000008: 04                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num tables\n; table 0\n000000b: 70                                        ; funcref\n000000c: 00                                        ; limits: flags\n000000d: 01                                        ; limits: initial\n0000009: 04                                        ; FIXUP section size\n; section \"Elem\" (9)\n000000e: 09                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num elem segments\n; elem segment header 0\n0000011: 00                                        ; segment flags\n0000012: 41                                        ; i32.const\n0000013: 00                                        ; i32 literal\n0000014: 0b                                        ; end\n0000015: 00                                        ; num elems\n000000f: 06                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nelem-mvp-compat-named.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/elem-mvp-compat.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; NOTE: using (table 0) syntax should still be MVP compatible when possible\n(module\n  (table 1 funcref)\n  (elem (table 0) (i32.const 0)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Table\" (4)\n0000008: 04                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num tables\n; table 0\n000000b: 70                                        ; funcref\n000000c: 00                                        ; limits: flags\n000000d: 01                                        ; limits: initial\n0000009: 04                                        ; FIXUP section size\n; section \"Elem\" (9)\n000000e: 09                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num elem segments\n; elem segment header 0\n0000011: 00                                        ; segment flags\n0000012: 41                                        ; i32.const\n0000013: 00                                        ; i32 literal\n0000014: 0b                                        ; end\n0000015: 00                                        ; num elems\n000000f: 06                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nelem-mvp-compat.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/export-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (nop))\n  (export \"a\" (func 0))\n  (export \"b\" (func 0)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Export\" (7)\n0000012: 07                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 02                                        ; num exports\n0000015: 01                                        ; string length\n0000016: 61                                       a  ; export name\n0000017: 00                                        ; export kind\n0000018: 00                                        ; export func index\n0000019: 01                                        ; string length\n000001a: 62                                       b  ; export name\n000001b: 00                                        ; export kind\n000001c: 00                                        ; export func index\n0000013: 09                                        ; FIXUP section size\n; section \"Code\" (10)\n000001d: 0a                                        ; section code\n000001e: 00                                        ; section size (guess)\n000001f: 01                                        ; num functions\n; function body 0\n0000020: 00                                        ; func body size (guess)\n0000021: 00                                        ; local decl count\n0000022: 01                                        ; nop\n0000023: 0b                                        ; end\n0000020: 03                                        ; FIXUP func body size\n000001e: 05                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nexport-multi.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000021 func[0] <b>:\n 000022: 01                         | nop\n 000023: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/expr-br.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (result i32)\n    block (result i32)\n      i32.const 1\n      br 0 \n    end))\n\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7f                                        ; i32\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000013: 0a                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num functions\n; function body 0\n0000016: 00                                        ; func body size (guess)\n0000017: 00                                        ; local decl count\n0000018: 02                                        ; block\n0000019: 7f                                        ; i32\n000001a: 41                                        ; i32.const\n000001b: 01                                        ; i32 literal\n000001c: 0c                                        ; br\n000001d: 00                                        ; break depth\n000001e: 0b                                        ; end\n000001f: 0b                                        ; end\n0000016: 09                                        ; FIXUP func body size\n0000014: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nexpr-br.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000017 func[0]:\n 000018: 02 7f                      | block i32\n 00001a: 41 01                      |   i32.const 1\n 00001c: 0c 00                      |   br 0\n 00001e: 0b                         | end\n 00001f: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/expr-brif.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (result i32)\n    block $exit (result i32)\n      i32.const 42\n      i32.const 0 \n      br_if $exit\n      drop\n      i32.const 29\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7f                                        ; i32\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000013: 0a                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num functions\n; function body 0\n0000016: 00                                        ; func body size (guess)\n0000017: 00                                        ; local decl count\n0000018: 02                                        ; block\n0000019: 7f                                        ; i32\n000001a: 41                                        ; i32.const\n000001b: 2a                                        ; i32 literal\n000001c: 41                                        ; i32.const\n000001d: 00                                        ; i32 literal\n000001e: 0d                                        ; br_if\n000001f: 00                                        ; break depth\n0000020: 1a                                        ; drop\n0000021: 41                                        ; i32.const\n0000022: 1d                                        ; i32 literal\n0000023: 0b                                        ; end\n0000024: 0b                                        ; end\n0000016: 0e                                        ; FIXUP func body size\n0000014: 10                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nexpr-brif.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000017 func[0]:\n 000018: 02 7f                      | block i32\n 00001a: 41 2a                      |   i32.const 42\n 00001c: 41 00                      |   i32.const 0\n 00001e: 0d 00                      |   br_if 0\n 000020: 1a                         |   drop\n 000021: 41 1d                      |   i32.const 29\n 000023: 0b                         | end\n 000024: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/extended-const.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --debug-names --enable-extended-const\n;;; ARGS1: -x\n(type $type1 (func (param i32)))\n(global $g_import (import \"foo\" \"bar\") i32)\n(table 1 funcref)\n(memory 1 1)\n(data (i32.add (global.get $g_import) (i32.const 42)) \"hello\")\n(elem (i32.mul (i32.const 4) (global.get $g_import)) func 0)\n(global (mut i32) (i32.sub (i32.const 44) (i32.const 3)))\n(global i32 (i32.const 45))\n(func)\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 00                                        ; num params\n0000011: 00                                        ; num results\n0000009: 08                                        ; FIXUP section size\n; section \"Import\" (2)\n0000012: 02                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num imports\n; import header 0\n0000015: 03                                        ; string length\n0000016: 666f 6f                                  foo  ; import module name\n0000019: 03                                        ; string length\n000001a: 6261 72                                  bar  ; import field name\n000001d: 03                                        ; import kind\n000001e: 7f                                        ; i32\n000001f: 00                                        ; global mutability\n0000013: 0c                                        ; FIXUP section size\n; section \"Function\" (3)\n0000020: 03                                        ; section code\n0000021: 00                                        ; section size (guess)\n0000022: 01                                        ; num functions\n0000023: 01                                        ; function 0 signature index\n0000021: 02                                        ; FIXUP section size\n; section \"Table\" (4)\n0000024: 04                                        ; section code\n0000025: 00                                        ; section size (guess)\n0000026: 01                                        ; num tables\n; table 0\n0000027: 70                                        ; funcref\n0000028: 00                                        ; limits: flags\n0000029: 01                                        ; limits: initial\n0000025: 04                                        ; FIXUP section size\n; section \"Memory\" (5)\n000002a: 05                                        ; section code\n000002b: 00                                        ; section size (guess)\n000002c: 01                                        ; num memories\n; memory 0\n000002d: 01                                        ; limits: flags\n000002e: 01                                        ; limits: initial\n000002f: 01                                        ; limits: max\n000002b: 04                                        ; FIXUP section size\n; section \"Global\" (6)\n0000030: 06                                        ; section code\n0000031: 00                                        ; section size (guess)\n0000032: 02                                        ; num globals\n0000033: 7f                                        ; i32\n0000034: 01                                        ; global mutability\n0000035: 41                                        ; i32.const\n0000036: 2c                                        ; i32 literal\n0000037: 41                                        ; i32.const\n0000038: 03                                        ; i32 literal\n0000039: 6b                                        ; i32.sub\n000003a: 0b                                        ; end\n000003b: 7f                                        ; i32\n000003c: 00                                        ; global mutability\n000003d: 41                                        ; i32.const\n000003e: 2d                                        ; i32 literal\n000003f: 0b                                        ; end\n0000031: 0e                                        ; FIXUP section size\n; section \"Elem\" (9)\n0000040: 09                                        ; section code\n0000041: 00                                        ; section size (guess)\n0000042: 01                                        ; num elem segments\n; elem segment header 0\n0000043: 00                                        ; segment flags\n0000044: 41                                        ; i32.const\n0000045: 04                                        ; i32 literal\n0000046: 23                                        ; global.get\n0000047: 00                                        ; global index\n0000048: 6c                                        ; i32.mul\n0000049: 0b                                        ; end\n000004a: 01                                        ; num elems\n000004b: 00                                        ; elem function index\n0000041: 0a                                        ; FIXUP section size\n; section \"DataCount\" (12)\n000004c: 0c                                        ; section code\n000004d: 00                                        ; section size (guess)\n000004e: 01                                        ; data count\n000004d: 01                                        ; FIXUP section size\n; section \"Code\" (10)\n000004f: 0a                                        ; section code\n0000050: 00                                        ; section size (guess)\n0000051: 01                                        ; num functions\n; function body 0\n0000052: 00                                        ; func body size (guess)\n0000053: 00                                        ; local decl count\n0000054: 0b                                        ; end\n0000052: 02                                        ; FIXUP func body size\n0000050: 04                                        ; FIXUP section size\n; move data: [4f, 55) -> [4c, 52)\n; truncate to 82 (0x52)\n; section \"Data\" (11)\n0000052: 0b                                        ; section code\n0000053: 00                                        ; section size (guess)\n0000054: 01                                        ; num data segments\n; data segment header 0\n0000055: 00                                        ; segment flags\n0000056: 23                                        ; global.get\n0000057: 00                                        ; global index\n0000058: 41                                        ; i32.const\n0000059: 2a                                        ; i32 literal\n000005a: 6a                                        ; i32.add\n000005b: 0b                                        ; end\n000005c: 05                                        ; data segment size\n; data segment data 0\n000005d: 6865 6c6c 6f                              ; data segment data\n0000053: 0e                                        ; FIXUP section size\n; section \"name\"\n0000062: 00                                        ; section code\n0000063: 00                                        ; section size (guess)\n0000064: 04                                        ; string length\n0000065: 6e61 6d65                                name  ; custom section name\n0000069: 02                                        ; local name type\n000006a: 00                                        ; subsection size (guess)\n000006b: 01                                        ; num functions\n000006c: 00                                        ; function index\n000006d: 00                                        ; num locals\n000006a: 03                                        ; FIXUP subsection size\n000006e: 04                                        ; name subsection type\n000006f: 00                                        ; subsection size (guess)\n0000070: 01                                        ; num names\n0000071: 00                                        ; elem index\n0000072: 05                                        ; string length\n0000073: 7479 7065 31                             type1  ; elem name 0\n000006f: 08                                        ; FIXUP subsection size\n0000078: 07                                        ; name subsection type\n0000079: 00                                        ; subsection size (guess)\n000007a: 01                                        ; num names\n000007b: 00                                        ; elem index\n000007c: 08                                        ; string length\n000007d: 675f 696d 706f 7274                      g_import  ; elem name 0\n0000079: 0b                                        ; FIXUP subsection size\n0000063: 21                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nextended-const.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[2]:\n - type[0] (i32) -> nil\n - type[1] () -> nil\nImport[1]:\n - global[0] i32 mutable=0 <- foo.bar\nFunction[1]:\n - func[0] sig=1\nTable[1]:\n - table[0] type=funcref initial=1\nMemory[1]:\n - memory[0] pages: initial=1 max=1\nGlobal[2]:\n - global[1] i32 mutable=1 - init (i32.const 44, i32.const 3, i32.sub)\n - global[2] i32 mutable=0 - init i32=45\nElem[1]:\n - segment[0] flags=0 table=0 count=1 - init (i32.const 4, global.get 0 <g_import>, i32.mul)\n  - elem[0] = ref.func:0\nCode[1]:\n - func[0] size=2\nData[1]:\n - segment[0] memory=0 size=5 - init (global.get 0 <g_import>, i32.const 42, i32.add)\n  - 0000000: 6865 6c6c 6f                             hello\nCustom:\n - name: \"name\"\n - type[0] <type1>\n - global[0] <g_import>\n\nCode Disassembly:\n\n000050 func[0]:\n 000051: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/extended-names.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --debug-names --enable-all\n;;; ARGS1: -x\n(type $type1 (func (param i32)))\n(table $table1 1 funcref)\n(table $table2 1 funcref)\n(memory $mem2 1 1)\n(data $data1 \"hello\")\n(tag $mytag1 (param i64))\n(tag $mytag2 (param i32))\n(func\n  i32.const 0\n  throw $mytag2\n  data.drop 0\n)\n(func\n  i32.const 0\n  i32.const 0\n  call_indirect $table1 (type $type1)\n)\n;; A function with locals but no params\n(func\n  (local $local1 i32)\n  (local $local2 i64)\n  i32.const 0\n  local.set 0\n  local.get 0\n  drop\n  i64.const 0\n  local.set 1\n  local.get 1\n  drop\n)\n;; A function with locals and params\n(func\n  (local $param1 i32)\n  (local $param2 i64)\n  (local $local1 i32)\n  (local $local2 i64)\n  i32.const 0\n  local.set 0\n  local.get 0\n  drop\n  i64.const 0\n  local.set 1\n  local.get 1\n  drop\n  i32.const 0\n  local.set 2\n  local.get 2\n  drop\n  i64.const 0\n  local.set 3\n  local.get 3\n  drop\n)\n\n(elem $elem1 func 0)\n(global $g1 (mut i32) (i32.const 1))\n(global $g2 i32 (i32.const 2))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 01                                        ; num params\n0000011: 7e                                        ; i64\n0000012: 00                                        ; num results\n; func type 2\n0000013: 60                                        ; func\n0000014: 00                                        ; num params\n0000015: 00                                        ; num results\n0000009: 0c                                        ; FIXUP section size\n; section \"Function\" (3)\n0000016: 03                                        ; section code\n0000017: 00                                        ; section size (guess)\n0000018: 04                                        ; num functions\n0000019: 02                                        ; function 0 signature index\n000001a: 02                                        ; function 1 signature index\n000001b: 02                                        ; function 2 signature index\n000001c: 02                                        ; function 3 signature index\n0000017: 05                                        ; FIXUP section size\n; section \"Table\" (4)\n000001d: 04                                        ; section code\n000001e: 00                                        ; section size (guess)\n000001f: 02                                        ; num tables\n; table 0\n0000020: 70                                        ; funcref\n0000021: 00                                        ; limits: flags\n0000022: 01                                        ; limits: initial\n; table 1\n0000023: 70                                        ; funcref\n0000024: 00                                        ; limits: flags\n0000025: 01                                        ; limits: initial\n000001e: 07                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000026: 05                                        ; section code\n0000027: 00                                        ; section size (guess)\n0000028: 01                                        ; num memories\n; memory 0\n0000029: 01                                        ; limits: flags\n000002a: 01                                        ; limits: initial\n000002b: 01                                        ; limits: max\n0000027: 04                                        ; FIXUP section size\n; section \"Tag\" (13)\n000002c: 0d                                        ; section code\n000002d: 00                                        ; section size (guess)\n000002e: 02                                        ; tag count\n; tag 0\n000002f: 00                                        ; tag attribute\n0000030: 01                                        ; tag signature index\n; tag 1\n0000031: 00                                        ; tag attribute\n0000032: 00                                        ; tag signature index\n000002d: 05                                        ; FIXUP section size\n; section \"Global\" (6)\n0000033: 06                                        ; section code\n0000034: 00                                        ; section size (guess)\n0000035: 02                                        ; num globals\n0000036: 7f                                        ; i32\n0000037: 01                                        ; global mutability\n0000038: 41                                        ; i32.const\n0000039: 01                                        ; i32 literal\n000003a: 0b                                        ; end\n000003b: 7f                                        ; i32\n000003c: 00                                        ; global mutability\n000003d: 41                                        ; i32.const\n000003e: 02                                        ; i32 literal\n000003f: 0b                                        ; end\n0000034: 0b                                        ; FIXUP section size\n; section \"Elem\" (9)\n0000040: 09                                        ; section code\n0000041: 00                                        ; section size (guess)\n0000042: 01                                        ; num elem segments\n; elem segment header 0\n0000043: 01                                        ; segment flags\n0000044: 00                                        ; elem list type\n0000045: 01                                        ; num elems\n0000046: 00                                        ; elem function index\n0000041: 05                                        ; FIXUP section size\n; section \"DataCount\" (12)\n0000047: 0c                                        ; section code\n0000048: 00                                        ; section size (guess)\n0000049: 01                                        ; data count\n0000048: 01                                        ; FIXUP section size\n; section \"Code\" (10)\n000004a: 0a                                        ; section code\n000004b: 00                                        ; section size (guess)\n000004c: 04                                        ; num functions\n; function body 0\n000004d: 00                                        ; func body size (guess)\n000004e: 00                                        ; local decl count\n000004f: 41                                        ; i32.const\n0000050: 00                                        ; i32 literal\n0000051: 08                                        ; throw\n0000052: 01                                        ; throw tag\n0000053: fc                                        ; prefix\n0000054: 09                                        ; data.drop\n0000055: 00                                        ; data.drop segment\n0000056: 0b                                        ; end\n000004d: 09                                        ; FIXUP func body size\n; function body 1\n0000057: 00                                        ; func body size (guess)\n0000058: 00                                        ; local decl count\n0000059: 41                                        ; i32.const\n000005a: 00                                        ; i32 literal\n000005b: 41                                        ; i32.const\n000005c: 00                                        ; i32 literal\n000005d: 11                                        ; call_indirect\n000005e: 00                                        ; signature index\n000005f: 00                                        ; table index\n0000060: 0b                                        ; end\n0000057: 09                                        ; FIXUP func body size\n; function body 2\n0000061: 00                                        ; func body size (guess)\n0000062: 02                                        ; local decl count\n0000063: 01                                        ; local type count\n0000064: 7f                                        ; i32\n0000065: 01                                        ; local type count\n0000066: 7e                                        ; i64\n0000067: 41                                        ; i32.const\n0000068: 00                                        ; i32 literal\n0000069: 21                                        ; local.set\n000006a: 00                                        ; local index\n000006b: 20                                        ; local.get\n000006c: 00                                        ; local index\n000006d: 1a                                        ; drop\n000006e: 42                                        ; i64.const\n000006f: 00                                        ; i64 literal\n0000070: 21                                        ; local.set\n0000071: 01                                        ; local index\n0000072: 20                                        ; local.get\n0000073: 01                                        ; local index\n0000074: 1a                                        ; drop\n0000075: 0b                                        ; end\n0000061: 14                                        ; FIXUP func body size\n; function body 3\n0000076: 00                                        ; func body size (guess)\n0000077: 04                                        ; local decl count\n0000078: 01                                        ; local type count\n0000079: 7f                                        ; i32\n000007a: 01                                        ; local type count\n000007b: 7e                                        ; i64\n000007c: 01                                        ; local type count\n000007d: 7f                                        ; i32\n000007e: 01                                        ; local type count\n000007f: 7e                                        ; i64\n0000080: 41                                        ; i32.const\n0000081: 00                                        ; i32 literal\n0000082: 21                                        ; local.set\n0000083: 00                                        ; local index\n0000084: 20                                        ; local.get\n0000085: 00                                        ; local index\n0000086: 1a                                        ; drop\n0000087: 42                                        ; i64.const\n0000088: 00                                        ; i64 literal\n0000089: 21                                        ; local.set\n000008a: 01                                        ; local index\n000008b: 20                                        ; local.get\n000008c: 01                                        ; local index\n000008d: 1a                                        ; drop\n000008e: 41                                        ; i32.const\n000008f: 00                                        ; i32 literal\n0000090: 21                                        ; local.set\n0000091: 02                                        ; local index\n0000092: 20                                        ; local.get\n0000093: 02                                        ; local index\n0000094: 1a                                        ; drop\n0000095: 42                                        ; i64.const\n0000096: 00                                        ; i64 literal\n0000097: 21                                        ; local.set\n0000098: 03                                        ; local index\n0000099: 20                                        ; local.get\n000009a: 03                                        ; local index\n000009b: 1a                                        ; drop\n000009c: 0b                                        ; end\n0000076: 26                                        ; FIXUP func body size\n000004b: 51                                        ; FIXUP section size\n; section \"Data\" (11)\n000009d: 0b                                        ; section code\n000009e: 00                                        ; section size (guess)\n000009f: 01                                        ; num data segments\n; data segment header 0\n00000a0: 01                                        ; segment flags\n00000a1: 05                                        ; data segment size\n; data segment data 0\n00000a2: 6865 6c6c 6f                              ; data segment data\n000009e: 08                                        ; FIXUP section size\n; section \"name\"\n00000a7: 00                                        ; section code\n00000a8: 00                                        ; section size (guess)\n00000a9: 04                                        ; string length\n00000aa: 6e61 6d65                                name  ; custom section name\n00000ae: 02                                        ; local name type\n00000af: 00                                        ; subsection size (guess)\n00000b0: 04                                        ; num functions\n00000b1: 00                                        ; function index\n00000b2: 00                                        ; num locals\n00000b3: 01                                        ; function index\n00000b4: 00                                        ; num locals\n00000b5: 02                                        ; function index\n00000b6: 02                                        ; num locals\n00000b7: 00                                        ; local index\n00000b8: 06                                        ; string length\n00000b9: 6c6f 6361 6c31                           local1  ; local name 0\n00000bf: 01                                        ; local index\n00000c0: 06                                        ; string length\n00000c1: 6c6f 6361 6c32                           local2  ; local name 1\n00000c7: 03                                        ; function index\n00000c8: 04                                        ; num locals\n00000c9: 00                                        ; local index\n00000ca: 06                                        ; string length\n00000cb: 7061 7261 6d31                           param1  ; local name 0\n00000d1: 01                                        ; local index\n00000d2: 06                                        ; string length\n00000d3: 7061 7261 6d32                           param2  ; local name 1\n00000d9: 02                                        ; local index\n00000da: 06                                        ; string length\n00000db: 6c6f 6361 6c31                           local1  ; local name 2\n00000e1: 03                                        ; local index\n00000e2: 06                                        ; string length\n00000e3: 6c6f 6361 6c32                           local2  ; local name 3\n00000af: 39                                        ; FIXUP subsection size\n00000e9: 04                                        ; name subsection type\n00000ea: 00                                        ; subsection size (guess)\n00000eb: 01                                        ; num names\n00000ec: 00                                        ; elem index\n00000ed: 05                                        ; string length\n00000ee: 7479 7065 31                             type1  ; elem name 0\n00000ea: 08                                        ; FIXUP subsection size\n00000f3: 05                                        ; name subsection type\n00000f4: 00                                        ; subsection size (guess)\n00000f5: 02                                        ; num names\n00000f6: 00                                        ; elem index\n00000f7: 06                                        ; string length\n00000f8: 7461 626c 6531                           table1  ; elem name 0\n00000fe: 01                                        ; elem index\n00000ff: 06                                        ; string length\n0000100: 7461 626c 6532                           table2  ; elem name 1\n00000f4: 11                                        ; FIXUP subsection size\n0000106: 06                                        ; name subsection type\n0000107: 00                                        ; subsection size (guess)\n0000108: 01                                        ; num names\n0000109: 00                                        ; elem index\n000010a: 04                                        ; string length\n000010b: 6d65 6d32                                mem2  ; elem name 0\n0000107: 07                                        ; FIXUP subsection size\n000010f: 07                                        ; name subsection type\n0000110: 00                                        ; subsection size (guess)\n0000111: 02                                        ; num names\n0000112: 00                                        ; elem index\n0000113: 02                                        ; string length\n0000114: 6731                                     g1  ; elem name 0\n0000116: 01                                        ; elem index\n0000117: 02                                        ; string length\n0000118: 6732                                     g2  ; elem name 1\n0000110: 09                                        ; FIXUP subsection size\n000011a: 08                                        ; name subsection type\n000011b: 00                                        ; subsection size (guess)\n000011c: 01                                        ; num names\n000011d: 00                                        ; elem index\n000011e: 05                                        ; string length\n000011f: 656c 656d 31                             elem1  ; elem name 0\n000011b: 08                                        ; FIXUP subsection size\n0000124: 09                                        ; name subsection type\n0000125: 00                                        ; subsection size (guess)\n0000126: 01                                        ; num names\n0000127: 00                                        ; elem index\n0000128: 05                                        ; string length\n0000129: 6461 7461 31                             data1  ; elem name 0\n0000125: 08                                        ; FIXUP subsection size\n000012e: 0b                                        ; name subsection type\n000012f: 00                                        ; subsection size (guess)\n0000130: 02                                        ; num names\n0000131: 00                                        ; elem index\n0000132: 06                                        ; string length\n0000133: 6d79 7461 6731                           mytag1  ; elem name 0\n0000139: 01                                        ; elem index\n000013a: 06                                        ; string length\n000013b: 6d79 7461 6732                           mytag2  ; elem name 1\n000012f: 11                                        ; FIXUP subsection size\n; move data: [a9, 141) -> [aa, 142)\n00000a8: 9801                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nextended-names.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[3]:\n - type[0] (i32) -> nil\n - type[1] (i64) -> nil\n - type[2] () -> nil\nFunction[4]:\n - func[0] sig=2\n - func[1] sig=2\n - func[2] sig=2\n - func[3] sig=2\nTable[2]:\n - table[0] type=funcref initial=1 <table1>\n - table[1] type=funcref initial=1 <table2>\nMemory[1]:\n - memory[0] pages: initial=1 max=1\nTag[2]:\n - tag[0] sig=1\n - tag[1] sig=0\nGlobal[2]:\n - global[0] i32 mutable=1 <g1> - init i32=1\n - global[1] i32 mutable=0 <g2> - init i32=2\nElem[1]:\n - segment[0] flags=1 table=0 count=1\n  - elem[0] = ref.func:0\nDataCount:\n - data count: 1\nCode[4]:\n - func[0] size=9\n - func[1] size=9\n - func[2] size=20\n - func[3] size=38\nData[1]:\n - segment[0] <data1> passive size=5\n  - 0000000: 6865 6c6c 6f                             hello\nCustom:\n - name: \"name\"\n - func[2] local[0] <local1>\n - func[2] local[1] <local2>\n - func[3] local[0] <param1>\n - func[3] local[1] <param2>\n - func[3] local[2] <local1>\n - func[3] local[3] <local2>\n - type[0] <type1>\n - table[0] <table1>\n - table[1] <table2>\n - memory[0] <mem2>\n - global[0] <g1>\n - global[1] <g2>\n - elemseg[0] <elem1>\n - dataseg[0] <data1>\n - tag[0] <mytag1>\n - tag[1] <mytag2>\n\nCode Disassembly:\n\n00004e func[0]:\n 00004f: 41 00                      | i32.const 0\n 000051: 08 01                      | throw 1 <mytag2>\n 000053: fc 09 00                   | data.drop 0 <data1>\n 000056: 0b                         | end\n000058 func[1]:\n 000059: 41 00                      | i32.const 0\n 00005b: 41 00                      | i32.const 0\n 00005d: 11 00 00                   | call_indirect 0 <table1> (type 0 <type1>)\n 000060: 0b                         | end\n000062 func[2]:\n 000063: 01 7f                      | local[0] type=i32\n 000065: 01 7e                      | local[1] type=i64\n 000067: 41 00                      | i32.const 0\n 000069: 21 00                      | local.set 0 <local1>\n 00006b: 20 00                      | local.get 0 <local1>\n 00006d: 1a                         | drop\n 00006e: 42 00                      | i64.const 0\n 000070: 21 01                      | local.set 1 <local2>\n 000072: 20 01                      | local.get 1 <local2>\n 000074: 1a                         | drop\n 000075: 0b                         | end\n000077 func[3]:\n 000078: 01 7f                      | local[0] type=i32\n 00007a: 01 7e                      | local[1] type=i64\n 00007c: 01 7f                      | local[2] type=i32\n 00007e: 01 7e                      | local[3] type=i64\n 000080: 41 00                      | i32.const 0\n 000082: 21 00                      | local.set 0 <param1>\n 000084: 20 00                      | local.get 0 <param1>\n 000086: 1a                         | drop\n 000087: 42 00                      | i64.const 0\n 000089: 21 01                      | local.set 1 <param2>\n 00008b: 20 01                      | local.get 1 <param2>\n 00008d: 1a                         | drop\n 00008e: 41 00                      | i32.const 0\n 000090: 21 02                      | local.set 2 <local1>\n 000092: 20 02                      | local.get 2 <local1>\n 000094: 1a                         | drop\n 000095: 42 00                      | i64.const 0\n 000097: 21 03                      | local.set 3 <local2>\n 000099: 20 03                      | local.get 3 <local2>\n 00009b: 1a                         | drop\n 00009c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/func-exported.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func)\n  (export \"foo\" (func 0)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Export\" (7)\n0000012: 07                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num exports\n0000015: 03                                        ; string length\n0000016: 666f 6f                                  foo  ; export name\n0000019: 00                                        ; export kind\n000001a: 00                                        ; export func index\n0000013: 07                                        ; FIXUP section size\n; section \"Code\" (10)\n000001b: 0a                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 01                                        ; num functions\n; function body 0\n000001e: 00                                        ; func body size (guess)\n000001f: 00                                        ; local decl count\n0000020: 0b                                        ; end\n000001e: 02                                        ; FIXUP func body size\n000001c: 04                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nfunc-exported.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001f func[0] <foo>:\n 000020: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/func-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func)\n  (func)\n  (func))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 03                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n0000012: 00                                        ; function 1 signature index\n0000013: 00                                        ; function 2 signature index\n000000f: 04                                        ; FIXUP section size\n; section \"Code\" (10)\n0000014: 0a                                        ; section code\n0000015: 00                                        ; section size (guess)\n0000016: 03                                        ; num functions\n; function body 0\n0000017: 00                                        ; func body size (guess)\n0000018: 00                                        ; local decl count\n0000019: 0b                                        ; end\n0000017: 02                                        ; FIXUP func body size\n; function body 1\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 0b                                        ; end\n000001a: 02                                        ; FIXUP func body size\n; function body 2\n000001d: 00                                        ; func body size (guess)\n000001e: 00                                        ; local decl count\n000001f: 0b                                        ; end\n000001d: 02                                        ; FIXUP func body size\n0000015: 0a                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nfunc-multi.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 0b                         | end\n00001b func[1]:\n 00001c: 0b                         | end\n00001e func[2]:\n 00001f: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/func-named.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func $my-func))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 0b                                        ; end\n0000015: 02                                        ; FIXUP func body size\n0000013: 04                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nfunc-named.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/func-result-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: -x\n(module\n  (func (result i32 i64)\n    i32.const 0\n    i64.const 0))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 02                                        ; num results\n000000e: 7f                                        ; i32\n000000f: 7e                                        ; i64\n0000009: 06                                        ; FIXUP section size\n; section \"Function\" (3)\n0000010: 03                                        ; section code\n0000011: 00                                        ; section size (guess)\n0000012: 01                                        ; num functions\n0000013: 00                                        ; function 0 signature index\n0000011: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000014: 0a                                        ; section code\n0000015: 00                                        ; section size (guess)\n0000016: 01                                        ; num functions\n; function body 0\n0000017: 00                                        ; func body size (guess)\n0000018: 00                                        ; local decl count\n0000019: 41                                        ; i32.const\n000001a: 00                                        ; i32 literal\n000001b: 42                                        ; i64.const\n000001c: 00                                        ; i64 literal\n000001d: 0b                                        ; end\n0000017: 06                                        ; FIXUP func body size\n0000015: 08                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nfunc-result-multi.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> (i32, i64)\nFunction[1]:\n - func[0] sig=0\nCode[1]:\n - func[0] size=6\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 41 00                      | i32.const 0\n 00001b: 42 00                      | i64.const 0\n 00001d: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/global.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: -x\n(module\n  (import \"foo\" \"i32_global\" (global i32))\n  (import \"foo\" \"i64_global\" (global i64))\n  (import \"foo\" \"f32_global\" (global f32))\n  (import \"foo\" \"f64_global\" (global f64))\n\n  (global i32 (i32.const 1))\n  (global i32 (i32.const -42))\n  (global i64 (i64.const 2))\n  (global i64 (i64.const -43))\n  (global f32 (f32.const 3))\n  (global f64 (f64.const 4))\n\n  (global i32 (global.get 0))\n  (global i64 (global.get 1))\n  (global f32 (global.get 2))\n  (global f64 (global.get 3)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Import\" (2)\n0000008: 02                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 04                                        ; num imports\n; import header 0\n000000b: 03                                        ; string length\n000000c: 666f 6f                                  foo  ; import module name\n000000f: 0a                                        ; string length\n0000010: 6933 325f 676c 6f62 616c                 i32_global  ; import field name\n000001a: 03                                        ; import kind\n000001b: 7f                                        ; i32\n000001c: 00                                        ; global mutability\n; import header 1\n000001d: 03                                        ; string length\n000001e: 666f 6f                                  foo  ; import module name\n0000021: 0a                                        ; string length\n0000022: 6936 345f 676c 6f62 616c                 i64_global  ; import field name\n000002c: 03                                        ; import kind\n000002d: 7e                                        ; i64\n000002e: 00                                        ; global mutability\n; import header 2\n000002f: 03                                        ; string length\n0000030: 666f 6f                                  foo  ; import module name\n0000033: 0a                                        ; string length\n0000034: 6633 325f 676c 6f62 616c                 f32_global  ; import field name\n000003e: 03                                        ; import kind\n000003f: 7d                                        ; f32\n0000040: 00                                        ; global mutability\n; import header 3\n0000041: 03                                        ; string length\n0000042: 666f 6f                                  foo  ; import module name\n0000045: 0a                                        ; string length\n0000046: 6636 345f 676c 6f62 616c                 f64_global  ; import field name\n0000050: 03                                        ; import kind\n0000051: 7c                                        ; f64\n0000052: 00                                        ; global mutability\n0000009: 49                                        ; FIXUP section size\n; section \"Global\" (6)\n0000053: 06                                        ; section code\n0000054: 00                                        ; section size (guess)\n0000055: 0a                                        ; num globals\n0000056: 7f                                        ; i32\n0000057: 00                                        ; global mutability\n0000058: 41                                        ; i32.const\n0000059: 01                                        ; i32 literal\n000005a: 0b                                        ; end\n000005b: 7f                                        ; i32\n000005c: 00                                        ; global mutability\n000005d: 41                                        ; i32.const\n000005e: 56                                        ; i32 literal\n000005f: 0b                                        ; end\n0000060: 7e                                        ; i64\n0000061: 00                                        ; global mutability\n0000062: 42                                        ; i64.const\n0000063: 02                                        ; i64 literal\n0000064: 0b                                        ; end\n0000065: 7e                                        ; i64\n0000066: 00                                        ; global mutability\n0000067: 42                                        ; i64.const\n0000068: 55                                        ; i64 literal\n0000069: 0b                                        ; end\n000006a: 7d                                        ; f32\n000006b: 00                                        ; global mutability\n000006c: 43                                        ; f32.const\n000006d: 0000 4040                                 ; f32 literal\n0000071: 0b                                        ; end\n0000072: 7c                                        ; f64\n0000073: 00                                        ; global mutability\n0000074: 44                                        ; f64.const\n0000075: 0000 0000 0000 1040                       ; f64 literal\n000007d: 0b                                        ; end\n000007e: 7f                                        ; i32\n000007f: 00                                        ; global mutability\n0000080: 23                                        ; global.get\n0000081: 00                                        ; global index\n0000082: 0b                                        ; end\n0000083: 7e                                        ; i64\n0000084: 00                                        ; global mutability\n0000085: 23                                        ; global.get\n0000086: 01                                        ; global index\n0000087: 0b                                        ; end\n0000088: 7d                                        ; f32\n0000089: 00                                        ; global mutability\n000008a: 23                                        ; global.get\n000008b: 02                                        ; global index\n000008c: 0b                                        ; end\n000008d: 7c                                        ; f64\n000008e: 00                                        ; global mutability\n000008f: 23                                        ; global.get\n0000090: 03                                        ; global index\n0000091: 0b                                        ; end\n0000054: 3d                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nglobal.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nImport[4]:\n - global[0] i32 mutable=0 <- foo.i32_global\n - global[1] i64 mutable=0 <- foo.i64_global\n - global[2] f32 mutable=0 <- foo.f32_global\n - global[3] f64 mutable=0 <- foo.f64_global\nGlobal[10]:\n - global[4] i32 mutable=0 - init i32=1\n - global[5] i32 mutable=0 - init i32=-42\n - global[6] i64 mutable=0 - init i64=2\n - global[7] i64 mutable=0 - init i64=-43\n - global[8] f32 mutable=0 - init f32=0x1.8p+1\n - global[9] f64 mutable=0 - init f64=0x1p+2\n - global[10] i32 mutable=0 - init global=0 <foo.i32_global>\n - global[11] i64 mutable=0 - init global=1 <foo.i64_global>\n - global[12] f32 mutable=0 - init global=2 <foo.f32_global>\n - global[13] f64 mutable=0 - init global=3 <foo.f64_global>\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/globalget.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (global i32 (i32.const 0))\n  (func (result i32)\n    global.get 0))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7f                                        ; i32\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Global\" (6)\n0000013: 06                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num globals\n0000016: 7f                                        ; i32\n0000017: 00                                        ; global mutability\n0000018: 41                                        ; i32.const\n0000019: 00                                        ; i32 literal\n000001a: 0b                                        ; end\n0000014: 06                                        ; FIXUP section size\n; section \"Code\" (10)\n000001b: 0a                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 01                                        ; num functions\n; function body 0\n000001e: 00                                        ; func body size (guess)\n000001f: 00                                        ; local decl count\n0000020: 23                                        ; global.get\n0000021: 00                                        ; global index\n0000022: 0b                                        ; end\n000001e: 04                                        ; FIXUP func body size\n000001c: 06                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nglobalget.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001f func[0]:\n 000020: 23 00                      | global.get 0\n 000022: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/globalset.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (global (mut f32) (f32.const 1))\n  (func\n    f32.const 2\n    global.set 0))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Global\" (6)\n0000012: 06                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num globals\n0000015: 7d                                        ; f32\n0000016: 01                                        ; global mutability\n0000017: 43                                        ; f32.const\n0000018: 0000 803f                                 ; f32 literal\n000001c: 0b                                        ; end\n0000013: 09                                        ; FIXUP section size\n; section \"Code\" (10)\n000001d: 0a                                        ; section code\n000001e: 00                                        ; section size (guess)\n000001f: 01                                        ; num functions\n; function body 0\n0000020: 00                                        ; func body size (guess)\n0000021: 00                                        ; local decl count\n0000022: 43                                        ; f32.const\n0000023: 0000 0040                                 ; f32 literal\n0000027: 24                                        ; global.set\n0000028: 00                                        ; global index\n0000029: 0b                                        ; end\n0000020: 09                                        ; FIXUP func body size\n000001e: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nglobalset.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000021 func[0]:\n 000022: 43 00 00 00 40             | f32.const 0x1p+1\n 000027: 24 00                      | global.set 0\n 000029: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/hexfloat_f32.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    f32.const 0x0p0\n    drop\n    f32.const 0x1234.5p6\n    drop\n    f32.const 0xffffffffp20\n    drop\n    f32.const 0x1p127\n    drop\n    f32.const 0x0.08p127\n    drop\n    f32.const 0x2.46p+123\n    drop\n    f32.const 0x0.fffffp127\n    drop\n    f32.const 0x0.7fffffp127\n    drop\n    f32.const 0x0.ffffffffp127\n    drop\n    f32.const 0x1.ffff88p127\n    drop\n    f32.const 0x1.fffff1p127\n    drop\n    f32.const 0xfffff98p-133\n    drop\n    f32.const 0xfffff88p-133\n    drop\n    f32.const 0xfffffffffp-155 \n    drop\n    f32.const 0x000000001.10000000000p0\n    drop\n    f32.const 0x1000000000.p4\n    drop\n    f32.const -0x1.ff01p1\n    drop\n  )\n)\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 43                                        ; f32.const\n0000018: 0000 0000                                 ; f32 literal\n000001c: 1a                                        ; drop\n000001d: 43                                        ; f32.const\n000001e: 80a2 9148                                 ; f32 literal\n0000022: 1a                                        ; drop\n0000023: 43                                        ; f32.const\n0000024: 0000 8059                                 ; f32 literal\n0000028: 1a                                        ; drop\n0000029: 43                                        ; f32.const\n000002a: 0000 007f                                 ; f32 literal\n000002e: 1a                                        ; drop\n000002f: 43                                        ; f32.const\n0000030: 0000 807c                                 ; f32 literal\n0000034: 1a                                        ; drop\n0000035: 43                                        ; f32.const\n0000036: 0080 917d                                 ; f32 literal\n000003a: 1a                                        ; drop\n000003b: 43                                        ; f32.const\n000003c: f0ff ff7e                                 ; f32 literal\n0000040: 1a                                        ; drop\n0000041: 43                                        ; f32.const\n0000042: feff 7f7e                                 ; f32 literal\n0000046: 1a                                        ; drop\n0000047: 43                                        ; f32.const\n0000048: 0000 007f                                 ; f32 literal\n000004c: 1a                                        ; drop\n000004d: 43                                        ; f32.const\n000004e: c4ff 7f7f                                 ; f32 literal\n0000052: 1a                                        ; drop\n0000053: 43                                        ; f32.const\n0000054: f8ff 7f7f                                 ; f32 literal\n0000058: 1a                                        ; drop\n0000059: 43                                        ; f32.const\n000005a: faff ff0a                                 ; f32 literal\n000005e: 1a                                        ; drop\n000005f: 43                                        ; f32.const\n0000060: f8ff ff0a                                 ; f32 literal\n0000064: 1a                                        ; drop\n0000065: 43                                        ; f32.const\n0000066: 0000 0004                                 ; f32 literal\n000006a: 1a                                        ; drop\n000006b: 43                                        ; f32.const\n000006c: 0000 883f                                 ; f32 literal\n0000070: 1a                                        ; drop\n0000071: 43                                        ; f32.const\n0000072: 0000 8053                                 ; f32 literal\n0000076: 1a                                        ; drop\n0000077: 43                                        ; f32.const\n0000078: 8080 7fc0                                 ; f32 literal\n000007c: 1a                                        ; drop\n000007d: 0b                                        ; end\n0000015: 68                                        ; FIXUP func body size\n0000013: 6a                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nhexfloat_f32.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 43 00 00 00 00             | f32.const 0x0p+0\n 00001c: 1a                         | drop\n 00001d: 43 80 a2 91 48             | f32.const 0x1.2345p+18\n 000022: 1a                         | drop\n 000023: 43 00 00 80 59             | f32.const 0x1p+52\n 000028: 1a                         | drop\n 000029: 43 00 00 00 7f             | f32.const 0x1p+127\n 00002e: 1a                         | drop\n 00002f: 43 00 00 80 7c             | f32.const 0x1p+122\n 000034: 1a                         | drop\n 000035: 43 00 80 91 7d             | f32.const 0x1.23p+124\n 00003a: 1a                         | drop\n 00003b: 43 f0 ff ff 7e             | f32.const 0x1.ffffep+126\n 000040: 1a                         | drop\n 000041: 43 fe ff 7f 7e             | f32.const 0x1.fffffcp+125\n 000046: 1a                         | drop\n 000047: 43 00 00 00 7f             | f32.const 0x1p+127\n 00004c: 1a                         | drop\n 00004d: 43 c4 ff 7f 7f             | f32.const 0x1.ffff88p+127\n 000052: 1a                         | drop\n 000053: 43 f8 ff 7f 7f             | f32.const 0x1.fffffp+127\n 000058: 1a                         | drop\n 000059: 43 fa ff ff 0a             | f32.const 0x1.fffff4p-106\n 00005e: 1a                         | drop\n 00005f: 43 f8 ff ff 0a             | f32.const 0x1.fffffp-106\n 000064: 1a                         | drop\n 000065: 43 00 00 00 04             | f32.const 0x1p-119\n 00006a: 1a                         | drop\n 00006b: 43 00 00 88 3f             | f32.const 0x1.1p+0\n 000070: 1a                         | drop\n 000071: 43 00 00 80 53             | f32.const 0x1p+40\n 000076: 1a                         | drop\n 000077: 43 80 80 7f c0             | f32.const -0x1.ff01p+1\n 00007c: 1a                         | drop\n 00007d: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/hexfloat_f64.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    f64.const 0x0p0\n    drop\n    f64.const 0x1234.5p6 \n    drop\n    f64.const 0xffffffffffffffffp20\n    drop\n    f64.const 0x1p1023\n    drop\n    f64.const 0x0.08p1023\n    drop\n    f64.const 0x2.46p+1020\n    drop\n    f64.const 0x0.ffffffffffp1023\n    drop\n    f64.const 0x0.7fffffffffffp1023\n    drop\n    f64.const 0x0.ffffffffffffffffp1023\n    drop\n    f64.const 0x1.ffffffffffffcp1023\n    drop\n    f64.const 0x1.ffffffffffffep1023\n    drop\n    f64.const 0xffffffffffff88p-1033\n    drop\n    f64.const 0xffffffffffff98p-1033\n    drop\n    f64.const 0xffffffffffffffp-1055\n    drop\n    f64.const 0x000000001.10000000000p0\n    drop\n    f64.const 0x1000000000.p4\n    drop\n    f64.const -0x1.ff01p1\n    drop\n  )\n)\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 44                                        ; f64.const\n0000018: 0000 0000 0000 0000                       ; f64 literal\n0000020: 1a                                        ; drop\n0000021: 44                                        ; f64.const\n0000022: 0000 0000 5034 1241                       ; f64 literal\n000002a: 1a                                        ; drop\n000002b: 44                                        ; f64.const\n000002c: 0000 0000 0000 3045                       ; f64 literal\n0000034: 1a                                        ; drop\n0000035: 44                                        ; f64.const\n0000036: 0000 0000 0000 e07f                       ; f64 literal\n000003e: 1a                                        ; drop\n000003f: 44                                        ; f64.const\n0000040: 0000 0000 0000 907f                       ; f64 literal\n0000048: 1a                                        ; drop\n0000049: 44                                        ; f64.const\n000004a: 0000 0000 0030 c27f                       ; f64 literal\n0000052: 1a                                        ; drop\n0000053: 44                                        ; f64.const\n0000054: 00e0 ffff ffff df7f                       ; f64 literal\n000005c: 1a                                        ; drop\n000005d: 44                                        ; f64.const\n000005e: c0ff ffff ffff cf7f                       ; f64 literal\n0000066: 1a                                        ; drop\n0000067: 44                                        ; f64.const\n0000068: 0000 0000 0000 e07f                       ; f64 literal\n0000070: 1a                                        ; drop\n0000071: 44                                        ; f64.const\n0000072: fcff ffff ffff ef7f                       ; f64 literal\n000007a: 1a                                        ; drop\n000007b: 44                                        ; f64.const\n000007c: feff ffff ffff ef7f                       ; f64 literal\n0000084: 1a                                        ; drop\n0000085: 44                                        ; f64.const\n0000086: f1ff ffff ffff df02                       ; f64 literal\n000008e: 1a                                        ; drop\n000008f: 44                                        ; f64.const\n0000090: f3ff ffff ffff df02                       ; f64 literal\n0000098: 1a                                        ; drop\n0000099: 44                                        ; f64.const\n000009a: 0000 0000 0000 8001                       ; f64 literal\n00000a2: 1a                                        ; drop\n00000a3: 44                                        ; f64.const\n00000a4: 0000 0000 0000 f13f                       ; f64 literal\n00000ac: 1a                                        ; drop\n00000ad: 44                                        ; f64.const\n00000ae: 0000 0000 0000 7042                       ; f64 literal\n00000b6: 1a                                        ; drop\n00000b7: 44                                        ; f64.const\n00000b8: 0000 0000 10f0 0fc0                       ; f64 literal\n00000c0: 1a                                        ; drop\n00000c1: 0b                                        ; end\n; move data: [16, c2) -> [17, c3)\n0000015: ac01                                      ; FIXUP func body size\n; move data: [14, c3) -> [15, c4)\n0000013: af01                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nhexfloat_f64.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000022: 1a                         | drop\n 000023: 44 00 00 00 00 50 34 12 41 | f64.const 0x1.2345p+18\n 00002c: 1a                         | drop\n 00002d: 44 00 00 00 00 00 00 30 45 | f64.const 0x1p+84\n 000036: 1a                         | drop\n 000037: 44 00 00 00 00 00 00 e0 7f | f64.const 0x1p+1023\n 000040: 1a                         | drop\n 000041: 44 00 00 00 00 00 00 90 7f | f64.const 0x1p+1018\n 00004a: 1a                         | drop\n 00004b: 44 00 00 00 00 00 30 c2 7f | f64.const 0x1.23p+1021\n 000054: 1a                         | drop\n 000055: 44 00 e0 ff ff ff ff df 7f | f64.const 0x1.fffffffffep+1022\n 00005e: 1a                         | drop\n 00005f: 44 c0 ff ff ff ff ff cf 7f | f64.const 0x1.fffffffffffcp+1021\n 000068: 1a                         | drop\n 000069: 44 00 00 00 00 00 00 e0 7f | f64.const 0x1p+1023\n 000072: 1a                         | drop\n 000073: 44 fc ff ff ff ff ff ef 7f | f64.const 0x1.ffffffffffffcp+1023\n 00007c: 1a                         | drop\n 00007d: 44 fe ff ff ff ff ff ef 7f | f64.const 0x1.ffffffffffffep+1023\n 000086: 1a                         | drop\n 000087: 44 f1 ff ff ff ff ff df 02 | f64.const 0x1.ffffffffffff1p-978\n 000090: 1a                         | drop\n 000091: 44 f3 ff ff ff ff ff df 02 | f64.const 0x1.ffffffffffff3p-978\n 00009a: 1a                         | drop\n 00009b: 44 00 00 00 00 00 00 80 01 | f64.const 0x1p-999\n 0000a4: 1a                         | drop\n 0000a5: 44 00 00 00 00 00 00 f1 3f | f64.const 0x1.1p+0\n 0000ae: 1a                         | drop\n 0000af: 44 00 00 00 00 00 00 70 42 | f64.const 0x1p+40\n 0000b8: 1a                         | drop\n 0000b9: 44 00 00 00 00 10 f0 0f c0 | f64.const -0x1.ff01p+1\n 0000c2: 1a                         | drop\n 0000c3: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/if-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    if (result i32 f32)\n      i32.const 1\n      f32.const 2\n    else\n      i32.const 3\n      f32.const 4\n    end\n    return)\n\n  (func\n    f32.const 0\n    i32.const 1\n    if (param f32)\n      drop\n    else\n      drop\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n; func type 1\n000000e: 60                                        ; func\n000000f: 00                                        ; num params\n0000010: 02                                        ; num results\n0000011: 7f                                        ; i32\n0000012: 7d                                        ; f32\n; func type 2\n0000013: 60                                        ; func\n0000014: 01                                        ; num params\n0000015: 7d                                        ; f32\n0000016: 00                                        ; num results\n0000009: 0d                                        ; FIXUP section size\n; section \"Function\" (3)\n0000017: 03                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 02                                        ; num functions\n000001a: 00                                        ; function 0 signature index\n000001b: 00                                        ; function 1 signature index\n0000018: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n000001c: 0a                                        ; section code\n000001d: 00                                        ; section size (guess)\n000001e: 02                                        ; num functions\n; function body 0\n000001f: 00                                        ; func body size (guess)\n0000020: 00                                        ; local decl count\n0000021: 41                                        ; i32.const\n0000022: 00                                        ; i32 literal\n0000023: 04                                        ; if\n0000024: 01                                        ; block type function index\n0000025: 41                                        ; i32.const\n0000026: 01                                        ; i32 literal\n0000027: 43                                        ; f32.const\n0000028: 0000 0040                                 ; f32 literal\n000002c: 05                                        ; else\n000002d: 41                                        ; i32.const\n000002e: 03                                        ; i32 literal\n000002f: 43                                        ; f32.const\n0000030: 0000 8040                                 ; f32 literal\n0000034: 0b                                        ; end\n0000035: 0f                                        ; return\n0000036: 0b                                        ; end\n000001f: 17                                        ; FIXUP func body size\n; function body 1\n0000037: 00                                        ; func body size (guess)\n0000038: 00                                        ; local decl count\n0000039: 43                                        ; f32.const\n000003a: 0000 0000                                 ; f32 literal\n000003e: 41                                        ; i32.const\n000003f: 01                                        ; i32 literal\n0000040: 04                                        ; if\n0000041: 02                                        ; block type function index\n0000042: 1a                                        ; drop\n0000043: 05                                        ; else\n0000044: 1a                                        ; drop\n0000045: 0b                                        ; end\n0000046: 0b                                        ; end\n0000037: 0f                                        ; FIXUP func body size\n000001d: 29                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nif-multi.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000020 func[0]:\n 000021: 41 00                      | i32.const 0\n 000023: 04 01                      | if type[1]\n 000025: 41 01                      |   i32.const 1\n 000027: 43 00 00 00 40             |   f32.const 0x1p+1\n 00002c: 05                         | else\n 00002d: 41 03                      |   i32.const 3\n 00002f: 43 00 00 80 40             |   f32.const 0x1p+2\n 000034: 0b                         | end\n 000035: 0f                         | return\n 000036: 0b                         | end\n000038 func[1]:\n 000039: 43 00 00 00 00             | f32.const 0x0p+0\n 00003e: 41 01                      | i32.const 1\n 000040: 04 02                      | if type[2]\n 000042: 1a                         |   drop\n 000043: 05                         | else\n 000044: 1a                         |   drop\n 000045: 0b                         | end\n 000046: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/if-then-else-list.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 1\n    if\n      i32.const 2\n      drop\n      i32.const 3\n      drop\n    else\n      i32.const 4\n      drop\n      i32.const 5\n      drop\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 01                                        ; i32 literal\n0000019: 04                                        ; if\n000001a: 40                                        ; void\n000001b: 41                                        ; i32.const\n000001c: 02                                        ; i32 literal\n000001d: 1a                                        ; drop\n000001e: 41                                        ; i32.const\n000001f: 03                                        ; i32 literal\n0000020: 1a                                        ; drop\n0000021: 05                                        ; else\n0000022: 41                                        ; i32.const\n0000023: 04                                        ; i32 literal\n0000024: 1a                                        ; drop\n0000025: 41                                        ; i32.const\n0000026: 05                                        ; i32 literal\n0000027: 1a                                        ; drop\n0000028: 0b                                        ; end\n0000029: 0b                                        ; end\n0000015: 14                                        ; FIXUP func body size\n0000013: 16                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nif-then-else-list.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 41 01                      | i32.const 1\n 000019: 04 40                      | if\n 00001b: 41 02                      |   i32.const 2\n 00001d: 1a                         |   drop\n 00001e: 41 03                      |   i32.const 3\n 000020: 1a                         |   drop\n 000021: 05                         | else\n 000022: 41 04                      |   i32.const 4\n 000024: 1a                         |   drop\n 000025: 41 05                      |   i32.const 5\n 000027: 1a                         |   drop\n 000028: 0b                         | end\n 000029: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/if-then-list.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 1\n    if \n      nop \n      nop\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 01                                        ; i32 literal\n0000019: 04                                        ; if\n000001a: 40                                        ; void\n000001b: 01                                        ; nop\n000001c: 01                                        ; nop\n000001d: 0b                                        ; end\n000001e: 0b                                        ; end\n0000015: 09                                        ; FIXUP func body size\n0000013: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nif-then-list.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 41 01                      | i32.const 1\n 000019: 04 40                      | if\n 00001b: 01                         |   nop\n 00001c: 01                         |   nop\n 00001d: 0b                         | end\n 00001e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/if.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 1\n    if \n      nop\n    end\n    i32.const 0\n    if (result f32)\n      f32.const 1.0\n    else\n      f32.const 2.0 \n    end\n    drop)\n  (func\n    i32.const 1\n    if\n      return\n    else\n      return\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 02                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n0000012: 00                                        ; function 1 signature index\n000000f: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000013: 0a                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 02                                        ; num functions\n; function body 0\n0000016: 00                                        ; func body size (guess)\n0000017: 00                                        ; local decl count\n0000018: 41                                        ; i32.const\n0000019: 01                                        ; i32 literal\n000001a: 04                                        ; if\n000001b: 40                                        ; void\n000001c: 01                                        ; nop\n000001d: 0b                                        ; end\n000001e: 41                                        ; i32.const\n000001f: 00                                        ; i32 literal\n0000020: 04                                        ; if\n0000021: 7d                                        ; f32\n0000022: 43                                        ; f32.const\n0000023: 0000 803f                                 ; f32 literal\n0000027: 05                                        ; else\n0000028: 43                                        ; f32.const\n0000029: 0000 0040                                 ; f32 literal\n000002d: 0b                                        ; end\n000002e: 1a                                        ; drop\n000002f: 0b                                        ; end\n0000016: 19                                        ; FIXUP func body size\n; function body 1\n0000030: 00                                        ; func body size (guess)\n0000031: 00                                        ; local decl count\n0000032: 41                                        ; i32.const\n0000033: 01                                        ; i32 literal\n0000034: 04                                        ; if\n0000035: 40                                        ; void\n0000036: 0f                                        ; return\n0000037: 05                                        ; else\n0000038: 0f                                        ; return\n0000039: 0b                                        ; end\n000003a: 0b                                        ; end\n0000030: 0a                                        ; FIXUP func body size\n0000014: 26                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nif.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000017 func[0]:\n 000018: 41 01                      | i32.const 1\n 00001a: 04 40                      | if\n 00001c: 01                         |   nop\n 00001d: 0b                         | end\n 00001e: 41 00                      | i32.const 0\n 000020: 04 7d                      | if f32\n 000022: 43 00 00 80 3f             |   f32.const 0x1p+0\n 000027: 05                         | else\n 000028: 43 00 00 00 40             |   f32.const 0x1p+1\n 00002d: 0b                         | end\n 00002e: 1a                         | drop\n 00002f: 0b                         | end\n000031 func[1]:\n 000032: 41 01                      | i32.const 1\n 000034: 04 40                      | if\n 000036: 0f                         |   return\n 000037: 05                         | else\n 000038: 0f                         |   return\n 000039: 0b                         | end\n 00003a: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/import.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: -x\n(module\n  (import \"ignored\" \"test\" (func (param i32 i64 f32 f64)))\n  (import \"ignored\" \"test2\" (func (param i32) (result i32)))\n  (import \"ignored\" \"testmem\" (memory 0))\n  (import \"ignored\" \"testtable\" (table 0 funcref))\n  (import \"ignored\" \"testtag\" (tag (param i32)))\n)\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 04                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 7e                                        ; i64\n000000f: 7d                                        ; f32\n0000010: 7c                                        ; f64\n0000011: 00                                        ; num results\n; func type 1\n0000012: 60                                        ; func\n0000013: 01                                        ; num params\n0000014: 7f                                        ; i32\n0000015: 01                                        ; num results\n0000016: 7f                                        ; i32\n; func type 2\n0000017: 60                                        ; func\n0000018: 01                                        ; num params\n0000019: 7f                                        ; i32\n000001a: 00                                        ; num results\n0000009: 11                                        ; FIXUP section size\n; section \"Import\" (2)\n000001b: 02                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 05                                        ; num imports\n; import header 0\n000001e: 07                                        ; string length\n000001f: 6967 6e6f 7265 64                        ignored  ; import module name\n0000026: 04                                        ; string length\n0000027: 7465 7374                                test  ; import field name\n000002b: 00                                        ; import kind\n000002c: 00                                        ; import signature index\n; import header 1\n000002d: 07                                        ; string length\n000002e: 6967 6e6f 7265 64                        ignored  ; import module name\n0000035: 05                                        ; string length\n0000036: 7465 7374 32                             test2  ; import field name\n000003b: 00                                        ; import kind\n000003c: 01                                        ; import signature index\n; import header 2\n000003d: 07                                        ; string length\n000003e: 6967 6e6f 7265 64                        ignored  ; import module name\n0000045: 07                                        ; string length\n0000046: 7465 7374 6d65 6d                        testmem  ; import field name\n000004d: 02                                        ; import kind\n000004e: 00                                        ; limits: flags\n000004f: 00                                        ; limits: initial\n; import header 3\n0000050: 07                                        ; string length\n0000051: 6967 6e6f 7265 64                        ignored  ; import module name\n0000058: 09                                        ; string length\n0000059: 7465 7374 7461 626c 65                   testtable  ; import field name\n0000062: 01                                        ; import kind\n0000063: 70                                        ; funcref\n0000064: 00                                        ; limits: flags\n0000065: 00                                        ; limits: initial\n; import header 4\n0000066: 07                                        ; string length\n0000067: 6967 6e6f 7265 64                        ignored  ; import module name\n000006e: 07                                        ; string length\n000006f: 7465 7374 7461 67                        testtag  ; import field name\n0000076: 04                                        ; import kind\n0000077: 00                                        ; tag attribute\n0000078: 02                                        ; tag signature index\n000001c: 5c                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nimport.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[3]:\n - type[0] (i32, i64, f32, f64) -> nil\n - type[1] (i32) -> i32\n - type[2] (i32) -> nil\nImport[5]:\n - func[0] sig=0 <ignored.test> <- ignored.test\n - func[1] sig=1 <ignored.test2> <- ignored.test2\n - memory[0] pages: initial=0 <- ignored.testmem\n - table[0] type=funcref initial=0 <- ignored.testtable\n - tag[0] sig=2 <ignored.testtag> <- ignored.testtag\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/invalid-data-segment-no-memory.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: -v --no-check\n(module\n  (data (i32.const 0) \"hello\"))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"DataCount\" (12)\n0000008: 0c                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; data count\n0000009: 01                                        ; FIXUP section size\n; truncate to 8 (0x8)\n; section \"Data\" (11)\n0000008: 0b                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num data segments\n; data segment header 0\n000000b: 00                                        ; segment flags\n000000c: 41                                        ; i32.const\n000000d: 00                                        ; i32 literal\n000000e: 0b                                        ; end\n000000f: 05                                        ; data segment size\n; data segment data 0\n0000010: 6865 6c6c 6f                              ; data segment data\n0000009: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/dump/invalid-data-segment-offset.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: -v --no-check\n(module\n  (memory 1)\n  (data (i32.add (i32.const 1) (i32.const 2)) \"foo\"))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Memory\" (5)\n0000008: 05                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num memories\n; memory 0\n000000b: 00                                        ; limits: flags\n000000c: 01                                        ; limits: initial\n0000009: 03                                        ; FIXUP section size\n; section \"DataCount\" (12)\n000000d: 0c                                        ; section code\n000000e: 00                                        ; section size (guess)\n000000f: 01                                        ; data count\n000000e: 01                                        ; FIXUP section size\n; truncate to 13 (0xd)\n; section \"Data\" (11)\n000000d: 0b                                        ; section code\n000000e: 00                                        ; section size (guess)\n000000f: 01                                        ; num data segments\n; data segment header 0\n0000010: 00                                        ; segment flags\n0000011: 41                                        ; i32.const\n0000012: 01                                        ; i32 literal\n0000013: 41                                        ; i32.const\n0000014: 02                                        ; i32 literal\n0000015: 6a                                        ; i32.add\n0000016: 0b                                        ; end\n0000017: 03                                        ; data segment size\n; data segment data 0\n0000018: 666f 6f                                   ; data segment data\n000000e: 0c                                        ; FIXUP section size\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/dump/invalid-elem-segment-no-table.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: -v --no-check\n(module\n  (func)\n  (func)\n  (elem (i32.const 0) 0 1))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 02                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n0000012: 00                                        ; function 1 signature index\n000000f: 03                                        ; FIXUP section size\n; section \"Elem\" (9)\n0000013: 09                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num elem segments\n; elem segment header 0\n0000016: 00                                        ; segment flags\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: 0b                                        ; end\n000001a: 02                                        ; num elems\n000001b: 00                                        ; elem function index\n000001c: 01                                        ; elem function index\n0000014: 08                                        ; FIXUP section size\n; section \"Code\" (10)\n000001d: 0a                                        ; section code\n000001e: 00                                        ; section size (guess)\n000001f: 02                                        ; num functions\n; function body 0\n0000020: 00                                        ; func body size (guess)\n0000021: 00                                        ; local decl count\n0000022: 0b                                        ; end\n0000020: 02                                        ; FIXUP func body size\n; function body 1\n0000023: 00                                        ; func body size (guess)\n0000024: 00                                        ; local decl count\n0000025: 0b                                        ; end\n0000023: 02                                        ; FIXUP func body size\n000001e: 07                                        ; FIXUP section size\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/dump/invalid-elem-segment-offset.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: -v --no-check\n(module\n  (table 1 funcref)\n  (func)\n  (elem (i32.eqz (i32.const 1)) 0))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Table\" (4)\n0000012: 04                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num tables\n; table 0\n0000015: 70                                        ; funcref\n0000016: 00                                        ; limits: flags\n0000017: 01                                        ; limits: initial\n0000013: 04                                        ; FIXUP section size\n; section \"Elem\" (9)\n0000018: 09                                        ; section code\n0000019: 00                                        ; section size (guess)\n000001a: 01                                        ; num elem segments\n; elem segment header 0\n000001b: 00                                        ; segment flags\n000001c: 41                                        ; i32.const\n000001d: 01                                        ; i32 literal\n000001e: 45                                        ; i32.eqz\n000001f: 0b                                        ; end\n0000020: 01                                        ; num elems\n0000021: 00                                        ; elem function index\n0000019: 08                                        ; FIXUP section size\n; section \"Code\" (10)\n0000022: 0a                                        ; section code\n0000023: 00                                        ; section size (guess)\n0000024: 01                                        ; num functions\n; function body 0\n0000025: 00                                        ; func body size (guess)\n0000026: 00                                        ; local decl count\n0000027: 0b                                        ; end\n0000025: 02                                        ; FIXUP func body size\n0000023: 04                                        ; FIXUP section size\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/dump/invalid-init-exprs.txt",
    "content": ";;; TOOL: run-objdump-gen-wasm\n;;; ARGS1: -x\n;; TODO: wasm-objdump should handle the \"<INVALID>\" case more gracefully\nmagic\nversion\nsection(ELEM) {\n  count[1]\n  flags[4]\n  offset[nop end]\n  elemcount[1]\n  end\n}\n(;; STDOUT ;;;\n\ninvalid-init-exprs.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nElem[1]:\n - segment[0] flags=4 table=0 count=1 - init <INVALID>\n  - elem[0] = <EMPTY>\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/load-aligned.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.load8_s align=1\n    drop\n    i32.const 0\n    i32.load16_s align=1\n    drop \n    i32.const 0\n    i32.load16_s align=2\n    drop\n    i32.const 0\n    i32.load align=1\n    drop\n    i32.const 0\n    i32.load align=2 \n    drop\n    i32.const 0\n    i32.load align=4\n    drop\n    i32.const 0\n    i64.load8_s align=1\n    drop\n    i32.const 0\n    i64.load16_s align=1\n    drop \n    i32.const 0 \n    i64.load16_s align=2 \n    drop\n    i32.const 0\n    i64.load32_s align=1\n    drop \n    i32.const 0\n    i64.load32_s align=2\n    drop \n    i32.const 0\n    i64.load32_s align=4\n    drop \n    i32.const 0\n    i64.load align=1\n    drop\n    i32.const 0\n    i64.load align=2\n    drop\n    i32.const 0\n    i64.load align=4\n    drop\n    i32.const 0\n    i64.load align=8\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000012: 05                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num memories\n; memory 0\n0000015: 00                                        ; limits: flags\n0000016: 01                                        ; limits: initial\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 01                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 41                                        ; i32.const\n000001d: 00                                        ; i32 literal\n000001e: 2c                                        ; i32.load8_s\n000001f: 00                                        ; alignment\n0000020: 00                                        ; load offset\n0000021: 1a                                        ; drop\n0000022: 41                                        ; i32.const\n0000023: 00                                        ; i32 literal\n0000024: 2e                                        ; i32.load16_s\n0000025: 00                                        ; alignment\n0000026: 00                                        ; load offset\n0000027: 1a                                        ; drop\n0000028: 41                                        ; i32.const\n0000029: 00                                        ; i32 literal\n000002a: 2e                                        ; i32.load16_s\n000002b: 01                                        ; alignment\n000002c: 00                                        ; load offset\n000002d: 1a                                        ; drop\n000002e: 41                                        ; i32.const\n000002f: 00                                        ; i32 literal\n0000030: 28                                        ; i32.load\n0000031: 00                                        ; alignment\n0000032: 00                                        ; load offset\n0000033: 1a                                        ; drop\n0000034: 41                                        ; i32.const\n0000035: 00                                        ; i32 literal\n0000036: 28                                        ; i32.load\n0000037: 01                                        ; alignment\n0000038: 00                                        ; load offset\n0000039: 1a                                        ; drop\n000003a: 41                                        ; i32.const\n000003b: 00                                        ; i32 literal\n000003c: 28                                        ; i32.load\n000003d: 02                                        ; alignment\n000003e: 00                                        ; load offset\n000003f: 1a                                        ; drop\n0000040: 41                                        ; i32.const\n0000041: 00                                        ; i32 literal\n0000042: 30                                        ; i64.load8_s\n0000043: 00                                        ; alignment\n0000044: 00                                        ; load offset\n0000045: 1a                                        ; drop\n0000046: 41                                        ; i32.const\n0000047: 00                                        ; i32 literal\n0000048: 32                                        ; i64.load16_s\n0000049: 00                                        ; alignment\n000004a: 00                                        ; load offset\n000004b: 1a                                        ; drop\n000004c: 41                                        ; i32.const\n000004d: 00                                        ; i32 literal\n000004e: 32                                        ; i64.load16_s\n000004f: 01                                        ; alignment\n0000050: 00                                        ; load offset\n0000051: 1a                                        ; drop\n0000052: 41                                        ; i32.const\n0000053: 00                                        ; i32 literal\n0000054: 34                                        ; i64.load32_s\n0000055: 00                                        ; alignment\n0000056: 00                                        ; load offset\n0000057: 1a                                        ; drop\n0000058: 41                                        ; i32.const\n0000059: 00                                        ; i32 literal\n000005a: 34                                        ; i64.load32_s\n000005b: 01                                        ; alignment\n000005c: 00                                        ; load offset\n000005d: 1a                                        ; drop\n000005e: 41                                        ; i32.const\n000005f: 00                                        ; i32 literal\n0000060: 34                                        ; i64.load32_s\n0000061: 02                                        ; alignment\n0000062: 00                                        ; load offset\n0000063: 1a                                        ; drop\n0000064: 41                                        ; i32.const\n0000065: 00                                        ; i32 literal\n0000066: 29                                        ; i64.load\n0000067: 00                                        ; alignment\n0000068: 00                                        ; load offset\n0000069: 1a                                        ; drop\n000006a: 41                                        ; i32.const\n000006b: 00                                        ; i32 literal\n000006c: 29                                        ; i64.load\n000006d: 01                                        ; alignment\n000006e: 00                                        ; load offset\n000006f: 1a                                        ; drop\n0000070: 41                                        ; i32.const\n0000071: 00                                        ; i32 literal\n0000072: 29                                        ; i64.load\n0000073: 02                                        ; alignment\n0000074: 00                                        ; load offset\n0000075: 1a                                        ; drop\n0000076: 41                                        ; i32.const\n0000077: 00                                        ; i32 literal\n0000078: 29                                        ; i64.load\n0000079: 03                                        ; alignment\n000007a: 00                                        ; load offset\n000007b: 1a                                        ; drop\n000007c: 0b                                        ; end\n000001a: 62                                        ; FIXUP func body size\n0000018: 64                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nload-aligned.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 41 00                      | i32.const 0\n 00001e: 2c 00 00                   | i32.load8_s 0 0\n 000021: 1a                         | drop\n 000022: 41 00                      | i32.const 0\n 000024: 2e 00 00                   | i32.load16_s 0 0\n 000027: 1a                         | drop\n 000028: 41 00                      | i32.const 0\n 00002a: 2e 01 00                   | i32.load16_s 1 0\n 00002d: 1a                         | drop\n 00002e: 41 00                      | i32.const 0\n 000030: 28 00 00                   | i32.load 0 0\n 000033: 1a                         | drop\n 000034: 41 00                      | i32.const 0\n 000036: 28 01 00                   | i32.load 1 0\n 000039: 1a                         | drop\n 00003a: 41 00                      | i32.const 0\n 00003c: 28 02 00                   | i32.load 2 0\n 00003f: 1a                         | drop\n 000040: 41 00                      | i32.const 0\n 000042: 30 00 00                   | i64.load8_s 0 0\n 000045: 1a                         | drop\n 000046: 41 00                      | i32.const 0\n 000048: 32 00 00                   | i64.load16_s 0 0\n 00004b: 1a                         | drop\n 00004c: 41 00                      | i32.const 0\n 00004e: 32 01 00                   | i64.load16_s 1 0\n 000051: 1a                         | drop\n 000052: 41 00                      | i32.const 0\n 000054: 34 00 00                   | i64.load32_s 0 0\n 000057: 1a                         | drop\n 000058: 41 00                      | i32.const 0\n 00005a: 34 01 00                   | i64.load32_s 1 0\n 00005d: 1a                         | drop\n 00005e: 41 00                      | i32.const 0\n 000060: 34 02 00                   | i64.load32_s 2 0\n 000063: 1a                         | drop\n 000064: 41 00                      | i32.const 0\n 000066: 29 00 00                   | i64.load 0 0\n 000069: 1a                         | drop\n 00006a: 41 00                      | i32.const 0\n 00006c: 29 01 00                   | i64.load 1 0\n 00006f: 1a                         | drop\n 000070: 41 00                      | i32.const 0\n 000072: 29 02 00                   | i64.load 2 0\n 000075: 1a                         | drop\n 000076: 41 00                      | i32.const 0\n 000078: 29 03 00                   | i64.load 3 0\n 00007b: 1a                         | drop\n 00007c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/load.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.load\n    drop\n    i32.const 0\n    i32.load8_s \n    drop\n    i32.const 0\n    i32.load16_s\n    drop\n    i32.const 0\n    i32.load8_u\n    drop\n    i32.const 0\n    i32.load16_u\n    drop\n    i32.const 0\n    i64.load\n    drop\n    i32.const 0\n    i64.load8_s\n    drop \n    i32.const 0\n    i64.load16_s\n    drop\n    i32.const 0\n    i64.load32_s\n    drop \n    i32.const 0\n    i64.load8_u\n    drop\n    i32.const 0\n    i64.load16_u\n    drop\n    i32.const 0\n    i64.load32_u\n    drop\n    i32.const 0\n    f32.load\n    drop\n    i32.const 0\n    f64.load\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000012: 05                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num memories\n; memory 0\n0000015: 00                                        ; limits: flags\n0000016: 01                                        ; limits: initial\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 01                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 41                                        ; i32.const\n000001d: 00                                        ; i32 literal\n000001e: 28                                        ; i32.load\n000001f: 02                                        ; alignment\n0000020: 00                                        ; load offset\n0000021: 1a                                        ; drop\n0000022: 41                                        ; i32.const\n0000023: 00                                        ; i32 literal\n0000024: 2c                                        ; i32.load8_s\n0000025: 00                                        ; alignment\n0000026: 00                                        ; load offset\n0000027: 1a                                        ; drop\n0000028: 41                                        ; i32.const\n0000029: 00                                        ; i32 literal\n000002a: 2e                                        ; i32.load16_s\n000002b: 01                                        ; alignment\n000002c: 00                                        ; load offset\n000002d: 1a                                        ; drop\n000002e: 41                                        ; i32.const\n000002f: 00                                        ; i32 literal\n0000030: 2d                                        ; i32.load8_u\n0000031: 00                                        ; alignment\n0000032: 00                                        ; load offset\n0000033: 1a                                        ; drop\n0000034: 41                                        ; i32.const\n0000035: 00                                        ; i32 literal\n0000036: 2f                                        ; i32.load16_u\n0000037: 01                                        ; alignment\n0000038: 00                                        ; load offset\n0000039: 1a                                        ; drop\n000003a: 41                                        ; i32.const\n000003b: 00                                        ; i32 literal\n000003c: 29                                        ; i64.load\n000003d: 03                                        ; alignment\n000003e: 00                                        ; load offset\n000003f: 1a                                        ; drop\n0000040: 41                                        ; i32.const\n0000041: 00                                        ; i32 literal\n0000042: 30                                        ; i64.load8_s\n0000043: 00                                        ; alignment\n0000044: 00                                        ; load offset\n0000045: 1a                                        ; drop\n0000046: 41                                        ; i32.const\n0000047: 00                                        ; i32 literal\n0000048: 32                                        ; i64.load16_s\n0000049: 01                                        ; alignment\n000004a: 00                                        ; load offset\n000004b: 1a                                        ; drop\n000004c: 41                                        ; i32.const\n000004d: 00                                        ; i32 literal\n000004e: 34                                        ; i64.load32_s\n000004f: 02                                        ; alignment\n0000050: 00                                        ; load offset\n0000051: 1a                                        ; drop\n0000052: 41                                        ; i32.const\n0000053: 00                                        ; i32 literal\n0000054: 31                                        ; i64.load8_u\n0000055: 00                                        ; alignment\n0000056: 00                                        ; load offset\n0000057: 1a                                        ; drop\n0000058: 41                                        ; i32.const\n0000059: 00                                        ; i32 literal\n000005a: 33                                        ; i64.load16_u\n000005b: 01                                        ; alignment\n000005c: 00                                        ; load offset\n000005d: 1a                                        ; drop\n000005e: 41                                        ; i32.const\n000005f: 00                                        ; i32 literal\n0000060: 35                                        ; i64.load32_u\n0000061: 02                                        ; alignment\n0000062: 00                                        ; load offset\n0000063: 1a                                        ; drop\n0000064: 41                                        ; i32.const\n0000065: 00                                        ; i32 literal\n0000066: 2a                                        ; f32.load\n0000067: 02                                        ; alignment\n0000068: 00                                        ; load offset\n0000069: 1a                                        ; drop\n000006a: 41                                        ; i32.const\n000006b: 00                                        ; i32 literal\n000006c: 2b                                        ; f64.load\n000006d: 03                                        ; alignment\n000006e: 00                                        ; load offset\n000006f: 1a                                        ; drop\n0000070: 0b                                        ; end\n000001a: 56                                        ; FIXUP func body size\n0000018: 58                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nload.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 41 00                      | i32.const 0\n 00001e: 28 02 00                   | i32.load 2 0\n 000021: 1a                         | drop\n 000022: 41 00                      | i32.const 0\n 000024: 2c 00 00                   | i32.load8_s 0 0\n 000027: 1a                         | drop\n 000028: 41 00                      | i32.const 0\n 00002a: 2e 01 00                   | i32.load16_s 1 0\n 00002d: 1a                         | drop\n 00002e: 41 00                      | i32.const 0\n 000030: 2d 00 00                   | i32.load8_u 0 0\n 000033: 1a                         | drop\n 000034: 41 00                      | i32.const 0\n 000036: 2f 01 00                   | i32.load16_u 1 0\n 000039: 1a                         | drop\n 00003a: 41 00                      | i32.const 0\n 00003c: 29 03 00                   | i64.load 3 0\n 00003f: 1a                         | drop\n 000040: 41 00                      | i32.const 0\n 000042: 30 00 00                   | i64.load8_s 0 0\n 000045: 1a                         | drop\n 000046: 41 00                      | i32.const 0\n 000048: 32 01 00                   | i64.load16_s 1 0\n 00004b: 1a                         | drop\n 00004c: 41 00                      | i32.const 0\n 00004e: 34 02 00                   | i64.load32_s 2 0\n 000051: 1a                         | drop\n 000052: 41 00                      | i32.const 0\n 000054: 31 00 00                   | i64.load8_u 0 0\n 000057: 1a                         | drop\n 000058: 41 00                      | i32.const 0\n 00005a: 33 01 00                   | i64.load16_u 1 0\n 00005d: 1a                         | drop\n 00005e: 41 00                      | i32.const 0\n 000060: 35 02 00                   | i64.load32_u 2 0\n 000063: 1a                         | drop\n 000064: 41 00                      | i32.const 0\n 000066: 2a 02 00                   | f32.load 2 0\n 000069: 1a                         | drop\n 00006a: 41 00                      | i32.const 0\n 00006c: 2b 03 00                   | f64.load 3 0\n 00006f: 1a                         | drop\n 000070: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/load64.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory i64 1)\n  (func\n    i64.const 0\n    i32.load\n    drop\n    i64.const 0\n    i32.load8_s\n    drop\n    i64.const 0\n    i32.load16_s\n    drop\n    i64.const 0\n    i32.load8_u\n    drop\n    i64.const 0\n    i32.load16_u\n    drop\n    i64.const 0\n    i64.load\n    drop\n    i64.const 0\n    i64.load8_s\n    drop\n    i64.const 0\n    i64.load16_s\n    drop\n    i64.const 0\n    i64.load32_s\n    drop\n    i64.const 0\n    i64.load8_u\n    drop\n    i64.const 0\n    i64.load16_u\n    drop\n    i64.const 0\n    i64.load32_u\n    drop\n    i64.const 0\n    f32.load\n    drop\n    i64.const 0\n    f64.load\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000012: 05                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num memories\n; memory 0\n0000015: 04                                        ; limits: flags\n0000016: 01                                        ; limits: initial\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 01                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 42                                        ; i64.const\n000001d: 00                                        ; i64 literal\n000001e: 28                                        ; i32.load\n000001f: 02                                        ; alignment\n0000020: 00                                        ; load offset\n0000021: 1a                                        ; drop\n0000022: 42                                        ; i64.const\n0000023: 00                                        ; i64 literal\n0000024: 2c                                        ; i32.load8_s\n0000025: 00                                        ; alignment\n0000026: 00                                        ; load offset\n0000027: 1a                                        ; drop\n0000028: 42                                        ; i64.const\n0000029: 00                                        ; i64 literal\n000002a: 2e                                        ; i32.load16_s\n000002b: 01                                        ; alignment\n000002c: 00                                        ; load offset\n000002d: 1a                                        ; drop\n000002e: 42                                        ; i64.const\n000002f: 00                                        ; i64 literal\n0000030: 2d                                        ; i32.load8_u\n0000031: 00                                        ; alignment\n0000032: 00                                        ; load offset\n0000033: 1a                                        ; drop\n0000034: 42                                        ; i64.const\n0000035: 00                                        ; i64 literal\n0000036: 2f                                        ; i32.load16_u\n0000037: 01                                        ; alignment\n0000038: 00                                        ; load offset\n0000039: 1a                                        ; drop\n000003a: 42                                        ; i64.const\n000003b: 00                                        ; i64 literal\n000003c: 29                                        ; i64.load\n000003d: 03                                        ; alignment\n000003e: 00                                        ; load offset\n000003f: 1a                                        ; drop\n0000040: 42                                        ; i64.const\n0000041: 00                                        ; i64 literal\n0000042: 30                                        ; i64.load8_s\n0000043: 00                                        ; alignment\n0000044: 00                                        ; load offset\n0000045: 1a                                        ; drop\n0000046: 42                                        ; i64.const\n0000047: 00                                        ; i64 literal\n0000048: 32                                        ; i64.load16_s\n0000049: 01                                        ; alignment\n000004a: 00                                        ; load offset\n000004b: 1a                                        ; drop\n000004c: 42                                        ; i64.const\n000004d: 00                                        ; i64 literal\n000004e: 34                                        ; i64.load32_s\n000004f: 02                                        ; alignment\n0000050: 00                                        ; load offset\n0000051: 1a                                        ; drop\n0000052: 42                                        ; i64.const\n0000053: 00                                        ; i64 literal\n0000054: 31                                        ; i64.load8_u\n0000055: 00                                        ; alignment\n0000056: 00                                        ; load offset\n0000057: 1a                                        ; drop\n0000058: 42                                        ; i64.const\n0000059: 00                                        ; i64 literal\n000005a: 33                                        ; i64.load16_u\n000005b: 01                                        ; alignment\n000005c: 00                                        ; load offset\n000005d: 1a                                        ; drop\n000005e: 42                                        ; i64.const\n000005f: 00                                        ; i64 literal\n0000060: 35                                        ; i64.load32_u\n0000061: 02                                        ; alignment\n0000062: 00                                        ; load offset\n0000063: 1a                                        ; drop\n0000064: 42                                        ; i64.const\n0000065: 00                                        ; i64 literal\n0000066: 2a                                        ; f32.load\n0000067: 02                                        ; alignment\n0000068: 00                                        ; load offset\n0000069: 1a                                        ; drop\n000006a: 42                                        ; i64.const\n000006b: 00                                        ; i64 literal\n000006c: 2b                                        ; f64.load\n000006d: 03                                        ; alignment\n000006e: 00                                        ; load offset\n000006f: 1a                                        ; drop\n0000070: 0b                                        ; end\n000001a: 56                                        ; FIXUP func body size\n0000018: 58                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nload64.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 42 00                      | i64.const 0\n 00001e: 28 02 00                   | i32.load 2 0\n 000021: 1a                         | drop\n 000022: 42 00                      | i64.const 0\n 000024: 2c 00 00                   | i32.load8_s 0 0\n 000027: 1a                         | drop\n 000028: 42 00                      | i64.const 0\n 00002a: 2e 01 00                   | i32.load16_s 1 0\n 00002d: 1a                         | drop\n 00002e: 42 00                      | i64.const 0\n 000030: 2d 00 00                   | i32.load8_u 0 0\n 000033: 1a                         | drop\n 000034: 42 00                      | i64.const 0\n 000036: 2f 01 00                   | i32.load16_u 1 0\n 000039: 1a                         | drop\n 00003a: 42 00                      | i64.const 0\n 00003c: 29 03 00                   | i64.load 3 0\n 00003f: 1a                         | drop\n 000040: 42 00                      | i64.const 0\n 000042: 30 00 00                   | i64.load8_s 0 0\n 000045: 1a                         | drop\n 000046: 42 00                      | i64.const 0\n 000048: 32 01 00                   | i64.load16_s 1 0\n 00004b: 1a                         | drop\n 00004c: 42 00                      | i64.const 0\n 00004e: 34 02 00                   | i64.load32_s 2 0\n 000051: 1a                         | drop\n 000052: 42 00                      | i64.const 0\n 000054: 31 00 00                   | i64.load8_u 0 0\n 000057: 1a                         | drop\n 000058: 42 00                      | i64.const 0\n 00005a: 33 01 00                   | i64.load16_u 1 0\n 00005d: 1a                         | drop\n 00005e: 42 00                      | i64.const 0\n 000060: 35 02 00                   | i64.load32_u 2 0\n 000063: 1a                         | drop\n 000064: 42 00                      | i64.const 0\n 000066: 2a 02 00                   | f32.load 2 0\n 000069: 1a                         | drop\n 00006a: 42 00                      | i64.const 0\n 00006c: 2b 03 00                   | f64.load 3 0\n 00006f: 1a                         | drop\n 000070: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/local-indices.txt",
    "content": ";;; TOOL: run-objdump\n(module\n  (func (param i32)\n    (local i32))\n  (func (param i32)\n    (local i32)))\n(;; STDOUT ;;;\n\nlocal-indices.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 01 7f                      | local[1] type=i32\n 00001b: 0b                         | end\n00001d func[1]:\n 00001e: 01 7f                      | local[1] type=i32\n 000020: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/local-tee.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    (local i32)\n    i32.const 0\n    local.tee 0\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 01                                        ; local decl count\n0000017: 01                                        ; local type count\n0000018: 7f                                        ; i32\n0000019: 41                                        ; i32.const\n000001a: 00                                        ; i32 literal\n000001b: 22                                        ; local.tee\n000001c: 00                                        ; local index\n000001d: 1a                                        ; drop\n000001e: 0b                                        ; end\n0000015: 09                                        ; FIXUP func body size\n0000013: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nlocal-tee.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 01 7f                      | local[0] type=i32\n 000019: 41 00                      | i32.const 0\n 00001b: 22 00                      | local.tee 0\n 00001d: 1a                         | drop\n 00001e: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/localget-param.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (param i32 f32)\n    (local i64 f32 i32 f32)\n    local.get 0\n    drop\n    local.get 1\n    drop\n    local.get 2\n    drop\n    local.get 3\n    drop\n    local.get 4\n    drop\n    local.get 5\n    drop ))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 02                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 7d                                        ; f32\n000000f: 00                                        ; num results\n0000009: 06                                        ; FIXUP section size\n; section \"Function\" (3)\n0000010: 03                                        ; section code\n0000011: 00                                        ; section size (guess)\n0000012: 01                                        ; num functions\n0000013: 00                                        ; function 0 signature index\n0000011: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000014: 0a                                        ; section code\n0000015: 00                                        ; section size (guess)\n0000016: 01                                        ; num functions\n; function body 0\n0000017: 00                                        ; func body size (guess)\n0000018: 04                                        ; local decl count\n0000019: 01                                        ; local type count\n000001a: 7e                                        ; i64\n000001b: 01                                        ; local type count\n000001c: 7d                                        ; f32\n000001d: 01                                        ; local type count\n000001e: 7f                                        ; i32\n000001f: 01                                        ; local type count\n0000020: 7d                                        ; f32\n0000021: 20                                        ; local.get\n0000022: 00                                        ; local index\n0000023: 1a                                        ; drop\n0000024: 20                                        ; local.get\n0000025: 01                                        ; local index\n0000026: 1a                                        ; drop\n0000027: 20                                        ; local.get\n0000028: 02                                        ; local index\n0000029: 1a                                        ; drop\n000002a: 20                                        ; local.get\n000002b: 03                                        ; local index\n000002c: 1a                                        ; drop\n000002d: 20                                        ; local.get\n000002e: 04                                        ; local index\n000002f: 1a                                        ; drop\n0000030: 20                                        ; local.get\n0000031: 05                                        ; local index\n0000032: 1a                                        ; drop\n0000033: 0b                                        ; end\n0000017: 1c                                        ; FIXUP func body size\n0000015: 1e                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nlocalget-param.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 01 7e                      | local[2] type=i64\n 00001b: 01 7d                      | local[3] type=f32\n 00001d: 01 7f                      | local[4] type=i32\n 00001f: 01 7d                      | local[5] type=f32\n 000021: 20 00                      | local.get 0\n 000023: 1a                         | drop\n 000024: 20 01                      | local.get 1\n 000026: 1a                         | drop\n 000027: 20 02                      | local.get 2\n 000029: 1a                         | drop\n 00002a: 20 03                      | local.get 3\n 00002c: 1a                         | drop\n 00002d: 20 04                      | local.get 4\n 00002f: 1a                         | drop\n 000030: 20 05                      | local.get 5\n 000032: 1a                         | drop\n 000033: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/localget.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    (local f64 f32 i64 i32 i32 f32 f64 i64)\n    local.get 0\n    drop\n    local.get 1\n    drop\n    local.get 2\n    drop\n    local.get 3\n    drop\n    local.get 4\n    drop\n    local.get 5\n    drop\n    local.get 6\n    drop\n    local.get 7\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 07                                        ; local decl count\n0000017: 01                                        ; local type count\n0000018: 7c                                        ; f64\n0000019: 01                                        ; local type count\n000001a: 7d                                        ; f32\n000001b: 01                                        ; local type count\n000001c: 7e                                        ; i64\n000001d: 02                                        ; local type count\n000001e: 7f                                        ; i32\n000001f: 01                                        ; local type count\n0000020: 7d                                        ; f32\n0000021: 01                                        ; local type count\n0000022: 7c                                        ; f64\n0000023: 01                                        ; local type count\n0000024: 7e                                        ; i64\n0000025: 20                                        ; local.get\n0000026: 00                                        ; local index\n0000027: 1a                                        ; drop\n0000028: 20                                        ; local.get\n0000029: 01                                        ; local index\n000002a: 1a                                        ; drop\n000002b: 20                                        ; local.get\n000002c: 02                                        ; local index\n000002d: 1a                                        ; drop\n000002e: 20                                        ; local.get\n000002f: 03                                        ; local index\n0000030: 1a                                        ; drop\n0000031: 20                                        ; local.get\n0000032: 04                                        ; local index\n0000033: 1a                                        ; drop\n0000034: 20                                        ; local.get\n0000035: 05                                        ; local index\n0000036: 1a                                        ; drop\n0000037: 20                                        ; local.get\n0000038: 06                                        ; local index\n0000039: 1a                                        ; drop\n000003a: 20                                        ; local.get\n000003b: 07                                        ; local index\n000003c: 1a                                        ; drop\n000003d: 0b                                        ; end\n0000015: 28                                        ; FIXUP func body size\n0000013: 2a                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nlocalget.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 01 7c                      | local[0] type=f64\n 000019: 01 7d                      | local[1] type=f32\n 00001b: 01 7e                      | local[2] type=i64\n 00001d: 02 7f                      | local[3..4] type=i32\n 00001f: 01 7d                      | local[5] type=f32\n 000021: 01 7c                      | local[6] type=f64\n 000023: 01 7e                      | local[7] type=i64\n 000025: 20 00                      | local.get 0\n 000027: 1a                         | drop\n 000028: 20 01                      | local.get 1\n 00002a: 1a                         | drop\n 00002b: 20 02                      | local.get 2\n 00002d: 1a                         | drop\n 00002e: 20 03                      | local.get 3\n 000030: 1a                         | drop\n 000031: 20 04                      | local.get 4\n 000033: 1a                         | drop\n 000034: 20 05                      | local.get 5\n 000036: 1a                         | drop\n 000037: 20 06                      | local.get 6\n 000039: 1a                         | drop\n 00003a: 20 07                      | local.get 7\n 00003c: 1a                         | drop\n 00003d: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/locals.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (local i32 i64 i64 f32 f32 f32 f64 f64 f64 f64)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 04                                        ; local decl count\n0000017: 01                                        ; local type count\n0000018: 7f                                        ; i32\n0000019: 02                                        ; local type count\n000001a: 7e                                        ; i64\n000001b: 03                                        ; local type count\n000001c: 7d                                        ; f32\n000001d: 04                                        ; local type count\n000001e: 7c                                        ; f64\n000001f: 0b                                        ; end\n0000015: 0a                                        ; FIXUP func body size\n0000013: 0c                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nlocals.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 01 7f                      | local[0] type=i32\n 000019: 02 7e                      | local[1..2] type=i64\n 00001b: 03 7d                      | local[3..5] type=f32\n 00001d: 04 7c                      | local[6..9] type=f64\n 00001f: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/localset-param.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  ;;             0   1\n  (func (param i32 f32)\n    ;; i32           2\n    ;; i64   3\n    ;; f32       4       5\n    (local i64 f32 i32 f32)\n    i32.const 0\n    local.set 0\n    f32.const 0\n    local.set 1\n    i64.const 0\n    local.set 2\n    f32.const 0\n    local.set 3\n    i32.const 0\n    local.set 4\n    f32.const 0\n    local.set 5))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 02                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 7d                                        ; f32\n000000f: 00                                        ; num results\n0000009: 06                                        ; FIXUP section size\n; section \"Function\" (3)\n0000010: 03                                        ; section code\n0000011: 00                                        ; section size (guess)\n0000012: 01                                        ; num functions\n0000013: 00                                        ; function 0 signature index\n0000011: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000014: 0a                                        ; section code\n0000015: 00                                        ; section size (guess)\n0000016: 01                                        ; num functions\n; function body 0\n0000017: 00                                        ; func body size (guess)\n0000018: 04                                        ; local decl count\n0000019: 01                                        ; local type count\n000001a: 7e                                        ; i64\n000001b: 01                                        ; local type count\n000001c: 7d                                        ; f32\n000001d: 01                                        ; local type count\n000001e: 7f                                        ; i32\n000001f: 01                                        ; local type count\n0000020: 7d                                        ; f32\n0000021: 41                                        ; i32.const\n0000022: 00                                        ; i32 literal\n0000023: 21                                        ; local.set\n0000024: 00                                        ; local index\n0000025: 43                                        ; f32.const\n0000026: 0000 0000                                 ; f32 literal\n000002a: 21                                        ; local.set\n000002b: 01                                        ; local index\n000002c: 42                                        ; i64.const\n000002d: 00                                        ; i64 literal\n000002e: 21                                        ; local.set\n000002f: 02                                        ; local index\n0000030: 43                                        ; f32.const\n0000031: 0000 0000                                 ; f32 literal\n0000035: 21                                        ; local.set\n0000036: 03                                        ; local index\n0000037: 41                                        ; i32.const\n0000038: 00                                        ; i32 literal\n0000039: 21                                        ; local.set\n000003a: 04                                        ; local index\n000003b: 43                                        ; f32.const\n000003c: 0000 0000                                 ; f32 literal\n0000040: 21                                        ; local.set\n0000041: 05                                        ; local index\n0000042: 0b                                        ; end\n0000017: 2b                                        ; FIXUP func body size\n0000015: 2d                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nlocalset-param.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 01 7e                      | local[2] type=i64\n 00001b: 01 7d                      | local[3] type=f32\n 00001d: 01 7f                      | local[4] type=i32\n 00001f: 01 7d                      | local[5] type=f32\n 000021: 41 00                      | i32.const 0\n 000023: 21 00                      | local.set 0\n 000025: 43 00 00 00 00             | f32.const 0x0p+0\n 00002a: 21 01                      | local.set 1\n 00002c: 42 00                      | i64.const 0\n 00002e: 21 02                      | local.set 2\n 000030: 43 00 00 00 00             | f32.const 0x0p+0\n 000035: 21 03                      | local.set 3\n 000037: 41 00                      | i32.const 0\n 000039: 21 04                      | local.set 4\n 00003b: 43 00 00 00 00             | f32.const 0x0p+0\n 000040: 21 05                      | local.set 5\n 000042: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/localset.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    ;; i32               0   1\n    ;; i64           2                   3\n    ;; f32       4               5\n    ;; f64   6                       7\n    (local f64 f32 i64 i32 i32 f32 f64 i64)\n    f64.const 0\n    local.set 0\n    f32.const 0\n    local.set 1\n    i64.const 0\n    local.set 2\n    i32.const 0\n    local.set 3\n    i32.const 0\n    local.set 4\n    f32.const 0\n    local.set 5\n    f64.const 0\n    local.set 6\n    i64.const 0\n    local.set 7))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 07                                        ; local decl count\n0000017: 01                                        ; local type count\n0000018: 7c                                        ; f64\n0000019: 01                                        ; local type count\n000001a: 7d                                        ; f32\n000001b: 01                                        ; local type count\n000001c: 7e                                        ; i64\n000001d: 02                                        ; local type count\n000001e: 7f                                        ; i32\n000001f: 01                                        ; local type count\n0000020: 7d                                        ; f32\n0000021: 01                                        ; local type count\n0000022: 7c                                        ; f64\n0000023: 01                                        ; local type count\n0000024: 7e                                        ; i64\n0000025: 44                                        ; f64.const\n0000026: 0000 0000 0000 0000                       ; f64 literal\n000002e: 21                                        ; local.set\n000002f: 00                                        ; local index\n0000030: 43                                        ; f32.const\n0000031: 0000 0000                                 ; f32 literal\n0000035: 21                                        ; local.set\n0000036: 01                                        ; local index\n0000037: 42                                        ; i64.const\n0000038: 00                                        ; i64 literal\n0000039: 21                                        ; local.set\n000003a: 02                                        ; local index\n000003b: 41                                        ; i32.const\n000003c: 00                                        ; i32 literal\n000003d: 21                                        ; local.set\n000003e: 03                                        ; local index\n000003f: 41                                        ; i32.const\n0000040: 00                                        ; i32 literal\n0000041: 21                                        ; local.set\n0000042: 04                                        ; local index\n0000043: 43                                        ; f32.const\n0000044: 0000 0000                                 ; f32 literal\n0000048: 21                                        ; local.set\n0000049: 05                                        ; local index\n000004a: 44                                        ; f64.const\n000004b: 0000 0000 0000 0000                       ; f64 literal\n0000053: 21                                        ; local.set\n0000054: 06                                        ; local index\n0000055: 42                                        ; i64.const\n0000056: 00                                        ; i64 literal\n0000057: 21                                        ; local.set\n0000058: 07                                        ; local index\n0000059: 0b                                        ; end\n0000015: 44                                        ; FIXUP func body size\n0000013: 46                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nlocalset.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 01 7c                      | local[0] type=f64\n 000019: 01 7d                      | local[1] type=f32\n 00001b: 01 7e                      | local[2] type=i64\n 00001d: 02 7f                      | local[3..4] type=i32\n 00001f: 01 7d                      | local[5] type=f32\n 000021: 01 7c                      | local[6] type=f64\n 000023: 01 7e                      | local[7] type=i64\n 000025: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 00002e: 21 00                      | local.set 0\n 000030: 43 00 00 00 00             | f32.const 0x0p+0\n 000035: 21 01                      | local.set 1\n 000037: 42 00                      | i64.const 0\n 000039: 21 02                      | local.set 2\n 00003b: 41 00                      | i32.const 0\n 00003d: 21 03                      | local.set 3\n 00003f: 41 00                      | i32.const 0\n 000041: 21 04                      | local.set 4\n 000043: 43 00 00 00 00             | f32.const 0x0p+0\n 000048: 21 05                      | local.set 5\n 00004a: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000053: 21 06                      | local.set 6\n 000055: 42 00                      | i64.const 0\n 000057: 21 07                      | local.set 7\n 000059: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/loop-257-exprs-br.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    block $outer \n      loop $inner\n        ;; 1..64\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n\n        ;; 65..128\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n\n\n        ;; 129..192\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n\n        ;; 193..256\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n        nop nop nop nop nop nop nop nop\n\n\n      ;; 257..258\n      br $outer  ;; depth 2\n      br $inner  ;; depth 1\n      br 1       ;; depth 2 (due to implicit block)\n      br 0       ;; depth 1 (due to implicit block)\n      end\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 02                                        ; block\n0000018: 40                                        ; void\n0000019: 03                                        ; loop\n000001a: 40                                        ; void\n000001b: 01                                        ; nop\n000001c: 01                                        ; nop\n000001d: 01                                        ; nop\n000001e: 01                                        ; nop\n000001f: 01                                        ; nop\n0000020: 01                                        ; nop\n0000021: 01                                        ; nop\n0000022: 01                                        ; nop\n0000023: 01                                        ; nop\n0000024: 01                                        ; nop\n0000025: 01                                        ; nop\n0000026: 01                                        ; nop\n0000027: 01                                        ; nop\n0000028: 01                                        ; nop\n0000029: 01                                        ; nop\n000002a: 01                                        ; nop\n000002b: 01                                        ; nop\n000002c: 01                                        ; nop\n000002d: 01                                        ; nop\n000002e: 01                                        ; nop\n000002f: 01                                        ; nop\n0000030: 01                                        ; nop\n0000031: 01                                        ; nop\n0000032: 01                                        ; nop\n0000033: 01                                        ; nop\n0000034: 01                                        ; nop\n0000035: 01                                        ; nop\n0000036: 01                                        ; nop\n0000037: 01                                        ; nop\n0000038: 01                                        ; nop\n0000039: 01                                        ; nop\n000003a: 01                                        ; nop\n000003b: 01                                        ; nop\n000003c: 01                                        ; nop\n000003d: 01                                        ; nop\n000003e: 01                                        ; nop\n000003f: 01                                        ; nop\n0000040: 01                                        ; nop\n0000041: 01                                        ; nop\n0000042: 01                                        ; nop\n0000043: 01                                        ; nop\n0000044: 01                                        ; nop\n0000045: 01                                        ; nop\n0000046: 01                                        ; nop\n0000047: 01                                        ; nop\n0000048: 01                                        ; nop\n0000049: 01                                        ; nop\n000004a: 01                                        ; nop\n000004b: 01                                        ; nop\n000004c: 01                                        ; nop\n000004d: 01                                        ; nop\n000004e: 01                                        ; nop\n000004f: 01                                        ; nop\n0000050: 01                                        ; nop\n0000051: 01                                        ; nop\n0000052: 01                                        ; nop\n0000053: 01                                        ; nop\n0000054: 01                                        ; nop\n0000055: 01                                        ; nop\n0000056: 01                                        ; nop\n0000057: 01                                        ; nop\n0000058: 01                                        ; nop\n0000059: 01                                        ; nop\n000005a: 01                                        ; nop\n000005b: 01                                        ; nop\n000005c: 01                                        ; nop\n000005d: 01                                        ; nop\n000005e: 01                                        ; nop\n000005f: 01                                        ; nop\n0000060: 01                                        ; nop\n0000061: 01                                        ; nop\n0000062: 01                                        ; nop\n0000063: 01                                        ; nop\n0000064: 01                                        ; nop\n0000065: 01                                        ; nop\n0000066: 01                                        ; nop\n0000067: 01                                        ; nop\n0000068: 01                                        ; nop\n0000069: 01                                        ; nop\n000006a: 01                                        ; nop\n000006b: 01                                        ; nop\n000006c: 01                                        ; nop\n000006d: 01                                        ; nop\n000006e: 01                                        ; nop\n000006f: 01                                        ; nop\n0000070: 01                                        ; nop\n0000071: 01                                        ; nop\n0000072: 01                                        ; nop\n0000073: 01                                        ; nop\n0000074: 01                                        ; nop\n0000075: 01                                        ; nop\n0000076: 01                                        ; nop\n0000077: 01                                        ; nop\n0000078: 01                                        ; nop\n0000079: 01                                        ; nop\n000007a: 01                                        ; nop\n000007b: 01                                        ; nop\n000007c: 01                                        ; nop\n000007d: 01                                        ; nop\n000007e: 01                                        ; nop\n000007f: 01                                        ; nop\n0000080: 01                                        ; nop\n0000081: 01                                        ; nop\n0000082: 01                                        ; nop\n0000083: 01                                        ; nop\n0000084: 01                                        ; nop\n0000085: 01                                        ; nop\n0000086: 01                                        ; nop\n0000087: 01                                        ; nop\n0000088: 01                                        ; nop\n0000089: 01                                        ; nop\n000008a: 01                                        ; nop\n000008b: 01                                        ; nop\n000008c: 01                                        ; nop\n000008d: 01                                        ; nop\n000008e: 01                                        ; nop\n000008f: 01                                        ; nop\n0000090: 01                                        ; nop\n0000091: 01                                        ; nop\n0000092: 01                                        ; nop\n0000093: 01                                        ; nop\n0000094: 01                                        ; nop\n0000095: 01                                        ; nop\n0000096: 01                                        ; nop\n0000097: 01                                        ; nop\n0000098: 01                                        ; nop\n0000099: 01                                        ; nop\n000009a: 01                                        ; nop\n000009b: 01                                        ; nop\n000009c: 01                                        ; nop\n000009d: 01                                        ; nop\n000009e: 01                                        ; nop\n000009f: 01                                        ; nop\n00000a0: 01                                        ; nop\n00000a1: 01                                        ; nop\n00000a2: 01                                        ; nop\n00000a3: 01                                        ; nop\n00000a4: 01                                        ; nop\n00000a5: 01                                        ; nop\n00000a6: 01                                        ; nop\n00000a7: 01                                        ; nop\n00000a8: 01                                        ; nop\n00000a9: 01                                        ; nop\n00000aa: 01                                        ; nop\n00000ab: 01                                        ; nop\n00000ac: 01                                        ; nop\n00000ad: 01                                        ; nop\n00000ae: 01                                        ; nop\n00000af: 01                                        ; nop\n00000b0: 01                                        ; nop\n00000b1: 01                                        ; nop\n00000b2: 01                                        ; nop\n00000b3: 01                                        ; nop\n00000b4: 01                                        ; nop\n00000b5: 01                                        ; nop\n00000b6: 01                                        ; nop\n00000b7: 01                                        ; nop\n00000b8: 01                                        ; nop\n00000b9: 01                                        ; nop\n00000ba: 01                                        ; nop\n00000bb: 01                                        ; nop\n00000bc: 01                                        ; nop\n00000bd: 01                                        ; nop\n00000be: 01                                        ; nop\n00000bf: 01                                        ; nop\n00000c0: 01                                        ; nop\n00000c1: 01                                        ; nop\n00000c2: 01                                        ; nop\n00000c3: 01                                        ; nop\n00000c4: 01                                        ; nop\n00000c5: 01                                        ; nop\n00000c6: 01                                        ; nop\n00000c7: 01                                        ; nop\n00000c8: 01                                        ; nop\n00000c9: 01                                        ; nop\n00000ca: 01                                        ; nop\n00000cb: 01                                        ; nop\n00000cc: 01                                        ; nop\n00000cd: 01                                        ; nop\n00000ce: 01                                        ; nop\n00000cf: 01                                        ; nop\n00000d0: 01                                        ; nop\n00000d1: 01                                        ; nop\n00000d2: 01                                        ; nop\n00000d3: 01                                        ; nop\n00000d4: 01                                        ; nop\n00000d5: 01                                        ; nop\n00000d6: 01                                        ; nop\n00000d7: 01                                        ; nop\n00000d8: 01                                        ; nop\n00000d9: 01                                        ; nop\n00000da: 01                                        ; nop\n00000db: 01                                        ; nop\n00000dc: 01                                        ; nop\n00000dd: 01                                        ; nop\n00000de: 01                                        ; nop\n00000df: 01                                        ; nop\n00000e0: 01                                        ; nop\n00000e1: 01                                        ; nop\n00000e2: 01                                        ; nop\n00000e3: 01                                        ; nop\n00000e4: 01                                        ; nop\n00000e5: 01                                        ; nop\n00000e6: 01                                        ; nop\n00000e7: 01                                        ; nop\n00000e8: 01                                        ; nop\n00000e9: 01                                        ; nop\n00000ea: 01                                        ; nop\n00000eb: 01                                        ; nop\n00000ec: 01                                        ; nop\n00000ed: 01                                        ; nop\n00000ee: 01                                        ; nop\n00000ef: 01                                        ; nop\n00000f0: 01                                        ; nop\n00000f1: 01                                        ; nop\n00000f2: 01                                        ; nop\n00000f3: 01                                        ; nop\n00000f4: 01                                        ; nop\n00000f5: 01                                        ; nop\n00000f6: 01                                        ; nop\n00000f7: 01                                        ; nop\n00000f8: 01                                        ; nop\n00000f9: 01                                        ; nop\n00000fa: 01                                        ; nop\n00000fb: 01                                        ; nop\n00000fc: 01                                        ; nop\n00000fd: 01                                        ; nop\n00000fe: 01                                        ; nop\n00000ff: 01                                        ; nop\n0000100: 01                                        ; nop\n0000101: 01                                        ; nop\n0000102: 01                                        ; nop\n0000103: 01                                        ; nop\n0000104: 01                                        ; nop\n0000105: 01                                        ; nop\n0000106: 01                                        ; nop\n0000107: 01                                        ; nop\n0000108: 01                                        ; nop\n0000109: 01                                        ; nop\n000010a: 01                                        ; nop\n000010b: 01                                        ; nop\n000010c: 01                                        ; nop\n000010d: 01                                        ; nop\n000010e: 01                                        ; nop\n000010f: 01                                        ; nop\n0000110: 01                                        ; nop\n0000111: 01                                        ; nop\n0000112: 01                                        ; nop\n0000113: 01                                        ; nop\n0000114: 01                                        ; nop\n0000115: 01                                        ; nop\n0000116: 01                                        ; nop\n0000117: 01                                        ; nop\n0000118: 01                                        ; nop\n0000119: 01                                        ; nop\n000011a: 01                                        ; nop\n000011b: 0c                                        ; br\n000011c: 01                                        ; break depth\n000011d: 0c                                        ; br\n000011e: 00                                        ; break depth\n000011f: 0c                                        ; br\n0000120: 01                                        ; break depth\n0000121: 0c                                        ; br\n0000122: 00                                        ; break depth\n0000123: 0b                                        ; end\n0000124: 0b                                        ; end\n0000125: 0b                                        ; end\n; move data: [16, 126) -> [17, 127)\n0000015: 9002                                      ; FIXUP func body size\n; move data: [14, 127) -> [15, 128)\n0000013: 9302                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nloop-257-exprs-br.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 02 40                      | block\n 00001b: 03 40                      |   loop\n 00001d: 01                         |     nop\n 00001e: 01                         |     nop\n 00001f: 01                         |     nop\n 000020: 01                         |     nop\n 000021: 01                         |     nop\n 000022: 01                         |     nop\n 000023: 01                         |     nop\n 000024: 01                         |     nop\n 000025: 01                         |     nop\n 000026: 01                         |     nop\n 000027: 01                         |     nop\n 000028: 01                         |     nop\n 000029: 01                         |     nop\n 00002a: 01                         |     nop\n 00002b: 01                         |     nop\n 00002c: 01                         |     nop\n 00002d: 01                         |     nop\n 00002e: 01                         |     nop\n 00002f: 01                         |     nop\n 000030: 01                         |     nop\n 000031: 01                         |     nop\n 000032: 01                         |     nop\n 000033: 01                         |     nop\n 000034: 01                         |     nop\n 000035: 01                         |     nop\n 000036: 01                         |     nop\n 000037: 01                         |     nop\n 000038: 01                         |     nop\n 000039: 01                         |     nop\n 00003a: 01                         |     nop\n 00003b: 01                         |     nop\n 00003c: 01                         |     nop\n 00003d: 01                         |     nop\n 00003e: 01                         |     nop\n 00003f: 01                         |     nop\n 000040: 01                         |     nop\n 000041: 01                         |     nop\n 000042: 01                         |     nop\n 000043: 01                         |     nop\n 000044: 01                         |     nop\n 000045: 01                         |     nop\n 000046: 01                         |     nop\n 000047: 01                         |     nop\n 000048: 01                         |     nop\n 000049: 01                         |     nop\n 00004a: 01                         |     nop\n 00004b: 01                         |     nop\n 00004c: 01                         |     nop\n 00004d: 01                         |     nop\n 00004e: 01                         |     nop\n 00004f: 01                         |     nop\n 000050: 01                         |     nop\n 000051: 01                         |     nop\n 000052: 01                         |     nop\n 000053: 01                         |     nop\n 000054: 01                         |     nop\n 000055: 01                         |     nop\n 000056: 01                         |     nop\n 000057: 01                         |     nop\n 000058: 01                         |     nop\n 000059: 01                         |     nop\n 00005a: 01                         |     nop\n 00005b: 01                         |     nop\n 00005c: 01                         |     nop\n 00005d: 01                         |     nop\n 00005e: 01                         |     nop\n 00005f: 01                         |     nop\n 000060: 01                         |     nop\n 000061: 01                         |     nop\n 000062: 01                         |     nop\n 000063: 01                         |     nop\n 000064: 01                         |     nop\n 000065: 01                         |     nop\n 000066: 01                         |     nop\n 000067: 01                         |     nop\n 000068: 01                         |     nop\n 000069: 01                         |     nop\n 00006a: 01                         |     nop\n 00006b: 01                         |     nop\n 00006c: 01                         |     nop\n 00006d: 01                         |     nop\n 00006e: 01                         |     nop\n 00006f: 01                         |     nop\n 000070: 01                         |     nop\n 000071: 01                         |     nop\n 000072: 01                         |     nop\n 000073: 01                         |     nop\n 000074: 01                         |     nop\n 000075: 01                         |     nop\n 000076: 01                         |     nop\n 000077: 01                         |     nop\n 000078: 01                         |     nop\n 000079: 01                         |     nop\n 00007a: 01                         |     nop\n 00007b: 01                         |     nop\n 00007c: 01                         |     nop\n 00007d: 01                         |     nop\n 00007e: 01                         |     nop\n 00007f: 01                         |     nop\n 000080: 01                         |     nop\n 000081: 01                         |     nop\n 000082: 01                         |     nop\n 000083: 01                         |     nop\n 000084: 01                         |     nop\n 000085: 01                         |     nop\n 000086: 01                         |     nop\n 000087: 01                         |     nop\n 000088: 01                         |     nop\n 000089: 01                         |     nop\n 00008a: 01                         |     nop\n 00008b: 01                         |     nop\n 00008c: 01                         |     nop\n 00008d: 01                         |     nop\n 00008e: 01                         |     nop\n 00008f: 01                         |     nop\n 000090: 01                         |     nop\n 000091: 01                         |     nop\n 000092: 01                         |     nop\n 000093: 01                         |     nop\n 000094: 01                         |     nop\n 000095: 01                         |     nop\n 000096: 01                         |     nop\n 000097: 01                         |     nop\n 000098: 01                         |     nop\n 000099: 01                         |     nop\n 00009a: 01                         |     nop\n 00009b: 01                         |     nop\n 00009c: 01                         |     nop\n 00009d: 01                         |     nop\n 00009e: 01                         |     nop\n 00009f: 01                         |     nop\n 0000a0: 01                         |     nop\n 0000a1: 01                         |     nop\n 0000a2: 01                         |     nop\n 0000a3: 01                         |     nop\n 0000a4: 01                         |     nop\n 0000a5: 01                         |     nop\n 0000a6: 01                         |     nop\n 0000a7: 01                         |     nop\n 0000a8: 01                         |     nop\n 0000a9: 01                         |     nop\n 0000aa: 01                         |     nop\n 0000ab: 01                         |     nop\n 0000ac: 01                         |     nop\n 0000ad: 01                         |     nop\n 0000ae: 01                         |     nop\n 0000af: 01                         |     nop\n 0000b0: 01                         |     nop\n 0000b1: 01                         |     nop\n 0000b2: 01                         |     nop\n 0000b3: 01                         |     nop\n 0000b4: 01                         |     nop\n 0000b5: 01                         |     nop\n 0000b6: 01                         |     nop\n 0000b7: 01                         |     nop\n 0000b8: 01                         |     nop\n 0000b9: 01                         |     nop\n 0000ba: 01                         |     nop\n 0000bb: 01                         |     nop\n 0000bc: 01                         |     nop\n 0000bd: 01                         |     nop\n 0000be: 01                         |     nop\n 0000bf: 01                         |     nop\n 0000c0: 01                         |     nop\n 0000c1: 01                         |     nop\n 0000c2: 01                         |     nop\n 0000c3: 01                         |     nop\n 0000c4: 01                         |     nop\n 0000c5: 01                         |     nop\n 0000c6: 01                         |     nop\n 0000c7: 01                         |     nop\n 0000c8: 01                         |     nop\n 0000c9: 01                         |     nop\n 0000ca: 01                         |     nop\n 0000cb: 01                         |     nop\n 0000cc: 01                         |     nop\n 0000cd: 01                         |     nop\n 0000ce: 01                         |     nop\n 0000cf: 01                         |     nop\n 0000d0: 01                         |     nop\n 0000d1: 01                         |     nop\n 0000d2: 01                         |     nop\n 0000d3: 01                         |     nop\n 0000d4: 01                         |     nop\n 0000d5: 01                         |     nop\n 0000d6: 01                         |     nop\n 0000d7: 01                         |     nop\n 0000d8: 01                         |     nop\n 0000d9: 01                         |     nop\n 0000da: 01                         |     nop\n 0000db: 01                         |     nop\n 0000dc: 01                         |     nop\n 0000dd: 01                         |     nop\n 0000de: 01                         |     nop\n 0000df: 01                         |     nop\n 0000e0: 01                         |     nop\n 0000e1: 01                         |     nop\n 0000e2: 01                         |     nop\n 0000e3: 01                         |     nop\n 0000e4: 01                         |     nop\n 0000e5: 01                         |     nop\n 0000e6: 01                         |     nop\n 0000e7: 01                         |     nop\n 0000e8: 01                         |     nop\n 0000e9: 01                         |     nop\n 0000ea: 01                         |     nop\n 0000eb: 01                         |     nop\n 0000ec: 01                         |     nop\n 0000ed: 01                         |     nop\n 0000ee: 01                         |     nop\n 0000ef: 01                         |     nop\n 0000f0: 01                         |     nop\n 0000f1: 01                         |     nop\n 0000f2: 01                         |     nop\n 0000f3: 01                         |     nop\n 0000f4: 01                         |     nop\n 0000f5: 01                         |     nop\n 0000f6: 01                         |     nop\n 0000f7: 01                         |     nop\n 0000f8: 01                         |     nop\n 0000f9: 01                         |     nop\n 0000fa: 01                         |     nop\n 0000fb: 01                         |     nop\n 0000fc: 01                         |     nop\n 0000fd: 01                         |     nop\n 0000fe: 01                         |     nop\n 0000ff: 01                         |     nop\n 000100: 01                         |     nop\n 000101: 01                         |     nop\n 000102: 01                         |     nop\n 000103: 01                         |     nop\n 000104: 01                         |     nop\n 000105: 01                         |     nop\n 000106: 01                         |     nop\n 000107: 01                         |     nop\n 000108: 01                         |     nop\n 000109: 01                         |     nop\n 00010a: 01                         |     nop\n 00010b: 01                         |     nop\n 00010c: 01                         |     nop\n 00010d: 01                         |     nop\n 00010e: 01                         |     nop\n 00010f: 01                         |     nop\n 000110: 01                         |     nop\n 000111: 01                         |     nop\n 000112: 01                         |     nop\n 000113: 01                         |     nop\n 000114: 01                         |     nop\n 000115: 01                         |     nop\n 000116: 01                         |     nop\n 000117: 01                         |     nop\n 000118: 01                         |     nop\n 000119: 01                         |     nop\n 00011a: 01                         |     nop\n 00011b: 01                         |     nop\n 00011c: 01                         |     nop\n 00011d: 0c 01                      |     br 1\n 00011f: 0c 00                      |     br 0\n 000121: 0c 01                      |     br 1\n 000123: 0c 00                      |     br 0\n 000125: 0b                         |   end\n 000126: 0b                         | end\n 000127: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/loop-257-exprs.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    loop\n      ;; 1..64\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 65..128\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 129..192\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 193..256\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n      nop nop nop nop nop nop nop nop\n\n      ;; 257\n      nop\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 03                                        ; loop\n0000018: 40                                        ; void\n0000019: 01                                        ; nop\n000001a: 01                                        ; nop\n000001b: 01                                        ; nop\n000001c: 01                                        ; nop\n000001d: 01                                        ; nop\n000001e: 01                                        ; nop\n000001f: 01                                        ; nop\n0000020: 01                                        ; nop\n0000021: 01                                        ; nop\n0000022: 01                                        ; nop\n0000023: 01                                        ; nop\n0000024: 01                                        ; nop\n0000025: 01                                        ; nop\n0000026: 01                                        ; nop\n0000027: 01                                        ; nop\n0000028: 01                                        ; nop\n0000029: 01                                        ; nop\n000002a: 01                                        ; nop\n000002b: 01                                        ; nop\n000002c: 01                                        ; nop\n000002d: 01                                        ; nop\n000002e: 01                                        ; nop\n000002f: 01                                        ; nop\n0000030: 01                                        ; nop\n0000031: 01                                        ; nop\n0000032: 01                                        ; nop\n0000033: 01                                        ; nop\n0000034: 01                                        ; nop\n0000035: 01                                        ; nop\n0000036: 01                                        ; nop\n0000037: 01                                        ; nop\n0000038: 01                                        ; nop\n0000039: 01                                        ; nop\n000003a: 01                                        ; nop\n000003b: 01                                        ; nop\n000003c: 01                                        ; nop\n000003d: 01                                        ; nop\n000003e: 01                                        ; nop\n000003f: 01                                        ; nop\n0000040: 01                                        ; nop\n0000041: 01                                        ; nop\n0000042: 01                                        ; nop\n0000043: 01                                        ; nop\n0000044: 01                                        ; nop\n0000045: 01                                        ; nop\n0000046: 01                                        ; nop\n0000047: 01                                        ; nop\n0000048: 01                                        ; nop\n0000049: 01                                        ; nop\n000004a: 01                                        ; nop\n000004b: 01                                        ; nop\n000004c: 01                                        ; nop\n000004d: 01                                        ; nop\n000004e: 01                                        ; nop\n000004f: 01                                        ; nop\n0000050: 01                                        ; nop\n0000051: 01                                        ; nop\n0000052: 01                                        ; nop\n0000053: 01                                        ; nop\n0000054: 01                                        ; nop\n0000055: 01                                        ; nop\n0000056: 01                                        ; nop\n0000057: 01                                        ; nop\n0000058: 01                                        ; nop\n0000059: 01                                        ; nop\n000005a: 01                                        ; nop\n000005b: 01                                        ; nop\n000005c: 01                                        ; nop\n000005d: 01                                        ; nop\n000005e: 01                                        ; nop\n000005f: 01                                        ; nop\n0000060: 01                                        ; nop\n0000061: 01                                        ; nop\n0000062: 01                                        ; nop\n0000063: 01                                        ; nop\n0000064: 01                                        ; nop\n0000065: 01                                        ; nop\n0000066: 01                                        ; nop\n0000067: 01                                        ; nop\n0000068: 01                                        ; nop\n0000069: 01                                        ; nop\n000006a: 01                                        ; nop\n000006b: 01                                        ; nop\n000006c: 01                                        ; nop\n000006d: 01                                        ; nop\n000006e: 01                                        ; nop\n000006f: 01                                        ; nop\n0000070: 01                                        ; nop\n0000071: 01                                        ; nop\n0000072: 01                                        ; nop\n0000073: 01                                        ; nop\n0000074: 01                                        ; nop\n0000075: 01                                        ; nop\n0000076: 01                                        ; nop\n0000077: 01                                        ; nop\n0000078: 01                                        ; nop\n0000079: 01                                        ; nop\n000007a: 01                                        ; nop\n000007b: 01                                        ; nop\n000007c: 01                                        ; nop\n000007d: 01                                        ; nop\n000007e: 01                                        ; nop\n000007f: 01                                        ; nop\n0000080: 01                                        ; nop\n0000081: 01                                        ; nop\n0000082: 01                                        ; nop\n0000083: 01                                        ; nop\n0000084: 01                                        ; nop\n0000085: 01                                        ; nop\n0000086: 01                                        ; nop\n0000087: 01                                        ; nop\n0000088: 01                                        ; nop\n0000089: 01                                        ; nop\n000008a: 01                                        ; nop\n000008b: 01                                        ; nop\n000008c: 01                                        ; nop\n000008d: 01                                        ; nop\n000008e: 01                                        ; nop\n000008f: 01                                        ; nop\n0000090: 01                                        ; nop\n0000091: 01                                        ; nop\n0000092: 01                                        ; nop\n0000093: 01                                        ; nop\n0000094: 01                                        ; nop\n0000095: 01                                        ; nop\n0000096: 01                                        ; nop\n0000097: 01                                        ; nop\n0000098: 01                                        ; nop\n0000099: 01                                        ; nop\n000009a: 01                                        ; nop\n000009b: 01                                        ; nop\n000009c: 01                                        ; nop\n000009d: 01                                        ; nop\n000009e: 01                                        ; nop\n000009f: 01                                        ; nop\n00000a0: 01                                        ; nop\n00000a1: 01                                        ; nop\n00000a2: 01                                        ; nop\n00000a3: 01                                        ; nop\n00000a4: 01                                        ; nop\n00000a5: 01                                        ; nop\n00000a6: 01                                        ; nop\n00000a7: 01                                        ; nop\n00000a8: 01                                        ; nop\n00000a9: 01                                        ; nop\n00000aa: 01                                        ; nop\n00000ab: 01                                        ; nop\n00000ac: 01                                        ; nop\n00000ad: 01                                        ; nop\n00000ae: 01                                        ; nop\n00000af: 01                                        ; nop\n00000b0: 01                                        ; nop\n00000b1: 01                                        ; nop\n00000b2: 01                                        ; nop\n00000b3: 01                                        ; nop\n00000b4: 01                                        ; nop\n00000b5: 01                                        ; nop\n00000b6: 01                                        ; nop\n00000b7: 01                                        ; nop\n00000b8: 01                                        ; nop\n00000b9: 01                                        ; nop\n00000ba: 01                                        ; nop\n00000bb: 01                                        ; nop\n00000bc: 01                                        ; nop\n00000bd: 01                                        ; nop\n00000be: 01                                        ; nop\n00000bf: 01                                        ; nop\n00000c0: 01                                        ; nop\n00000c1: 01                                        ; nop\n00000c2: 01                                        ; nop\n00000c3: 01                                        ; nop\n00000c4: 01                                        ; nop\n00000c5: 01                                        ; nop\n00000c6: 01                                        ; nop\n00000c7: 01                                        ; nop\n00000c8: 01                                        ; nop\n00000c9: 01                                        ; nop\n00000ca: 01                                        ; nop\n00000cb: 01                                        ; nop\n00000cc: 01                                        ; nop\n00000cd: 01                                        ; nop\n00000ce: 01                                        ; nop\n00000cf: 01                                        ; nop\n00000d0: 01                                        ; nop\n00000d1: 01                                        ; nop\n00000d2: 01                                        ; nop\n00000d3: 01                                        ; nop\n00000d4: 01                                        ; nop\n00000d5: 01                                        ; nop\n00000d6: 01                                        ; nop\n00000d7: 01                                        ; nop\n00000d8: 01                                        ; nop\n00000d9: 01                                        ; nop\n00000da: 01                                        ; nop\n00000db: 01                                        ; nop\n00000dc: 01                                        ; nop\n00000dd: 01                                        ; nop\n00000de: 01                                        ; nop\n00000df: 01                                        ; nop\n00000e0: 01                                        ; nop\n00000e1: 01                                        ; nop\n00000e2: 01                                        ; nop\n00000e3: 01                                        ; nop\n00000e4: 01                                        ; nop\n00000e5: 01                                        ; nop\n00000e6: 01                                        ; nop\n00000e7: 01                                        ; nop\n00000e8: 01                                        ; nop\n00000e9: 01                                        ; nop\n00000ea: 01                                        ; nop\n00000eb: 01                                        ; nop\n00000ec: 01                                        ; nop\n00000ed: 01                                        ; nop\n00000ee: 01                                        ; nop\n00000ef: 01                                        ; nop\n00000f0: 01                                        ; nop\n00000f1: 01                                        ; nop\n00000f2: 01                                        ; nop\n00000f3: 01                                        ; nop\n00000f4: 01                                        ; nop\n00000f5: 01                                        ; nop\n00000f6: 01                                        ; nop\n00000f7: 01                                        ; nop\n00000f8: 01                                        ; nop\n00000f9: 01                                        ; nop\n00000fa: 01                                        ; nop\n00000fb: 01                                        ; nop\n00000fc: 01                                        ; nop\n00000fd: 01                                        ; nop\n00000fe: 01                                        ; nop\n00000ff: 01                                        ; nop\n0000100: 01                                        ; nop\n0000101: 01                                        ; nop\n0000102: 01                                        ; nop\n0000103: 01                                        ; nop\n0000104: 01                                        ; nop\n0000105: 01                                        ; nop\n0000106: 01                                        ; nop\n0000107: 01                                        ; nop\n0000108: 01                                        ; nop\n0000109: 01                                        ; nop\n000010a: 01                                        ; nop\n000010b: 01                                        ; nop\n000010c: 01                                        ; nop\n000010d: 01                                        ; nop\n000010e: 01                                        ; nop\n000010f: 01                                        ; nop\n0000110: 01                                        ; nop\n0000111: 01                                        ; nop\n0000112: 01                                        ; nop\n0000113: 01                                        ; nop\n0000114: 01                                        ; nop\n0000115: 01                                        ; nop\n0000116: 01                                        ; nop\n0000117: 01                                        ; nop\n0000118: 01                                        ; nop\n0000119: 01                                        ; nop\n000011a: 0b                                        ; end\n000011b: 0b                                        ; end\n; move data: [16, 11c) -> [17, 11d)\n0000015: 8602                                      ; FIXUP func body size\n; move data: [14, 11d) -> [15, 11e)\n0000013: 8902                                      ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nloop-257-exprs.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000018 func[0]:\n 000019: 03 40                      | loop\n 00001b: 01                         |   nop\n 00001c: 01                         |   nop\n 00001d: 01                         |   nop\n 00001e: 01                         |   nop\n 00001f: 01                         |   nop\n 000020: 01                         |   nop\n 000021: 01                         |   nop\n 000022: 01                         |   nop\n 000023: 01                         |   nop\n 000024: 01                         |   nop\n 000025: 01                         |   nop\n 000026: 01                         |   nop\n 000027: 01                         |   nop\n 000028: 01                         |   nop\n 000029: 01                         |   nop\n 00002a: 01                         |   nop\n 00002b: 01                         |   nop\n 00002c: 01                         |   nop\n 00002d: 01                         |   nop\n 00002e: 01                         |   nop\n 00002f: 01                         |   nop\n 000030: 01                         |   nop\n 000031: 01                         |   nop\n 000032: 01                         |   nop\n 000033: 01                         |   nop\n 000034: 01                         |   nop\n 000035: 01                         |   nop\n 000036: 01                         |   nop\n 000037: 01                         |   nop\n 000038: 01                         |   nop\n 000039: 01                         |   nop\n 00003a: 01                         |   nop\n 00003b: 01                         |   nop\n 00003c: 01                         |   nop\n 00003d: 01                         |   nop\n 00003e: 01                         |   nop\n 00003f: 01                         |   nop\n 000040: 01                         |   nop\n 000041: 01                         |   nop\n 000042: 01                         |   nop\n 000043: 01                         |   nop\n 000044: 01                         |   nop\n 000045: 01                         |   nop\n 000046: 01                         |   nop\n 000047: 01                         |   nop\n 000048: 01                         |   nop\n 000049: 01                         |   nop\n 00004a: 01                         |   nop\n 00004b: 01                         |   nop\n 00004c: 01                         |   nop\n 00004d: 01                         |   nop\n 00004e: 01                         |   nop\n 00004f: 01                         |   nop\n 000050: 01                         |   nop\n 000051: 01                         |   nop\n 000052: 01                         |   nop\n 000053: 01                         |   nop\n 000054: 01                         |   nop\n 000055: 01                         |   nop\n 000056: 01                         |   nop\n 000057: 01                         |   nop\n 000058: 01                         |   nop\n 000059: 01                         |   nop\n 00005a: 01                         |   nop\n 00005b: 01                         |   nop\n 00005c: 01                         |   nop\n 00005d: 01                         |   nop\n 00005e: 01                         |   nop\n 00005f: 01                         |   nop\n 000060: 01                         |   nop\n 000061: 01                         |   nop\n 000062: 01                         |   nop\n 000063: 01                         |   nop\n 000064: 01                         |   nop\n 000065: 01                         |   nop\n 000066: 01                         |   nop\n 000067: 01                         |   nop\n 000068: 01                         |   nop\n 000069: 01                         |   nop\n 00006a: 01                         |   nop\n 00006b: 01                         |   nop\n 00006c: 01                         |   nop\n 00006d: 01                         |   nop\n 00006e: 01                         |   nop\n 00006f: 01                         |   nop\n 000070: 01                         |   nop\n 000071: 01                         |   nop\n 000072: 01                         |   nop\n 000073: 01                         |   nop\n 000074: 01                         |   nop\n 000075: 01                         |   nop\n 000076: 01                         |   nop\n 000077: 01                         |   nop\n 000078: 01                         |   nop\n 000079: 01                         |   nop\n 00007a: 01                         |   nop\n 00007b: 01                         |   nop\n 00007c: 01                         |   nop\n 00007d: 01                         |   nop\n 00007e: 01                         |   nop\n 00007f: 01                         |   nop\n 000080: 01                         |   nop\n 000081: 01                         |   nop\n 000082: 01                         |   nop\n 000083: 01                         |   nop\n 000084: 01                         |   nop\n 000085: 01                         |   nop\n 000086: 01                         |   nop\n 000087: 01                         |   nop\n 000088: 01                         |   nop\n 000089: 01                         |   nop\n 00008a: 01                         |   nop\n 00008b: 01                         |   nop\n 00008c: 01                         |   nop\n 00008d: 01                         |   nop\n 00008e: 01                         |   nop\n 00008f: 01                         |   nop\n 000090: 01                         |   nop\n 000091: 01                         |   nop\n 000092: 01                         |   nop\n 000093: 01                         |   nop\n 000094: 01                         |   nop\n 000095: 01                         |   nop\n 000096: 01                         |   nop\n 000097: 01                         |   nop\n 000098: 01                         |   nop\n 000099: 01                         |   nop\n 00009a: 01                         |   nop\n 00009b: 01                         |   nop\n 00009c: 01                         |   nop\n 00009d: 01                         |   nop\n 00009e: 01                         |   nop\n 00009f: 01                         |   nop\n 0000a0: 01                         |   nop\n 0000a1: 01                         |   nop\n 0000a2: 01                         |   nop\n 0000a3: 01                         |   nop\n 0000a4: 01                         |   nop\n 0000a5: 01                         |   nop\n 0000a6: 01                         |   nop\n 0000a7: 01                         |   nop\n 0000a8: 01                         |   nop\n 0000a9: 01                         |   nop\n 0000aa: 01                         |   nop\n 0000ab: 01                         |   nop\n 0000ac: 01                         |   nop\n 0000ad: 01                         |   nop\n 0000ae: 01                         |   nop\n 0000af: 01                         |   nop\n 0000b0: 01                         |   nop\n 0000b1: 01                         |   nop\n 0000b2: 01                         |   nop\n 0000b3: 01                         |   nop\n 0000b4: 01                         |   nop\n 0000b5: 01                         |   nop\n 0000b6: 01                         |   nop\n 0000b7: 01                         |   nop\n 0000b8: 01                         |   nop\n 0000b9: 01                         |   nop\n 0000ba: 01                         |   nop\n 0000bb: 01                         |   nop\n 0000bc: 01                         |   nop\n 0000bd: 01                         |   nop\n 0000be: 01                         |   nop\n 0000bf: 01                         |   nop\n 0000c0: 01                         |   nop\n 0000c1: 01                         |   nop\n 0000c2: 01                         |   nop\n 0000c3: 01                         |   nop\n 0000c4: 01                         |   nop\n 0000c5: 01                         |   nop\n 0000c6: 01                         |   nop\n 0000c7: 01                         |   nop\n 0000c8: 01                         |   nop\n 0000c9: 01                         |   nop\n 0000ca: 01                         |   nop\n 0000cb: 01                         |   nop\n 0000cc: 01                         |   nop\n 0000cd: 01                         |   nop\n 0000ce: 01                         |   nop\n 0000cf: 01                         |   nop\n 0000d0: 01                         |   nop\n 0000d1: 01                         |   nop\n 0000d2: 01                         |   nop\n 0000d3: 01                         |   nop\n 0000d4: 01                         |   nop\n 0000d5: 01                         |   nop\n 0000d6: 01                         |   nop\n 0000d7: 01                         |   nop\n 0000d8: 01                         |   nop\n 0000d9: 01                         |   nop\n 0000da: 01                         |   nop\n 0000db: 01                         |   nop\n 0000dc: 01                         |   nop\n 0000dd: 01                         |   nop\n 0000de: 01                         |   nop\n 0000df: 01                         |   nop\n 0000e0: 01                         |   nop\n 0000e1: 01                         |   nop\n 0000e2: 01                         |   nop\n 0000e3: 01                         |   nop\n 0000e4: 01                         |   nop\n 0000e5: 01                         |   nop\n 0000e6: 01                         |   nop\n 0000e7: 01                         |   nop\n 0000e8: 01                         |   nop\n 0000e9: 01                         |   nop\n 0000ea: 01                         |   nop\n 0000eb: 01                         |   nop\n 0000ec: 01                         |   nop\n 0000ed: 01                         |   nop\n 0000ee: 01                         |   nop\n 0000ef: 01                         |   nop\n 0000f0: 01                         |   nop\n 0000f1: 01                         |   nop\n 0000f2: 01                         |   nop\n 0000f3: 01                         |   nop\n 0000f4: 01                         |   nop\n 0000f5: 01                         |   nop\n 0000f6: 01                         |   nop\n 0000f7: 01                         |   nop\n 0000f8: 01                         |   nop\n 0000f9: 01                         |   nop\n 0000fa: 01                         |   nop\n 0000fb: 01                         |   nop\n 0000fc: 01                         |   nop\n 0000fd: 01                         |   nop\n 0000fe: 01                         |   nop\n 0000ff: 01                         |   nop\n 000100: 01                         |   nop\n 000101: 01                         |   nop\n 000102: 01                         |   nop\n 000103: 01                         |   nop\n 000104: 01                         |   nop\n 000105: 01                         |   nop\n 000106: 01                         |   nop\n 000107: 01                         |   nop\n 000108: 01                         |   nop\n 000109: 01                         |   nop\n 00010a: 01                         |   nop\n 00010b: 01                         |   nop\n 00010c: 01                         |   nop\n 00010d: 01                         |   nop\n 00010e: 01                         |   nop\n 00010f: 01                         |   nop\n 000110: 01                         |   nop\n 000111: 01                         |   nop\n 000112: 01                         |   nop\n 000113: 01                         |   nop\n 000114: 01                         |   nop\n 000115: 01                         |   nop\n 000116: 01                         |   nop\n 000117: 01                         |   nop\n 000118: 01                         |   nop\n 000119: 01                         |   nop\n 00011a: 01                         |   nop\n 00011b: 01                         |   nop\n 00011c: 0b                         | end\n 00011d: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/loop-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    loop (result i32 i32)\n      i32.const 1\n      i32.const 2\n    end\n    return)\n\n  (func\n    i32.const 0\n    loop (param i32)\n      drop\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n; func type 1\n000000e: 60                                        ; func\n000000f: 00                                        ; num params\n0000010: 02                                        ; num results\n0000011: 7f                                        ; i32\n0000012: 7f                                        ; i32\n; func type 2\n0000013: 60                                        ; func\n0000014: 01                                        ; num params\n0000015: 7f                                        ; i32\n0000016: 00                                        ; num results\n0000009: 0d                                        ; FIXUP section size\n; section \"Function\" (3)\n0000017: 03                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 02                                        ; num functions\n000001a: 00                                        ; function 0 signature index\n000001b: 00                                        ; function 1 signature index\n0000018: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n000001c: 0a                                        ; section code\n000001d: 00                                        ; section size (guess)\n000001e: 02                                        ; num functions\n; function body 0\n000001f: 00                                        ; func body size (guess)\n0000020: 00                                        ; local decl count\n0000021: 03                                        ; loop\n0000022: 01                                        ; block type function index\n0000023: 41                                        ; i32.const\n0000024: 01                                        ; i32 literal\n0000025: 41                                        ; i32.const\n0000026: 02                                        ; i32 literal\n0000027: 0b                                        ; end\n0000028: 0f                                        ; return\n0000029: 0b                                        ; end\n000001f: 0a                                        ; FIXUP func body size\n; function body 1\n000002a: 00                                        ; func body size (guess)\n000002b: 00                                        ; local decl count\n000002c: 41                                        ; i32.const\n000002d: 00                                        ; i32 literal\n000002e: 03                                        ; loop\n000002f: 02                                        ; block type function index\n0000030: 1a                                        ; drop\n0000031: 0b                                        ; end\n0000032: 0b                                        ; end\n000002a: 08                                        ; FIXUP func body size\n000001d: 15                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nloop-multi.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000020 func[0]:\n 000021: 03 01                      | loop type[1]\n 000023: 41 01                      |   i32.const 1\n 000025: 41 02                      |   i32.const 2\n 000027: 0b                         | end\n 000028: 0f                         | return\n 000029: 0b                         | end\n00002b func[1]:\n 00002c: 41 00                      | i32.const 0\n 00002e: 03 02                      | loop type[2]\n 000030: 1a                         |   drop\n 000031: 0b                         | end\n 000032: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/loop.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    loop\n      nop\n      nop\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 03                                        ; loop\n0000018: 40                                        ; void\n0000019: 01                                        ; nop\n000001a: 01                                        ; nop\n000001b: 0b                                        ; end\n000001c: 0b                                        ; end\n0000015: 07                                        ; FIXUP func body size\n0000013: 09                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nloop.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 03 40                      | loop\n 000019: 01                         |   nop\n 00001a: 01                         |   nop\n 00001b: 0b                         | end\n 00001c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/memory-1-byte.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module (memory 1))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Memory\" (5)\n0000008: 05                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num memories\n; memory 0\n000000b: 00                                        ; limits: flags\n000000c: 01                                        ; limits: initial\n0000009: 03                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nmemory-1-byte.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/memory-data-size.txt",
    "content": ";;; TOOL: run-objdump-spec\n;;; ARGS0: -v\n;;; ARGS1: %(temp_file)s.0.wasm %(temp_file)s.1.wasm %(temp_file)s.2.wasm %(temp_file)s.3.wasm\n(module (memory 1))\n(module (memory 2))\n(module (memory 4))\n(module (memory 5))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Memory\" (5)\n0000008: 05                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num memories\n; memory 0\n000000b: 00                                        ; limits: flags\n000000c: 01                                        ; limits: initial\n0000009: 03                                        ; FIXUP section size\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Memory\" (5)\n0000008: 05                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num memories\n; memory 0\n000000b: 00                                        ; limits: flags\n000000c: 02                                        ; limits: initial\n0000009: 03                                        ; FIXUP section size\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Memory\" (5)\n0000008: 05                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num memories\n; memory 0\n000000b: 00                                        ; limits: flags\n000000c: 04                                        ; limits: initial\n0000009: 03                                        ; FIXUP section size\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Memory\" (5)\n0000008: 05                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num memories\n; memory 0\n000000b: 00                                        ; limits: flags\n000000c: 05                                        ; limits: initial\n0000009: 03                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nmemory-data-size.0.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n\nmemory-data-size.1.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n\nmemory-data-size.2.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n\nmemory-data-size.3.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/memory-grow.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory 1 2)\n  (func (param i32)\n    local.get 0\n    memory.grow\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000013: 05                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num memories\n; memory 0\n0000016: 01                                        ; limits: flags\n0000017: 01                                        ; limits: initial\n0000018: 02                                        ; limits: max\n0000014: 04                                        ; FIXUP section size\n; section \"Code\" (10)\n0000019: 0a                                        ; section code\n000001a: 00                                        ; section size (guess)\n000001b: 01                                        ; num functions\n; function body 0\n000001c: 00                                        ; func body size (guess)\n000001d: 00                                        ; local decl count\n000001e: 20                                        ; local.get\n000001f: 00                                        ; local index\n0000020: 40                                        ; memory.grow\n0000021: 00                                        ; memory.grow memidx\n0000022: 1a                                        ; drop\n0000023: 0b                                        ; end\n000001c: 07                                        ; FIXUP func body size\n000001a: 09                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nmemory-grow.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001d func[0]:\n 00001e: 20 00                      | local.get 0\n 000020: 40 00                      | memory.grow 0\n 000022: 1a                         | drop\n 000023: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/memory-hex.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory\n    (data \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\")))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Memory\" (5)\n0000008: 05                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num memories\n; memory 0\n000000b: 01                                        ; limits: flags\n000000c: 01                                        ; limits: initial\n000000d: 01                                        ; limits: max\n0000009: 04                                        ; FIXUP section size\n; section \"DataCount\" (12)\n000000e: 0c                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; data count\n000000f: 01                                        ; FIXUP section size\n; truncate to 14 (0xe)\n; section \"Data\" (11)\n000000e: 0b                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num data segments\n; data segment header 0\n0000011: 00                                        ; segment flags\n0000012: 41                                        ; i32.const\n0000013: 00                                        ; i32 literal\n0000014: 0b                                        ; end\n0000015: 0b                                        ; data segment size\n; data segment data 0\n0000016: 0001 0203 0405 0607 0809 0a               ; data segment data\n000000f: 11                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nmemory-hex.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/memory-size.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory 1)\n  (func (result i32)\n    memory.size))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7f                                        ; i32\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000013: 05                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num memories\n; memory 0\n0000016: 00                                        ; limits: flags\n0000017: 01                                        ; limits: initial\n0000014: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000018: 0a                                        ; section code\n0000019: 00                                        ; section size (guess)\n000001a: 01                                        ; num functions\n; function body 0\n000001b: 00                                        ; func body size (guess)\n000001c: 00                                        ; local decl count\n000001d: 3f                                        ; memory.size\n000001e: 00                                        ; memory.size memidx\n000001f: 0b                                        ; end\n000001b: 04                                        ; FIXUP func body size\n0000019: 06                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nmemory-size.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001c func[0]:\n 00001d: 3f 00                      | memory.size 0\n 00001f: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/memory.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: -x\n(module\n  (memory 1)\n  (data (i32.const 10) \"hello\")\n  (data (i32.const 2147483648) \"goodbye, Lorem ipsum dolor sit amet, consectetur\"))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Memory\" (5)\n0000008: 05                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num memories\n; memory 0\n000000b: 00                                        ; limits: flags\n000000c: 01                                        ; limits: initial\n0000009: 03                                        ; FIXUP section size\n; section \"DataCount\" (12)\n000000d: 0c                                        ; section code\n000000e: 00                                        ; section size (guess)\n000000f: 02                                        ; data count\n000000e: 01                                        ; FIXUP section size\n; truncate to 13 (0xd)\n; section \"Data\" (11)\n000000d: 0b                                        ; section code\n000000e: 00                                        ; section size (guess)\n000000f: 02                                        ; num data segments\n; data segment header 0\n0000010: 00                                        ; segment flags\n0000011: 41                                        ; i32.const\n0000012: 0a                                        ; i32 literal\n0000013: 0b                                        ; end\n0000014: 05                                        ; data segment size\n; data segment data 0\n0000015: 6865 6c6c 6f                              ; data segment data\n; data segment header 1\n000001a: 00                                        ; segment flags\n000001b: 41                                        ; i32.const\n000001c: 8080 8080 78                              ; i32 literal\n0000021: 0b                                        ; end\n0000022: 30                                        ; data segment size\n; data segment data 1\n0000023: 676f 6f64 6279 652c 204c 6f72 656d 2069 \n0000033: 7073 756d 2064 6f6c 6f72 2073 6974 2061 \n0000043: 6d65 742c 2063 6f6e 7365 6374 6574 7572   ; data segment data\n000000e: 44                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nmemory.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nMemory[1]:\n - memory[0] pages: initial=1\nData[2]:\n - segment[0] memory=0 size=5 - init i32=10\n  - 000000a: 6865 6c6c 6f                             hello\n - segment[1] memory=0 size=48 - init i32=2147483648\n  - 80000000: 676f 6f64 6279 652c 204c 6f72 656d 2069  goodbye, Lorem i\n  - 80000010: 7073 756d 2064 6f6c 6f72 2073 6974 2061  psum dolor sit a\n  - 80000020: 6d65 742c 2063 6f6e 7365 6374 6574 7572  met, consectetur\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/memory64.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: --enable-all\n;;; ARGS1: -h -x\n\n(module\n  (import \"env\" \"table\" (table i64 42 funcref))\n  (import \"env\" \"memory\" (memory i64 2))\n  (memory i64 1)\n  (table i64 1 funcref)\n  (data (i64.const 1) \"a\")\n)\n(;; STDOUT ;;;\n\nmemory64.wasm:\tfile format wasm 0x1\n\nSections:\n\n   Import start=0x0000000a end=0x00000026 (size=0x0000001c) count: 2\n    Table start=0x00000028 end=0x0000002c (size=0x00000004) count: 1\n   Memory start=0x0000002e end=0x00000031 (size=0x00000003) count: 1\n     Data start=0x00000033 end=0x0000003a (size=0x00000007) count: 1\n\nSection Details:\n\nImport[2]:\n - table[0] type=funcref initial=42 i64 <- env.table\n - memory[0] pages: initial=2 i64 <- env.memory\nTable[1]:\n - table[1] type=funcref initial=1 i64\nMemory[1]:\n - memory[1] pages: initial=1 i64\nData[1]:\n - segment[0] memory=0 size=1 - init i64=1\n  - 0000001: 61                                       a\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/module-name.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --debug-names\n;;; ARGS1: -x\n(module $my_module)\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"name\"\n0000008: 00                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 04                                        ; string length\n000000b: 6e61 6d65                                name  ; custom section name\n000000f: 00                                        ; module name type\n0000010: 00                                        ; subsection size (guess)\n0000011: 09                                        ; string length\n0000012: 6d79 5f6d 6f64 756c 65                   my_module  ; module name\n0000010: 0a                                        ; FIXUP subsection size\n000001b: 02                                        ; local name type\n000001c: 00                                        ; subsection size (guess)\n000001d: 00                                        ; num functions\n000001c: 01                                        ; FIXUP subsection size\n0000009: 14                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nmodule-name.wasm:\tfile format wasm 0x1\nmodule name: <my_module>\n\nSection Details:\n\nCustom:\n - name: \"name\"\n - module <my_module>\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/multi_file.txt",
    "content": ";;; TOOL: run-objdump-spec\n;;; ARGS1: --headers %(temp_file)s.0.wasm %(temp_file)s.1.wasm\n(module\n  (func (param $param2 i64))\n)\n(module\n  (func (param $param2 i64))\n)\n(;; STDOUT ;;;\n\nmulti_file.0.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000f (size=0x00000005) count: 1\n Function start=0x00000011 end=0x00000013 (size=0x00000002) count: 1\n     Code start=0x00000015 end=0x00000019 (size=0x00000004) count: 1\n\nCode Disassembly:\n\n000017 func[0]:\n 000018: 0b                         | end\n\nmulti_file.1.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000f (size=0x00000005) count: 1\n Function start=0x00000011 end=0x00000013 (size=0x00000002) count: 1\n     Code start=0x00000015 end=0x00000019 (size=0x00000004) count: 1\n\nCode Disassembly:\n\n000017 func[0]:\n 000018: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/mutable-global.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: -x\n(module\n  (import \"foo\" \"imported\" (global (mut i32)))\n  (global (export \"exported\") (mut i32) (i32.const 1)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Import\" (2)\n0000008: 02                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num imports\n; import header 0\n000000b: 03                                        ; string length\n000000c: 666f 6f                                  foo  ; import module name\n000000f: 08                                        ; string length\n0000010: 696d 706f 7274 6564                      imported  ; import field name\n0000018: 03                                        ; import kind\n0000019: 7f                                        ; i32\n000001a: 01                                        ; global mutability\n0000009: 11                                        ; FIXUP section size\n; section \"Global\" (6)\n000001b: 06                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 01                                        ; num globals\n000001e: 7f                                        ; i32\n000001f: 01                                        ; global mutability\n0000020: 41                                        ; i32.const\n0000021: 01                                        ; i32 literal\n0000022: 0b                                        ; end\n000001c: 06                                        ; FIXUP section size\n; section \"Export\" (7)\n0000023: 07                                        ; section code\n0000024: 00                                        ; section size (guess)\n0000025: 01                                        ; num exports\n0000026: 08                                        ; string length\n0000027: 6578 706f 7274 6564                      exported  ; export name\n000002f: 03                                        ; export kind\n0000030: 01                                        ; export global index\n0000024: 0c                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nmutable-global.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nImport[1]:\n - global[0] i32 mutable=1 <- foo.imported\nGlobal[1]:\n - global[1] i32 mutable=1 <exported> - init i32=1\nExport[1]:\n - global[1] -> \"exported\"\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/no-canonicalize.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --no-canonicalize-leb128s\n(module\n  (import \"stdio\" \"print\" (func (param i32)))\n  (memory 100)\n  (export \"f1\" (func $f1))\n  (table funcref (elem $f2 $f3))\n  (type $t (func (param i32) (result i32)))\n  (func $f1 (param i32 i32)\n    local.get 0\n    local.get 1\n    call_indirect (type $t)\n    drop)\n  (func $f2 (param i32)\n    local.get 0\n    i32.const 1\n    i32.add\n    drop)\n  (func $f3 (param i32)\n    local.get 0\n    i32.const 2\n    i32.mul\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 0000 0000 00                              ; section size (guess)\n000000e: 03                                        ; num types\n; func type 0\n000000f: 60                                        ; func\n0000010: 01                                        ; num params\n0000011: 7f                                        ; i32\n0000012: 01                                        ; num results\n0000013: 7f                                        ; i32\n; func type 1\n0000014: 60                                        ; func\n0000015: 01                                        ; num params\n0000016: 7f                                        ; i32\n0000017: 00                                        ; num results\n; func type 2\n0000018: 60                                        ; func\n0000019: 02                                        ; num params\n000001a: 7f                                        ; i32\n000001b: 7f                                        ; i32\n000001c: 00                                        ; num results\n0000009: 8f80 8080 00                              ; FIXUP section size\n; section \"Import\" (2)\n000001d: 02                                        ; section code\n000001e: 0000 0000 00                              ; section size (guess)\n0000023: 01                                        ; num imports\n; import header 0\n0000024: 05                                        ; string length\n0000025: 7374 6469 6f                             stdio  ; import module name\n000002a: 05                                        ; string length\n000002b: 7072 696e 74                             print  ; import field name\n0000030: 00                                        ; import kind\n0000031: 01                                        ; import signature index\n000001e: 8f80 8080 00                              ; FIXUP section size\n; section \"Function\" (3)\n0000032: 03                                        ; section code\n0000033: 0000 0000 00                              ; section size (guess)\n0000038: 03                                        ; num functions\n0000039: 02                                        ; function 0 signature index\n000003a: 01                                        ; function 1 signature index\n000003b: 01                                        ; function 2 signature index\n0000033: 8480 8080 00                              ; FIXUP section size\n; section \"Table\" (4)\n000003c: 04                                        ; section code\n000003d: 0000 0000 00                              ; section size (guess)\n0000042: 01                                        ; num tables\n; table 0\n0000043: 70                                        ; funcref\n0000044: 01                                        ; limits: flags\n0000045: 02                                        ; limits: initial\n0000046: 02                                        ; limits: max\n000003d: 8580 8080 00                              ; FIXUP section size\n; section \"Memory\" (5)\n0000047: 05                                        ; section code\n0000048: 0000 0000 00                              ; section size (guess)\n000004d: 01                                        ; num memories\n; memory 0\n000004e: 00                                        ; limits: flags\n000004f: 64                                        ; limits: initial\n0000048: 8380 8080 00                              ; FIXUP section size\n; section \"Export\" (7)\n0000050: 07                                        ; section code\n0000051: 0000 0000 00                              ; section size (guess)\n0000056: 01                                        ; num exports\n0000057: 02                                        ; string length\n0000058: 6631                                     f1  ; export name\n000005a: 00                                        ; export kind\n000005b: 01                                        ; export func index\n0000051: 8680 8080 00                              ; FIXUP section size\n; section \"Elem\" (9)\n000005c: 09                                        ; section code\n000005d: 0000 0000 00                              ; section size (guess)\n0000062: 01                                        ; num elem segments\n; elem segment header 0\n0000063: 00                                        ; segment flags\n0000064: 41                                        ; i32.const\n0000065: 00                                        ; i32 literal\n0000066: 0b                                        ; end\n0000067: 02                                        ; num elems\n0000068: 02                                        ; elem function index\n0000069: 03                                        ; elem function index\n000005d: 8880 8080 00                              ; FIXUP section size\n; section \"Code\" (10)\n000006a: 0a                                        ; section code\n000006b: 0000 0000 00                              ; section size (guess)\n0000070: 03                                        ; num functions\n; function body 0\n0000071: 0000 0000 00                              ; func body size (guess)\n0000076: 00                                        ; local decl count\n0000077: 20                                        ; local.get\n0000078: 00                                        ; local index\n0000079: 20                                        ; local.get\n000007a: 01                                        ; local index\n000007b: 11                                        ; call_indirect\n000007c: 00                                        ; signature index\n000007d: 00                                        ; table index\n000007e: 1a                                        ; drop\n000007f: 0b                                        ; end\n0000071: 8a80 8080 00                              ; FIXUP func body size\n; function body 1\n0000080: 0000 0000 00                              ; func body size (guess)\n0000085: 00                                        ; local decl count\n0000086: 20                                        ; local.get\n0000087: 00                                        ; local index\n0000088: 41                                        ; i32.const\n0000089: 01                                        ; i32 literal\n000008a: 6a                                        ; i32.add\n000008b: 1a                                        ; drop\n000008c: 0b                                        ; end\n0000080: 8880 8080 00                              ; FIXUP func body size\n; function body 2\n000008d: 0000 0000 00                              ; func body size (guess)\n0000092: 00                                        ; local decl count\n0000093: 20                                        ; local.get\n0000094: 00                                        ; local index\n0000095: 41                                        ; i32.const\n0000096: 02                                        ; i32 literal\n0000097: 6c                                        ; i32.mul\n0000098: 1a                                        ; drop\n0000099: 0b                                        ; end\n000008d: 8880 8080 00                              ; FIXUP func body size\n000006b: aa80 8080 00                              ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nno-canonicalize.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000076 func[1] <f1>:\n 000077: 20 00                      | local.get 0\n 000079: 20 01                      | local.get 1\n 00007b: 11 00 00                   | call_indirect 0 (type 0)\n 00007e: 1a                         | drop\n 00007f: 0b                         | end\n000085 func[2]:\n 000086: 20 00                      | local.get 0\n 000088: 41 01                      | i32.const 1\n 00008a: 6a                         | i32.add\n 00008b: 1a                         | drop\n 00008c: 0b                         | end\n000092 func[3]:\n 000093: 20 00                      | local.get 0\n 000095: 41 02                      | i32.const 2\n 000097: 6c                         | i32.mul\n 000098: 1a                         | drop\n 000099: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/nocheck.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --no-check\n(module\n  (func (result i64)\n    f32.const 1\n    f64.const 2\n    i32.add)\n  (export \"foo\" (func 0)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7e                                        ; i64\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Export\" (7)\n0000013: 07                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num exports\n0000016: 03                                        ; string length\n0000017: 666f 6f                                  foo  ; export name\n000001a: 00                                        ; export kind\n000001b: 00                                        ; export func index\n0000014: 07                                        ; FIXUP section size\n; section \"Code\" (10)\n000001c: 0a                                        ; section code\n000001d: 00                                        ; section size (guess)\n000001e: 01                                        ; num functions\n; function body 0\n000001f: 00                                        ; func body size (guess)\n0000020: 00                                        ; local decl count\n0000021: 43                                        ; f32.const\n0000022: 0000 803f                                 ; f32 literal\n0000026: 44                                        ; f64.const\n0000027: 0000 0000 0000 0040                       ; f64 literal\n000002f: 6a                                        ; i32.add\n0000030: 0b                                        ; end\n000001f: 11                                        ; FIXUP func body size\n000001d: 13                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nnocheck.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000020 func[0] <foo>:\n 000021: 43 00 00 80 3f             | f32.const 0x1p+0\n 000026: 44 00 00 00 00 00 00 00 40 | f64.const 0x1p+1\n 00002f: 6a                         | i32.add\n 000030: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/noncanon-leb128-opcode.txt",
    "content": ";;; TOOL: run-objdump-spec\n;;; ARGS0: -v\n;;; ARGS1: %(temp_file)s.0.wasm\n(module binary\n\"\\00\\61\\73\\6d\\01\\00\\00\\00\\01\\0a\\02\\60\\00\\01\\7f\\60\\01\\7f\\01\\7f\\03\\02\\01\\01\\04\\05\\01\\70\\01\\01\\09\\07\\08\\01\\04\\6d\\61\\69\\6e\\00\\00\\0a\\27\\01\\25\\01\\03\\7e\\20\\00\\41\\d6\\49\\02\\7f\\41\\fe\\20\\0c\\00\\68\\fc\\0e\\00\\00\\0b\\20\\00\\68\\fc\\10\\00\\68\\fc\\90\\80\\00\\00\\00\\26\\00\\0b\"\n)\n(;; STDERR ;;;\n0000000: 0061 736d 0100 0000 010a 0260 0001 7f60 \n0000010: 017f 017f 0302 0101 0405 0170 0101 0907 \n0000020: 0801 046d 6169 6e00 000a 2701 2501 037e \n0000030: 2000 41d6 4902 7f41 fe20 0c00 68fc 0e00 \n0000040: 000b 2000 68fc 1000 68fc 9080 0000 0026 \n0000050: 000b                                      ; \n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nnoncanon-leb128-opcode.0.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00002d func[0] <main>:\n 00002e: 03 7e                      | local[1..3] type=i64\n 000030: 20 00                      | local.get 0\n 000032: 41 d6 49                   | i32.const 4294960342\n 000035: 02 7f                      | block i32\n 000037: 41 fe 20                   |   i32.const 4222\n 00003a: 0c 00                      |   br 0\n 00003c: 68                         |   i32.ctz\n 00003d: fc 0e 00 00                |   table.copy 0 0\n 000041: 0b                         | end\n 000042: 20 00                      | local.get 0\n 000044: 68                         | i32.ctz\n 000045: fc 10 00                   | table.size 0\n 000048: 68                         | i32.ctz\n 00004b: 80 00 00                   | table.size 0\n 00004e: 00                         | unreachable\n 00004f: 26 00                      | table.set 0\n 000051: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/nop.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func \n    nop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 01                                        ; nop\n0000018: 0b                                        ; end\n0000015: 03                                        ; FIXUP func body size\n0000013: 05                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nnop.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 01                         | nop\n 000018: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/param-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (param i32 i64 f32 f64)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 04                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 7e                                        ; i64\n000000f: 7d                                        ; f32\n0000010: 7c                                        ; f64\n0000011: 00                                        ; num results\n0000009: 08                                        ; FIXUP section size\n; section \"Function\" (3)\n0000012: 03                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n0000015: 00                                        ; function 0 signature index\n0000013: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000016: 0a                                        ; section code\n0000017: 00                                        ; section size (guess)\n0000018: 01                                        ; num functions\n; function body 0\n0000019: 00                                        ; func body size (guess)\n000001a: 00                                        ; local decl count\n000001b: 0b                                        ; end\n0000019: 02                                        ; FIXUP func body size\n0000017: 04                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nparam-multi.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001a func[0]:\n 00001b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/reference-types.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS1: -x\n\n(module\n  (table $foo 1 externref)\n  (table $bar 1 externref)\n  (table $baz 1 funcref)\n  (elem (table $baz) (i32.const 0) $f1)\n  (elem funcref (ref.null func))\n\n  (func $f1 (result externref)\n    i32.const 0\n    table.get $foo\n  )\n  (func (result externref)\n    i32.const 0\n    table.get $bar\n  )\n\n  (func (param externref)\n    i32.const 0\n    local.get 0\n    table.set $foo\n  )\n  (func (param externref)\n    i32.const 0\n    local.get 0\n    table.set $bar\n  )\n\n  (func (result i32)\n    ref.null extern\n    i32.const 0\n    table.grow $foo\n  )\n  (func (result i32)\n    ref.null extern\n    i32.const 0\n    table.grow $bar\n  )\n\n  (func (param externref) (result i32)\n    local.get 0\n    ref.is_null\n  )\n\n\n  (func (result i32)\n    table.size $foo\n  )\n  (func (result i32)\n    table.size $bar\n  )\n  (func (result i32)\n    table.size $baz\n  )\n)\n(;; STDOUT ;;;\n\nreference-types.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[4]:\n - type[0] () -> externref\n - type[1] (externref) -> nil\n - type[2] () -> i32\n - type[3] (externref) -> i32\nFunction[10]:\n - func[0] sig=0\n - func[1] sig=0\n - func[2] sig=1\n - func[3] sig=1\n - func[4] sig=2\n - func[5] sig=2\n - func[6] sig=3\n - func[7] sig=2\n - func[8] sig=2\n - func[9] sig=2\nTable[3]:\n - table[0] type=externref initial=1\n - table[1] type=externref initial=1\n - table[2] type=funcref initial=1\nElem[2]:\n - segment[0] flags=2 table=2 count=1 - init i32=0\n  - elem[0] = ref.func:0\n - segment[1] flags=5 table=0 count=1\n  - elem[0] = ref.null funcref\nCode[10]:\n - func[0] size=6\n - func[1] size=6\n - func[2] size=8\n - func[3] size=8\n - func[4] size=9\n - func[5] size=9\n - func[6] size=5\n - func[7] size=5\n - func[8] size=5\n - func[9] size=5\n\nCode Disassembly:\n\n00004a func[0]:\n 00004b: 41 00                      | i32.const 0\n 00004d: 25 00                      | table.get 0\n 00004f: 0b                         | end\n000051 func[1]:\n 000052: 41 00                      | i32.const 0\n 000054: 25 01                      | table.get 1\n 000056: 0b                         | end\n000058 func[2]:\n 000059: 41 00                      | i32.const 0\n 00005b: 20 00                      | local.get 0\n 00005d: 26 00                      | table.set 0\n 00005f: 0b                         | end\n000061 func[3]:\n 000062: 41 00                      | i32.const 0\n 000064: 20 00                      | local.get 0\n 000066: 26 01                      | table.set 1\n 000068: 0b                         | end\n00006a func[4]:\n 00006b: d0 6f                      | ref.null extern\n 00006d: 41 00                      | i32.const 0\n 00006f: fc 0f 00                   | table.grow 0\n 000072: 0b                         | end\n000074 func[5]:\n 000075: d0 6f                      | ref.null extern\n 000077: 41 00                      | i32.const 0\n 000079: fc 0f 01                   | table.grow 1\n 00007c: 0b                         | end\n00007e func[6]:\n 00007f: 20 00                      | local.get 0\n 000081: d1                         | ref.is_null\n 000082: 0b                         | end\n000084 func[7]:\n 000085: fc 10 00                   | table.size 0\n 000088: 0b                         | end\n00008a func[8]:\n 00008b: fc 10 01                   | table.size 1\n 00008e: 0b                         | end\n000090 func[9]:\n 000091: fc 10 02                   | table.size 2\n 000094: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/relocations-all-features.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -r --enable-all\n;;; ARGS1: --headers --details\n(module\n  (type $t (func (param i32)))\n  (import \"__extern\" \"foo\" (func (param i32) (result i32)))\n  (import \"__extern\" \"bar\" (func (param i32) (param i32) (result i32)))\n  (global $g i32 (i32.const 0))\n  (func $f (param i32) (result i32)\n    global.get 0\n    call 2\n    call 0\n    i32.const 1234\n    i32.const 0\n    call_indirect (param i32) (param i32) (result i32))\n  (export \"f\" (func $f))\n  (table funcref (elem 1)))\n(;; STDOUT ;;;\n\nrelocations-all-features.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000001a (size=0x00000010) count: 3\n   Import start=0x0000001c end=0x00000035 (size=0x00000019) count: 2\n Function start=0x00000037 end=0x00000039 (size=0x00000002) count: 1\n    Table start=0x0000003b end=0x00000040 (size=0x00000005) count: 1\n   Global start=0x00000042 end=0x00000048 (size=0x00000006) count: 1\n   Export start=0x0000004a end=0x0000004f (size=0x00000005) count: 1\n     Elem start=0x00000051 end=0x0000005e (size=0x0000000d) count: 1\n     Code start=0x00000060 end=0x00000086 (size=0x00000026) count: 1\n   Custom start=0x00000088 end=0x000000a9 (size=0x00000021) \"linking\"\n   Custom start=0x000000ab end=0x000000bb (size=0x00000010) \"reloc.Elem\"\n   Custom start=0x000000bd end=0x000000d9 (size=0x0000001c) \"reloc.Code\"\n\nSection Details:\n\nType[3]:\n - type[0] (i32) -> nil\n - type[1] (i32) -> i32\n - type[2] (i32, i32) -> i32\nImport[2]:\n - func[0] sig=1 <__extern.foo> <- __extern.foo\n - func[1] sig=2 <__extern.bar> <- __extern.bar\nFunction[1]:\n - func[2] sig=1 <f>\nTable[1]:\n - table[0] type=funcref initial=1 max=1\nGlobal[1]:\n - global[0] i32 mutable=0 <g> - init i32=0\nExport[1]:\n - func[2] <f> -> \"f\"\nElem[1]:\n - segment[0] flags=4 table=0 count=1 - init i32=0\n  - elem[0] = ref.func:1 <__extern.bar>\nCode[1]:\n - func[2] size=36 <f>\nCustom:\n - name: \"linking\"\n  - symbol table [count=5]\n   - 0: F <__extern.foo> func=0 [ undefined binding=global vis=default ]\n   - 1: F <__extern.bar> func=1 [ undefined binding=global vis=default ]\n   - 2: F <f> func=2 [ exported no_strip binding=global vis=hidden ]\n   - 3: T <> table=0 [ binding=local vis=hidden ]\n   - 4: G <g> global=0 [ binding=global vis=default ]\nCustom:\n - name: \"reloc.Elem\"\n  - relocations for section: 6 (Elem) [1]\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x000007(file=0x000058) symbol=1 <__extern.bar>\nCustom:\n - name: \"reloc.Code\"\n  - relocations for section: 7 (Code) [5]\n   - R_WASM_GLOBAL_INDEX_LEB offset=0x000004(file=0x000064) symbol=4 <g>\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x00000a(file=0x00006a) symbol=2 <f>\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x000010(file=0x000070) symbol=0 <__extern.foo>\n   - R_WASM_TYPE_INDEX_LEB offset=0x00001b(file=0x00007b) type=2\n   - R_WASM_TABLE_NUMBER_LEB offset=0x000020(file=0x000080) symbol=3 <>\n\nCode Disassembly:\n\n000062 func[2] <f>:\n 000063: 23 80 80 80 80 00          | global.get 0 <g>\n           000064: R_WASM_GLOBAL_INDEX_LEB 4 <g>\n 000069: 10 82 80 80 80 00          | call 2 <f>\n           00006a: R_WASM_FUNCTION_INDEX_LEB 2 <f>\n 00006f: 10 80 80 80 80 00          | call 0 <__extern.foo>\n           000070: R_WASM_FUNCTION_INDEX_LEB 0 <__extern.foo>\n 000075: 41 d2 09                   | i32.const 1234\n 000078: 41 00                      | i32.const 0\n 00007a: 11 82 80 80 80 00 80 80 80 | call_indirect 0 (type 2)\n 000083: 80 00                      | \n           00007b: R_WASM_TYPE_INDEX_LEB 2\n 000085: 0b                         | end\n           000080: R_WASM_TABLE_NUMBER_LEB 3 <>\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/relocations-block-types.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -r\n;;; ARGS1: -x\n(module\n  (func $multivalue_block (param i32) (result i32 i32)\n    (if (result i32 i32)\n        (local.get 0)\n        (then\n            i32.const 0\n            i32.const 1)\n        (else\n            i32.const 2\n            i32.const 3)))\n  (export \"multivalue_block\" (func $multivalue_block)))\n(;; STDOUT ;;;\n\nrelocations-block-types.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[2]:\n - type[0] (i32) -> (i32, i32)\n - type[1] () -> (i32, i32)\nFunction[1]:\n - func[0] sig=0 <multivalue_block>\nExport[1]:\n - func[0] <multivalue_block> -> \"multivalue_block\"\nCode[1]:\n - func[0] size=20 <multivalue_block>\nCustom:\n - name: \"linking\"\n  - symbol table [count=1]\n   - 0: F <multivalue_block> func=0 [ exported no_strip binding=global vis=hidden ]\nCustom:\n - name: \"reloc.Code\"\n  - relocations for section: 3 (Code) [1]\n   - R_WASM_TYPE_INDEX_LEB offset=0x000006(file=0x000038) type=1\n\nCode Disassembly:\n\n000034 func[0] <multivalue_block>:\n 000035: 20 00                      | local.get 0\n 000037: 04 81 80 80 80 00          | if type[1]\n           000038: R_WASM_TYPE_INDEX_LEB 1\n 00003d: 41 00                      |   i32.const 0\n 00003f: 41 01                      |   i32.const 1\n 000041: 05                         | else\n 000042: 41 02                      |   i32.const 2\n 000044: 41 03                      |   i32.const 3\n 000046: 0b                         | end\n 000047: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/relocations-long-func-bodies.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -r\n;;; ARGS1:\n(module\n  (global $g i32 (i32.const 0))\n  (func $previous_func\n    (drop (global.get 0)))\n  (func $long_func\n    (drop (global.get 0))\n    (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0))\n    (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0))\n    (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0))\n    (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0))\n    (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0))\n    (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0))\n    (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0))\n  )\n  (export \"long_func\" (func $long_func)))\n(;; STDOUT ;;;\n\nrelocations-long-func-bodies.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00002e func[0] <previous_func>:\n 00002f: 23 80 80 80 80 00          | global.get 0 <g>\n           000030: R_WASM_GLOBAL_INDEX_LEB 2 <g>\n 000035: 1a                         | drop\n 000036: 0b                         | end\n000038 func[1] <long_func>:\n 000039: 23 80 80 80 80 00          | global.get 0 <g>\n           00003a: R_WASM_GLOBAL_INDEX_LEB 2 <g>\n 00003f: 1a                         | drop\n 000040: 41 00                      | i32.const 0\n 000042: 1a                         | drop\n 000043: 41 00                      | i32.const 0\n 000045: 1a                         | drop\n 000046: 41 00                      | i32.const 0\n 000048: 1a                         | drop\n 000049: 41 00                      | i32.const 0\n 00004b: 1a                         | drop\n 00004c: 41 00                      | i32.const 0\n 00004e: 1a                         | drop\n 00004f: 41 00                      | i32.const 0\n 000051: 1a                         | drop\n 000052: 41 00                      | i32.const 0\n 000054: 1a                         | drop\n 000055: 41 00                      | i32.const 0\n 000057: 1a                         | drop\n 000058: 41 00                      | i32.const 0\n 00005a: 1a                         | drop\n 00005b: 41 00                      | i32.const 0\n 00005d: 1a                         | drop\n 00005e: 41 00                      | i32.const 0\n 000060: 1a                         | drop\n 000061: 41 00                      | i32.const 0\n 000063: 1a                         | drop\n 000064: 41 00                      | i32.const 0\n 000066: 1a                         | drop\n 000067: 41 00                      | i32.const 0\n 000069: 1a                         | drop\n 00006a: 41 00                      | i32.const 0\n 00006c: 1a                         | drop\n 00006d: 41 00                      | i32.const 0\n 00006f: 1a                         | drop\n 000070: 41 00                      | i32.const 0\n 000072: 1a                         | drop\n 000073: 41 00                      | i32.const 0\n 000075: 1a                         | drop\n 000076: 41 00                      | i32.const 0\n 000078: 1a                         | drop\n 000079: 41 00                      | i32.const 0\n 00007b: 1a                         | drop\n 00007c: 41 00                      | i32.const 0\n 00007e: 1a                         | drop\n 00007f: 41 00                      | i32.const 0\n 000081: 1a                         | drop\n 000082: 41 00                      | i32.const 0\n 000084: 1a                         | drop\n 000085: 41 00                      | i32.const 0\n 000087: 1a                         | drop\n 000088: 41 00                      | i32.const 0\n 00008a: 1a                         | drop\n 00008b: 41 00                      | i32.const 0\n 00008d: 1a                         | drop\n 00008e: 41 00                      | i32.const 0\n 000090: 1a                         | drop\n 000091: 41 00                      | i32.const 0\n 000093: 1a                         | drop\n 000094: 41 00                      | i32.const 0\n 000096: 1a                         | drop\n 000097: 41 00                      | i32.const 0\n 000099: 1a                         | drop\n 00009a: 41 00                      | i32.const 0\n 00009c: 1a                         | drop\n 00009d: 41 00                      | i32.const 0\n 00009f: 1a                         | drop\n 0000a0: 41 00                      | i32.const 0\n 0000a2: 1a                         | drop\n 0000a3: 41 00                      | i32.const 0\n 0000a5: 1a                         | drop\n 0000a6: 41 00                      | i32.const 0\n 0000a8: 1a                         | drop\n 0000a9: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/relocations-long-func-section.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -r\n;;; ARGS1:\n(module\n    (global $a i32 (i32.const 0))\n    (func $0\n        (drop (global.get $a))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0)))\n    (func $1\n        (drop (global.get $a))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))\n        (drop (i32.const 0))))\n(;; STDOUT ;;;\n\nrelocations-long-func-section.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000020 func[0] <0>:\n 000021: 23 80 80 80 80 00          | global.get 0 <a>\n           000022: R_WASM_GLOBAL_INDEX_LEB 2 <a>\n 000027: 1a                         | drop\n 000028: 41 00                      | i32.const 0\n 00002a: 1a                         | drop\n 00002b: 41 00                      | i32.const 0\n 00002d: 1a                         | drop\n 00002e: 41 00                      | i32.const 0\n 000030: 1a                         | drop\n 000031: 41 00                      | i32.const 0\n 000033: 1a                         | drop\n 000034: 41 00                      | i32.const 0\n 000036: 1a                         | drop\n 000037: 41 00                      | i32.const 0\n 000039: 1a                         | drop\n 00003a: 41 00                      | i32.const 0\n 00003c: 1a                         | drop\n 00003d: 41 00                      | i32.const 0\n 00003f: 1a                         | drop\n 000040: 41 00                      | i32.const 0\n 000042: 1a                         | drop\n 000043: 41 00                      | i32.const 0\n 000045: 1a                         | drop\n 000046: 41 00                      | i32.const 0\n 000048: 1a                         | drop\n 000049: 41 00                      | i32.const 0\n 00004b: 1a                         | drop\n 00004c: 41 00                      | i32.const 0\n 00004e: 1a                         | drop\n 00004f: 41 00                      | i32.const 0\n 000051: 1a                         | drop\n 000052: 41 00                      | i32.const 0\n 000054: 1a                         | drop\n 000055: 41 00                      | i32.const 0\n 000057: 1a                         | drop\n 000058: 41 00                      | i32.const 0\n 00005a: 1a                         | drop\n 00005b: 41 00                      | i32.const 0\n 00005d: 1a                         | drop\n 00005e: 41 00                      | i32.const 0\n 000060: 1a                         | drop\n 000061: 41 00                      | i32.const 0\n 000063: 1a                         | drop\n 000064: 41 00                      | i32.const 0\n 000066: 1a                         | drop\n 000067: 0b                         | end\n000069 func[1] <1>:\n 00006a: 23 80 80 80 80 00          | global.get 0 <a>\n           00006b: R_WASM_GLOBAL_INDEX_LEB 2 <a>\n 000070: 1a                         | drop\n 000071: 41 00                      | i32.const 0\n 000073: 1a                         | drop\n 000074: 41 00                      | i32.const 0\n 000076: 1a                         | drop\n 000077: 41 00                      | i32.const 0\n 000079: 1a                         | drop\n 00007a: 41 00                      | i32.const 0\n 00007c: 1a                         | drop\n 00007d: 41 00                      | i32.const 0\n 00007f: 1a                         | drop\n 000080: 41 00                      | i32.const 0\n 000082: 1a                         | drop\n 000083: 41 00                      | i32.const 0\n 000085: 1a                         | drop\n 000086: 41 00                      | i32.const 0\n 000088: 1a                         | drop\n 000089: 41 00                      | i32.const 0\n 00008b: 1a                         | drop\n 00008c: 41 00                      | i32.const 0\n 00008e: 1a                         | drop\n 00008f: 41 00                      | i32.const 0\n 000091: 1a                         | drop\n 000092: 41 00                      | i32.const 0\n 000094: 1a                         | drop\n 000095: 41 00                      | i32.const 0\n 000097: 1a                         | drop\n 000098: 41 00                      | i32.const 0\n 00009a: 1a                         | drop\n 00009b: 41 00                      | i32.const 0\n 00009d: 1a                         | drop\n 00009e: 41 00                      | i32.const 0\n 0000a0: 1a                         | drop\n 0000a1: 41 00                      | i32.const 0\n 0000a3: 1a                         | drop\n 0000a4: 41 00                      | i32.const 0\n 0000a6: 1a                         | drop\n 0000a7: 41 00                      | i32.const 0\n 0000a9: 1a                         | drop\n 0000aa: 41 00                      | i32.const 0\n 0000ac: 1a                         | drop\n 0000ad: 41 00                      | i32.const 0\n 0000af: 1a                         | drop\n 0000b0: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/relocations-section-target.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -r\n;;; ARGS1: -x\n(module\n  (type (;0;) (func))\n  (import \"env\" \"b\" (func (;0;) (type 0)))\n  (func $a (type 0)\n    call 0)\n  (export \"a\" (func $a)))\n(;; STDOUT ;;;\n\nrelocations-section-target.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nImport[1]:\n - func[0] sig=0 <env.b> <- env.b\nFunction[1]:\n - func[1] sig=0 <a>\nExport[1]:\n - func[1] <a> -> \"a\"\nCode[1]:\n - func[1] size=8 <a>\nCustom:\n - name: \"linking\"\n  - symbol table [count=2]\n   - 0: F <env.b> func=0 [ undefined binding=global vis=default ]\n   - 1: F <a> func=1 [ exported no_strip binding=global vis=hidden ]\nCustom:\n - name: \"reloc.Code\"\n  - relocations for section: 4 (Code) [1]\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x000004(file=0x00002a) symbol=0 <env.b>\n\nCode Disassembly:\n\n000028 func[1] <a>:\n 000029: 10 80 80 80 80 00          | call 0 <env.b>\n           00002a: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>\n 00002f: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/relocations.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -r\n;;; ARGS1: --headers --details\n(module\n  (type $t (func (param i32)))\n  (import \"__extern\" \"foo\" (func (param i32) (result i32)))\n  (import \"__extern\" \"bar\" (func (param i32) (param i32) (result i32)))\n  (global $g i32 (i32.const 0))\n  (func $f (param i32) (result i32)\n    global.get 0\n    call 2\n    call 0\n    i32.const 1234\n    i32.const 0\n    call_indirect (param i32) (param i32) (result i32))\n  (export \"f\" (func $f))\n  (table funcref (elem 1)))\n(;; STDOUT ;;;\n\nrelocations.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000001a (size=0x00000010) count: 3\n   Import start=0x0000001c end=0x0000003b (size=0x0000001f) count: 2\n Function start=0x0000003d end=0x0000003f (size=0x00000002) count: 1\n    Table start=0x00000041 end=0x00000046 (size=0x00000005) count: 1\n   Global start=0x00000048 end=0x0000004e (size=0x00000006) count: 1\n   Export start=0x00000050 end=0x00000055 (size=0x00000005) count: 1\n     Elem start=0x00000057 end=0x0000005e (size=0x00000007) count: 1\n     Code start=0x00000060 end=0x00000086 (size=0x00000026) count: 1\n   Custom start=0x00000088 end=0x000000a9 (size=0x00000021) \"linking\"\n   Custom start=0x000000ab end=0x000000c7 (size=0x0000001c) \"reloc.Code\"\n\nSection Details:\n\nType[3]:\n - type[0] (i32) -> nil\n - type[1] (i32) -> i32\n - type[2] (i32, i32) -> i32\nImport[2]:\n - func[0] sig=1 <__extern.foo> <- __extern.foo\n - func[1] sig=2 <__extern.bar> <- __extern.bar\nFunction[1]:\n - func[2] sig=1 <f>\nTable[1]:\n - table[0] type=funcref initial=1 max=1\nGlobal[1]:\n - global[0] i32 mutable=0 <g> - init i32=0\nExport[1]:\n - func[2] <f> -> \"f\"\nElem[1]:\n - segment[0] flags=0 table=0 count=1 - init i32=0\n  - elem[0] = ref.func:1 <__extern.bar>\nCode[1]:\n - func[2] size=36 <f>\nCustom:\n - name: \"linking\"\n  - symbol table [count=5]\n   - 0: F <__extern.foo> func=0 [ undefined binding=global vis=default ]\n   - 1: F <__extern.bar> func=1 [ undefined binding=global vis=default ]\n   - 2: F <f> func=2 [ exported no_strip binding=global vis=hidden ]\n   - 3: T <> table=0 [ binding=local vis=hidden ]\n   - 4: G <g> global=0 [ binding=global vis=default ]\nCustom:\n - name: \"reloc.Code\"\n  - relocations for section: 7 (Code) [5]\n   - R_WASM_GLOBAL_INDEX_LEB offset=0x000004(file=0x000064) symbol=4 <g>\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x00000a(file=0x00006a) symbol=2 <f>\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x000010(file=0x000070) symbol=0 <__extern.foo>\n   - R_WASM_TYPE_INDEX_LEB offset=0x00001b(file=0x00007b) type=2\n   - R_WASM_TABLE_NUMBER_LEB offset=0x000020(file=0x000080) symbol=3 <>\n\nCode Disassembly:\n\n000062 func[2] <f>:\n 000063: 23 80 80 80 80 00          | global.get 0 <g>\n           000064: R_WASM_GLOBAL_INDEX_LEB 4 <g>\n 000069: 10 82 80 80 80 00          | call 2 <f>\n           00006a: R_WASM_FUNCTION_INDEX_LEB 2 <f>\n 00006f: 10 80 80 80 80 00          | call 0 <__extern.foo>\n           000070: R_WASM_FUNCTION_INDEX_LEB 0 <__extern.foo>\n 000075: 41 d2 09                   | i32.const 1234\n 000078: 41 00                      | i32.const 0\n 00007a: 11 82 80 80 80 00 80 80 80 | call_indirect 0 (type 2)\n 000083: 80 00                      | \n           00007b: R_WASM_TYPE_INDEX_LEB 2\n 000085: 0b                         | end\n           000080: R_WASM_TABLE_NUMBER_LEB 3 <>\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/result.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (result i32) \n    i32.const 0)\n  (func (result i64) \n    i64.const 0)\n  (func (result f32) \n    f32.const 0)\n  (func (result f64) \n    f64.const 0))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 04                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7f                                        ; i32\n; func type 1\n000000f: 60                                        ; func\n0000010: 00                                        ; num params\n0000011: 01                                        ; num results\n0000012: 7e                                        ; i64\n; func type 2\n0000013: 60                                        ; func\n0000014: 00                                        ; num params\n0000015: 01                                        ; num results\n0000016: 7d                                        ; f32\n; func type 3\n0000017: 60                                        ; func\n0000018: 00                                        ; num params\n0000019: 01                                        ; num results\n000001a: 7c                                        ; f64\n0000009: 11                                        ; FIXUP section size\n; section \"Function\" (3)\n000001b: 03                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 04                                        ; num functions\n000001e: 00                                        ; function 0 signature index\n000001f: 01                                        ; function 1 signature index\n0000020: 02                                        ; function 2 signature index\n0000021: 03                                        ; function 3 signature index\n000001c: 05                                        ; FIXUP section size\n; section \"Code\" (10)\n0000022: 0a                                        ; section code\n0000023: 00                                        ; section size (guess)\n0000024: 04                                        ; num functions\n; function body 0\n0000025: 00                                        ; func body size (guess)\n0000026: 00                                        ; local decl count\n0000027: 41                                        ; i32.const\n0000028: 00                                        ; i32 literal\n0000029: 0b                                        ; end\n0000025: 04                                        ; FIXUP func body size\n; function body 1\n000002a: 00                                        ; func body size (guess)\n000002b: 00                                        ; local decl count\n000002c: 42                                        ; i64.const\n000002d: 00                                        ; i64 literal\n000002e: 0b                                        ; end\n000002a: 04                                        ; FIXUP func body size\n; function body 2\n000002f: 00                                        ; func body size (guess)\n0000030: 00                                        ; local decl count\n0000031: 43                                        ; f32.const\n0000032: 0000 0000                                 ; f32 literal\n0000036: 0b                                        ; end\n000002f: 07                                        ; FIXUP func body size\n; function body 3\n0000037: 00                                        ; func body size (guess)\n0000038: 00                                        ; local decl count\n0000039: 44                                        ; f64.const\n000003a: 0000 0000 0000 0000                       ; f64 literal\n0000042: 0b                                        ; end\n0000037: 0b                                        ; FIXUP func body size\n0000023: 1f                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nresult.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000026 func[0]:\n 000027: 41 00                      | i32.const 0\n 000029: 0b                         | end\n00002b func[1]:\n 00002c: 42 00                      | i64.const 0\n 00002e: 0b                         | end\n000030 func[2]:\n 000031: 43 00 00 00 00             | f32.const 0x0p+0\n 000036: 0b                         | end\n000038 func[3]:\n 000039: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000042: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/rethrow.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-exceptions\n(module\n  (tag $e1)\n  (func\n    try\n    catch $e1\n      rethrow 0\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Tag\" (13)\n0000012: 0d                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; tag count\n; tag 0\n0000015: 00                                        ; tag attribute\n0000016: 00                                        ; tag signature index\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 01                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 06                                        ; try\n000001d: 40                                        ; void\n000001e: 07                                        ; catch\n000001f: 00                                        ; catch tag\n0000020: 09                                        ; rethrow\n0000021: 00                                        ; rethrow depth\n0000022: 0b                                        ; end\n0000023: 0b                                        ; end\n000001a: 09                                        ; FIXUP func body size\n0000018: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nrethrow.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 06 40                      | try\n 00001e: 07 00                      | catch 0\n 000020: 09 00                      |   rethrow 0\n 000022: 0b                         | end\n 000023: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/return.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func (result i32)\n    i32.const 42\n    return)\n  (func \n    return))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7f                                        ; i32\n; func type 1\n000000f: 60                                        ; func\n0000010: 00                                        ; num params\n0000011: 00                                        ; num results\n0000009: 08                                        ; FIXUP section size\n; section \"Function\" (3)\n0000012: 03                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 02                                        ; num functions\n0000015: 00                                        ; function 0 signature index\n0000016: 01                                        ; function 1 signature index\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 02                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 41                                        ; i32.const\n000001d: 2a                                        ; i32 literal\n000001e: 0f                                        ; return\n000001f: 0b                                        ; end\n000001a: 05                                        ; FIXUP func body size\n; function body 1\n0000020: 00                                        ; func body size (guess)\n0000021: 00                                        ; local decl count\n0000022: 0f                                        ; return\n0000023: 0b                                        ; end\n0000020: 03                                        ; FIXUP func body size\n0000018: 0b                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nreturn.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 41 2a                      | i32.const 42\n 00001e: 0f                         | return\n 00001f: 0b                         | end\n000021 func[1]:\n 000022: 0f                         | return\n 000023: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/section-offsets.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: --section-offsets\n(module\n  (func)\n  (func)\n  (func))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 03                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n0000012: 00                                        ; function 1 signature index\n0000013: 00                                        ; function 2 signature index\n000000f: 04                                        ; FIXUP section size\n; section \"Code\" (10)\n0000014: 0a                                        ; section code\n0000015: 00                                        ; section size (guess)\n0000016: 03                                        ; num functions\n; function body 0\n0000017: 00                                        ; func body size (guess)\n0000018: 00                                        ; local decl count\n0000019: 0b                                        ; end\n0000017: 02                                        ; FIXUP func body size\n; function body 1\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 0b                                        ; end\n000001a: 02                                        ; FIXUP func body size\n; function body 2\n000001d: 00                                        ; func body size (guess)\n000001e: 00                                        ; local decl count\n000001f: 0b                                        ; end\n000001d: 02                                        ; FIXUP func body size\n0000015: 0a                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nsection-offsets.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000002 func[0]:\n 000003: 0b                         | end\n000005 func[1]:\n 000006: 0b                         | end\n000008 func[2]:\n 000009: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/select.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 2\n    i32.const 3\n    i32.const 1\n    select\n    drop\n    i64.const 2\n    i64.const 3\n    i32.const 1\n    select\n    drop\n    f32.const 2\n    f32.const 3\n    i32.const 1\n    select (result f32)\n    drop\n    f64.const 2\n    f64.const 3\n    i32.const 1\n    select\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 02                                        ; i32 literal\n0000019: 41                                        ; i32.const\n000001a: 03                                        ; i32 literal\n000001b: 41                                        ; i32.const\n000001c: 01                                        ; i32 literal\n000001d: 1b                                        ; select\n000001e: 1a                                        ; drop\n000001f: 42                                        ; i64.const\n0000020: 02                                        ; i64 literal\n0000021: 42                                        ; i64.const\n0000022: 03                                        ; i64 literal\n0000023: 41                                        ; i32.const\n0000024: 01                                        ; i32 literal\n0000025: 1b                                        ; select\n0000026: 1a                                        ; drop\n0000027: 43                                        ; f32.const\n0000028: 0000 0040                                 ; f32 literal\n000002c: 43                                        ; f32.const\n000002d: 0000 4040                                 ; f32 literal\n0000031: 41                                        ; i32.const\n0000032: 01                                        ; i32 literal\n0000033: 1c                                        ; select\n0000034: 01                                        ; num result types\n0000035: 7d                                        ; result type\n0000036: 1a                                        ; drop\n0000037: 44                                        ; f64.const\n0000038: 0000 0000 0000 0040                       ; f64 literal\n0000040: 44                                        ; f64.const\n0000041: 0000 0000 0000 0840                       ; f64 literal\n0000049: 41                                        ; i32.const\n000004a: 01                                        ; i32 literal\n000004b: 1b                                        ; select\n000004c: 1a                                        ; drop\n000004d: 0b                                        ; end\n0000015: 38                                        ; FIXUP func body size\n0000013: 3a                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nselect.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 41 02                      | i32.const 2\n 000019: 41 03                      | i32.const 3\n 00001b: 41 01                      | i32.const 1\n 00001d: 1b                         | select\n 00001e: 1a                         | drop\n 00001f: 42 02                      | i64.const 2\n 000021: 42 03                      | i64.const 3\n 000023: 41 01                      | i32.const 1\n 000025: 1b                         | select\n 000026: 1a                         | drop\n 000027: 43 00 00 00 40             | f32.const 0x1p+1\n 00002c: 43 00 00 40 40             | f32.const 0x1.8p+1\n 000031: 41 01                      | i32.const 1\n 000033: 1c 01 7d                   | select f32\n 000036: 1a                         | drop\n 000037: 44 00 00 00 00 00 00 00 40 | f64.const 0x1p+1\n 000040: 44 00 00 00 00 00 00 08 40 | f64.const 0x1.8p+1\n 000049: 41 01                      | i32.const 1\n 00004b: 1b                         | select\n 00004c: 1a                         | drop\n 00004d: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/signatures.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (type (func (param i32)))\n  (type (func (param i64)))\n  (type (func (param f32)))\n  (type (func (param f64)))\n\n  (type (func (result i32)))\n  (type (func (result i64)))\n  (type (func (result f32)))\n  (type (func (result f64)))\n\n  (type (func (param i32) (result f64))))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 09                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 01                                        ; num params\n0000011: 7e                                        ; i64\n0000012: 00                                        ; num results\n; func type 2\n0000013: 60                                        ; func\n0000014: 01                                        ; num params\n0000015: 7d                                        ; f32\n0000016: 00                                        ; num results\n; func type 3\n0000017: 60                                        ; func\n0000018: 01                                        ; num params\n0000019: 7c                                        ; f64\n000001a: 00                                        ; num results\n; func type 4\n000001b: 60                                        ; func\n000001c: 00                                        ; num params\n000001d: 01                                        ; num results\n000001e: 7f                                        ; i32\n; func type 5\n000001f: 60                                        ; func\n0000020: 00                                        ; num params\n0000021: 01                                        ; num results\n0000022: 7e                                        ; i64\n; func type 6\n0000023: 60                                        ; func\n0000024: 00                                        ; num params\n0000025: 01                                        ; num results\n0000026: 7d                                        ; f32\n; func type 7\n0000027: 60                                        ; func\n0000028: 00                                        ; num params\n0000029: 01                                        ; num results\n000002a: 7c                                        ; f64\n; func type 8\n000002b: 60                                        ; func\n000002c: 01                                        ; num params\n000002d: 7f                                        ; i32\n000002e: 01                                        ; num results\n000002f: 7c                                        ; f64\n0000009: 26                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nsignatures.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-basic.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  (func (export \"main\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    return))\n(;; STDOUT ;;;\n\nsimd-basic.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000021 func[0] <main>:\n 000022: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 00002b: 00 03 00 00 00 04 00 00 00 | \n 000034: 0f                         | return\n 000035: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-binary.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  ;; i8x16 add\n  (func (export \"i8x16_add_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.add)\n\n  ;; i16x8 add\n  (func (export \"i16x8_add_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.add)\n\n  ;; i32x4 add\n  (func (export \"i32x4_add_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.add)\n\n  ;; i64x2 add\n  (func (export \"i64x2_add_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i64x2.add)\n\n  ;; i8x16 sub\n  (func (export \"i8x16_sub_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.sub)\n\n  ;; i16x8 sub\n  (func (export \"i16x8_sub_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.sub)\n\n  ;; i32x4 sub\n  (func (export \"i32x4_sub_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.sub)\n\n  ;; i64x2 sub\n  (func (export \"i64x2_sub_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i64x2.sub)\n\n  ;; i16x8 mul\n  (func (export \"i16x8_mul_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.mul)\n\n  ;; i32x4 mul\n  (func (export \"i32x4_mul_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.mul)\n\n  ;; i64x2 mul\n  (func (export \"i64x2_mul_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i64x2.mul)\n\n  ;; i8x16 saturating add (signed and unsigned)\n  (func (export \"i8x16_add_saturate_signed_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000007f 0x00000003 0x00000080\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x000000ff\n    i8x16.add_sat_s)\n  (func (export \"i8x16_add_saturate_unsigned_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x04000002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i8x16.add_sat_u)\n\n  ;; i16x8 saturating add (signed and unsigned)\n  (func (export \"i16x8_add_saturate_signed_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00007fff 0x00000003 0x00008000\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x0000fffe\n    i16x8.add_sat_s)\n  (func (export \"i16x8_add_saturate_unsigned_0\") (result v128)\n    v128.const i32x4 0x00ffffff 0x0400ffff 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i16x8.add_sat_u)\n\n  ;; i8x16 saturating sub (signed and unsigned)\n  (func (export \"i8x16_sub_saturate_signed_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000007f 0x000000fe 0x00000080\n    v128.const i32x4 0x00000001 0x000000fe 0x0000007f 0x000000ff\n    i8x16.sub_sat_s)\n  (func (export \"i8x16_sub_saturate_unsigned_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x0400007f 0x0000fffe 0x00000004\n    v128.const i32x4 0x00020001 0xfe00fffe 0x0000007f 0x00000004\n    i8x16.sub_sat_u)\n\n  ;; i16x8 saturating sub (signed and unsigned)\n  (func (export \"i16x8_sub_saturate_signed_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00007fff 0x0000fffe 0x00008000\n    v128.const i32x4 0x00000001 0x0000fffe 0x00007fff 0x0000fffe\n    i16x8.sub_sat_s)\n  (func (export \"i16x8_sub_saturate_unsigned_0\") (result v128)\n    v128.const i32x4 0x00ffffff 0x0400ffff 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i16x8.sub_sat_u)\n\n  ;; v128 and\n  (func (export \"v128_and_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x44000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x55000004\n    v128.and)\n\n  ;; v128 or\n  (func (export \"v128_or_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x44000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x55000004\n    v128.or)\n\n  ;; v128 xor\n  (func (export \"v128_xor_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x44000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x55000004\n    v128.xor)\n\n  ;; f32x4 min\n  (func (export \"f32x4_min_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xbf800000\n    v128.const i32x4 0x00000000 0x3f800000 0x449a5000 0x3f800000\n    f32x4.min)\n\n  ;; f64x2 min\n  (func (export \"f64x2_min_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.min)\n\n  ;; f32x4 max\n  (func (export \"f32x4_max_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xbf800000\n    v128.const i32x4 0x00000000 0x3f800000 0x449a5000 0x3f800000\n    f32x4.max)\n\n  ;; f64x2 max\n  (func (export \"f64x2_max_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.max)\n\n  ;; f32x4 add\n  (func (export \"f32x4_add_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xc49a5000\n    v128.const i32x4 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n    f32x4.add)\n\n  ;; f64x2 add\n  (func (export \"f64x2_add_0\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.add)\n\n  ;; f32x4 sub\n  (func (export \"f32x4_sub_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xc49a5000\n    v128.const i32x4 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n    f32x4.sub)\n\n  ;; f64x2 sub\n  (func (export \"f64x2_sub_0\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.sub)\n\n  ;; f32x4 div\n  (func (export \"f32x4_div_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x3fc00000 0xc0400000\n    v128.const i32x4 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n    f32x4.div)\n\n  ;; f64x2 div\n  (func (export \"f64x2_div_0\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0xc0080000\n    v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0x3ff80000\n    f64x2.div)\n\n  ;; f32x4 mul\n  (func (export \"f32x4_mul_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x3fc00000 0xc0400000\n    v128.const i32x4 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n    f32x4.mul)\n\n  ;; f64x2 mul\n  (func (export \"f64x2_mul_0\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0xc0080000\n    v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0x3ff80000\n    f64x2.mul)\n\n  ;; i8x16.narrow_i16x8_s\n  (func (export \"i8x16.narrow_i16x8_s\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.narrow_i16x8_s)\n\n  ;; i8x16.narrow_i16x8_u\n  (func (export \"i8x16.narrow_i16x8_u\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.narrow_i16x8_u)\n\n  ;; i16x8.narrow_i32x4_s\n  (func (export \"i16x8.narrow_i32x4_s\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.narrow_i32x4_s)\n\n  ;; i16x8.narrow_i32x4_u\n  (func (export \"i16x8.narrow_i32x4_u\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.narrow_i32x4_u)\n\n  ;; i16x8.extend_low_i8x16_s\n  (func (export \"i16x8.extend_low_i8x16_s\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.extend_low_i8x16_s)\n\n  ;; i16x8.extend_high_i8x16_s\n  (func (export \"i16x8.extend_high_i8x16_s\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.extend_high_i8x16_s)\n\n  ;; i16x8.extend_low_i8x16_u\n  (func (export \"i16x8.extend_low_i8x16_u\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.extend_low_i8x16_u)\n\n  ;; i16x8.extend_high_i8x16_u\n  (func (export \"i16x8.extend_high_i8x16_u\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.extend_high_i8x16_u)\n\n  ;; i32x4.extend_low_i16x8_s\n  (func (export \"i32x4.extend_low_i16x8_s\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.extend_low_i16x8_s)\n\n  ;; i32x4.extend_high_i16x8_s\n  (func (export \"i32x4.extend_high_i16x8_s\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.extend_high_i16x8_s)\n\n  ;; i32x4.extend_low_i16x8_u\n  (func (export \"i32x4.extend_low_i16x8_u\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.extend_low_i16x8_u)\n\n  ;; i32x4.extend_high_i16x8_u\n  (func (export \"i32x4.extend_high_i16x8_u\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.extend_high_i16x8_u)\n\n  ;; v128.andnot\n  (func (export \"v128.andnot\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.andnot)\n\n  ;; i8x16.avgr_u\n  (func (export \"i8x16.avgr_u\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.avgr_u)\n\n  ;; i16x8.avgr_u\n  (func (export \"i16x8.avgr_u\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.avgr_u)\n)\n\n(;; STDOUT ;;;\n\nsimd-binary.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000410 func[0] <i8x16_add_0>:\n 000411: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 00041a: 00 03 00 00 00 04 00 00 00 | \n 000423: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 00042c: 00 03 00 00 00 04 00 00 00 | \n 000435: fd 6e                      | i8x16.add\n 000437: 0b                         | end\n000439 func[1] <i16x8_add_0>:\n 00043a: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000443: 00 03 00 00 00 04 00 00 00 | \n 00044c: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000455: 00 03 00 00 00 04 00 00 00 | \n 00045e: fd 8e 01                   | i16x8.add\n 000461: 0b                         | end\n000463 func[2] <i32x4_add_0>:\n 000464: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 00046d: 00 03 00 00 00 04 00 00 00 | \n 000476: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 00047f: 00 03 00 00 00 04 00 00 00 | \n 000488: fd ae 01                   | i32x4.add\n 00048b: 0b                         | end\n00048d func[3] <i64x2_add_0>:\n 00048e: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000497: 00 03 00 00 00 04 00 00 00 | \n 0004a0: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0004a9: 00 03 00 00 00 04 00 00 00 | \n 0004b2: fd ce 01                   | i64x2.add\n 0004b5: 0b                         | end\n0004b7 func[4] <i8x16_sub_0>:\n 0004b8: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0004c1: 00 03 00 00 00 04 00 00 00 | \n 0004ca: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0004d3: 00 03 00 00 00 04 00 00 00 | \n 0004dc: fd 71                      | i8x16.sub\n 0004de: 0b                         | end\n0004e0 func[5] <i16x8_sub_0>:\n 0004e1: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0004ea: 00 03 00 00 00 04 00 00 00 | \n 0004f3: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0004fc: 00 03 00 00 00 04 00 00 00 | \n 000505: fd 91 01                   | i16x8.sub\n 000508: 0b                         | end\n00050a func[6] <i32x4_sub_0>:\n 00050b: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000514: 00 03 00 00 00 04 00 00 00 | \n 00051d: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000526: 00 03 00 00 00 04 00 00 00 | \n 00052f: fd b1 01                   | i32x4.sub\n 000532: 0b                         | end\n000534 func[7] <i64x2_sub_0>:\n 000535: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 00053e: 00 03 00 00 00 04 00 00 00 | \n 000547: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000550: 00 03 00 00 00 04 00 00 00 | \n 000559: fd d1 01                   | i64x2.sub\n 00055c: 0b                         | end\n00055e func[8] <i16x8_mul_0>:\n 00055f: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000568: 00 03 00 00 00 04 00 00 00 | \n 000571: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 00057a: 00 03 00 00 00 04 00 00 00 | \n 000583: fd 95 01                   | i16x8.mul\n 000586: 0b                         | end\n000588 func[9] <i32x4_mul_0>:\n 000589: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000592: 00 03 00 00 00 04 00 00 00 | \n 00059b: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0005a4: 00 03 00 00 00 04 00 00 00 | \n 0005ad: fd b5 01                   | i32x4.mul\n 0005b0: 0b                         | end\n0005b2 func[10] <i64x2_mul_0>:\n 0005b3: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0005bc: 00 03 00 00 00 04 00 00 00 | \n 0005c5: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0005ce: 00 03 00 00 00 04 00 00 00 | \n 0005d7: fd d5 01                   | i64x2.mul\n 0005da: 0b                         | end\n0005dc func[11] <i8x16_add_saturate_signed_0>:\n 0005dd: fd 0c 01 00 00 00 7f 00 00 | v128.const 0x00000001 0x0000007f 0x00000003 0x00000080\n 0005e6: 00 03 00 00 00 80 00 00 00 | \n 0005ef: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x000000ff\n 0005f8: 00 03 00 00 00 ff 00 00 00 | \n 000601: fd 6f                      | i8x16.add_sat_s\n 000603: 0b                         | end\n000605 func[12] <i8x16_add_saturate_unsigned_0>:\n 000606: fd 0c 01 00 ff 00 02 00 00 | v128.const 0x00ff0001 0x04000002 0x00000003 0x00000004\n 00060f: 04 03 00 00 00 04 00 00 00 | \n 000618: fd 0c 01 00 02 00 02 00 00 | v128.const 0x00020001 0xfe000002 0x00000003 0x00000004\n 000621: fe 03 00 00 00 04 00 00 00 | \n 00062a: fd 70                      | i8x16.add_sat_u\n 00062c: 0b                         | end\n00062e func[13] <i16x8_add_saturate_signed_0>:\n 00062f: fd 0c 01 00 00 00 ff 7f 00 | v128.const 0x00000001 0x00007fff 0x00000003 0x00008000\n 000638: 00 03 00 00 00 00 80 00 00 | \n 000641: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x0000fffe\n 00064a: 00 03 00 00 00 fe ff 00 00 | \n 000653: fd 8f 01                   | i16x8.add_sat_s\n 000656: 0b                         | end\n000658 func[14] <i16x8_add_saturate_unsigned_0>:\n 000659: fd 0c ff ff ff 00 ff ff 00 | v128.const 0x00ffffff 0x0400ffff 0x00000003 0x00000004\n 000662: 04 03 00 00 00 04 00 00 00 | \n 00066b: fd 0c 01 00 02 00 02 00 00 | v128.const 0x00020001 0xfe000002 0x00000003 0x00000004\n 000674: fe 03 00 00 00 04 00 00 00 | \n 00067d: fd 90 01                   | i16x8.add_sat_u\n 000680: 0b                         | end\n000682 func[15] <i8x16_sub_saturate_signed_0>:\n 000683: fd 0c 01 00 00 00 7f 00 00 | v128.const 0x00000001 0x0000007f 0x000000fe 0x00000080\n 00068c: 00 fe 00 00 00 80 00 00 00 | \n 000695: fd 0c 01 00 00 00 fe 00 00 | v128.const 0x00000001 0x000000fe 0x0000007f 0x000000ff\n 00069e: 00 7f 00 00 00 ff 00 00 00 | \n 0006a7: fd 72                      | i8x16.sub_sat_s\n 0006a9: 0b                         | end\n0006ab func[16] <i8x16_sub_saturate_unsigned_0>:\n 0006ac: fd 0c 01 00 ff 00 7f 00 00 | v128.const 0x00ff0001 0x0400007f 0x0000fffe 0x00000004\n 0006b5: 04 fe ff 00 00 04 00 00 00 | \n 0006be: fd 0c 01 00 02 00 fe ff 00 | v128.const 0x00020001 0xfe00fffe 0x0000007f 0x00000004\n 0006c7: fe 7f 00 00 00 04 00 00 00 | \n 0006d0: fd 73                      | i8x16.sub_sat_u\n 0006d2: 0b                         | end\n0006d4 func[17] <i16x8_sub_saturate_signed_0>:\n 0006d5: fd 0c 01 00 00 00 ff 7f 00 | v128.const 0x00000001 0x00007fff 0x0000fffe 0x00008000\n 0006de: 00 fe ff 00 00 00 80 00 00 | \n 0006e7: fd 0c 01 00 00 00 fe ff 00 | v128.const 0x00000001 0x0000fffe 0x00007fff 0x0000fffe\n 0006f0: 00 ff 7f 00 00 fe ff 00 00 | \n 0006f9: fd 92 01                   | i16x8.sub_sat_s\n 0006fc: 0b                         | end\n0006fe func[18] <i16x8_sub_saturate_unsigned_0>:\n 0006ff: fd 0c ff ff ff 00 ff ff 00 | v128.const 0x00ffffff 0x0400ffff 0x00000003 0x00000004\n 000708: 04 03 00 00 00 04 00 00 00 | \n 000711: fd 0c 01 00 02 00 02 00 00 | v128.const 0x00020001 0xfe000002 0x00000003 0x00000004\n 00071a: fe 03 00 00 00 04 00 00 00 | \n 000723: fd 93 01                   | i16x8.sub_sat_u\n 000726: 0b                         | end\n000728 func[19] <v128_and_0>:\n 000729: fd 0c 01 00 ff 00 02 00 04 | v128.const 0x00ff0001 0x00040002 0x44000003 0x00000004\n 000732: 00 03 00 00 44 04 00 00 00 | \n 00073b: fd 0c 01 00 02 00 02 00 fe | v128.const 0x00020001 0x00fe0002 0x00000003 0x55000004\n 000744: 00 03 00 00 00 04 00 00 55 | \n 00074d: fd 4e                      | v128.and\n 00074f: 0b                         | end\n000751 func[20] <v128_or_0>:\n 000752: fd 0c 01 00 ff 00 02 00 04 | v128.const 0x00ff0001 0x00040002 0x44000003 0x00000004\n 00075b: 00 03 00 00 44 04 00 00 00 | \n 000764: fd 0c 01 00 02 00 02 00 fe | v128.const 0x00020001 0x00fe0002 0x00000003 0x55000004\n 00076d: 00 03 00 00 00 04 00 00 55 | \n 000776: fd 50                      | v128.or\n 000778: 0b                         | end\n00077a func[21] <v128_xor_0>:\n 00077b: fd 0c 01 00 ff 00 02 00 04 | v128.const 0x00ff0001 0x00040002 0x44000003 0x00000004\n 000784: 00 03 00 00 44 04 00 00 00 | \n 00078d: fd 0c 01 00 02 00 02 00 fe | v128.const 0x00020001 0x00fe0002 0x00000003 0x55000004\n 000796: 00 03 00 00 00 04 00 00 55 | \n 00079f: fd 51                      | v128.xor\n 0007a1: 0b                         | end\n0007a3 func[22] <f32x4_min_0>:\n 0007a4: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x449a5000 0xbf800000\n 0007ad: ff 00 50 9a 44 00 00 80 bf | \n 0007b6: fd 0c 00 00 00 00 00 00 80 | v128.const 0x00000000 0x3f800000 0x449a5000 0x3f800000\n 0007bf: 3f 00 50 9a 44 00 00 80 3f | \n 0007c8: fd e8 01                   | f32x4.min\n 0007cb: 0b                         | end\n0007cd func[23] <f64x2_min_0>:\n 0007ce: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 0007d7: 00 00 00 00 00 00 00 f8 ff | \n 0007e0: fd 0c 00 00 00 00 00 4a 93 | v128.const 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n 0007e9: c0 00 00 00 00 00 00 f0 3f | \n 0007f2: fd f4 01                   | f64x2.min\n 0007f5: 0b                         | end\n0007f7 func[24] <f32x4_max_0>:\n 0007f8: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x449a5000 0xbf800000\n 000801: ff 00 50 9a 44 00 00 80 bf | \n 00080a: fd 0c 00 00 00 00 00 00 80 | v128.const 0x00000000 0x3f800000 0x449a5000 0x3f800000\n 000813: 3f 00 50 9a 44 00 00 80 3f | \n 00081c: fd e9 01                   | f32x4.max\n 00081f: 0b                         | end\n000821 func[25] <f64x2_max_0>:\n 000822: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 00082b: 00 00 00 00 00 00 00 f8 ff | \n 000834: fd 0c 00 00 00 00 00 4a 93 | v128.const 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n 00083d: c0 00 00 00 00 00 00 f0 3f | \n 000846: fd f5 01                   | f64x2.max\n 000849: 0b                         | end\n00084b func[26] <f32x4_add_0>:\n 00084c: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x449a5000 0xc49a5000\n 000855: ff 00 50 9a 44 00 50 9a c4 | \n 00085e: fd 0c 00 00 00 00 00 00 80 | v128.const 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n 000867: 3f 00 00 80 3f 00 00 c0 3f | \n 000870: fd e4 01                   | f32x4.add\n 000873: 0b                         | end\n000875 func[27] <f64x2_add_0>:\n 000876: fd 0c 00 00 00 00 00 00 f8 | v128.const 0x00000000 0x3ff80000 0x00000000 0xfff80000\n 00087f: 3f 00 00 00 00 00 00 f8 ff | \n 000888: fd 0c 00 00 00 00 00 4a 93 | v128.const 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n 000891: c0 00 00 00 00 00 00 f0 3f | \n 00089a: fd f0 01                   | f64x2.add\n 00089d: 0b                         | end\n00089f func[28] <f32x4_sub_0>:\n 0008a0: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x449a5000 0xc49a5000\n 0008a9: ff 00 50 9a 44 00 50 9a c4 | \n 0008b2: fd 0c 00 00 00 00 00 00 80 | v128.const 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n 0008bb: 3f 00 00 80 3f 00 00 c0 3f | \n 0008c4: fd e5 01                   | f32x4.sub\n 0008c7: 0b                         | end\n0008c9 func[29] <f64x2_sub_0>:\n 0008ca: fd 0c 00 00 00 00 00 00 f8 | v128.const 0x00000000 0x3ff80000 0x00000000 0xfff80000\n 0008d3: 3f 00 00 00 00 00 00 f8 ff | \n 0008dc: fd 0c 00 00 00 00 00 4a 93 | v128.const 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n 0008e5: c0 00 00 00 00 00 00 f0 3f | \n 0008ee: fd f1 01                   | f64x2.sub\n 0008f1: 0b                         | end\n0008f3 func[30] <f32x4_div_0>:\n 0008f4: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x3fc00000 0xc0400000\n 0008fd: ff 00 00 c0 3f 00 00 40 c0 | \n 000906: fd 0c 00 00 00 00 00 00 80 | v128.const 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n 00090f: 3f 00 00 80 3f 00 00 c0 3f | \n 000918: fd e7 01                   | f32x4.div\n 00091b: 0b                         | end\n00091d func[31] <f64x2_div_0>:\n 00091e: fd 0c 00 00 00 00 00 00 f8 | v128.const 0x00000000 0x3ff80000 0x00000000 0xc0080000\n 000927: 3f 00 00 00 00 00 00 08 c0 | \n 000930: fd 0c 00 00 00 00 00 00 f0 | v128.const 0x00000000 0x3ff00000 0x00000000 0x3ff80000\n 000939: 3f 00 00 00 00 00 00 f8 3f | \n 000942: fd f3 01                   | f64x2.div\n 000945: 0b                         | end\n000947 func[32] <f32x4_mul_0>:\n 000948: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x3fc00000 0xc0400000\n 000951: ff 00 00 c0 3f 00 00 40 c0 | \n 00095a: fd 0c 00 00 00 00 00 00 80 | v128.const 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n 000963: 3f 00 00 80 3f 00 00 c0 3f | \n 00096c: fd e6 01                   | f32x4.mul\n 00096f: 0b                         | end\n000971 func[33] <f64x2_mul_0>:\n 000972: fd 0c 00 00 00 00 00 00 f8 | v128.const 0x00000000 0x3ff80000 0x00000000 0xc0080000\n 00097b: 3f 00 00 00 00 00 00 08 c0 | \n 000984: fd 0c 00 00 00 00 00 00 f0 | v128.const 0x00000000 0x3ff00000 0x00000000 0x3ff80000\n 00098d: 3f 00 00 00 00 00 00 f8 3f | \n 000996: fd f2 01                   | f64x2.mul\n 000999: 0b                         | end\n00099b func[34] <i8x16.narrow_i16x8_s>:\n 00099c: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0009a5: 00 03 00 00 00 04 00 00 00 | \n 0009ae: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0009b7: 00 03 00 00 00 04 00 00 00 | \n 0009c0: fd 65                      | i8x16.narrow_i16x8_s\n 0009c2: 0b                         | end\n0009c4 func[35] <i8x16.narrow_i16x8_u>:\n 0009c5: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0009ce: 00 03 00 00 00 04 00 00 00 | \n 0009d7: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0009e0: 00 03 00 00 00 04 00 00 00 | \n 0009e9: fd 66                      | i8x16.narrow_i16x8_u\n 0009eb: 0b                         | end\n0009ed func[36] <i16x8.narrow_i32x4_s>:\n 0009ee: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0009f7: 00 03 00 00 00 04 00 00 00 | \n 000a00: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000a09: 00 03 00 00 00 04 00 00 00 | \n 000a12: fd 85 01                   | i16x8.narrow_i32x4_s\n 000a15: 0b                         | end\n000a17 func[37] <i16x8.narrow_i32x4_u>:\n 000a18: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000a21: 00 03 00 00 00 04 00 00 00 | \n 000a2a: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000a33: 00 03 00 00 00 04 00 00 00 | \n 000a3c: fd 86 01                   | i16x8.narrow_i32x4_u\n 000a3f: 0b                         | end\n000a41 func[38] <i16x8.extend_low_i8x16_s>:\n 000a42: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000a4b: 00 03 00 00 00 04 00 00 00 | \n 000a54: fd 87 01                   | i16x8.extend_low_i8x16_s\n 000a57: 0b                         | end\n000a59 func[39] <i16x8.extend_high_i8x16_s>:\n 000a5a: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000a63: 00 03 00 00 00 04 00 00 00 | \n 000a6c: fd 88 01                   | i16x8.extend_high_i8x16_s\n 000a6f: 0b                         | end\n000a71 func[40] <i16x8.extend_low_i8x16_u>:\n 000a72: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000a7b: 00 03 00 00 00 04 00 00 00 | \n 000a84: fd 89 01                   | i16x8.extend_low_i8x16_u\n 000a87: 0b                         | end\n000a89 func[41] <i16x8.extend_high_i8x16_u>:\n 000a8a: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000a93: 00 03 00 00 00 04 00 00 00 | \n 000a9c: fd 8a 01                   | i16x8.extend_high_i8x16_u\n 000a9f: 0b                         | end\n000aa1 func[42] <i32x4.extend_low_i16x8_s>:\n 000aa2: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000aab: 00 03 00 00 00 04 00 00 00 | \n 000ab4: fd a7 01                   | i32x4.extend_low_i16x8_s\n 000ab7: 0b                         | end\n000ab9 func[43] <i32x4.extend_high_i16x8_s>:\n 000aba: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000ac3: 00 03 00 00 00 04 00 00 00 | \n 000acc: fd a8 01                   | i32x4.extend_high_i16x8_s\n 000acf: 0b                         | end\n000ad1 func[44] <i32x4.extend_low_i16x8_u>:\n 000ad2: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000adb: 00 03 00 00 00 04 00 00 00 | \n 000ae4: fd a9 01                   | i32x4.extend_low_i16x8_u\n 000ae7: 0b                         | end\n000ae9 func[45] <i32x4.extend_high_i16x8_u>:\n 000aea: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000af3: 00 03 00 00 00 04 00 00 00 | \n 000afc: fd aa 01                   | i32x4.extend_high_i16x8_u\n 000aff: 0b                         | end\n000b01 func[46] <v128.andnot>:\n 000b02: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000b0b: 00 03 00 00 00 04 00 00 00 | \n 000b14: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000b1d: 00 03 00 00 00 04 00 00 00 | \n 000b26: fd 4f                      | v128.andnot\n 000b28: 0b                         | end\n000b2a func[47] <i8x16.avgr_u>:\n 000b2b: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000b34: 00 03 00 00 00 04 00 00 00 | \n 000b3d: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000b46: 00 03 00 00 00 04 00 00 00 | \n 000b4f: fd 7b                      | i8x16.avgr_u\n 000b51: 0b                         | end\n000b53 func[48] <i16x8.avgr_u>:\n 000b54: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000b5d: 00 03 00 00 00 04 00 00 00 | \n 000b66: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000b6f: 00 03 00 00 00 04 00 00 00 | \n 000b78: fd 9b 01                   | i16x8.avgr_u\n 000b7b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-bitselect.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  ;; v128.bitselect\n  (func (export  \"func_v128_bitselect_0\") (result  v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x55555555 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0xaaaaaaaa 0x55000004\n    v128.const i32x4 0xffffffff 0x00000000 0x55555555 0x55000004\n    v128.bitselect)\n)\n\n(;; STDOUT ;;;\n\nsimd-bitselect.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000032 func[0] <func_v128_bitselect_0>:\n 000033: fd 0c 01 00 ff 00 02 00 04 | v128.const 0x00ff0001 0x00040002 0x55555555 0x00000004\n 00003c: 00 55 55 55 55 04 00 00 00 | \n 000045: fd 0c 01 00 02 00 02 00 fe | v128.const 0x00020001 0x00fe0002 0xaaaaaaaa 0x55000004\n 00004e: 00 aa aa aa aa 04 00 00 55 | \n 000057: fd 0c ff ff ff ff 00 00 00 | v128.const 0xffffffff 0x00000000 0x55555555 0x55000004\n 000060: 00 55 55 55 55 04 00 00 55 | \n 000069: fd 52                      | v128.bitselect\n 00006b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-compare.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  ;; i8x16 eq\n  (func (export \"i8x16_eq_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i8x16.eq)\n\n  ;; i16x8 eq\n  (func (export \"i16x8_eq_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i16x8.eq)\n\n  ;; i32x4 eq\n  (func (export \"i32x4_eq_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i32x4.eq)\n\n  ;; f32x4 eq\n  (func (export \"f32x4_eq_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0x3f800000\n    f32x4.eq)\n\n  ;; f64x2 eq\n  (func (export \"f64x2_eq_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.eq)\n\n  ;; i8x16 ne\n  (func (export \"i8x16_ne_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i8x16.ne)\n\n  ;; i16x8 ne\n  (func (export \"i16x8_ne_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i16x8.ne)\n\n  ;; i32x4 ne\n  (func (export \"i32x4_ne_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i32x4.ne)\n\n  ;; f32x4 ne\n  (func (export \"f32x4_ne_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0x3f800000\n    f32x4.ne)\n\n  ;; f64x2 ne\n  (func (export \"f64x2_ne_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.ne)\n\n  ;; i8x16 lt (sign and unsigned)\n  (func (export \"i8x16_lt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.lt_s)\n  (func (export \"i8x16_lt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.lt_u)\n\n  ;; i16x8 lt (sign and unsigned)\n  (func (export \"i16x8_lt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.lt_s)\n  (func (export \"i16x8_lt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.lt_u)\n\n  ;; i32x4 lt (sign and unsigned)\n  (func (export \"i32x4_lt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.lt_s)\n  (func (export \"i32x4_lt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.lt_u)\n\n  ;; f32x4 lt\n  (func (export \"f32x4_lt_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0xffc00000 0x3f800000\n    f32x4.lt)\n\n  ;; f64x2 lt\n  (func (export \"f64x2_lt_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.lt)\n\n  ;; i8x16 le (sign and unsigned)\n  (func (export \"i8x16_le_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.le_s)\n  (func (export \"i8x16_le_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.le_u)\n\n  ;; i16x8 le (sign and unsigned)\n  (func (export \"i16x8_le_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.le_s)\n  (func (export \"i16x8_le_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.le_u)\n\n  ;; i32x4 le (sign and unsigned)\n  (func (export \"i32x4_le_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.le_s)\n  (func (export \"i32x4_le_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.le_u)\n\n  ;; f32x4 le\n  (func (export \"f32x4_le_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0xffc00000 0x3f800000\n    f32x4.le)\n\n  ;; f64x2 le\n  (func (export \"f64x2_le_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.le)\n\n  ;; i8x16 gt (sign and unsigned)\n  (func (export \"i8x16_gt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.gt_s)\n  (func (export \"i8x16_gt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.gt_u)\n\n  ;; i16x8 gt (sign and unsigned)\n  (func (export \"i16x8_gt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.gt_s)\n  (func (export \"i16x8_gt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.gt_u)\n\n  ;; i32x4 gt (sign and unsigned)\n  (func (export \"i32x4_gt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.gt_s)\n  (func (export \"i32x4_gt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.gt_u)\n\n  ;; f32x4 gt\n  (func (export \"f32x4_gt_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0xffc00000 0x3f800000\n    f32x4.gt)\n\n  ;; f64x2 gt\n  (func (export \"f64x2_gt_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.gt)\n\n  ;; i8x16 ge (sign and unsigned)\n  (func (export \"i8x16_ge_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.ge_s)\n  (func (export \"i8x16_ge_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.ge_u)\n\n  ;; i16x8 ge (sign and unsigned)\n  (func (export \"i16x8_ge_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.ge_s)\n  (func (export \"i16x8_ge_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.ge_u)\n\n  ;; i32x4 ge (sign and unsigned)\n  (func (export \"i32x4_ge_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.ge_s)\n  (func (export \"i32x4_ge_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.ge_u)\n\n  ;; f32x4 ge\n  (func (export \"f32x4_ge_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0xffc00000 0x3f800000\n    f32x4.ge)\n\n  ;; f64x2 ge\n  (func (export \"f64x2_ge_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.ge)\n)\n(;; STDOUT ;;;\n\nsimd-compare.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000267 func[0] <i8x16_eq_0>:\n 000268: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 000271: e0 03 00 00 00 04 00 00 00 | \n 00027a: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 000283: e0 03 00 00 00 04 00 00 00 | \n 00028c: fd 23                      | i8x16.eq\n 00028e: 0b                         | end\n000290 func[1] <i16x8_eq_0>:\n 000291: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 00029a: e0 03 00 00 00 04 00 00 00 | \n 0002a3: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 0002ac: e0 03 00 00 00 04 00 00 00 | \n 0002b5: fd 2d                      | i16x8.eq\n 0002b7: 0b                         | end\n0002b9 func[2] <i32x4_eq_0>:\n 0002ba: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 0002c3: e0 03 00 00 00 04 00 00 00 | \n 0002cc: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 0002d5: e0 03 00 00 00 04 00 00 00 | \n 0002de: fd 37                      | i32x4.eq\n 0002e0: 0b                         | end\n0002e2 func[3] <f32x4_eq_0>:\n 0002e3: fd 0c 00 00 00 00 00 00 c0 | v128.const 0x00000000 0xffc00000 0x449a5000 0x449a5000\n 0002ec: ff 00 50 9a 44 00 50 9a 44 | \n 0002f5: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x449a5000 0x3f800000\n 0002fe: ff 00 50 9a 44 00 00 80 3f | \n 000307: fd 41                      | f32x4.eq\n 000309: 0b                         | end\n00030b func[4] <f64x2_eq_0>:\n 00030c: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 000315: 00 00 00 00 00 00 00 f8 ff | \n 00031e: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x80000000 0x00000000 0xfff80000\n 000327: 80 00 00 00 00 00 00 f8 ff | \n 000330: fd 47                      | f64x2.eq\n 000332: 0b                         | end\n000334 func[5] <i8x16_ne_0>:\n 000335: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 00033e: e0 03 00 00 00 04 00 00 00 | \n 000347: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 000350: e0 03 00 00 00 04 00 00 00 | \n 000359: fd 24                      | i8x16.ne\n 00035b: 0b                         | end\n00035d func[6] <i16x8_ne_0>:\n 00035e: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 000367: e0 03 00 00 00 04 00 00 00 | \n 000370: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 000379: e0 03 00 00 00 04 00 00 00 | \n 000382: fd 2e                      | i16x8.ne\n 000384: 0b                         | end\n000386 func[7] <i32x4_ne_0>:\n 000387: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 000390: e0 03 00 00 00 04 00 00 00 | \n 000399: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 0003a2: e0 03 00 00 00 04 00 00 00 | \n 0003ab: fd 38                      | i32x4.ne\n 0003ad: 0b                         | end\n0003af func[8] <f32x4_ne_0>:\n 0003b0: fd 0c 00 00 00 00 00 00 c0 | v128.const 0x00000000 0xffc00000 0x449a5000 0x449a5000\n 0003b9: ff 00 50 9a 44 00 50 9a 44 | \n 0003c2: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x449a5000 0x3f800000\n 0003cb: ff 00 50 9a 44 00 00 80 3f | \n 0003d4: fd 42                      | f32x4.ne\n 0003d6: 0b                         | end\n0003d8 func[9] <f64x2_ne_0>:\n 0003d9: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 0003e2: 00 00 00 00 00 00 00 f8 ff | \n 0003eb: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x80000000 0x00000000 0xfff80000\n 0003f4: 80 00 00 00 00 00 00 f8 ff | \n 0003fd: fd 48                      | f64x2.ne\n 0003ff: 0b                         | end\n000401 func[10] <i8x16_lt_s>:\n 000402: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 00040b: e0 03 80 00 00 04 00 00 00 | \n 000414: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 00041d: e0 03 00 00 00 04 81 00 00 | \n 000426: fd 25                      | i8x16.lt_s\n 000428: 0b                         | end\n00042a func[11] <i8x16_lt_u>:\n 00042b: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 000434: e0 03 80 00 00 04 00 00 00 | \n 00043d: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000446: e0 03 00 00 00 04 81 00 00 | \n 00044f: fd 26                      | i8x16.lt_u\n 000451: 0b                         | end\n000453 func[12] <i16x8_lt_s>:\n 000454: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 00045d: e0 03 80 00 00 04 00 00 00 | \n 000466: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 00046f: e0 03 00 00 00 04 81 00 00 | \n 000478: fd 2f                      | i16x8.lt_s\n 00047a: 0b                         | end\n00047c func[13] <i16x8_lt_u>:\n 00047d: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 000486: e0 03 80 00 00 04 00 00 00 | \n 00048f: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000498: e0 03 00 00 00 04 81 00 00 | \n 0004a1: fd 30                      | i16x8.lt_u\n 0004a3: 0b                         | end\n0004a5 func[14] <i32x4_lt_s>:\n 0004a6: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0004af: e0 03 80 00 00 04 00 00 00 | \n 0004b8: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0004c1: e0 03 00 00 00 04 81 00 00 | \n 0004ca: fd 39                      | i32x4.lt_s\n 0004cc: 0b                         | end\n0004ce func[15] <i32x4_lt_u>:\n 0004cf: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0004d8: e0 03 80 00 00 04 00 00 00 | \n 0004e1: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0004ea: e0 03 00 00 00 04 81 00 00 | \n 0004f3: fd 3a                      | i32x4.lt_u\n 0004f5: 0b                         | end\n0004f7 func[16] <f32x4_lt_0>:\n 0004f8: fd 0c 00 00 00 00 00 00 c0 | v128.const 0x00000000 0xffc00000 0x449a5000 0x449a5000\n 000501: ff 00 50 9a 44 00 50 9a 44 | \n 00050a: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0xffc00000 0x3f800000\n 000513: ff 00 00 c0 ff 00 00 80 3f | \n 00051c: fd 43                      | f32x4.lt\n 00051e: 0b                         | end\n000520 func[17] <f64x2_lt_0>:\n 000521: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 00052a: 00 00 00 00 00 00 00 f8 ff | \n 000533: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x80000000 0x00000000 0xfff80000\n 00053c: 80 00 00 00 00 00 00 f8 ff | \n 000545: fd 49                      | f64x2.lt\n 000547: 0b                         | end\n000549 func[18] <i8x16_le_s>:\n 00054a: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 000553: e0 03 80 00 00 04 00 00 00 | \n 00055c: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000565: e0 03 00 00 00 04 81 00 00 | \n 00056e: fd 29                      | i8x16.le_s\n 000570: 0b                         | end\n000572 func[19] <i8x16_le_u>:\n 000573: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 00057c: e0 03 80 00 00 04 00 00 00 | \n 000585: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 00058e: e0 03 00 00 00 04 81 00 00 | \n 000597: fd 2a                      | i8x16.le_u\n 000599: 0b                         | end\n00059b func[20] <i16x8_le_s>:\n 00059c: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0005a5: e0 03 80 00 00 04 00 00 00 | \n 0005ae: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0005b7: e0 03 00 00 00 04 81 00 00 | \n 0005c0: fd 33                      | i16x8.le_s\n 0005c2: 0b                         | end\n0005c4 func[21] <i16x8_le_u>:\n 0005c5: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0005ce: e0 03 80 00 00 04 00 00 00 | \n 0005d7: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0005e0: e0 03 00 00 00 04 81 00 00 | \n 0005e9: fd 34                      | i16x8.le_u\n 0005eb: 0b                         | end\n0005ed func[22] <i32x4_le_s>:\n 0005ee: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0005f7: e0 03 80 00 00 04 00 00 00 | \n 000600: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000609: e0 03 00 00 00 04 81 00 00 | \n 000612: fd 3d                      | i32x4.le_s\n 000614: 0b                         | end\n000616 func[23] <i32x4_le_u>:\n 000617: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 000620: e0 03 80 00 00 04 00 00 00 | \n 000629: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000632: e0 03 00 00 00 04 81 00 00 | \n 00063b: fd 3e                      | i32x4.le_u\n 00063d: 0b                         | end\n00063f func[24] <f32x4_le_0>:\n 000640: fd 0c 00 00 00 00 00 00 c0 | v128.const 0x00000000 0xffc00000 0x449a5000 0x449a5000\n 000649: ff 00 50 9a 44 00 50 9a 44 | \n 000652: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0xffc00000 0x3f800000\n 00065b: ff 00 00 c0 ff 00 00 80 3f | \n 000664: fd 45                      | f32x4.le\n 000666: 0b                         | end\n000668 func[25] <f64x2_le_0>:\n 000669: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 000672: 00 00 00 00 00 00 00 f8 ff | \n 00067b: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x80000000 0x00000000 0xfff80000\n 000684: 80 00 00 00 00 00 00 f8 ff | \n 00068d: fd 4b                      | f64x2.le\n 00068f: 0b                         | end\n000691 func[26] <i8x16_gt_s>:\n 000692: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 00069b: e0 03 80 00 00 04 00 00 00 | \n 0006a4: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0006ad: e0 03 00 00 00 04 81 00 00 | \n 0006b6: fd 27                      | i8x16.gt_s\n 0006b8: 0b                         | end\n0006ba func[27] <i8x16_gt_u>:\n 0006bb: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0006c4: e0 03 80 00 00 04 00 00 00 | \n 0006cd: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0006d6: e0 03 00 00 00 04 81 00 00 | \n 0006df: fd 28                      | i8x16.gt_u\n 0006e1: 0b                         | end\n0006e3 func[28] <i16x8_gt_s>:\n 0006e4: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0006ed: e0 03 80 00 00 04 00 00 00 | \n 0006f6: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0006ff: e0 03 00 00 00 04 81 00 00 | \n 000708: fd 31                      | i16x8.gt_s\n 00070a: 0b                         | end\n00070c func[29] <i16x8_gt_u>:\n 00070d: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 000716: e0 03 80 00 00 04 00 00 00 | \n 00071f: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000728: e0 03 00 00 00 04 81 00 00 | \n 000731: fd 32                      | i16x8.gt_u\n 000733: 0b                         | end\n000735 func[30] <i32x4_gt_s>:\n 000736: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 00073f: e0 03 80 00 00 04 00 00 00 | \n 000748: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000751: e0 03 00 00 00 04 81 00 00 | \n 00075a: fd 3b                      | i32x4.gt_s\n 00075c: 0b                         | end\n00075e func[31] <i32x4_gt_u>:\n 00075f: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 000768: e0 03 80 00 00 04 00 00 00 | \n 000771: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 00077a: e0 03 00 00 00 04 81 00 00 | \n 000783: fd 3c                      | i32x4.gt_u\n 000785: 0b                         | end\n000787 func[32] <f32x4_gt_0>:\n 000788: fd 0c 00 00 00 00 00 00 c0 | v128.const 0x00000000 0xffc00000 0x449a5000 0x449a5000\n 000791: ff 00 50 9a 44 00 50 9a 44 | \n 00079a: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0xffc00000 0x3f800000\n 0007a3: ff 00 00 c0 ff 00 00 80 3f | \n 0007ac: fd 44                      | f32x4.gt\n 0007ae: 0b                         | end\n0007b0 func[33] <f64x2_gt_0>:\n 0007b1: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 0007ba: 00 00 00 00 00 00 00 f8 ff | \n 0007c3: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x80000000 0x00000000 0xfff80000\n 0007cc: 80 00 00 00 00 00 00 f8 ff | \n 0007d5: fd 4a                      | f64x2.gt\n 0007d7: 0b                         | end\n0007d9 func[34] <i8x16_ge_s>:\n 0007da: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0007e3: e0 03 80 00 00 04 00 00 00 | \n 0007ec: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0007f5: e0 03 00 00 00 04 81 00 00 | \n 0007fe: fd 2b                      | i8x16.ge_s\n 000800: 0b                         | end\n000802 func[35] <i8x16_ge_u>:\n 000803: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 00080c: e0 03 80 00 00 04 00 00 00 | \n 000815: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 00081e: e0 03 00 00 00 04 81 00 00 | \n 000827: fd 2c                      | i8x16.ge_u\n 000829: 0b                         | end\n00082b func[36] <i16x8_ge_s>:\n 00082c: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 000835: e0 03 80 00 00 04 00 00 00 | \n 00083e: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000847: e0 03 00 00 00 04 81 00 00 | \n 000850: fd 35                      | i16x8.ge_s\n 000852: 0b                         | end\n000854 func[37] <i16x8_ge_u>:\n 000855: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 00085e: e0 03 80 00 00 04 00 00 00 | \n 000867: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000870: e0 03 00 00 00 04 81 00 00 | \n 000879: fd 36                      | i16x8.ge_u\n 00087b: 0b                         | end\n00087d func[38] <i32x4_ge_s>:\n 00087e: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 000887: e0 03 80 00 00 04 00 00 00 | \n 000890: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 000899: e0 03 00 00 00 04 81 00 00 | \n 0008a2: fd 3f                      | i32x4.ge_s\n 0008a4: 0b                         | end\n0008a6 func[39] <i32x4_ge_u>:\n 0008a7: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00008003 0x00000004\n 0008b0: e0 03 80 00 00 04 00 00 00 | \n 0008b9: fd 0c 01 00 00 02 02 ff 00 | v128.const 0x02000001 0xe000ff02 0x00000003 0x00008104\n 0008c2: e0 03 00 00 00 04 81 00 00 | \n 0008cb: fd 40                      | i32x4.ge_u\n 0008cd: 0b                         | end\n0008cf func[40] <f32x4_ge_0>:\n 0008d0: fd 0c 00 00 00 00 00 00 c0 | v128.const 0x00000000 0xffc00000 0x449a5000 0x449a5000\n 0008d9: ff 00 50 9a 44 00 50 9a 44 | \n 0008e2: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0xffc00000 0x3f800000\n 0008eb: ff 00 00 c0 ff 00 00 80 3f | \n 0008f4: fd 46                      | f32x4.ge\n 0008f6: 0b                         | end\n0008f8 func[41] <f64x2_ge_0>:\n 0008f9: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 000902: 00 00 00 00 00 00 00 f8 ff | \n 00090b: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x80000000 0x00000000 0xfff80000\n 000914: 80 00 00 00 00 00 00 f8 ff | \n 00091d: fd 4c                      | f64x2.ge\n 00091f: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-lane.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  ;; i8x16 extract lane signed/unsigned\n  (func (export  \"func_i8x16_extract_lane_s_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x000000ff 0x0000017f\n    i8x16.extract_lane_s 8)\n  (func (export  \"func_i8x16_extract_lane_u_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x000000ff 0x0000017f\n    i8x16.extract_lane_u 8)\n\n  ;; i16x8 extract lane signed/unsigned\n  (func (export  \"func_i16x8_extract_lane_s_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i16x8.extract_lane_s 4)\n  (func (export  \"func_i16x8_extract_lane_u_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i16x8.extract_lane_u 4)\n\n  ;; i32x4 extract lane\n  (func (export  \"func_i32x4_extract_lane_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i32x4.extract_lane 2)\n\n  ;; i64x2 extract lane\n  (func (export  \"func_i64x2_extract_lane_0\") (result i64)\n    v128.const i32x4 0x0000000f 0x00000000 0x0000ffff 0x0000017f\n    i64x2.extract_lane 0)\n\n  ;; f32x4 extract lane\n  ;; For Floating num:\n  ;; 1.5 = 0x3fc00000\n  (func (export  \"func_f32x4_extract_lane_0\") (result f32)\n    v128.const i32x4 0x00000001 0x3fc00000 0x0000ffff 0x0000017f\n    f32x4.extract_lane 1)\n\n  ;; f64x2 extract lane\n  ;; For Double num:\n  ;; 4.5 = 0x4012000000000000\n  (func (export  \"func_f64x2_extract_lane_0\") (result f64)\n    v128.const i32x4 0x00000000 0x40120000 0x0000ffff 0x0000017f\n    f64x2.extract_lane 0)\n\n  ;; i8x16 replace lane\n  (func (export  \"func_i8x16_replace_lane_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000000f 0x000000ff 0x0000017f\n    i32.const 0xe5\n    i8x16.replace_lane 8)\n\n  ;; i16x8 replace lane\n  (func (export  \"func_i16x8_replace_lane_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i32.const 0xe5e6\n    i16x8.replace_lane 4)\n\n  ;; i32x4 replace lane\n  (func (export  \"func_i32x4_replace_lane_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i32.const 0x12345678\n    i32x4.replace_lane 2)\n\n  ;; i64x2 replace lane\n  (func (export  \"func_i64x2_replace_lane_0\") (result v128)\n    v128.const i32x4 0x0000000f 0x00000000 0x0000ffff 0x0000017f\n    i64.const 0x0000123400005678\n    i64x2.replace_lane 0)\n\n  ;; f32x4 replace lane\n  (func (export  \"func_f32x4_replace_lane_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000000 0x0000ffff 0x0000017f\n    f32.const 1.5\n    f32x4.replace_lane 1)\n\n  ;; f64x2 replace lane\n  (func (export  \"func_f64x2_replace_lane_0\") (result v128)\n    v128.const i32x4 0x0000789a 0xff880330 0x0000ffff 0x0000017f\n    f64.const 4.5\n    f64x2.replace_lane 0)\n\n  ;; v8x16 swizzle\n  (func (export  \"func_v8x16_swizzle_0\") (result v128)\n    v128.const i32x4 0x11223344 0x55667788 0x99aabbcc 0xddeeff00\n    v128.const i32x4 0x0f0e0d0c 0x0b0a0908 0x07060504 0x03020100\n    i8x16.swizzle)\n\n  ;; v8x16 shuffle\n  (func (export  \"func_v8x16_shuffle_0\") (result v128)\n    v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n    v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155\n    i8x16.shuffle 16 1 18 3 20 5 22 7 24 9 26 11 28 13 30 15)\n)\n(;; STDOUT ;;;\n\nsimd-lane.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n0001f9 func[0] <func_i8x16_extract_lane_s_0>:\n 0001fa: fd 0c 01 00 00 00 0f 00 00 | v128.const 0x00000001 0x0000000f 0x000000ff 0x0000017f\n 000203: 00 ff 00 00 00 7f 01 00 00 | \n 00020c: fd 15 08                   | i8x16.extract_lane_s 8\n 00020f: 0b                         | end\n000211 func[1] <func_i8x16_extract_lane_u_0>:\n 000212: fd 0c 01 00 00 00 0f 00 00 | v128.const 0x00000001 0x0000000f 0x000000ff 0x0000017f\n 00021b: 00 ff 00 00 00 7f 01 00 00 | \n 000224: fd 16 08                   | i8x16.extract_lane_u 8\n 000227: 0b                         | end\n000229 func[2] <func_i16x8_extract_lane_s_0>:\n 00022a: fd 0c 01 00 00 00 0f 00 00 | v128.const 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n 000233: 00 ff ff 00 00 7f 01 00 00 | \n 00023c: fd 18 04                   | i16x8.extract_lane_s 4\n 00023f: 0b                         | end\n000241 func[3] <func_i16x8_extract_lane_u_0>:\n 000242: fd 0c 01 00 00 00 0f 00 00 | v128.const 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n 00024b: 00 ff ff 00 00 7f 01 00 00 | \n 000254: fd 19 04                   | i16x8.extract_lane_u 4\n 000257: 0b                         | end\n000259 func[4] <func_i32x4_extract_lane_0>:\n 00025a: fd 0c 01 00 00 00 0f 00 00 | v128.const 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n 000263: 00 ff ff 00 00 7f 01 00 00 | \n 00026c: fd 1b 02                   | i32x4.extract_lane 2\n 00026f: 0b                         | end\n000271 func[5] <func_i64x2_extract_lane_0>:\n 000272: fd 0c 0f 00 00 00 00 00 00 | v128.const 0x0000000f 0x00000000 0x0000ffff 0x0000017f\n 00027b: 00 ff ff 00 00 7f 01 00 00 | \n 000284: fd 1d 00                   | i64x2.extract_lane 0\n 000287: 0b                         | end\n000289 func[6] <func_f32x4_extract_lane_0>:\n 00028a: fd 0c 01 00 00 00 00 00 c0 | v128.const 0x00000001 0x3fc00000 0x0000ffff 0x0000017f\n 000293: 3f ff ff 00 00 7f 01 00 00 | \n 00029c: fd 1f 01                   | f32x4.extract_lane 1\n 00029f: 0b                         | end\n0002a1 func[7] <func_f64x2_extract_lane_0>:\n 0002a2: fd 0c 00 00 00 00 00 00 12 | v128.const 0x00000000 0x40120000 0x0000ffff 0x0000017f\n 0002ab: 40 ff ff 00 00 7f 01 00 00 | \n 0002b4: fd 21 00                   | f64x2.extract_lane 0\n 0002b7: 0b                         | end\n0002b9 func[8] <func_i8x16_replace_lane_0>:\n 0002ba: fd 0c 01 00 00 00 0f 00 00 | v128.const 0x00000001 0x0000000f 0x000000ff 0x0000017f\n 0002c3: 00 ff 00 00 00 7f 01 00 00 | \n 0002cc: 41 e5 01                   | i32.const 229\n 0002cf: fd 17 08                   | i8x16.replace_lane 8\n 0002d2: 0b                         | end\n0002d4 func[9] <func_i16x8_replace_lane_0>:\n 0002d5: fd 0c 01 00 00 00 0f 00 00 | v128.const 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n 0002de: 00 ff ff 00 00 7f 01 00 00 | \n 0002e7: 41 e6 cb 03                | i32.const 58854\n 0002eb: fd 1a 04                   | i16x8.replace_lane 4\n 0002ee: 0b                         | end\n0002f0 func[10] <func_i32x4_replace_lane_0>:\n 0002f1: fd 0c 01 00 00 00 0f 00 00 | v128.const 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n 0002fa: 00 ff ff 00 00 7f 01 00 00 | \n 000303: 41 f8 ac d1 91 01          | i32.const 305419896\n 000309: fd 1c 02                   | i32x4.replace_lane 2\n 00030c: 0b                         | end\n00030e func[11] <func_i64x2_replace_lane_0>:\n 00030f: fd 0c 0f 00 00 00 00 00 00 | v128.const 0x0000000f 0x00000000 0x0000ffff 0x0000017f\n 000318: 00 ff ff 00 00 7f 01 00 00 | \n 000321: 42 f8 ac 81 80 c0 c6 04    | i64.const 20014547621496\n 000329: fd 1e 00                   | i64x2.replace_lane 0\n 00032c: 0b                         | end\n00032e func[12] <func_f32x4_replace_lane_0>:\n 00032f: fd 0c 01 00 00 00 00 00 00 | v128.const 0x00000001 0x00000000 0x0000ffff 0x0000017f\n 000338: 00 ff ff 00 00 7f 01 00 00 | \n 000341: 43 00 00 c0 3f             | f32.const 0x1.8p+0\n 000346: fd 20 01                   | f32x4.replace_lane 1\n 000349: 0b                         | end\n00034b func[13] <func_f64x2_replace_lane_0>:\n 00034c: fd 0c 9a 78 00 00 30 03 88 | v128.const 0x0000789a 0xff880330 0x0000ffff 0x0000017f\n 000355: ff ff ff 00 00 7f 01 00 00 | \n 00035e: 44 00 00 00 00 00 00 12 40 | f64.const 0x1.2p+2\n 000367: fd 22 00                   | f64x2.replace_lane 0\n 00036a: 0b                         | end\n00036c func[14] <func_v8x16_swizzle_0>:\n 00036d: fd 0c 44 33 22 11 88 77 66 | v128.const 0x11223344 0x55667788 0x99aabbcc 0xddeeff00\n 000376: 55 cc bb aa 99 00 ff ee dd | \n 00037f: fd 0c 0c 0d 0e 0f 08 09 0a | v128.const 0x0f0e0d0c 0x0b0a0908 0x07060504 0x03020100\n 000388: 0b 04 05 06 07 00 01 02 03 | \n 000391: fd 0e                      | i8x16.swizzle\n 000393: 0b                         | end\n000395 func[15] <func_v8x16_shuffle_0>:\n 000396: fd 0c 01 ff 00 ff 0f ff 00 | v128.const 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n 00039f: ff ff ff 00 ff 7f ff 00 ff | \n 0003a8: fd 0c 55 00 55 00 55 00 55 | v128.const 0x00550055 0x00550055 0x00550055 0x00550155\n 0003b1: 00 55 00 55 00 55 01 55 00 | \n 0003ba: fd 0d 10 01 12 03 14 05 16 | i8x16.shuffle 0x03120110 0x07160514 0x0b1a0918 0x0f1e0d1c\n 0003c3: 07 18 09 1a 0b 1c 0d 1e 0f | \n 0003cc: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-load-lane.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0A\\0B\\0C\\0D\\0E\\0F\")\n\n  ;; v128.load8_lane\n  (func (export \"v128.load8_lane_0\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load8_lane 0 (local.get $address) (local.get $x)))\n  ;; v128.load8_lane with offset\n  (func (export \"v128.load8_lane_15_offset_15\")\n    (param $x v128) (result v128)\n    (v128.load8_lane offset=15 15 (i32.const 0) (local.get $x)))\n  ;; v128.load8_lane with alignment\n  (func (export \"v128.load8_lane_2_align_1\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load8_lane align=1 2 (local.get $address) (local.get $x)))\n  ;; v128.load8_lane with both offset and alignment\n  (func (export \"v128.load8_lane_8_offset_1_align_1\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load8_lane offset=1 align=1 8 (local.get $address) (local.get $x)))\n\n  ;; v128.load16_lane\n  (func (export \"v128.load16_lane_0\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load16_lane 0 (local.get $address) (local.get $x)))\n  ;; v128.load16_lane with offset\n  (func (export \"v128.load16_lane_7_offset_15\")\n    (param $x v128) (result v128)\n    (v128.load16_lane offset=15 7 (i32.const 0) (local.get $x)))\n  ;; v128.load16_lane with alignment\n  (func (export \"v128.load16_lane_2_align_1\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load16_lane align=1 2 (local.get $address) (local.get $x)))\n  ;; v128.load16_lane with both offset and alignment\n  (func (export \"v128.load16_lane_4_offset_1_align_2\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load16_lane offset=1 align=2 4 (local.get $address) (local.get $x)))\n\n  ;; v128.load32_lane\n  (func (export \"v128.load32_lane_0\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load32_lane 0 (local.get $address) (local.get $x)))\n  ;; v128.load32_lane with offset\n  (func (export \"v128.load32_lane_3_offset_15\")\n    (param $x v128) (result v128)\n    (v128.load32_lane offset=15 3 (i32.const 0) (local.get $x)))\n  ;; v128.load32_lane with alignment\n  (func (export \"v128.load32_lane_2_align_1\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load32_lane align=1 2 (local.get $address) (local.get $x)))\n  ;; v128.load32_lane with both offset and alignment\n  (func (export \"v128.load32_lane_2_offset_1_align_4\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load32_lane offset=1 align=4 2 (local.get $address) (local.get $x)))\n\n  ;; v128.load64_lane\n  (func (export \"v128.load64_lane_0\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load64_lane 0 (local.get $address) (local.get $x)))\n  ;; v128.load64_lane with offset\n  (func (export \"v128.load64_lane_1_offset_15\")\n    (param $x v128) (result v128)\n    (v128.load64_lane offset=15 1 (i32.const 0) (local.get $x)))\n  ;; v128.load64_lane with alignment\n  (func (export \"v128.load64_lane_0_align_1\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load64_lane align=1 0 (local.get $address) (local.get $x)))\n  ;; v128.load64_lane with both offset and alignment\n  (func (export \"v128.load64_lane_1_offset_1_align_8\")\n    (param $address i32) (param $x v128) (result v128)\n    (v128.load64_lane offset=1 align=8 1 (local.get $address) (local.get $x)))\n)\n(;; STDOUT ;;;\n\nsimd-load-lane.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000210 func[0] <v128.load8_lane_0>:\n 000211: 20 00                      | local.get 0\n 000213: 20 01                      | local.get 1\n 000215: fd 54 00 00 00             | v128.load8_lane 0 0 0\n 00021a: 0b                         | end\n00021c func[1] <v128.load8_lane_15_offset_15>:\n 00021d: 41 00                      | i32.const 0\n 00021f: 20 00                      | local.get 0\n 000221: fd 54 00 0f 0f             | v128.load8_lane 0 15 15\n 000226: 0b                         | end\n000228 func[2] <v128.load8_lane_2_align_1>:\n 000229: 20 00                      | local.get 0\n 00022b: 20 01                      | local.get 1\n 00022d: fd 54 00 00 02             | v128.load8_lane 0 0 2\n 000232: 0b                         | end\n000234 func[3] <v128.load8_lane_8_offset_1_align_1>:\n 000235: 20 00                      | local.get 0\n 000237: 20 01                      | local.get 1\n 000239: fd 54 00 01 08             | v128.load8_lane 0 1 8\n 00023e: 0b                         | end\n000240 func[4] <v128.load16_lane_0>:\n 000241: 20 00                      | local.get 0\n 000243: 20 01                      | local.get 1\n 000245: fd 55 01 00 00             | v128.load16_lane 1 0 0\n 00024a: 0b                         | end\n00024c func[5] <v128.load16_lane_7_offset_15>:\n 00024d: 41 00                      | i32.const 0\n 00024f: 20 00                      | local.get 0\n 000251: fd 55 01 0f 07             | v128.load16_lane 1 15 7\n 000256: 0b                         | end\n000258 func[6] <v128.load16_lane_2_align_1>:\n 000259: 20 00                      | local.get 0\n 00025b: 20 01                      | local.get 1\n 00025d: fd 55 00 00 02             | v128.load16_lane 0 0 2\n 000262: 0b                         | end\n000264 func[7] <v128.load16_lane_4_offset_1_align_2>:\n 000265: 20 00                      | local.get 0\n 000267: 20 01                      | local.get 1\n 000269: fd 55 01 01 04             | v128.load16_lane 1 1 4\n 00026e: 0b                         | end\n000270 func[8] <v128.load32_lane_0>:\n 000271: 20 00                      | local.get 0\n 000273: 20 01                      | local.get 1\n 000275: fd 56 02 00 00             | v128.load32_lane 2 0 0\n 00027a: 0b                         | end\n00027c func[9] <v128.load32_lane_3_offset_15>:\n 00027d: 41 00                      | i32.const 0\n 00027f: 20 00                      | local.get 0\n 000281: fd 56 02 0f 03             | v128.load32_lane 2 15 3\n 000286: 0b                         | end\n000288 func[10] <v128.load32_lane_2_align_1>:\n 000289: 20 00                      | local.get 0\n 00028b: 20 01                      | local.get 1\n 00028d: fd 56 00 00 02             | v128.load32_lane 0 0 2\n 000292: 0b                         | end\n000294 func[11] <v128.load32_lane_2_offset_1_align_4>:\n 000295: 20 00                      | local.get 0\n 000297: 20 01                      | local.get 1\n 000299: fd 56 02 01 02             | v128.load32_lane 2 1 2\n 00029e: 0b                         | end\n0002a0 func[12] <v128.load64_lane_0>:\n 0002a1: 20 00                      | local.get 0\n 0002a3: 20 01                      | local.get 1\n 0002a5: fd 57 03 00 00             | v128.load64_lane 3 0 0\n 0002aa: 0b                         | end\n0002ac func[13] <v128.load64_lane_1_offset_15>:\n 0002ad: 41 00                      | i32.const 0\n 0002af: 20 00                      | local.get 0\n 0002b1: fd 57 03 0f 01             | v128.load64_lane 3 15 1\n 0002b6: 0b                         | end\n0002b8 func[14] <v128.load64_lane_0_align_1>:\n 0002b9: 20 00                      | local.get 0\n 0002bb: 20 01                      | local.get 1\n 0002bd: fd 57 00 00 00             | v128.load64_lane 0 0 0\n 0002c2: 0b                         | end\n0002c4 func[15] <v128.load64_lane_1_offset_1_align_8>:\n 0002c5: 20 00                      | local.get 0\n 0002c7: 20 01                      | local.get 1\n 0002c9: fd 57 03 01 01             | v128.load64_lane 3 1 1\n 0002ce: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-load-store.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"\\ff\\ff\\ff\\ff\")\n  (data (i32.const 4) \"\\00\\00\\ce\\41\")\n  (data (i32.const 8) \"\\00\\00\\00\\00\\00\\ff\\8f\\40\")\n  (data (i32.const 16) \"\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\")\n\n  ;; v128 load\n  (func (export \"v128_load_0\") (result v128)\n    i32.const 4\n    v128.load)\n\n  ;; v128 store\n  (func (export \"v128_store_0\") (result v128)\n    i32.const 4\n    v128.const i32x4 0x11223344 0x55667788 0x99aabbcc 0xddeeff00\n    v128.store\n    i32.const 4\n    v128.load)\n\n  ;; i16x8.load8x8_s\n  (func (export \"i16x8.load8x8_s\") (result v128)\n    i32.const 0\n    v128.load8x8_s)\n\n  ;; i16x8.load8x8_u\n  (func (export \"i16x8.load8x8_u\") (result v128)\n    i32.const 0\n    v128.load8x8_u)\n\n  ;; i32x4.load16x4_s\n  (func (export \"i32x4.load16x4_s\") (result v128)\n    i32.const 0\n    v128.load16x4_s)\n\n  ;; i32x4.load16x4_u\n  (func (export \"i32x4.load16x4_u\") (result v128)\n    i32.const 0\n    v128.load16x4_u)\n\n  ;; i64x2.load32x2_s\n  (func (export \"i64x2.load32x2_s\") (result v128)\n    i32.const 0\n    v128.load32x2_s)\n\n  ;; i64x2.load32x2_u\n  (func (export \"i64x2.load32x2_u\") (result v128)\n    i32.const 0\n    v128.load32x2_u)\n)\n(;; STDOUT ;;;\n\nsimd-load-store.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n0000b4 func[0] <v128_load_0>:\n 0000b5: 41 04                      | i32.const 4\n 0000b7: fd 00 04 00                | v128.load 4 0\n 0000bb: 0b                         | end\n0000bd func[1] <v128_store_0>:\n 0000be: 41 04                      | i32.const 4\n 0000c0: fd 0c 44 33 22 11 88 77 66 | v128.const 0x11223344 0x55667788 0x99aabbcc 0xddeeff00\n 0000c9: 55 cc bb aa 99 00 ff ee dd | \n 0000d2: fd 0b 04 00                | v128.store 4 0\n 0000d6: 41 04                      | i32.const 4\n 0000d8: fd 00 04 00                | v128.load 4 0\n 0000dc: 0b                         | end\n0000de func[2] <i16x8.load8x8_s>:\n 0000df: 41 00                      | i32.const 0\n 0000e1: fd 01 03 00                | v128.load8x8_s 3 0\n 0000e5: 0b                         | end\n0000e7 func[3] <i16x8.load8x8_u>:\n 0000e8: 41 00                      | i32.const 0\n 0000ea: fd 02 03 00                | v128.load8x8_u 3 0\n 0000ee: 0b                         | end\n0000f0 func[4] <i32x4.load16x4_s>:\n 0000f1: 41 00                      | i32.const 0\n 0000f3: fd 03 03 00                | v128.load16x4_s 3 0\n 0000f7: 0b                         | end\n0000f9 func[5] <i32x4.load16x4_u>:\n 0000fa: 41 00                      | i32.const 0\n 0000fc: fd 04 03 00                | v128.load16x4_u 3 0\n 000100: 0b                         | end\n000102 func[6] <i64x2.load32x2_s>:\n 000103: 41 00                      | i32.const 0\n 000105: fd 05 03 00                | v128.load32x2_s 3 0\n 000109: 0b                         | end\n00010b func[7] <i64x2.load32x2_u>:\n 00010c: 41 00                      | i32.const 0\n 00010e: fd 06 03 00                | v128.load32x2_u 3 0\n 000112: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-shift.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  ;; i8x16 shl\n  (func (export \"i8x16_shl_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i32.const 3\n    i8x16.shl)\n\n  ;; i16x8 shl\n  (func (export \"i16x8_shl_0\") (result v128)\n    v128.const i32x4 0xff000071 0xe0000702 0x00000003 0x00000004\n    i32.const 3\n    i16x8.shl)\n\n  ;; i32x4 shl\n  (func (export \"i32x4_shl_0\") (result v128)\n    v128.const i32x4 0xff0ff071 0xe0077702 0xe0004003 0x00002004\n    i32.const 3\n    i32x4.shl)\n\n  ;; i64x2 shl\n  (func (export \"i64x2_shl_0\") (result v128)\n    v128.const i32x4 0xff000055 0xe0000702 0xe0004003 0x00002004\n    i32.const 3\n    i64x2.shl)\n\n  ;; i8x16 shr (signed and unsigned)\n  (func (export \"i8x16_shr_s_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i8x16.shr_s)\n  (func (export \"i8x16_shr_u_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i8x16.shr_u)\n\n  ;; i16x8 shr (signed and unsigned)\n  (func (export \"i16x8_shr_s_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i16x8.shr_s)\n  (func (export \"i16x8_shr_u_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i16x8.shr_u)\n\n  ;; i32x4 shr (signed and unsigned)\n  (func (export \"i32x4_shr_s_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i32x4.shr_s)\n  (func (export \"i32x4_shr_u_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i32x4.shr_u)\n\n  ;; i64x2 shr (signed and unsigned)\n  (func (export \"i64x2_shr_s_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i64x2.shr_s)\n  (func (export \"i64x2_shr_u_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i64x2.shr_u)\n  )\n(;; STDOUT ;;;\n\nsimd-shift.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n0000df func[0] <i8x16_shl_0>:\n 0000e0: fd 0c 01 00 00 ff 02 00 00 | v128.const 0xff000001 0xe0000002 0x00000003 0x00000004\n 0000e9: e0 03 00 00 00 04 00 00 00 | \n 0000f2: 41 03                      | i32.const 3\n 0000f4: fd 6b                      | i8x16.shl\n 0000f6: 0b                         | end\n0000f8 func[1] <i16x8_shl_0>:\n 0000f9: fd 0c 71 00 00 ff 02 07 00 | v128.const 0xff000071 0xe0000702 0x00000003 0x00000004\n 000102: e0 03 00 00 00 04 00 00 00 | \n 00010b: 41 03                      | i32.const 3\n 00010d: fd 8b 01                   | i16x8.shl\n 000110: 0b                         | end\n000112 func[2] <i32x4_shl_0>:\n 000113: fd 0c 71 f0 0f ff 02 77 07 | v128.const 0xff0ff071 0xe0077702 0xe0004003 0x00002004\n 00011c: e0 03 40 00 e0 04 20 00 00 | \n 000125: 41 03                      | i32.const 3\n 000127: fd ab 01                   | i32x4.shl\n 00012a: 0b                         | end\n00012c func[3] <i64x2_shl_0>:\n 00012d: fd 0c 55 00 00 ff 02 07 00 | v128.const 0xff000055 0xe0000702 0xe0004003 0x00002004\n 000136: e0 03 40 00 e0 04 20 00 00 | \n 00013f: 41 03                      | i32.const 3\n 000141: fd cb 01                   | i64x2.shl\n 000144: 0b                         | end\n000146 func[4] <i8x16_shr_s_0>:\n 000147: fd 0c 0f 00 00 ff 02 70 0f | v128.const 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n 000150: e0 03 00 00 0f 04 f0 0f 00 | \n 000159: 41 03                      | i32.const 3\n 00015b: fd 6c                      | i8x16.shr_s\n 00015d: 0b                         | end\n00015f func[5] <i8x16_shr_u_0>:\n 000160: fd 0c 0f 00 00 ff 02 70 0f | v128.const 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n 000169: e0 03 00 00 0f 04 f0 0f 00 | \n 000172: 41 03                      | i32.const 3\n 000174: fd 6d                      | i8x16.shr_u\n 000176: 0b                         | end\n000178 func[6] <i16x8_shr_s_0>:\n 000179: fd 0c 0f 00 00 ff 02 70 0f | v128.const 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n 000182: e0 03 00 00 0f 04 f0 0f 00 | \n 00018b: 41 03                      | i32.const 3\n 00018d: fd 8c 01                   | i16x8.shr_s\n 000190: 0b                         | end\n000192 func[7] <i16x8_shr_u_0>:\n 000193: fd 0c 0f 00 00 ff 02 70 0f | v128.const 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n 00019c: e0 03 00 00 0f 04 f0 0f 00 | \n 0001a5: 41 03                      | i32.const 3\n 0001a7: fd 8d 01                   | i16x8.shr_u\n 0001aa: 0b                         | end\n0001ac func[8] <i32x4_shr_s_0>:\n 0001ad: fd 0c 0f 00 00 ff 02 70 0f | v128.const 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n 0001b6: e0 03 00 00 0f 04 f0 0f 00 | \n 0001bf: 41 03                      | i32.const 3\n 0001c1: fd ac 01                   | i32x4.shr_s\n 0001c4: 0b                         | end\n0001c6 func[9] <i32x4_shr_u_0>:\n 0001c7: fd 0c 0f 00 00 ff 02 70 0f | v128.const 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n 0001d0: e0 03 00 00 0f 04 f0 0f 00 | \n 0001d9: 41 03                      | i32.const 3\n 0001db: fd ad 01                   | i32x4.shr_u\n 0001de: 0b                         | end\n0001e0 func[10] <i64x2_shr_s_0>:\n 0001e1: fd 0c 0f 00 00 ff 02 70 0f | v128.const 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n 0001ea: e0 03 00 00 0f 04 f0 0f 00 | \n 0001f3: 41 03                      | i32.const 3\n 0001f5: fd cc 01                   | i64x2.shr_s\n 0001f8: 0b                         | end\n0001fa func[11] <i64x2_shr_u_0>:\n 0001fb: fd 0c 0f 00 00 ff 02 70 0f | v128.const 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n 000204: e0 03 00 00 0f 04 f0 0f 00 | \n 00020d: 41 03                      | i32.const 3\n 00020f: fd cd 01                   | i64x2.shr_u\n 000212: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-splat.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  ;; i8x16\n  (func (export  \"func_i8x16_splat_0\") (result  v128)\n    i32.const 0x7f\n    i8x16.splat)\n\n  ;; i16x8\n  (func (export  \"func_i16x8_splat_0\") (result  v128)\n    i32.const 0x1234\n    i16x8.splat)\n\n  ;; i32x4\n  (func (export  \"func_i32x4_splat_0\") (result  v128)\n    i32.const 0x12345678\n    i32x4.splat)\n\n  ;; i64x2\n  (func (export  \"func_i64x2_splat_0\") (result  v128)\n    i64.const 0x1234567800000000\n    i64x2.splat)\n\n  ;; f32x4\n  (func (export  \"func_f32x4_splat_0\") (result  v128)\n    f32.const 1.0\n    f32x4.splat)\n  ;; float 6.91 == Hex 0x40dd1eb8\n\n  ;; f64x2\n  (func (export  \"func_f64x2_splat_0\") (result  v128)\n    f64.const 1.0\n    f64x2.splat)\n)\n(;; STDOUT ;;;\n\nsimd-splat.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00009d func[0] <func_i8x16_splat_0>:\n 00009e: 41 ff 00                   | i32.const 127\n 0000a1: fd 0f                      | i8x16.splat\n 0000a3: 0b                         | end\n0000a5 func[1] <func_i16x8_splat_0>:\n 0000a6: 41 b4 24                   | i32.const 4660\n 0000a9: fd 10                      | i16x8.splat\n 0000ab: 0b                         | end\n0000ad func[2] <func_i32x4_splat_0>:\n 0000ae: 41 f8 ac d1 91 01          | i32.const 305419896\n 0000b4: fd 11                      | i32x4.splat\n 0000b6: 0b                         | end\n0000b8 func[3] <func_i64x2_splat_0>:\n 0000b9: 42 80 80 80 80 80 cf 95 9a | i64.const 1311768464867721216\n 0000c2: 12                         | \n 0000c3: fd 12                      | i64x2.splat\n 0000c5: 0b                         | end\n0000c7 func[4] <func_f32x4_splat_0>:\n 0000c8: 43 00 00 80 3f             | f32.const 0x1p+0\n 0000cd: fd 13                      | f32x4.splat\n 0000cf: 0b                         | end\n0000d1 func[5] <func_f64x2_splat_0>:\n 0000d2: 44 00 00 00 00 00 00 f0 3f | f64.const 0x1p+0\n 0000db: fd 14                      | f64x2.splat\n 0000dd: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-store-lane.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0A\\0B\\0C\\0D\\0E\\0F\")\n\n  ;; v128.store8_lane\n  (func (export \"v128.store8_lane_0\")\n    (param $address i32) (param $x v128)\n    (v128.store8_lane 0 (local.get $address) (local.get $x)))\n  ;; v128.store8_lane with offset\n  (func (export \"v128.store8_lane_15_offset_15\")\n    (param $x v128)\n    (v128.store8_lane offset=15 15 (i32.const 0) (local.get $x)))\n  ;; v128.store8_lane with alignment\n  (func (export \"v128.store8_lane_2_align_1\")\n    (param $address i32) (param $x v128)\n    (v128.store8_lane align=1 2 (local.get $address) (local.get $x)))\n  ;; v128.store8_lane with both offset and alignment\n  (func (export \"v128.store8_lane_8_offset_1_align_1\")\n    (param $address i32) (param $x v128)\n    (v128.store8_lane offset=1 align=1 8 (local.get $address) (local.get $x)))\n\n  ;; v128.store16_lane\n  (func (export \"v128.store16_lane_0\")\n    (param $address i32) (param $x v128)\n    (v128.store16_lane 0 (local.get $address) (local.get $x)))\n  ;; v128.store16_lane with offset\n  (func (export \"v128.store16_lane_7_offset_15\")\n    (param $x v128)\n    (v128.store16_lane offset=15 7 (i32.const 0) (local.get $x)))\n  ;; v128.store16_lane with alignment\n  (func (export \"v128.store16_lane_2_align_1\")\n    (param $address i32) (param $x v128)\n    (v128.store16_lane align=1 2 (local.get $address) (local.get $x)))\n  ;; v128.store16_lane with both offset and alignment\n  (func (export \"v128.store16_lane_4_offset_1_align_1\")\n    (param $address i32) (param $x v128)\n    (v128.store16_lane offset=1 align=1 4 (local.get $address) (local.get $x)))\n\n  ;; v128.store32_lane\n  (func (export \"v128.store32_lane_0\")\n    (param $address i32) (param $x v128)\n    (v128.store32_lane 0 (local.get $address) (local.get $x)))\n  ;; v128.store32_lane with offset\n  (func (export \"v128.store32_lane_3_offset_15\")\n    (param $x v128)\n    (v128.store32_lane offset=15 3 (i32.const 0) (local.get $x)))\n  ;; v128.store32_lane with alignment\n  (func (export \"v128.store32_lane_2_align_1\")\n    (param $address i32) (param $x v128)\n    (v128.store32_lane align=1 2 (local.get $address) (local.get $x)))\n  ;; v128.store32_lane with both offset and alignment\n  (func (export \"v128.store32_lane_2_offset_1_align_1\")\n    (param $address i32) (param $x v128)\n    (v128.store32_lane offset=1 align=1 2 (local.get $address) (local.get $x)))\n\n  ;; v128.store64_lane\n  (func (export \"v128.store64_lane_0\")\n    (param $address i32) (param $x v128)\n    (v128.store64_lane 0 (local.get $address) (local.get $x)))\n  ;; v128.store64_lane with offset\n  (func (export \"v128.store64_lane_1_offset_15\")\n    (param $x v128)\n    (v128.store64_lane offset=15 1 (i32.const 0) (local.get $x)))\n  ;; v128.store64_lane with alignment\n  (func (export \"v128.store64_lane_0_align_1\")\n    (param $address i32) (param $x v128)\n    (v128.store64_lane align=1 0 (local.get $address) (local.get $x)))\n  ;; v128.store64_lane with both offset and alignment\n  (func (export \"v128.store64_lane_1_offset_1_align_1\")\n    (param $address i32) (param $x v128)\n    (v128.store64_lane offset=1 align=1 1 (local.get $address) (local.get $x)))\n)\n(;; STDOUT ;;;\n\nsimd-store-lane.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00021e func[0] <v128.store8_lane_0>:\n 00021f: 20 00                      | local.get 0\n 000221: 20 01                      | local.get 1\n 000223: fd 58 00 00 00             | v128.store8_lane 0 0 0\n 000228: 0b                         | end\n00022a func[1] <v128.store8_lane_15_offset_15>:\n 00022b: 41 00                      | i32.const 0\n 00022d: 20 00                      | local.get 0\n 00022f: fd 58 00 0f 0f             | v128.store8_lane 0 15 15\n 000234: 0b                         | end\n000236 func[2] <v128.store8_lane_2_align_1>:\n 000237: 20 00                      | local.get 0\n 000239: 20 01                      | local.get 1\n 00023b: fd 58 00 00 02             | v128.store8_lane 0 0 2\n 000240: 0b                         | end\n000242 func[3] <v128.store8_lane_8_offset_1_align_1>:\n 000243: 20 00                      | local.get 0\n 000245: 20 01                      | local.get 1\n 000247: fd 58 00 01 08             | v128.store8_lane 0 1 8\n 00024c: 0b                         | end\n00024e func[4] <v128.store16_lane_0>:\n 00024f: 20 00                      | local.get 0\n 000251: 20 01                      | local.get 1\n 000253: fd 59 01 00 00             | v128.store16_lane 1 0 0\n 000258: 0b                         | end\n00025a func[5] <v128.store16_lane_7_offset_15>:\n 00025b: 41 00                      | i32.const 0\n 00025d: 20 00                      | local.get 0\n 00025f: fd 59 01 0f 07             | v128.store16_lane 1 15 7\n 000264: 0b                         | end\n000266 func[6] <v128.store16_lane_2_align_1>:\n 000267: 20 00                      | local.get 0\n 000269: 20 01                      | local.get 1\n 00026b: fd 59 00 00 02             | v128.store16_lane 0 0 2\n 000270: 0b                         | end\n000272 func[7] <v128.store16_lane_4_offset_1_align_1>:\n 000273: 20 00                      | local.get 0\n 000275: 20 01                      | local.get 1\n 000277: fd 59 00 01 04             | v128.store16_lane 0 1 4\n 00027c: 0b                         | end\n00027e func[8] <v128.store32_lane_0>:\n 00027f: 20 00                      | local.get 0\n 000281: 20 01                      | local.get 1\n 000283: fd 5a 02 00 00             | v128.store32_lane 2 0 0\n 000288: 0b                         | end\n00028a func[9] <v128.store32_lane_3_offset_15>:\n 00028b: 41 00                      | i32.const 0\n 00028d: 20 00                      | local.get 0\n 00028f: fd 5a 02 0f 03             | v128.store32_lane 2 15 3\n 000294: 0b                         | end\n000296 func[10] <v128.store32_lane_2_align_1>:\n 000297: 20 00                      | local.get 0\n 000299: 20 01                      | local.get 1\n 00029b: fd 5a 00 00 02             | v128.store32_lane 0 0 2\n 0002a0: 0b                         | end\n0002a2 func[11] <v128.store32_lane_2_offset_1_align_1>:\n 0002a3: 20 00                      | local.get 0\n 0002a5: 20 01                      | local.get 1\n 0002a7: fd 5a 00 01 02             | v128.store32_lane 0 1 2\n 0002ac: 0b                         | end\n0002ae func[12] <v128.store64_lane_0>:\n 0002af: 20 00                      | local.get 0\n 0002b1: 20 01                      | local.get 1\n 0002b3: fd 5b 03 00 00             | v128.store64_lane 3 0 0\n 0002b8: 0b                         | end\n0002ba func[13] <v128.store64_lane_1_offset_15>:\n 0002bb: 41 00                      | i32.const 0\n 0002bd: 20 00                      | local.get 0\n 0002bf: fd 5b 03 0f 01             | v128.store64_lane 3 15 1\n 0002c4: 0b                         | end\n0002c6 func[14] <v128.store64_lane_0_align_1>:\n 0002c7: 20 00                      | local.get 0\n 0002c9: 20 01                      | local.get 1\n 0002cb: fd 5b 00 00 00             | v128.store64_lane 0 0 0\n 0002d0: 0b                         | end\n0002d2 func[15] <v128.store64_lane_1_offset_1_align_1>:\n 0002d3: 20 00                      | local.get 0\n 0002d5: 20 01                      | local.get 1\n 0002d7: fd 5b 00 01 01             | v128.store64_lane 0 1 1\n 0002dc: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/simd-unary.txt",
    "content": ";;; TOOL: run-objdump\n\n(module\n  ;; i8x16 neg\n  (func (export \"i8x16_neg_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.neg)\n\n  ;; i16x8 neg\n  (func (export \"i16x8_neg_0\") (result v128)\n    v128.const i32x4 0x0000ffff 0x00007fff 0x00000003 0x00000004\n    i16x8.neg)\n\n  ;; i32x4 neg\n  (func (export \"i32x4_neg_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.neg)\n\n  ;; i64x2 neg\n  (func (export \"i64x2_neg_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i64x2.neg)\n\n  ;; v128 not\n  (func (export \"v128_not_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    v128.not)\n\n  ;; v128 any_true\n  (func (export \"v128_any_true_0\") (result i32)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    v128.any_true)\n\n  ;; i8x16 all_true\n  (func (export \"i8x16_all_true_0\") (result i32)\n    v128.const i32x4 0x01020304 0x01050706 0x10020403 0x20103004\n    i8x16.all_true)\n\n  ;; i16x8 all_true\n  (func (export \"i16x8_all_true_0\") (result i32)\n    v128.const i32x4 0x00040004 0x00030003 0x00020002 0x00010001\n    i16x8.all_true)\n\n  ;; i32x4 all_true\n  (func (export \"i32x4_all_true_0\") (result i32)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    i32x4.all_true)\n\n  ;; i8x16 bitmask\n  (func (export \"i8x16_bitmask_0\") (result i32)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    i8x16.bitmask)\n\n  ;; i16x8 bitmask\n  (func (export \"i16x8_bitmask_0\") (result i32)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000\n    i16x8.bitmask)\n\n  ;; i32x4 bitmask\n  (func (export \"i32x4_bitmask_0\") (result i32)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    i32x4.bitmask)\n\n  ;; f32x4 neg\n  (func (export \"f32x4_neg_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xbf800000\n    f32x4.neg)\n\n  ;; f64x2 neg\n  (func (export \"f64x2_neg_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    f64x2.neg)\n  (func (export \"f64x2_neg_1\") (result v128)\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.neg)\n\n  ;; f32x4 abs\n  (func (export \"f32x4_abs_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xbf800000\n    f32x4.abs)\n\n  ;; f64x2 abs\n  (func (export \"f64x2_abs_0\") (result v128)\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.abs)\n  (func (export \"f64x2_abs_1\") (result v128)\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.abs)\n\n  ;; f32x4 sqrt\n  (func (export \"f32x4_sqrt_0\") (result v128)\n    v128.const i32x4 0xbf800000 0xffc00000 0x40800000 0x41100000\n    f32x4.sqrt)\n\n  ;; f64x2 sqrt\n  (func (export \"f64x2_sqrt_0\") (result v128)\n    v128.const i32x4 0x00000000 0xbff00000 0x00000000 0xfff80000\n    f64x2.sqrt)\n  (func (export \"f64x2_sqrt_1\") (result v128)\n    v128.const i32x4 0x00000000 0x40100000 0x00000000 0x40220000\n    f64x2.sqrt)\n\n  ;; f32x4 convert_i32x4_s\n  (func (export \"f32x4_convert_i32x4_s_0\") (result v128)\n    v128.const i32x4 0x00000001 0xffffffff 0x00000000 0x00000003\n    f32x4.convert_i32x4_s)\n\n  ;; f32x4 convert_i32x4_u\n  (func (export \"f32x4_convert_i32x4_u_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000000 0x00000003\n    f32x4.convert_i32x4_u)\n\n  ;; i32x4 trunc_sat_f32x4_s\n  (func (export \"i32x4_trunc_sat_f32x4_s_0\") (result v128)\n    v128.const i32x4 0x3fc00000 0xc0900000 0xffc00000 0x449a599a\n    i32x4.trunc_sat_f32x4_s)\n\n  ;; i32x4 trunc_sat_f32x4_u\n  (func (export \"i32x4_trunc_sat_f32x4_u_0\") (result v128)\n    v128.const i32x4 0x3fc00000 0x40900000 0xffc00000 0x449a599a\n    i32x4.trunc_sat_f32x4_u)\n)\n(;; STDOUT ;;;\n\nsimd-unary.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n0001eb func[0] <i8x16_neg_0>:\n 0001ec: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 0001f5: 00 03 00 00 00 04 00 00 00 | \n 0001fe: fd 61                      | i8x16.neg\n 000200: 0b                         | end\n000202 func[1] <i16x8_neg_0>:\n 000203: fd 0c ff ff 00 00 ff 7f 00 | v128.const 0x0000ffff 0x00007fff 0x00000003 0x00000004\n 00020c: 00 03 00 00 00 04 00 00 00 | \n 000215: fd 81 01                   | i16x8.neg\n 000218: 0b                         | end\n00021a func[2] <i32x4_neg_0>:\n 00021b: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 000224: 00 03 00 00 00 04 00 00 00 | \n 00022d: fd a1 01                   | i32x4.neg\n 000230: 0b                         | end\n000232 func[3] <i64x2_neg_0>:\n 000233: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004\n 00023c: 00 03 00 00 00 04 00 00 00 | \n 000245: fd c1 01                   | i64x2.neg\n 000248: 0b                         | end\n00024a func[4] <v128_not_0>:\n 00024b: fd 0c 01 00 ff 00 02 00 55 | v128.const 0x00ff0001 0x00550002 0x00000003 0x00000004\n 000254: 00 03 00 00 00 04 00 00 00 | \n 00025d: fd 4d                      | v128.not\n 00025f: 0b                         | end\n000261 func[5] <v128_any_true_0>:\n 000262: fd 0c 01 00 ff 00 02 00 55 | v128.const 0x00ff0001 0x00550002 0x00000003 0x00000004\n 00026b: 00 03 00 00 00 04 00 00 00 | \n 000274: fd 53                      | v128.any_true\n 000276: 0b                         | end\n000278 func[6] <i8x16_all_true_0>:\n 000279: fd 0c 04 03 02 01 06 07 05 | v128.const 0x01020304 0x01050706 0x10020403 0x20103004\n 000282: 01 03 04 02 10 04 30 10 20 | \n 00028b: fd 63                      | i8x16.all_true\n 00028d: 0b                         | end\n00028f func[7] <i16x8_all_true_0>:\n 000290: fd 0c 04 00 04 00 03 00 03 | v128.const 0x00040004 0x00030003 0x00020002 0x00010001\n 000299: 00 02 00 02 00 01 00 01 00 | \n 0002a2: fd 83 01                   | i16x8.all_true\n 0002a5: 0b                         | end\n0002a7 func[8] <i32x4_all_true_0>:\n 0002a8: fd 0c 01 00 ff 00 02 00 55 | v128.const 0x00ff0001 0x00550002 0x00000003 0x00000004\n 0002b1: 00 03 00 00 00 04 00 00 00 | \n 0002ba: fd a3 01                   | i32x4.all_true\n 0002bd: 0b                         | end\n0002bf func[9] <i8x16_bitmask_0>:\n 0002c0: fd 0c 01 00 ff 00 02 00 55 | v128.const 0x00ff0001 0x00550002 0x00000003 0x00000004\n 0002c9: 00 03 00 00 00 04 00 00 00 | \n 0002d2: fd 64                      | i8x16.bitmask\n 0002d4: 0b                         | end\n0002d6 func[10] <i16x8_bitmask_0>:\n 0002d7: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0x00000000\n 0002e0: 00 00 00 00 00 00 00 00 00 | \n 0002e9: fd 84 01                   | i16x8.bitmask\n 0002ec: 0b                         | end\n0002ee func[11] <i32x4_bitmask_0>:\n 0002ef: fd 0c 01 00 ff 00 02 00 55 | v128.const 0x00ff0001 0x00550002 0x00000003 0x00000004\n 0002f8: 00 03 00 00 00 04 00 00 00 | \n 000301: fd a4 01                   | i32x4.bitmask\n 000304: 0b                         | end\n000306 func[12] <f32x4_neg_0>:\n 000307: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x449a5000 0xbf800000\n 000310: ff 00 50 9a 44 00 00 80 bf | \n 000319: fd e1 01                   | f32x4.neg\n 00031c: 0b                         | end\n00031e func[13] <f64x2_neg_0>:\n 00031f: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x00000000 0x00000000 0xfff80000\n 000328: 00 00 00 00 00 00 00 f8 ff | \n 000331: fd ed 01                   | f64x2.neg\n 000334: 0b                         | end\n000336 func[14] <f64x2_neg_1>:\n 000337: fd 0c 00 00 00 00 00 4a 93 | v128.const 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n 000340: c0 00 00 00 00 00 00 f0 3f | \n 000349: fd ed 01                   | f64x2.neg\n 00034c: 0b                         | end\n00034e func[15] <f32x4_abs_0>:\n 00034f: fd 0c 00 00 00 80 00 00 c0 | v128.const 0x80000000 0xffc00000 0x449a5000 0xbf800000\n 000358: ff 00 50 9a 44 00 00 80 bf | \n 000361: fd e0 01                   | f32x4.abs\n 000364: 0b                         | end\n000366 func[16] <f64x2_abs_0>:\n 000367: fd 0c 00 00 00 00 00 00 00 | v128.const 0x00000000 0x80000000 0x00000000 0xfff80000\n 000370: 80 00 00 00 00 00 00 f8 ff | \n 000379: fd ec 01                   | f64x2.abs\n 00037c: 0b                         | end\n00037e func[17] <f64x2_abs_1>:\n 00037f: fd 0c 00 00 00 00 00 4a 93 | v128.const 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n 000388: c0 00 00 00 00 00 00 f0 3f | \n 000391: fd ec 01                   | f64x2.abs\n 000394: 0b                         | end\n000396 func[18] <f32x4_sqrt_0>:\n 000397: fd 0c 00 00 80 bf 00 00 c0 | v128.const 0xbf800000 0xffc00000 0x40800000 0x41100000\n 0003a0: ff 00 00 80 40 00 00 10 41 | \n 0003a9: fd e3 01                   | f32x4.sqrt\n 0003ac: 0b                         | end\n0003ae func[19] <f64x2_sqrt_0>:\n 0003af: fd 0c 00 00 00 00 00 00 f0 | v128.const 0x00000000 0xbff00000 0x00000000 0xfff80000\n 0003b8: bf 00 00 00 00 00 00 f8 ff | \n 0003c1: fd ef 01                   | f64x2.sqrt\n 0003c4: 0b                         | end\n0003c6 func[20] <f64x2_sqrt_1>:\n 0003c7: fd 0c 00 00 00 00 00 00 10 | v128.const 0x00000000 0x40100000 0x00000000 0x40220000\n 0003d0: 40 00 00 00 00 00 00 22 40 | \n 0003d9: fd ef 01                   | f64x2.sqrt\n 0003dc: 0b                         | end\n0003de func[21] <f32x4_convert_i32x4_s_0>:\n 0003df: fd 0c 01 00 00 00 ff ff ff | v128.const 0x00000001 0xffffffff 0x00000000 0x00000003\n 0003e8: ff 00 00 00 00 03 00 00 00 | \n 0003f1: fd fa 01                   | f32x4.convert_i32x4_s\n 0003f4: 0b                         | end\n0003f6 func[22] <f32x4_convert_i32x4_u_0>:\n 0003f7: fd 0c 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000000 0x00000003\n 000400: 00 00 00 00 00 03 00 00 00 | \n 000409: fd fb 01                   | f32x4.convert_i32x4_u\n 00040c: 0b                         | end\n00040e func[23] <i32x4_trunc_sat_f32x4_s_0>:\n 00040f: fd 0c 00 00 c0 3f 00 00 90 | v128.const 0x3fc00000 0xc0900000 0xffc00000 0x449a599a\n 000418: c0 00 00 c0 ff 9a 59 9a 44 | \n 000421: fd f8 01                   | i32x4.trunc_sat_f32x4_s\n 000424: 0b                         | end\n000426 func[24] <i32x4_trunc_sat_f32x4_u_0>:\n 000427: fd 0c 00 00 c0 3f 00 00 90 | v128.const 0x3fc00000 0x40900000 0xffc00000 0x449a599a\n 000430: 40 00 00 c0 ff 9a 59 9a 44 | \n 000439: fd f9 01                   | i32x4.trunc_sat_f32x4_u\n 00043c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/start.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --debug-names\n;;; ARGS1: -x --headers\n(module\n  (func $a)\n  (func $b)\n  (func $start)\n  (start $start))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 03                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n0000012: 00                                        ; function 1 signature index\n0000013: 00                                        ; function 2 signature index\n000000f: 04                                        ; FIXUP section size\n; section \"Start\" (8)\n0000014: 08                                        ; section code\n0000015: 00                                        ; section size (guess)\n0000016: 02                                        ; start func index\n0000015: 01                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 03                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 0b                                        ; end\n000001a: 02                                        ; FIXUP func body size\n; function body 1\n000001d: 00                                        ; func body size (guess)\n000001e: 00                                        ; local decl count\n000001f: 0b                                        ; end\n000001d: 02                                        ; FIXUP func body size\n; function body 2\n0000020: 00                                        ; func body size (guess)\n0000021: 00                                        ; local decl count\n0000022: 0b                                        ; end\n0000020: 02                                        ; FIXUP func body size\n0000018: 0a                                        ; FIXUP section size\n; section \"name\"\n0000023: 00                                        ; section code\n0000024: 00                                        ; section size (guess)\n0000025: 04                                        ; string length\n0000026: 6e61 6d65                                name  ; custom section name\n000002a: 01                                        ; name subsection type\n000002b: 00                                        ; subsection size (guess)\n000002c: 03                                        ; num names\n000002d: 00                                        ; elem index\n000002e: 01                                        ; string length\n000002f: 61                                       a  ; elem name 0\n0000030: 01                                        ; elem index\n0000031: 01                                        ; string length\n0000032: 62                                       b  ; elem name 1\n0000033: 02                                        ; elem index\n0000034: 05                                        ; string length\n0000035: 7374 6172 74                             start  ; elem name 2\n000002b: 0e                                        ; FIXUP subsection size\n000003a: 02                                        ; local name type\n000003b: 00                                        ; subsection size (guess)\n000003c: 03                                        ; num functions\n000003d: 00                                        ; function index\n000003e: 00                                        ; num locals\n000003f: 01                                        ; function index\n0000040: 00                                        ; num locals\n0000041: 02                                        ; function index\n0000042: 00                                        ; num locals\n000003b: 07                                        ; FIXUP subsection size\n0000024: 1e                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nstart.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000e (size=0x00000004) count: 1\n Function start=0x00000010 end=0x00000014 (size=0x00000004) count: 3\n    Start start=0x00000016 end=0x00000017 (size=0x00000001) start: 2\n     Code start=0x00000019 end=0x00000023 (size=0x0000000a) count: 3\n   Custom start=0x00000025 end=0x00000043 (size=0x0000001e) \"name\"\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nFunction[3]:\n - func[0] sig=0 <a>\n - func[1] sig=0 <b>\n - func[2] sig=0 <start>\nStart:\n - start function: 2 <start>\nCode[3]:\n - func[0] size=2 <a>\n - func[1] size=2 <b>\n - func[2] size=2 <start>\nCustom:\n - name: \"name\"\n - func[0] <a>\n - func[1] <b>\n - func[2] <start>\n\nCode Disassembly:\n\n00001b func[0] <a>:\n 00001c: 0b                         | end\n00001e func[1] <b>:\n 00001f: 0b                         | end\n000021 func[2] <start>:\n 000022: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/store-aligned.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.const 0\n    i32.store8 align=1\n    i32.const 0\n    i32.const 0\n    i32.store16 align=1\n    i32.const 0\n    i32.const 0\n    i32.store16 align=2\n    i32.const 0\n    i32.const 0\n    i32.store align=1\n    i32.const 0\n    i32.const 0\n    i32.store align=2\n    i32.const 0\n    i32.const 0\n    i32.store align=4\n    i32.const 0\n    i64.const 0\n    i64.store8 align=1\n    i32.const 0\n    i64.const 0\n    i64.store16 align=1\n    i32.const 0\n    i64.const 0\n    i64.store16 align=2\n    i32.const 0\n    i64.const 0\n    i64.store32 align=1\n    i32.const 0\n    i64.const 0\n    i64.store32 align=2\n    i32.const 0\n    i64.const 0\n    i64.store32 align=4\n    i32.const 0\n    i64.const 0\n    i64.store align=1\n    i32.const 0\n    i64.const 0\n    i64.store align=2\n    i32.const 0\n    i64.const 0\n    i64.store align=4\n    i32.const 0\n    i64.const 0\n    i64.store align=8))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000012: 05                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num memories\n; memory 0\n0000015: 00                                        ; limits: flags\n0000016: 01                                        ; limits: initial\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 01                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 41                                        ; i32.const\n000001d: 00                                        ; i32 literal\n000001e: 41                                        ; i32.const\n000001f: 00                                        ; i32 literal\n0000020: 3a                                        ; i32.store8\n0000021: 00                                        ; alignment\n0000022: 00                                        ; store offset\n0000023: 41                                        ; i32.const\n0000024: 00                                        ; i32 literal\n0000025: 41                                        ; i32.const\n0000026: 00                                        ; i32 literal\n0000027: 3b                                        ; i32.store16\n0000028: 00                                        ; alignment\n0000029: 00                                        ; store offset\n000002a: 41                                        ; i32.const\n000002b: 00                                        ; i32 literal\n000002c: 41                                        ; i32.const\n000002d: 00                                        ; i32 literal\n000002e: 3b                                        ; i32.store16\n000002f: 01                                        ; alignment\n0000030: 00                                        ; store offset\n0000031: 41                                        ; i32.const\n0000032: 00                                        ; i32 literal\n0000033: 41                                        ; i32.const\n0000034: 00                                        ; i32 literal\n0000035: 36                                        ; i32.store\n0000036: 00                                        ; alignment\n0000037: 00                                        ; store offset\n0000038: 41                                        ; i32.const\n0000039: 00                                        ; i32 literal\n000003a: 41                                        ; i32.const\n000003b: 00                                        ; i32 literal\n000003c: 36                                        ; i32.store\n000003d: 01                                        ; alignment\n000003e: 00                                        ; store offset\n000003f: 41                                        ; i32.const\n0000040: 00                                        ; i32 literal\n0000041: 41                                        ; i32.const\n0000042: 00                                        ; i32 literal\n0000043: 36                                        ; i32.store\n0000044: 02                                        ; alignment\n0000045: 00                                        ; store offset\n0000046: 41                                        ; i32.const\n0000047: 00                                        ; i32 literal\n0000048: 42                                        ; i64.const\n0000049: 00                                        ; i64 literal\n000004a: 3c                                        ; i64.store8\n000004b: 00                                        ; alignment\n000004c: 00                                        ; store offset\n000004d: 41                                        ; i32.const\n000004e: 00                                        ; i32 literal\n000004f: 42                                        ; i64.const\n0000050: 00                                        ; i64 literal\n0000051: 3d                                        ; i64.store16\n0000052: 00                                        ; alignment\n0000053: 00                                        ; store offset\n0000054: 41                                        ; i32.const\n0000055: 00                                        ; i32 literal\n0000056: 42                                        ; i64.const\n0000057: 00                                        ; i64 literal\n0000058: 3d                                        ; i64.store16\n0000059: 01                                        ; alignment\n000005a: 00                                        ; store offset\n000005b: 41                                        ; i32.const\n000005c: 00                                        ; i32 literal\n000005d: 42                                        ; i64.const\n000005e: 00                                        ; i64 literal\n000005f: 3e                                        ; i64.store32\n0000060: 00                                        ; alignment\n0000061: 00                                        ; store offset\n0000062: 41                                        ; i32.const\n0000063: 00                                        ; i32 literal\n0000064: 42                                        ; i64.const\n0000065: 00                                        ; i64 literal\n0000066: 3e                                        ; i64.store32\n0000067: 01                                        ; alignment\n0000068: 00                                        ; store offset\n0000069: 41                                        ; i32.const\n000006a: 00                                        ; i32 literal\n000006b: 42                                        ; i64.const\n000006c: 00                                        ; i64 literal\n000006d: 3e                                        ; i64.store32\n000006e: 02                                        ; alignment\n000006f: 00                                        ; store offset\n0000070: 41                                        ; i32.const\n0000071: 00                                        ; i32 literal\n0000072: 42                                        ; i64.const\n0000073: 00                                        ; i64 literal\n0000074: 37                                        ; i64.store\n0000075: 00                                        ; alignment\n0000076: 00                                        ; store offset\n0000077: 41                                        ; i32.const\n0000078: 00                                        ; i32 literal\n0000079: 42                                        ; i64.const\n000007a: 00                                        ; i64 literal\n000007b: 37                                        ; i64.store\n000007c: 01                                        ; alignment\n000007d: 00                                        ; store offset\n000007e: 41                                        ; i32.const\n000007f: 00                                        ; i32 literal\n0000080: 42                                        ; i64.const\n0000081: 00                                        ; i64 literal\n0000082: 37                                        ; i64.store\n0000083: 02                                        ; alignment\n0000084: 00                                        ; store offset\n0000085: 41                                        ; i32.const\n0000086: 00                                        ; i32 literal\n0000087: 42                                        ; i64.const\n0000088: 00                                        ; i64 literal\n0000089: 37                                        ; i64.store\n000008a: 03                                        ; alignment\n000008b: 00                                        ; store offset\n000008c: 0b                                        ; end\n000001a: 72                                        ; FIXUP func body size\n0000018: 74                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nstore-aligned.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 41 00                      | i32.const 0\n 00001e: 41 00                      | i32.const 0\n 000020: 3a 00 00                   | i32.store8 0 0\n 000023: 41 00                      | i32.const 0\n 000025: 41 00                      | i32.const 0\n 000027: 3b 00 00                   | i32.store16 0 0\n 00002a: 41 00                      | i32.const 0\n 00002c: 41 00                      | i32.const 0\n 00002e: 3b 01 00                   | i32.store16 1 0\n 000031: 41 00                      | i32.const 0\n 000033: 41 00                      | i32.const 0\n 000035: 36 00 00                   | i32.store 0 0\n 000038: 41 00                      | i32.const 0\n 00003a: 41 00                      | i32.const 0\n 00003c: 36 01 00                   | i32.store 1 0\n 00003f: 41 00                      | i32.const 0\n 000041: 41 00                      | i32.const 0\n 000043: 36 02 00                   | i32.store 2 0\n 000046: 41 00                      | i32.const 0\n 000048: 42 00                      | i64.const 0\n 00004a: 3c 00 00                   | i64.store8 0 0\n 00004d: 41 00                      | i32.const 0\n 00004f: 42 00                      | i64.const 0\n 000051: 3d 00 00                   | i64.store16 0 0\n 000054: 41 00                      | i32.const 0\n 000056: 42 00                      | i64.const 0\n 000058: 3d 01 00                   | i64.store16 1 0\n 00005b: 41 00                      | i32.const 0\n 00005d: 42 00                      | i64.const 0\n 00005f: 3e 00 00                   | i64.store32 0 0\n 000062: 41 00                      | i32.const 0\n 000064: 42 00                      | i64.const 0\n 000066: 3e 01 00                   | i64.store32 1 0\n 000069: 41 00                      | i32.const 0\n 00006b: 42 00                      | i64.const 0\n 00006d: 3e 02 00                   | i64.store32 2 0\n 000070: 41 00                      | i32.const 0\n 000072: 42 00                      | i64.const 0\n 000074: 37 00 00                   | i64.store 0 0\n 000077: 41 00                      | i32.const 0\n 000079: 42 00                      | i64.const 0\n 00007b: 37 01 00                   | i64.store 1 0\n 00007e: 41 00                      | i32.const 0\n 000080: 42 00                      | i64.const 0\n 000082: 37 02 00                   | i64.store 2 0\n 000085: 41 00                      | i32.const 0\n 000087: 42 00                      | i64.const 0\n 000089: 37 03 00                   | i64.store 3 0\n 00008c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/store.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.const 0\n    i32.store8\n    i32.const 0\n    i32.const 0\n    i32.store16\n    i32.const 0\n    i32.const 0\n    i32.store\n    i32.const 0\n    i64.const 0\n    i64.store\n    i32.const 0\n    i64.const 0\n    i64.store8\n    i32.const 0\n    i64.const 0\n    i64.store16\n    i32.const 0\n    i64.const 0\n    i64.store32\n    i32.const 0\n    f32.const 0\n    f32.store\n    i32.const 0\n    f64.const 0\n    f64.store))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000012: 05                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num memories\n; memory 0\n0000015: 00                                        ; limits: flags\n0000016: 01                                        ; limits: initial\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 01                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 41                                        ; i32.const\n000001d: 00                                        ; i32 literal\n000001e: 41                                        ; i32.const\n000001f: 00                                        ; i32 literal\n0000020: 3a                                        ; i32.store8\n0000021: 00                                        ; alignment\n0000022: 00                                        ; store offset\n0000023: 41                                        ; i32.const\n0000024: 00                                        ; i32 literal\n0000025: 41                                        ; i32.const\n0000026: 00                                        ; i32 literal\n0000027: 3b                                        ; i32.store16\n0000028: 01                                        ; alignment\n0000029: 00                                        ; store offset\n000002a: 41                                        ; i32.const\n000002b: 00                                        ; i32 literal\n000002c: 41                                        ; i32.const\n000002d: 00                                        ; i32 literal\n000002e: 36                                        ; i32.store\n000002f: 02                                        ; alignment\n0000030: 00                                        ; store offset\n0000031: 41                                        ; i32.const\n0000032: 00                                        ; i32 literal\n0000033: 42                                        ; i64.const\n0000034: 00                                        ; i64 literal\n0000035: 37                                        ; i64.store\n0000036: 03                                        ; alignment\n0000037: 00                                        ; store offset\n0000038: 41                                        ; i32.const\n0000039: 00                                        ; i32 literal\n000003a: 42                                        ; i64.const\n000003b: 00                                        ; i64 literal\n000003c: 3c                                        ; i64.store8\n000003d: 00                                        ; alignment\n000003e: 00                                        ; store offset\n000003f: 41                                        ; i32.const\n0000040: 00                                        ; i32 literal\n0000041: 42                                        ; i64.const\n0000042: 00                                        ; i64 literal\n0000043: 3d                                        ; i64.store16\n0000044: 01                                        ; alignment\n0000045: 00                                        ; store offset\n0000046: 41                                        ; i32.const\n0000047: 00                                        ; i32 literal\n0000048: 42                                        ; i64.const\n0000049: 00                                        ; i64 literal\n000004a: 3e                                        ; i64.store32\n000004b: 02                                        ; alignment\n000004c: 00                                        ; store offset\n000004d: 41                                        ; i32.const\n000004e: 00                                        ; i32 literal\n000004f: 43                                        ; f32.const\n0000050: 0000 0000                                 ; f32 literal\n0000054: 38                                        ; f32.store\n0000055: 02                                        ; alignment\n0000056: 00                                        ; store offset\n0000057: 41                                        ; i32.const\n0000058: 00                                        ; i32 literal\n0000059: 44                                        ; f64.const\n000005a: 0000 0000 0000 0000                       ; f64 literal\n0000062: 39                                        ; f64.store\n0000063: 03                                        ; alignment\n0000064: 00                                        ; store offset\n0000065: 0b                                        ; end\n000001a: 4b                                        ; FIXUP func body size\n0000018: 4d                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nstore.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 41 00                      | i32.const 0\n 00001e: 41 00                      | i32.const 0\n 000020: 3a 00 00                   | i32.store8 0 0\n 000023: 41 00                      | i32.const 0\n 000025: 41 00                      | i32.const 0\n 000027: 3b 01 00                   | i32.store16 1 0\n 00002a: 41 00                      | i32.const 0\n 00002c: 41 00                      | i32.const 0\n 00002e: 36 02 00                   | i32.store 2 0\n 000031: 41 00                      | i32.const 0\n 000033: 42 00                      | i64.const 0\n 000035: 37 03 00                   | i64.store 3 0\n 000038: 41 00                      | i32.const 0\n 00003a: 42 00                      | i64.const 0\n 00003c: 3c 00 00                   | i64.store8 0 0\n 00003f: 41 00                      | i32.const 0\n 000041: 42 00                      | i64.const 0\n 000043: 3d 01 00                   | i64.store16 1 0\n 000046: 41 00                      | i32.const 0\n 000048: 42 00                      | i64.const 0\n 00004a: 3e 02 00                   | i64.store32 2 0\n 00004d: 41 00                      | i32.const 0\n 00004f: 43 00 00 00 00             | f32.const 0x0p+0\n 000054: 38 02 00                   | f32.store 2 0\n 000057: 41 00                      | i32.const 0\n 000059: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000062: 39 03 00                   | f64.store 3 0\n 000065: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/store64.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (memory i64 1)\n  (func\n    i64.const 0\n    i32.const 0\n    i32.store8\n    i64.const 0\n    i32.const 0\n    i32.store16\n    i64.const 0\n    i32.const 0\n    i32.store\n    i64.const 0\n    i64.const 0\n    i64.store\n    i64.const 0\n    i64.const 0\n    i64.store8\n    i64.const 0\n    i64.const 0\n    i64.store16\n    i64.const 0\n    i64.const 0\n    i64.store32\n    i64.const 0\n    f32.const 0\n    f32.store\n    i64.const 0\n    f64.const 0\n    f64.store))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Memory\" (5)\n0000012: 05                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num memories\n; memory 0\n0000015: 04                                        ; limits: flags\n0000016: 01                                        ; limits: initial\n0000013: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000017: 0a                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 01                                        ; num functions\n; function body 0\n000001a: 00                                        ; func body size (guess)\n000001b: 00                                        ; local decl count\n000001c: 42                                        ; i64.const\n000001d: 00                                        ; i64 literal\n000001e: 41                                        ; i32.const\n000001f: 00                                        ; i32 literal\n0000020: 3a                                        ; i32.store8\n0000021: 00                                        ; alignment\n0000022: 00                                        ; store offset\n0000023: 42                                        ; i64.const\n0000024: 00                                        ; i64 literal\n0000025: 41                                        ; i32.const\n0000026: 00                                        ; i32 literal\n0000027: 3b                                        ; i32.store16\n0000028: 01                                        ; alignment\n0000029: 00                                        ; store offset\n000002a: 42                                        ; i64.const\n000002b: 00                                        ; i64 literal\n000002c: 41                                        ; i32.const\n000002d: 00                                        ; i32 literal\n000002e: 36                                        ; i32.store\n000002f: 02                                        ; alignment\n0000030: 00                                        ; store offset\n0000031: 42                                        ; i64.const\n0000032: 00                                        ; i64 literal\n0000033: 42                                        ; i64.const\n0000034: 00                                        ; i64 literal\n0000035: 37                                        ; i64.store\n0000036: 03                                        ; alignment\n0000037: 00                                        ; store offset\n0000038: 42                                        ; i64.const\n0000039: 00                                        ; i64 literal\n000003a: 42                                        ; i64.const\n000003b: 00                                        ; i64 literal\n000003c: 3c                                        ; i64.store8\n000003d: 00                                        ; alignment\n000003e: 00                                        ; store offset\n000003f: 42                                        ; i64.const\n0000040: 00                                        ; i64 literal\n0000041: 42                                        ; i64.const\n0000042: 00                                        ; i64 literal\n0000043: 3d                                        ; i64.store16\n0000044: 01                                        ; alignment\n0000045: 00                                        ; store offset\n0000046: 42                                        ; i64.const\n0000047: 00                                        ; i64 literal\n0000048: 42                                        ; i64.const\n0000049: 00                                        ; i64 literal\n000004a: 3e                                        ; i64.store32\n000004b: 02                                        ; alignment\n000004c: 00                                        ; store offset\n000004d: 42                                        ; i64.const\n000004e: 00                                        ; i64 literal\n000004f: 43                                        ; f32.const\n0000050: 0000 0000                                 ; f32 literal\n0000054: 38                                        ; f32.store\n0000055: 02                                        ; alignment\n0000056: 00                                        ; store offset\n0000057: 42                                        ; i64.const\n0000058: 00                                        ; i64 literal\n0000059: 44                                        ; f64.const\n000005a: 0000 0000 0000 0000                       ; f64 literal\n0000062: 39                                        ; f64.store\n0000063: 03                                        ; alignment\n0000064: 00                                        ; store offset\n0000065: 0b                                        ; end\n000001a: 4b                                        ; FIXUP func body size\n0000018: 4d                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nstore64.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001b func[0]:\n 00001c: 42 00                      | i64.const 0\n 00001e: 41 00                      | i32.const 0\n 000020: 3a 00 00                   | i32.store8 0 0\n 000023: 42 00                      | i64.const 0\n 000025: 41 00                      | i32.const 0\n 000027: 3b 01 00                   | i32.store16 1 0\n 00002a: 42 00                      | i64.const 0\n 00002c: 41 00                      | i32.const 0\n 00002e: 36 02 00                   | i32.store 2 0\n 000031: 42 00                      | i64.const 0\n 000033: 42 00                      | i64.const 0\n 000035: 37 03 00                   | i64.store 3 0\n 000038: 42 00                      | i64.const 0\n 00003a: 42 00                      | i64.const 0\n 00003c: 3c 00 00                   | i64.store8 0 0\n 00003f: 42 00                      | i64.const 0\n 000041: 42 00                      | i64.const 0\n 000043: 3d 01 00                   | i64.store16 1 0\n 000046: 42 00                      | i64.const 0\n 000048: 42 00                      | i64.const 0\n 00004a: 3e 02 00                   | i64.store32 2 0\n 00004d: 42 00                      | i64.const 0\n 00004f: 43 00 00 00 00             | f32.const 0x0p+0\n 000054: 38 02 00                   | f32.store 2 0\n 000057: 42 00                      | i64.const 0\n 000059: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 000062: 39 03 00                   | f64.store 3 0\n 000065: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/string-escape.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module (func) (export \"tab:\\t newline:\\n slash:\\\\ quote:\\' double:\\\"\" (func 0)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Export\" (7)\n0000012: 07                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num exports\n0000015: 28                                        ; string length\n0000016: 7461 623a 0920 6e65 776c 696e 653a 0a20  tab:. newline:. \n0000026: 736c 6173 683a 5c20 7175 6f74 653a 2720  slash:\\ quote:' \n0000036: 646f 7562 6c65 3a22                      double:\"  ; export name\n000003e: 00                                        ; export kind\n000003f: 00                                        ; export func index\n0000013: 2c                                        ; FIXUP section size\n; section \"Code\" (10)\n0000040: 0a                                        ; section code\n0000041: 00                                        ; section size (guess)\n0000042: 01                                        ; num functions\n; function body 0\n0000043: 00                                        ; func body size (guess)\n0000044: 00                                        ; local decl count\n0000045: 0b                                        ; end\n0000043: 02                                        ; FIXUP func body size\n0000041: 04                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nstring-escape.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000044 func[0] <tab:\t newline:\n slash:\\ quote:' double:\">:\n 000045: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/string-hex.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module (func) (export \"foo\\de\\ad\\ca\\bb\" (func 0)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Export\" (7)\n0000012: 07                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num exports\n0000015: 07                                        ; string length\n0000016: 666f 6fde adca bb                        foo....  ; export name\n000001d: 00                                        ; export kind\n000001e: 00                                        ; export func index\n0000013: 0b                                        ; FIXUP section size\n; section \"Code\" (10)\n000001f: 0a                                        ; section code\n0000020: 00                                        ; section size (guess)\n0000021: 01                                        ; num functions\n; function body 0\n0000022: 00                                        ; func body size (guess)\n0000023: 00                                        ; local decl count\n0000024: 0b                                        ; end\n0000022: 02                                        ; FIXUP func body size\n0000020: 04                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nstring-hex.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000023 func[0] <fooޭʻ>:\n 000024: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/struct.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: --enable-gc\n;;; ARGS1: -x\n(type (struct))\n(type (struct i32 i64 f32 f64))\n(type (struct i32 (mut i64)))\n(;; STDOUT ;;;\n\nstruct.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[3]:\n - type[0] (struct)\n - type[1] (struct i32 i64 f32 f64)\n - type[2] (struct i32 (mut i64))\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/symbol-tables-all-features.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -r --enable-all\n;;; ARGS1: -x\n(module\n  (type (;0;) (func))\n  (import \"env\" \"b\" (func (;0;) (type 0)))\n  (func $a (type 0)\n    call 0)\n  (func (type 0)\n    call 0)\n  (func $b (type 0)\n    (call_indirect (type 0) (i32.const 0))\n    call 0)\n  (export \"a\" (func $a))\n  (table $t 0 funcref))\n(;; STDOUT ;;;\n\nsymbol-tables-all-features.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nImport[1]:\n - func[0] sig=0 <env.b> <- env.b\nFunction[3]:\n - func[1] sig=0 <a>\n - func[2] sig=0\n - func[3] sig=0 <b>\nTable[1]:\n - table[0] type=funcref initial=0 <t>\nExport[1]:\n - func[1] <a> -> \"a\"\nCode[3]:\n - func[1] size=8 <a>\n - func[2] size=8\n - func[3] size=21 <b>\nCustom:\n - name: \"linking\"\n  - symbol table [count=5]\n   - 0: F <env.b> func=0 [ undefined binding=global vis=default ]\n   - 1: F <a> func=1 [ exported no_strip binding=global vis=hidden ]\n   - 2: F <> func=2 [ binding=local vis=hidden ]\n   - 3: F <b> func=3 [ binding=global vis=default ]\n   - 4: T <t> table=0 [ binding=global vis=default ]\nCustom:\n - name: \"reloc.Code\"\n  - relocations for section: 5 (Code) [5]\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x000004(file=0x000032) symbol=0 <env.b>\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x00000d(file=0x00003b) symbol=0 <env.b>\n   - R_WASM_TYPE_INDEX_LEB offset=0x000018(file=0x000046) type=0\n   - R_WASM_TABLE_NUMBER_LEB offset=0x00001d(file=0x00004b) symbol=4 <t>\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x000023(file=0x000051) symbol=0 <env.b>\n\nCode Disassembly:\n\n000030 func[1] <a>:\n 000031: 10 80 80 80 80 00          | call 0 <env.b>\n           000032: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>\n 000037: 0b                         | end\n000039 func[2]:\n 00003a: 10 80 80 80 80 00          | call 0 <env.b>\n           00003b: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>\n 000040: 0b                         | end\n000042 func[3] <b>:\n 000043: 41 00                      | i32.const 0\n 000045: 11 80 80 80 80 00 80 80 80 | call_indirect 0 <t> (type 0)\n 00004e: 80 00                      | \n           000046: R_WASM_TYPE_INDEX_LEB 0\n 000050: 10 80 80 80 80 00          | call 0 <env.b>\n           00004b: R_WASM_TABLE_NUMBER_LEB 4 <t>\n 000056: 0b                         | end\n           000051: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/symbol-tables.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -r --enable-all\n;;; ARGS1: -x\n(module\n  (type (;0;) (func))\n  (import \"env\" \"timport\" (table 1 funcref))\n  (import \"env\" \"b\" (func (;0;) (type 0)))\n  (func $a (type 0)\n    call 0)\n  (func (type 0)\n    call 0)\n  (func $b (type 0)\n    (call_indirect (type 0) (i32.const 0))\n    call 0)\n  (export \"a\" (func $a))\n  (table $t 0 funcref))\n(;; STDOUT ;;;\n\nsymbol-tables.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> nil\nImport[2]:\n - table[0] type=funcref initial=1 <- env.timport\n - func[0] sig=0 <env.b> <- env.b\nFunction[3]:\n - func[1] sig=0 <a>\n - func[2] sig=0\n - func[3] sig=0 <b>\nTable[1]:\n - table[1] type=funcref initial=0 <t>\nExport[1]:\n - func[1] <a> -> \"a\"\nCode[3]:\n - func[1] size=8 <a>\n - func[2] size=8\n - func[3] size=21 <b>\nCustom:\n - name: \"linking\"\n  - symbol table [count=6]\n   - 0: F <env.b> func=0 [ undefined binding=global vis=default ]\n   - 1: F <a> func=1 [ exported no_strip binding=global vis=hidden ]\n   - 2: F <> func=2 [ binding=local vis=hidden ]\n   - 3: F <b> func=3 [ binding=global vis=default ]\n   - 4: T <env.timport> table=0 [ undefined binding=global vis=default ]\n   - 5: T <t> table=1 [ binding=global vis=default ]\nCustom:\n - name: \"reloc.Code\"\n  - relocations for section: 5 (Code) [5]\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x000004(file=0x000041) symbol=0 <env.b>\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x00000d(file=0x00004a) symbol=0 <env.b>\n   - R_WASM_TYPE_INDEX_LEB offset=0x000018(file=0x000055) type=0\n   - R_WASM_TABLE_NUMBER_LEB offset=0x00001d(file=0x00005a) symbol=4 <env.timport>\n   - R_WASM_FUNCTION_INDEX_LEB offset=0x000023(file=0x000060) symbol=0 <env.b>\n\nCode Disassembly:\n\n00003f func[1] <a>:\n 000040: 10 80 80 80 80 00          | call 0 <env.b>\n           000041: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>\n 000046: 0b                         | end\n000048 func[2]:\n 000049: 10 80 80 80 80 00          | call 0 <env.b>\n           00004a: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>\n 00004f: 0b                         | end\n000051 func[3] <b>:\n 000052: 41 00                      | i32.const 0\n 000054: 11 80 80 80 80 00 80 80 80 | call_indirect 0 <env.timport> (type 0)\n 00005d: 80 00                      | \n           000055: R_WASM_TYPE_INDEX_LEB 0\n 00005f: 10 80 80 80 80 00          | call 0 <env.b>\n           00005a: R_WASM_TABLE_NUMBER_LEB 4 <env.timport>\n 000065: 0b                         | end\n           000060: R_WASM_FUNCTION_INDEX_LEB 0 <env.b>\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/table-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: -x\n(module\n  (func (param i32))\n  (table funcref (elem 0))\n  (table funcref (elem 0)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Table\" (4)\n0000013: 04                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 02                                        ; num tables\n; table 0\n0000016: 70                                        ; funcref\n0000017: 01                                        ; limits: flags\n0000018: 01                                        ; limits: initial\n0000019: 01                                        ; limits: max\n; table 1\n000001a: 70                                        ; funcref\n000001b: 01                                        ; limits: flags\n000001c: 01                                        ; limits: initial\n000001d: 01                                        ; limits: max\n0000014: 09                                        ; FIXUP section size\n; section \"Elem\" (9)\n000001e: 09                                        ; section code\n000001f: 00                                        ; section size (guess)\n0000020: 02                                        ; num elem segments\n; elem segment header 0\n0000021: 00                                        ; segment flags\n0000022: 41                                        ; i32.const\n0000023: 00                                        ; i32 literal\n0000024: 0b                                        ; end\n0000025: 01                                        ; num elems\n0000026: 00                                        ; elem function index\n; elem segment header 1\n0000027: 02                                        ; segment flags\n0000028: 01                                        ; table index\n0000029: 41                                        ; i32.const\n000002a: 00                                        ; i32 literal\n000002b: 0b                                        ; end\n000002c: 00                                        ; elem list type\n000002d: 01                                        ; num elems\n000002e: 00                                        ; elem function index\n000001f: 0f                                        ; FIXUP section size\n; section \"Code\" (10)\n000002f: 0a                                        ; section code\n0000030: 00                                        ; section size (guess)\n0000031: 01                                        ; num functions\n; function body 0\n0000032: 00                                        ; func body size (guess)\n0000033: 00                                        ; local decl count\n0000034: 0b                                        ; end\n0000032: 02                                        ; FIXUP func body size\n0000030: 04                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntable-multi.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] (i32) -> nil\nFunction[1]:\n - func[0] sig=0\nTable[2]:\n - table[0] type=funcref initial=1 max=1\n - table[1] type=funcref initial=1 max=1\nElem[2]:\n - segment[0] flags=0 table=0 count=1 - init i32=0\n  - elem[0] = ref.func:0\n - segment[1] flags=2 table=1 count=1 - init i32=0\n  - elem[0] = ref.func:0\nCode[1]:\n - func[0] size=2\n\nCode Disassembly:\n\n000033 func[0]:\n 000034: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/table.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n;;; ARGS1: -x\n(module\n  (type $t (func (param i32)))\n  (func (type $t))\n  (func (param i32 i64))\n  (func (result f64) \n    f64.const 0)\n  (table 6 6 funcref)\n  (elem (i32.const 0) 1 1)\n  (elem (i32.const 2) 0 0 1 2))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 02                                        ; num params\n0000011: 7f                                        ; i32\n0000012: 7e                                        ; i64\n0000013: 00                                        ; num results\n; func type 2\n0000014: 60                                        ; func\n0000015: 00                                        ; num params\n0000016: 01                                        ; num results\n0000017: 7c                                        ; f64\n0000009: 0e                                        ; FIXUP section size\n; section \"Function\" (3)\n0000018: 03                                        ; section code\n0000019: 00                                        ; section size (guess)\n000001a: 03                                        ; num functions\n000001b: 00                                        ; function 0 signature index\n000001c: 01                                        ; function 1 signature index\n000001d: 02                                        ; function 2 signature index\n0000019: 04                                        ; FIXUP section size\n; section \"Table\" (4)\n000001e: 04                                        ; section code\n000001f: 00                                        ; section size (guess)\n0000020: 01                                        ; num tables\n; table 0\n0000021: 70                                        ; funcref\n0000022: 01                                        ; limits: flags\n0000023: 06                                        ; limits: initial\n0000024: 06                                        ; limits: max\n000001f: 05                                        ; FIXUP section size\n; section \"Elem\" (9)\n0000025: 09                                        ; section code\n0000026: 00                                        ; section size (guess)\n0000027: 02                                        ; num elem segments\n; elem segment header 0\n0000028: 00                                        ; segment flags\n0000029: 41                                        ; i32.const\n000002a: 00                                        ; i32 literal\n000002b: 0b                                        ; end\n000002c: 02                                        ; num elems\n000002d: 01                                        ; elem function index\n000002e: 01                                        ; elem function index\n; elem segment header 1\n000002f: 00                                        ; segment flags\n0000030: 41                                        ; i32.const\n0000031: 02                                        ; i32 literal\n0000032: 0b                                        ; end\n0000033: 04                                        ; num elems\n0000034: 00                                        ; elem function index\n0000035: 00                                        ; elem function index\n0000036: 01                                        ; elem function index\n0000037: 02                                        ; elem function index\n0000026: 11                                        ; FIXUP section size\n; section \"Code\" (10)\n0000038: 0a                                        ; section code\n0000039: 00                                        ; section size (guess)\n000003a: 03                                        ; num functions\n; function body 0\n000003b: 00                                        ; func body size (guess)\n000003c: 00                                        ; local decl count\n000003d: 0b                                        ; end\n000003b: 02                                        ; FIXUP func body size\n; function body 1\n000003e: 00                                        ; func body size (guess)\n000003f: 00                                        ; local decl count\n0000040: 0b                                        ; end\n000003e: 02                                        ; FIXUP func body size\n; function body 2\n0000041: 00                                        ; func body size (guess)\n0000042: 00                                        ; local decl count\n0000043: 44                                        ; f64.const\n0000044: 0000 0000 0000 0000                       ; f64 literal\n000004c: 0b                                        ; end\n0000041: 0b                                        ; FIXUP func body size\n0000039: 13                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntable.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[3]:\n - type[0] (i32) -> nil\n - type[1] (i32, i64) -> nil\n - type[2] () -> f64\nFunction[3]:\n - func[0] sig=0\n - func[1] sig=1\n - func[2] sig=2\nTable[1]:\n - table[0] type=funcref initial=6 max=6\nElem[2]:\n - segment[0] flags=0 table=0 count=2 - init i32=0\n  - elem[0] = ref.func:1\n  - elem[1] = ref.func:1\n - segment[1] flags=0 table=0 count=4 - init i32=2\n  - elem[2] = ref.func:0\n  - elem[3] = ref.func:0\n  - elem[4] = ref.func:1\n  - elem[5] = ref.func:2\nCode[3]:\n - func[0] size=2\n - func[1] size=2\n - func[2] size=11\n\nCode Disassembly:\n\n00003c func[0]:\n 00003d: 0b                         | end\n00003f func[1]:\n 000040: 0b                         | end\n000042 func[2]:\n 000043: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 00004c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/tag.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-exceptions\n;;; ARGS1: -x\n(module\n  (tag)\n  (tag (param i32))\n  (tag (param f32 f64)))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n; func type 1\n000000e: 60                                        ; func\n000000f: 01                                        ; num params\n0000010: 7f                                        ; i32\n0000011: 00                                        ; num results\n; func type 2\n0000012: 60                                        ; func\n0000013: 02                                        ; num params\n0000014: 7d                                        ; f32\n0000015: 7c                                        ; f64\n0000016: 00                                        ; num results\n0000009: 0d                                        ; FIXUP section size\n; section \"Tag\" (13)\n0000017: 0d                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 03                                        ; tag count\n; tag 0\n000001a: 00                                        ; tag attribute\n000001b: 00                                        ; tag signature index\n; tag 1\n000001c: 00                                        ; tag attribute\n000001d: 01                                        ; tag signature index\n; tag 2\n000001e: 00                                        ; tag attribute\n000001f: 02                                        ; tag signature index\n0000018: 07                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntag.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nType[3]:\n - type[0] () -> nil\n - type[1] (i32) -> nil\n - type[2] (f32, f64) -> nil\nTag[3]:\n - tag[0] sig=0\n - tag[1] sig=1\n - tag[2] sig=2\n\nCode Disassembly:\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/tail-call.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: --enable-tail-call\n(module\n  (table 1 funcref)\n  (func return_call 0)\n  (func i32.const 0 return_call_indirect)\n)\n(;; STDOUT ;;;\n\ntail-call.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001d func[0]:\n 00001e: 12 00                      | return_call 0\n 000020: 0b                         | end\n000022 func[1]:\n 000023: 41 00                      | i32.const 0\n 000025: 13 00 00                   | return_call_indirect 0 0\n 000028: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/throw.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-exceptions\n(module\n  (tag $e (param i32))\n  (func\n    i32.const 1\n    throw $e))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 00                                        ; num params\n0000011: 00                                        ; num results\n0000009: 08                                        ; FIXUP section size\n; section \"Function\" (3)\n0000012: 03                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n0000015: 01                                        ; function 0 signature index\n0000013: 02                                        ; FIXUP section size\n; section \"Tag\" (13)\n0000016: 0d                                        ; section code\n0000017: 00                                        ; section size (guess)\n0000018: 01                                        ; tag count\n; tag 0\n0000019: 00                                        ; tag attribute\n000001a: 00                                        ; tag signature index\n0000017: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n000001b: 0a                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 01                                        ; num functions\n; function body 0\n000001e: 00                                        ; func body size (guess)\n000001f: 00                                        ; local decl count\n0000020: 41                                        ; i32.const\n0000021: 01                                        ; i32 literal\n0000022: 08                                        ; throw\n0000023: 00                                        ; throw tag\n0000024: 0b                                        ; end\n000001e: 06                                        ; FIXUP func body size\n000001c: 08                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nthrow.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001f func[0]:\n 000020: 41 01                      | i32.const 1\n 000022: 08 00                      | throw 0\n 000024: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/try-catch-all.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-exceptions\n(module\n  (tag $e (param i32))\n  (func\n    try $try1 (result i32)\n      nop\n      i32.const 7\n    catch_all\n      i32.const 8\n    end\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 00                                        ; num params\n0000011: 00                                        ; num results\n0000009: 08                                        ; FIXUP section size\n; section \"Function\" (3)\n0000012: 03                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n0000015: 01                                        ; function 0 signature index\n0000013: 02                                        ; FIXUP section size\n; section \"Tag\" (13)\n0000016: 0d                                        ; section code\n0000017: 00                                        ; section size (guess)\n0000018: 01                                        ; tag count\n; tag 0\n0000019: 00                                        ; tag attribute\n000001a: 00                                        ; tag signature index\n0000017: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n000001b: 0a                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 01                                        ; num functions\n; function body 0\n000001e: 00                                        ; func body size (guess)\n000001f: 00                                        ; local decl count\n0000020: 06                                        ; try\n0000021: 7f                                        ; i32\n0000022: 01                                        ; nop\n0000023: 41                                        ; i32.const\n0000024: 07                                        ; i32 literal\n0000025: 19                                        ; catch_all\n0000026: 41                                        ; i32.const\n0000027: 08                                        ; i32 literal\n0000028: 0b                                        ; end\n0000029: 1a                                        ; drop\n000002a: 0b                                        ; end\n000001e: 0c                                        ; FIXUP func body size\n000001c: 0e                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntry-catch-all.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001f func[0]:\n 000020: 06 7f                      | try i32\n 000022: 01                         |   nop\n 000023: 41 07                      |   i32.const 7\n 000025: 19                         | catch_all\n 000026: 41 08                      |   i32.const 8\n 000028: 0b                         | end\n 000029: 1a                         | drop\n 00002a: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/try-delegate.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-exceptions\n(module\n  (tag $e (param i32))\n  (func\n    try $try1 (result i32)\n      try\n        nop\n      delegate 1\n      try\n        nop\n      delegate $try1\n      i32.const 7\n    catch $e\n      drop\n      i32.const 8\n    end\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 00                                        ; num params\n0000011: 00                                        ; num results\n0000009: 08                                        ; FIXUP section size\n; section \"Function\" (3)\n0000012: 03                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n0000015: 01                                        ; function 0 signature index\n0000013: 02                                        ; FIXUP section size\n; section \"Tag\" (13)\n0000016: 0d                                        ; section code\n0000017: 00                                        ; section size (guess)\n0000018: 01                                        ; tag count\n; tag 0\n0000019: 00                                        ; tag attribute\n000001a: 00                                        ; tag signature index\n0000017: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n000001b: 0a                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 01                                        ; num functions\n; function body 0\n000001e: 00                                        ; func body size (guess)\n000001f: 00                                        ; local decl count\n0000020: 06                                        ; try\n0000021: 7f                                        ; i32\n0000022: 06                                        ; try\n0000023: 40                                        ; void\n0000024: 01                                        ; nop\n0000025: 18                                        ; delegate\n0000026: 01                                        ; delegate depth\n0000027: 06                                        ; try\n0000028: 40                                        ; void\n0000029: 01                                        ; nop\n000002a: 18                                        ; delegate\n000002b: 00                                        ; delegate depth\n000002c: 41                                        ; i32.const\n000002d: 07                                        ; i32 literal\n000002e: 07                                        ; catch\n000002f: 00                                        ; catch tag\n0000030: 1a                                        ; drop\n0000031: 41                                        ; i32.const\n0000032: 08                                        ; i32 literal\n0000033: 0b                                        ; end\n0000034: 1a                                        ; drop\n0000035: 0b                                        ; end\n000001e: 17                                        ; FIXUP func body size\n000001c: 19                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntry-delegate.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001f func[0]:\n 000020: 06 7f                      | try i32\n 000022: 06 40                      |   try\n 000024: 01                         |     nop\n 000025: 18 01                      |   delegate 1\n 000027: 06 40                      |   try\n 000029: 01                         |     nop\n 00002a: 18 00                      |   delegate 0\n 00002c: 41 07                      |   i32.const 7\n 00002e: 07 00                      | catch 0\n 000030: 1a                         |   drop\n 000031: 41 08                      |   i32.const 8\n 000033: 0b                         | end\n 000034: 1a                         | drop\n 000035: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/try-multi.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-exceptions\n(module\n  (tag $e1 (param i32))\n  (func\n    try (result i32 i32)\n      i32.const 1\n      i32.const 2\n    catch $e1\n      drop\n      i32.const 3\n      i32.const 4\n    end\n    return)\n\n  (func\n    i32.const 0\n    try (param i32)\n      drop\n    catch $e1\n      drop\n    end))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 00                                        ; num params\n0000011: 00                                        ; num results\n; func type 2\n0000012: 60                                        ; func\n0000013: 00                                        ; num params\n0000014: 02                                        ; num results\n0000015: 7f                                        ; i32\n0000016: 7f                                        ; i32\n0000009: 0d                                        ; FIXUP section size\n; section \"Function\" (3)\n0000017: 03                                        ; section code\n0000018: 00                                        ; section size (guess)\n0000019: 02                                        ; num functions\n000001a: 01                                        ; function 0 signature index\n000001b: 01                                        ; function 1 signature index\n0000018: 03                                        ; FIXUP section size\n; section \"Tag\" (13)\n000001c: 0d                                        ; section code\n000001d: 00                                        ; section size (guess)\n000001e: 01                                        ; tag count\n; tag 0\n000001f: 00                                        ; tag attribute\n0000020: 00                                        ; tag signature index\n000001d: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n0000021: 0a                                        ; section code\n0000022: 00                                        ; section size (guess)\n0000023: 02                                        ; num functions\n; function body 0\n0000024: 00                                        ; func body size (guess)\n0000025: 00                                        ; local decl count\n0000026: 06                                        ; try\n0000027: 02                                        ; block type function index\n0000028: 41                                        ; i32.const\n0000029: 01                                        ; i32 literal\n000002a: 41                                        ; i32.const\n000002b: 02                                        ; i32 literal\n000002c: 07                                        ; catch\n000002d: 00                                        ; catch tag\n000002e: 1a                                        ; drop\n000002f: 41                                        ; i32.const\n0000030: 03                                        ; i32 literal\n0000031: 41                                        ; i32.const\n0000032: 04                                        ; i32 literal\n0000033: 0b                                        ; end\n0000034: 0f                                        ; return\n0000035: 0b                                        ; end\n0000024: 11                                        ; FIXUP func body size\n; function body 1\n0000036: 00                                        ; func body size (guess)\n0000037: 00                                        ; local decl count\n0000038: 41                                        ; i32.const\n0000039: 00                                        ; i32 literal\n000003a: 06                                        ; try\n000003b: 00                                        ; block type function index\n000003c: 1a                                        ; drop\n000003d: 07                                        ; catch\n000003e: 00                                        ; catch tag\n000003f: 1a                                        ; drop\n0000040: 0b                                        ; end\n0000041: 0b                                        ; end\n0000036: 0b                                        ; FIXUP func body size\n0000022: 1f                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntry-multi.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000025 func[0]:\n 000026: 06 02                      | try type[2]\n 000028: 41 01                      |   i32.const 1\n 00002a: 41 02                      |   i32.const 2\n 00002c: 07 00                      | catch 0\n 00002e: 1a                         |   drop\n 00002f: 41 03                      |   i32.const 3\n 000031: 41 04                      |   i32.const 4\n 000033: 0b                         | end\n 000034: 0f                         | return\n 000035: 0b                         | end\n000037 func[1]:\n 000038: 41 00                      | i32.const 0\n 00003a: 06 00                      | try type[0]\n 00003c: 1a                         |   drop\n 00003d: 07 00                      | catch 0\n 00003f: 1a                         |   drop\n 000040: 0b                         | end\n 000041: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/try.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-exceptions\n(module\n  (tag $e (param i32))\n  (func\n    try\n      nop\n    end\n    try $try1 (result i32)\n      nop\n      i32.const 7\n    catch $e\n      drop\n      i32.const 8\n    end\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 02                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7f                                        ; i32\n000000e: 00                                        ; num results\n; func type 1\n000000f: 60                                        ; func\n0000010: 00                                        ; num params\n0000011: 00                                        ; num results\n0000009: 08                                        ; FIXUP section size\n; section \"Function\" (3)\n0000012: 03                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n0000015: 01                                        ; function 0 signature index\n0000013: 02                                        ; FIXUP section size\n; section \"Tag\" (13)\n0000016: 0d                                        ; section code\n0000017: 00                                        ; section size (guess)\n0000018: 01                                        ; tag count\n; tag 0\n0000019: 00                                        ; tag attribute\n000001a: 00                                        ; tag signature index\n0000017: 03                                        ; FIXUP section size\n; section \"Code\" (10)\n000001b: 0a                                        ; section code\n000001c: 00                                        ; section size (guess)\n000001d: 01                                        ; num functions\n; function body 0\n000001e: 00                                        ; func body size (guess)\n000001f: 00                                        ; local decl count\n0000020: 06                                        ; try\n0000021: 40                                        ; void\n0000022: 01                                        ; nop\n0000023: 0b                                        ; end\n0000024: 06                                        ; try\n0000025: 7f                                        ; i32\n0000026: 01                                        ; nop\n0000027: 41                                        ; i32.const\n0000028: 07                                        ; i32 literal\n0000029: 07                                        ; catch\n000002a: 00                                        ; catch tag\n000002b: 1a                                        ; drop\n000002c: 41                                        ; i32.const\n000002d: 08                                        ; i32 literal\n000002e: 0b                                        ; end\n000002f: 1a                                        ; drop\n0000030: 0b                                        ; end\n000001e: 12                                        ; FIXUP func body size\n000001c: 14                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntry.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00001f func[0]:\n 000020: 06 40                      | try\n 000022: 01                         |   nop\n 000023: 0b                         | end\n 000024: 06 7f                      | try i32\n 000026: 01                         |   nop\n 000027: 41 07                      |   i32.const 7\n 000029: 07 00                      | catch 0\n 00002b: 1a                         |   drop\n 00002c: 41 08                      |   i32.const 8\n 00002e: 0b                         | end\n 00002f: 1a                         | drop\n 000030: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/typed-func-ref-signature.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-function-references\n(module\n  (type $t1 (func))\n  (type $t2 (func))\n  (type $t3 (func))\n\n  (func $f1 (param (ref $t1)) )\n  (func $f2 (param (ref $t2)) )\n  (func $f3 (param (ref $t3)) )\n  (func $f4 (param (ref $t3)) )\n  (func $f5 (param (ref $t2)) )\n  (func $f6 (param (ref $t1)) )\n)\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 06                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n; func type 1\n000000e: 60                                        ; func\n000000f: 00                                        ; num params\n0000010: 00                                        ; num results\n; func type 2\n0000011: 60                                        ; func\n0000012: 00                                        ; num params\n0000013: 00                                        ; num results\n; func type 3\n0000014: 60                                        ; func\n0000015: 01                                        ; num params\n0000016: 64                                        ; (ref 0)\n0000017: 00                                        ; (ref 0)\n0000018: 00                                        ; num results\n; func type 4\n0000019: 60                                        ; func\n000001a: 01                                        ; num params\n000001b: 64                                        ; (ref 1)\n000001c: 01                                        ; (ref 1)\n000001d: 00                                        ; num results\n; func type 5\n000001e: 60                                        ; func\n000001f: 01                                        ; num params\n0000020: 64                                        ; (ref 2)\n0000021: 02                                        ; (ref 2)\n0000022: 00                                        ; num results\n0000009: 19                                        ; FIXUP section size\n; section \"Function\" (3)\n0000023: 03                                        ; section code\n0000024: 00                                        ; section size (guess)\n0000025: 06                                        ; num functions\n0000026: 03                                        ; function 0 signature index\n0000027: 04                                        ; function 1 signature index\n0000028: 05                                        ; function 2 signature index\n0000029: 05                                        ; function 3 signature index\n000002a: 04                                        ; function 4 signature index\n000002b: 03                                        ; function 5 signature index\n0000024: 07                                        ; FIXUP section size\n; section \"Code\" (10)\n000002c: 0a                                        ; section code\n000002d: 00                                        ; section size (guess)\n000002e: 06                                        ; num functions\n; function body 0\n000002f: 00                                        ; func body size (guess)\n0000030: 00                                        ; local decl count\n0000031: 0b                                        ; end\n000002f: 02                                        ; FIXUP func body size\n; function body 1\n0000032: 00                                        ; func body size (guess)\n0000033: 00                                        ; local decl count\n0000034: 0b                                        ; end\n0000032: 02                                        ; FIXUP func body size\n; function body 2\n0000035: 00                                        ; func body size (guess)\n0000036: 00                                        ; local decl count\n0000037: 0b                                        ; end\n0000035: 02                                        ; FIXUP func body size\n; function body 3\n0000038: 00                                        ; func body size (guess)\n0000039: 00                                        ; local decl count\n000003a: 0b                                        ; end\n0000038: 02                                        ; FIXUP func body size\n; function body 4\n000003b: 00                                        ; func body size (guess)\n000003c: 00                                        ; local decl count\n000003d: 0b                                        ; end\n000003b: 02                                        ; FIXUP func body size\n; function body 5\n000003e: 00                                        ; func body size (guess)\n000003f: 00                                        ; local decl count\n0000040: 0b                                        ; end\n000003e: 02                                        ; FIXUP func body size\n000002d: 13                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntyped-func-ref-signature.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000030 func[0]:\n 000031: 0b                         | end\n000033 func[1]:\n 000034: 0b                         | end\n000036 func[2]:\n 000037: 0b                         | end\n000039 func[3]:\n 00003a: 0b                         | end\n00003c func[4]:\n 00003d: 0b                         | end\n00003f func[5]:\n 000040: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/typed-func-refs-locals.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-function-references\n\n(module\n  (type $t0 (func))\n  (type $t1 (func))\n\n  (type $t2 (func (param (ref $t0) (ref $t1) (ref 1))))\n\n  (func $f1 (param (ref $t0) (ref 0))\n    (local (ref $t0) (ref 0)\n           (ref $t1) (ref 1))\n  )\n)\n\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 04                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n; func type 1\n000000e: 60                                        ; func\n000000f: 00                                        ; num params\n0000010: 00                                        ; num results\n; func type 2\n0000011: 60                                        ; func\n0000012: 03                                        ; num params\n0000013: 64                                        ; (ref 0)\n0000014: 00                                        ; (ref 0)\n0000015: 64                                        ; (ref 1)\n0000016: 01                                        ; (ref 1)\n0000017: 64                                        ; (ref 1)\n0000018: 01                                        ; (ref 1)\n0000019: 00                                        ; num results\n; func type 3\n000001a: 60                                        ; func\n000001b: 02                                        ; num params\n000001c: 64                                        ; (ref 0)\n000001d: 00                                        ; (ref 0)\n000001e: 64                                        ; (ref 0)\n000001f: 00                                        ; (ref 0)\n0000020: 00                                        ; num results\n0000009: 17                                        ; FIXUP section size\n; section \"Function\" (3)\n0000021: 03                                        ; section code\n0000022: 00                                        ; section size (guess)\n0000023: 01                                        ; num functions\n0000024: 03                                        ; function 0 signature index\n0000022: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000025: 0a                                        ; section code\n0000026: 00                                        ; section size (guess)\n0000027: 01                                        ; num functions\n; function body 0\n0000028: 00                                        ; func body size (guess)\n0000029: 02                                        ; local decl count\n000002a: 02                                        ; local type count\n000002b: 64                                        ; (ref 0)\n000002c: 00                                        ; (ref 0)\n000002d: 02                                        ; local type count\n000002e: 64                                        ; (ref 1)\n000002f: 01                                        ; (ref 1)\n0000030: 0b                                        ; end\n0000028: 08                                        ; FIXUP func body size\n0000026: 0a                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntyped-func-refs-locals.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000029 func[0]:\n 00002a: 02 64 00                   | local[2..3] type=(ref 0)\n 00002d: 02 64 01                   | local[4..5] type=(ref 1)\n 000030: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/typed_func_refs_params.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-function-references\n\n(module\n  (type $f32-f32 (func (param f32) (result f32)))\n\n  (func $deriv (param $f (ref $f32-f32)) (param $x f32) (param $delta f32) (result f32)\n    (f32.div\n      (f32.sub (call_ref $f32-f32 (f32.add (local.get $delta) (local.get $x)) (local.get $f))\n               (call_ref $f32-f32 (local.get $x) (local.get $f))\n      )\n      (local.get $delta)\n    )\n  )\n\n  (func $square (param $x f32) (result f32)\n    (f32.mul (local.get $x)\n             (local.get $x))\n  )\n\n  (func (export \"main\") (result f32)\n    (call $deriv (ref.func $square)\n                 (f32.const 1.0)\n                 (f32.const 0.01)\n    )\n  )\n\n  (elem declare func $square)\n)\n\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7d                                        ; f32\n000000e: 01                                        ; num results\n000000f: 7d                                        ; f32\n; func type 1\n0000010: 60                                        ; func\n0000011: 03                                        ; num params\n0000012: 64                                        ; (ref 0)\n0000013: 00                                        ; (ref 0)\n0000014: 7d                                        ; f32\n0000015: 7d                                        ; f32\n0000016: 01                                        ; num results\n0000017: 7d                                        ; f32\n; func type 2\n0000018: 60                                        ; func\n0000019: 00                                        ; num params\n000001a: 01                                        ; num results\n000001b: 7d                                        ; f32\n0000009: 12                                        ; FIXUP section size\n; section \"Function\" (3)\n000001c: 03                                        ; section code\n000001d: 00                                        ; section size (guess)\n000001e: 03                                        ; num functions\n000001f: 01                                        ; function 0 signature index\n0000020: 00                                        ; function 1 signature index\n0000021: 02                                        ; function 2 signature index\n000001d: 04                                        ; FIXUP section size\n; section \"Export\" (7)\n0000022: 07                                        ; section code\n0000023: 00                                        ; section size (guess)\n0000024: 01                                        ; num exports\n0000025: 04                                        ; string length\n0000026: 6d61 696e                                main  ; export name\n000002a: 00                                        ; export kind\n000002b: 02                                        ; export func index\n0000023: 08                                        ; FIXUP section size\n; section \"Elem\" (9)\n000002c: 09                                        ; section code\n000002d: 00                                        ; section size (guess)\n000002e: 01                                        ; num elem segments\n; elem segment header 0\n000002f: 03                                        ; segment flags\n0000030: 00                                        ; elem list type\n0000031: 01                                        ; num elems\n0000032: 01                                        ; elem function index\n000002d: 05                                        ; FIXUP section size\n; section \"Code\" (10)\n0000033: 0a                                        ; section code\n0000034: 00                                        ; section size (guess)\n0000035: 03                                        ; num functions\n; function body 0\n0000036: 00                                        ; func body size (guess)\n0000037: 00                                        ; local decl count\n0000038: 20                                        ; local.get\n0000039: 02                                        ; local index\n000003a: 20                                        ; local.get\n000003b: 01                                        ; local index\n000003c: 92                                        ; f32.add\n000003d: 20                                        ; local.get\n000003e: 00                                        ; local index\n000003f: 14                                        ; call_ref\n0000040: 00                                        ; signature index\n0000041: 20                                        ; local.get\n0000042: 01                                        ; local index\n0000043: 20                                        ; local.get\n0000044: 00                                        ; local index\n0000045: 14                                        ; call_ref\n0000046: 00                                        ; signature index\n0000047: 93                                        ; f32.sub\n0000048: 20                                        ; local.get\n0000049: 02                                        ; local index\n000004a: 95                                        ; f32.div\n000004b: 0b                                        ; end\n0000036: 15                                        ; FIXUP func body size\n; function body 1\n000004c: 00                                        ; func body size (guess)\n000004d: 00                                        ; local decl count\n000004e: 20                                        ; local.get\n000004f: 00                                        ; local index\n0000050: 20                                        ; local.get\n0000051: 00                                        ; local index\n0000052: 94                                        ; f32.mul\n0000053: 0b                                        ; end\n000004c: 07                                        ; FIXUP func body size\n; function body 2\n0000054: 00                                        ; func body size (guess)\n0000055: 00                                        ; local decl count\n0000056: d2                                        ; ref.func\n0000057: 01                                        ; function index\n0000058: 43                                        ; f32.const\n0000059: 0000 803f                                 ; f32 literal\n000005d: 43                                        ; f32.const\n000005e: 0ad7 233c                                 ; f32 literal\n0000062: 10                                        ; call\n0000063: 00                                        ; function index\n0000064: 0b                                        ; end\n0000054: 10                                        ; FIXUP func body size\n0000034: 30                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntyped_func_refs_params.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000037 func[0]:\n 000038: 20 02                      | local.get 2\n 00003a: 20 01                      | local.get 1\n 00003c: 92                         | f32.add\n 00003d: 20 00                      | local.get 0\n 00003f: 14 00                      | call_ref (ref null 0)\n 000041: 20 01                      | local.get 1\n 000043: 20 00                      | local.get 0\n 000045: 14 00                      | call_ref (ref null 0)\n 000047: 93                         | f32.sub\n 000048: 20 02                      | local.get 2\n 00004a: 95                         | f32.div\n 00004b: 0b                         | end\n00004d func[1]:\n 00004e: 20 00                      | local.get 0\n 000050: 20 00                      | local.get 0\n 000052: 94                         | f32.mul\n 000053: 0b                         | end\n000055 func[2] <main>:\n 000056: d2 01                      | ref.func 1\n 000058: 43 00 00 80 3f             | f32.const 0x1p+0\n 00005d: 43 0a d7 23 3c             | f32.const 0x1.47ae14p-7\n 000062: 10 00                      | call 0\n 000064: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/typed_func_refs_results.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v --enable-function-references\n\n(module\n  (type $f32-f32 (func (param f32) (result f32)))\n\n  (func $choice (param $f (ref $f32-f32))\n                (param $g (ref $f32-f32))\n                (param $cond i32)\n                (result (ref $f32-f32))\n    (if (result (ref $f32-f32))\n      (i32.eq\n        (local.get $cond)\n        (i32.const 1)\n      )\n      (then\n        (local.get $f)\n      )\n      (else\n        (local.get $g)\n      )\n    )\n  )\n\n  (func $square (param $x f32) (result f32)\n    (f32.mul (local.get $x)\n             (local.get $x))\n  )\n\n  (func $double (param $x f32) (result f32)\n    (f32.add (local.get $x)\n             (local.get $x))\n  )\n\n  (func (export \"main\") (result f32)\n    (call_ref $f32-f32\n      (f32.const 2.0)\n      (call $choice (ref.func $square) (ref.func $double) (i32.const 1))\n    )\n  )\n\n  (elem declare func $square $double)\n)\n\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 03                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 01                                        ; num params\n000000d: 7d                                        ; f32\n000000e: 01                                        ; num results\n000000f: 7d                                        ; f32\n; func type 1\n0000010: 60                                        ; func\n0000011: 03                                        ; num params\n0000012: 64                                        ; (ref 0)\n0000013: 00                                        ; (ref 0)\n0000014: 64                                        ; (ref 0)\n0000015: 00                                        ; (ref 0)\n0000016: 7f                                        ; i32\n0000017: 01                                        ; num results\n0000018: 64                                        ; (ref 0)\n0000019: 00                                        ; (ref 0)\n; func type 2\n000001a: 60                                        ; func\n000001b: 00                                        ; num params\n000001c: 01                                        ; num results\n000001d: 7d                                        ; f32\n0000009: 14                                        ; FIXUP section size\n; section \"Function\" (3)\n000001e: 03                                        ; section code\n000001f: 00                                        ; section size (guess)\n0000020: 04                                        ; num functions\n0000021: 01                                        ; function 0 signature index\n0000022: 00                                        ; function 1 signature index\n0000023: 00                                        ; function 2 signature index\n0000024: 02                                        ; function 3 signature index\n000001f: 05                                        ; FIXUP section size\n; section \"Export\" (7)\n0000025: 07                                        ; section code\n0000026: 00                                        ; section size (guess)\n0000027: 01                                        ; num exports\n0000028: 04                                        ; string length\n0000029: 6d61 696e                                main  ; export name\n000002d: 00                                        ; export kind\n000002e: 03                                        ; export func index\n0000026: 08                                        ; FIXUP section size\n; section \"Elem\" (9)\n000002f: 09                                        ; section code\n0000030: 00                                        ; section size (guess)\n0000031: 01                                        ; num elem segments\n; elem segment header 0\n0000032: 03                                        ; segment flags\n0000033: 00                                        ; elem list type\n0000034: 02                                        ; num elems\n0000035: 01                                        ; elem function index\n0000036: 02                                        ; elem function index\n0000030: 06                                        ; FIXUP section size\n; section \"Code\" (10)\n0000037: 0a                                        ; section code\n0000038: 00                                        ; section size (guess)\n0000039: 04                                        ; num functions\n; function body 0\n000003a: 00                                        ; func body size (guess)\n000003b: 00                                        ; local decl count\n000003c: 20                                        ; local.get\n000003d: 02                                        ; local index\n000003e: 41                                        ; i32.const\n000003f: 01                                        ; i32 literal\n0000040: 46                                        ; i32.eq\n0000041: 04                                        ; if\n0000042: 64                                        ; (ref 0)\n0000043: 00                                        ; (ref 0)\n0000044: 20                                        ; local.get\n0000045: 00                                        ; local index\n0000046: 05                                        ; else\n0000047: 20                                        ; local.get\n0000048: 01                                        ; local index\n0000049: 0b                                        ; end\n000004a: 0b                                        ; end\n000003a: 10                                        ; FIXUP func body size\n; function body 1\n000004b: 00                                        ; func body size (guess)\n000004c: 00                                        ; local decl count\n000004d: 20                                        ; local.get\n000004e: 00                                        ; local index\n000004f: 20                                        ; local.get\n0000050: 00                                        ; local index\n0000051: 94                                        ; f32.mul\n0000052: 0b                                        ; end\n000004b: 07                                        ; FIXUP func body size\n; function body 2\n0000053: 00                                        ; func body size (guess)\n0000054: 00                                        ; local decl count\n0000055: 20                                        ; local.get\n0000056: 00                                        ; local index\n0000057: 20                                        ; local.get\n0000058: 00                                        ; local index\n0000059: 92                                        ; f32.add\n000005a: 0b                                        ; end\n0000053: 07                                        ; FIXUP func body size\n; function body 3\n000005b: 00                                        ; func body size (guess)\n000005c: 00                                        ; local decl count\n000005d: 43                                        ; f32.const\n000005e: 0000 0040                                 ; f32 literal\n0000062: d2                                        ; ref.func\n0000063: 01                                        ; function index\n0000064: d2                                        ; ref.func\n0000065: 02                                        ; function index\n0000066: 41                                        ; i32.const\n0000067: 01                                        ; i32 literal\n0000068: 10                                        ; call\n0000069: 00                                        ; function index\n000006a: 14                                        ; call_ref\n000006b: 00                                        ; signature index\n000006c: 0b                                        ; end\n000005b: 11                                        ; FIXUP func body size\n0000038: 34                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\ntyped_func_refs_results.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n00003b func[0]:\n 00003c: 20 02                      | local.get 2\n 00003e: 41 01                      | i32.const 1\n 000040: 46                         | i32.eq\n 000041: 04 64 00                   | if (ref 0)\n 000044: 20 00                      |   local.get 0\n 000046: 05                         | else\n 000047: 20 01                      |   local.get 1\n 000049: 0b                         | end\n 00004a: 0b                         | end\n00004c func[1]:\n 00004d: 20 00                      | local.get 0\n 00004f: 20 00                      | local.get 0\n 000051: 94                         | f32.mul\n 000052: 0b                         | end\n000054 func[2]:\n 000055: 20 00                      | local.get 0\n 000057: 20 00                      | local.get 0\n 000059: 92                         | f32.add\n 00005a: 0b                         | end\n00005c func[3] <main>:\n 00005d: 43 00 00 00 40             | f32.const 0x1p+1\n 000062: d2 01                      | ref.func 1\n 000064: d2 02                      | ref.func 2\n 000066: 41 01                      | i32.const 1\n 000068: 10 00                      | call 0\n 00006a: 14 00                      | call_ref (ref null 0)\n 00006c: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/unary-extend.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    i32.extend8_s\n    drop\n\n    i32.const 0\n    i32.extend16_s\n    drop\n\n    i64.const 0\n    i64.extend8_s\n    drop\n\n    i64.const 0\n    i64.extend16_s\n    drop\n\n    i64.const 0\n    i64.extend32_s\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: c0                                        ; i32.extend8_s\n000001a: 1a                                        ; drop\n000001b: 41                                        ; i32.const\n000001c: 00                                        ; i32 literal\n000001d: c1                                        ; i32.extend16_s\n000001e: 1a                                        ; drop\n000001f: 42                                        ; i64.const\n0000020: 00                                        ; i64 literal\n0000021: c2                                        ; i64.extend8_s\n0000022: 1a                                        ; drop\n0000023: 42                                        ; i64.const\n0000024: 00                                        ; i64 literal\n0000025: c3                                        ; i64.extend16_s\n0000026: 1a                                        ; drop\n0000027: 42                                        ; i64.const\n0000028: 00                                        ; i64 literal\n0000029: c4                                        ; i64.extend32_s\n000002a: 1a                                        ; drop\n000002b: 0b                                        ; end\n0000015: 16                                        ; FIXUP func body size\n0000013: 18                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nunary-extend.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 41 00                      | i32.const 0\n 000019: c0                         | i32.extend8_s\n 00001a: 1a                         | drop\n 00001b: 41 00                      | i32.const 0\n 00001d: c1                         | i32.extend16_s\n 00001e: 1a                         | drop\n 00001f: 42 00                      | i64.const 0\n 000021: c2                         | i64.extend8_s\n 000022: 1a                         | drop\n 000023: 42 00                      | i64.const 0\n 000025: c3                         | i64.extend16_s\n 000026: 1a                         | drop\n 000027: 42 00                      | i64.const 0\n 000029: c4                         | i64.extend32_s\n 00002a: 1a                         | drop\n 00002b: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/unary.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    i32.const 0\n    i32.popcnt\n    i32.ctz\n    i32.clz\n    i32.eqz\n    drop\n    \n    i64.const 0\n    i64.popcnt\n    i64.ctz\n    i64.clz\n    drop\n    \n    f32.const 0\n    f32.nearest\n    f32.trunc\n    f32.floor\n    f32.ceil\n    f32.sqrt\n    f32.abs\n    f32.neg\n    drop\n   \n    f64.const 0\n    f64.nearest \n    f64.trunc\n    f64.floor\n    f64.ceil\n    f64.sqrt\n    f64.abs\n    f64.neg\n    drop))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 41                                        ; i32.const\n0000018: 00                                        ; i32 literal\n0000019: 69                                        ; i32.popcnt\n000001a: 68                                        ; i32.ctz\n000001b: 67                                        ; i32.clz\n000001c: 45                                        ; i32.eqz\n000001d: 1a                                        ; drop\n000001e: 42                                        ; i64.const\n000001f: 00                                        ; i64 literal\n0000020: 7b                                        ; i64.popcnt\n0000021: 7a                                        ; i64.ctz\n0000022: 79                                        ; i64.clz\n0000023: 1a                                        ; drop\n0000024: 43                                        ; f32.const\n0000025: 0000 0000                                 ; f32 literal\n0000029: 90                                        ; f32.nearest\n000002a: 8f                                        ; f32.trunc\n000002b: 8e                                        ; f32.floor\n000002c: 8d                                        ; f32.ceil\n000002d: 91                                        ; f32.sqrt\n000002e: 8b                                        ; f32.abs\n000002f: 8c                                        ; f32.neg\n0000030: 1a                                        ; drop\n0000031: 44                                        ; f64.const\n0000032: 0000 0000 0000 0000                       ; f64 literal\n000003a: 9e                                        ; f64.nearest\n000003b: 9d                                        ; f64.trunc\n000003c: 9c                                        ; f64.floor\n000003d: 9b                                        ; f64.ceil\n000003e: 9f                                        ; f64.sqrt\n000003f: 99                                        ; f64.abs\n0000040: 9a                                        ; f64.neg\n0000041: 1a                                        ; drop\n0000042: 0b                                        ; end\n0000015: 2d                                        ; FIXUP func body size\n0000013: 2f                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nunary.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 41 00                      | i32.const 0\n 000019: 69                         | i32.popcnt\n 00001a: 68                         | i32.ctz\n 00001b: 67                         | i32.clz\n 00001c: 45                         | i32.eqz\n 00001d: 1a                         | drop\n 00001e: 42 00                      | i64.const 0\n 000020: 7b                         | i64.popcnt\n 000021: 7a                         | i64.ctz\n 000022: 79                         | i64.clz\n 000023: 1a                         | drop\n 000024: 43 00 00 00 00             | f32.const 0x0p+0\n 000029: 90                         | f32.nearest\n 00002a: 8f                         | f32.trunc\n 00002b: 8e                         | f32.floor\n 00002c: 8d                         | f32.ceil\n 00002d: 91                         | f32.sqrt\n 00002e: 8b                         | f32.abs\n 00002f: 8c                         | f32.neg\n 000030: 1a                         | drop\n 000031: 44 00 00 00 00 00 00 00 00 | f64.const 0x0p+0\n 00003a: 9e                         | f64.nearest\n 00003b: 9d                         | f64.trunc\n 00003c: 9c                         | f64.floor\n 00003d: 9b                         | f64.ceil\n 00003e: 9f                         | f64.sqrt\n 00003f: 99                         | f64.abs\n 000040: 9a                         | f64.neg\n 000041: 1a                         | drop\n 000042: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/dump/unreachable.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: -v\n(module\n  (func\n    unreachable))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 00                                        ; num results\n0000009: 04                                        ; FIXUP section size\n; section \"Function\" (3)\n000000e: 03                                        ; section code\n000000f: 00                                        ; section size (guess)\n0000010: 01                                        ; num functions\n0000011: 00                                        ; function 0 signature index\n000000f: 02                                        ; FIXUP section size\n; section \"Code\" (10)\n0000012: 0a                                        ; section code\n0000013: 00                                        ; section size (guess)\n0000014: 01                                        ; num functions\n; function body 0\n0000015: 00                                        ; func body size (guess)\n0000016: 00                                        ; local decl count\n0000017: 00                                        ; unreachable\n0000018: 0b                                        ; end\n0000015: 03                                        ; FIXUP func body size\n0000013: 05                                        ; FIXUP section size\n;;; STDERR ;;)\n(;; STDOUT ;;;\n\nunreachable.wasm:\tfile format wasm 0x1\n\nCode Disassembly:\n\n000016 func[0]:\n 000017: 00                         | unreachable\n 000018: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/find_exe.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport os\nimport sys\n\nfrom utils import Error\n\nIS_WINDOWS = sys.platform == 'win32'\nSCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))\nREPO_ROOT_DIR = os.path.dirname(SCRIPT_DIR)\nEXECUTABLES = [\n    'wat2wasm', 'wast2json', 'wasm2wat', 'wasm-objdump', 'wasm-interp',\n    'wasm-stats', 'wat-desugar', 'spectest-interp', 'wasm-validate',\n    'wasm2c', 'wasm-strip', 'wasm-decompile'\n]\n\n\ndef GetDefaultPath():\n    return os.path.join(REPO_ROOT_DIR, 'bin')\n\n\ndef GetDefaultExe(basename):\n    result = os.path.join(GetDefaultPath(), basename)\n    if IS_WINDOWS:\n        result += '.exe'\n    return result\n\n\ndef FindExeWithFallback(name, default_exe_list, override_exe=None):\n    result = override_exe\n    if result is not None:\n        if os.path.isdir(result):\n            result = os.path.join(result, name)\n        if IS_WINDOWS and os.path.splitext(result)[1] != '.exe':\n            result += '.exe'\n        if os.path.exists(result):\n            return os.path.abspath(result)\n        raise Error('%s executable not found.\\nsearch path: %s\\n' % (name, result))\n\n    for result in default_exe_list:\n        if os.path.exists(result):\n            return os.path.abspath(result)\n\n    raise Error('%s executable not found.\\n%s\\n' %\n                (name, '\\n'.join('search path: %s' % path\n                 for path in default_exe_list)))\n\n\ndef FindExecutable(basename, override=None):\n    return FindExeWithFallback(basename, [GetDefaultExe(basename)], override)\n\n\ndef GetWat2WasmExecutable(override=None):\n    return FindExecutable('wat2wasm', override)\n\n\ndef GetWast2JsonExecutable(override=None):\n    return FindExecutable('wast2json', override)\n\n\ndef GetWasm2WatExecutable(override=None):\n    return FindExecutable('wasm2wat', override)\n\n\ndef GetWasmdumpExecutable(override=None):\n    return FindExecutable('wasm-objdump', override)\n\n\ndef GetWasmInterpExecutable(override=None):\n    return FindExecutable('wasm-interp', override)\n\n\ndef GetSpectestInterpExecutable(override=None):\n    return FindExecutable('spectest-interp', override)\n\n\ndef GetWasmStatsExecutable(override=None):\n    return FindExecutable('wasm-stats', override)\n\n\ndef GetWatDesugarExecutable(override=None):\n    return FindExecutable('wat-desugar', override)\n\n\ndef GetWasmValidateExecutable(override=None):\n    return FindExecutable('wasm-validate', override)\n\n\ndef GetWasm2CExecutable(override=None):\n    return FindExecutable('wasm2c', override)\n\n\ndef GetWasmStripExecutable(override=None):\n    return FindExecutable('wasm-strip', override)\n\n\ndef GetWasmDecompileExecutable(override=None):\n    return FindExecutable('wasm-decompile', override)\n"
  },
  {
    "path": "test/gen-spec-empty-prefix.js",
    "content": "// A deliberately empty file for testing.\n"
  },
  {
    "path": "test/gen-spec-js/action.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(module\n  (import \"spectest\" \"print\" (func (param i32)))\n  (func (export \"print_i32\") (param i32) local.get 0 call 0)\n\n  (global (export \"global\") i32 (i32.const 14)))\n\n(invoke \"print_i32\" (i32.const 1))\n(get \"global\")\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// action.txt:3\nlet $1 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x05\\x01\\x60\\x01\\x7f\\x00\\x02\\x12\\x01\\x08\\x73\\x70\\x65\\x63\\x74\\x65\\x73\\x74\\x05\\x70\\x72\\x69\\x6e\\x74\\x00\\x00\\x03\\x02\\x01\\x00\\x06\\x06\\x01\\x7f\\x00\\x41\\x0e\\x0b\\x07\\x16\\x02\\x09\\x70\\x72\\x69\\x6e\\x74\\x5f\\x69\\x33\\x32\\x00\\x01\\x06\\x67\\x6c\\x6f\\x62\\x61\\x6c\\x03\\x00\\x0a\\x08\\x01\\x06\\x00\\x20\\x00\\x10\\x00\\x0b\");\n\n// action.txt:9\ncall($1, \"print_i32\", [1]);\n\n// action.txt:10\nget($1, \"global\");\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/assert_exhaustion.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(module\n  (func (export \"foo\")\n    call 0))\n\n(assert_exhaustion (invoke \"foo\") \"so exhausted\")\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// assert_exhaustion.txt:3\nlet $1 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x04\\x01\\x60\\x00\\x00\\x03\\x02\\x01\\x00\\x07\\x07\\x01\\x03\\x66\\x6f\\x6f\\x00\\x00\\x0a\\x06\\x01\\x04\\x00\\x10\\x00\\x0b\");\n\n// assert_exhaustion.txt:7\nassert_exhaustion(() => call($1, \"foo\", []));\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/assert_malformed-quote.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n\n;; This won't be written out, since it can't be tested in JS.\n(assert_malformed\n  (module quote \"(module))\")\n  \"syntax error\")\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// assert_malformed-quote.txt:6\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/assert_malformed.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(assert_malformed\n  (module binary \"\\00asm\\bc\\0a\\00\\00\")\n  \"unknown binary version\")\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// assert_malformed.txt:4\nassert_malformed(\"\\x00\\x61\\x73\\x6d\\xbc\\x0a\\x00\\x00\");\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/assert_return.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(module\n  (func (export \"no_result\"))\n  (func (export \"42\") (result i32) i32.const 42)\n  (func (export \"i32.add\") (param i32 i32) (result i32)\n    local.get 0\n    local.get 1\n    i32.add)\n  (func (export \"i64.add\") (param i64 i64) (result i64)\n    local.get 0\n    local.get 1\n    i64.add)\n  (func (export \"f32.add\") (param f32 f32) (result f32)\n    local.get 0\n    local.get 1\n    f32.add)\n  (func (export \"f64.add\") (param f64 f64) (result f64)\n    local.get 0\n    local.get 1\n    f64.add)\n  (func (export \"nan\") (result f32) f32.const nan:0x2))\n\n(assert_return (invoke \"no_result\"))\n(assert_return (invoke \"42\") (i32.const 42))\n\n(assert_return (invoke \"i32.add\" (i32.const 1) (i32.const 2)) (i32.const 3))\n;; Rewritten to avoid passing i64 values as parameters.\n(assert_return (invoke \"i64.add\" (i64.const 1) (i64.const 2)) (i64.const 3))\n;; Normal floats are not rewritten.\n(assert_return (invoke \"f32.add\" (f32.const 1) (f32.const 2)) (f32.const 3))\n(assert_return (invoke \"f64.add\" (f64.const 1) (f64.const 2)) (f64.const 3))\n\n;; Rewritten to avoid passing nan as a parameter.\n(assert_return (invoke \"nan\") (f32.const nan:0x2))\n\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// assert_return.txt:3\nlet $1 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x24\\x07\\x60\\x00\\x00\\x60\\x00\\x01\\x7f\\x60\\x02\\x7f\\x7f\\x01\\x7f\\x60\\x02\\x7e\\x7e\\x01\\x7e\\x60\\x02\\x7d\\x7d\\x01\\x7d\\x60\\x02\\x7c\\x7c\\x01\\x7c\\x60\\x00\\x01\\x7d\\x03\\x0a\\x09\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x00\\x00\\x07\\x56\\x09\\x09\\x6e\\x6f\\x5f\\x72\\x65\\x73\\x75\\x6c\\x74\\x00\\x00\\x02\\x34\\x32\\x00\\x01\\x07\\x69\\x33\\x32\\x2e\\x61\\x64\\x64\\x00\\x02\\x07\\x69\\x36\\x34\\x2e\\x61\\x64\\x64\\x00\\x03\\x07\\x66\\x33\\x32\\x2e\\x61\\x64\\x64\\x00\\x04\\x07\\x66\\x36\\x34\\x2e\\x61\\x64\\x64\\x00\\x05\\x03\\x6e\\x61\\x6e\\x00\\x06\\x08\\x61\\x73\\x73\\x65\\x72\\x74\\x5f\\x30\\x00\\x07\\x08\\x61\\x73\\x73\\x65\\x72\\x74\\x5f\\x31\\x00\\x08\\x0a\\x5a\\x09\\x02\\x00\\x0b\\x04\\x00\\x41\\x2a\\x0b\\x07\\x00\\x20\\x00\\x20\\x01\\x6a\\x0b\\x07\\x00\\x20\\x00\\x20\\x01\\x7c\\x0b\\x07\\x00\\x20\\x00\\x20\\x01\\x92\\x0b\\x07\\x00\\x20\\x00\\x20\\x01\\xa0\\x0b\\x07\\x00\\x43\\x02\\x00\\x80\\x7f\\x0b\\x13\\x00\\x02\\x40\\x42\\x01\\x42\\x02\\x10\\x03\\x42\\x03\\x51\\x45\\x0d\\x00\\x0f\\x0b\\x00\\x0b\\x14\\x00\\x02\\x40\\x10\\x06\\xbc\\x43\\x02\\x00\\x80\\x7f\\xbc\\x46\\x45\\x0d\\x00\\x0f\\x0b\\x00\\x0b\");\n\n// assert_return.txt:24\nassert_return(() => call($1, \"no_result\", []));\n\n// assert_return.txt:25\nassert_return(() => call($1, \"42\", []), 42);\n\n// assert_return.txt:27\nassert_return(() => call($1, \"i32.add\", [1, 2]), 3);\n\n// assert_return.txt:29\nassert_return(() => call($1, \"assert_0\", []));\n\n// assert_return.txt:31\nassert_return(() => call($1, \"f32.add\", [f32(1.0), f32(2.0)]), f32(3.0));\n\n// assert_return.txt:32\nassert_return(() => call($1, \"f64.add\", [1.0, 2.0]), 3.0);\n\n// assert_return.txt:35\nassert_return(() => call($1, \"assert_1\", []));\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/assert_return_nan.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(module\n  (func (export \"f32_nan\") (result f32) f32.const nan)\n  (func (export \"f32_nan_with_tag\") (result f32) f32.const nan:0x1234)\n  (func (export \"f32_passthru\") (param f32) (result f32) local.get 0)\n\n  (func (export \"f64_nan\") (result f64) f64.const nan)\n  (func (export \"f64_nan_with_tag\") (result f64) f64.const nan:0x1234)\n  (func (export \"f64_passthru\") (param f64) (result f64) local.get 0))\n\n(assert_return (invoke \"f32_nan\") (f32.const nan:canonical))\n(assert_return (invoke \"f32_nan_with_tag\") (f32.const nan:arithmetic))\n(assert_return (invoke \"f64_nan\") (f64.const nan:canonical))\n(assert_return (invoke \"f64_nan_with_tag\") (f64.const nan:canonical))\n\n;; Rewritten to avoid passing nan as a parameter.\n(assert_return (invoke \"f32_passthru\" (f32.const -nan)) (f32.const nan:canonical))\n(assert_return (invoke \"f32_passthru\" (f32.const nan:0x1234)) (f32.const nan:arithmetic))\n(assert_return (invoke \"f64_passthru\" (f64.const -nan)) (f64.const nan:canonical))\n(assert_return (invoke \"f64_passthru\" (f64.const nan:0x1234)) (f64.const nan:arithmetic))\n\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// assert_return_nan.txt:3\nlet $1 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x16\\x05\\x60\\x00\\x01\\x7d\\x60\\x01\\x7d\\x01\\x7d\\x60\\x00\\x01\\x7c\\x60\\x01\\x7c\\x01\\x7c\\x60\\x00\\x00\\x03\\x0b\\x0a\\x00\\x00\\x01\\x02\\x02\\x03\\x04\\x04\\x04\\x04\\x07\\x85\\x01\\x0a\\x07\\x66\\x33\\x32\\x5f\\x6e\\x61\\x6e\\x00\\x00\\x10\\x66\\x33\\x32\\x5f\\x6e\\x61\\x6e\\x5f\\x77\\x69\\x74\\x68\\x5f\\x74\\x61\\x67\\x00\\x01\\x0c\\x66\\x33\\x32\\x5f\\x70\\x61\\x73\\x73\\x74\\x68\\x72\\x75\\x00\\x02\\x07\\x66\\x36\\x34\\x5f\\x6e\\x61\\x6e\\x00\\x03\\x10\\x66\\x36\\x34\\x5f\\x6e\\x61\\x6e\\x5f\\x77\\x69\\x74\\x68\\x5f\\x74\\x61\\x67\\x00\\x04\\x0c\\x66\\x36\\x34\\x5f\\x70\\x61\\x73\\x73\\x74\\x68\\x72\\x75\\x00\\x05\\x08\\x61\\x73\\x73\\x65\\x72\\x74\\x5f\\x30\\x00\\x06\\x08\\x61\\x73\\x73\\x65\\x72\\x74\\x5f\\x31\\x00\\x07\\x08\\x61\\x73\\x73\\x65\\x72\\x74\\x5f\\x32\\x00\\x08\\x08\\x61\\x73\\x73\\x65\\x72\\x74\\x5f\\x33\\x00\\x09\\x0a\\xd3\\x01\\x0a\\x07\\x00\\x43\\x00\\x00\\xc0\\x7f\\x0b\\x07\\x00\\x43\\x34\\x12\\x80\\x7f\\x0b\\x04\\x00\\x20\\x00\\x0b\\x0b\\x00\\x44\\x00\\x00\\x00\\x00\\x00\\x00\\xf8\\x7f\\x0b\\x0b\\x00\\x44\\x34\\x12\\x00\\x00\\x00\\x00\\xf0\\x7f\\x0b\\x04\\x00\\x20\\x00\\x0b\\x20\\x00\\x02\\x40\\x43\\x00\\x00\\xc0\\xff\\x10\\x02\\xbc\\x41\\xff\\xff\\xff\\xff\\x07\\x71\\x41\\x80\\x80\\x80\\xfe\\x07\\x46\\x45\\x0d\\x00\\x0f\\x0b\\x00\\x0b\\x20\\x00\\x02\\x40\\x43\\x34\\x12\\x80\\x7f\\x10\\x02\\xbc\\x41\\x80\\x80\\x80\\xfe\\x07\\x71\\x41\\x80\\x80\\x80\\xfe\\x07\\x46\\x45\\x0d\\x00\\x0f\\x0b\\x00\\x0b\\x2e\\x00\\x02\\x40\\x44\\x00\\x00\\x00\\x00\\x00\\x00\\xf8\\xff\\x10\\x05\\xbd\\x42\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\x83\\x42\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\xfc\\xff\\x00\\x51\\x45\\x0d\\x00\\x0f\\x0b\\x00\\x0b\\x2e\\x00\\x02\\x40\\x44\\x34\\x12\\x00\\x00\\x00\\x00\\xf0\\x7f\\x10\\x05\\xbd\\x42\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\xfc\\xff\\x00\\x83\\x42\\x80\\x80\\x80\\x80\\x80\\x80\\x80\\xfc\\xff\\x00\\x51\\x45\\x0d\\x00\\x0f\\x0b\\x00\\x0b\");\n\n// assert_return_nan.txt:12\nassert_return(() => call($1, \"f32_nan\", []), nan:canonical);\n\n// assert_return_nan.txt:13\nassert_return(() => call($1, \"f32_nan_with_tag\", []), nan:arithmetic);\n\n// assert_return_nan.txt:14\nassert_return(() => call($1, \"f64_nan\", []), nan:canonical);\n\n// assert_return_nan.txt:15\nassert_return(() => call($1, \"f64_nan_with_tag\", []), nan:canonical);\n\n// assert_return_nan.txt:18\nassert_return(() => call($1, \"assert_0\", []));\n\n// assert_return_nan.txt:19\nassert_return(() => call($1, \"assert_1\", []));\n\n// assert_return_nan.txt:20\nassert_return(() => call($1, \"assert_2\", []));\n\n// assert_return_nan.txt:21\nassert_return(() => call($1, \"assert_3\", []));\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/assert_trap.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(module\n  (func (export \"unreachable\") unreachable)\n  (func (export \"i32.trunc_s\") (param f32) (result i32)\n    local.get 0\n    i32.trunc_f32_s))\n\n(assert_trap (invoke \"unreachable\") \"unreachable\")\n;; Rewritten to avoid passing nan as a parameter.\n(assert_trap (invoke \"i32.trunc_s\" (f32.const -nan)) \"invalid conversion\")\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// assert_trap.txt:3\nlet $1 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x09\\x02\\x60\\x00\\x00\\x60\\x01\\x7d\\x01\\x7f\\x03\\x04\\x03\\x00\\x01\\x00\\x07\\x28\\x03\\x0b\\x75\\x6e\\x72\\x65\\x61\\x63\\x68\\x61\\x62\\x6c\\x65\\x00\\x00\\x0b\\x69\\x33\\x32\\x2e\\x74\\x72\\x75\\x6e\\x63\\x5f\\x73\\x00\\x01\\x08\\x61\\x73\\x73\\x65\\x72\\x74\\x5f\\x30\\x00\\x02\\x0a\\x17\\x03\\x03\\x00\\x00\\x0b\\x05\\x00\\x20\\x00\\xa8\\x0b\\x0b\\x00\\x43\\x00\\x00\\xc0\\xff\\x10\\x01\\x0c\\x00\\x0b\");\n\n// assert_trap.txt:9\nassert_trap(() => call($1, \"unreachable\", []));\n\n// assert_trap.txt:11\nassert_trap(() => call($1, \"assert_0\", []));\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/assert_uninstantiable.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(assert_trap\n  (module\n    (func unreachable)\n    (start 0))\n  \"trap in start function\")\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// assert_uninstantiable.txt:4\nassert_uninstantiable(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x04\\x01\\x60\\x00\\x00\\x03\\x02\\x01\\x00\\x08\\x01\\x00\\x0a\\x05\\x01\\x03\\x00\\x00\\x0b\");\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/assert_unlinkable.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(assert_unlinkable\n  (module (import \"foo\" \"bar\" (func)))\n  \"module not linkable\")\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// assert_unlinkable.txt:4\nassert_unlinkable(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x04\\x01\\x60\\x00\\x00\\x02\\x0b\\x01\\x03\\x66\\x6f\\x6f\\x03\\x62\\x61\\x72\\x00\\x00\");\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/basic.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(module\n  (func (export \"42\") (result i32) i32.const 42))\n\n(assert_return (invoke \"42\") (i32.const 42))\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// basic.txt:3\nlet $1 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x05\\x01\\x60\\x00\\x01\\x7f\\x03\\x02\\x01\\x00\\x07\\x06\\x01\\x02\\x34\\x32\\x00\\x00\\x0a\\x06\\x01\\x04\\x00\\x41\\x2a\\x0b\");\n\n// basic.txt:6\nassert_return(() => call($1, \"42\", []), 42);\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/many-modules.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(module $A (func (export \"f\") (result i32) i32.const 1))\n(module $B (func (export \"f\") (result i32) i32.const 2))\n(module $C (func (export \"f\") (result i32) i32.const 3))\n\n(assert_return (invoke \"f\") (i32.const 3))\n(assert_return (invoke $A \"f\") (i32.const 1))\n(assert_return (invoke $B \"f\") (i32.const 2))\n(assert_return (invoke $C \"f\") (i32.const 3))\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// many-modules.txt:3\nlet $1 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x05\\x01\\x60\\x00\\x01\\x7f\\x03\\x02\\x01\\x00\\x07\\x05\\x01\\x01\\x66\\x00\\x00\\x0a\\x06\\x01\\x04\\x00\\x41\\x01\\x0b\");\nlet $A = $1;\n\n// many-modules.txt:4\nlet $2 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x05\\x01\\x60\\x00\\x01\\x7f\\x03\\x02\\x01\\x00\\x07\\x05\\x01\\x01\\x66\\x00\\x00\\x0a\\x06\\x01\\x04\\x00\\x41\\x02\\x0b\");\nlet $B = $2;\n\n// many-modules.txt:5\nlet $3 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x05\\x01\\x60\\x00\\x01\\x7f\\x03\\x02\\x01\\x00\\x07\\x05\\x01\\x01\\x66\\x00\\x00\\x0a\\x06\\x01\\x04\\x00\\x41\\x03\\x0b\");\nlet $C = $3;\n\n// many-modules.txt:7\nassert_return(() => call($3, \"f\", []), 3);\n\n// many-modules.txt:8\nassert_return(() => call($A, \"f\", []), 1);\n\n// many-modules.txt:9\nassert_return(() => call($B, \"f\", []), 2);\n\n// many-modules.txt:10\nassert_return(() => call($C, \"f\", []), 3);\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js/register.txt",
    "content": ";;; TOOL: run-gen-spec-js\n;;; ARGS: --prefix=%(test_dir)s/gen-spec-empty-prefix.js\n(module\n  (func (export \"f\") (result i32) i32.const 1))\n\n(register \"A\")\n\n(module\n  (import \"A\" \"f\" (func (result i32)))\n  (func (export \"g\") (result i32) call 0))\n\n(assert_return (invoke \"g\") (i32.const 1))\n(;; STDOUT ;;;\n// A deliberately empty file for testing.\n\n// register.txt:3\nlet $1 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x05\\x01\\x60\\x00\\x01\\x7f\\x03\\x02\\x01\\x00\\x07\\x05\\x01\\x01\\x66\\x00\\x00\\x0a\\x06\\x01\\x04\\x00\\x41\\x01\\x0b\");\n\n// register.txt:6\nregister(\"A\", $1)\n\n// register.txt:8\nlet $2 = instance(\"\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00\\x01\\x05\\x01\\x60\\x00\\x01\\x7f\\x02\\x07\\x01\\x01\\x41\\x01\\x66\\x00\\x00\\x03\\x02\\x01\\x00\\x07\\x05\\x01\\x01\\x67\\x00\\x01\\x0a\\x06\\x01\\x04\\x00\\x10\\x00\\x0b\");\n\n// register.txt:12\nassert_return(() => call($2, \"g\", []), 1);\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/gen-spec-js.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n\"\"\"Convert a JSON descrption of a spec test into a JavaScript.\"\"\"\n\nimport argparse\nimport io\nimport json\nimport os\nimport re\nimport struct\nimport sys\n\nimport find_exe\nfrom utils import ChangeDir, ChangeExt, Error, Executable\nimport utils\n\nSCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))\n\nF32_INF = 0x7f800000\nF32_NEG_INF = 0xff800000\nF32_NEG_ZERO = 0x80000000\nF32_SIGN_BIT = F32_NEG_ZERO\nF32_SIG_MASK = 0x7fffff\nF32_QUIET_NAN = 0x7fc00000\nF32_QUIET_NAN_TAG = 0x400000\nF64_INF = 0x7ff0000000000000\nF64_NEG_INF = 0xfff0000000000000\nF64_NEG_ZERO = 0x8000000000000000\nF64_SIGN_BIT = F64_NEG_ZERO\nF64_SIG_MASK = 0xfffffffffffff\nF64_QUIET_NAN = 0x7ff8000000000000\nF64_QUIET_NAN_TAG = 0x8000000000000\n\n\ndef I32ToJS(value):\n    # JavaScript will return all i32 values as signed.\n    if value >= 2**31:\n        value -= 2**32\n    return str(value)\n\n\ndef IsNaNF32(f32_bits):\n    return (F32_INF < f32_bits < F32_NEG_ZERO) or (f32_bits > F32_NEG_INF)\n\n\ndef ReinterpretF32(f32_bits):\n    return struct.unpack('<f', struct.pack('<I', f32_bits))[0]\n\n\ndef NaNF32ToString(f32_bits):\n    result = '-' if f32_bits & F32_SIGN_BIT else ''\n    result += 'nan'\n    sig = f32_bits & F32_SIG_MASK\n    if sig != F32_QUIET_NAN_TAG:\n        result += ':0x%x' % sig\n    return result\n\n\ndef F32ToWasm(f32_bits):\n    if IsNaNF32(f32_bits):\n        return 'f32.const %s' % NaNF32ToString(f32_bits)\n    elif f32_bits == F32_INF:\n        return 'f32.const infinity'\n    elif f32_bits == F32_NEG_INF:\n        return 'f32.const -infinity'\n    else:\n        return 'f32.const %s' % float.hex(ReinterpretF32(f32_bits))\n\n\ndef F32ToJS(f32_bits):\n    assert not IsNaNF32(f32_bits)\n    if f32_bits == F32_INF:\n        return 'Infinity'\n    elif f32_bits == F32_NEG_INF:\n        return '-Infinity'\n    else:\n        return 'f32(%s)' % ReinterpretF32(f32_bits)\n\n\ndef IsNaNF64(f64_bits):\n    return (F64_INF < f64_bits < F64_NEG_ZERO) or (f64_bits > F64_NEG_INF)\n\n\ndef ReinterpretF64(f64_bits):\n    return struct.unpack('<d', struct.pack('<Q', f64_bits))[0]\n\n\ndef NaNF64ToString(f64_bits):\n    result = '-' if f64_bits & F64_SIGN_BIT else ''\n    result += 'nan'\n    sig = f64_bits & F64_SIG_MASK\n    if sig != F64_QUIET_NAN_TAG:\n        result += ':0x%x' % sig\n    return result\n\n\ndef F64ToWasm(f64_bits):\n    if IsNaNF64(f64_bits):\n        return 'f64.const %s' % NaNF64ToString(f64_bits)\n    elif f64_bits == F64_INF:\n        return 'f64.const infinity'\n    elif f64_bits == F64_NEG_INF:\n        return 'f64.const -infinity'\n    else:\n        return 'f64.const %s' % float.hex(ReinterpretF64(f64_bits))\n\n\ndef F64ToJS(f64_bits):\n    assert not IsNaNF64(f64_bits)\n    if f64_bits == F64_INF:\n        return 'Infinity'\n    elif f64_bits == F64_NEG_INF:\n        return '-Infinity'\n    else:\n        # Use repr to get full precision\n        return repr(ReinterpretF64(f64_bits))\n\n\ndef UnescapeWasmString(s):\n    # Wat allows for more escape characters than this, but we assume that\n    # wasm2wat will only use the \\xx escapes.\n    result = ''\n    i = 0\n    while i < len(s):\n        c = s[i]\n        if c == '\\\\':\n            x = s[i + 1:i + 3]\n            if len(x) != 2:\n                raise Error('String with invalid escape: \\\"%s\\\"' % s)\n            result += chr(int(x, 16))\n            i += 3\n        else:\n            result += c\n            i += 1\n    return result\n\n\ndef EscapeJSString(s):\n    result = ''\n    for c in s:\n        if 32 <= ord(c) < 127 and c not in '\"\\\\':\n            result += c\n        else:\n            result += '\\\\x%02x' % ord(c)\n    return result\n\n\ndef IsValidJSConstant(const):\n    type_ = const['type']\n    value = const['value']\n    if type_ in ('f32', 'f64') and value in ('nan:canonical', 'nan:arithmetic'):\n        return True\n    if type_ == 'i32':\n        return True\n    elif type_ == 'i64':\n        return False\n    elif type_ == 'f32':\n        return not IsNaNF32(int(value))\n    elif type_ == 'f64':\n        return not IsNaNF64(int(value))\n\n\ndef IsValidJSAction(action):\n    return all(IsValidJSConstant(x) for x in action.get('args', []))\n\n\ndef IsValidJSCommand(command):\n    type_ = command['type']\n    action = command['action']\n    if type_ == 'assert_return':\n        expected = command['expected']\n        return (IsValidJSAction(action) and\n                all(IsValidJSConstant(x) for x in expected))\n    elif type_ in ('assert_trap', 'assert_exhaustion'):\n        return IsValidJSAction(action)\n\n\ndef CollectInvalidModuleCommands(commands):\n    modules = []\n    module_map = {}\n    for command in commands:\n        if command['type'] == 'module':\n            pair = (command, [])\n            modules.append(pair)\n            module_name = command.get('name')\n            if module_name:\n                module_map[module_name] = pair\n        elif command['type'] in ('assert_return', 'assert_trap',\n                                 'assert_exhaustion'):\n            if IsValidJSCommand(command):\n                continue\n\n            action = command['action']\n            module_name = action.get('module')\n            if module_name:\n                pair = module_map[module_name]\n            else:\n                pair = modules[-1]\n            pair[1].append(command)\n    return modules\n\n\nclass ModuleExtender(object):\n\n    def __init__(self, wat2wasm, wasm2wat, temp_dir):\n        self.wat2wasm = wat2wasm\n        self.wasm2wat = wasm2wat\n        self.temp_dir = temp_dir\n        self.lines = []\n        self.exports = {}\n\n    def Extend(self, wasm_path, commands):\n        wat_path = self._RunWasm2Wat(wasm_path)\n        with open(wat_path) as wat_file:\n            wat = wat_file.read()\n\n        self.lines = []\n        self.exports = self._GetExports(wat)\n        for i, command in enumerate(commands):\n            self._Command(i, command)\n\n        wat = wat[:wat.rindex(')')] + '\\n\\n'\n        wat += '\\n'.join(self.lines) + ')'\n        # print wat\n        with open(wat_path, 'w') as wat_file:\n            wat_file.write(wat)\n        return self._RunWat2Wasm(wat_path)\n\n    def _Command(self, index, command):\n        command_type = command['type']\n        new_field = 'assert_%d' % index\n        if command_type == 'assert_return':\n            self.lines.append('(func (export \"%s\")' % new_field)\n            self.lines.append('block')\n            self._Action(command['action'])\n            for expected in command['expected']:\n                self._Reinterpret(expected['type'])\n                if expected['value'] in ('nan:canonical', 'nan:arithmetic'):\n                    self._NanBitmask(expected['value'] == 'nan:canonical', expected['type'])\n                    self._And(expected['type'])\n                    self._QuietNan(expected['type'])\n                else:\n                    self._Constant(expected)\n                    self._Reinterpret(expected['type'])\n                self._Eq(expected['type'])\n                self.lines.extend(['i32.eqz', 'br_if 0'])\n            self.lines.extend(['return', 'end', 'unreachable', ')'])\n        elif command_type in ('assert_trap', 'assert_exhaustion'):\n            self.lines.append('(func (export \"%s\")' % new_field)\n            self._Action(command['action'])\n            self.lines.extend(['br 0', ')'])\n        else:\n            raise Error('Unexpected command: %s' % command_type)\n\n        # Update command to point to the new exported function.\n        command['action']['field'] = new_field\n        command['action']['args'] = []\n        command['expected'] = []\n\n    def _GetExports(self, wat):\n        result = {}\n        pattern = r'^\\s*\\(export \\\"(.*?)\\\"\\s*\\((\\w+) (\\d+)'\n        for name, type_, index in re.findall(pattern, wat, re.MULTILINE):\n            result[UnescapeWasmString(name)] = (type_, index)\n        return result\n\n    def _Action(self, action):\n        export = self.exports[action['field']]\n        if action['type'] == 'invoke':\n            for arg in action['args']:\n                self._Constant(arg)\n            self.lines.append('call %s' % export[1])\n        elif action['type'] == 'get':\n            self.lines.append('global.get %s' % export[1])\n        else:\n            raise Error('Unexpected action: %s' % action['type'])\n\n    def _Reinterpret(self, type_):\n        self.lines.extend({\n            'i32': [],\n            'i64': [],\n            'f32': ['i32.reinterpret_f32'],\n            'f64': ['i64.reinterpret_f64']\n        }[type_])\n\n    def _Eq(self, type_):\n        self.lines.append({\n            'i32': 'i32.eq',\n            'i64': 'i64.eq',\n            'f32': 'i32.eq',\n            'f64': 'i64.eq'\n        }[type_])\n\n    def _And(self, type_):\n        self.lines.append({\n            'i32': 'i32.and',\n            'i64': 'i64.and',\n            'f32': 'i32.and',\n            'f64': 'i64.and'\n        }[type_])\n\n    def _NanBitmask(self, canonical, type_):\n        # When checking for canonical NaNs, the value can differ only in the sign\n        # bit from +nan. For arithmetic NaNs, the sign bit and the rest of the tag\n        # can differ as well.\n        assert type_ in ('f32', 'f64')\n        if not canonical:\n            return self._QuietNan(type_)\n\n        if type_ == 'f32':\n            line = 'i32.const 0x7fffffff'\n        else:\n            line = 'i64.const 0x7fffffffffffffff'\n        self.lines.append(line)\n\n    def _QuietNan(self, type_):\n        assert type_ in ('f32', 'f64')\n        if type_ == 'f32':\n            line = 'i32.const 0x%x' % F32_QUIET_NAN\n        else:\n            line = 'i64.const 0x%x' % F64_QUIET_NAN\n        self.lines.append(line)\n\n    def _Constant(self, const):\n        inst = None\n        type_ = const['type']\n        value = const['value']\n        assert value not in ('nan:canonical', 'nan:arithmetic')\n        if type_ == 'i32':\n            inst = 'i32.const %s' % value\n        elif type_ == 'i64':\n            inst = 'i64.const %s' % value\n        elif type_ == 'f32':\n            inst = F32ToWasm(int(value))\n        elif type_ == 'f64':\n            inst = F64ToWasm(int(value))\n        self.lines.append(inst)\n\n    def _RunWasm2Wat(self, wasm_path):\n        wat_path = ChangeDir(ChangeExt(wasm_path, '.wat'), self.temp_dir)\n        self.wasm2wat.RunWithArgs(wasm_path, '-o', wat_path)\n        return wat_path\n\n    def _RunWat2Wasm(self, wat_path):\n        wasm_path = ChangeDir(ChangeExt(wat_path, '.wasm'), self.temp_dir)\n        self.wat2wasm.RunWithArgs(wat_path, '-o', wasm_path)\n        return wasm_path\n\n\nclass JSWriter(object):\n\n    def __init__(self, base_dir, spec_json, out_file):\n        self.base_dir = base_dir\n        self.source_filename = os.path.basename(spec_json['source_filename'])\n        self.commands = spec_json['commands']\n        self.out_file = out_file\n        self.module_idx = 0\n\n    def Write(self):\n        for command in self.commands:\n            self._WriteCommand(command)\n\n    def _WriteFileAndLine(self, command):\n        self.out_file.write('// %s:%d\\n' % (self.source_filename, command['line']))\n\n    def _WriteCommand(self, command):\n        command_funcs = {\n            'module': self._WriteModuleCommand,\n            'action': self._WriteActionCommand,\n            'register': self._WriteRegisterCommand,\n            'assert_malformed': self._WriteAssertModuleCommand,\n            'assert_invalid': self._WriteAssertModuleCommand,\n            'assert_unlinkable': self._WriteAssertModuleCommand,\n            'assert_uninstantiable': self._WriteAssertModuleCommand,\n            'assert_return': self._WriteAssertReturnCommand,\n            'assert_trap': self._WriteAssertActionCommand,\n            'assert_exhaustion': self._WriteAssertActionCommand,\n        }\n\n        func = command_funcs.get(command['type'])\n        if func is None:\n            raise Error('Unexpected type: %s' % command['type'])\n        self._WriteFileAndLine(command)\n        func(command)\n        self.out_file.write('\\n')\n\n    def _ModuleIdxName(self):\n        return '$%d' % self.module_idx\n\n    def _WriteModuleCommand(self, command):\n        self.module_idx += 1\n        idx_name = self._ModuleIdxName()\n\n        self.out_file.write('let %s = instance(\"%s\");\\n' %\n                            (idx_name, self._Module(command['filename'])))\n        if 'name' in command:\n            self.out_file.write('let %s = %s;\\n' % (command['name'], idx_name))\n\n    def _WriteActionCommand(self, command):\n        self.out_file.write('%s;\\n' % self._Action(command['action']))\n\n    def _WriteRegisterCommand(self, command):\n        self.out_file.write('register(\"%s\", %s)\\n' % (\n            command['as'], command.get('name', self._ModuleIdxName())))\n\n    def _WriteAssertModuleCommand(self, command):\n        # Don't bother writing out text modules; they can't be parsed by JS.\n        if command['module_type'] == 'binary':\n            self.out_file.write('%s(\"%s\");\\n' % (command['type'],\n                                self._Module(command['filename'])))\n\n    def _WriteAssertReturnCommand(self, command):\n        expected = command['expected']\n        if len(expected) == 1:\n            self.out_file.write('assert_return(() => %s, %s);\\n' %\n                                (self._Action(command['action']),\n                                 self._ConstantList(expected)))\n        elif len(expected) == 0:\n            self._WriteAssertActionCommand(command)\n        else:\n            raise Error('Unexpected result with multiple values: %s' % expected)\n\n    def _WriteAssertActionCommand(self, command):\n        self.out_file.write('%s(() => %s);\\n' % (command['type'],\n                            self._Action(command['action'])))\n\n    def _Module(self, filename):\n        with open(os.path.join(self.base_dir, filename), 'rb') as wasm_file:\n            return ''.join('\\\\x%02x' % c for c in bytearray(wasm_file.read()))\n\n    def _Constant(self, const):\n        assert IsValidJSConstant(const), 'Invalid JS const: %s' % const\n        type_ = const['type']\n        value = const['value']\n        if type_ in ('f32', 'f64') and value in ('nan:canonical', 'nan:arithmetic'):\n            return value\n        if type_ == 'i32':\n            return I32ToJS(int(value))\n        elif type_ == 'f32':\n            return F32ToJS(int(value))\n        elif type_ == 'f64':\n            return F64ToJS(int(value))\n        else:\n            assert False\n\n    def _ConstantList(self, consts):\n        return ', '.join(self._Constant(const) for const in consts)\n\n    def _Action(self, action):\n        type_ = action['type']\n        module = action.get('module', self._ModuleIdxName())\n        field = EscapeJSString(action['field'])\n        if type_ == 'invoke':\n            args = '[%s]' % self._ConstantList(action.get('args', []))\n            return 'call(%s, \"%s\", %s)' % (module, field, args)\n        elif type_ == 'get':\n            return 'get(%s, \"%s\")' % (module, field)\n        else:\n            raise Error('Unexpected action type: %s' % type_)\n\n\ndef main(args):\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument('-o', '--output', metavar='PATH', help='output file.')\n    parser.add_argument('-P', '--prefix', metavar='PATH', help='prefix file.',\n                        default=os.path.join(SCRIPT_DIR, 'gen-spec-prefix.js'))\n    parser.add_argument('--bindir', metavar='PATH',\n                        default=find_exe.GetDefaultPath(),\n                        help='directory to search for all executables.')\n    parser.add_argument('--temp-dir', metavar='PATH',\n                        help='set the directory that temporary wasm/wat'\n                        ' files are written.')\n    parser.add_argument('--no-error-cmdline',\n                        help='don\\'t display the subprocess\\'s commandline when'\n                        ' an error occurs', dest='error_cmdline',\n                        action='store_false')\n    parser.add_argument('-p', '--print-cmd',\n                        help='print the commands that are run.',\n                        action='store_true')\n    parser.add_argument('file', help='spec json file.')\n    options = parser.parse_args(args)\n\n    wat2wasm = Executable(\n        find_exe.GetWat2WasmExecutable(options.bindir),\n        error_cmdline=options.error_cmdline)\n    wasm2wat = Executable(\n        find_exe.GetWasm2WatExecutable(options.bindir),\n        error_cmdline=options.error_cmdline)\n\n    wat2wasm.verbose = options.print_cmd\n    wasm2wat.verbose = options.print_cmd\n\n    with open(options.file) as json_file:\n        json_dir = os.path.dirname(options.file)\n        spec_json = json.load(json_file)\n        all_commands = spec_json['commands']\n\n    # modules is a list of pairs: [(module_command, [assert_command, ...]), ...]\n    modules = CollectInvalidModuleCommands(all_commands)\n\n    with utils.TempDirectory(options.temp_dir, 'gen-spec-js-') as temp_dir:\n        extender = ModuleExtender(wat2wasm, wasm2wat, temp_dir)\n        for module_command, assert_commands in modules:\n            if assert_commands:\n                wasm_path = os.path.join(json_dir, module_command['filename'])\n                new_module_filename = extender.Extend(wasm_path, assert_commands)\n                module_command['filename'] = new_module_filename\n\n        output = io.StringIO()\n        if options.prefix:\n            with open(options.prefix) as prefix_file:\n                output.write(prefix_file.read())\n                output.write('\\n')\n\n        JSWriter(json_dir, spec_json, output).Write()\n\n    if options.output:\n        out_file = open(options.output, 'w')\n    else:\n        out_file = sys.stdout\n\n    try:\n        out_file.write(output.getvalue())\n    finally:\n        out_file.close()\n\n    return 0\n\n\nif __name__ == '__main__':\n    try:\n        sys.exit(main(sys.argv[1:]))\n    except Error as e:\n        sys.stderr.write(str(e) + '\\n')\n        sys.exit(1)\n"
  },
  {
    "path": "test/gen-spec-prefix.js",
    "content": "/* Lovingly generated by gen-spec-js.py based on the wonderful content of *\n * https://github.com/WebAssembly/spec/blob/master/interpreter/script/js.ml */\n'use strict';\n\nlet spectest = {\n  print: print || ((...xs) => console.log(...xs)),\n  global: 666,\n  table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'funcref'}),\n  memory: new WebAssembly.Memory({initial: 1, maximum: 2}),};\n\nlet registry = {spectest};\n\nfunction register(name, instance) {\n  registry[name] = instance.exports;\n}\n\nfunction module(bytes, valid = true) {\n  let buffer = new ArrayBuffer(bytes.length);\n  let view = new Uint8Array(buffer);\n  for (let i = 0; i < bytes.length; ++i) {\n    view[i] = bytes.charCodeAt(i);\n  }\n  let validated;\n  try {\n    validated = WebAssembly.validate(buffer);\n  } catch (e) {\n    throw new Error(\"Wasm validate throws\");\n  }\n  if (validated !== valid) {\n    throw new Error(\"Wasm validate failure\" + (valid ? \"\" : \" expected\"));\n  }\n  return new WebAssembly.Module(buffer);\n}\n\nfunction instance(bytes, imports = registry) {\n  return new WebAssembly.Instance(module(bytes), imports);\n}\n\nfunction instance(bytes, imports = registry) {\n  return new WebAssembly.Instance(module(bytes), imports);\n}\n\nfunction call(instance, name, args) {\n  return instance.exports[name](...args);\n}\n\nfunction get(instance, name) {\n  return instance.exports[name];\n}\n\nfunction exports(name, instance) {\n  return {[name]: instance.exports};\n}\n\nfunction run(action) {\n  action();\n}\n\nfunction assert_malformed(bytes) {\n  try { module(bytes, false) } catch (e) {\n    if (e instanceof WebAssembly.CompileError) return;\n  }\n  throw new Error(\"Wasm decoding failure expected\");\n}\n\nfunction assert_invalid(bytes) {\n  try { module(bytes, false) } catch (e) {\n    if (e instanceof WebAssembly.CompileError) return;\n  }\n  throw new Error(\"Wasm validation failure expected\");\n}\n\nfunction assert_unlinkable(bytes) {\n  let mod = module(bytes);\n  try { new WebAssembly.Instance(mod, registry) } catch (e) {\n    if (e instanceof WebAssembly.LinkError) return;\n  }\n  throw new Error(\"Wasm linking failure expected\");\n}\n\nfunction assert_uninstantiable(bytes) {\n  let mod = module(bytes);\n  try { new WebAssembly.Instance(mod, registry) } catch (e) {\n    if (e instanceof WebAssembly.RuntimeError) return;\n  }\n  throw new Error(\"Wasm trap expected\");\n}\n\nfunction assert_trap(action) {\n  try { action() } catch (e) {\n    if (e instanceof WebAssembly.RuntimeError) return;\n  }\n  throw new Error(\"Wasm trap expected\");\n}\n\nlet StackOverflow;\ntry { (function f() { 1 + f() })() } catch (e) { StackOverflow = e.constructor }\n\nfunction assert_exhaustion(action) {\n  try { action() } catch (e) {\n    if (e instanceof StackOverflow) return;\n  }\n  throw new Error(\"Wasm resource exhaustion expected\");\n}\n\nfunction assert_return(action, expected) {\n  let actual = action();\n  if (!Object.is(actual, expected)) {\n    throw new Error(\"Wasm return value \" + expected + \" expected, got \" + actual);\n  };\n}\n\nfunction assert_return_canonical_nan(action) {\n  let actual = action();\n  // Note that JS can't reliably distinguish different NaN values,\n  // so there's no good way to test that it's a canonical NaN.\n  if (!Number.isNaN(actual)) {\n    throw new Error(\"Wasm return value NaN expected, got \" + actual);\n  };\n}\n\nfunction assert_return_arithmetic_nan(action) {\n  // Note that JS can't reliably distinguish different NaN values,\n  // so there's no good way to test for specific bitpatterns here.\n  let actual = action();\n  if (!Number.isNaN(actual)) {\n    throw new Error(\"Wasm return value NaN expected, got \" + actual);\n  };\n}\n\nlet f32 = Math.fround;\n"
  },
  {
    "path": "test/gen-spec-wast.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2020 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport argparse\nimport json\nimport io\nimport os\nimport struct\nimport sys\n\nimport find_exe\nfrom utils import ChangeDir, Error, Executable\nimport utils\n\nF32_INF = 0x7f800000\nF32_NEG_INF = 0xff800000\nF32_NEG_ZERO = 0x80000000\nF32_SIGN_BIT = F32_NEG_ZERO\nF32_SIG_MASK = 0x7fffff\nF32_QUIET_NAN_TAG = 0x400000\nF64_INF = 0x7ff0000000000000\nF64_NEG_INF = 0xfff0000000000000\nF64_NEG_ZERO = 0x8000000000000000\nF64_SIGN_BIT = F64_NEG_ZERO\nF64_SIG_MASK = 0xfffffffffffff\nF64_QUIET_NAN_TAG = 0x8000000000000\n\n\ndef EscapeWasmString(s):\n    result = ''\n    for c in s:\n        if c == 34:\n            result += '\\\\\"'\n        elif c == 92:\n            result += '\\\\\\\\'\n        elif 32 <= c < 127:\n            result += chr(c)\n        else:\n            result += '\\\\%02x' % c\n    return result\n\n\ndef IsNaNF32(f32_bits):\n    return (F32_INF < f32_bits < F32_NEG_ZERO) or (f32_bits > F32_NEG_INF)\n\n\ndef ReinterpretF32(f32_bits):\n    return struct.unpack('<f', struct.pack('<I', f32_bits))[0]\n\n\ndef NaNF32ToString(f32_bits):\n    result = '-' if f32_bits & F32_SIGN_BIT else ''\n    result += 'nan'\n    sig = f32_bits & F32_SIG_MASK\n    if sig != F32_QUIET_NAN_TAG:\n        result += ':0x%x' % sig\n    return result\n\n\ndef F32ToWasm(f32_bits):\n    if IsNaNF32(f32_bits):\n        return 'f32.const %s' % NaNF32ToString(f32_bits)\n    elif f32_bits == F32_INF:\n        return 'f32.const infinity'\n    elif f32_bits == F32_NEG_INF:\n        return 'f32.const -infinity'\n    else:\n        return 'f32.const %s' % float.hex(ReinterpretF32(f32_bits))\n\n\ndef IsNaNF64(f64_bits):\n    return (F64_INF < f64_bits < F64_NEG_ZERO) or (f64_bits > F64_NEG_INF)\n\n\ndef ReinterpretF64(f64_bits):\n    return struct.unpack('<d', struct.pack('<Q', f64_bits))[0]\n\n\ndef NaNF64ToString(f64_bits):\n    result = '-' if f64_bits & F64_SIGN_BIT else ''\n    result += 'nan'\n    sig = f64_bits & F64_SIG_MASK\n    if sig != F64_QUIET_NAN_TAG:\n        result += ':0x%x' % sig\n    return result\n\n\ndef F64ToWasm(f64_bits):\n    if IsNaNF64(f64_bits):\n        return 'f64.const %s' % NaNF64ToString(f64_bits)\n    elif f64_bits == F64_INF:\n        return 'f64.const infinity'\n    elif f64_bits == F64_NEG_INF:\n        return 'f64.const -infinity'\n    else:\n        return 'f64.const %s' % float.hex(ReinterpretF64(f64_bits))\n\n\nclass WastWriter(object):\n\n    def __init__(self, base_dir, spec_json, out_file):\n        self.base_dir = base_dir\n        self.source_filename = os.path.basename(spec_json['source_filename'])\n        self.commands = spec_json['commands']\n        self.out_file = out_file\n        self.module_idx = 0\n\n    def Write(self):\n        for command in self.commands:\n            self._WriteCommand(command)\n\n    def _WriteFileAndLine(self, command):\n        self.out_file.write(';; %s:%d\\n' % (self.source_filename, command['line']))\n\n    def _WriteCommand(self, command):\n        command_funcs = {\n            'module': self._WriteModuleCommand,\n            'action': self._WriteActionCommand,\n            'register': self._WriteRegisterCommand,\n            'assert_malformed': self._WriteAssertModuleCommand,\n            'assert_invalid': self._WriteAssertModuleCommand,\n            'assert_unlinkable': self._WriteAssertModuleCommand,\n            'assert_uninstantiable': self._WriteAssertModuleCommand,\n            'assert_return': self._WriteAssertReturnCommand,\n            'assert_trap': self._WriteAssertActionCommand,\n            'assert_exhaustion': self._WriteAssertActionCommand,\n            'assert_exception': self._WriteAssertActionCommand,\n        }\n\n        func = command_funcs.get(command['type'])\n        if func is None:\n            raise Error('Unexpected type: %s' % command['type'])\n        self._WriteFileAndLine(command)\n        func(command)\n        self.out_file.write('\\n')\n\n    def _WriteModuleCommand(self, command):\n        self.out_file.write('(module %s binary \\\"%s\\\")\\n' % (\n            command.get('name', ''), self._Binary(command['filename'])))\n\n    def _WriteActionCommand(self, command):\n        self.out_file.write('(action %s)\\n' % self._Action(command['action']))\n\n    def _WriteRegisterCommand(self, command):\n        self.out_file.write('(register \"%s\" %s)\\n' % (\n            command['as'], command.get('name', '')))\n\n    def _WriteAssertModuleCommand(self, command):\n        if command['module_type'] == 'binary':\n            self.out_file.write('(%s (module binary \"%s\") \"%s\")\\n' % (\n                command['type'], self._Binary(command['filename']), command['text']))\n        elif command['module_type'] == 'text':\n            self.out_file.write('(%s (module quote \"%s\") \"%s\")\\n' % (\n                command['type'], self._Text(command['filename']), command['text']))\n        else:\n            raise Error('Unknown module type: %s' % command['module_type'])\n\n    def _WriteAssertReturnCommand(self, command):\n        expected = command['expected']\n        self.out_file.write('(assert_return %s%s)\\n' % (\n            self._Action(command['action']), self._ConstantList(expected)))\n\n    def _WriteAssertActionCommand(self, command):\n        self.out_file.write('(%s %s)\\n' % (\n            command['type'], self._Action(command['action'])))\n\n    def _Binary(self, filename):\n        with open(os.path.join(self.base_dir, filename), 'rb') as wasm_file:\n            return ''.join('\\\\%02x' % c for c in wasm_file.read())\n\n    def _Text(self, filename):\n        with open(os.path.join(self.base_dir, filename), 'rb') as wasm_file:\n            return '%s' % EscapeWasmString(wasm_file.read())\n\n    def _Constant(self, const):\n        type_ = const['type']\n        value = const['value']\n        if type_ in ('f32', 'f64') and value in ('nan:canonical', 'nan:arithmetic'):\n            return value\n        if type_ == 'i32':\n            return 'i32.const %s' % value\n        elif type_ == 'i64':\n            return 'i64.const %s' % value\n        elif type_ == 'f32':\n            return F32ToWasm(int(value))\n        elif type_ == 'f64':\n            return F64ToWasm(int(value))\n        elif type_ == 'externref':\n            return 'ref.extern %s' % value\n        elif type_ == 'funcref':\n            return 'ref.func %s' % value\n        else:\n            raise Error('Unknown type: %s' % type_)\n\n    def _ConstantList(self, consts):\n        if consts:\n            return ' ' + (' '.join('(%s)' % self._Constant(const) for const in consts))\n        return ''\n\n    def _Action(self, action):\n        type_ = action['type']\n        module = action.get('module', '')\n        field = action['field']\n        if type_ == 'invoke':\n            args = self._ConstantList(action.get('args', []))\n            return '(invoke %s \"%s\"%s)' % (module, field, args)\n        elif type_ == 'get':\n            return '(get %s \"%s\")' % (module, field)\n        else:\n            raise Error('Unexpected action type: %s' % type_)\n\n\ndef main(args):\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument('-o', '--output', metavar='PATH', help='output file.')\n    parser.add_argument('file', help='spec json file.')\n    parser.add_argument('--bindir', metavar='PATH',\n                        default=find_exe.GetDefaultPath(),\n                        help='directory to search for all executables.')\n    parser.add_argument('--temp-dir', metavar='PATH',\n                        help='set the directory that temporary wasm/wat'\n                        ' files are written.')\n    parser.add_argument('--no-error-cmdline',\n                        help='don\\'t display the subprocess\\'s commandline when'\n                        ' an error occurs', dest='error_cmdline',\n                        action='store_false')\n    parser.add_argument('-p', '--print-cmd',\n                        help='print the commands that are run.',\n                        action='store_true')\n    parser.add_argument('--enable-exceptions', action='store_true')\n    parser.add_argument('--enable-saturating-float-to-int', action='store_true')\n    parser.add_argument('--enable-threads', action='store_true')\n    parser.add_argument('--enable-sign-extension', action='store_true')\n    parser.add_argument('--enable-multi-value', action='store_true')\n    parser.add_argument('--enable-tail-call', action='store_true')\n    parser.add_argument('--disable-reference-types', action='store_true')\n    parser.add_argument('--enable-memory64', action='store_true')\n    options = parser.parse_args(args)\n\n    wast2json = Executable(\n        find_exe.GetWast2JsonExecutable(options.bindir),\n        error_cmdline=options.error_cmdline)\n    wast2json.verbose = options.print_cmd\n    wast2json.AppendOptionalArgs({\n        '--enable-exceptions': options.enable_exceptions,\n        '--enable-multi-value': options.enable_multi_value,\n        '--enable-saturating-float-to-int':\n            options.enable_saturating_float_to_int,\n        '--enable-sign-extension': options.enable_sign_extension,\n        '--enable-threads': options.enable_threads,\n        '--enable-tail-call': options.enable_tail_call,\n        '--disable-reference-types': options.disable_reference_types,\n        '--enable-memory64': options.enable_memory64,\n    })\n\n    json_filename = options.file\n\n    with utils.TempDirectory(options.temp_dir, 'gen-spec-wast-') as temp_dir:\n        file_base, file_ext = os.path.splitext(json_filename)\n        if file_ext == '.wast':\n            wast_filename = options.file\n            json_filename = ChangeDir(file_base + '.json', temp_dir)\n            wast2json.RunWithArgs(wast_filename, '-o', json_filename)\n\n        with open(json_filename) as json_file:\n            json_dir = os.path.dirname(json_filename)\n            spec_json = json.load(json_file)\n\n        output = io.StringIO()\n        WastWriter(json_dir, spec_json, output).Write()\n\n    if options.output:\n        out_file = open(options.output, 'w')\n    else:\n        out_file = sys.stdout\n\n    try:\n        out_file.write(output.getvalue())\n    finally:\n        out_file.close()\n\n    return 0\n\n\nif __name__ == '__main__':\n    try:\n        sys.exit(main(sys.argv[1:]))\n    except Error as e:\n        sys.stderr.write(str(e) + '\\n')\n        sys.exit(1)\n"
  },
  {
    "path": "test/gen-wasm.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport argparse\nimport os\nimport struct\nimport sys\n\nfrom utils import Error, Hexdump\n\nSCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = os.path.dirname(SCRIPT_DIR)\nOUT_DIR = os.path.join(ROOT_DIR, 'out')\nPLY_DIR = os.path.join(ROOT_DIR, 'third_party', 'ply')\n\nsys.path.append(PLY_DIR)\n\ntry:\n    import ply.lex as lex\n    import ply.yacc as yacc\nexcept ImportError:\n    raise Error('Unable to import ply. Did you run \"git submodule update\"?')\n\n# ply stuff ###################################################################\nNAMED_VALUES = {\n    'i32': 0x7f,    # -1\n    'i64': 0x7e,    # -2\n    'f32': 0x7d,    # -3\n    'f64': 0x7c,    # -4\n    'v128': 0x7b,    # -5\n    'funcref': 0x70,    # -0x10\n    'reference': 0x6b,    # -0x15\n    'function': 0x60,    # -0x20\n    'struct': 0x5f,    # -0x21\n    'array': 0x5e,    # -0x22\n    'void': 0x40,    # -0x40\n    'magic': (0, 0x61, 0x73, 0x6d),\n    'version': (1, 0, 0, 0),\n\n    # section codes\n    'USER': 0,\n    'TYPE': 1,\n    'IMPORT': 2,\n    'FUNCTION': 3,\n    'TABLE': 4,\n    'MEMORY': 5,\n    'GLOBAL': 6,\n    'EXPORT': 7,\n    'START': 8,\n    'ELEM': 9,\n    'CODE': 10,\n    'DATA': 11,\n    'DATACOUNT': 12,\n    'TAG': 13,\n\n    # name subsection codes\n    'NAME_MODULE': 0,\n    'NAME_FUNCTION': 1,\n    'NAME_LOCALS': 2,\n\n    # linking subsection codes\n    'LINKING_SEGMENT_INFO': 5,\n    'LINKING_INIT_FUNCTIONS': 6,\n    'LINKING_COMDAT_INFO': 7,\n    'LINKING_SYMBOL_TABLE': 8,\n\n    # dylink.0 subsection codes\n    'DYLINK_MEM_INFO': 1,\n    'DYLINK_NEEDED': 2,\n    'DYLINK_EXPORT_INFO': 3,\n    'DYLINK_IMPORT_INFO': 4,\n\n    # external kinds\n    'func_kind': 0,\n    'table_kind': 1,\n    'memory_kind': 2,\n    'global_kind': 3,\n    \"unreachable\": 0x00,\n    \"nop\": 0x01,\n    \"block\": 0x02,\n    \"loop\": 0x03,\n    \"if\": 0x04,\n    \"else\": 0x05,\n    \"end\": 0x0b,\n    \"br\": 0x0c,\n    \"br_if\": 0x0d,\n    \"br_table\": 0x0e,\n    \"return\": 0x0f,\n    \"call\": 0x10,\n    \"call_indirect\": 0x11,\n    \"return_call\": 0x12,\n    \"return_call_indirect\": 0x13,\n    \"drop\": 0x1a,\n    \"select\": 0x1b,\n    \"local.get\": 0x20,\n    \"local.set\": 0x21,\n    \"local.tee\": 0x22,\n    \"global.get\": 0x23,\n    \"global.set\": 0x24,\n    \"i32.load\": 0x28,\n    \"i64.load\": 0x29,\n    \"f32.load\": 0x2a,\n    \"f64.load\": 0x2b,\n    \"i32.load8_s\": 0x2c,\n    \"i32.load8_u\": 0x2d,\n    \"i32.load16_s\": 0x2e,\n    \"i32.load16_u\": 0x2f,\n    \"i64.load8_s\": 0x30,\n    \"i64.load8_u\": 0x31,\n    \"i64.load16_s\": 0x32,\n    \"i64.load16_u\": 0x33,\n    \"i64.load32_s\": 0x34,\n    \"i64.load32_u\": 0x35,\n    \"i32.store\": 0x36,\n    \"i64.store\": 0x37,\n    \"f32.store\": 0x38,\n    \"f64.store\": 0x39,\n    \"i32.store8\": 0x3a,\n    \"i32.store16\": 0x3b,\n    \"i64.store8\": 0x3c,\n    \"i64.store16\": 0x3d,\n    \"i64.store32\": 0x3e,\n    \"memory.size\": 0x3f,\n    \"memory.grow\": 0x40,\n    \"i32.const\": 0x41,\n    \"i64.const\": 0x42,\n    \"f32.const\": 0x43,\n    \"f64.const\": 0x44,\n    \"i32.eqz\": 0x45,\n    \"i32.eq\": 0x46,\n    \"i32.ne\": 0x47,\n    \"i32.lt_s\": 0x48,\n    \"i32.lt_u\": 0x49,\n    \"i32.gt_s\": 0x4a,\n    \"i32.gt_u\": 0x4b,\n    \"i32.le_s\": 0x4c,\n    \"i32.le_u\": 0x4d,\n    \"i32.ge_s\": 0x4e,\n    \"i32.ge_u\": 0x4f,\n    'i64.eqz': 0x50,\n    \"i64.eq\": 0x51,\n    \"i64.ne\": 0x52,\n    \"i64.lt_s\": 0x53,\n    \"i64.lt_u\": 0x54,\n    \"i64.gt_s\": 0x55,\n    \"i64.gt_u\": 0x56,\n    \"i64.le_s\": 0x57,\n    \"i64.le_u\": 0x58,\n    \"i64.ge_s\": 0x59,\n    \"i64.ge_u\": 0x5a,\n    \"f32.eq\": 0x5b,\n    \"f32.ne\": 0x5c,\n    \"f32.lt\": 0x5d,\n    \"f32.gt\": 0x5e,\n    \"f32.le\": 0x5f,\n    \"f32.ge\": 0x60,\n    \"f64.eq\": 0x61,\n    \"f64.ne\": 0x62,\n    \"f64.lt\": 0x63,\n    \"f64.gt\": 0x64,\n    \"f64.le\": 0x65,\n    \"f64.ge\": 0x66,\n    \"i32.clz\": 0x67,\n    \"i32.ctz\": 0x68,\n    \"i32.popcnt\": 0x69,\n    \"i32.add\": 0x6a,\n    \"i32.sub\": 0x6b,\n    \"i32.mul\": 0x6c,\n    \"i32.div_s\": 0x6d,\n    \"i32.div_u\": 0x6e,\n    \"i32.rem_s\": 0x6f,\n    \"i32.rem_u\": 0x70,\n    \"i32.and\": 0x71,\n    \"i32.or\": 0x72,\n    \"i32.xor\": 0x73,\n    \"i32.shl\": 0x74,\n    \"i32.shr_s\": 0x75,\n    \"i32.shr_u\": 0x76,\n    \"i32.rotl\": 0x77,\n    \"i32.rotr\": 0x78,\n    \"i64.clz\": 0x79,\n    \"i64.ctz\": 0x7a,\n    \"i64.popcnt\": 0x7b,\n    \"i64.add\": 0x7c,\n    \"i64.sub\": 0x7d,\n    \"i64.mul\": 0x7e,\n    \"i64.div_s\": 0x7f,\n    \"i64.div_u\": 0x80,\n    \"i64.rem_s\": 0x81,\n    \"i64.rem_u\": 0x82,\n    \"i64.and\": 0x83,\n    \"i64.or\": 0x84,\n    \"i64.xor\": 0x85,\n    \"i64.shl\": 0x86,\n    \"i64.shr_s\": 0x87,\n    \"i64.shr_u\": 0x88,\n    \"i64.rotl\": 0x89,\n    \"i64.rotr\": 0x8a,\n    \"f32.abs\": 0x8b,\n    \"f32.neg\": 0x8c,\n    \"f32.copysign\": 0x8d,\n    \"f32.ceil\": 0x8e,\n    \"f32.floor\": 0x8f,\n    \"f32.trunc\": 0x90,\n    \"f32.nearest\": 0x91,\n    \"f32.sqrt\": 0x92,\n    \"f32.add\": 0x93,\n    \"f32.sub\": 0x94,\n    \"f32.mul\": 0x95,\n    \"f32.div\": 0x96,\n    \"f32.min\": 0x97,\n    \"f32.max\": 0x98,\n    \"f64.abs\": 0x99,\n    \"f64.neg\": 0x9a,\n    \"f64.copysign\": 0x9b,\n    \"f64.ceil\": 0x9c,\n    \"f64.floor\": 0x9d,\n    \"f64.trunc\": 0x9e,\n    \"f64.nearest\": 0x9f,\n    \"f64.sqrt\": 0xa0,\n    \"f64.add\": 0xa1,\n    \"f64.sub\": 0xa2,\n    \"f64.mul\": 0xa3,\n    \"f64.div\": 0xa4,\n    \"f64.min\": 0xa5,\n    \"f64.max\": 0xa6,\n    \"i32.wrap_i64\": 0xa7,\n    \"i32.trunc_f32_s\": 0xa8,\n    \"i32.trunc_f32_u\": 0xa9,\n    \"i32.trunc_f64_s\": 0xaa,\n    \"i32.trunc_f64_u\": 0xab,\n    \"i64.extend_i32_s\": 0xac,\n    \"i64.extend_i32_u\": 0xad,\n    \"i64.trunc_f32_s\": 0xae,\n    \"i64.trunc_f32_u\": 0xaf,\n    \"i64.trunc_f64_s\": 0xb0,\n    \"i64.trunc_f64_u\": 0xb1,\n    \"f32.convert_i32_s\": 0xb2,\n    \"f32.convert_i32_u\": 0xb3,\n    \"f32.convert_i64_s\": 0xb4,\n    \"f32.convert_i64_u\": 0xb5,\n    \"f32.demote_f64\": 0xb6,\n    \"f64.convert_i32_s\": 0xb7,\n    \"f64.convert_i32_u\": 0xb8,\n    \"f64.convert_i64_s\": 0xb9,\n    \"f64.convert_i64_u\": 0xba,\n    \"f64.promote_f32\": 0xbb,\n    \"i32.reinterpret_f32\": 0xbc,\n    \"i64.reinterpret_f64\": 0xbd,\n    \"f32.reinterpret_i32\": 0xbe,\n    \"f64.reinterpret_i64\": 0xbf,\n\n    # bulk memory\n    \"memory.init\": (0xfc, 0x08),\n    \"data.drop\": (0xfc, 0x09),\n    \"memory.copy\": (0xfc, 0x0a),\n    \"memory.fill\": (0xfc, 0x0b),\n    \"table.init\": (0xfc, 0x0c),\n    \"elem.drop\": (0xfc, 0x0d),\n    \"table.copy\": (0xfc, 0x0e),\n\n    # exceptions\n    \"try\": 0x06,\n    \"catch_all\": 0x19,\n}\n\nkeywords = {\n    'func': 'FUNC',\n    'section': 'SECTION',\n    'leb_i32': 'LEB_I32',\n    'leb_i64': 'LEB_I64',\n    'leb_u32': 'LEB_U32',\n    'f32': 'F32',\n    'f64': 'F64',\n    'str': 'STR',\n}\n\n# lexer ###\n\ntokens = tuple(keywords.values()) + (\n    'BYTE',\n    'INT',\n    'FLOAT',\n    'STRING',\n    'NAME',\n    'NAMED_VALUE',\n    'LPAREN',\n    'RPAREN',\n    'LBRACE',\n    'RBRACE',\n    'LBRACKET',\n    'RBRACKET',)\n\nt_LPAREN = r'\\('\nt_RPAREN = r'\\)'\nt_LBRACE = r'{'\nt_RBRACE = r'}'\nt_LBRACKET = r'\\['\nt_RBRACKET = r'\\]'\nt_ignore = ' \\t'\n\n\ndef t_COMMENT(t):\n    r';;.*'\n    pass\n\n\ndef t_INT(t):\n    r'\\-?(0[xX][0-9a-fA-F]+|[0-9]+)'\n    if t.value.lower().startswith('0x'):\n        t.value = int(t.value, 16)\n    else:\n        t.value = int(t.value)\n\n    if 0 <= t.value < 256:\n        t.type = 'BYTE'\n    return t\n\n\ndef t_FLOAT(t):\n    r'\\-?([0-9]*\\.?[0-9]+|[0-9]+\\.?[0-9]*)([eE][0-9]+)?'\n    t.value = float(t.value)\n    return t\n\n\ndef t_STRING(t):\n    r'\\'[^\\']*\\'|\\\"[^\\\"]*\\\"'\n    t.value = t.value[1:-1]\n    return t\n\n\ndef t_NAME(t):\n    r'[a-zA-Z][a-zA-Z0-9_\\.\\/]*'\n    if t.value in NAMED_VALUES:\n        t.type = 'NAMED_VALUE'\n        t.value = NAMED_VALUES[t.value]\n    elif t.value in keywords:\n        t.type = keywords[t.value]\n    return t\n\n\ndef t_newline(t):\n    r'\\n+'\n    t.lexer.lineno += len(t.value)\n\n\ndef t_error(t):\n    print(\"Illegal character '%s'\" % t.value[0])\n    t.lexer.skip(1)\n\n\nlexer = lex.lex()\n\n# parser ###\n\n\ndef LebLoop(data, v, cond):\n    while True:\n        byte = v & 0x7f\n        v >>= 7\n        if cond(v, byte):\n            data.append(byte)\n            break\n        else:\n            data.append(byte | 0x80)\n\n\ndef WriteUnsignedLeb(data, v, max_size):\n    result = []\n    LebLoop(result, v, lambda v, byte: v == 0)\n    assert len(result) <= max_size\n    data.extend(result)\n\n\ndef WriteLebU32(data, v):\n    WriteUnsignedLeb(data, v, 5)\n\n\ndef WriteSignedLeb(data, v, max_size):\n    result = []\n    if v < 0:\n        LebLoop(result, v, lambda v, byte: v == -1 and byte & 0x40)\n    else:\n        LebLoop(result, v, lambda v, byte: v == 0 and not byte & 0x40)\n    assert len(result) <= max_size\n    data.extend(result)\n\n\ndef WriteLebI32(data, v):\n    WriteSignedLeb(data, v, 5)\n\n\ndef WriteLebI64(data, v):\n    WriteSignedLeb(data, v, 10)\n\n\ndef WriteF32(data, v):\n    data.extend(ord(b) for b in struct.pack('<f', v))\n\n\ndef WriteF64(data, v):\n    data.extend(ord(b) for b in struct.pack('<d', v))\n\n\ndef WriteString(data, s):\n    data.extend(ord(c) for c in s)\n\n\ndef p_data_byte(p):\n    'data : data BYTE'\n    p[0] = p[1]\n    p[0].append(p[2])\n\n\ndef p_data_name(p):\n    '''data : data NAME LBRACKET data RBRACKET\n          | data FUNC LBRACKET data RBRACKET'''\n    p[0] = p[1]\n    # name is only used for documentation\n    p[0].extend(p[4])\n\n\ndef p_data_named_value(p):\n    'data : data NAMED_VALUE'\n    p[0] = p[1]\n    if type(p[2]) is tuple:\n        p[0].extend(p[2])\n    else:\n        p[0].append(p[2])\n\n\ndef p_data_section(p):\n    'data : data SECTION LPAREN NAMED_VALUE RPAREN LBRACE data RBRACE'\n    p[0] = p[1]\n    section_data = p[7]\n    p[0].append(p[4])\n    WriteLebU32(p[0], len(section_data))\n    p[0].extend(section_data)\n\n\ndef p_data_user_section(p):\n    'data : data SECTION LPAREN STRING RPAREN LBRACE data RBRACE'\n    p[0] = p[1]\n    name = p[4]\n    section_data = p[7]\n    p[0].append(0)  # 0 is the section code for \"user\"\n    section_name_data = []\n    WriteLebU32(section_name_data, len(name))\n    WriteString(section_name_data, name)\n    WriteLebU32(p[0], len(section_name_data) + len(section_data))\n    p[0].extend(section_name_data)\n    p[0].extend(section_data)\n\n\ndef p_data_func(p):\n    'data : data FUNC LBRACE data RBRACE'\n    p[0] = p[1]\n    func_data = p[4]\n    func_data.append(0xb)  # end opcode\n    WriteLebU32(p[0], len(func_data))\n    p[0].extend(func_data)\n\n\ndef p_data_str(p):\n    'data : data STR LPAREN STRING RPAREN'\n    p[0] = p[1]\n    s = p[4]\n    WriteLebU32(p[0], len(s))\n    WriteString(p[0], s)\n\n\ndef p_data_leb_i32(p):\n    '''data : data LEB_I32 LPAREN INT RPAREN\n            | data LEB_I32 LPAREN BYTE RPAREN'''\n    p[0] = p[1]\n    WriteLebI32(p[0], p[4])\n\n\ndef p_data_leb_i64(p):\n    '''data : data LEB_I64 LPAREN INT RPAREN\n            | data LEB_I64 LPAREN BYTE RPAREN'''\n    p[0] = p[1]\n    WriteLebI64(p[0], p[4])\n\n\ndef p_data_leb_u32(p):\n    '''data : data LEB_U32 LPAREN INT RPAREN\n            | data LEB_U32 LPAREN BYTE RPAREN'''\n    p[0] = p[1]\n    WriteLebU32(p[0], p[4])\n\n\ndef p_data_f32(p):\n    'data : data F32 LPAREN FLOAT RPAREN'\n    p[0] = p[1]\n    WriteF32(p[0], p[4])\n\n\ndef p_data_f64(p):\n    'data : data F64 LPAREN FLOAT RPAREN'\n    p[0] = p[1]\n    WriteF64(p[0], p[4])\n\n\ndef p_data_string(p):\n    'data : data STRING'\n    p[0] = p[1]\n    WriteString(p[0], p[2])\n\n\ndef p_data_empty(p):\n    'data :'\n    p[0] = []\n\n\ndef p_error(p):\n    raise Error('%d: syntax error, %s' % (p.lineno, p))\n\n\nparser = yacc.yacc(debug=False, tabmodule='gen_wasm',\n                   debugfile='gen_wasm_debug.txt', outputdir=OUT_DIR)\n\n################################################################################\n\n\ndef Run(input_file_name):\n    with open(input_file_name) as input_file:\n        input_data = input_file.read()\n    data = parser.parse(input_data)\n    # convert to bytes\n    data = bytearray(data)\n    return data\n\n\ndef main(args):\n    arg_parser = argparse.ArgumentParser()\n    arg_parser.add_argument('-o', '--output', metavar='PATH',\n                            help='output file.')\n    arg_parser.add_argument('-v', '--verbose',\n                            help='print more diagnotic messages.',\n                            action='store_true')\n    arg_parser.add_argument('file', help='input file.')\n    options = arg_parser.parse_args(args)\n    data = Run(options.file)\n    if options.output:\n        with open(options.output, 'wb') as output_file:\n            output_file.write(data)\n    else:\n        sys.stdout.writelines(Hexdump(data))\n    return 0\n\n\nif __name__ == '__main__':\n    try:\n        sys.exit(main(sys.argv[1:]))\n    except Error as e:\n        sys.stderr.write(str(e) + '\\n')\n        sys.exit(1)\n"
  },
  {
    "path": "test/harness/wasm2c/floating_point.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ERROR: 1\n(module\n  (func (export \"f32\") (param $x f32) (result f32) (local.get $x))\n  (func (export \"f64\") (param $x f64) (result f64) (local.get $x))\n)\n(assert_return (invoke \"f32\" (f32.const 0.0)) (f32.const 123.4))\n(assert_return (invoke \"f32\" (f32.const 123.4)) (f32.const 0.0))\n(assert_return (invoke \"f64\" (f64.const 0.0)) (f64.const 123.4))\n(assert_return (invoke \"f64\" (f64.const 123.4)) (f64.const 0.0))\n(;; STDERR ;;;\nfloating_point.txt:7: assertion failed: in w2c_floating__point__0__wasm_f32(&floating__point__0__wasm_instance, 0.f): expected 123.400002, got 0.\nfloating_point.txt:8: assertion failed: in w2c_floating__point__0__wasm_f32(&floating__point__0__wasm_instance, 123.400002f): expected 0, got 123.400002.\nfloating_point.txt:9: assertion failed: in w2c_floating__point__0__wasm_f64(&floating__point__0__wasm_instance, 0.0000000000000000): expected 123.40000000000001, got 0.\nfloating_point.txt:10: assertion failed: in w2c_floating__point__0__wasm_f64(&floating__point__0__wasm_instance, 123.40000000000001): expected 0, got 123.40000000000001.\n;;; STDERR ;;)\n(;; STDOUT ;;;\n0/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/harness/wasm2c/simd_formatting.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ERROR: 1\n(module\n  (func (export \"x\") (param $x v128) (result v128) (local.get $x))\n)\n(assert_return (invoke \"x\" (v128.const i8x16 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F))\n                           (v128.const i8x16 0xFF 0xFE 0xFD 0xFC 0xFB 0xFA 0xF9 0xF8 0xF7 0xF6 0xF5 0xF4 0xF3 0xF2 0xF1 0xF0))\n(;; STDERR ;;;\nsimd_formatting.txt:6: assertion failed: in w2c_simd__formatting__0__wasm_x(&simd__formatting__0__wasm_instance, v128_i8x16_make(0u,1u,2u,3u,4u,5u,6u,7u,8u,9u,10u,11u,12u,13u,14u,15u)): expected <255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 >, got <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 >.\n;;; STDERR ;;)\n(;; STDOUT ;;;\n0/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/harness/wasm2c/stdin_file.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ERROR: 1\n;;; STDIN_FILE: test/harness/wasm2c/stdin_file.wast\n(;; STDERR ;;;\nstdin_file.wast:4: assertion failed: w2c_stdin__file__0__wasm_x(&stdin__file__0__wasm_instance, 1u) trapped (Unreachable instruction executed).\n;;; STDERR ;;)\n(;; STDOUT ;;;\n0/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/harness/wasm2c/stdin_file.wast",
    "content": "(module\n  (func (export \"x\") (param $x i32) (result i32) (unreachable))\n)\n(assert_return (invoke \"x\" (i32.const 1))\n                           (i32.const 1))\n"
  },
  {
    "path": "test/help/spectest-interp.txt",
    "content": ";;; RUN: %(spectest-interp)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: spectest-interp [options] filename\n\n  read a Spectest JSON file, and run its tests in the interpreter.\n\nexamples:\n  # parse test.json and run the spec tests\n  $ spectest-interp test.json\n\noptions:\n      --help                                   Print this help message\n      --version                                Print version information\n  -v, --verbose                                Use multiple times for more info\n      --enable-exceptions                      Enable Experimental exception handling\n      --disable-mutable-globals                Disable Import/export mutable globals\n      --disable-saturating-float-to-int        Disable Saturating float-to-int operators\n      --disable-sign-extension                 Disable Sign-extension operators\n      --disable-simd                           Disable SIMD support\n      --enable-threads                         Enable Threading support\n      --enable-function-references             Enable Typed function references\n      --disable-multi-value                    Disable Multi-value\n      --enable-tail-call                       Enable Tail-call support\n      --disable-bulk-memory                    Disable Bulk-memory operations\n      --disable-reference-types                Disable Reference types (externref)\n      --enable-annotations                     Enable Custom annotation syntax\n      --enable-code-metadata                   Enable Code metadata\n      --enable-gc                              Enable Garbage collection\n      --enable-memory64                        Enable 64-bit memory\n      --enable-multi-memory                    Enable Multi-memory\n      --enable-extended-const                  Enable Extended constant expressions\n      --enable-relaxed-simd                    Enable Relaxed SIMD\n      --enable-custom-page-sizes               Enable Custom page sizes\n      --enable-compact-imports                 Enable Compact import section\n      --enable-wide-arithmetic                 Enable Wide arithmetic\n      --enable-all                             Enable all features\n  -V, --value-stack-size=SIZE                  Size in elements of the value stack\n  -C, --call-stack-size=SIZE                   Size in elements of the call stack\n  -t, --trace                                  Trace execution\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/help/wasm-interp.txt",
    "content": ";;; RUN: %(wasm-interp)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: wasm-interp [options] filename [arg]...\n\n  read a file in the wasm binary format, and run in it a stack-based\n  interpreter.\n\nexamples:\n  # parse binary file test.wasm, and type-check it\n  $ wasm-interp test.wasm\n\n  # parse test.wasm and run all its exported functions\n  $ wasm-interp test.wasm --run-all-exports\n\n  # parse test.wasm, run the exported functions and trace the output\n  $ wasm-interp test.wasm --run-all-exports --trace\n\n  # parse test.wasm and run all its exported functions, setting the\n  # value stack size to 100 elements\n  $ wasm-interp test.wasm -V 100 --run-all-exports\n\n  # parse test.wasm, run specific exported function by name with argument\n  $ wasm-interp test.wasm -r \"func_sum\" -a \"i32:8\" -a \"i32:5\"\n\noptions:\n      --help                                   Print this help message\n      --version                                Print version information\n  -v, --verbose                                Use multiple times for more info\n      --enable-exceptions                      Enable Experimental exception handling\n      --disable-mutable-globals                Disable Import/export mutable globals\n      --disable-saturating-float-to-int        Disable Saturating float-to-int operators\n      --disable-sign-extension                 Disable Sign-extension operators\n      --disable-simd                           Disable SIMD support\n      --enable-threads                         Enable Threading support\n      --enable-function-references             Enable Typed function references\n      --disable-multi-value                    Disable Multi-value\n      --enable-tail-call                       Enable Tail-call support\n      --disable-bulk-memory                    Disable Bulk-memory operations\n      --disable-reference-types                Disable Reference types (externref)\n      --enable-annotations                     Enable Custom annotation syntax\n      --enable-code-metadata                   Enable Code metadata\n      --enable-gc                              Enable Garbage collection\n      --enable-memory64                        Enable 64-bit memory\n      --enable-multi-memory                    Enable Multi-memory\n      --enable-extended-const                  Enable Extended constant expressions\n      --enable-relaxed-simd                    Enable Relaxed SIMD\n      --enable-custom-page-sizes               Enable Custom page sizes\n      --enable-compact-imports                 Enable Compact import section\n      --enable-wide-arithmetic                 Enable Wide arithmetic\n      --enable-all                             Enable all features\n  -V, --value-stack-size=SIZE                  Size in elements of the value stack\n  -C, --call-stack-size=SIZE                   Size in elements of the call stack\n  -t, --trace                                  Trace execution\n  -r, --run-export=FUNCTION                    Run exported function by name\n  -a, --argument=ARGUMENT                      Add argument to an exported function execution\n      --wasi                                   Assume input module is WASI compliant (Export  WASI API the the module and invoke _start function)\n  -e, --env=ENV                                Pass the given environment string in the WASI runtime\n  -d, --dir=DIR                                Pass the given directory the the WASI runtime\n      --run-all-exports                        Run all the exported functions, in order. Useful for testing\n      --host-print                             Include an importable function named \"host.print\" for printing to stdout\n      --dummy-import-func                      Provide a dummy implementation of all imported functions. The function will log the call and return an appropriate zero value.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/help/wasm-objdump.txt",
    "content": ";;; RUN: %(wasm-objdump)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: wasm-objdump [options] filename+\n\n  Print information about the contents of wasm binaries.\n\nexamples:\n  $ wasm-objdump test.wasm\n\noptions:\n      --help                   Print this help message\n      --version                Print version information\n  -h, --headers                Print headers\n  -j, --section=SECTION        Select just one section\n  -s, --full-contents          Print raw section contents\n  -d, --disassemble            Disassemble function bodies\n      --debug                  Print extra debug information\n  -x, --details                Show section details\n  -r, --reloc                  Show relocations inline with disassembly\n      --section-offsets        Print section offsets instead of file offsets in code disassembly\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/help/wasm-stats.txt",
    "content": ";;; RUN: %(wasm-stats)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: wasm-stats [options] filename+\n\n  Read a file in the wasm binary format, and output stats.\n\nexamples:\n  # parse binary file test.wasm and write opcode dist file test.dist\n  $ wasm-stats test.wasm -o test.dist\n\noptions:\n      --help                                   Print this help message\n      --version                                Print version information\n  -v, --verbose                                Use multiple times for more info\n      --enable-exceptions                      Enable Experimental exception handling\n      --disable-mutable-globals                Disable Import/export mutable globals\n      --disable-saturating-float-to-int        Disable Saturating float-to-int operators\n      --disable-sign-extension                 Disable Sign-extension operators\n      --disable-simd                           Disable SIMD support\n      --enable-threads                         Enable Threading support\n      --enable-function-references             Enable Typed function references\n      --disable-multi-value                    Disable Multi-value\n      --enable-tail-call                       Enable Tail-call support\n      --disable-bulk-memory                    Disable Bulk-memory operations\n      --disable-reference-types                Disable Reference types (externref)\n      --enable-annotations                     Enable Custom annotation syntax\n      --enable-code-metadata                   Enable Code metadata\n      --enable-gc                              Enable Garbage collection\n      --enable-memory64                        Enable 64-bit memory\n      --enable-multi-memory                    Enable Multi-memory\n      --enable-extended-const                  Enable Extended constant expressions\n      --enable-relaxed-simd                    Enable Relaxed SIMD\n      --enable-custom-page-sizes               Enable Custom page sizes\n      --enable-compact-imports                 Enable Compact import section\n      --enable-wide-arithmetic                 Enable Wide arithmetic\n      --enable-all                             Enable all features\n  -o, --output=FILENAME                        Output file for the stats, by default use stdout\n  -c, --cutoff=N                               Cutoff for reporting counts less than N\n  -s, --separator=SEPARATOR                    Separator text between element and count when reporting counts\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/help/wasm-validate.txt",
    "content": ";;; RUN: %(wasm-validate)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: wasm-validate [options] filename\n\n  Read a file in the WebAssembly binary format, and validate it.\n\nexamples:\n  # validate binary file test.wasm\n  $ wasm-validate test.wasm\n\noptions:\n      --help                                   Print this help message\n      --version                                Print version information\n  -v, --verbose                                Use multiple times for more info\n      --enable-exceptions                      Enable Experimental exception handling\n      --disable-mutable-globals                Disable Import/export mutable globals\n      --disable-saturating-float-to-int        Disable Saturating float-to-int operators\n      --disable-sign-extension                 Disable Sign-extension operators\n      --disable-simd                           Disable SIMD support\n      --enable-threads                         Enable Threading support\n      --enable-function-references             Enable Typed function references\n      --disable-multi-value                    Disable Multi-value\n      --enable-tail-call                       Enable Tail-call support\n      --disable-bulk-memory                    Disable Bulk-memory operations\n      --disable-reference-types                Disable Reference types (externref)\n      --enable-annotations                     Enable Custom annotation syntax\n      --enable-code-metadata                   Enable Code metadata\n      --enable-gc                              Enable Garbage collection\n      --enable-memory64                        Enable 64-bit memory\n      --enable-multi-memory                    Enable Multi-memory\n      --enable-extended-const                  Enable Extended constant expressions\n      --enable-relaxed-simd                    Enable Relaxed SIMD\n      --enable-custom-page-sizes               Enable Custom page sizes\n      --enable-compact-imports                 Enable Compact import section\n      --enable-wide-arithmetic                 Enable Wide arithmetic\n      --enable-all                             Enable all features\n      --no-debug-names                         Ignore debug names in the binary file\n      --ignore-custom-section-errors           Ignore errors in custom sections\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/help/wasm2wat.txt",
    "content": ";;; RUN: %(wasm2wat)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: wasm2wat [options] filename\n\n  Read a file in the WebAssembly binary format, and convert it to\n  the WebAssembly text format.\n\nexamples:\n  # parse binary file test.wasm and write text file test.wast\n  $ wasm2wat test.wasm -o test.wat\n\n  # parse test.wasm, write test.wat, but ignore the debug names, if any\n  $ wasm2wat test.wasm --no-debug-names -o test.wat\n\noptions:\n      --help                                   Print this help message\n      --version                                Print version information\n  -v, --verbose                                Use multiple times for more info\n  -o, --output=FILENAME                        Output file for the generated wast file, by default use stdout\n  -f, --fold-exprs                             Write folded expressions where possible\n      --enable-exceptions                      Enable Experimental exception handling\n      --disable-mutable-globals                Disable Import/export mutable globals\n      --disable-saturating-float-to-int        Disable Saturating float-to-int operators\n      --disable-sign-extension                 Disable Sign-extension operators\n      --disable-simd                           Disable SIMD support\n      --enable-threads                         Enable Threading support\n      --enable-function-references             Enable Typed function references\n      --disable-multi-value                    Disable Multi-value\n      --enable-tail-call                       Enable Tail-call support\n      --disable-bulk-memory                    Disable Bulk-memory operations\n      --disable-reference-types                Disable Reference types (externref)\n      --enable-annotations                     Enable Custom annotation syntax\n      --enable-code-metadata                   Enable Code metadata\n      --enable-gc                              Enable Garbage collection\n      --enable-memory64                        Enable 64-bit memory\n      --enable-multi-memory                    Enable Multi-memory\n      --enable-extended-const                  Enable Extended constant expressions\n      --enable-relaxed-simd                    Enable Relaxed SIMD\n      --enable-custom-page-sizes               Enable Custom page sizes\n      --enable-compact-imports                 Enable Compact import section\n      --enable-wide-arithmetic                 Enable Wide arithmetic\n      --enable-all                             Enable all features\n      --inline-exports                         Write all exports inline\n      --inline-imports                         Write all imports inline\n      --no-debug-names                         Ignore debug names in the binary file\n      --ignore-custom-section-errors           Ignore errors in custom sections\n      --generate-names                         Give auto-generated names to non-named functions, types, etc.\n      --no-check                               Don't check for invalid modules\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/help/wast2json.txt",
    "content": ";;; RUN: %(wast2json)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: wast2json [options] filename\n\n  read a file in the wasm spec test format, check it for errors, and\n  convert it to a JSON file and associated wasm binary files.\n\nexamples:\n  # parse spec-test.wast, and write files to spec-test.json. Modules are\n  # written to spec-test.0.wasm, spec-test.1.wasm, etc.\n  $ wast2json spec-test.wast -o spec-test.json\n\noptions:\n      --help                                   Print this help message\n      --version                                Print version information\n  -v, --verbose                                Use multiple times for more info\n      --debug-parser                           Turn on debugging the parser of wast files\n      --enable-exceptions                      Enable Experimental exception handling\n      --disable-mutable-globals                Disable Import/export mutable globals\n      --disable-saturating-float-to-int        Disable Saturating float-to-int operators\n      --disable-sign-extension                 Disable Sign-extension operators\n      --disable-simd                           Disable SIMD support\n      --enable-threads                         Enable Threading support\n      --enable-function-references             Enable Typed function references\n      --disable-multi-value                    Disable Multi-value\n      --enable-tail-call                       Enable Tail-call support\n      --disable-bulk-memory                    Disable Bulk-memory operations\n      --disable-reference-types                Disable Reference types (externref)\n      --enable-annotations                     Enable Custom annotation syntax\n      --enable-code-metadata                   Enable Code metadata\n      --enable-gc                              Enable Garbage collection\n      --enable-memory64                        Enable 64-bit memory\n      --enable-multi-memory                    Enable Multi-memory\n      --enable-extended-const                  Enable Extended constant expressions\n      --enable-relaxed-simd                    Enable Relaxed SIMD\n      --enable-custom-page-sizes               Enable Custom page sizes\n      --enable-compact-imports                 Enable Compact import section\n      --enable-wide-arithmetic                 Enable Wide arithmetic\n      --enable-all                             Enable all features\n  -o, --output=FILE                            output JSON file\n  -r, --relocatable                            Create a relocatable wasm binary (suitable for linking with e.g. lld)\n      --no-canonicalize-leb128s                Write all LEB128 sizes as 5-bytes instead of their minimal size\n      --debug-names                            Write debug names to the generated binary file\n      --no-check                               Don't check for invalid modules\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/help/wat-desugar.txt",
    "content": ";;; RUN: %(wat-desugar)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: wat-desugar [options] filename\n\n  read a file in the wasm s-expression format and format it.\n\nexamples:\n  # write output to stdout\n  $ wat-desugar test.wat\n\n  # write output to test2.wat\n  $ wat-desugar test.wat -o test2.wat\n\n  # generate names for indexed variables\n  $ wat-desugar --generate-names test.wat\n\noptions:\n      --help                                   Print this help message\n      --version                                Print version information\n  -o, --output=FILE                            Output file for the formatted file\n      --debug-parser                           Turn on debugging the parser of wat files\n  -f, --fold-exprs                             Write folded expressions where possible\n      --inline-exports                         Write all exports inline\n      --inline-imports                         Write all imports inline\n      --enable-exceptions                      Enable Experimental exception handling\n      --disable-mutable-globals                Disable Import/export mutable globals\n      --disable-saturating-float-to-int        Disable Saturating float-to-int operators\n      --disable-sign-extension                 Disable Sign-extension operators\n      --disable-simd                           Disable SIMD support\n      --enable-threads                         Enable Threading support\n      --enable-function-references             Enable Typed function references\n      --disable-multi-value                    Disable Multi-value\n      --enable-tail-call                       Enable Tail-call support\n      --disable-bulk-memory                    Disable Bulk-memory operations\n      --disable-reference-types                Disable Reference types (externref)\n      --enable-annotations                     Enable Custom annotation syntax\n      --enable-code-metadata                   Enable Code metadata\n      --enable-gc                              Enable Garbage collection\n      --enable-memory64                        Enable 64-bit memory\n      --enable-multi-memory                    Enable Multi-memory\n      --enable-extended-const                  Enable Extended constant expressions\n      --enable-relaxed-simd                    Enable Relaxed SIMD\n      --enable-custom-page-sizes               Enable Custom page sizes\n      --enable-compact-imports                 Enable Compact import section\n      --enable-wide-arithmetic                 Enable Wide arithmetic\n      --enable-all                             Enable all features\n      --generate-names                         Give auto-generated names to non-named functions, types, etc.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/help/wat2wasm.txt",
    "content": ";;; RUN: %(wat2wasm)s\n;;; ARGS: --help\n(;; STDOUT ;;;\nusage: wat2wasm [options] filename\n\n  read a file in the wasm text format, check it for errors, and\n  convert it to the wasm binary format.\n\nexamples:\n  # parse test.wat and write to .wasm binary file with the same name\n  $ wat2wasm test.wat\n\n  # parse test.wat and write to binary file test.wasm\n  $ wat2wasm test.wat -o test.wasm\n\n  # parse spec-test.wast, and write verbose output to stdout (including\n  # the meaning of every byte)\n  $ wat2wasm spec-test.wast -v\n\noptions:\n      --help                                   Print this help message\n      --version                                Print version information\n  -v, --verbose                                Use multiple times for more info\n      --debug-parser                           Turn on debugging the parser of wat files\n  -d, --dump-module                            Print a hexdump of the module to stdout\n      --enable-exceptions                      Enable Experimental exception handling\n      --disable-mutable-globals                Disable Import/export mutable globals\n      --disable-saturating-float-to-int        Disable Saturating float-to-int operators\n      --disable-sign-extension                 Disable Sign-extension operators\n      --disable-simd                           Disable SIMD support\n      --enable-threads                         Enable Threading support\n      --enable-function-references             Enable Typed function references\n      --disable-multi-value                    Disable Multi-value\n      --enable-tail-call                       Enable Tail-call support\n      --disable-bulk-memory                    Disable Bulk-memory operations\n      --disable-reference-types                Disable Reference types (externref)\n      --enable-annotations                     Enable Custom annotation syntax\n      --enable-code-metadata                   Enable Code metadata\n      --enable-gc                              Enable Garbage collection\n      --enable-memory64                        Enable 64-bit memory\n      --enable-multi-memory                    Enable Multi-memory\n      --enable-extended-const                  Enable Extended constant expressions\n      --enable-relaxed-simd                    Enable Relaxed SIMD\n      --enable-custom-page-sizes               Enable Custom page sizes\n      --enable-compact-imports                 Enable Compact import section\n      --enable-wide-arithmetic                 Enable Wide arithmetic\n      --enable-all                             Enable all features\n  -o, --output=FILE                            Output wasm binary file. Use \"-\" to write to stdout.\n  -r, --relocatable                            Create a relocatable wasm binary (suitable for linking with e.g. lld)\n      --no-canonicalize-leb128s                Write all LEB128 sizes as 5-bytes instead of their minimal size\n      --debug-names                            Write debug names to the generated binary file\n      --no-check                               Don't check for invalid modules\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-load.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n  (data (i32.const 0) \"\\ff\\ff\\ff\\ff\")\n  (data (i32.const 4) \"\\00\\00\\ce\\41\")\n  (data (i32.const 8) \"\\00\\00\\00\\00\\00\\ff\\8f\\40\")\n\n  (func (export \"i32.atomic.load8_u\") (result i32)\n    i32.const 1 i32.atomic.load8_u)\n  (func (export \"i32.atomic.load16_u\") (result i32)\n    i32.const 2 i32.atomic.load16_u)\n  (func (export \"i32.atomic.load\") (result i32)\n    i32.const 4 i32.atomic.load)\n\n  (func (export \"i64.atomic.load8_u\") (result i64)\n    i32.const 1 i64.atomic.load8_u)\n  (func (export \"i64.atomic.load16_u\") (result i64)\n    i32.const 2 i64.atomic.load16_u)\n  (func (export \"i64.atomic.load32_u\") (result i64)\n    i32.const 4 i64.atomic.load32_u)\n  (func (export \"i64.atomic.load\") (result i64)\n    i32.const 0 i64.atomic.load)\n\n  ;; Test bad alignment\n\n  (func (export \"bad.align-i32.atomic.load16_u\") (result i32)\n    i32.const 1 i32.atomic.load16_u)\n  (func (export \"bad.align-i32.atomic.load\") (result i32)\n    i32.const 2 i32.atomic.load)\n\n  (func (export \"bad.align-i64.atomic.load16_u\") (result i64)\n    i32.const 1 i64.atomic.load16_u)\n  (func (export \"bad.align-i64.atomic.load32_u\") (result i64)\n    i32.const 2 i64.atomic.load32_u)\n  (func (export \"bad.align-i64.atomic.load\") (result i64)\n    i32.const 4 i64.atomic.load)\n\n\n)\n(;; STDOUT ;;;\ni32.atomic.load8_u() => i32:255\ni32.atomic.load16_u() => i32:65535\ni32.atomic.load() => i32:1104019456\ni64.atomic.load8_u() => i64:255\ni64.atomic.load16_u() => i64:65535\ni64.atomic.load32_u() => i64:1104019456\ni64.atomic.load() => i64:4741727461962678271\nbad.align-i32.atomic.load16_u() => error: invalid atomic access at 1+0\nbad.align-i32.atomic.load() => error: invalid atomic access at 2+0\nbad.align-i64.atomic.load16_u() => error: invalid atomic access at 1+0\nbad.align-i64.atomic.load32_u() => error: invalid atomic access at 2+0\nbad.align-i64.atomic.load() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-rmw-add.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n\n  ;; i32\n\n  (func (export \"i32.atomic.rmw8.add_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw8.add_u)\n\n  (func (export \"i32.atomic.rmw8.add_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw8.add_u drop\n    i32.const 0 i32.load8_u)\n\n  (func (export \"i32.atomic.rmw16.add_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw16.add_u)\n\n  (func (export \"i32.atomic.rmw16.add_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw16.add_u drop\n    i32.const 0 i32.load16_u)\n\n  (func (export \"i32.atomic.rmw.add-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw.add)\n\n  (func (export \"i32.atomic.rmw.add-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw.add drop\n    i32.const 0 i32.load)\n\n\n  ;; i64\n\n  (func (export \"i64.atomic.rmw8.add_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw8.add_u)\n\n  (func (export \"i64.atomic.rmw8.add_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw8.add_u drop\n    i32.const 0 i64.load8_u)\n\n  (func (export \"i64.atomic.rmw16.add_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw16.add_u)\n\n  (func (export \"i64.atomic.rmw16.add_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw16.add_u drop\n    i32.const 0 i64.load16_u)\n\n  (func (export \"i64.atomic.rmw32.add_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw32.add_u)\n\n  (func (export \"i64.atomic.rmw32.add_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw32.add_u drop\n    i32.const 0 i64.load32_u)\n\n  (func (export \"i64.atomic.rmw.add-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw.add)\n\n  (func (export \"i64.atomic.rmw.add-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw.add drop\n    i32.const 0 i64.load)\n\n\n  ;; Test bad alignment\n\n  (func (export \"bad_align-i32.atomic.rmw16.add_u\")\n    i32.const 1 i32.const 0 i32.atomic.rmw16.add_u drop)\n  (func (export \"bad_align-i32.atomic.rmw.add\")\n    i32.const 2 i32.const 0 i32.atomic.rmw.add drop)\n\n  (func (export \"bad_align-i64.atomic.rmw16.add_u\")\n    i32.const 1 i64.const 0 i64.atomic.rmw16.add_u drop)\n  (func (export \"bad_align-i64.atomic.rmw32.add_u\")\n    i32.const 2 i64.const 0 i64.atomic.rmw32.add_u drop)\n  (func (export \"bad_align-i64.atomic.rmw.add\")\n    i32.const 4 i64.const 0 i64.atomic.rmw.add drop)\n\n)\n(;; STDOUT ;;;\ni32.atomic.rmw8.add_u-result() => i32:64\ni32.atomic.rmw8.add_u-memory() => i32:65\ni32.atomic.rmw16.add_u-result() => i32:16960\ni32.atomic.rmw16.add_u-memory() => i32:16961\ni32.atomic.rmw.add-result() => i32:1000000\ni32.atomic.rmw.add-memory() => i32:1000001\ni64.atomic.rmw8.add_u-result() => i64:0\ni64.atomic.rmw8.add_u-memory() => i64:1\ni64.atomic.rmw16.add_u-result() => i64:58368\ni64.atomic.rmw16.add_u-memory() => i64:58369\ni64.atomic.rmw32.add_u-result() => i64:1410065408\ni64.atomic.rmw32.add_u-memory() => i64:1410065409\ni64.atomic.rmw.add-result() => i64:10000000000\ni64.atomic.rmw.add-memory() => i64:10000000001\nbad_align-i32.atomic.rmw16.add_u() => error: invalid atomic access at 1+0\nbad_align-i32.atomic.rmw.add() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw16.add_u() => error: invalid atomic access at 1+0\nbad_align-i64.atomic.rmw32.add_u() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw.add() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-rmw-and.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n\n  ;; i32\n\n  (func (export \"i32.atomic.rmw8.and_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 64      i32.atomic.rmw8.and_u)\n\n  (func (export \"i32.atomic.rmw8.and_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 64      i32.atomic.rmw8.and_u drop\n    i32.const 0 i32.load8_u)\n\n  (func (export \"i32.atomic.rmw16.and_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 64      i32.atomic.rmw16.and_u)\n\n  (func (export \"i32.atomic.rmw16.and_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 64      i32.atomic.rmw16.and_u drop\n    i32.const 0 i32.load16_u)\n\n  (func (export \"i32.atomic.rmw.and-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 64      i32.atomic.rmw.and)\n\n  (func (export \"i32.atomic.rmw.and-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 64      i32.atomic.rmw.and drop\n    i32.const 0 i32.load)\n\n\n  ;; i64\n\n  (func (export \"i64.atomic.rmw8.and_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 64          i64.atomic.rmw8.and_u)\n\n  (func (export \"i64.atomic.rmw8.and_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 64          i64.atomic.rmw8.and_u drop\n    i32.const 0 i64.load8_u)\n\n  (func (export \"i64.atomic.rmw16.and_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1024        i64.atomic.rmw16.and_u)\n\n  (func (export \"i64.atomic.rmw16.and_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1024        i64.atomic.rmw16.and_u drop\n    i32.const 0 i64.load16_u)\n\n  (func (export \"i64.atomic.rmw32.and_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1024        i64.atomic.rmw32.and_u)\n\n  (func (export \"i64.atomic.rmw32.and_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1024        i64.atomic.rmw32.and_u drop\n    i32.const 0 i64.load32_u)\n\n  (func (export \"i64.atomic.rmw.and-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1024        i64.atomic.rmw.and)\n\n  (func (export \"i64.atomic.rmw.and-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1024        i64.atomic.rmw.and drop\n    i32.const 0 i64.load)\n\n\n  ;; Test bad alignment\n\n  (func (export \"bad_align-i32.atomic.rmw16.and_u\")\n    i32.const 1 i32.const 0 i32.atomic.rmw16.and_u drop)\n  (func (export \"bad_align-i32.atomic.rmw.and\")\n    i32.const 2 i32.const 0 i32.atomic.rmw.and drop)\n\n  (func (export \"bad_align-i64.atomic.rmw16.and_u\")\n    i32.const 1 i64.const 0 i64.atomic.rmw16.and_u drop)\n  (func (export \"bad_align-i64.atomic.rmw32.and_u\")\n    i32.const 2 i64.const 0 i64.atomic.rmw32.and_u drop)\n  (func (export \"bad_align-i64.atomic.rmw.and\")\n    i32.const 4 i64.const 0 i64.atomic.rmw.and drop)\n\n)\n(;; STDOUT ;;;\ni32.atomic.rmw8.and_u-result() => i32:64\ni32.atomic.rmw8.and_u-memory() => i32:64\ni32.atomic.rmw16.and_u-result() => i32:16960\ni32.atomic.rmw16.and_u-memory() => i32:64\ni32.atomic.rmw.and-result() => i32:1000000\ni32.atomic.rmw.and-memory() => i32:64\ni64.atomic.rmw8.and_u-result() => i64:0\ni64.atomic.rmw8.and_u-memory() => i64:0\ni64.atomic.rmw16.and_u-result() => i64:58368\ni64.atomic.rmw16.and_u-memory() => i64:1024\ni64.atomic.rmw32.and_u-result() => i64:1410065408\ni64.atomic.rmw32.and_u-memory() => i64:1024\ni64.atomic.rmw.and-result() => i64:10000000000\ni64.atomic.rmw.and-memory() => i64:1024\nbad_align-i32.atomic.rmw16.and_u() => error: invalid atomic access at 1+0\nbad_align-i32.atomic.rmw.and() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw16.and_u() => error: invalid atomic access at 1+0\nbad_align-i64.atomic.rmw32.and_u() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw.and() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-rmw-cmpxchg.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n\n  ;; i32\n\n  (func (export \"i32.atomic.rmw8.cmpxchg_u-true-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1000000 i32.const 1 i32.atomic.rmw8.cmpxchg_u)\n  (func (export \"i32.atomic.rmw8.cmpxchg_u-true-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1000000 i32.const 1 i32.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i32.load8_u)\n\n  (func (export \"i32.atomic.rmw8.cmpxchg_u-false-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const     123 i32.const 1       i32.atomic.rmw8.cmpxchg_u)\n  (func (export \"i32.atomic.rmw8.cmpxchg_u-false-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const     123 i32.const 1       i32.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i32.load8_u)\n\n\n  (func (export \"i32.atomic.rmw16.cmpxchg_u-true-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1000000 i32.const 1 i32.atomic.rmw16.cmpxchg_u)\n  (func (export \"i32.atomic.rmw16.cmpxchg_u-true-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1000000 i32.const 1 i32.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i32.load16_u)\n\n  (func (export \"i32.atomic.rmw16.cmpxchg_u-false-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const     123 i32.const 1       i32.atomic.rmw16.cmpxchg_u)\n  (func (export \"i32.atomic.rmw16.cmpxchg_u-false-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const     123 i32.const 1       i32.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i32.load16_u)\n\n\n  (func (export \"i32.atomic.rmw.cmpxchg-true-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1000000 i32.const 1 i32.atomic.rmw.cmpxchg)\n  (func (export \"i32.atomic.rmw.cmpxchg-true-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1000000 i32.const 1 i32.atomic.rmw.cmpxchg drop\n    i32.const 0 i32.load)\n\n  (func (export \"i32.atomic.rmw.cmpxchg-false-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const     123 i32.const 1       i32.atomic.rmw.cmpxchg)\n\n  (func (export \"i32.atomic.rmw.cmpxchg-false-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const     123 i32.const 1       i32.atomic.rmw.cmpxchg drop\n    i32.const 0 i32.load)\n\n\n\n  ;; i64\n\n  (func (export \"i64.atomic.rmw8.cmpxchg_u-true-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 10000000000 i64.const 1 i64.atomic.rmw8.cmpxchg_u)\n  (func (export \"i64.atomic.rmw8.cmpxchg_u-true-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 10000000000 i64.const 1 i64.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i64.load8_u)\n\n  (func (export \"i64.atomic.rmw8.cmpxchg_u-false-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const         123 i64.const 1 i64.atomic.rmw8.cmpxchg_u)\n  (func (export \"i64.atomic.rmw8.cmpxchg_u-false-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const         123 i64.const 1 i64.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i64.load8_u)\n\n\n  (func (export \"i64.atomic.rmw16.cmpxchg_u-true-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 10000000000 i64.const 1 i64.atomic.rmw16.cmpxchg_u)\n  (func (export \"i64.atomic.rmw16.cmpxchg_u-true-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 10000000000 i64.const 1 i64.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.load16_u)\n\n  (func (export \"i64.atomic.rmw16.cmpxchg_u-false-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const         123 i64.const 1 i64.atomic.rmw16.cmpxchg_u)\n  (func (export \"i64.atomic.rmw16.cmpxchg_u-false-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const         123 i64.const 1 i64.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.load16_u)\n\n\n  (func (export \"i64.atomic.rmw32.cmpxchg_u-true-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 10000000000 i64.const 1 i64.atomic.rmw32.cmpxchg_u)\n  (func (export \"i64.atomic.rmw32.cmpxchg_u-true-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 10000000000 i64.const 1 i64.atomic.rmw32.cmpxchg_u drop\n    i32.const 0 i64.load32_u)\n\n  (func (export \"i64.atomic.rmw32.cmpxchg_u-false-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const         123 i64.const 1 i64.atomic.rmw32.cmpxchg_u)\n  (func (export \"i64.atomic.rmw32.cmpxchg_u-false-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const         123 i64.const 1 i64.atomic.rmw32.cmpxchg_u drop\n    i32.const 0 i64.load32_u)\n\n\n  (func (export \"i64.atomic.rmw.cmpxchg-true-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 10000000000 i64.const 1 i64.atomic.rmw.cmpxchg)\n  (func (export \"i64.atomic.rmw.cmpxchg-true-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 10000000000 i64.const 1 i64.atomic.rmw.cmpxchg drop\n    i32.const 0 i64.load)\n\n  (func (export \"i64.atomic.rmw.cmpxchg-false-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const         123 i64.const 1 i64.atomic.rmw.cmpxchg)\n  (func (export \"i64.atomic.rmw.cmpxchg-false-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const         123 i64.const 1 i64.atomic.rmw.cmpxchg drop\n    i32.const 0 i64.load)\n\n\n  ;; Test bad alignment\n\n  (func (export \"bad_align-i32.atomic.rmw16.cmpxchg_u\")\n    i32.const 1 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop)\n  (func (export \"bad_align-i32.atomic.rmw.cmpxchg\")\n    i32.const 2 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop)\n\n  (func (export \"bad_align-i64.atomic.rmw16.cmpxchg_u\")\n    i32.const 1 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop)\n  (func (export \"bad_align-i64.atomic.rmw32.cmpxchg_u\")\n    i32.const 2 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop)\n  (func (export \"bad_align-i64.atomic.rmw.cmpxchg\")\n    i32.const 4 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop)\n\n)\n(;; STDOUT ;;;\ni32.atomic.rmw8.cmpxchg_u-true-result() => i32:64\ni32.atomic.rmw8.cmpxchg_u-true-memory() => i32:1\ni32.atomic.rmw8.cmpxchg_u-false-result() => i32:64\ni32.atomic.rmw8.cmpxchg_u-false-memory() => i32:64\ni32.atomic.rmw16.cmpxchg_u-true-result() => i32:16960\ni32.atomic.rmw16.cmpxchg_u-true-memory() => i32:1\ni32.atomic.rmw16.cmpxchg_u-false-result() => i32:16960\ni32.atomic.rmw16.cmpxchg_u-false-memory() => i32:16960\ni32.atomic.rmw.cmpxchg-true-result() => i32:1000000\ni32.atomic.rmw.cmpxchg-true-memory() => i32:1\ni32.atomic.rmw.cmpxchg-false-result() => i32:1000000\ni32.atomic.rmw.cmpxchg-false-memory() => i32:1000000\ni64.atomic.rmw8.cmpxchg_u-true-result() => i64:0\ni64.atomic.rmw8.cmpxchg_u-true-memory() => i64:1\ni64.atomic.rmw8.cmpxchg_u-false-result() => i64:0\ni64.atomic.rmw8.cmpxchg_u-false-memory() => i64:0\ni64.atomic.rmw16.cmpxchg_u-true-result() => i64:58368\ni64.atomic.rmw16.cmpxchg_u-true-memory() => i64:1\ni64.atomic.rmw16.cmpxchg_u-false-result() => i64:58368\ni64.atomic.rmw16.cmpxchg_u-false-memory() => i64:58368\ni64.atomic.rmw32.cmpxchg_u-true-result() => i64:1410065408\ni64.atomic.rmw32.cmpxchg_u-true-memory() => i64:1\ni64.atomic.rmw32.cmpxchg_u-false-result() => i64:1410065408\ni64.atomic.rmw32.cmpxchg_u-false-memory() => i64:1410065408\ni64.atomic.rmw.cmpxchg-true-result() => i64:10000000000\ni64.atomic.rmw.cmpxchg-true-memory() => i64:1\ni64.atomic.rmw.cmpxchg-false-result() => i64:10000000000\ni64.atomic.rmw.cmpxchg-false-memory() => i64:10000000000\nbad_align-i32.atomic.rmw16.cmpxchg_u() => error: invalid atomic access at 1+0\nbad_align-i32.atomic.rmw.cmpxchg() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw16.cmpxchg_u() => error: invalid atomic access at 1+0\nbad_align-i64.atomic.rmw32.cmpxchg_u() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw.cmpxchg() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-rmw-or.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n\n  ;; i32\n\n  (func (export \"i32.atomic.rmw8.or_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw8.or_u)\n\n  (func (export \"i32.atomic.rmw8.or_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw8.or_u drop\n    i32.const 0 i32.load8_u)\n\n  (func (export \"i32.atomic.rmw16.or_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw16.or_u)\n\n  (func (export \"i32.atomic.rmw16.or_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw16.or_u drop\n    i32.const 0 i32.load16_u)\n\n  (func (export \"i32.atomic.rmw.or-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw.or)\n\n  (func (export \"i32.atomic.rmw.or-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw.or drop\n    i32.const 0 i32.load)\n\n\n  ;; i64\n\n  (func (export \"i64.atomic.rmw8.or_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 65          i64.atomic.rmw8.or_u)\n\n  (func (export \"i64.atomic.rmw8.or_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 65        i64.atomic.rmw8.or_u drop\n    i32.const 0 i64.load8_u)\n\n  (func (export \"i64.atomic.rmw16.or_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw16.or_u)\n\n  (func (export \"i64.atomic.rmw16.or_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw16.or_u drop\n    i32.const 0 i64.load16_u)\n\n  (func (export \"i64.atomic.rmw32.or_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw32.or_u)\n\n  (func (export \"i64.atomic.rmw32.or_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw32.or_u drop\n    i32.const 0 i64.load32_u)\n\n  (func (export \"i64.atomic.rmw.or-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw.or)\n\n  (func (export \"i64.atomic.rmw.or-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw.or drop\n    i32.const 0 i64.load)\n\n\n  ;; Test bad alignment\n\n  (func (export \"bad_align-i32.atomic.rmw16.or_u\")\n    i32.const 1 i32.const 0 i32.atomic.rmw16.or_u drop)\n  (func (export \"bad_align-i32.atomic.rmw.or\")\n    i32.const 2 i32.const 0 i32.atomic.rmw.or drop)\n\n  (func (export \"bad_align-i64.atomic.rmw16.or_u\")\n    i32.const 1 i64.const 0 i64.atomic.rmw16.or_u drop)\n  (func (export \"bad_align-i64.atomic.rmw32.or_u\")\n    i32.const 2 i64.const 0 i64.atomic.rmw32.or_u drop)\n  (func (export \"bad_align-i64.atomic.rmw.or\")\n    i32.const 4 i64.const 0 i64.atomic.rmw.or drop)\n\n)\n(;; STDOUT ;;;\ni32.atomic.rmw8.or_u-result() => i32:64\ni32.atomic.rmw8.or_u-memory() => i32:65\ni32.atomic.rmw16.or_u-result() => i32:16960\ni32.atomic.rmw16.or_u-memory() => i32:16961\ni32.atomic.rmw.or-result() => i32:1000000\ni32.atomic.rmw.or-memory() => i32:1000001\ni64.atomic.rmw8.or_u-result() => i64:0\ni64.atomic.rmw8.or_u-memory() => i64:65\ni64.atomic.rmw16.or_u-result() => i64:58368\ni64.atomic.rmw16.or_u-memory() => i64:58369\ni64.atomic.rmw32.or_u-result() => i64:1410065408\ni64.atomic.rmw32.or_u-memory() => i64:1410065409\ni64.atomic.rmw.or-result() => i64:10000000000\ni64.atomic.rmw.or-memory() => i64:10000000001\nbad_align-i32.atomic.rmw16.or_u() => error: invalid atomic access at 1+0\nbad_align-i32.atomic.rmw.or() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw16.or_u() => error: invalid atomic access at 1+0\nbad_align-i64.atomic.rmw32.or_u() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw.or() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-rmw-sub.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n\n  ;; i32\n\n  (func (export \"i32.atomic.rmw8.sub_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw8.sub_u)\n\n  (func (export \"i32.atomic.rmw8.sub_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw8.sub_u drop\n    i32.const 0 i32.load8_u)\n\n  (func (export \"i32.atomic.rmw16.sub_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw16.sub_u)\n\n  (func (export \"i32.atomic.rmw16.sub_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw16.sub_u drop\n    i32.const 0 i32.load16_u)\n\n  (func (export \"i32.atomic.rmw.sub-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw.sub)\n\n  (func (export \"i32.atomic.rmw.sub-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw.sub drop\n    i32.const 0 i32.load)\n\n\n  ;; i64\n\n  (func (export \"i64.atomic.rmw8.sub_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw8.sub_u)\n\n  (func (export \"i64.atomic.rmw8.sub_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw8.sub_u drop\n    i32.const 0 i64.load8_u)\n\n  (func (export \"i64.atomic.rmw16.sub_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw16.sub_u)\n\n  (func (export \"i64.atomic.rmw16.sub_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw16.sub_u drop\n    i32.const 0 i64.load16_u)\n\n  (func (export \"i64.atomic.rmw32.sub_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw32.sub_u)\n\n  (func (export \"i64.atomic.rmw32.sub_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw32.sub_u drop\n    i32.const 0 i64.load32_u)\n\n  (func (export \"i64.atomic.rmw.sub-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw.sub)\n\n  (func (export \"i64.atomic.rmw.sub-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw.sub drop\n    i32.const 0 i64.load)\n\n\n  ;; Test bad alignment\n\n  (func (export \"bad_align-i32.atomic.rmw16.sub_u\")\n    i32.const 1 i32.const 0 i32.atomic.rmw16.sub_u drop)\n  (func (export \"bad_align-i32.atomic.rmw.sub\")\n    i32.const 2 i32.const 0 i32.atomic.rmw.sub drop)\n\n  (func (export \"bad_align-i64.atomic.rmw16.sub_u\")\n    i32.const 1 i64.const 0 i64.atomic.rmw16.sub_u drop)\n  (func (export \"bad_align-i64.atomic.rmw32.sub_u\")\n    i32.const 2 i64.const 0 i64.atomic.rmw32.sub_u drop)\n  (func (export \"bad_align-i64.atomic.rmw.sub\")\n    i32.const 4 i64.const 0 i64.atomic.rmw.sub drop)\n\n)\n(;; STDOUT ;;;\ni32.atomic.rmw8.sub_u-result() => i32:64\ni32.atomic.rmw8.sub_u-memory() => i32:63\ni32.atomic.rmw16.sub_u-result() => i32:16960\ni32.atomic.rmw16.sub_u-memory() => i32:16959\ni32.atomic.rmw.sub-result() => i32:1000000\ni32.atomic.rmw.sub-memory() => i32:999999\ni64.atomic.rmw8.sub_u-result() => i64:0\ni64.atomic.rmw8.sub_u-memory() => i64:255\ni64.atomic.rmw16.sub_u-result() => i64:58368\ni64.atomic.rmw16.sub_u-memory() => i64:58367\ni64.atomic.rmw32.sub_u-result() => i64:1410065408\ni64.atomic.rmw32.sub_u-memory() => i64:1410065407\ni64.atomic.rmw.sub-result() => i64:10000000000\ni64.atomic.rmw.sub-memory() => i64:9999999999\nbad_align-i32.atomic.rmw16.sub_u() => error: invalid atomic access at 1+0\nbad_align-i32.atomic.rmw.sub() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw16.sub_u() => error: invalid atomic access at 1+0\nbad_align-i64.atomic.rmw32.sub_u() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw.sub() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-rmw-xchg.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n\n  ;; i32\n\n  (func (export \"i32.atomic.rmw8.xchg_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw8.xchg_u)\n\n  (func (export \"i32.atomic.rmw8.xchg_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw8.xchg_u drop\n    i32.const 0 i32.load8_u)\n\n  (func (export \"i32.atomic.rmw16.xchg_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw16.xchg_u)\n\n  (func (export \"i32.atomic.rmw16.xchg_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw16.xchg_u drop\n    i32.const 0 i32.load16_u)\n\n  (func (export \"i32.atomic.rmw.xchg-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw.xchg)\n\n  (func (export \"i32.atomic.rmw.xchg-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 1       i32.atomic.rmw.xchg drop\n    i32.const 0 i32.load)\n\n\n  ;; i64\n\n  (func (export \"i64.atomic.rmw8.xchg_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw8.xchg_u)\n\n  (func (export \"i64.atomic.rmw8.xchg_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw8.xchg_u drop\n    i32.const 0 i64.load8_u)\n\n  (func (export \"i64.atomic.rmw16.xchg_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw16.xchg_u)\n\n  (func (export \"i64.atomic.rmw16.xchg_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.load16_u)\n\n  (func (export \"i64.atomic.rmw32.xchg_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw32.xchg_u)\n\n  (func (export \"i64.atomic.rmw32.xchg_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw32.xchg_u drop\n    i32.const 0 i64.load32_u)\n\n  (func (export \"i64.atomic.rmw.xchg-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw.xchg)\n\n  (func (export \"i64.atomic.rmw.xchg-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1           i64.atomic.rmw.xchg drop\n    i32.const 0 i64.load)\n\n\n  ;; Test bad alignment\n\n  (func (export \"bad_align-i32.atomic.rmw16.xchg_u\")\n    i32.const 1 i32.const 0 i32.atomic.rmw16.xchg_u drop)\n  (func (export \"bad_align-i32.atomic.rmw.xchg\")\n    i32.const 2 i32.const 0 i32.atomic.rmw.xchg drop)\n\n  (func (export \"bad_align-i64.atomic.rmw16.xchg_u\")\n    i32.const 1 i64.const 0 i64.atomic.rmw16.xchg_u drop)\n  (func (export \"bad_align-i64.atomic.rmw32.xchg_u\")\n    i32.const 2 i64.const 0 i64.atomic.rmw32.xchg_u drop)\n  (func (export \"bad_align-i64.atomic.rmw.xchg\")\n    i32.const 4 i64.const 0 i64.atomic.rmw.xchg drop)\n\n)\n(;; STDOUT ;;;\ni32.atomic.rmw8.xchg_u-result() => i32:64\ni32.atomic.rmw8.xchg_u-memory() => i32:1\ni32.atomic.rmw16.xchg_u-result() => i32:16960\ni32.atomic.rmw16.xchg_u-memory() => i32:1\ni32.atomic.rmw.xchg-result() => i32:1000000\ni32.atomic.rmw.xchg-memory() => i32:1\ni64.atomic.rmw8.xchg_u-result() => i64:0\ni64.atomic.rmw8.xchg_u-memory() => i64:1\ni64.atomic.rmw16.xchg_u-result() => i64:58368\ni64.atomic.rmw16.xchg_u-memory() => i64:1\ni64.atomic.rmw32.xchg_u-result() => i64:1410065408\ni64.atomic.rmw32.xchg_u-memory() => i64:1\ni64.atomic.rmw.xchg-result() => i64:10000000000\ni64.atomic.rmw.xchg-memory() => i64:1\nbad_align-i32.atomic.rmw16.xchg_u() => error: invalid atomic access at 1+0\nbad_align-i32.atomic.rmw.xchg() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw16.xchg_u() => error: invalid atomic access at 1+0\nbad_align-i64.atomic.rmw32.xchg_u() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw.xchg() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-rmw-xor.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n\n  ;; i32\n\n  (func (export \"i32.atomic.rmw8.xor_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw8.xor_u)\n\n  (func (export \"i32.atomic.rmw8.xor_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw8.xor_u drop\n    i32.const 0 i32.load8_u)\n\n  (func (export \"i32.atomic.rmw16.xor_u-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw16.xor_u)\n\n  (func (export \"i32.atomic.rmw16.xor_u-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw16.xor_u drop\n    i32.const 0 i32.load16_u)\n\n  (func (export \"i32.atomic.rmw.xor-result\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw.xor)\n\n  (func (export \"i32.atomic.rmw.xor-memory\") (result i32)\n    i32.const 0 i32.const 1000000 i32.store\n    i32.const 0 i32.const 65      i32.atomic.rmw.xor drop\n    i32.const 0 i32.load)\n\n\n  ;; i64\n\n  (func (export \"i64.atomic.rmw8.xor_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 65          i64.atomic.rmw8.xor_u)\n\n  (func (export \"i64.atomic.rmw8.xor_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 65        i64.atomic.rmw8.xor_u drop\n    i32.const 0 i64.load8_u)\n\n  (func (export \"i64.atomic.rmw16.xor_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw16.xor_u)\n\n  (func (export \"i64.atomic.rmw16.xor_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw16.xor_u drop\n    i32.const 0 i64.load16_u)\n\n  (func (export \"i64.atomic.rmw32.xor_u-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw32.xor_u)\n\n  (func (export \"i64.atomic.rmw32.xor_u-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw32.xor_u drop\n    i32.const 0 i64.load32_u)\n\n  (func (export \"i64.atomic.rmw.xor-result\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw.xor)\n\n  (func (export \"i64.atomic.rmw.xor-memory\") (result i64)\n    i32.const 0 i64.const 10000000000 i64.store\n    i32.const 0 i64.const 1025        i64.atomic.rmw.xor drop\n    i32.const 0 i64.load)\n\n\n  ;; Test bad alignment\n\n  (func (export \"bad_align-i32.atomic.rmw16.xor_u\")\n    i32.const 1 i32.const 0 i32.atomic.rmw16.xor_u drop)\n  (func (export \"bad_align-i32.atomic.rmw.xor\")\n    i32.const 2 i32.const 0 i32.atomic.rmw.xor drop)\n\n  (func (export \"bad_align-i64.atomic.rmw16.xor_u\")\n    i32.const 1 i64.const 0 i64.atomic.rmw16.xor_u drop)\n  (func (export \"bad_align-i64.atomic.rmw32.xor_u\")\n    i32.const 2 i64.const 0 i64.atomic.rmw32.xor_u drop)\n  (func (export \"bad_align-i64.atomic.rmw.xor\")\n    i32.const 4 i64.const 0 i64.atomic.rmw.xor drop)\n\n)\n(;; STDOUT ;;;\ni32.atomic.rmw8.xor_u-result() => i32:64\ni32.atomic.rmw8.xor_u-memory() => i32:1\ni32.atomic.rmw16.xor_u-result() => i32:16960\ni32.atomic.rmw16.xor_u-memory() => i32:16897\ni32.atomic.rmw.xor-result() => i32:1000000\ni32.atomic.rmw.xor-memory() => i32:999937\ni64.atomic.rmw8.xor_u-result() => i64:0\ni64.atomic.rmw8.xor_u-memory() => i64:65\ni64.atomic.rmw16.xor_u-result() => i64:58368\ni64.atomic.rmw16.xor_u-memory() => i64:57345\ni64.atomic.rmw32.xor_u-result() => i64:1410065408\ni64.atomic.rmw32.xor_u-memory() => i64:1410064385\ni64.atomic.rmw.xor-result() => i64:10000000000\ni64.atomic.rmw.xor-memory() => i64:9999998977\nbad_align-i32.atomic.rmw16.xor_u() => error: invalid atomic access at 1+0\nbad_align-i32.atomic.rmw.xor() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw16.xor_u() => error: invalid atomic access at 1+0\nbad_align-i64.atomic.rmw32.xor_u() => error: invalid atomic access at 2+0\nbad_align-i64.atomic.rmw.xor() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/atomic-store.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-threads\n(module\n  (memory 1 1 shared)\n\n  (func (export \"i32.atomic.store8\") (result i32)\n      i32.const 0 i32.const 0xfb i32.atomic.store8\n      i32.const 1 i32.const 0xfc i32.atomic.store8\n      i32.const 2 i32.const 0xfd i32.atomic.store8\n      i32.const 3 i32.const 0xfe i32.atomic.store8\n      i32.const 0 i32.load)\n\n  (func (export \"i32.atomic.store16\") (result i32)\n      i32.const 0 i32.const 0xcac9 i32.atomic.store16\n      i32.const 2 i32.const 0xcccb i32.atomic.store16\n      i32.const 0 i32.load)\n\n  (func (export \"i32.atomic.store\") (result i32)\n      i32.const 0 i32.const -123456 i32.atomic.store\n      i32.const 0 i32.load)\n\n  (func (export \"i64.atomic.store8\") (result i32)\n      i32.const 0 i64.const 0xeeeeeeeeeeeeeefb i64.atomic.store8\n      i32.const 1 i64.const 0xeeeeeeeeeeeeeefc i64.atomic.store8\n      i32.const 2 i64.const 0xeeeeeeeeeeeeeefd i64.atomic.store8\n      i32.const 3 i64.const 0xeeeeeeeeeeeeeefe i64.atomic.store8\n      i32.const 0 i32.load)\n\n  (func (export \"i64.atomic.store16\") (result i32)\n      i32.const 0 i64.const 0xeeeeeeeeeeeecac9 i64.atomic.store16\n      i32.const 2 i64.const 0xeeeeeeeeeeeecccb i64.atomic.store16\n      i32.const 0 i32.load)\n\n  (func (export \"i64.atomic.store32\") (result i32)\n      i32.const 0 i64.const -123456 i64.atomic.store32\n      i32.const 0 i32.load)\n\n  (func (export \"i64.atomic.store\") (result i64)\n      i32.const 0 i64.const 0xbaddc0de600dd00d i64.atomic.store\n      i32.const 0 i64.load)\n\n  ;; Test bad alignment\n\n  (func (export \"bad.align-i32.atomic.store16\")\n      i32.const 1 i32.const 0 i32.atomic.store16)\n  (func (export \"bad.align-i32.atomic.store\")\n      i32.const 2 i32.const 0 i32.atomic.store)\n\n  (func (export \"bad.align-i64.atomic.store16\")\n      i32.const 1 i64.const 0 i64.atomic.store16)\n  (func (export \"bad.align-i64.atomic.store32\")\n      i32.const 2 i64.const 0 i64.atomic.store32)\n  (func (export \"bad.align-i64.atomic.store\")\n      i32.const 4 i64.const 0 i64.atomic.store)\n\n)\n(;; STDOUT ;;;\ni32.atomic.store8() => i32:4278058235\ni32.atomic.store16() => i32:3435907785\ni32.atomic.store() => i32:4294843840\ni64.atomic.store8() => i32:4278058235\ni64.atomic.store16() => i32:3435907785\ni64.atomic.store32() => i32:4294843840\ni64.atomic.store() => i64:13465130522234441741\nbad.align-i32.atomic.store16() => error: invalid atomic access at 1+0\nbad.align-i32.atomic.store() => error: invalid atomic access at 2+0\nbad.align-i64.atomic.store16() => error: invalid atomic access at 1+0\nbad.align-i64.atomic.store32() => error: invalid atomic access at 2+0\nbad.align-i64.atomic.store() => error: invalid atomic access at 4+0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/basic-logging.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: -v\n(module\n  (func (export \"main\") (result i32)\n    i32.const 42\n    return))\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n; section \"Type\" (1)\n0000008: 01                                        ; section code\n0000009: 00                                        ; section size (guess)\n000000a: 01                                        ; num types\n; func type 0\n000000b: 60                                        ; func\n000000c: 00                                        ; num params\n000000d: 01                                        ; num results\n000000e: 7f                                        ; i32\n0000009: 05                                        ; FIXUP section size\n; section \"Function\" (3)\n000000f: 03                                        ; section code\n0000010: 00                                        ; section size (guess)\n0000011: 01                                        ; num functions\n0000012: 00                                        ; function 0 signature index\n0000010: 02                                        ; FIXUP section size\n; section \"Export\" (7)\n0000013: 07                                        ; section code\n0000014: 00                                        ; section size (guess)\n0000015: 01                                        ; num exports\n0000016: 04                                        ; string length\n0000017: 6d61 696e                                main  ; export name\n000001b: 00                                        ; export kind\n000001c: 00                                        ; export func index\n0000014: 08                                        ; FIXUP section size\n; section \"Code\" (10)\n000001d: 0a                                        ; section code\n000001e: 00                                        ; section size (guess)\n000001f: 01                                        ; num functions\n; function body 0\n0000020: 00                                        ; func body size (guess)\n0000021: 00                                        ; local decl count\n0000022: 41                                        ; i32.const\n0000023: 2a                                        ; i32 literal\n0000024: 0f                                        ; return\n0000025: 0b                                        ; end\n0000020: 05                                        ; FIXUP func body size\n000001e: 07                                        ; FIXUP section size\nBeginModule(version: 1)\n  BeginTypeSection(5)\n    OnTypeCount(1)\n    OnFuncType(index: 0, params: [], results: [i32])\n  EndTypeSection\n  BeginFunctionSection(2)\n    OnFunctionCount(1)\n    OnFunction(index: 0, sig_index: 0)\n  EndFunctionSection\n  BeginExportSection(8)\n    OnExportCount(1)\n    OnExport(index: 0, kind: func, item_index: 0, name: \"main\")\n  EndExportSection\n  BeginCodeSection(7)\n    OnFunctionBodyCount(1)\n    BeginFunctionBody(0, size:5)\n    OnLocalDeclCount(0)\n    EndLocalDecls\n    OnI32ConstExpr(42 (0x2a))\n    OnReturnExpr\n    OnEndExpr\n    EndFunctionBody(0)\n  EndCodeSection\nEndModule\n;;; STDERR ;;)\n(;; STDOUT ;;;\n   0| i32.const 42\n   8| return\n  12| return\nmain() => i32:42\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/basic-tracing.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS: --trace\n(module\n  (func $fib (param $n i32) (result i32)\n    local.get $n\n    i32.const 1\n    i32.le_s\n    if (result i32)\n      i32.const 1\n    else\n      local.get $n\n      i32.const 1\n      i32.sub\n      call $fib\n      local.get $n\n      i32.mul\n    end)\n\n  (func (export \"main\") (result i32)\n    i32.const 3\n    call $fib))\n(;; STDOUT ;;;\n>>> running export \"main\":\n#0.  100: V:0  | i32.const 3\n#0.  108: V:1  | call $0\n#1.    0: V:1  | local.get $1\n#1.    8: V:2  | i32.const 1\n#1.   16: V:3  | i32.le_s 3, 1\n#1.   20: V:2  | br_unless @44, 0\n#1.   44: V:1  | local.get $1\n#1.   52: V:2  | i32.const 1\n#1.   60: V:3  | i32.sub 3, 1\n#1.   64: V:2  | call $0\n#2.    0: V:2  | local.get $1\n#2.    8: V:3  | i32.const 1\n#2.   16: V:4  | i32.le_s 2, 1\n#2.   20: V:3  | br_unless @44, 0\n#2.   44: V:2  | local.get $1\n#2.   52: V:3  | i32.const 1\n#2.   60: V:4  | i32.sub 2, 1\n#2.   64: V:3  | call $0\n#3.    0: V:3  | local.get $1\n#3.    8: V:4  | i32.const 1\n#3.   16: V:5  | i32.le_s 1, 1\n#3.   20: V:4  | br_unless @44, 1\n#3.   28: V:3  | i32.const 1\n#3.   36: V:4  | br @84\n#3.   84: V:4  | drop_keep $1 $1\n#3.   96: V:3  | return\n#2.   72: V:3  | local.get $2\n#2.   80: V:4  | i32.mul 1, 2\n#2.   84: V:3  | drop_keep $1 $1\n#2.   96: V:2  | return\n#1.   72: V:2  | local.get $2\n#1.   80: V:3  | i32.mul 2, 3\n#1.   84: V:2  | drop_keep $1 $1\n#1.   96: V:1  | return\n#0.  116: V:1  | return\nmain() => i32:6\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/basic.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"main\") (result i32)\n    i32.const 42\n    return))\n(;; STDOUT ;;;\nmain() => i32:42\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/binary.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; i32\n  (func (export \"i32_add\") (result i32)\n    i32.const 1\n    i32.const 2 \n    i32.add)\n  (func (export \"i32_sub\") (result i32) \n    i32.const 20\n    i32.const 4\n    i32.sub)\n  (func (export \"i32_mul\") (result i32)\n    i32.const 3\n    i32.const 7\n    i32.mul)\n  (func (export \"i32_div_s\") (result i32)\n    i32.const -4\n    i32.const 2 \n    i32.div_s)\n  (func (export \"i32_div_u\") (result i32) \n    i32.const -4\n    i32.const 2\n    i32.div_u)\n  (func (export \"i32_rem_s\") (result i32) \n    i32.const -5\n    i32.const 2\n    i32.rem_s)\n  (func (export \"i32_rem_u\") (result i32)\n    i32.const -5\n    i32.const 2 \n    i32.rem_u)\n  (func (export \"i32_and\") (result i32)\n    i32.const 11\n    i32.const 5 \n    i32.and)\n  (func (export \"i32_or\") (result i32)\n    i32.const 11\n    i32.const 5 \n    i32.or)\n  (func (export \"i32_xor\") (result i32)\n    i32.const 11\n    i32.const 5 \n    i32.xor)\n  (func (export \"i32_shl\") (result i32)\n    i32.const -100\n    i32.const 3 \n    i32.shl)\n  (func (export \"i32_shr_u\") (result i32)\n    i32.const -100\n    i32.const 3 \n    i32.shr_u)\n  (func (export \"i32_shr_s\") (result i32)\n    i32.const -100\n    i32.const 3 \n    i32.shr_s)\n  (func (export \"i32_rotl\") (result i32)\n    i32.const -100\n    i32.const 3 \n    i32.rotl)\n  (func (export \"i32_rotr\") (result i32)\n    i32.const -100 \n    i32.const 3\n    i32.rotr)\n\n  ;; i64\n  (func (export \"i64_add\") (result i64)\n    i64.const 1\n    i64.const 2 \n    i64.add)\n  (func (export \"i64_sub\") (result i64)\n    i64.const 20\n    i64.const 4 \n    i64.sub)\n  (func (export \"i64_mul\") (result i64)\n    i64.const 3\n    i64.const 7 \n    i64.mul)\n  (func (export \"i64_div_s\") (result i64)\n    i64.const -4 \n    i64.const 2\n    i64.div_s)\n  (func (export \"i64_div_u\") (result i64)\n    i64.const -4\n    i64.const 2 \n    i64.div_u)\n  (func (export \"i64_rem_s\") (result i64)\n    i64.const -5\n    i64.const 2 \n    i64.rem_s)\n  (func (export \"i64_rem_u\") (result i64)\n    i64.const -5\n    i64.const 2 \n    i64.rem_u)\n  (func (export \"i64_and\") (result i64)\n    i64.const 11\n    i64.const 5 \n    i64.and)\n  (func (export \"i64_or\") (result i64)\n    i64.const 11\n    i64.const 5 \n    i64.or)\n  (func (export \"i64_xor\") (result i64)\n    i64.const 11\n    i64.const 5 \n    i64.xor)\n  (func (export \"i64_shl\") (result i64) \n    i64.const -100\n    i64.const 3\n    i64.shl)\n  (func (export \"i64_shr_u\") (result i64)\n    i64.const -100\n    i64.const 3 \n    i64.shr_u)\n  (func (export \"i64_shr_s\") (result i64)\n    i64.const -100\n    i64.const 3 \n    i64.shr_s)\n  (func (export \"i64_rotl\") (result i64)\n    i64.const -100\n    i64.const 3 \n    i64.rotl)\n  (func (export \"i64_rotr\") (result i64)\n    i64.const -100\n    i64.const 3 \n    i64.rotr)\n\n  ;; f32\n  (func (export \"f32_add\") (result f32)\n    f32.const 1.25\n    f32.const 3.75\n    f32.add)\n  (func (export \"f32_sub\") (result f32)\n    f32.const 4.5\n    f32.const 1e4\n    f32.sub)\n  (func (export \"f32_mul\") (result f32)\n    f32.const 1234.5\n    f32.const -6.875\n    f32.mul)\n  (func (export \"f32_div\") (result f32)\n    f32.const 1e14\n    f32.const -2e5\n    f32.div)\n  (func (export \"f32_min\") (result f32)\n    f32.const 0\n    f32.const 0\n    f32.min)\n  (func (export \"f32_max\") (result f32)\n    f32.const 0\n    f32.const 0\n    f32.max)\n  (func (export \"f32_copysign\") (result f32)\n    f32.const 0\n    f32.const 0\n    f32.copysign)\n\n  ;; f64\n  (func (export \"f64_add\") (result f64)\n    f64.const 987654321\n    f64.const 123456789\n    f64.add)\n  (func (export \"f64_sub\") (result f64)\n    f64.const 1234e56\n    f64.const 5.5e23\n    f64.sub)\n  (func (export \"f64_mul\") (result f64)\n    f64.const -123e4\n    f64.const 12341234\n    f64.mul)\n  (func (export \"f64_div\") (result f64)\n    f64.const 1e200\n    f64.const 1e50\n    f64.div)\n  (func (export \"f64_min\") (result f64)\n    f64.const 0\n    f64.const 0\n    f64.min)\n  (func (export \"f64_max\") (result f64)\n    f64.const 0\n    f64.const 0\n    f64.max)\n  (func (export \"f64_copysign\") (result f64)\n    f64.const 0\n    f64.const 0\n    f64.copysign)\n)\n(;; STDOUT ;;;\ni32_add() => i32:3\ni32_sub() => i32:16\ni32_mul() => i32:21\ni32_div_s() => i32:4294967294\ni32_div_u() => i32:2147483646\ni32_rem_s() => i32:4294967295\ni32_rem_u() => i32:1\ni32_and() => i32:1\ni32_or() => i32:15\ni32_xor() => i32:14\ni32_shl() => i32:4294966496\ni32_shr_u() => i32:536870899\ni32_shr_s() => i32:4294967283\ni32_rotl() => i32:4294966503\ni32_rotr() => i32:2684354547\ni64_add() => i64:3\ni64_sub() => i64:16\ni64_mul() => i64:21\ni64_div_s() => i64:18446744073709551614\ni64_div_u() => i64:9223372036854775806\ni64_rem_s() => i64:18446744073709551615\ni64_rem_u() => i64:1\ni64_and() => i64:1\ni64_or() => i64:15\ni64_xor() => i64:14\ni64_shl() => i64:18446744073709550816\ni64_shr_u() => i64:2305843009213693939\ni64_shr_s() => i64:18446744073709551603\ni64_rotl() => i64:18446744073709550823\ni64_rotr() => i64:11529215046068469747\nf32_add() => f32:5.000000\nf32_sub() => f32:-9995.500000\nf32_mul() => f32:-8487.187500\nf32_div() => f32:-500000000.000000\nf32_min() => f32:0.000000\nf32_max() => f32:0.000000\nf32_copysign() => f32:0.000000\nf64_add() => f64:1111111110.000000\nf64_sub() => f64:123400000000000007812762268812638756607430593436581896388608.000000\nf64_mul() => f64:-15179717820000.000000\nf64_div() => f64:999999999999999980835596172437374590573120014030318793091164810154100112203678582976298268616221151962702060266176005440567032331208403948233373515776.000000\nf64_min() => f64:0.000000\nf64_max() => f64:0.000000\nf64_copysign() => f64:0.000000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/block-multi.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"block-multi-result\") (result i32)\n    block (result i32 i32)\n      i32.const 1\n      i32.const 2\n    end\n    i32.add\n  )\n\n  (func (export \"block-multi-result-br\") (result i32)\n    block $b (result i32 i32)\n      block\n        i32.const 15\n        i32.const 7\n        br $b\n      end\n      i32.const -1\n      i32.const -2\n    end\n    drop)\n\n  (func (export \"block-param\") (result f32)\n    i32.const 2\n    block (param i32) (result f32)\n      f32.convert_i32_s\n    end\n  )\n)\n(;; STDOUT ;;;\nblock-multi-result() => i32:3\nblock-multi-result-br() => i32:15\nblock-param() => f32:2.000000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/br.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; basic br test\n  (func (export \"br0\") (result i32)\n    (local i32 i32)\n    block $exit\n      i32.const 1\n      if \n        br 1     ;; if branches introduce blocks\n      end\n      i32.const 1\n      local.set 0    ;; not executed\n    end\n    i32.const 1  \n    local.set 1\n    local.get 0\n    i32.const 0\n    i32.eq\n    local.get 1\n    i32.const 1\n    i32.eq\n    i32.add\n    return)\n\n  ;; test br-ing with a depth > 0\n  (func (export \"br1\") (result i32)\n    (local i32 i32 i32)\n    block $outer\n      block $inner\n        i32.const 1\n        if  \n          br 2\n        end     ;; if branches introduce blocks\n        i32.const 1\n        local.set 0    ;; not executed\n      end\n      i32.const 1\n      local.set 1    ;; not executed\n    end\n    i32.const 1\n    local.set 2\n    local.get 0\n    i32.const 0\n    i32.eq\n    local.get 1\n    i32.const 0\n    i32.eq\n    i32.add\n    local.get 2\n    i32.const 1\n    i32.eq\n    i32.add\n    return)\n\n  ;; test br-ing to a label\n  (func (export \"br2\") (result i32)\n    block $exit\n      block\n        i32.const 1\n        if\n          br $exit\n        end\n        i32.const 1\n        return      ;; not executed\n      end\n    end\n    i32.const 2  \n    return)\n\n  ;; test br-ing in a loop with an exit and continue continuation\n  (func (export \"br3\") (result i32)\n    (local i32 i32)\n    block $exit\n      loop $cont\n        local.get 0\n        i32.const 1\n        i32.add\n        local.set 0\n        local.get 0\n        i32.const 5\n        i32.ge_s\n        if\n          br $exit\n        end\n        local.get 0\n        i32.const 4\n        i32.eq \n        if \n          (br $cont)\n        end\n        local.get 0\n        local.set 1\n        br $cont\n      end\n    end\n    local.get 1\n    return)\n)\n(;; STDOUT ;;;\nbr0() => i32:2\nbr1() => i32:3\nbr2() => i32:2\nbr3() => i32:3\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/brif-loop.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $f (param i32) (result i32)\n    (local i32)\n    loop $cont\n      local.get 1\n      i32.const 1\n      i32.add\n      local.set 1\n      local.get 1\n      local.get 0\n      i32.lt_s\n      br_if $cont\n    end\n    local.get 1\n    return)\n\n  (func (export \"test1\") (result i32)\n    i32.const 3\n    call $f)\n\n  (func (export \"test2\") (result i32)\n    i32.const 10\n    call $f))\n(;; STDOUT ;;;\ntest1() => i32:3\ntest2() => i32:10\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/brif.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $f (param i32) (result i32)\n    block $exit\n      local.get 0\n      br_if $exit\n      i32.const 1\n      return\n    end\n    i32.const 2\n    return)\n\n  (func (export \"test1\") (result i32)\n    i32.const 0\n    call $f)\n\n  (func (export \"test2\") (result i32)\n    i32.const 1\n    call $f))\n(;; STDOUT ;;;\ntest1() => i32:1\ntest2() => i32:2\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/brtable.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $f (param i32) (result i32)\n    block $default\n      block $2\n        block $1\n          block $0\n            local.get 0\n            br_table $0 $1 $2 $default\n          end\n          ;; 0\n          i32.const 0\n          return\n        end\n        ;; 1\n        i32.const 1\n        return \n       end\n      end\n      ;; 2, fallthrough\n      \n    ;; default\n    i32.const 2\n    return)\n\n  (func (export \"test0\") (result i32)\n    i32.const 0 \n    call $f)\n  (func (export \"test1\") (result i32) \n    i32.const 1\n    call $f)\n  (func (export \"test2\") (result i32)\n    i32.const 2 \n    call $f)\n  (func (export \"test3\") (result i32)\n    i32.const 3\n    call $f))\n(;; STDOUT ;;;\ntest0() => i32:0\ntest1() => i32:1\ntest2() => i32:2\ntest3() => i32:2\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/call-dummy-import.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS: --dummy-import-func\n(module\n  (import \"foo\" \"bar\" (func $bar (param i32 f32) (result i32)))\n  (import \"baz\" \"quux\" (func $quux (param f64) (result i64)))\n\n  (func (export \"f1\") (result i32)\n    i32.const 1\n    f32.const 2\n    call $bar)\n\n  (func (export \"f2\") (result i64)\n    f64.const 3\n    call $quux))\n(;; STDOUT ;;;\ncalled host foo.bar(i32:1, f32:2.000000) => i32:0\nf1() => i32:0\ncalled host baz.quux(f64:3.000000) => i64:0\nf2() => i64:0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/call-multi-result.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $i32_i64 (result i32 i64)\n    i32.const 1\n    i64.const 2)\n\n  (func (export \"call-multi-result\") (result i32)\n    call $i32_i64\n    i32.wrap_i64\n    i32.add)\n\n  (func $rot_f32_3 (param f32 f32 f32) (result f32 f32 f32)\n    local.get 1\n    local.get 2\n    local.get 0)\n\n  (func (export \"call-multi-param-result\") (result i32)\n    block $fail\n      f32.const 11\n      f32.const 22\n      f32.const 33\n\n      ;; updates stack: 11 22 33 -- 22 33 11\n      call $rot_f32_3\n\n      f32.const 11\n      f32.ne\n      br_if $fail\n\n      f32.const 33\n      f32.ne\n      br_if $fail\n\n      f32.const 22\n      f32.ne\n      br_if $fail\n\n      i32.const 1\n      return\n    end\n\n    i32.const 0)\n)\n(;; STDOUT ;;;\ncall-multi-result() => i32:3\ncall-multi-param-result() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/call-zero-args.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $f (result i32)\n    i32.const 42)\n\n  (func $g (param i32 i32) (result i32)\n    local.get 0\n    local.get 1\n    i32.add)\n\n  (func (export \"h\") (result i32)\n    i32.const 1\n    call $f\n    call $g))\n(;; STDOUT ;;;\nh() => i32:43\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/call.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"call\") (result i32)\n    i32.const 1\n    i64.const 2\n    f32.const 3\n    f64.const 4\n    call $helper)\n\n  (func $helper (param i32 i64 f32 f64) (result i32)\n    local.get 1\n    i32.wrap_i64\n    local.get 0\n    i32.add\n    local.get 2\n    i32.trunc_f32_s\n    i32.add\n    local.get 3\n    i32.trunc_f64_s\n    i32.add\n    return)\n\n  (func (export \"fac10\") (result i32)\n    i32.const 10\n    call $fac)\n\n\n  (func $fac (param i32) (result i32)\n    local.get 0\n    i32.const 0\n    i32.gt_s \n    if (result i32)\n      local.get 0\n      local.get 0\n      i32.const 1\n      i32.sub\n      call $fac\n      i32.mul\n      return\n    else\n      i32.const 1\n      return\n    end) \n)\n(;; STDOUT ;;;\ncall() => i32:10\nfac10() => i32:3628800\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/callimport-zero-args.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS: --host-print\n(module\n  (import \"host\" \"print\" (func $imported (result i32)))\n\n  (func (export \"f\") (result i32)\n    i32.const 13\n    call $imported\n    i32.add))\n(;; STDOUT ;;;\ncalled host host.print() => i32:0\nf() => i32:13\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/callindirect.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (type $v_i (func (result i32)))\n  (func $zero (type $v_i) \n     i32.const 0)\n  (func $one (type $v_i) \n     i32.const 1)\n\n  (func $nullary (param i32) (result i32)\n    local.get 0\n    call_indirect (type $v_i))\n\n  (type $ii_i (func (param i32 i32) (result i32)))\n  (func $add (type $ii_i)\n    local.get 0 \n    local.get 1\n    i32.add)\n  (func $sub (type $ii_i)\n     local.get 0\n     local.get 1 \n     i32.sub)\n\n  (func $binary (param i32 i32 i32) (result i32)\n    local.get 0\n    local.get 1\n    local.get 2\n    call_indirect (type $ii_i))\n\n  (table funcref (elem $zero $one $add $sub))\n\n  (func (export \"test_zero\") (result i32)\n    i32.const 0\n    call $nullary)\n\n  (func (export \"test_one\") (result i32)\n    i32.const 1\n    call $nullary)\n\n  (func (export \"test_add\") (result i32)\n    i32.const 10\n    i32.const 4\n    i32.const 2\n    call $binary)\n\n  (func (export \"test_sub\") (result i32)\n    i32.const 10\n    i32.const 4\n    i32.const 3\n    call $binary)\n\n  (func (export \"trap_oob\") (result i32)\n    i32.const 10\n    i32.const 4\n    i32.const 4\n    call $binary)\n\n  (func (export \"trap_sig_mismatch\") (result i32)\n    i32.const 10\n    i32.const 4\n    i32.const 0\n    call $binary))\n(;; STDOUT ;;;\ntest_zero() => i32:0\ntest_one() => i32:1\ntest_add() => i32:14\ntest_sub() => i32:6\ntrap_oob() => error: undefined table index\ntrap_sig_mismatch() => error: indirect call signature mismatch\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/cast.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"f32_reinterpret_i32\") (result f32)\n    i32.const 0x40900000\n    f32.reinterpret_i32)\n\n  (func (export \"i32_reinterpret_f32\") (result i32)\n    f32.const -3.5\n    i32.reinterpret_f32)\n\n  (func (export \"f64_reinterpret_i64\") (result f64)\n    i64.const 0x405f480000000000\n    f64.reinterpret_i64)\n\n  (func (export \"i64_reinterpret_f64\") (result i64)\n    f64.const 1.375e10\n    i64.reinterpret_f64))\n(;; STDOUT ;;;\nf32_reinterpret_i32() => f32:4.500000\ni32_reinterpret_f32() => i32:3227516928\nf64_reinterpret_i64() => f64:125.125000\ni64_reinterpret_f64() => i64:4758506566875873280\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/compare.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; i32\n  (func (export \"i32_eq_true\") (result i32)\n    i32.const -1\n    i32.const -1 \n    i32.eq)\n  (func (export \"i32_eq_false\") (result i32) \n    i32.const 1\n    i32.const -1\n    i32.eq)\n  (func (export \"i32_ne_true\") (result i32)\n    i32.const 1\n    i32.const -1 \n    i32.ne)\n  (func (export \"i32_ne_false\") (result i32)\n    i32.const -1\n    i32.const -1 \n    i32.ne)\n  (func (export \"i32_lt_s_less\") (result i32)\n    i32.const -1\n    i32.const 1 \n    i32.lt_s)\n  (func (export \"i32_lt_s_equal\") (result i32)\n    i32.const -1\n    i32.const -1 \n    i32.lt_s)\n  (func (export \"i32_lt_s_greater\") (result i32) \n    i32.const 1\n    i32.const -1\n    i32.lt_s)\n  (func (export \"i32_lt_u_less\") (result i32)\n    i32.const 1\n    i32.const -1 \n    i32.lt_u )\n  (func (export \"i32_lt_u_equal\") (result i32)\n    i32.const 1\n    i32.const 1 \n    i32.lt_u)\n  (func (export \"i32_lt_u_greater\") (result i32)\n    i32.const -1 \n    i32.const 1\n    i32.lt_u)\n  (func (export \"i32_le_s_less\") (result i32)\n    i32.const -1\n    i32.const 1 \n    i32.le_s)\n\n  (func (export \"i32_le_s_equal\") (result i32)\n    i32.const -1\n    i32.const -1\n    i32.le_s)\n  (func (export \"i32_le_s_greater\") (result i32)\n    i32.const 1 \n    i32.const -1\n    i32.le_s)\n\n  (func (export \"i32_le_u_less\") (result i32)\n    i32.const 1\n    i32.const -1 \n    i32.le_u)\n  (func (export \"i32_le_u_equal\") (result i32)\n    i32.const 1\n    i32.const 1 \n    i32.le_u)\n  (func (export \"i32_le_u_greater\") (result i32) \n    i32.const -1\n    i32.const 1\n    i32.le_u)\n\n  (func (export \"i32_gt_s_less\") (result i32)\n    i32.const -1\n    i32.const 1 \n    i32.gt_s)\n  (func (export \"i32_gt_s_equal\") (result i32)\n    i32.const -1\n    i32.const -1\n    i32.gt_s)\n  (func (export \"i32_gt_s_greater\") (result i32)\n    i32.const 1 \n    i32.const -1\n    i32.gt_s)\n\n  (func (export \"i32_gt_u_less\") (result i32)\n    i32.const 1\n    i32.const -1 \n    i32.gt_u)\n  (func (export \"i32_gt_u_equal\") (result i32)\n    i32.const 1\n    i32.const 1 \n    i32.gt_u)\n  (func (export \"i32_gt_u_greater\") (result i32)\n    i32.const -1\n    i32.const 1 \n    i32.gt_u)\n\n  (func (export \"i32_ge_s_less\") (result i32)\n    i32.const -1\n    i32.const 1 \n    i32.ge_s)\n  (func (export \"i32_ge_s_equal\") (result i32)\n    i32.const -1\n    i32.const -1 \n    i32.ge_s)\n  (func (export \"i32_ge_s_greater\") (result i32)\n    i32.const 1\n    i32.const -1\n    i32.ge_s)\n\n  (func (export \"i32_ge_u_less\") (result i32)\n    i32.const 1 \n    i32.const -1\n    i32.ge_u)\n  (func (export \"i32_ge_u_equal\") (result i32)\n    i32.const 1\n    i32.const 1 \n    i32.ge_u)\n  (func (export \"i32_ge_u_greater\") (result i32)\n    i32.const -1\n    i32.const 1 \n    i32.ge_u)\n\n  ;; i64\n  (func (export \"i64_eq_true\") (result i32)\n    i64.const -1 \n    i64.const -1\n    i64.eq)\n  (func (export \"i64_eq_false\") (result i32)\n    i64.const 1\n    i64.const -1 \n    i64.eq)\n\n  (func (export \"i64_ne_true\") (result i32)\n    i64.const 1\n    i64.const -1 \n    i64.ne)\n  (func (export \"i64_ne_false\") (result i32)\n    i64.const -1\n    i64.const -1 \n    i64.ne)\n\n  (func (export \"i64_lt_s_less\") (result i32)\n    i64.const -1\n    i64.const 1 \n    i64.lt_s)\n  (func (export \"i64_lt_s_equal\") (result i32)\n    i64.const -1\n    i64.const -1 \n    i64.lt_s)\n  (func (export \"i64_lt_s_greater\") (result i32)\n    i64.const 1\n    i64.const -1 \n    i64.lt_s)\n\n  (func (export \"i64_lt_u_less\") (result i32)\n    i64.const 1 \n    i64.const -1\n    i64.lt_u)\n  (func (export \"i64_lt_u_equal\") (result i32)\n    i64.const 1\n    i64.const 1 \n    i64.lt_u)\n  (func (export \"i64_lt_u_greater\") (result i32)\n    i64.const -1\n    i64.const 1 \n    i64.lt_u)\n\n  (func (export \"i64_le_s_less\") (result i32)\n    i64.const -1\n    i64.const 1 \n    i64.le_s)\n  (func (export \"i64_le_s_equal\") (result i32)\n    i64.const -1\n    i64.const -1 \n    i64.le_s)\n  (func (export \"i64_le_s_greater\") (result i32)\n    i64.const 1\n    i64.const -1 \n    i64.le_s)\n\n  (func (export \"i64_le_u_less\") (result i32)\n    i64.const 1\n    i64.const -1 \n    i64.le_u)\n  (func (export \"i64_le_u_equal\") (result i32)\n    i64.const 1\n    i64.const 1 \n    i64.le_u)\n  (func (export \"i64_le_u_greater\") (result i32)\n    i64.const -1 \n    i64.const 1\n    i64.le_u)\n\n  (func (export \"i64_gt_s_less\") (result i32)\n    i64.const -1 \n    i64.const 1\n    i64.gt_s)\n  (func (export \"i64_gt_s_equal\") (result i32)\n    i64.const -1 \n    i64.const -1\n    i64.gt_s)\n  (func (export \"i64_gt_s_greater\") (result i32)\n    i64.const 1\n    i64.const -1 \n    i64.gt_s)\n\n  (func (export \"i64_gt_u_less\") (result i32)\n    i64.const 1\n    i64.const -1 \n    i64.gt_u)\n  (func (export \"i64_gt_u_equal\") (result i32)\n    i64.const 1 \n    i64.const 1\n    i64.gt_u)\n  (func (export \"i64_gt_u_greater\") (result i32)\n    i64.const -1\n    i64.const 1 \n    i64.gt_u)\n\n  (func (export \"i64_ge_s_less\") (result i32)\n    i64.const -1\n    i64.const 1 \n    i64.ge_s)\n  (func (export \"i64_ge_s_equal\") (result i32)\n    i64.const -1\n    i64.const -1 \n    i64.ge_s)\n  (func (export \"i64_ge_s_greater\") (result i32)\n    i64.const 1\n    i64.const -1 \n    i64.ge_s)\n\n  (func (export \"i64_ge_u_less\") (result i32) \n    i64.const 1\n    i64.const -1\n    i64.ge_u)\n  (func (export \"i64_ge_u_equal\") (result i32)\n    i64.const 1\n    i64.const 1 \n    i64.ge_u)\n  (func (export \"i64_ge_u_greater\") (result i32) \n     i64.const -1\n     i64.const 1\n     i64.ge_u)\n\n  ;; f32\n  (func (export \"f32_eq_true\") (result i32)\n    f32.const -1\n    f32.const -1 \n    f32.eq)\n  (func (export \"f32_eq_false\") (result i32)\n    f32.const 1 \n    f32.const -1\n    f32.eq)\n\n  (func (export \"f32_ne_true\") (result i32)\n    f32.const 1\n    f32.const -1 \n    f32.ne)\n  (func (export \"f32_ne_false\") (result i32)\n    f32.const -1\n    f32.const -1 \n    f32.ne)\n\n  (func (export \"f32_lt_less\") (result i32)\n    f32.const -1\n    f32.const 1 \n    f32.lt)\n  (func (export \"f32_lt_equal\") (result i32)\n    f32.const -1\n    f32.const -1 \n    f32.lt)\n  (func (export \"f32_lt_greater\") (result i32)\n    f32.const 1\n    f32.const -1 \n    f32.lt)\n\n  (func (export \"f32_le_less\") (result i32) \n    f32.const -1\n    f32.const 1\n    f32.le)\n  (func (export \"f32_le_equal\") (result i32)\n    f32.const -1\n    f32.const -1 \n    f32.le)\n  (func (export \"f32_le_greater\") (result i32)\n    f32.const 1\n    f32.const -1 \n    f32.le)\n\n  (func (export \"f32_gt_less\") (result i32)\n    f32.const -1\n    f32.const 1 \n    f32.gt)\n  (func (export \"f32_gt_equal\") (result i32)\n    f32.const -1\n    f32.const -1 \n    f32.gt)\n  (func (export \"f32_gt_greater\") (result i32)\n    f32.const 1\n    f32.const -1 \n    f32.gt)\n\n  (func (export \"f32_ge_less\") (result i32)\n    f32.const -1\n    f32.const 1 \n    f32.ge)\n  (func (export \"f32_ge_equal\") (result i32)\n    f32.const -1 \n    f32.const -1\n    f32.ge)\n  (func (export \"f32_ge_greater\") (result i32)\n    f32.const 1\n    f32.const -1 \n    f32.ge)\n\n  ;; f64\n  (func (export \"f64_eq_true\") (result i32) \n    f64.const -1\n    f64.const -1\n    f64.eq)\n  (func (export \"f64_eq_false\") (result i32)\n    f64.const 1 \n    f64.const -1\n    f64.eq)\n\n  (func (export \"f64_ne_true\") (result i32)\n    f64.const 1\n    f64.const -1 \n    f64.ne)\n  (func (export \"f64_ne_false\") (result i32)\n    f64.const -1\n    f64.const -1 \n    f64.ne)\n\n  (func (export \"f64_lt_less\") (result i32)\n    f64.const -1\n    f64.const 1 \n    f64.lt)\n  (func (export \"f64_lt_equal\") (result i32)\n    f64.const -1\n    f64.const -1 \n    f64.lt)\n  (func (export \"f64_lt_greater\") (result i32)\n    f64.const 1\n    f64.const -1 \n    f64.lt)\n\n  (func (export \"f64_le_less\") (result i32)\n    f64.const -1\n    f64.const 1 \n    f64.le)\n  (func (export \"f64_le_equal\") (result i32) \n    f64.const -1\n    f64.const -1\n    f64.le)\n  (func (export \"f64_le_greater\") (result i32)\n    f64.const 1\n    f64.const -1 \n    f64.le)\n\n  (func (export \"f64_gt_less\") (result i32)\n    f64.const -1 \n    f64.const 1\n    f64.gt)\n  (func (export \"f64_gt_equal\") (result i32)\n    f64.const -1 \n    f64.const -1\n    f64.gt)\n  (func (export \"f64_gt_greater\") (result i32)\n    f64.const 1\n    f64.const -1 \n    f64.gt)\n\n  (func (export \"f64_ge_less\") (result i32)\n    f64.const -1\n    f64.const 1 \n    f64.ge)\n  (func (export \"f64_ge_equal\") (result i32)\n    f64.const -1\n    f64.const -1 \n    f64.ge)\n  (func (export \"f64_ge_greater\") (result i32)\n    f64.const 1\n    f64.const -1 \n    f64.ge)\n)\n(;; STDOUT ;;;\ni32_eq_true() => i32:1\ni32_eq_false() => i32:0\ni32_ne_true() => i32:1\ni32_ne_false() => i32:0\ni32_lt_s_less() => i32:1\ni32_lt_s_equal() => i32:0\ni32_lt_s_greater() => i32:0\ni32_lt_u_less() => i32:1\ni32_lt_u_equal() => i32:0\ni32_lt_u_greater() => i32:0\ni32_le_s_less() => i32:1\ni32_le_s_equal() => i32:1\ni32_le_s_greater() => i32:0\ni32_le_u_less() => i32:1\ni32_le_u_equal() => i32:1\ni32_le_u_greater() => i32:0\ni32_gt_s_less() => i32:0\ni32_gt_s_equal() => i32:0\ni32_gt_s_greater() => i32:1\ni32_gt_u_less() => i32:0\ni32_gt_u_equal() => i32:0\ni32_gt_u_greater() => i32:1\ni32_ge_s_less() => i32:0\ni32_ge_s_equal() => i32:1\ni32_ge_s_greater() => i32:1\ni32_ge_u_less() => i32:0\ni32_ge_u_equal() => i32:1\ni32_ge_u_greater() => i32:1\ni64_eq_true() => i32:1\ni64_eq_false() => i32:0\ni64_ne_true() => i32:1\ni64_ne_false() => i32:0\ni64_lt_s_less() => i32:1\ni64_lt_s_equal() => i32:0\ni64_lt_s_greater() => i32:0\ni64_lt_u_less() => i32:1\ni64_lt_u_equal() => i32:0\ni64_lt_u_greater() => i32:0\ni64_le_s_less() => i32:1\ni64_le_s_equal() => i32:1\ni64_le_s_greater() => i32:0\ni64_le_u_less() => i32:1\ni64_le_u_equal() => i32:1\ni64_le_u_greater() => i32:0\ni64_gt_s_less() => i32:0\ni64_gt_s_equal() => i32:0\ni64_gt_s_greater() => i32:1\ni64_gt_u_less() => i32:0\ni64_gt_u_equal() => i32:0\ni64_gt_u_greater() => i32:1\ni64_ge_s_less() => i32:0\ni64_ge_s_equal() => i32:1\ni64_ge_s_greater() => i32:1\ni64_ge_u_less() => i32:0\ni64_ge_u_equal() => i32:1\ni64_ge_u_greater() => i32:1\nf32_eq_true() => i32:1\nf32_eq_false() => i32:0\nf32_ne_true() => i32:1\nf32_ne_false() => i32:0\nf32_lt_less() => i32:1\nf32_lt_equal() => i32:0\nf32_lt_greater() => i32:0\nf32_le_less() => i32:1\nf32_le_equal() => i32:1\nf32_le_greater() => i32:0\nf32_gt_less() => i32:0\nf32_gt_equal() => i32:0\nf32_gt_greater() => i32:1\nf32_ge_less() => i32:0\nf32_ge_equal() => i32:1\nf32_ge_greater() => i32:1\nf64_eq_true() => i32:1\nf64_eq_false() => i32:0\nf64_ne_true() => i32:1\nf64_ne_false() => i32:0\nf64_lt_less() => i32:1\nf64_lt_equal() => i32:0\nf64_lt_greater() => i32:0\nf64_le_less() => i32:1\nf64_le_equal() => i32:1\nf64_le_greater() => i32:0\nf64_gt_less() => i32:0\nf64_gt_equal() => i32:0\nf64_gt_greater() => i32:1\nf64_ge_less() => i32:0\nf64_ge_equal() => i32:1\nf64_ge_greater() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/convert-sat.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"i32.trunc_sat_f32_s\") (result i32)\n    f32.const -100.12345\n    i32.trunc_sat_f32_s)\n\n  (func (export \"i32.trunc_sat_f32_u\") (result i32)\n    f32.const 3e9\n    i32.trunc_sat_f32_u)\n\n  (func (export \"i32.trunc_sat_f64_s\") (result i32)\n    f64.const -100.12345\n    i32.trunc_sat_f64_s)\n\n  (func (export \"i32.trunc_sat_f64_u\") (result i32)\n    f64.const 3e9\n    i32.trunc_sat_f64_u)\n\n  (func (export \"i64.trunc_sat_f32_s\") (result i64)\n    f32.const -100.12345\n    i64.trunc_sat_f32_s)\n\n  (func (export \"i64.trunc_sat_f32_u\") (result i64)\n    f32.const 3e9\n    i64.trunc_sat_f32_u)\n\n  (func (export \"i64.trunc_sat_f64_s\") (result i64)\n    f64.const -100.12345\n    i64.trunc_sat_f64_s)\n\n  (func (export \"i64.trunc_sat_f64_u\") (result i64)\n    f64.const 3e9\n    i64.trunc_sat_f64_u))\n(;; STDOUT ;;;\ni32.trunc_sat_f32_s() => i32:4294967196\ni32.trunc_sat_f32_u() => i32:3000000000\ni32.trunc_sat_f64_s() => i32:4294967196\ni32.trunc_sat_f64_u() => i32:3000000000\ni64.trunc_sat_f32_s() => i64:18446744073709551516\ni64.trunc_sat_f32_u() => i64:3000000000\ni64.trunc_sat_f64_s() => i64:18446744073709551516\ni64.trunc_sat_f64_u() => i64:3000000000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/convert.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; i32\n  (func (export \"i32_wrap_i64\") (result i32) \n    i64.const -1\n    i32.wrap_i64)\n  ;; TODO(binji): how best to distinguish _s from _u?\n  (func (export \"i32_trunc_s_f32\") (result i32)\n    f32.const -100.12345 \n    i32.trunc_f32_s)\n  (func (export \"i32_trunc_u_f32\") (result i32)\n    f32.const 3e9 \n    i32.trunc_f32_u)\n  (func (export \"i32_trunc_s_f64\") (result i32)\n    f64.const -100.12345 \n    i32.trunc_f64_s)\n  (func (export \"i32_trunc_u_f64\") (result i32)\n    f64.const 3e9 \n    i32.trunc_f64_u)\n\n  ;; i64\n  (func (export \"i64_extend_u_i32\") (result i64) \n    i32.const -1\n    i64.extend_i32_u)\n  (func (export \"i64_extend_s_i32\") (result i64)\n    i32.const -1 \n    i64.extend_i32_s)\n\n  (func (export \"i64_trunc_s_f32\") (result i32)\n     f32.const -100.12345\n     i64.trunc_f32_s \n     i64.const -100\n     i64.eq)\n  (func (export \"i64_trunc_u_f32\") (result i32)\n     f32.const 3e9\n     i64.trunc_f32_u\n     i64.const 3000000000\n     i64.eq)\n  (func (export \"i64_trunc_s_f64\") (result i32)\n     f64.const -100.12345\n     i64.trunc_f64_s\n     i64.const -100\n     i64.eq)\n  (func (export \"i64_trunc_u_f64\") (result i32)\n     f64.const 3e9\n     i64.trunc_f64_u\n     i64.const 3000000000\n     i64.eq)\n\n  ;; f32\n  (func (export \"f32_convert_s_i32\") (result f32)\n    i32.const -1 \n    f32.convert_i32_s)\n  (func (export \"f32_convert_u_i32\") (result f32) \n    i32.const -1\n    f32.convert_i32_u)\n  (func (export \"f32_demote_f64\") (result f32)\n    f64.const 12345678.9 \n    f32.demote_f64)\n  (func (export \"f32_convert_s_i64\") (result f32) \n    i64.const 0\n    f32.convert_i64_s)\n  (func (export \"f32_convert_u_i64\") (result f32) \n    i64.const 0\n    f32.convert_i64_u)\n\n  ;; f64\n  (func (export \"f64_convert_s_i32\") (result f64)\n    i32.const -1 \n    f64.convert_i32_s)\n  (func (export \"f64_convert_u_i32\") (result f64) \n    i32.const -1\n    f64.convert_i32_u)\n  (func (export \"f64_demote_f32\") (result f64)\n    f32.const 12345678.9 \n    f64.promote_f32)\n  (func (export \"f64_convert_s_i64\") (result f64) \n    i64.const 0\n    f64.convert_i64_s)\n  (func (export \"f64_convert_u_i64\") (result f64) \n    i64.const 0\n    f64.convert_i64_u)\n)\n(;; STDOUT ;;;\ni32_wrap_i64() => i32:4294967295\ni32_trunc_s_f32() => i32:4294967196\ni32_trunc_u_f32() => i32:3000000000\ni32_trunc_s_f64() => i32:4294967196\ni32_trunc_u_f64() => i32:3000000000\ni64_extend_u_i32() => i64:4294967295\ni64_extend_s_i32() => i64:18446744073709551615\ni64_trunc_s_f32() => i32:1\ni64_trunc_u_f32() => i32:1\ni64_trunc_s_f64() => i32:1\ni64_trunc_u_f64() => i32:1\nf32_convert_s_i32() => f32:-1.000000\nf32_convert_u_i32() => f32:4294967296.000000\nf32_demote_f64() => f32:12345679.000000\nf32_convert_s_i64() => f32:0.000000\nf32_convert_u_i64() => f32:0.000000\nf64_convert_s_i32() => f64:-1.000000\nf64_convert_u_i32() => f64:4294967295.000000\nf64_demote_f32() => f64:12345679.000000\nf64_convert_s_i64() => f64:0.000000\nf64_convert_u_i64() => f64:0.000000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/custom-page-sizes.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ARGS*: --enable-custom-page-sizes --enable-memory64\n\n;; Page size of zero is malformed\n(assert_malformed\n  (module quote \"(memory 0 (pagesize 0))\")\n  \"invalid custom page size\")\n\n;; Maximum memory sizes with pagesize 1 and 65536\n;; These are valid but would instantiate a huge memory,\n;; so test with `assert_unlinkable`.\n\n;; i32 (pagesize 1)\n(assert_unlinkable\n  (module\n    (import \"test\" \"unknown\" (func))\n    (memory 0xFFFF_FFFF (pagesize 1)))\n  \"unknown import\")\n\n;; i64 (pagesize 1)\n(assert_unlinkable\n  (module\n    (import \"test\" \"import\" (func))\n    (memory i64 0xFFFF_FFFF_FFFF_FFFF (pagesize 1)))\n  \"unknown import\")\n\n;; i32 (default pagesize)\n(assert_unlinkable\n  (module\n    (import \"test\" \"unknown\" (func))\n    (memory 65536 (pagesize 65536)))\n  \"unknown import\")\n\n;; i64 (default pagesize)\n(assert_unlinkable\n  (module\n    (import \"test\" \"unknown\" (func))\n    (memory i64 0x1_0000_0000_0000 (pagesize 65536)))\n  \"unknown import\")\n\n;; Memory size just over the maximum.\n;;\n;; These are malformed (for pagesize 1)\n;; or invalid (for other pagesizes).\n\n;; i32 (pagesize 1)\n(assert_malformed\n  (module quote \"(memory 0x1_0000_0000 (pagesize 1))\")\n  \"constant out of range\")\n\n;; i64 (pagesize 1)\n(assert_malformed\n  (module quote \"(memory i64 0x1_0000_0000_0000_0000 (pagesize 1))\")\n  \"constant out of range\")\n\n;; i32 (default pagesize)\n(assert_invalid\n  (module\n    (memory 65537 (pagesize 65536)))\n  \"memory size must be at most\")\n\n;; i64 (default pagesize)\n(assert_invalid\n  (module\n    (memory i64 0x1_0000_0000_0001 (pagesize 65536)))\n  \"memory size must be at most\")\n\n;; Test data abbreviation syntax\n\n(assert_malformed (module quote \"(memory (pagesize 0) (data))\") \"invalid custom page size\")\n\n(module\n  (memory (pagesize 1) (data \"xyz\"))\n  (func (export \"size\") (result i32)\n    memory.size)\n  (func (export \"grow\") (param i32) (result i32)\n    (memory.grow (local.get 0)))\n  (func (export \"load\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_return (invoke \"size\") (i32.const 3))\n(assert_return (invoke \"load\" (i32.const 0)) (i32.const 120))\n(assert_return (invoke \"load\" (i32.const 1)) (i32.const 121))\n(assert_return (invoke \"load\" (i32.const 2)) (i32.const 122))\n(assert_trap (invoke \"load\" (i32.const 3)) \"out of bounds\")\n(assert_return (invoke \"grow\" (i32.const 1)) (i32.const -1))\n\n(module\n  (memory (pagesize 65536) (data \"xyz\"))\n  (func (export \"size\") (result i32)\n        memory.size))\n\n(assert_return (invoke \"size\") (i32.const 1))\n\n(;; STDOUT ;;;\nout/test/interp/custom-page-sizes.txt:6: assert_malformed passed:\n  out/test/interp/custom-page-sizes/custom-page-sizes.0.wat:1:21: error: malformed custom page size\n  (memory 0 (pagesize 0))\n                      ^\nout/test/interp/custom-page-sizes.txt:15: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/interp/custom-page-sizes.txt:22: assert_unlinkable passed:\n  error: invalid import \"test.import\"\nout/test/interp/custom-page-sizes.txt:29: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/interp/custom-page-sizes.txt:36: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/interp/custom-page-sizes.txt:48: assert_malformed passed:\n  out/test/interp/custom-page-sizes/custom-page-sizes.5.wat:1:9: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000 (pagesize 1))\n          ^^^^^^^^^^^^^\nout/test/interp/custom-page-sizes.txt:53: assert_malformed passed:\n  out/test/interp/custom-page-sizes/custom-page-sizes.6.wat:1:13: error: invalid int \"0x1_0000_0000_0000_0000\"\n  (memory i64 0x1_0000_0000_0000_0000 (pagesize 1))\n              ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/interp/custom-page-sizes.txt:58: assert_invalid passed:\n  out/test/interp/custom-page-sizes/custom-page-sizes.7.wasm:000000f: error: initial pages (65537) must be <= (65536)\n  000000f: error: OnMemory callback failed\nout/test/interp/custom-page-sizes.txt:64: assert_invalid passed:\n  out/test/interp/custom-page-sizes/custom-page-sizes.8.wasm:0000013: error: initial pages (281474976710657) must be <= (281474976710656)\n  0000013: error: OnMemory callback failed\nout/test/interp/custom-page-sizes.txt:70: assert_malformed passed:\n  out/test/interp/custom-page-sizes/custom-page-sizes.9.wat:1:19: error: malformed custom page size\n  (memory (pagesize 0) (data))\n                    ^\n  out/test/interp/custom-page-sizes/custom-page-sizes.9.wat:1:28: error: unexpected token ), expected EOF.\n  (memory (pagesize 0) (data))\n                             ^\nout/test/interp/custom-page-sizes.txt:85: assert_trap passed: out of bounds memory access: access at 3+1 >= max value 3\n19/19 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/empty.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"f\")))\n(;; STDOUT ;;;\nf() =>\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/expr-block.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"test\") (result i32)\n    block (result i32)\n      i32.const 10\n      drop \n      i32.const 1\n    end\n  )\n)\n(;; STDOUT ;;;\ntest() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/expr-br.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $f (param i32) (result i32)\n    block (result i32)\n      local.get 0\n      i32.const 0\n      i32.eq\n      if\n        i32.const 1\n        br 1\n      end\n      i32.const 2\n    end)\n\n  (func (export \"test1\") (result i32)\n    i32.const 0\n    call $f)\n\n  (func (export \"test2\") (result i32)\n    i32.const 1\n    call $f))\n(;; STDOUT ;;;\ntest1() => i32:1\ntest2() => i32:2\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/expr-brif.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (param i32) (result i32)\n    (block $exit (result i32)\n      (i32.sub\n        (br_if $exit (i32.const 42) (local.get 0))\n        (i32.const 13))))\n\n  (func (export \"test1\") (result i32)\n    (call 0 (i32.const 0)))\n\n  (func (export \"test2\") (result i32)\n    (call 0 (i32.const 1))))\n(;; STDOUT ;;;\ntest1() => i32:29\ntest2() => i32:42\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/expr-if.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (param i32) (result i32)\n    local.get 0\n    i32.const 0\n    i32.eq\n    if (result i32)\n      i32.const 1\n    else\n      i32.const 2\n    end)\n\n  (func (export \"test1\") (result i32)\n    i32.const 0\n    call 0)\n\n  (func (export \"test2\") (result i32)\n    i32.const 1\n    call 0))\n(;; STDOUT ;;;\ntest1() => i32:1\ntest2() => i32:2\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/if-multi.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"if-multi-result\") (result i32)\n    i32.const 1\n    if (result i32 f32)\n      i32.const 2\n      f32.const 3\n    else\n      unreachable\n    end\n    i32.trunc_f32_s\n    i32.add)\n\n  (func (export \"if-param\") (result f32)\n    f32.const 3\n    i32.const 0\n    if (param f32) (result f32)\n      unreachable\n    else\n      f32.const 100\n      f32.add\n    end)\n)\n(;; STDOUT ;;;\nif-multi-result() => i32:5\nif-param() => f32:103.000000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/if.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"if1\") (result i32) (local i32)\n    i32.const 0\n    local.set 0\n    i32.const 1\n    if\n      local.get 0\n      i32.const 1\n      i32.add\n      local.set 0 \n    end\n    i32.const 0\n    if\n      local.get 0\n      i32.const 1\n      i32.add\n      local.set 0 \n    end\n    local.get 0\n    return)\n\n  (func (export \"if2\") (result i32) (local i32 i32)\n    i32.const 1\n    if\n      i32.const 1 \n      local.set 0\n    else\n      i32.const 2\n      local.set 0\n    end\n    i32.const 0\n    if\n      i32.const 4\n      local.set 1\n    else\n      i32.const 8\n      local.set 1\n    end\n    local.get 0\n    local.get 1\n    i32.add\n    return)\n)\n(;; STDOUT ;;;\nif1() => i32:1\nif2() => i32:9\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/import.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS1: --host-print\n(module\n  (import \"host\" \"print\" (func $print_i32 (param i32)))\n  (import \"host\" \"print\" (func $print_i32_i32 (param i32 i32)))\n  (func (export \"test\") (result i32)\n    i32.const 100\n    call $print_i32\n    i32.const 200\n    i32.const 300\n    call $print_i32_i32\n    i32.const 1\n    return)\n)\n(;; STDOUT ;;;\ncalled host host.print(i32:100) =>\ncalled host host.print(i32:200, i32:300) =>\ntest() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/load.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (memory 1)\n  (data (i32.const 0) \"\\ff\\ff\\ff\\ff\")\n  (data (i32.const 4) \"\\00\\00\\ce\\41\")\n  (data (i32.const 8) \"\\00\\00\\00\\00\\00\\ff\\8f\\40\")\n  (data (i32.const 16) \"\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\")\n\n  (func (export \"i32_load8_s\") (result i32)\n    i32.const 0 \n    i32.load8_s)\n  (func (export \"i32_load16_s\") (result i32)\n    i32.const 0\n    i32.load16_s)\n  (func (export \"i32_load\") (result i32)\n    i32.const 0 \n    i32.load)\n\n  (func (export \"i32_load8_u\") (result i32)\n    i32.const 0 \n    i32.load8_u)\n  (func (export \"i32_load16_u\") (result i32)\n    i32.const 0 \n    i32.load16_u)\n\n  (func (export \"i64_load8_s\") (result i64)\n    i32.const 0 \n    i64.load8_s)\n  (func (export \"i64_load16_s\") (result i64)\n    i32.const 0 \n    i64.load16_s)\n  (func (export \"i64_load32_s\") (result i64) \n    i32.const 0\n    i64.load32_s)\n\n  (func (export \"i64_load\") (result i64)\n    i32.const 16 \n    i64.load)\n\n  (func (export \"i64_load8_u\") (result i64) \n    i32.const 0\n    i64.load8_u)\n  (func (export \"i64_load16_u\") (result i64)\n    i32.const 0 \n    i64.load16_u)\n  (func (export \"i64_load32_u\") (result i64) \n    i32.const 0\n    i64.load32_u)\n\n  (func (export \"f32_load\") (result f32)\n    i32.const 4 \n    f32.load)\n\n  (func (export \"f64_load\") (result f64)\n    i32.const 8 \n    f64.load)\n)\n(;; STDOUT ;;;\ni32_load8_s() => i32:4294967295\ni32_load16_s() => i32:4294967295\ni32_load() => i32:4294967295\ni32_load8_u() => i32:255\ni32_load16_u() => i32:65535\ni64_load8_s() => i64:18446744073709551615\ni64_load16_s() => i64:18446744073709551615\ni64_load32_s() => i64:18446744073709551615\ni64_load() => i64:18446744073709551615\ni64_load8_u() => i64:255\ni64_load16_u() => i64:65535\ni64_load32_u() => i64:4294967295\nf32_load() => f32:25.750000\nf64_load() => f64:1023.875000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/load64.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS: --enable-memory64\n(module\n  (memory i64 1)\n  (data (i64.const 0) \"\\ff\\ff\\ff\\ff\")\n  (data (i64.const 4) \"\\00\\00\\ce\\41\")\n  (data (i64.const 8) \"\\00\\00\\00\\00\\00\\ff\\8f\\40\")\n  (data (i64.const 16) \"\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\")\n\n  (func (export \"i32_load8_s\") (result i32)\n    i64.const 0\n    i32.load8_s)\n  (func (export \"i32_load16_s\") (result i32)\n    i64.const 0\n    i32.load16_s)\n  (func (export \"i32_load\") (result i32)\n    i64.const 0\n    i32.load)\n\n  (func (export \"i32_load8_u\") (result i32)\n    i64.const 0\n    i32.load8_u)\n  (func (export \"i32_load16_u\") (result i32)\n    i64.const 0\n    i32.load16_u)\n\n  (func (export \"i64_load8_s\") (result i64)\n    i64.const 0\n    i64.load8_s)\n  (func (export \"i64_load16_s\") (result i64)\n    i64.const 0\n    i64.load16_s)\n  (func (export \"i64_load32_s\") (result i64)\n    i64.const 0\n    i64.load32_s)\n\n  (func (export \"i64_load\") (result i64)\n    i64.const 16\n    i64.load)\n\n  (func (export \"i64_load8_u\") (result i64)\n    i64.const 0\n    i64.load8_u)\n  (func (export \"i64_load16_u\") (result i64)\n    i64.const 0\n    i64.load16_u)\n  (func (export \"i64_load32_u\") (result i64)\n    i64.const 0\n    i64.load32_u)\n\n  (func (export \"f32_load\") (result f32)\n    i64.const 4\n    f32.load)\n\n  (func (export \"f64_load\") (result f64)\n    i64.const 8\n    f64.load)\n)\n(;; STDOUT ;;;\ni32_load8_s() => i32:4294967295\ni32_load16_s() => i32:4294967295\ni32_load() => i32:4294967295\ni32_load8_u() => i32:255\ni32_load16_u() => i32:65535\ni64_load8_s() => i64:18446744073709551615\ni64_load16_s() => i64:18446744073709551615\ni64_load32_s() => i64:18446744073709551615\ni64_load() => i64:18446744073709551615\ni64_load8_u() => i64:255\ni64_load16_u() => i64:65535\ni64_load32_u() => i64:4294967295\nf32_load() => f32:25.750000\nf64_load() => f64:1023.875000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/loop-multi.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"loop-multi-result\") (result i32)\n    loop (result i32 i32)\n      i32.const 1\n      i32.const 2\n    end\n    i32.add)\n\n  (func (export \"loop-param-brif\") (result i32)\n    (local $l i32)\n    i32.const 0\n    loop $again (param i32) (result i32)\n      i32.const 3\n      i32.add       ;; +3 to TOS (loop param)\n\n      local.tee $l\n      local.get $l  ;; dup TOS\n\n      i32.const 10\n      i32.lt_s\n      br_if $again  ;; loop if < 10\n    end\n  )\n)\n(;; STDOUT ;;;\nloop-multi-result() => i32:3\nloop-param-brif() => i32:12\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/loop.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"loop\") (result i32)\n    (local i32 i32)\n    ;; loop statements now require an explicit branch to the top\n    loop $cont\n      local.get 1\n      local.get 0\n      i32.add\n      local.set 1\n      local.get 0\n      i32.const 1\n      i32.add \n      local.set 0\n      local.get 0\n      i32.const 5\n      i32.lt_s\n      if\n        br $cont\n      end\n    end\n    local.get 1))\n(;; STDOUT ;;;\nloop() => i32:10\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/memory-empty-segment.txt",
    "content": ";;; TOOL: run-interp\n(module (memory (data \"\")))\n"
  },
  {
    "path": "test/interp/nested-if.txt",
    "content": ";;; TOOL: run-interp\n\n;; This used to test an odd case where a nested if would return a void, so the\n;; true branch of the outer if would have to be dropped its instructions had\n;; already been generated. Now that drops are explicit, this case is\n;; straightforward.\n\n(module\n  (func (export \"f\") (result i32)\n    block $exit\n      i32.const 1\n      if                     ;; outer if\n        i32.const 2          \n        drop\n        i32.const 3\n        if                   ;; inner if\n          br $exit\n        end\n      end\n    end\n    i32.const 4))\n(;; STDOUT ;;;\nf() => i32:4\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/reference-types.txt",
    "content": ";;; TOOL: run-interp\n\n(module\n  (table $t_func 1 funcref)\n  (table $t_extern 1 externref)\n  (elem funcref (ref.func 2) (ref.null func))\n  (elem externref (ref.null extern))\n  (global $g (mut funcref) (ref.null func))\n\n  (func (export \"ref_null_func\") (result funcref)\n    ref.null func\n  )\n\n  (func (export \"ref_null_extern\") (result externref)\n    ref.null extern\n  )\n\n  (func $ref_is_null_func (export \"ref_is_null_func\") (result i32)\n    global.get $g\n    ref.is_null\n  )\n\n  (func $ref_func (export \"ref_func\") (result funcref)\n    ref.func $ref_is_null_func\n  )\n\n  (func $table_set (export \"table_set\")\n    i32.const 0\n    call $ref_func\n    table.set $t_func\n  )\n\n  (func (export \"table_get\") (result i32)\n    call $table_set\n    i32.const 0\n    table.get $t_func\n    ref.is_null\n  )\n\n  (func $global_set (export \"global_set\") (result funcref)\n    ref.func $ref_is_null_func\n    global.set $g\n    global.get $g\n  )\n)\n(;; STDOUT ;;;\nref_null_func() => funcref:0\nref_null_extern() => externref:0\nref_is_null_func() => i32:1\nref_func() => funcref:5\ntable_set() =>\ntable_get() => i32:0\nglobal_set() => funcref:5\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/rethrow-and-br.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-exceptions --enable-tail-call\n(module\n  (tag $e1)\n  (tag $e2)\n  (type $helper-type (func (result i32)))\n  (table funcref (elem $helper))\n  (func (export \"rethrow-br\") (result i32)\n    (try (result i32)\n      (do\n        (try\n          (do (throw $e1))\n          (catch $e1\n            (try $l\n              (do (throw $e2))\n              (catch $e2\n                ;; exception stack has two entries\n                ;; br should reset to height of one\n                (br $l)))\n            ;; exception stack has one entry\n            (rethrow 0)))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"rethrow-br-if\") (result i32)\n    (try (result i32)\n      (do\n        (try\n          (do (throw $e1))\n          (catch $e1\n            (try $l\n              (do (throw $e2))\n              (catch $e2\n                (i32.const 1)\n                (br_if $l)))\n            (rethrow 0)))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"rethrow-br-table\") (result i32)\n    (try (result i32)\n      (do\n        (try\n          (do (throw $e1))\n          (catch $e1\n            (try $l\n              (do (throw $e2))\n              (catch $e2\n                (i32.const 1)\n                (br_table 1 $l 1)))\n            (rethrow 0)))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func $helper (result i32)\n    (try (result i32)\n      (do (throw $e1))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"rethrow-return-call\") (result i32)\n    (try (result i32)\n      (do (throw $e1))\n      (catch $e1\n        (try $l\n          (do (throw $e2))\n          (catch $e2\n            (return_call $helper)))\n        (i32.const 0))))\n  (func (export \"rethrow-return-call-indirect\") (result i32)\n    (try (result i32)\n      (do (throw $e1))\n      (catch $e1\n        (try $l\n          (do (throw $e2))\n          (catch $e2\n            (i32.const 0)\n            (return_call_indirect (type $helper-type))))\n        (i32.const 0))))\n  (func $helper-2\n    (try\n      (do (throw $e2))\n      (catch $e2\n        return)))\n  (func (export \"rethrow-return\") (result i32)\n    (try (result i32)\n      (do\n        (try (result i32)\n          (do (throw $e1))\n          (catch $e1\n            (call $helper-2)\n            (rethrow 0))))\n      (catch $e1\n        (i32.const 1))\n      (catch $e2\n        (i32.const 0))))\n  ;; test rethrow stack interaction with throw, as if it were a br\n  (func (export \"rethrow-throw\") (result i32)\n    (try (result i32)\n      (do\n        (try\n          (do (throw $e1))\n          (catch $e1\n            (try\n              (do\n                (try\n                  (do (throw $e2))\n                  (catch $e2\n                    ;; exception stack has $e1, $e2\n                    ;; should get unwound on throw to $e1\n                    (throw $e2))))\n              (catch $e2\n                ;; should reference $e1\n                (rethrow 1)))))\n        (i32.const 0))\n      (catch $e1 (i32.const 1))\n      (catch_all (i32.const 0))))\n  )\n(;; STDOUT ;;;\nrethrow-br() => i32:1\nrethrow-br-if() => i32:1\nrethrow-br-table() => i32:1\nrethrow-return-call() => i32:1\nrethrow-return-call-indirect() => i32:1\nrethrow-return() => i32:1\nrethrow-throw() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/rethrow.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-exceptions\n(module\n  (tag $e1)\n  (tag $e2)\n  (func (export \"rethrow-uncaught\")\n    (try\n      (do\n        (throw $e1))\n      (catch $e1\n        (rethrow 0))))\n  (func (export \"rethrow-1\") (result i32)\n    (try (result i32)\n      (do\n        (try\n          (do\n            (throw $e1))\n          (catch $e1\n            (rethrow 0)))\n        (i32.const 0))\n      (catch_all\n        (i32.const 1))))\n  (func (export \"rethrow-2\") (result i32)\n    (try (result i32)\n      (do\n        (try\n          (do\n            (throw $e1))\n          (catch $e1\n            (try\n              (do\n                (throw $e2))\n              (catch $e2\n                (rethrow 1)))))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  )\n(;; STDOUT ;;;\nrethrow-uncaught() => error: uncaught exception\nrethrow-1() => i32:1\nrethrow-2() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/return-call-import.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-tail-call\n;;; ARGS1: --host-print \n(module\n  (import \"host\" \"print\" (func $imported (param i32) (result i32)))\n\n  (func (export \"f\") (result i32)\n    i32.const 42\n    return_call $imported\n    unreachable\n  )\n)\n(;; STDOUT ;;;\ncalled host host.print(i32:42) => i32:0\nf() => i32:0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/return-call-indirect-import.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-tail-call\n;;; ARGS1: --host-print\n(module\n  (import \"host\" \"print\" (func $imported (param i32) (result i32)))\n  (type $i_i (func (param i32)(result i32)))\n  (table funcref (elem $imported))\n\n  (func (export \"f\") (result i32)\n    i32.const 42\n    i32.const 0\n    return_call_indirect (type $i_i)\n  )\n)\n(;; STDOUT ;;;\ncalled host host.print(i32:42) => i32:0\nf() => i32:0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/return-call-indirect.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-tail-call\n(module\n  (type $iii_i (func (param i32 i32 i32)(result i32)))\n  (table funcref (elem $facInd))\n\n  (func (export \"facInd10\") (result i32)\n    i32.const 10\n    i32.const 1\n    i32.const 0\n    i32.const 0\n    call_indirect (type $iii_i))\n\n(;; Tail call version of factorial, using indirect call ;;)\n(;; fac(Ix,So) => Ix==0?So:fac(Ix-1,So*Ix) ;;)\n  (func $facInd (type $iii_i)\n    local.get 0\n    i32.const 0\n    i32.gt_s\n    if (result i32)\n      local.get 0\n      i32.const 1\n      i32.sub\n      local.get 1\n      local.get 0\n      i32.mul\n      local.get 2\n      local.get 2\n      return_call_indirect (type $iii_i)\n      unreachable\n    else\n      local.get 1\n      return\n    end)\n)\n(;; STDOUT ;;;\nfacInd10() => i32:3628800\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/return-call-local-set.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-tail-call\n(module\n  (func (export \"f\") (result i32)\n    (i64.const 1)\n    (return_call $g))\n\n  (func $g (param i64) (result i32)\n    (i32.const 3)\n    (return_call $h))\n\n  (func $h (param i32) (result i32)\n    (i32.const 2)\n    (local.set 0)\n    (local.get 0)\n    return)\n)\n(;; STDOUT ;;;\nf() => i32:2\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/return-call.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-tail-call\n(module\n  (func (export \"fac10\") (result i32)\n    i32.const 10\n    i32.const 1\n    call $fac\n    return)\n\n(;; Tail call version of factorial ;;)\n(;; fac(Ix,So) => Ix==0?So:fac(Ix-1,So*Ix) ;;)\n  (func $fac (param i32 i32) (result i32)\n    local.get 0\n    i32.const 0\n    i32.gt_s\n    if (result i32)\n      local.get 0\n      i32.const 1\n      i32.sub\n      local.get 1\n      local.get 0\n      i32.mul\n      return_call $fac\n    else\n      local.get 1\n      return\n    end)\n)\n(;; STDOUT ;;;\nfac10() => i32:3628800\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/return-void.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (memory 1)\n  (func $store_unless (param i32)\n    local.get 0\n    i32.const 0\n    i32.eq\n    if\n      return\n    end\n    i32.const 0\n    i32.const 1\n    i32.store)\n\n  (func (export \"test1\")\n    i32.const 0\n    call $store_unless)\n\n  (func (export \"check1\") (result i32)\n    i32.const 0\n    i32.load)\n\n  (func (export \"test2\")\n    i32.const 1\n    call $store_unless)\n\n  (func (export \"check2\") (result i32)\n    i32.const 0\n    i32.load))\n(;; STDOUT ;;;\ntest1() =>\ncheck1() => i32:0\ntest2() =>\ncheck2() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/return.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $f (param i32) (result i32)\n    local.get 0\n    i32.const 0\n    i32.eq\n    if\n      i32.const 1\n      return\n    end\n    local.get 0\n    i32.const 1\n    i32.eq\n    if\n      i32.const 2\n      return\n    end\n    i32.const 3\n    return)\n\n  (func (export \"test1\") (result i32)\n    i32.const 0\n    call $f)\n\n  (func (export \"test2\") (result i32)\n    i32.const 1\n    call $f)\n\n  (func (export \"test3\") (result i32)\n    i32.const 5\n    call $f))\n(;; STDOUT ;;;\ntest1() => i32:1\ntest2() => i32:2\ntest3() => i32:3\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/run-export-as-global.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS1: --run-export=global_export --argument=i32:10\n;;; ERROR: 1\n(module\n  (global $my_global i32 (i32.const 0))\n  (export \"global_export\" (global $my_global))\n)\n(;; STDOUT ;;;\nExport 'global_export' is not a function\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/run-export-with-argument.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS1: --run-export=func_sum --argument=i64:8 --argument=i64:5 --run-export=func_fac --argument=i32:10\n(module\n  (func (export \"func_sum\") (param i64) (param i64) (result i64)\n    local.get 0\n    local.get 1\n    i64.add\n    return)\n\n  (func (export \"func_fac\") (param i32) (result i32)\n    local.get 0\n    call $fac)\n\n  (func $fac (param i32) (result i32)\n    local.get 0\n    i32.const 0\n    i32.gt_s \n    if (result i32)\n      local.get 0\n      local.get 0\n      i32.const 1\n      i32.sub\n      call $fac\n      i32.mul\n      return\n    else\n      i32.const 1\n      return\n    end) \n)\n(;; STDOUT ;;;\nfunc_sum(i64:8, i64:5) => i64:13\nfunc_fac(i32:10) => i32:3628800\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/run-export-with-invalid-arguments-size.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS1: --run-export=id --argument=i32:7 --argument=i32:8\n;;; ERROR: 1\n(module\n  (func (export \"id\") (param i32) (result i32) (local.get 0))\n)\n(;; STDOUT ;;;\nExported function 'id' expects 1 arguments, but 2 were provided\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/run-non-func-export.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (memory (export \"mem\") 1 1)\n  (func (export \"dummy\") (result i32) i32.const 0x25))\n(;; STDOUT ;;;\ndummy() => i32:37\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/select-ref.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS: --enable-function-references\n\n(module\n  (type $i32_func (func (result i32)))\n\n  ;; Two simple functions to use as reference values.\n  (func $f1 (type $i32_func) i32.const 42)\n  (func $f2 (type $i32_func) i32.const 99)\n\n  ;; Declare functions in elem so ref.func is valid.\n  (elem declare funcref (ref.func $f1) (ref.func $f2))\n\n  ;; Typed select choosing between two funcref values.\n  ;; When cond is nonzero, should return first operand (ref to $f1).\n  (func (export \"select_funcref_true\") (result i32)\n    ref.func $f1\n    ref.func $f2\n    i32.const 1\n    select (result funcref)\n    ref.is_null\n  )\n\n  ;; When cond is zero, should return second operand (ref to $f2).\n  (func (export \"select_funcref_false\") (result i32)\n    ref.func $f1\n    ref.func $f2\n    i32.const 0\n    select (result funcref)\n    ref.is_null\n  )\n\n  ;; Select between a non-null ref and a null ref.\n  ;; cond=1 selects first (non-null), so ref.is_null should return 0.\n  (func (export \"select_nonnull\") (result i32)\n    ref.func $f1\n    ref.null func\n    i32.const 1\n    select (result funcref)\n    ref.is_null\n  )\n\n  ;; cond=0 selects second (null), so ref.is_null should return 1.\n  (func (export \"select_null\") (result i32)\n    ref.func $f1\n    ref.null func\n    i32.const 0\n    select (result funcref)\n    ref.is_null\n  )\n\n  ;; Use select result as a global to verify the ref survives.\n  (global $g (mut funcref) (ref.null func))\n\n  (func (export \"select_to_global\") (result i32)\n    ref.func $f1\n    ref.func $f2\n    i32.const 1\n    select (result funcref)\n    global.set $g\n    global.get $g\n    ref.is_null\n  )\n)\n(;; STDOUT ;;;\nselect_funcref_true() => i32:0\nselect_funcref_false() => i32:0\nselect_nonnull() => i32:0\nselect_null() => i32:1\nselect_to_global() => i32:0\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/select.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $i32 (param i32) (result i32)\n    i32.const 1\n    i32.const 2\n    local.get 0\n    select)\n  (func $i64 (param i32) (result i64)\n    i64.const 1\n    i64.const 2\n    local.get 0\n    select)\n  (func $f32 (param i32) (result f32)\n    f32.const 1\n    f32.const 2\n    local.get 0\n    select)\n  (func $f64 (param i32) (result f64)\n    f64.const 1\n    f64.const 2\n    local.get 0\n    select)\n\n  (func (export \"test_i32_l\") (result i32)\n    i32.const 0 \n    call $i32)\n  (func (export \"test_i32_r\") (result i32) \n    i32.const 1\n    call $i32)\n  (func (export \"test_i64_l\") (result i64) \n    i32.const 0\n    call $i64)\n  (func (export \"test_i64_r\") (result i64) \n    i32.const 1\n    call $i64)\n  (func (export \"test_f32_l\") (result f32) \n    i32.const 0\n    call $f32)\n  (func (export \"test_f32_r\") (result f32) \n   i32.const 1\n   call $f32)\n  (func (export \"test_f64_l\") (result f64) \n   i32.const 0\n   call $f64)\n  (func (export \"test_f64_r\") (result f64) \n   i32.const 1\n   call $f64))\n(;; STDOUT ;;;\ntest_i32_l() => i32:2\ntest_i32_r() => i32:1\ntest_i64_l() => i64:2\ntest_i64_r() => i64:1\ntest_f32_l() => f32:2.000000\ntest_f32_r() => f32:1.000000\ntest_f64_l() => f64:2.000000\ntest_f64_r() => f64:1.000000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-basic.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"v128_const_i8x16\") (result v128)\n    v128.const i8x16 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0\n    return)\n  (func (export \"v128_const_i16x8\") (result v128)\n    v128.const i16x8 1 0 2 0 3 0 4 0\n    return)\n  (func (export \"v128_const_i32x4\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    return)\n  (func (export \"v128_const_i64x2\") (result v128)\n    v128.const i64x2 1 2\n    return)\n  (func (export \"v128_const_f32x4\") (result v128)\n    v128.const f32x4 6.91 6.91 6.91 6.91\n    return)\n  (func (export \"v128_const_f64x2\") (result v128)\n    v128.const f64x2 6.91 6.91\n    return)\n)\n(;; STDOUT ;;;\nv128_const_i8x16() => v128 i32x4:0x00000001 0x00000002 0x00000003 0x00000004\nv128_const_i16x8() => v128 i32x4:0x00000001 0x00000002 0x00000003 0x00000004\nv128_const_i32x4() => v128 i32x4:0x00000001 0x00000002 0x00000003 0x00000004\nv128_const_i64x2() => v128 i32x4:0x00000001 0x00000000 0x00000002 0x00000000\nv128_const_f32x4() => v128 i32x4:0x40dd1eb8 0x40dd1eb8 0x40dd1eb8 0x40dd1eb8\nv128_const_f64x2() => v128 i32x4:0x0a3d70a4 0x401ba3d7 0x0a3d70a4 0x401ba3d7\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-binary.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; i8x16 add\n  (func (export \"i8x16_add_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.add)\n  (func (export \"i8x16_add_1\") (result v128)\n    v128.const i32x4 0x00ff0001 0x04000002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i8x16.add)\n\n  ;; i16x8 add\n  (func (export \"i16x8_add_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.add)\n  (func (export \"i16x8_add_1\") (result v128)\n    v128.const i32x4 0x00ffffff 0x0400ffff 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i16x8.add)\n\n  ;; i32x4 add\n  (func (export \"i32x4_add_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.add)\n  (func (export \"i32x4_add_1\") (result v128)\n    v128.const i32x4 0xffffffff 0x0400ffff 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i32x4.add)\n\n  ;; i64x2 add\n  (func (export \"i64x2_add_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i64x2.add)\n  (func (export \"i64x2_add_1\") (result v128)\n    v128.const i32x4 0x00000000 0x0400ffff 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i64x2.add)\n\n  ;; i8x16 sub\n  (func (export \"i8x16_sub_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.sub)\n  (func (export \"i8x16_sub_1\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x00000004\n    i8x16.sub)\n\n  ;; i16x8 sub\n  (func (export \"i16x8_sub_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.sub)\n  (func (export \"i16x8_sub_1\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x00000004\n    i16x8.sub)\n\n  ;; i32x4 sub\n  (func (export \"i32x4_sub_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.sub)\n  (func (export \"i32x4_sub_1\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x00000004\n    i32x4.sub)\n\n  ;; i64x2 sub\n  (func (export \"i64x2_sub_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i64x2.sub)\n  (func (export \"i64x2_sub_1\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x00000004\n    i64x2.sub)\n\n  ;; i16x8 mul\n  (func (export \"i16x8_mul_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i16x8.mul)\n  (func (export \"i16x8_mul_1\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x00000004\n    i16x8.mul)\n\n  ;; i32x4 mul\n  (func (export \"i32x4_mul_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.mul)\n  (func (export \"i32x4_mul_1\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x00000004\n    i32x4.mul)\n\n  ;; i64x2 mul\n  (func (export \"i64x2_mul_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i64x2.mul)\n  (func (export \"i64x2_mul_1\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x00000004\n    i64x2.mul)\n\n  ;; i8x16 saturating add (signed and unsigned)\n  (func (export \"i8x16_add_saturate_signed_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000007f 0x00000003 0x00000080\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x000000ff\n    i8x16.add_sat_s)\n  (func (export \"i8x16_add_saturate_unsigned_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x04000002 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i8x16.add_sat_u)\n\n  ;; i16x8 saturating add (signed and unsigned)\n  (func (export \"i16x8_add_saturate_signed_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00007fff 0x00000003 0x00008000\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x0000fffe\n    i16x8.add_sat_s)\n  (func (export \"i16x8_add_saturate_unsigned_0\") (result v128)\n    v128.const i32x4 0x00ffffff 0x0400ffff 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i16x8.add_sat_u)\n\n  ;; i8x16 saturating sub (signed and unsigned)\n  (func (export \"i8x16_sub_saturate_signed_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000007f 0x000000fe 0x00000080\n    v128.const i32x4 0x00000001 0x000000fe 0x0000007f 0x000000ff\n    i8x16.sub_sat_s)\n  (func (export \"i8x16_sub_saturate_unsigned_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x0400007f 0x0000fffe 0x00000004\n    v128.const i32x4 0x00020001 0xfe00fffe 0x0000007f 0x00000004\n    i8x16.sub_sat_u)\n\n  ;; i16x8 saturating sub (signed and unsigned)\n  (func (export \"i16x8_sub_saturate_signed_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00007fff 0x0000fffe 0x00008000\n    v128.const i32x4 0x00000001 0x0000fffe 0x00007fff 0x0000fffe\n    i16x8.sub_sat_s)\n  (func (export \"i16x8_sub_saturate_unsigned_0\") (result v128)\n    v128.const i32x4 0x00ffffff 0x0400ffff 0x00000003 0x00000004\n    v128.const i32x4 0x00020001 0xfe000002 0x00000003 0x00000004\n    i16x8.sub_sat_u)\n\n  ;; v128 and\n  (func (export \"v128_and_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x44000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x55000004\n    v128.and)\n\n  ;; v128 or\n  (func (export \"v128_or_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x44000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x55000004\n    v128.or)\n\n  ;; v128 xor\n  (func (export \"v128_xor_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x44000003 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0x00000003 0x55000004\n    v128.xor)\n\n  ;; f32x4 min\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000\n  ;; 0xffc00000 is a NaN, 0x7fc00000 is a NaN.\n  ;;  1234.5 = 0x449a5000,  1.0 = 0x3f800000\n  ;; -1234.5 = 0xc49a5000, -1.0 = 0xbf800000\n  ;; test is:   [-0.0, NaN,  1234.5, -1.0]\n  ;;            [ 0.0, 1.0,  1234.5,  1.0]\n  ;; expect is: [-0.0, NaN,  1234.5, -1.0]\n  (func (export \"f32x4_min_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xbf800000\n    v128.const i32x4 0x00000000 0x3f800000 0x449a5000 0x3f800000\n    f32x4.min)\n\n  ;; f64x2 min\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; 0xfff8000000000000 is a NaN, 0x7ff8000000000000 is a NaN.\n  ;; 1234.5  = 0x40934a0000000000,  1.0 = 0x3ff0000000000000\n  ;; -1234.5 = 0xc0934a0000000000, -1.0 = 0xbff0000000000000\n  ;; tests are:   [ 0.0,     NaN]\n  ;;              [-1234.5,  1.0]\n  ;; expects are: [-1234.5,  NaN]\n  (func (export \"f64x2_min_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.min)\n\n  ;; f32x4 max\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000\n  ;; 0xffc00000 is a NaN, 0x7fc00000 is a NaN.\n  ;;  1234.5 = 0x449a5000,  1.0 = 0x3f800000\n  ;; -1234.5 = 0xc49a5000, -1.0 = 0xbf800000\n  ;; test is:   [-0.0, NaN,  1234.5, -1.0]\n  ;;            [ 0.0, 1.0,  1234.5,  1.0]\n  ;; expect is: [ 0.0, NaN,  1234.5,  1.0]\n  (func (export \"f32x4_max_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xbf800000\n    v128.const i32x4 0x00000000 0x3f800000 0x449a5000 0x3f800000\n    f32x4.max)\n\n  ;; f64x2 max\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; 0xfff8000000000000 is a NaN, 0x7ff8000000000000 is a NaN.\n  ;; 1234.5  = 0x40934a0000000000,  1.0 = 0x3ff0000000000000\n  ;; -1234.5 = 0xc0934a0000000000, -1.0 = 0xbff0000000000000\n  ;; tests are:   [ 0.0,     NaN]\n  ;;              [-1234.5,  1.0]\n  ;; expects are: [ 0.0,     NaN]\n  (func (export \"f64x2_max_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.max)\n\n  ;; f32x4 add\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000\n  ;; 0xffc00000 is a NaN\n  ;;  1234.5 = 0x449a5000,  1.0 = 0x3f800000\n  ;; -1234.5 = 0xc49a5000,  1.5 = 0x3fc00000\n  ;;  1235.5 = 0x449a7000, -1233.0 = 0xc49a2000\n  ;; test is:   [-0.0, NaN,  1234.5,  -1234.5]\n  ;;            [ 0.0, 1.0,     1.0,      1.5]\n  ;; expect is: [ 0.0, NaN,  1235.5,  -1233.0]\n  (func (export \"f32x4_add_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xc49a5000\n    v128.const i32x4 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n    f32x4.add)\n\n  ;; f64x2 add\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; 0xfff8000000000000 is a NaN\n  ;; -1233.0 = 0xc093440000000000,  1.0 = 0x3ff0000000000000\n  ;; -1234.5 = 0xc0934a0000000000,  1.5 = 0x3ff8000000000000\n  ;; tests are:   [    1.5,  NaN]\n  ;;              [-1234.5,  1.0]\n  ;; expects are: [-1233.0,  NaN]\n  (func (export \"f64x2_add_0\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.add)\n\n  ;; f32x4 sub\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000\n  ;; 0xffc00000 is a NaN.\n  ;;  1234.5 = 0x449a5000,  1.0 = 0x3f800000\n  ;; -1234.5 = 0xc49a5000,  1.5 = 0x3fc00000\n  ;;  1233.5 = 0x449a3000,  -1236.0 = 0xc49a8000\n  ;; test is:   [-0.0, NaN,  1234.5,  -1234.5]\n  ;;            [ 0.0, 1.0,     1.0,      1.5]\n  ;; expect is: [-0.0, NaN,  1233.5,  -1236.0]\n  (func (export \"f32x4_sub_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xc49a5000\n    v128.const i32x4 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n    f32x4.sub)\n\n  ;; f64x2 sub\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; 0xfff8000000000000 is a NaN.\n  ;; 1236.0  = 0x4093500000000000,  1.0 = 0x3ff0000000000000\n  ;; -1234.5 = 0xc0934a0000000000,  1.5 = 0x3ff8000000000000\n  ;; tests are:   [    1.5,  NaN]\n  ;;              [-1234.5,  1.0]\n  ;; expects are: [ 1236.0,  NaN]\n  (func (export \"f64x2_sub_0\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.sub)\n\n  ;; f32x4 div\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000\n  ;; 0xffc00000 is a NaN, 0x7fc00000 is a NaN.\n  ;;   1.0 = 0x3f800000,  1.5 = 0x3fc00000\n  ;;  -3.0 = 0xc0400000, -2.0 = 0xc0000000\n  ;; test is:   [-0.0, NaN,  1.5,  -3.0]\n  ;;            [ 0.0, 1.0,  1.0,   1.5]\n  ;; expect is: [ NaN, NaN,  1.5,  -2.0]\n  (func (export \"f32x4_div_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x3fc00000 0xc0400000 \n    v128.const i32x4 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n    f32x4.div)\n\n  ;; f64x2 div\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; 0xfff8000000000000 is a NaN.\n  ;; -3.0 = 0xc008000000000000,  1.0 = 0x3ff0000000000000\n  ;; -2.0 = 0xc000000000000000,  1.5 = 0x3ff8000000000000\n  ;; tests are:   [ 1.5,  -3.0]\n  ;;              [ 1.0,   1.5]\n  ;; expects are: [ 1.5,  -2.0]\n  (func (export \"f64x2_div_0\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0xc0080000\n    v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0x3ff80000\n    f64x2.div)\n\n  ;; f32x4 mul\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000\n  ;; 0xffc00000 is a NaN.\n  ;;   1.0 = 0x3f800000,  1.5 = 0x3fc00000\n  ;;  -3.0 = 0xc0400000, -4.5 = 0xc0900000\n  ;; test is:   [-0.0, NaN,  1.5,  -3.0]\n  ;;            [ 0.0, 1.0,  1.0,   1.5]\n  ;; expect is: [-0.0, NaN,  1.5,  -4.5]\n  (func (export \"f32x4_mul_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x3fc00000 0xc0400000\n    v128.const i32x4 0x00000000 0x3f800000 0x3f800000 0x3fc00000\n    f32x4.mul)\n\n  ;; f64x2 mul\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; 0xfff8000000000000 is a NaN.\n  ;; -3.0 = 0xc008000000000000,  1.0 = 0x3ff0000000000000\n  ;; -4.5 = 0xc012000000000000,  1.5 = 0x3ff8000000000000\n  ;; tests are:   [ 1.5,  -3.0]\n  ;;              [ 1.0,   1.5]\n  ;; expects are: [ 1.5,  -4.5]\n  (func (export \"f64x2_mul_0\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0xc0080000\n    v128.const i32x4 0x00000000 0x3ff00000 0x00000000 0x3ff80000\n    f64x2.mul)\n\n  ;; i8x16.swizzle\n  (func (export \"v8x16_swizzle_0\") (result v128)\n    v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d\n    v128.const i8x16 0 4 8 12 5 9 13 1 10 14 6 2 15 3 7 11\n    i8x16.swizzle)\n\n  (func (export \"v8x16_swizzle_1\") (result v128)\n    v128.const i32x4 0x11223344 0x55667788 0x99aabbcc 0xddeeff00\n    v128.const i8x16 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4 4\n    i8x16.swizzle)\n\n  (func (export \"v8x16_swizzle_2\") (result v128)\n    v128.const i32x4 0xffffffff 0xffffffff 0xffffffff 0xffffffff\n    v128.const i8x16 -1 16 31 255 -128 127 32 63 64 127 128 -2 -3 -4 -5 -6\n    i8x16.swizzle)\n)\n\n(;; STDOUT ;;;\ni8x16_add_0() => v128 i32x4:0x00000002 0x00000004 0x00000006 0x00000008\ni8x16_add_1() => v128 i32x4:0x00010002 0x02000004 0x00000006 0x00000008\ni16x8_add_0() => v128 i32x4:0x00000002 0x00000004 0x00000006 0x00000008\ni16x8_add_1() => v128 i32x4:0x01010000 0x02000001 0x00000006 0x00000008\ni32x4_add_0() => v128 i32x4:0x00000002 0x00000004 0x00000006 0x00000008\ni32x4_add_1() => v128 i32x4:0x00020000 0x02010001 0x00000006 0x00000008\ni64x2_add_0() => v128 i32x4:0x00000002 0x00000004 0x00000006 0x00000008\ni64x2_add_1() => v128 i32x4:0x00020001 0x02010001 0x00000006 0x00000008\ni8x16_sub_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni8x16_sub_1() => v128 i32x4:0x00fd0000 0x00060000 0x00000000 0x00000000\ni16x8_sub_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni16x8_sub_1() => v128 i32x4:0x00fd0000 0xff060000 0x00000000 0x00000000\ni32x4_sub_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni32x4_sub_1() => v128 i32x4:0x00fd0000 0xff060000 0x00000000 0x00000000\ni64x2_sub_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni64x2_sub_1() => v128 i32x4:0x00fd0000 0xff060000 0x00000000 0x00000000\ni16x8_mul_0() => v128 i32x4:0x00000001 0x00000004 0x00000009 0x00000010\ni16x8_mul_1() => v128 i32x4:0x01fe0001 0x03f80004 0x00000009 0x00000010\ni32x4_mul_0() => v128 i32x4:0x00000001 0x00000004 0x00000009 0x00000010\ni32x4_mul_1() => v128 i32x4:0x01010001 0x02040004 0x00000009 0x00000010\ni64x2_mul_0() => v128 i32x4:0x00000001 0x00000004 0x00000009 0x00000018\ni64x2_mul_1() => v128 i32x4:0x01010001 0x03040202 0x00000009 0x00000018\ni8x16_add_saturate_signed_0() => v128 i32x4:0x00000002 0x0000007f 0x00000006 0x00000080\ni8x16_add_saturate_unsigned_0() => v128 i32x4:0x00ff0002 0xff000004 0x00000006 0x00000008\ni16x8_add_saturate_signed_0() => v128 i32x4:0x00000002 0x00007fff 0x00000006 0x00008000\ni16x8_add_saturate_unsigned_0() => v128 i32x4:0x0101ffff 0xffffffff 0x00000006 0x00000008\ni8x16_sub_saturate_signed_0() => v128 i32x4:0x00000000 0x0000007f 0x00000080 0x00000081\ni8x16_sub_saturate_unsigned_0() => v128 i32x4:0x00fd0000 0x00000000 0x0000ff7f 0x00000000\ni16x8_sub_saturate_signed_0() => v128 i32x4:0x00000000 0x00007fff 0x00008000 0x00008002\ni16x8_sub_saturate_unsigned_0() => v128 i32x4:0x00fdfffe 0x0000fffd 0x00000000 0x00000000\nv128_and_0() => v128 i32x4:0x00020001 0x00040002 0x00000003 0x00000004\nv128_or_0() => v128 i32x4:0x00ff0001 0x00fe0002 0x44000003 0x55000004\nv128_xor_0() => v128 i32x4:0x00fd0000 0x00fa0000 0x44000000 0x55000000\nf32x4_min_0() => v128 i32x4:0x80000000 0x7fc00000 0x449a5000 0xbf800000\nf64x2_min_0() => v128 i32x4:0x00000000 0xc0934a00 0x00000000 0x7ff80000\nf32x4_max_0() => v128 i32x4:0x00000000 0x7fc00000 0x449a5000 0x3f800000\nf64x2_max_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x7ff80000\nf32x4_add_0() => v128 i32x4:0x00000000 0x7fc00000 0x449a7000 0xc49a2000\nf64x2_add_0() => v128 i32x4:0x00000000 0xc0934400 0x00000000 0x7ff80000\nf32x4_sub_0() => v128 i32x4:0x80000000 0x7fc00000 0x449a3000 0xc49a8000\nf64x2_sub_0() => v128 i32x4:0x00000000 0x40935000 0x00000000 0x7ff80000\nf32x4_div_0() => v128 i32x4:0x7fc00000 0x7fc00000 0x3fc00000 0xc0000000\nf64x2_div_0() => v128 i32x4:0x00000000 0x3ff80000 0x00000000 0xc0000000\nf32x4_mul_0() => v128 i32x4:0x80000000 0x7fc00000 0x3fc00000 0xc0900000\nf64x2_mul_0() => v128 i32x4:0x00000000 0x3ff80000 0x00000000 0xc0120000\nv8x16_swizzle_0() => v128 i32x4:0x0d090501 0x020e0a06 0x03070f0b 0x0c080410\nv8x16_swizzle_1() => v128 i32x4:0x44444444 0x44444444 0x88888888 0x88888888\nv8x16_swizzle_2() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-bitselect.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; v128.bitselect\n  (func (export  \"func_v128_bitselect_0\") (result  v128)\n    v128.const i32x4 0x00ff0001 0x00040002 0x55555555 0x00000004\n    v128.const i32x4 0x00020001 0x00fe0002 0xaaaaaaaa 0x55000004\n    v128.const i32x4 0xffffffff 0x00000000 0x55555555 0x55000004\n    v128.bitselect)\n)\n\n(;; STDOUT ;;;\nfunc_v128_bitselect_0() => v128 i32x4:0x00ff0001 0x00fe0002 0xffffffff 0x00000004\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-compare.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; i8x16 eq\n  (func (export \"i8x16_eq_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i8x16.eq)\n  (func (export \"i8x16_eq_1\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x77000004\n    v128.const i32x4 0x05000001 0x0e002002 0x44000003 0x00000004\n    i8x16.eq)\n\n  ;; i16x8 eq\n  (func (export \"i16x8_eq_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i16x8.eq)\n  (func (export \"i16x8_eq_1\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x77000004\n    v128.const i32x4 0x05000001 0x0e002002 0x44000003 0x00000004\n    i16x8.eq)\n\n  ;; i32x4 eq\n  (func (export \"i32x4_eq_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i32x4.eq)\n  (func (export \"i32x4_eq_1\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x77000004\n    v128.const i32x4 0x05000001 0x0e002002 0x44000003 0x00000004\n    i32x4.eq)\n\n  ;; f32x4 eq\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000, 0xffc00000 is a NaN\n  ;; 1.5 = 0x449a5000, 1.0 = 0x3f800000\n  (func (export \"f32x4_eq_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0x3f800000\n    f32x4.eq)\n\n  ;; f64x2 eq\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; fff8000000000000 is a NaN\n  ;; 1.5 = 3ff8000000000000, 1.0 = 0x3ff0000000000000\n  (func (export \"f64x2_eq_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.eq)\n  (func (export \"f64x2_eq_1\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x3ff80000\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x3ff00000\n    f64x2.eq)\n\n  ;; i8x16 ne\n  (func (export \"i8x16_ne_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i8x16.ne)\n  (func (export \"i8x16_ne_1\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x77000004\n    v128.const i32x4 0x05000001 0x0e002002 0x44000003 0x00000004\n    i8x16.ne)\n\n  ;; i16x8 ne\n  (func (export \"i16x8_ne_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i16x8.ne)\n  (func (export \"i16x8_ne_1\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x77000004\n    v128.const i32x4 0x05000001 0x0e002002 0x44000003 0x00000004\n    i16x8.ne)\n\n  ;; i32x4 ne\n  (func (export \"i32x4_ne_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i32x4.ne)\n  (func (export \"i32x4_ne_1\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x77000004\n    v128.const i32x4 0x05000001 0x0e002002 0x44000003 0x00000004\n    i32x4.ne)\n\n  ;; f32x4 ne\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000, 0xffc00000 is a NaN\n  ;; 1.5 = 0x449a5000, 1.0 = 0x3f800000\n  (func (export \"f32x4_ne_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0x3f800000\n    f32x4.ne)\n\n  ;; f64x2 ne\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; fff8000000000000 is a NaN\n  ;; 1.5 = 3ff8000000000000, 1.0 = 0x3ff0000000000000\n  (func (export \"f64x2_ne_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.ne)\n  (func (export \"f64x2_ne_1\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x3ff80000\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x3ff00000\n    f64x2.ne)\n\n  ;; i8x16 lt (sign and unsigned)\n  (func (export \"i8x16_lt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.lt_s)\n  (func (export \"i8x16_lt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.lt_u)\n\n  ;; i16x8 lt (sign and unsigned)\n  (func (export \"i16x8_lt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.lt_s)\n  (func (export \"i16x8_lt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.lt_u)\n\n  ;; i32x4 lt (sign and unsigned)\n  (func (export \"i32x4_lt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.lt_s)\n  (func (export \"i32x4_lt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.lt_u)\n\n  ;; f32x4 lt\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000, 0xffc00000 is a NaN\n  ;; 1.5 = 0x449a5000, 1.0 = 0x3f800000\n  (func (export \"f32x4_lt_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0xffc00000 0x3f800000\n    f32x4.lt)\n\n  ;; f64x2 lt\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; fff8000000000000 is a NaN\n  ;; 1.5 = 3ff8000000000000, 1.0 = 0x3ff0000000000000\n  (func (export \"f64x2_lt_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.lt)\n  (func (export \"f64x2_lt_1\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x3ff80000\n    v128.const i32x4 0x00000000 0xfff80000 0x00000000 0x3ff00000\n    f64x2.lt)\n\n  ;; i8x16 le (sign and unsigned)\n  (func (export \"i8x16_le_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.le_s)\n  (func (export \"i8x16_le_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.le_u)\n\n  ;; i16x8 le (sign and unsigned)\n  (func (export \"i16x8_le_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.le_s)\n  (func (export \"i16x8_le_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.le_u)\n\n  ;; i32x4 le (sign and unsigned)\n  (func (export \"i32x4_le_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.le_s)\n  (func (export \"i32x4_le_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.le_u)\n\n  ;; f32x4 le\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000, 0xffc00000 is a NaN\n  ;; 1.5 = 0x449a5000, 1.0 = 0x3f800000\n  (func (export \"f32x4_le_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0xffc00000 0x3f800000\n    f32x4.le)\n\n  ;; f64x2 le\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; fff8000000000000 is a NaN\n  ;; 1.5 = 3ff8000000000000, 1.0 = 0x3ff0000000000000\n  (func (export \"f64x2_le_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.le)\n  (func (export \"f64x2_le_1\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x3ff80000\n    v128.const i32x4 0x00000000 0xfff80000 0x00000000 0x3ff00000\n    f64x2.le)\n\n  ;; i8x16 gt (sign and unsigned)\n  (func (export \"i8x16_gt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.gt_s)\n  (func (export \"i8x16_gt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.gt_u)\n\n  ;; i16x8 gt (sign and unsigned)\n  (func (export \"i16x8_gt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.gt_s)\n  (func (export \"i16x8_gt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.gt_u)\n\n  ;; i32x4 gt (sign and unsigned)\n  (func (export \"i32x4_gt_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.gt_s)\n  (func (export \"i32x4_gt_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.gt_u)\n\n  ;; f32x4 gt\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000, 0xffc00000 is a NaN\n  ;; 1.5 = 0x449a5000, 1.0 = 0x3f800000\n  (func (export \"f32x4_gt_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0xffc00000 0x3f800000\n    f32x4.gt)\n\n  ;; f64x2 gt\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; fff8000000000000 is a NaN\n  ;; 1.5 = 3ff8000000000000, 1.0 = 0x3ff0000000000000\n  (func (export \"f64x2_gt_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.gt)\n  (func (export \"f64x2_gt_1\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x3ff80000\n    v128.const i32x4 0x00000000 0xfff80000 0x00000000 0x3ff00000\n    f64x2.gt)\n\n  ;; i8x16 ge (sign and unsigned)\n  (func (export \"i8x16_ge_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.ge_s)\n  (func (export \"i8x16_ge_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i8x16.ge_u)\n\n  ;; i16x8 ge (sign and unsigned)\n  (func (export \"i16x8_ge_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.ge_s)\n  (func (export \"i16x8_ge_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i16x8.ge_u)\n\n  ;; i32x4 ge (sign and unsigned)\n  (func (export \"i32x4_ge_s\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.ge_s)\n  (func (export \"i32x4_ge_u\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00008003 0x00000004\n    v128.const i32x4 0x02000001 0xe000ff02 0x00000003 0x00008104\n    i32x4.ge_u)\n\n  ;; f32x4 ge\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000, 0xffc00000 is a NaN\n  ;; 1.5 = 0x449a5000, 1.0 = 0x3f800000\n  (func (export \"f32x4_ge_0\") (result v128)\n    v128.const i32x4 0x00000000 0xffc00000 0x449a5000 0x449a5000\n    v128.const i32x4 0x80000000 0xffc00000 0xffc00000 0x3f800000\n    f32x4.ge)\n\n  ;; f64x2 ge\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; fff8000000000000 is a NaN\n  ;; 1.5 = 3ff8000000000000, 1.0 = 0x3ff0000000000000\n  (func (export \"f64x2_ge_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.ge)\n  (func (export \"f64x2_ge_1\") (result v128)\n    v128.const i32x4 0x00000000 0x3ff80000 0x00000000 0x3ff80000\n    v128.const i32x4 0x00000000 0xfff80000 0x00000000 0x3ff00000\n    f64x2.ge)\n)\n(;; STDOUT ;;;\ni8x16_eq_0() => v128 i32x4:0xffffffff 0xffffffff 0xffffffff 0xffffffff\ni8x16_eq_1() => v128 i32x4:0x00ffffff 0x00ff00ff 0x00ffffff 0x00ffffff\ni16x8_eq_0() => v128 i32x4:0xffffffff 0xffffffff 0xffffffff 0xffffffff\ni16x8_eq_1() => v128 i32x4:0x0000ffff 0x00000000 0x0000ffff 0x0000ffff\ni32x4_eq_0() => v128 i32x4:0xffffffff 0xffffffff 0xffffffff 0xffffffff\ni32x4_eq_1() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\nf32x4_eq_0() => v128 i32x4:0xffffffff 0x00000000 0xffffffff 0x00000000\nf64x2_eq_0() => v128 i32x4:0xffffffff 0xffffffff 0x00000000 0x00000000\nf64x2_eq_1() => v128 i32x4:0xffffffff 0xffffffff 0x00000000 0x00000000\ni8x16_ne_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni8x16_ne_1() => v128 i32x4:0xff000000 0xff00ff00 0xff000000 0xff000000\ni16x8_ne_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni16x8_ne_1() => v128 i32x4:0xffff0000 0xffffffff 0xffff0000 0xffff0000\ni32x4_ne_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni32x4_ne_1() => v128 i32x4:0xffffffff 0xffffffff 0xffffffff 0xffffffff\nf32x4_ne_0() => v128 i32x4:0x00000000 0xffffffff 0x00000000 0xffffffff\nf64x2_ne_0() => v128 i32x4:0x00000000 0x00000000 0xffffffff 0xffffffff\nf64x2_ne_1() => v128 i32x4:0x00000000 0x00000000 0xffffffff 0xffffffff\ni8x16_lt_s() => v128 i32x4:0xff000000 0x00000000 0x0000ff00 0x00000000\ni8x16_lt_u() => v128 i32x4:0x00000000 0x0000ff00 0x00000000 0x0000ff00\ni16x8_lt_s() => v128 i32x4:0xffff0000 0x00000000 0x0000ffff 0x00000000\ni16x8_lt_u() => v128 i32x4:0x00000000 0x0000ffff 0x00000000 0x0000ffff\ni32x4_lt_s() => v128 i32x4:0xffffffff 0xffffffff 0x00000000 0xffffffff\ni32x4_lt_u() => v128 i32x4:0x00000000 0xffffffff 0x00000000 0xffffffff\nf32x4_lt_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\nf64x2_lt_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\nf64x2_lt_1() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni8x16_le_s() => v128 i32x4:0xffffffff 0xffff00ff 0xffffffff 0xffff00ff\ni8x16_le_u() => v128 i32x4:0x00ffffff 0xffffffff 0xffff00ff 0xffffffff\ni16x8_le_s() => v128 i32x4:0xffffffff 0xffff0000 0xffffffff 0xffff0000\ni16x8_le_u() => v128 i32x4:0x0000ffff 0xffffffff 0xffff0000 0xffffffff\ni32x4_le_s() => v128 i32x4:0xffffffff 0xffffffff 0x00000000 0xffffffff\ni32x4_le_u() => v128 i32x4:0x00000000 0xffffffff 0x00000000 0xffffffff\nf32x4_le_0() => v128 i32x4:0xffffffff 0x00000000 0x00000000 0x00000000\nf64x2_le_0() => v128 i32x4:0xffffffff 0xffffffff 0x00000000 0x00000000\nf64x2_le_1() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\ni8x16_gt_s() => v128 i32x4:0x00000000 0x0000ff00 0x00000000 0x0000ff00\ni8x16_gt_u() => v128 i32x4:0xff000000 0x00000000 0x0000ff00 0x00000000\ni16x8_gt_s() => v128 i32x4:0x00000000 0x0000ffff 0x00000000 0x0000ffff\ni16x8_gt_u() => v128 i32x4:0xffff0000 0x00000000 0x0000ffff 0x00000000\ni32x4_gt_s() => v128 i32x4:0x00000000 0x00000000 0xffffffff 0x00000000\ni32x4_gt_u() => v128 i32x4:0xffffffff 0x00000000 0xffffffff 0x00000000\nf32x4_gt_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0xffffffff\nf64x2_gt_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x00000000\nf64x2_gt_1() => v128 i32x4:0x00000000 0x00000000 0xffffffff 0xffffffff\ni8x16_ge_s() => v128 i32x4:0x00ffffff 0xffffffff 0xffff00ff 0xffffffff\ni8x16_ge_u() => v128 i32x4:0xffffffff 0xffff00ff 0xffffffff 0xffff00ff\ni16x8_ge_s() => v128 i32x4:0x0000ffff 0xffffffff 0xffff0000 0xffffffff\ni16x8_ge_u() => v128 i32x4:0xffffffff 0xffff0000 0xffffffff 0xffff0000\ni32x4_ge_s() => v128 i32x4:0x00000000 0x00000000 0xffffffff 0x00000000\ni32x4_ge_u() => v128 i32x4:0xffffffff 0x00000000 0xffffffff 0x00000000\nf32x4_ge_0() => v128 i32x4:0xffffffff 0x00000000 0x00000000 0xffffffff\nf64x2_ge_0() => v128 i32x4:0xffffffff 0xffffffff 0x00000000 0x00000000\nf64x2_ge_1() => v128 i32x4:0x00000000 0x00000000 0xffffffff 0xffffffff\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-lane.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; i8x16 extract lane signed/unsigned\n  (func (export  \"func_i8x16_extract_lane_s_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x000000ff 0x0000017f\n    i8x16.extract_lane_s 8)\n  (func (export  \"func_i8x16_extract_lane_u_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x000000ff 0x0000017f\n    i8x16.extract_lane_u 8)\n\n  ;; i16x8 extract lane signed/unsigned\n  (func (export  \"func_i16x8_extract_lane_s_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i16x8.extract_lane_s 4)\n  (func (export  \"func_i16x8_extract_lane_u_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i16x8.extract_lane_u 4)\n\n  ;; i32x4 extract lane\n  (func (export  \"func_i32x4_extract_lane_0\") (result i32)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i32x4.extract_lane 2)\n\n  ;; i64x2 extract lane\n  (func (export  \"func_i64x2_extract_lane_0\") (result i64)\n    v128.const i32x4 0x0000000f 0x00000000 0x0000ffff 0x0000017f\n    i64x2.extract_lane 0)\n\n  ;; f32x4 extract lane\n  ;; For Floating num:\n  ;; 1.5 = 0x3fc00000\n  (func (export  \"func_f32x4_extract_lane_0\") (result f32)\n    v128.const i32x4 0x00000001 0x3fc00000 0x0000ffff 0x0000017f\n    f32x4.extract_lane 1)\n\n  ;; f64x2 extract lane\n  ;; For Double num:\n  ;; 4.5 = 0x4012000000000000\n  (func (export  \"func_f64x2_extract_lane_0\") (result f64)\n    v128.const i32x4 0x00000000 0x40120000 0x0000ffff 0x0000017f\n    f64x2.extract_lane 0)\n\n  ;; i8x16 replace lane\n  (func (export  \"func_i8x16_replace_lane_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000000f 0x000000ff 0x0000017f\n    i32.const 0xe5\n    i8x16.replace_lane 8)\n\n  ;; i16x8 replace lane\n  (func (export  \"func_i16x8_replace_lane_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i32.const 0xe5e6\n    i16x8.replace_lane 4)\n\n  ;; i32x4 replace lane\n  (func (export  \"func_i32x4_replace_lane_0\") (result v128)\n    v128.const i32x4 0x00000001 0x0000000f 0x0000ffff 0x0000017f\n    i32.const 0x12345678\n    i32x4.replace_lane 2)\n\n  ;; i64x2 replace lane\n  (func (export  \"func_i64x2_replace_lane_0\") (result v128)\n    v128.const i32x4 0x0000000f 0x00000000 0x0000ffff 0x0000017f\n    i64.const 0x0000123400005678\n    i64x2.replace_lane 0)\n\n  ;; f32x4 replace lane\n  ;; For Floating num:\n  ;; 1.5 = 0x3fc00000\n  (func (export  \"func_f32x4_replace_lane_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000000 0x0000ffff 0x0000017f\n    f32.const 1.5\n    f32x4.replace_lane 1)\n\n  ;; f64x2 replace lane\n  ;; For Double num:\n  ;; 4.5 = 0x4012000000000000\n  (func (export  \"func_f64x2_replace_lane_0\") (result v128)\n    v128.const i32x4 0x0000789a 0xff880330 0x0000ffff 0x0000017f\n    f64.const 4.5\n    f64x2.replace_lane 0)\n\n  ;; v8x16 shuffle\n  (func (export  \"func_v8x16_shuffle_0\") (result v128)\n    v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n    v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155\n    i8x16.shuffle  16 1 18 3 20 5 22 7 24 9 26 11 28 13 30 15)\n)\n(;; STDOUT ;;;\nfunc_i8x16_extract_lane_s_0() => i32:4294967295\nfunc_i8x16_extract_lane_u_0() => i32:255\nfunc_i16x8_extract_lane_s_0() => i32:4294967295\nfunc_i16x8_extract_lane_u_0() => i32:65535\nfunc_i32x4_extract_lane_0() => i32:65535\nfunc_i64x2_extract_lane_0() => i64:15\nfunc_f32x4_extract_lane_0() => f32:1.500000\nfunc_f64x2_extract_lane_0() => f64:4.500000\nfunc_i8x16_replace_lane_0() => v128 i32x4:0x00000001 0x0000000f 0x000000e5 0x0000017f\nfunc_i16x8_replace_lane_0() => v128 i32x4:0x00000001 0x0000000f 0x0000e5e6 0x0000017f\nfunc_i32x4_replace_lane_0() => v128 i32x4:0x00000001 0x0000000f 0x12345678 0x0000017f\nfunc_i64x2_replace_lane_0() => v128 i32x4:0x00005678 0x00001234 0x0000ffff 0x0000017f\nfunc_f32x4_replace_lane_0() => v128 i32x4:0x00000001 0x3fc00000 0x0000ffff 0x0000017f\nfunc_f64x2_replace_lane_0() => v128 i32x4:0x00000000 0x40120000 0x0000ffff 0x0000017f\nfunc_v8x16_shuffle_0() => v128 i32x4:0xff55ff55 0xff55ff55 0xff55ff55 0xff55ff55\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-load-store.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (memory 1)\n  (data (i32.const 0) \"\\ff\\ff\\ff\\ff\")\n  (data (i32.const 4) \"\\00\\00\\ce\\41\")\n  (data (i32.const 8) \"\\00\\00\\00\\00\\00\\ff\\8f\\40\")\n  (data (i32.const 16) \"\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\")\n\n  ;; v128 load\n  (func (export \"v128_load_0\") (result v128)\n    i32.const 4\n    v128.load)\n\n  ;; v8x16 load_splat\n  (func (export \"v8x16_load_splat_0\") (result v128)\n    i32.const 6\n    v128.load8_splat)\n\n  ;; v16x8 load_splat\n  (func (export \"v16x8_load_splat_0\") (result v128)\n    i32.const 6\n    v128.load16_splat)\n\n  ;; v32x4 load_splat\n  (func (export \"v32x4_load_splat_0\") (result v128)\n    i32.const 4\n    v128.load32_splat)\n\n  ;; v64x2 load_splat\n  (func (export \"v64x2_load_splat_0\") (result v128)\n    i32.const 0\n    v128.load64_splat)\n\n  ;; v128 store\n  (func (export \"v128_store_0\") (result v128)\n    i32.const 4\n    v128.const i32x4 0x11223344 0x55667788 0x99aabbcc 0xddeeff00\n    v128.store\n    i32.const 4\n    v128.load)\n)\n(;; STDOUT ;;;\nv128_load_0() => v128 i32x4:0x41ce0000 0x00000000 0x408fff00 0xffffffff\nv8x16_load_splat_0() => v128 i32x4:0xcececece 0xcececece 0xcececece 0xcececece\nv16x8_load_splat_0() => v128 i32x4:0x41ce41ce 0x41ce41ce 0x41ce41ce 0x41ce41ce\nv32x4_load_splat_0() => v128 i32x4:0x41ce0000 0x41ce0000 0x41ce0000 0x41ce0000\nv64x2_load_splat_0() => v128 i32x4:0xffffffff 0x41ce0000 0xffffffff 0x41ce0000\nv128_store_0() => v128 i32x4:0x11223344 0x55667788 0x99aabbcc 0xddeeff00\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-shift.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; i8x16 shl\n  (func (export \"i8x16_shl_0\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i32.const 3\n    i8x16.shl)\n  (func (export \"i8x16_shl_1\") (result v128)\n    v128.const i32x4 0xff000001 0xe0000002 0x00000003 0x00000004\n    i32.const 11\n    i8x16.shl)\n\n  ;; i16x8 shl\n  (func (export \"i16x8_shl_0\") (result v128)\n    v128.const i32x4 0xff000071 0xe0000702 0x00000003 0x00000004\n    i32.const 3\n    i16x8.shl)\n  (func (export \"i16x8_shl_1\") (result v128)\n    v128.const i32x4 0xff000071 0xe0000702 0x00000003 0x00000004\n    i32.const 19\n    i16x8.shl)\n\n  ;; i32x4 shl\n  (func (export \"i32x4_shl_0\") (result v128)\n    v128.const i32x4 0xff0ff071 0xe0077702 0xe0004003 0x00002004\n    i32.const 3\n    i32x4.shl)\n  (func (export \"i32x4_shl_1\") (result v128)\n    v128.const i32x4 0xff0ff071 0xe0077702 0xe0004003 0x00002004\n    i32.const 35\n    i32x4.shl)\n\n  ;; i64x2 shl\n  (func (export \"i64x2_shl_0\") (result v128)\n    v128.const i32x4 0xff000055 0xe0000702 0xe0004003 0x00002004\n    i32.const 3\n    i64x2.shl)\n  (func (export \"i64x2_shl_1\") (result v128)\n    v128.const i32x4 0xff000055 0xe0000702 0xe0004003 0x00002004\n    i32.const 67\n    i64x2.shl)\n\n  ;; i8x16 shr (signed and unsigned)\n  (func (export \"i8x16_shr_s_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i8x16.shr_s)\n  (func (export \"i8x16_shr_s_1\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 11\n    i8x16.shr_s)\n  (func (export \"i8x16_shr_u_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i8x16.shr_u)\n  (func (export \"i8x16_shr_u_1\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 11\n    i8x16.shr_u)\n\n  ;; i16x8 shr (signed and unsigned)\n  (func (export \"i16x8_shr_s_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i16x8.shr_s)\n  (func (export \"i16x8_shr_s_1\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 19\n    i16x8.shr_s)\n  (func (export \"i16x8_shr_u_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i16x8.shr_u)\n  (func (export \"i16x8_shr_u_1\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 19\n    i16x8.shr_u)\n\n  ;; i32x4 shr (signed and unsigned)\n  (func (export \"i32x4_shr_s_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i32x4.shr_s)\n  (func (export \"i32x4_shr_s_1\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 35\n    i32x4.shr_s)\n  (func (export \"i32x4_shr_u_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i32x4.shr_u)\n  (func (export \"i32x4_shr_u_1\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 35\n    i32x4.shr_u)\n\n  ;; i64x2 shr (signed and unsigned)\n  (func (export \"i64x2_shr_s_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i64x2.shr_s)\n  (func (export \"i64x2_shr_s_1\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 67\n    i64x2.shr_s)\n  (func (export \"i64x2_shr_u_0\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 3\n    i64x2.shr_u)\n  (func (export \"i64x2_shr_u_1\") (result v128)\n    v128.const i32x4 0xff00000f 0xe00f7002 0x0f000003 0x000ff004\n    i32.const 67\n    i64x2.shr_u)\n)\n(;; STDOUT ;;;\ni8x16_shl_0() => v128 i32x4:0xf8000008 0x00000010 0x00000018 0x00000020\ni8x16_shl_1() => v128 i32x4:0xf8000008 0x00000010 0x00000018 0x00000020\ni16x8_shl_0() => v128 i32x4:0xf8000388 0x00003810 0x00000018 0x00000020\ni16x8_shl_1() => v128 i32x4:0xf8000388 0x00003810 0x00000018 0x00000020\ni32x4_shl_0() => v128 i32x4:0xf87f8388 0x003bb810 0x00020018 0x00010020\ni32x4_shl_1() => v128 i32x4:0xf87f8388 0x003bb810 0x00020018 0x00010020\ni64x2_shl_0() => v128 i32x4:0xf80002a8 0x00003817 0x00020018 0x00010027\ni64x2_shl_1() => v128 i32x4:0xf80002a8 0x00003817 0x00020018 0x00010027\ni8x16_shr_s_0() => v128 i32x4:0xff000001 0xfc010e00 0x01000000 0x0001fe00\ni8x16_shr_s_1() => v128 i32x4:0xff000001 0xfc010e00 0x01000000 0x0001fe00\ni8x16_shr_u_0() => v128 i32x4:0x1f000001 0x1c010e00 0x01000000 0x00011e00\ni8x16_shr_u_1() => v128 i32x4:0x1f000001 0x1c010e00 0x01000000 0x00011e00\ni16x8_shr_s_0() => v128 i32x4:0xffe00001 0xfc010e00 0x01e00000 0x0001fe00\ni16x8_shr_s_1() => v128 i32x4:0xffe00001 0xfc010e00 0x01e00000 0x0001fe00\ni16x8_shr_u_0() => v128 i32x4:0x1fe00001 0x1c010e00 0x01e00000 0x00011e00\ni16x8_shr_u_1() => v128 i32x4:0x1fe00001 0x1c010e00 0x01e00000 0x00011e00\ni32x4_shr_s_0() => v128 i32x4:0xffe00001 0xfc01ee00 0x01e00000 0x0001fe00\ni32x4_shr_s_1() => v128 i32x4:0xffe00001 0xfc01ee00 0x01e00000 0x0001fe00\ni32x4_shr_u_0() => v128 i32x4:0x1fe00001 0x1c01ee00 0x01e00000 0x0001fe00\ni32x4_shr_u_1() => v128 i32x4:0x1fe00001 0x1c01ee00 0x01e00000 0x0001fe00\ni64x2_shr_s_0() => v128 i32x4:0x5fe00001 0xfc01ee00 0x81e00000 0x0001fe00\ni64x2_shr_s_1() => v128 i32x4:0x5fe00001 0xfc01ee00 0x81e00000 0x0001fe00\ni64x2_shr_u_0() => v128 i32x4:0x5fe00001 0x1c01ee00 0x81e00000 0x0001fe00\ni64x2_shr_u_1() => v128 i32x4:0x5fe00001 0x1c01ee00 0x81e00000 0x0001fe00\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-splat.txt",
    "content": ";;; TOOL: run-interp\n(module\n\n  ;; i8x16\n  (func (export  \"func_i8x16_splat_0\") (result  v128)\n    i32.const 0x7f\n    i8x16.splat)\n  (func (export  \"func_i8x16_splat_1\") (result  v128)\n    i32.const 0x01\n    i8x16.splat)\n  (func (export  \"func_i8x16_splat_2\") (result  v128)\n    i32.const 0x3524\n    i8x16.splat)\n\n  ;; i16x8\n  (func (export  \"func_i16x8_splat_0\") (result  v128)\n    i32.const 0x1234\n    i16x8.splat)\n  (func (export  \"func_i16x8_splat_1\") (result  v128)\n    i32.const 0x5aa5\n    i16x8.splat)\n  (func (export  \"func_i16x8_splat_2\") (result  v128)\n    i32.const 0x01234567\n    i16x8.splat)\n\n  ;; i32x4\n  (func (export  \"func_i32x4_splat_0\") (result  v128)\n    i32.const 0x12345678\n    i32x4.splat)\n  (func (export  \"func_i32x4_splat_1\") (result  v128)\n    i32.const 0x00000001\n    i32x4.splat)\n\n  ;; i64x2\n  (func (export  \"func_i64x2_splat_0\") (result  v128)\n    i64.const 0x1234567800000000\n    i64x2.splat)\n  (func (export  \"func_i64x2_splat_1\") (result  v128)\n    i64.const 0x0000000100000002\n    i64x2.splat)\n\n  ;; f32x4\n  ;; float 1.0 == Hex 0x3f800000\n  (func (export  \"func_f32x4_splat_0\") (result  v128)\n    f32.const 1.0\n    f32x4.splat)\n  ;; float 6.91 == Hex 0x40dd1eb8\n  (func (export  \"func_f32x4_splat_1\") (result  v128)\n    f32.const 6.91\n    f32x4.splat)\n\n  ;; f64x2\n  ;; double 1.0 == Hex 0x3ff0000000000000\n  (func (export  \"func_f64x2_splat_0\") (result  v128)\n    f64.const 1.0\n    f64x2.splat)\n  ;; double 6.91 == Hex 0x401ba3d70a3d70a4\n  (func (export  \"func_f64x2_splat_1\") (result  v128)\n    f64.const 6.91\n    f64x2.splat)\n)\n(;; STDOUT ;;;\nfunc_i8x16_splat_0() => v128 i32x4:0x7f7f7f7f 0x7f7f7f7f 0x7f7f7f7f 0x7f7f7f7f\nfunc_i8x16_splat_1() => v128 i32x4:0x01010101 0x01010101 0x01010101 0x01010101\nfunc_i8x16_splat_2() => v128 i32x4:0x24242424 0x24242424 0x24242424 0x24242424\nfunc_i16x8_splat_0() => v128 i32x4:0x12341234 0x12341234 0x12341234 0x12341234\nfunc_i16x8_splat_1() => v128 i32x4:0x5aa55aa5 0x5aa55aa5 0x5aa55aa5 0x5aa55aa5\nfunc_i16x8_splat_2() => v128 i32x4:0x45674567 0x45674567 0x45674567 0x45674567\nfunc_i32x4_splat_0() => v128 i32x4:0x12345678 0x12345678 0x12345678 0x12345678\nfunc_i32x4_splat_1() => v128 i32x4:0x00000001 0x00000001 0x00000001 0x00000001\nfunc_i64x2_splat_0() => v128 i32x4:0x00000000 0x12345678 0x00000000 0x12345678\nfunc_i64x2_splat_1() => v128 i32x4:0x00000002 0x00000001 0x00000002 0x00000001\nfunc_f32x4_splat_0() => v128 i32x4:0x3f800000 0x3f800000 0x3f800000 0x3f800000\nfunc_f32x4_splat_1() => v128 i32x4:0x40dd1eb8 0x40dd1eb8 0x40dd1eb8 0x40dd1eb8\nfunc_f64x2_splat_0() => v128 i32x4:0x00000000 0x3ff00000 0x00000000 0x3ff00000\nfunc_f64x2_splat_1() => v128 i32x4:0x0a3d70a4 0x401ba3d7 0x0a3d70a4 0x401ba3d7\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/simd-unary.txt",
    "content": ";;; TOOL: run-interp\n(module\n  ;; i8x16 neg\n  (func (export \"i8x16_neg_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i8x16.neg)\n\n  ;; i16x8 neg\n  (func (export \"i16x8_neg_0\") (result v128)\n    v128.const i32x4 0x0000ffff 0x00007fff 0x00000003 0x00000004\n    i16x8.neg)\n\n  ;; i32x4 neg\n  (func (export \"i32x4_neg_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i32x4.neg)\n\n  ;; i64x2 neg\n  (func (export \"i64x2_neg_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004\n    i64x2.neg)\n\n  ;; v128 not\n  (func (export \"v128_not_0\") (result v128)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    v128.not)\n\n  ;; v128 any_true\n  (func (export \"v128_any_true_0\") (result i32)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    v128.any_true)\n  (func (export \"v128_any_true_1\") (result i32)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000\n    v128.any_true)\n\n  ;; i8x16 all_true\n  (func (export \"i8x16_all_true_0\") (result i32)\n    v128.const i32x4 0x01020304 0x01050706 0x10020403 0x20103004\n    i8x16.all_true)\n  (func (export \"i8x16_all_true_1\") (result i32)\n    v128.const i32x4 0x00000001 0x00000200 0x00030000 0x00000000\n    i8x16.all_true)\n\n  ;; i16x8 all_true\n  (func (export \"i16x8_all_true_0\") (result i32)\n    v128.const i32x4 0x00040004 0x00030003 0x00020002 0x00010001\n    i16x8.all_true)\n  (func (export \"i16x8_all_true_1\") (result i32)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    i16x8.all_true)\n\n  ;; i32x4 all_true\n  (func (export \"i32x4_all_true_0\") (result i32)\n    v128.const i32x4 0x00ff0001 0x00550002 0x00000003 0x00000004\n    i32x4.all_true)\n  (func (export \"i32x4_all_true_1\") (result i32)\n    v128.const i32x4 0x01010101 0x000000ff 0x000ff000 0x00000000\n    i32x4.all_true)\n\n  ;; i8x16 bitmask\n  (func (export \"i8x16_bitmask_0\") (result i32)\n    v128.const i32x4 0x80808080 0x80808080 0x80808080 0x80808080\n    i8x16.bitmask)\n  (func (export \"i8x16_bitmask_1\") (result i32)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000\n    i8x16.bitmask)\n\n  ;; i16x8 bitmask\n  (func (export \"i16x8_bitmask_0\") (result i32)\n    v128.const i32x4 0x80008000 0x80008000 0x80008000 0x80008000\n    i16x8.bitmask)\n  (func (export \"i16x8_bitmask_1\") (result i32)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000\n    i16x8.bitmask)\n\n  ;; i32x4 bitmask\n  (func (export \"i32x4_bitmask_0\") (result i32)\n    v128.const i32x4 0x80000000 0x80000000 0x80000000 0x80000000\n    i32x4.bitmask)\n  (func (export \"i32x4_bitmask_1\") (result i32)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000\n    i32x4.bitmask)\n\n  ;; f32x4 neg\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000\n  ;; 0xffc00000 is a NaN, 0x7fc00000 is a NaN.\n  ;;  1234.5 = 0x449a5000,  1.0 = 0x3f800000\n  ;; -1234.5 = 0xc49a5000, -1.0 = 0xbf800000\n  ;; test is:   [-0.0, NaN,  1234.5, -1.0]\n  ;; expect is: [ 0.0, NaN, -1234.5,  1.0]\n  (func (export \"f32x4_neg_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xbf800000\n    f32x4.neg)\n\n  ;; f64x2 neg\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; 0xfff8000000000000 is a NaN, 0x7ff8000000000000 is a NaN.\n  ;; 1234.5  = 0x40934a0000000000,  1.0 = 0x3ff0000000000000\n  ;; -1234.5 = 0xc0934a0000000000, -1.0 = 0xbff0000000000000\n  ;; tests are:   [ 0.0, NaN],  [-1234.5,  1.0]\n  ;; expects are: [-0.0, NaN],  [ 1234.5, -1.0]\n  (func (export \"f64x2_neg_0\") (result v128)\n    v128.const i32x4 0x00000000 0x00000000 0x00000000 0xfff80000\n    f64x2.neg)\n  (func (export \"f64x2_neg_1\") (result v128)\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.neg)\n\n  ;; f32x4 abs\n  ;; For Floating num:\n  ;; +0.0 = 0x00000000, -0.0 = 0x80000000\n  ;; 0xffc00000 is a NaN, 0x7fc00000 is a NaN.\n  ;;  1234.5 = 0x449a5000,  1.0 = 0x3f800000\n  ;; -1234.5 = 0xc49a5000, -1.0 = 0xbf800000\n  ;; test is:   [-0.0, NaN,  1234.5, -1.0]\n  ;; expect is: [ 0.0, NaN,  1234.5,  1.0]\n  (func (export \"f32x4_abs_0\") (result v128)\n    v128.const i32x4 0x80000000 0xffc00000 0x449a5000 0xbf800000\n    f32x4.abs)\n\n  ;; f64x2 abs\n  ;; For Double num:\n  ;; +0.0 = 0x0000000000000000, -0.0 = 0x8000000000000000\n  ;; 0xfff8000000000000 is a NaN, 0x7ff8000000000000 is a NaN.\n  ;; 1234.5  = 0x40934a0000000000,  1.0 = 0x3ff0000000000000\n  ;; -1234.5 = 0xc0934a0000000000, -1.0 = 0xbff0000000000000\n  ;; tests are:   [-0.0, NaN],  [-1234.5, 1.0]\n  ;; expects are: [ 0.0, NaN],  [ 1234.5, 1.0]\n  (func (export \"f64x2_abs_0\") (result v128)\n    v128.const i32x4 0x00000000 0x80000000 0x00000000 0xfff80000\n    f64x2.abs)\n  (func (export \"f64x2_abs_1\") (result v128)\n    v128.const i32x4 0x00000000 0xc0934a00 0x00000000 0x3ff00000\n    f64x2.abs)\n\n  ;; f32x4 sqrt\n  ;; For Floating num:\n  ;; 0xffc00000 is a NaN, 0x7fc00000 is a NaN.\n  ;; -1.0 = 0xbf800000, 4.0 = 0x40800000, 2.0 = 0x40000000 \n  ;;  9.0 = 0x41100000, 3.0 = 0x40400000\n  ;; test is:   [-1.0, NaN,  4.0, 9.0]\n  ;; expect is: [ NaN, NaN,  2.0, 3.0]\n  (func (export \"f32x4_sqrt_0\") (result v128)\n    v128.const i32x4 0xbf800000 0xffc00000 0x40800000 0x41100000\n    f32x4.sqrt)\n\n  ;; f64x2 sqrt\n  ;; For Double num:\n  ;; 0xfff8000000000000 is a NaN, 0x7ff8000000000000 is a NaN.\n  ;; -1.0 = 0xbff0000000000000, 4.0 = 0x4010000000000000\n  ;;  2.0 = 0x4000000000000000, 9.0 = 0x4022000000000000\n  ;;  3.0 = 0x4008000000000000\n  ;; tests are:   [-1.0, NaN],  [ 4.0, 9.0]\n  ;; expects are: [ NaN, NaN],  [ 2.0, 3.0]\n  (func (export \"f64x2_sqrt_0\") (result v128)\n    v128.const i32x4 0x00000000 0xbff00000 0x00000000 0xfff80000\n    f64x2.sqrt)\n  (func (export \"f64x2_sqrt_1\") (result v128)\n    v128.const i32x4 0x00000000 0x40100000 0x00000000 0x40220000\n    f64x2.sqrt)\n\n  ;; f32x4 convert_i32x4_s\n  ;; For Floating num:\n  ;; 1.0 = 0x3f800000 -1.0 = 0xbf800000 3.0 = 0x40400000\n  ;; test is:   [   1,   -1,   0,   3]\n  ;; expect is: [ 1.0, -1.0, 0.0, 3.0]\n  (func (export \"f32x4_convert_i32x4_s_0\") (result v128)\n    v128.const i32x4 0x00000001 0xffffffff 0x00000000 0x00000003\n    f32x4.convert_i32x4_s)\n\n  ;; f32x4 convert_i32x4_u\n  ;; For Floating num:\n  ;; 1.0 = 0x3f800000 0.0 = 0x00000000 3.0 = 0x40400000\n  ;; 2.0 = 0x40000000\n  ;; test is:   [   1,   2,   0,   3]\n  ;; expect is: [ 1.0, 2.0, 0.0, 3.0]\n  (func (export \"f32x4_convert_i32x4_u_0\") (result v128)\n    v128.const i32x4 0x00000001 0x00000002 0x00000000 0x00000003\n    f32x4.convert_i32x4_u)\n\n  ;; i32x4 trunc_sat_f32x4_s\n  ;; For Floating num:\n  ;; 0xffc00000 is a NaN.\n  ;; 1.5 = 0x3fc00000 -4.5 = 0xc0900000 1234.8 = 0x449a599a\n  ;; 1234 = 0x000004d2\n  ;; test is:   [ 1.5, -4.5, NaN,  1234.8]\n  ;; expect is: [   1,   -4,   0,    1234]\n  (func (export \"i32x4_trunc_sat_f32x4_s_0\") (result v128)\n    v128.const i32x4 0x3fc00000 0xc0900000 0xffc00000 0x449a599a\n    i32x4.trunc_sat_f32x4_s)\n\n  ;; i32x4 trunc_sat_f32x4_u\n  ;; For Floating num:\n  ;; 0xffc00000 is a NaN.\n  ;; 1.5 = 0x3fc00000 4.5 = 0x40900000 1234.8 = 0x449a599a\n  ;; 1234 = 0x000004d2\n  ;; test is:   [ 1.5, 4.5, NaN,  1234.8]\n  ;; expect is: [   1,   4,   0,    1234]\n  (func (export \"i32x4_trunc_sat_f32x4_u_0\") (result v128)\n    v128.const i32x4 0x3fc00000 0x40900000 0xffc00000 0x449a599a\n    i32x4.trunc_sat_f32x4_u)\n)\n(;; STDOUT ;;;\ni8x16_neg_0() => v128 i32x4:0x000000ff 0x000000fe 0x000000fd 0x000000fc\ni16x8_neg_0() => v128 i32x4:0x00000001 0x00008001 0x0000fffd 0x0000fffc\ni32x4_neg_0() => v128 i32x4:0xffffffff 0xfffffffe 0xfffffffd 0xfffffffc\ni64x2_neg_0() => v128 i32x4:0xffffffff 0xfffffffd 0xfffffffd 0xfffffffb\nv128_not_0() => v128 i32x4:0xff00fffe 0xffaafffd 0xfffffffc 0xfffffffb\nv128_any_true_0() => i32:1\nv128_any_true_1() => i32:0\ni8x16_all_true_0() => i32:1\ni8x16_all_true_1() => i32:0\ni16x8_all_true_0() => i32:1\ni16x8_all_true_1() => i32:0\ni32x4_all_true_0() => i32:1\ni32x4_all_true_1() => i32:0\ni8x16_bitmask_0() => i32:65535\ni8x16_bitmask_1() => i32:0\ni16x8_bitmask_0() => i32:255\ni16x8_bitmask_1() => i32:0\ni32x4_bitmask_0() => i32:15\ni32x4_bitmask_1() => i32:0\nf32x4_neg_0() => v128 i32x4:0x00000000 0x7fc00000 0xc49a5000 0x3f800000\nf64x2_neg_0() => v128 i32x4:0x00000000 0x80000000 0x00000000 0x7ff80000\nf64x2_neg_1() => v128 i32x4:0x00000000 0x40934a00 0x00000000 0xbff00000\nf32x4_abs_0() => v128 i32x4:0x00000000 0x7fc00000 0x449a5000 0x3f800000\nf64x2_abs_0() => v128 i32x4:0x00000000 0x00000000 0x00000000 0x7ff80000\nf64x2_abs_1() => v128 i32x4:0x00000000 0x40934a00 0x00000000 0x3ff00000\nf32x4_sqrt_0() => v128 i32x4:0x7fc00000 0x7fc00000 0x40000000 0x40400000\nf64x2_sqrt_0() => v128 i32x4:0x00000000 0x7ff80000 0x00000000 0x7ff80000\nf64x2_sqrt_1() => v128 i32x4:0x00000000 0x40000000 0x00000000 0x40080000\nf32x4_convert_i32x4_s_0() => v128 i32x4:0x3f800000 0xbf800000 0x00000000 0x40400000\nf32x4_convert_i32x4_u_0() => v128 i32x4:0x3f800000 0x40000000 0x00000000 0x40400000\ni32x4_trunc_sat_f32x4_s_0() => v128 i32x4:0x00000001 0xfffffffc 0x00000000 0x000004d2\ni32x4_trunc_sat_f32x4_u_0() => v128 i32x4:0x00000001 0x00000004 0x00000000 0x000004d2\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/start-failure.txt",
    "content": ";;; TOOL: run-interp\n;;; ERROR: 1\n(module\n  (func $start unreachable)\n  (start $start)\n)\n(;; STDERR ;;;\nerror initializing module: unreachable executed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/interp/start.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (memory 1)\n  (func $start\n    i32.const 0 \n    i32.const 42\n    i32.store)\n  (start $start)\n  (func (export \"get\") (result i32) \n    i32.const 0\n    i32.load))\n(;; STDOUT ;;;\nget() => i32:42\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/store.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (memory 1)\n\n  (func (export \"i32_store8\") (result i32)\n      i32.const 0\n      i32.const 0xfb\n      i32.store8\n      i32.const 1\n      i32.const 0xfc\n      i32.store8\n      i32.const 2\n      i32.const 0xfd\n      i32.store8\n      i32.const 3\n      i32.const 0xfe\n      i32.store8\n      i32.const 0\n      i32.load)\n\n  (func (export \"i32_store16\") (result i32)\n      i32.const 0\n      i32.const 0xcac9\n      i32.store16\n      i32.const 2\n      i32.const 0xcccb\n      i32.store16\n      i32.const 0\n      i32.load)\n\n  (func (export \"i32_store\") (result i32)\n      i32.const 0\n      i32.const -123456\n      i32.store\n      i32.const 0\n      i32.load)\n\n  (func (export \"i64_store8\") (result i32)\n      i32.const 0\n      i64.const 0xeeeeeeeeeeeeeefb\n      i64.store8\n      i32.const 1\n      i64.const 0xeeeeeeeeeeeeeefc\n      i64.store8\n      i32.const 2\n      i64.const 0xeeeeeeeeeeeeeefd\n      i64.store8\n      i32.const 3\n      i64.const 0xeeeeeeeeeeeeeefe\n      i64.store8\n      i32.const 0\n      i32.load)\n\n  (func (export \"i64_store16\") (result i32)\n      i32.const 0\n      i64.const 0xeeeeeeeeeeeecac9\n      i64.store16\n      i32.const 2\n      i64.const 0xeeeeeeeeeeeecccb\n      i64.store16\n      i32.const 0\n      i32.load)\n\n  (func (export \"i64_store32\") (result i32)\n      i32.const 0\n      i64.const -123456\n      i64.store32\n      i32.const 0\n      i32.load)\n\n  (func (export \"i64_store\") (result i64)\n      i32.const 0\n      i64.const 0xbaddc0de600dd00d\n      i64.store\n      i32.const 0\n      i64.load)\n\n  (func (export \"f32_store\") (result i32)\n      i32.const 0\n      f32.const 1.5\n      f32.store\n      i32.const 0\n      i32.load)\n\n  (func (export \"f64_store\") (result i32)\n      i32.const 0\n      f64.const -1000.75\n      f64.store\n      i32.const 4\n      i32.load)\n)\n(;; STDOUT ;;;\ni32_store8() => i32:4278058235\ni32_store16() => i32:3435907785\ni32_store() => i32:4294843840\ni64_store8() => i32:4278058235\ni64_store16() => i32:3435907785\ni64_store32() => i32:4294843840\ni64_store() => i64:13465130522234441741\nf32_store() => i32:1069547520\nf64_store() => i32:3230615040\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/store64.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS: --enable-memory64\n(module\n  (memory i64 1)\n\n  (func (export \"i32_store8\") (result i32)\n      i64.const 0\n      i32.const 0xfb\n      i32.store8\n      i64.const 1\n      i32.const 0xfc\n      i32.store8\n      i64.const 2\n      i32.const 0xfd\n      i32.store8\n      i64.const 3\n      i32.const 0xfe\n      i32.store8\n      i64.const 0\n      i32.load)\n\n  (func (export \"i32_store16\") (result i32)\n      i64.const 0\n      i32.const 0xcac9\n      i32.store16\n      i64.const 2\n      i32.const 0xcccb\n      i32.store16\n      i64.const 0\n      i32.load)\n\n  (func (export \"i32_store\") (result i32)\n      i64.const 0\n      i32.const -123456\n      i32.store\n      i64.const 0\n      i32.load)\n\n  (func (export \"i64_store8\") (result i32)\n      i64.const 0\n      i64.const 0xeeeeeeeeeeeeeefb\n      i64.store8\n      i64.const 1\n      i64.const 0xeeeeeeeeeeeeeefc\n      i64.store8\n      i64.const 2\n      i64.const 0xeeeeeeeeeeeeeefd\n      i64.store8\n      i64.const 3\n      i64.const 0xeeeeeeeeeeeeeefe\n      i64.store8\n      i64.const 0\n      i32.load)\n\n  (func (export \"i64_store16\") (result i32)\n      i64.const 0\n      i64.const 0xeeeeeeeeeeeecac9\n      i64.store16\n      i64.const 2\n      i64.const 0xeeeeeeeeeeeecccb\n      i64.store16\n      i64.const 0\n      i32.load)\n\n  (func (export \"i64_store32\") (result i32)\n      i64.const 0\n      i64.const -123456\n      i64.store32\n      i64.const 0\n      i32.load)\n\n  (func (export \"i64_store\") (result i64)\n      i64.const 0\n      i64.const 0xbaddc0de600dd00d\n      i64.store\n      i64.const 0\n      i64.load)\n\n  (func (export \"f32_store\") (result i32)\n      i64.const 0\n      f32.const 1.5\n      f32.store\n      i64.const 0\n      i32.load)\n\n  (func (export \"f64_store\") (result i32)\n      i64.const 0\n      f64.const -1000.75\n      f64.store\n      i64.const 4\n      i32.load)\n)\n(;; STDOUT ;;;\ni32_store8() => i32:4278058235\ni32_store16() => i32:3435907785\ni32_store() => i32:4294843840\ni64_store8() => i32:4278058235\ni64_store16() => i32:3435907785\ni64_store32() => i32:4294843840\ni64_store() => i64:13465130522234441741\nf32_store() => i32:1069547520\nf64_store() => i32:3230615040\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/throw-across-frame.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-exceptions\n(module\n  (tag $e1)\n  (tag $e2)\n  (tag $e3)\n  (func $thrower\n    (throw $e1))\n  (func $thrower2\n    (try\n      (do (throw $e1))\n      (catch $e2)))\n  (func (export \"call-thrower\") (result i32)\n    (try (result i32)\n      (do\n        (call $thrower)\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"call-thrower2\") (result i32)\n    (try (result i32)\n      (do\n        (call $thrower2)\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func $helper (result i32)\n    (try (result i32)\n      (do\n        (call $thrower2)\n        (i32.const 0))\n      (catch $e3\n        (i32.const 1))))\n  (func (export \"call-thrower3\") (result i32)\n    (try (result i32)\n      (do\n        (call $helper))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"call-thrower4\") (result i32)\n    (try (result i32)\n      (do\n        (call $helper))\n      (catch $e2\n        (i32.const 1))))\n  )\n(;; STDOUT ;;;\ncall-thrower() => i32:1\ncall-thrower2() => i32:1\ncall-thrower3() => i32:1\ncall-thrower4() => error: uncaught exception\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/trap-with-callstack.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $trap\n    i32.const 1\n    i32.const 0\n    i32.div_s\n    drop)\n\n  (func $f \n    call $trap)\n  (func $g \n    call $f)\n  (func (export \"h\") \n    call $g)\n\n  ;; this function should run properly, even after h traps.\n  (func (export \"i\") (result i32)\n    i32.const 22))\n(;; STDOUT ;;;\nh() => error: integer divide by zero\ni() => i32:22\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/try-delegate.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-exceptions\n(module\n  (tag $e1)\n  (tag $e2)\n  (func (export \"try-delegate\") (result i32)\n    (try $l (result i32)\n      (do\n        (try\n          (do (throw $e1))\n          (delegate $l))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"try-delegate-2\") (result i32)\n    (try $l (result i32)\n      (do\n        (try\n          (do\n            (try\n              (do (throw $e1))\n              (delegate $l)))\n          (catch_all))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"try-delegate-uncaught\") (result i32)\n    (try $l (result i32)\n      (do\n        (try\n          (do (throw $e1))\n          (delegate $l))\n        (i32.const 0))\n      (catch $e2\n        (i32.const 0))))\n  (func (export \"try-delegate-to-caller\") (result i32)\n    (try (result i32)\n      (do\n        (try\n          (do (throw $e1))\n          (delegate 1))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"try-delegate-to-delegate\") (result i32)\n    (try $l1 (result i32)\n      (do\n        (try $l2\n          (do\n            (try\n              (do\n                (try\n                  (do (throw $e1))\n                  (delegate $l2)))\n              (catch_all)))\n          (delegate $l1))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"try-delegate-to-block\") (result i32)\n    (try (result i32)\n      (do\n        (block $l\n          (try\n            (do\n              (try\n                (do (throw $e1))\n                (delegate $l)))\n            (catch_all)))\n        (i32.const 0))\n      (catch $e1\n        (i32.const 1))))\n  )\n(;; STDOUT ;;;\ntry-delegate() => i32:1\ntry-delegate-2() => i32:1\ntry-delegate-uncaught() => error: uncaught exception\ntry-delegate-to-caller() => error: uncaught exception\ntry-delegate-to-delegate() => i32:1\ntry-delegate-to-block() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/try.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-exceptions\n(module\n  (tag $e1)\n  (tag $e2)\n  (tag $e3 (param i32))\n  (func (export \"throw-uncaught\")\n    (throw $e1))\n  (func (export \"throw-uncaught-2\")\n    (try\n      (do\n        (throw $e1))))\n  (func (export \"try-catch\") (result i32)\n    (try (result i32)\n      (do\n        (throw $e1))\n      (catch $e1\n        (i32.const 1))))\n  (func (export \"try-catch-all\") (result i32)\n    (try (result i32)\n      (do\n        (throw $e1))\n      (catch_all\n        (i32.const 1))))\n  (func (export \"try-catch-all-2\")\n    (try\n      (do\n        (i32.const 1)\n        (throw $e3))\n      (catch_all)))\n  (func (export \"try-catch-payload\") (result i32)\n    (try (result i32)\n      (do\n        (i32.const 42)\n        (throw $e3))\n      (catch $e3)))\n  (func (export \"try-catch-multi\") (result i32)\n    (try (result i32)\n      (do\n        (throw $e2))\n      (catch $e1\n        (i32.const 1))\n      (catch $e2\n        (i32.const 2))))\n  (func (export \"try-catch-nested\") (result i32)\n    (try (result i32)\n      (do\n        (try (result i32)\n          (do (throw $e2))\n          (catch $e1\n            (i32.const 1))))\n      (catch $e2\n        (i32.const 2))))\n  (func (export \"try-catch-nested-2\") (result i32)\n    (try (result i32)\n      (do\n        (try (result i32)\n          (do (throw $e1))\n          (catch $e1\n            (i32.const 1))))\n      (catch $e1\n        (i32.const 2))))\n  (func (export \"try-catch-nested-3\") (result i32)\n    (try (result i32)\n      (do\n        (try (result i32)\n          (do\n            (try (result i32)\n              (do (throw $e2))\n              (catch $e1\n                (i32.const 1))))\n          (catch $e2\n            (i32.const 2))))\n      (catch_all\n        (i32.const 3))))\n  (func (export \"try-catch-nested-4\") (result i32)\n    (try (result i32)\n      (do\n        (try (result i32)\n          (do\n            (throw $e1))\n          (catch $e1\n            (try (do (throw $e2)))\n            (i32.const 0))\n          (catch $e2\n            (i32.const 0))))\n      (catch $e2\n        (i32.const 1))))\n  (func (export \"try-catch-nested-5\") (result i32)\n    (try (result i32)\n      (do\n        (try (result i32)\n          (do\n            (throw $e1))\n          (catch $e1\n            (try (do (throw $e2)))\n            (i32.const 0))\n          (catch_all\n            (i32.const 0))))\n      (catch $e2\n        (i32.const 1))))\n  (func (export \"try-catch-uncaught\") (result i32)\n    (try (result i32)\n      (do\n        (throw $e1))\n      (catch $e2\n        (i32.const 1))))\n  (func (export \"try-catch-stack-size\") (result i32)\n    (i32.const 1)\n    (try\n      (do\n        (i32.const 0)\n        (throw $e1))\n      (catch $e1))\n    ;; here the value stack should have just 1\n    )\n  (func $helper\n    (try\n      (do\n        (i32.const 0)\n        (throw $e1))\n      (catch $e1)))\n  (func (export \"try-catch-stack-size-2\") (result i32)\n    (i32.const 1)\n    (call $helper)))\n(;; STDOUT ;;;\nthrow-uncaught() => error: uncaught exception\nthrow-uncaught-2() => error: uncaught exception\ntry-catch() => i32:1\ntry-catch-all() => i32:1\ntry-catch-all-2() =>\ntry-catch-payload() => i32:42\ntry-catch-multi() => i32:2\ntry-catch-nested() => i32:2\ntry-catch-nested-2() => i32:1\ntry-catch-nested-3() => i32:2\ntry-catch-nested-4() => i32:1\ntry-catch-nested-5() => i32:1\ntry-catch-uncaught() => error: uncaught exception\ntry-catch-stack-size() => i32:1\ntry-catch-stack-size-2() => i32:1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/unary-extend.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"i32.extend8_s 0x7f\") (result i32)\n    i32.const 0x7f\n    i32.extend8_s)\n\n  (func (export \"i32.extend8_s 0x80\") (result i32)\n    i32.const 0x80\n    i32.extend8_s)\n\n  (func (export \"i32.extend16_s 0x7fff\") (result i32)\n    i32.const 0x7fff\n    i32.extend16_s)\n\n  (func (export \"i32.extend16_s 0x8000\") (result i32)\n    i32.const 0x8000\n    i32.extend16_s)\n\n  (func (export \"i64.extend8_s 0x7f\") (result i64)\n    i64.const 0x7f\n    i64.extend8_s)\n\n  (func (export \"i64.extend8_s 0x80\") (result i64)\n    i64.const 0x80\n    i64.extend8_s)\n\n  (func (export \"i64.extend16_s 0x7fff\") (result i64)\n    i64.const 0x7fff\n    i64.extend16_s)\n\n  (func (export \"i64.extend16_s 0x8000\") (result i64)\n    i64.const 0x8000\n    i64.extend16_s)\n\n  (func (export \"i64.extend32_s 0x7fffffff\") (result i64)\n    i64.const 0x7fffffff\n    i64.extend32_s)\n\n  (func (export \"i64.extend32_s 0x80000000\") (result i64)\n    i64.const 0x80000000\n    i64.extend32_s))\n(;; STDOUT ;;;\ni32.extend8_s 0x7f() => i32:127\ni32.extend8_s 0x80() => i32:4294967168\ni32.extend16_s 0x7fff() => i32:32767\ni32.extend16_s 0x8000() => i32:4294934528\ni64.extend8_s 0x7f() => i64:127\ni64.extend8_s 0x80() => i64:18446744073709551488\ni64.extend16_s 0x7fff() => i64:32767\ni64.extend16_s 0x8000() => i64:18446744073709518848\ni64.extend32_s 0x7fffffff() => i64:2147483647\ni64.extend32_s 0x80000000() => i64:18446744071562067968\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/unary.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func $f32_is_nan (param f32) (result i32)\n    local.get 0\n    local.get 0\n    f32.ne)\n  (func $f64_is_nan (param f64) (result i32)\n    local.get 0\n    local.get 0\n    f64.ne)\n\n  ;; i32\n  (func (export \"i32_eqz_100\") (result i32) \n    i32.const 100\n    i32.eqz)\n  (func (export \"i32_eqz_0\") (result i32)\n    i32.const 0 \n    i32.eqz)\n  (func (export \"i32_clz\") (result i32)\n    i32.const 128 \n    i32.clz)\n  (func (export \"i32_ctz\") (result i32)\n    i32.const 128 \n    i32.ctz)\n  (func (export \"i32_popcnt\") (result i32) \n    i32.const 128\n    i32.popcnt)\n\n  ;; i64\n  (func (export \"i64_eqz_100\") (result i32)\n    i64.const 100 \n    i64.eqz)\n  (func (export \"i64_eqz_0\") (result i32)\n    i64.const 0 \n    i64.eqz)\n  (func (export \"i64_clz\") (result i64) \n    i64.const 128\n    i64.clz)\n  (func (export \"i64_ctz\") (result i64) \n    i64.const 128\n    i64.ctz)\n  (func (export \"i64_popcnt\") (result i64)\n    i64.const 128 \n    i64.popcnt)\n\n  ;; f32\n  (func (export \"f32_neg\") (result f32)\n    f32.const 100 \n    f32.neg)\n  (func (export \"f32_abs\") (result f32)\n    f32.const -100 \n    f32.abs)\n  (func (export \"f32_sqrt_neg_is_nan\") (result i32)\n    f32.const -100\n    f32.sqrt\n    call $f32_is_nan)\n  (func (export \"f32_sqrt_100\") (result f32)\n    f32.const 100\n    f32.sqrt)\n  (func (export \"f32_ceil\") (result f32)\n    f32.const -0.75 \n    f32.ceil)\n  (func (export \"f32_floor\") (result f32)\n    f32.const -0.75 \n    f32.floor)\n  (func (export \"f32_trunc\") (result f32)\n    f32.const -0.75 \n    f32.trunc)\n  (func (export \"f32_nearest_lo\") (result f32)\n    f32.const 1.25 \n    f32.nearest)\n  (func (export \"f32_nearest_hi\") (result f32)\n    f32.const 1.75 \n    f32.nearest)\n\n  ;; f64\n  (func (export \"f64_neg\") (result f64) \n    f64.const 100\n    f64.neg)\n  (func (export \"f64_abs\") (result f64) \n    f64.const -100\n    f64.abs)\n  (func (export \"f64_sqrt_neg_is_nan\") (result i32)\n    f64.const -100\n    f64.sqrt\n    call $f64_is_nan)\n  (func (export \"f64_sqrt_100\") (result f64)\n   f64.const 100 \n   f64.sqrt)\n  (func (export \"f64_ceil\") (result f64)\n   f64.const -0.75 \n   f64.ceil)\n  (func (export \"f64_floor\") (result f64)\n    f64.const -0.75 \n    f64.floor)\n  (func (export \"f64_trunc\") (result f64)\n    f64.const -0.75 \n    f64.trunc)\n  (func (export \"f64_nearest_lo\") (result f64) \n    f64.const 1.25\n    f64.nearest)\n  (func (export \"f64_nearest_hi\") (result f64)\n    f64.const 1.75 \n    f64.nearest)\n)\n(;; STDOUT ;;;\ni32_eqz_100() => i32:0\ni32_eqz_0() => i32:1\ni32_clz() => i32:24\ni32_ctz() => i32:7\ni32_popcnt() => i32:1\ni64_eqz_100() => i32:0\ni64_eqz_0() => i32:1\ni64_clz() => i64:56\ni64_ctz() => i64:7\ni64_popcnt() => i64:1\nf32_neg() => f32:-100.000000\nf32_abs() => f32:100.000000\nf32_sqrt_neg_is_nan() => i32:1\nf32_sqrt_100() => f32:10.000000\nf32_ceil() => f32:-0.000000\nf32_floor() => f32:-1.000000\nf32_trunc() => f32:-0.000000\nf32_nearest_lo() => f32:1.000000\nf32_nearest_hi() => f32:2.000000\nf64_neg() => f64:-100.000000\nf64_abs() => f64:100.000000\nf64_sqrt_neg_is_nan() => i32:1\nf64_sqrt_100() => f64:10.000000\nf64_ceil() => f64:-0.000000\nf64_floor() => f64:-1.000000\nf64_trunc() => f64:-0.000000\nf64_nearest_lo() => f64:1.000000\nf64_nearest_hi() => f64:2.000000\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/interp/unreachable.txt",
    "content": ";;; TOOL: run-interp\n(module\n  (func (export \"trap\")\n    unreachable))\n(;; STDOUT ;;;\ntrap() => error: unreachable executed\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/address.wast",
    "content": ";; Load i32 data with different offset/align arguments\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"abcdefghijklmnopqrstuvwxyz\")\n\n  (func (export \"8u_good1\") (param $i i32) (result i32)\n    (i32.load8_u offset=0 (local.get $i))                   ;; 97 'a'\n  )\n  (func (export \"8u_good2\") (param $i i32) (result i32)\n    (i32.load8_u align=1 (local.get $i))                    ;; 97 'a'\n  )\n  (func (export \"8u_good3\") (param $i i32) (result i32)\n    (i32.load8_u offset=1 align=1 (local.get $i))           ;; 98 'b'\n  )\n  (func (export \"8u_good4\") (param $i i32) (result i32)\n    (i32.load8_u offset=2 align=1 (local.get $i))           ;; 99 'c'\n  )\n  (func (export \"8u_good5\") (param $i i32) (result i32)\n    (i32.load8_u offset=25 align=1 (local.get $i))          ;; 122 'z'\n  )\n\n  (func (export \"8s_good1\") (param $i i32) (result i32)\n    (i32.load8_s offset=0 (local.get $i))                   ;; 97 'a'\n  )\n  (func (export \"8s_good2\") (param $i i32) (result i32)\n    (i32.load8_s align=1 (local.get $i))                    ;; 97 'a'\n  )\n  (func (export \"8s_good3\") (param $i i32) (result i32)\n    (i32.load8_s offset=1 align=1 (local.get $i))           ;; 98 'b'\n  )\n  (func (export \"8s_good4\") (param $i i32) (result i32)\n    (i32.load8_s offset=2 align=1 (local.get $i))           ;; 99 'c'\n  )\n  (func (export \"8s_good5\") (param $i i32) (result i32)\n    (i32.load8_s offset=25 align=1 (local.get $i))          ;; 122 'z'\n  )\n\n  (func (export \"16u_good1\") (param $i i32) (result i32)\n    (i32.load16_u offset=0 (local.get $i))                  ;; 25185 'ab'\n  )\n  (func (export \"16u_good2\") (param $i i32) (result i32)\n    (i32.load16_u align=1 (local.get $i))                   ;; 25185 'ab'\n  )\n  (func (export \"16u_good3\") (param $i i32) (result i32)\n    (i32.load16_u offset=1 align=1 (local.get $i))          ;; 25442 'bc'\n  )\n  (func (export \"16u_good4\") (param $i i32) (result i32)\n    (i32.load16_u offset=2 align=2 (local.get $i))          ;; 25699 'cd'\n  )\n  (func (export \"16u_good5\") (param $i i32) (result i32)\n    (i32.load16_u offset=25 align=2 (local.get $i))         ;; 122 'z\\0'\n  )\n\n  (func (export \"16s_good1\") (param $i i32) (result i32)\n    (i32.load16_s offset=0 (local.get $i))                  ;; 25185 'ab'\n  )\n  (func (export \"16s_good2\") (param $i i32) (result i32)\n    (i32.load16_s align=1 (local.get $i))                   ;; 25185 'ab'\n  )\n  (func (export \"16s_good3\") (param $i i32) (result i32)\n    (i32.load16_s offset=1 align=1 (local.get $i))          ;; 25442 'bc'\n  )\n  (func (export \"16s_good4\") (param $i i32) (result i32)\n    (i32.load16_s offset=2 align=2 (local.get $i))          ;; 25699 'cd'\n  )\n  (func (export \"16s_good5\") (param $i i32) (result i32)\n    (i32.load16_s offset=25 align=2 (local.get $i))         ;; 122 'z\\0'\n  )\n\n  (func (export \"32_good1\") (param $i i32) (result i32)\n    (i32.load offset=0 (local.get $i))                      ;; 1684234849 'abcd'\n  )\n  (func (export \"32_good2\") (param $i i32) (result i32)\n    (i32.load align=1 (local.get $i))                       ;; 1684234849 'abcd'\n  )\n  (func (export \"32_good3\") (param $i i32) (result i32)\n    (i32.load offset=1 align=1 (local.get $i))              ;; 1701077858 'bcde'\n  )\n  (func (export \"32_good4\") (param $i i32) (result i32)\n    (i32.load offset=2 align=2 (local.get $i))              ;; 1717920867 'cdef'\n  )\n  (func (export \"32_good5\") (param $i i32) (result i32)\n    (i32.load offset=25 align=4 (local.get $i))             ;; 122 'z\\0\\0\\0'\n  )\n\n  (func (export \"8u_bad\") (param $i i32)\n    (drop (i32.load8_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"8s_bad\") (param $i i32)\n    (drop (i32.load8_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"16u_bad\") (param $i i32)\n    (drop (i32.load16_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"16s_bad\") (param $i i32)\n    (drop (i32.load16_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"32_bad\") (param $i i32)\n    (drop (i32.load offset=4294967295 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"8u_good1\" (i32.const 0)) (i32.const 97))\n(assert_return (invoke \"8u_good2\" (i32.const 0)) (i32.const 97))\n(assert_return (invoke \"8u_good3\" (i32.const 0)) (i32.const 98))\n(assert_return (invoke \"8u_good4\" (i32.const 0)) (i32.const 99))\n(assert_return (invoke \"8u_good5\" (i32.const 0)) (i32.const 122))\n\n(assert_return (invoke \"8s_good1\" (i32.const 0)) (i32.const 97))\n(assert_return (invoke \"8s_good2\" (i32.const 0)) (i32.const 97))\n(assert_return (invoke \"8s_good3\" (i32.const 0)) (i32.const 98))\n(assert_return (invoke \"8s_good4\" (i32.const 0)) (i32.const 99))\n(assert_return (invoke \"8s_good5\" (i32.const 0)) (i32.const 122))\n\n(assert_return (invoke \"16u_good1\" (i32.const 0)) (i32.const 25185))\n(assert_return (invoke \"16u_good2\" (i32.const 0)) (i32.const 25185))\n(assert_return (invoke \"16u_good3\" (i32.const 0)) (i32.const 25442))\n(assert_return (invoke \"16u_good4\" (i32.const 0)) (i32.const 25699))\n(assert_return (invoke \"16u_good5\" (i32.const 0)) (i32.const 122))\n\n(assert_return (invoke \"16s_good1\" (i32.const 0)) (i32.const 25185))\n(assert_return (invoke \"16s_good2\" (i32.const 0)) (i32.const 25185))\n(assert_return (invoke \"16s_good3\" (i32.const 0)) (i32.const 25442))\n(assert_return (invoke \"16s_good4\" (i32.const 0)) (i32.const 25699))\n(assert_return (invoke \"16s_good5\" (i32.const 0)) (i32.const 122))\n\n(assert_return (invoke \"32_good1\" (i32.const 0)) (i32.const 1684234849))\n(assert_return (invoke \"32_good2\" (i32.const 0)) (i32.const 1684234849))\n(assert_return (invoke \"32_good3\" (i32.const 0)) (i32.const 1701077858))\n(assert_return (invoke \"32_good4\" (i32.const 0)) (i32.const 1717920867))\n(assert_return (invoke \"32_good5\" (i32.const 0)) (i32.const 122))\n\n(assert_return (invoke \"8u_good1\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"8u_good2\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"8u_good3\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"8u_good4\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"8u_good5\" (i32.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"8s_good1\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"8s_good2\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"8s_good3\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"8s_good4\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"8s_good5\" (i32.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"16u_good1\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"16u_good2\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"16u_good3\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"16u_good4\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"16u_good5\" (i32.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"16s_good1\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"16s_good2\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"16s_good3\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"16s_good4\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"16s_good5\" (i32.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"32_good1\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"32_good2\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"32_good3\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"32_good4\" (i32.const 65507)) (i32.const 0))\n(assert_return (invoke \"32_good5\" (i32.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"8u_good1\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"8u_good2\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"8u_good3\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"8u_good4\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"8u_good5\" (i32.const 65508)) (i32.const 0))\n\n(assert_return (invoke \"8s_good1\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"8s_good2\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"8s_good3\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"8s_good4\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"8s_good5\" (i32.const 65508)) (i32.const 0))\n\n(assert_return (invoke \"16u_good1\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"16u_good2\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"16u_good3\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"16u_good4\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"16u_good5\" (i32.const 65508)) (i32.const 0))\n\n(assert_return (invoke \"16s_good1\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"16s_good2\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"16s_good3\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"16s_good4\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"16s_good5\" (i32.const 65508)) (i32.const 0))\n\n(assert_return (invoke \"32_good1\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"32_good2\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"32_good3\" (i32.const 65508)) (i32.const 0))\n(assert_return (invoke \"32_good4\" (i32.const 65508)) (i32.const 0))\n(assert_trap (invoke \"32_good5\" (i32.const 65508)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_good3\" (i32.const -1)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_bad\" (i32.const 0)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_bad\" (i32.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_bad\" (i32.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_bad\" (i32.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_bad\" (i32.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_bad\" (i32.const 1)) \"out of bounds memory access\")\n\n(assert_invalid\n  (module quote\n    \"(memory 1)\"\n    \"(func (drop (i32.load offset=4294967296 (i32.const 0))))\"\n  )\n  \"offset out of range\"\n)\n\n;; Load i64 data with different offset/align arguments\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"abcdefghijklmnopqrstuvwxyz\")\n\n  (func (export \"8u_good1\") (param $i i32) (result i64)\n    (i64.load8_u offset=0 (local.get $i))                   ;; 97 'a'\n  )\n  (func (export \"8u_good2\") (param $i i32) (result i64)\n    (i64.load8_u align=1 (local.get $i))                    ;; 97 'a'\n  )\n  (func (export \"8u_good3\") (param $i i32) (result i64)\n    (i64.load8_u offset=1 align=1 (local.get $i))           ;; 98 'b'\n  )\n  (func (export \"8u_good4\") (param $i i32) (result i64)\n    (i64.load8_u offset=2 align=1 (local.get $i))           ;; 99 'c'\n  )\n  (func (export \"8u_good5\") (param $i i32) (result i64)\n    (i64.load8_u offset=25 align=1 (local.get $i))          ;; 122 'z'\n  )\n\n  (func (export \"8s_good1\") (param $i i32) (result i64)\n    (i64.load8_s offset=0 (local.get $i))                   ;; 97 'a'\n  )\n  (func (export \"8s_good2\") (param $i i32) (result i64)\n    (i64.load8_s align=1 (local.get $i))                    ;; 97 'a'\n  )\n  (func (export \"8s_good3\") (param $i i32) (result i64)\n    (i64.load8_s offset=1 align=1 (local.get $i))           ;; 98 'b'\n  )\n  (func (export \"8s_good4\") (param $i i32) (result i64)\n    (i64.load8_s offset=2 align=1 (local.get $i))           ;; 99 'c'\n  )\n  (func (export \"8s_good5\") (param $i i32) (result i64)\n    (i64.load8_s offset=25 align=1 (local.get $i))          ;; 122 'z'\n  )\n\n  (func (export \"16u_good1\") (param $i i32) (result i64)\n    (i64.load16_u offset=0 (local.get $i))                 ;; 25185 'ab'\n  )\n  (func (export \"16u_good2\") (param $i i32) (result i64)\n    (i64.load16_u align=1 (local.get $i))                  ;; 25185 'ab'\n  )\n  (func (export \"16u_good3\") (param $i i32) (result i64)\n    (i64.load16_u offset=1 align=1 (local.get $i))         ;; 25442 'bc'\n  )\n  (func (export \"16u_good4\") (param $i i32) (result i64)\n    (i64.load16_u offset=2 align=2 (local.get $i))         ;; 25699 'cd'\n  )\n  (func (export \"16u_good5\") (param $i i32) (result i64)\n    (i64.load16_u offset=25 align=2 (local.get $i))        ;; 122 'z\\0'\n  )\n\n  (func (export \"16s_good1\") (param $i i32) (result i64)\n    (i64.load16_s offset=0 (local.get $i))                 ;; 25185 'ab'\n  )\n  (func (export \"16s_good2\") (param $i i32) (result i64)\n    (i64.load16_s align=1 (local.get $i))                  ;; 25185 'ab'\n  )\n  (func (export \"16s_good3\") (param $i i32) (result i64)\n    (i64.load16_s offset=1 align=1 (local.get $i))         ;; 25442 'bc'\n  )\n  (func (export \"16s_good4\") (param $i i32) (result i64)\n    (i64.load16_s offset=2 align=2 (local.get $i))         ;; 25699 'cd'\n  )\n  (func (export \"16s_good5\") (param $i i32) (result i64)\n    (i64.load16_s offset=25 align=2 (local.get $i))        ;; 122 'z\\0'\n  )\n\n  (func (export \"32u_good1\") (param $i i32) (result i64)\n    (i64.load32_u offset=0 (local.get $i))                 ;; 1684234849 'abcd'\n  )\n  (func (export \"32u_good2\") (param $i i32) (result i64)\n    (i64.load32_u align=1 (local.get $i))                  ;; 1684234849 'abcd'\n  )\n  (func (export \"32u_good3\") (param $i i32) (result i64)\n    (i64.load32_u offset=1 align=1 (local.get $i))         ;; 1701077858 'bcde'\n  )\n  (func (export \"32u_good4\") (param $i i32) (result i64)\n    (i64.load32_u offset=2 align=2 (local.get $i))         ;; 1717920867 'cdef'\n  )\n  (func (export \"32u_good5\") (param $i i32) (result i64)\n    (i64.load32_u offset=25 align=4 (local.get $i))        ;; 122 'z\\0\\0\\0'\n  )\n\n  (func (export \"32s_good1\") (param $i i32) (result i64)\n    (i64.load32_s offset=0 (local.get $i))                 ;; 1684234849 'abcd'\n  )\n  (func (export \"32s_good2\") (param $i i32) (result i64)\n    (i64.load32_s align=1 (local.get $i))                  ;; 1684234849 'abcd'\n  )\n  (func (export \"32s_good3\") (param $i i32) (result i64)\n    (i64.load32_s offset=1 align=1 (local.get $i))         ;; 1701077858 'bcde'\n  )\n  (func (export \"32s_good4\") (param $i i32) (result i64)\n    (i64.load32_s offset=2 align=2 (local.get $i))         ;; 1717920867 'cdef'\n  )\n  (func (export \"32s_good5\") (param $i i32) (result i64)\n    (i64.load32_s offset=25 align=4 (local.get $i))        ;; 122 'z\\0\\0\\0'\n  )\n\n  (func (export \"64_good1\") (param $i i32) (result i64)\n    (i64.load offset=0 (local.get $i))                     ;; 0x6867666564636261 'abcdefgh'\n  )\n  (func (export \"64_good2\") (param $i i32) (result i64)\n    (i64.load align=1 (local.get $i))                      ;; 0x6867666564636261 'abcdefgh'\n  )\n  (func (export \"64_good3\") (param $i i32) (result i64)\n    (i64.load offset=1 align=1 (local.get $i))             ;; 0x6968676665646362 'bcdefghi'\n  )\n  (func (export \"64_good4\") (param $i i32) (result i64)\n    (i64.load offset=2 align=2 (local.get $i))             ;; 0x6a69686766656463 'cdefghij'\n  )\n  (func (export \"64_good5\") (param $i i32) (result i64)\n    (i64.load offset=25 align=8 (local.get $i))            ;; 122 'z\\0\\0\\0\\0\\0\\0\\0'\n  )\n\n  (func (export \"8u_bad\") (param $i i32)\n    (drop (i64.load8_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"8s_bad\") (param $i i32)\n    (drop (i64.load8_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"16u_bad\") (param $i i32)\n    (drop (i64.load16_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"16s_bad\") (param $i i32)\n    (drop (i64.load16_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"32u_bad\") (param $i i32)\n    (drop (i64.load32_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"32s_bad\") (param $i i32)\n    (drop (i64.load32_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"64_bad\") (param $i i32)\n    (drop (i64.load offset=4294967295 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"8u_good1\" (i32.const 0)) (i64.const 97))\n(assert_return (invoke \"8u_good2\" (i32.const 0)) (i64.const 97))\n(assert_return (invoke \"8u_good3\" (i32.const 0)) (i64.const 98))\n(assert_return (invoke \"8u_good4\" (i32.const 0)) (i64.const 99))\n(assert_return (invoke \"8u_good5\" (i32.const 0)) (i64.const 122))\n\n(assert_return (invoke \"8s_good1\" (i32.const 0)) (i64.const 97))\n(assert_return (invoke \"8s_good2\" (i32.const 0)) (i64.const 97))\n(assert_return (invoke \"8s_good3\" (i32.const 0)) (i64.const 98))\n(assert_return (invoke \"8s_good4\" (i32.const 0)) (i64.const 99))\n(assert_return (invoke \"8s_good5\" (i32.const 0)) (i64.const 122))\n\n(assert_return (invoke \"16u_good1\" (i32.const 0)) (i64.const 25185))\n(assert_return (invoke \"16u_good2\" (i32.const 0)) (i64.const 25185))\n(assert_return (invoke \"16u_good3\" (i32.const 0)) (i64.const 25442))\n(assert_return (invoke \"16u_good4\" (i32.const 0)) (i64.const 25699))\n(assert_return (invoke \"16u_good5\" (i32.const 0)) (i64.const 122))\n\n(assert_return (invoke \"16s_good1\" (i32.const 0)) (i64.const 25185))\n(assert_return (invoke \"16s_good2\" (i32.const 0)) (i64.const 25185))\n(assert_return (invoke \"16s_good3\" (i32.const 0)) (i64.const 25442))\n(assert_return (invoke \"16s_good4\" (i32.const 0)) (i64.const 25699))\n(assert_return (invoke \"16s_good5\" (i32.const 0)) (i64.const 122))\n\n(assert_return (invoke \"32u_good1\" (i32.const 0)) (i64.const 1684234849))\n(assert_return (invoke \"32u_good2\" (i32.const 0)) (i64.const 1684234849))\n(assert_return (invoke \"32u_good3\" (i32.const 0)) (i64.const 1701077858))\n(assert_return (invoke \"32u_good4\" (i32.const 0)) (i64.const 1717920867))\n(assert_return (invoke \"32u_good5\" (i32.const 0)) (i64.const 122))\n\n(assert_return (invoke \"32s_good1\" (i32.const 0)) (i64.const 1684234849))\n(assert_return (invoke \"32s_good2\" (i32.const 0)) (i64.const 1684234849))\n(assert_return (invoke \"32s_good3\" (i32.const 0)) (i64.const 1701077858))\n(assert_return (invoke \"32s_good4\" (i32.const 0)) (i64.const 1717920867))\n(assert_return (invoke \"32s_good5\" (i32.const 0)) (i64.const 122))\n\n(assert_return (invoke \"64_good1\" (i32.const 0)) (i64.const 0x6867666564636261))\n(assert_return (invoke \"64_good2\" (i32.const 0)) (i64.const 0x6867666564636261))\n(assert_return (invoke \"64_good3\" (i32.const 0)) (i64.const 0x6968676665646362))\n(assert_return (invoke \"64_good4\" (i32.const 0)) (i64.const 0x6a69686766656463))\n(assert_return (invoke \"64_good5\" (i32.const 0)) (i64.const 122))\n\n(assert_return (invoke \"8u_good1\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"8u_good2\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"8u_good3\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"8u_good4\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"8u_good5\" (i32.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"8s_good1\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"8s_good2\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"8s_good3\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"8s_good4\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"8s_good5\" (i32.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"16u_good1\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"16u_good2\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"16u_good3\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"16u_good4\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"16u_good5\" (i32.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"16s_good1\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"16s_good2\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"16s_good3\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"16s_good4\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"16s_good5\" (i32.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"32u_good1\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"32u_good2\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"32u_good3\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"32u_good4\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"32u_good5\" (i32.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"32s_good1\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"32s_good2\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"32s_good3\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"32s_good4\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"32s_good5\" (i32.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"64_good1\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"64_good2\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"64_good3\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"64_good4\" (i32.const 65503)) (i64.const 0))\n(assert_return (invoke \"64_good5\" (i32.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"8u_good1\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"8u_good2\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"8u_good3\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"8u_good4\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"8u_good5\" (i32.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"8s_good1\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"8s_good2\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"8s_good3\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"8s_good4\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"8s_good5\" (i32.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"16u_good1\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"16u_good2\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"16u_good3\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"16u_good4\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"16u_good5\" (i32.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"16s_good1\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"16s_good2\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"16s_good3\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"16s_good4\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"16s_good5\" (i32.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"32u_good1\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"32u_good2\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"32u_good3\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"32u_good4\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"32u_good5\" (i32.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"32s_good1\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"32s_good2\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"32s_good3\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"32s_good4\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"32s_good5\" (i32.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"64_good1\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"64_good2\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"64_good3\" (i32.const 65504)) (i64.const 0))\n(assert_return (invoke \"64_good4\" (i32.const 65504)) (i64.const 0))\n(assert_trap (invoke \"64_good5\" (i32.const 65504)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32u_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32s_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"64_good3\" (i32.const -1)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32u_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32s_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"64_bad\" (i32.const 0)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_bad\" (i32.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_bad\" (i32.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_bad\" (i32.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_bad\" (i32.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32u_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32s_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"64_bad\" (i32.const 1)) \"out of bounds memory access\")\n\n;; Load f32 data with different offset/align arguments\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"\\00\\00\\00\\00\\00\\00\\a0\\7f\\01\\00\\d0\\7f\")\n\n  (func (export \"32_good1\") (param $i i32) (result f32)\n    (f32.load offset=0 (local.get $i))                   ;; 0.0 '\\00\\00\\00\\00'\n  )\n  (func (export \"32_good2\") (param $i i32) (result f32)\n    (f32.load align=1 (local.get $i))                    ;; 0.0 '\\00\\00\\00\\00'\n  )\n  (func (export \"32_good3\") (param $i i32) (result f32)\n    (f32.load offset=1 align=1 (local.get $i))           ;; 0.0 '\\00\\00\\00\\00'\n  )\n  (func (export \"32_good4\") (param $i i32) (result f32)\n    (f32.load offset=2 align=2 (local.get $i))           ;; 0.0 '\\00\\00\\00\\00'\n  )\n  (func (export \"32_good5\") (param $i i32) (result f32)\n    (f32.load offset=8 align=4 (local.get $i))           ;; nan:0x500001 '\\01\\00\\d0\\7f'\n  )\n  (func (export \"32_bad\") (param $i i32)\n    (drop (f32.load offset=4294967295 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"32_good1\" (i32.const 0)) (f32.const 0.0))\n(assert_return (invoke \"32_good2\" (i32.const 0)) (f32.const 0.0))\n(assert_return (invoke \"32_good3\" (i32.const 0)) (f32.const 0.0))\n(assert_return (invoke \"32_good4\" (i32.const 0)) (f32.const 0.0))\n(assert_return (invoke \"32_good5\" (i32.const 0)) (f32.const nan:0x500001))\n\n(assert_return (invoke \"32_good1\" (i32.const 65524)) (f32.const 0.0))\n(assert_return (invoke \"32_good2\" (i32.const 65524)) (f32.const 0.0))\n(assert_return (invoke \"32_good3\" (i32.const 65524)) (f32.const 0.0))\n(assert_return (invoke \"32_good4\" (i32.const 65524)) (f32.const 0.0))\n(assert_return (invoke \"32_good5\" (i32.const 65524)) (f32.const 0.0))\n\n(assert_return (invoke \"32_good1\" (i32.const 65525)) (f32.const 0.0))\n(assert_return (invoke \"32_good2\" (i32.const 65525)) (f32.const 0.0))\n(assert_return (invoke \"32_good3\" (i32.const 65525)) (f32.const 0.0))\n(assert_return (invoke \"32_good4\" (i32.const 65525)) (f32.const 0.0))\n(assert_trap (invoke \"32_good5\" (i32.const 65525)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"32_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_good3\" (i32.const -1)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"32_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_bad\" (i32.const 1)) \"out of bounds memory access\")\n\n;; Load f64 data with different offset/align arguments\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\f4\\7f\\01\\00\\00\\00\\00\\00\\fc\\7f\")\n\n  (func (export \"64_good1\") (param $i i32) (result f64)\n    (f64.load offset=0 (local.get $i))                     ;; 0.0 '\\00\\00\\00\\00\\00\\00\\00\\00'\n  )\n  (func (export \"64_good2\") (param $i i32) (result f64)\n    (f64.load align=1 (local.get $i))                      ;; 0.0 '\\00\\00\\00\\00\\00\\00\\00\\00'\n  )\n  (func (export \"64_good3\") (param $i i32) (result f64)\n    (f64.load offset=1 align=1 (local.get $i))             ;; 0.0 '\\00\\00\\00\\00\\00\\00\\00\\00'\n  )\n  (func (export \"64_good4\") (param $i i32) (result f64)\n    (f64.load offset=2 align=2 (local.get $i))             ;; 0.0 '\\00\\00\\00\\00\\00\\00\\00\\00'\n  )\n  (func (export \"64_good5\") (param $i i32) (result f64)\n    (f64.load offset=18 align=8 (local.get $i))            ;; nan:0xc000000000001 '\\01\\00\\00\\00\\00\\00\\fc\\7f'\n  )\n  (func (export \"64_bad\") (param $i i32)\n    (drop (f64.load offset=4294967295 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"64_good1\" (i32.const 0)) (f64.const 0.0))\n(assert_return (invoke \"64_good2\" (i32.const 0)) (f64.const 0.0))\n(assert_return (invoke \"64_good3\" (i32.const 0)) (f64.const 0.0))\n(assert_return (invoke \"64_good4\" (i32.const 0)) (f64.const 0.0))\n(assert_return (invoke \"64_good5\" (i32.const 0)) (f64.const nan:0xc000000000001))\n\n(assert_return (invoke \"64_good1\" (i32.const 65510)) (f64.const 0.0))\n(assert_return (invoke \"64_good2\" (i32.const 65510)) (f64.const 0.0))\n(assert_return (invoke \"64_good3\" (i32.const 65510)) (f64.const 0.0))\n(assert_return (invoke \"64_good4\" (i32.const 65510)) (f64.const 0.0))\n(assert_return (invoke \"64_good5\" (i32.const 65510)) (f64.const 0.0))\n\n(assert_return (invoke \"64_good1\" (i32.const 65511)) (f64.const 0.0))\n(assert_return (invoke \"64_good2\" (i32.const 65511)) (f64.const 0.0))\n(assert_return (invoke \"64_good3\" (i32.const 65511)) (f64.const 0.0))\n(assert_return (invoke \"64_good4\" (i32.const 65511)) (f64.const 0.0))\n(assert_trap (invoke \"64_good5\" (i32.const 65511)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"64_good3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"64_good3\" (i32.const -1)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"64_bad\" (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"64_bad\" (i32.const 1)) \"out of bounds memory access\")\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/address64.wast",
    "content": ";; Load i32 data with different offset/align arguments\n\n(module\n  (memory i64 1)\n  (data (i64.const 0) \"abcdefghijklmnopqrstuvwxyz\")\n\n  (func (export \"8u_good1\") (param $i i64) (result i32)\n    (i32.load8_u offset=0 (local.get $i))                   ;; 97 'a'\n  )\n  (func (export \"8u_good2\") (param $i i64) (result i32)\n    (i32.load8_u align=1 (local.get $i))                    ;; 97 'a'\n  )\n  (func (export \"8u_good3\") (param $i i64) (result i32)\n    (i32.load8_u offset=1 align=1 (local.get $i))           ;; 98 'b'\n  )\n  (func (export \"8u_good4\") (param $i i64) (result i32)\n    (i32.load8_u offset=2 align=1 (local.get $i))           ;; 99 'c'\n  )\n  (func (export \"8u_good5\") (param $i i64) (result i32)\n    (i32.load8_u offset=25 align=1 (local.get $i))          ;; 122 'z'\n  )\n\n  (func (export \"8s_good1\") (param $i i64) (result i32)\n    (i32.load8_s offset=0 (local.get $i))                   ;; 97 'a'\n  )\n  (func (export \"8s_good2\") (param $i i64) (result i32)\n    (i32.load8_s align=1 (local.get $i))                    ;; 97 'a'\n  )\n  (func (export \"8s_good3\") (param $i i64) (result i32)\n    (i32.load8_s offset=1 align=1 (local.get $i))           ;; 98 'b'\n  )\n  (func (export \"8s_good4\") (param $i i64) (result i32)\n    (i32.load8_s offset=2 align=1 (local.get $i))           ;; 99 'c'\n  )\n  (func (export \"8s_good5\") (param $i i64) (result i32)\n    (i32.load8_s offset=25 align=1 (local.get $i))          ;; 122 'z'\n  )\n\n  (func (export \"16u_good1\") (param $i i64) (result i32)\n    (i32.load16_u offset=0 (local.get $i))                  ;; 25185 'ab'\n  )\n  (func (export \"16u_good2\") (param $i i64) (result i32)\n    (i32.load16_u align=1 (local.get $i))                   ;; 25185 'ab'\n  )\n  (func (export \"16u_good3\") (param $i i64) (result i32)\n    (i32.load16_u offset=1 align=1 (local.get $i))          ;; 25442 'bc'\n  )\n  (func (export \"16u_good4\") (param $i i64) (result i32)\n    (i32.load16_u offset=2 align=2 (local.get $i))          ;; 25699 'cd'\n  )\n  (func (export \"16u_good5\") (param $i i64) (result i32)\n    (i32.load16_u offset=25 align=2 (local.get $i))         ;; 122 'z\\0'\n  )\n\n  (func (export \"16s_good1\") (param $i i64) (result i32)\n    (i32.load16_s offset=0 (local.get $i))                  ;; 25185 'ab'\n  )\n  (func (export \"16s_good2\") (param $i i64) (result i32)\n    (i32.load16_s align=1 (local.get $i))                   ;; 25185 'ab'\n  )\n  (func (export \"16s_good3\") (param $i i64) (result i32)\n    (i32.load16_s offset=1 align=1 (local.get $i))          ;; 25442 'bc'\n  )\n  (func (export \"16s_good4\") (param $i i64) (result i32)\n    (i32.load16_s offset=2 align=2 (local.get $i))          ;; 25699 'cd'\n  )\n  (func (export \"16s_good5\") (param $i i64) (result i32)\n    (i32.load16_s offset=25 align=2 (local.get $i))         ;; 122 'z\\0'\n  )\n\n  (func (export \"32_good1\") (param $i i64) (result i32)\n    (i32.load offset=0 (local.get $i))                      ;; 1684234849 'abcd'\n  )\n  (func (export \"32_good2\") (param $i i64) (result i32)\n    (i32.load align=1 (local.get $i))                       ;; 1684234849 'abcd'\n  )\n  (func (export \"32_good3\") (param $i i64) (result i32)\n    (i32.load offset=1 align=1 (local.get $i))              ;; 1701077858 'bcde'\n  )\n  (func (export \"32_good4\") (param $i i64) (result i32)\n    (i32.load offset=2 align=2 (local.get $i))              ;; 1717920867 'cdef'\n  )\n  (func (export \"32_good5\") (param $i i64) (result i32)\n    (i32.load offset=25 align=4 (local.get $i))             ;; 122 'z\\0\\0\\0'\n  )\n\n  (func (export \"8u_bad\") (param $i i64)\n    (drop (i32.load8_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"8s_bad\") (param $i i64)\n    (drop (i32.load8_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"16u_bad\") (param $i i64)\n    (drop (i32.load16_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"16s_bad\") (param $i i64)\n    (drop (i32.load16_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"32_bad\") (param $i i64)\n    (drop (i32.load offset=4294967295 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"8u_good1\" (i64.const 0)) (i32.const 97))\n(assert_return (invoke \"8u_good2\" (i64.const 0)) (i32.const 97))\n(assert_return (invoke \"8u_good3\" (i64.const 0)) (i32.const 98))\n(assert_return (invoke \"8u_good4\" (i64.const 0)) (i32.const 99))\n(assert_return (invoke \"8u_good5\" (i64.const 0)) (i32.const 122))\n\n(assert_return (invoke \"8s_good1\" (i64.const 0)) (i32.const 97))\n(assert_return (invoke \"8s_good2\" (i64.const 0)) (i32.const 97))\n(assert_return (invoke \"8s_good3\" (i64.const 0)) (i32.const 98))\n(assert_return (invoke \"8s_good4\" (i64.const 0)) (i32.const 99))\n(assert_return (invoke \"8s_good5\" (i64.const 0)) (i32.const 122))\n\n(assert_return (invoke \"16u_good1\" (i64.const 0)) (i32.const 25185))\n(assert_return (invoke \"16u_good2\" (i64.const 0)) (i32.const 25185))\n(assert_return (invoke \"16u_good3\" (i64.const 0)) (i32.const 25442))\n(assert_return (invoke \"16u_good4\" (i64.const 0)) (i32.const 25699))\n(assert_return (invoke \"16u_good5\" (i64.const 0)) (i32.const 122))\n\n(assert_return (invoke \"16s_good1\" (i64.const 0)) (i32.const 25185))\n(assert_return (invoke \"16s_good2\" (i64.const 0)) (i32.const 25185))\n(assert_return (invoke \"16s_good3\" (i64.const 0)) (i32.const 25442))\n(assert_return (invoke \"16s_good4\" (i64.const 0)) (i32.const 25699))\n(assert_return (invoke \"16s_good5\" (i64.const 0)) (i32.const 122))\n\n(assert_return (invoke \"32_good1\" (i64.const 0)) (i32.const 1684234849))\n(assert_return (invoke \"32_good2\" (i64.const 0)) (i32.const 1684234849))\n(assert_return (invoke \"32_good3\" (i64.const 0)) (i32.const 1701077858))\n(assert_return (invoke \"32_good4\" (i64.const 0)) (i32.const 1717920867))\n(assert_return (invoke \"32_good5\" (i64.const 0)) (i32.const 122))\n\n(assert_return (invoke \"8u_good1\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"8u_good2\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"8u_good3\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"8u_good4\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"8u_good5\" (i64.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"8s_good1\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"8s_good2\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"8s_good3\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"8s_good4\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"8s_good5\" (i64.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"16u_good1\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"16u_good2\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"16u_good3\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"16u_good4\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"16u_good5\" (i64.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"16s_good1\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"16s_good2\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"16s_good3\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"16s_good4\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"16s_good5\" (i64.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"32_good1\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"32_good2\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"32_good3\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"32_good4\" (i64.const 65507)) (i32.const 0))\n(assert_return (invoke \"32_good5\" (i64.const 65507)) (i32.const 0))\n\n(assert_return (invoke \"8u_good1\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"8u_good2\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"8u_good3\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"8u_good4\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"8u_good5\" (i64.const 65508)) (i32.const 0))\n\n(assert_return (invoke \"8s_good1\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"8s_good2\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"8s_good3\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"8s_good4\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"8s_good5\" (i64.const 65508)) (i32.const 0))\n\n(assert_return (invoke \"16u_good1\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"16u_good2\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"16u_good3\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"16u_good4\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"16u_good5\" (i64.const 65508)) (i32.const 0))\n\n(assert_return (invoke \"16s_good1\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"16s_good2\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"16s_good3\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"16s_good4\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"16s_good5\" (i64.const 65508)) (i32.const 0))\n\n(assert_return (invoke \"32_good1\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"32_good2\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"32_good3\" (i64.const 65508)) (i32.const 0))\n(assert_return (invoke \"32_good4\" (i64.const 65508)) (i32.const 0))\n(assert_trap (invoke \"32_good5\" (i64.const 65508)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_bad\" (i64.const 0)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_bad\" (i64.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_bad\" (i64.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_bad\" (i64.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_bad\" (i64.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_bad\" (i64.const 1)) \"out of bounds memory access\")\n\n\n;; Load i64 data with different offset/align arguments\n\n(module\n  (memory i64 1)\n  (data (i64.const 0) \"abcdefghijklmnopqrstuvwxyz\")\n\n  (func (export \"8u_good1\") (param $i i64) (result i64)\n    (i64.load8_u offset=0 (local.get $i))                   ;; 97 'a'\n  )\n  (func (export \"8u_good2\") (param $i i64) (result i64)\n    (i64.load8_u align=1 (local.get $i))                    ;; 97 'a'\n  )\n  (func (export \"8u_good3\") (param $i i64) (result i64)\n    (i64.load8_u offset=1 align=1 (local.get $i))           ;; 98 'b'\n  )\n  (func (export \"8u_good4\") (param $i i64) (result i64)\n    (i64.load8_u offset=2 align=1 (local.get $i))           ;; 99 'c'\n  )\n  (func (export \"8u_good5\") (param $i i64) (result i64)\n    (i64.load8_u offset=25 align=1 (local.get $i))          ;; 122 'z'\n  )\n\n  (func (export \"8s_good1\") (param $i i64) (result i64)\n    (i64.load8_s offset=0 (local.get $i))                   ;; 97 'a'\n  )\n  (func (export \"8s_good2\") (param $i i64) (result i64)\n    (i64.load8_s align=1 (local.get $i))                    ;; 97 'a'\n  )\n  (func (export \"8s_good3\") (param $i i64) (result i64)\n    (i64.load8_s offset=1 align=1 (local.get $i))           ;; 98 'b'\n  )\n  (func (export \"8s_good4\") (param $i i64) (result i64)\n    (i64.load8_s offset=2 align=1 (local.get $i))           ;; 99 'c'\n  )\n  (func (export \"8s_good5\") (param $i i64) (result i64)\n    (i64.load8_s offset=25 align=1 (local.get $i))          ;; 122 'z'\n  )\n\n  (func (export \"16u_good1\") (param $i i64) (result i64)\n    (i64.load16_u offset=0 (local.get $i))                 ;; 25185 'ab'\n  )\n  (func (export \"16u_good2\") (param $i i64) (result i64)\n    (i64.load16_u align=1 (local.get $i))                  ;; 25185 'ab'\n  )\n  (func (export \"16u_good3\") (param $i i64) (result i64)\n    (i64.load16_u offset=1 align=1 (local.get $i))         ;; 25442 'bc'\n  )\n  (func (export \"16u_good4\") (param $i i64) (result i64)\n    (i64.load16_u offset=2 align=2 (local.get $i))         ;; 25699 'cd'\n  )\n  (func (export \"16u_good5\") (param $i i64) (result i64)\n    (i64.load16_u offset=25 align=2 (local.get $i))        ;; 122 'z\\0'\n  )\n\n  (func (export \"16s_good1\") (param $i i64) (result i64)\n    (i64.load16_s offset=0 (local.get $i))                 ;; 25185 'ab'\n  )\n  (func (export \"16s_good2\") (param $i i64) (result i64)\n    (i64.load16_s align=1 (local.get $i))                  ;; 25185 'ab'\n  )\n  (func (export \"16s_good3\") (param $i i64) (result i64)\n    (i64.load16_s offset=1 align=1 (local.get $i))         ;; 25442 'bc'\n  )\n  (func (export \"16s_good4\") (param $i i64) (result i64)\n    (i64.load16_s offset=2 align=2 (local.get $i))         ;; 25699 'cd'\n  )\n  (func (export \"16s_good5\") (param $i i64) (result i64)\n    (i64.load16_s offset=25 align=2 (local.get $i))        ;; 122 'z\\0'\n  )\n\n  (func (export \"32u_good1\") (param $i i64) (result i64)\n    (i64.load32_u offset=0 (local.get $i))                 ;; 1684234849 'abcd'\n  )\n  (func (export \"32u_good2\") (param $i i64) (result i64)\n    (i64.load32_u align=1 (local.get $i))                  ;; 1684234849 'abcd'\n  )\n  (func (export \"32u_good3\") (param $i i64) (result i64)\n    (i64.load32_u offset=1 align=1 (local.get $i))         ;; 1701077858 'bcde'\n  )\n  (func (export \"32u_good4\") (param $i i64) (result i64)\n    (i64.load32_u offset=2 align=2 (local.get $i))         ;; 1717920867 'cdef'\n  )\n  (func (export \"32u_good5\") (param $i i64) (result i64)\n    (i64.load32_u offset=25 align=4 (local.get $i))        ;; 122 'z\\0\\0\\0'\n  )\n\n  (func (export \"32s_good1\") (param $i i64) (result i64)\n    (i64.load32_s offset=0 (local.get $i))                 ;; 1684234849 'abcd'\n  )\n  (func (export \"32s_good2\") (param $i i64) (result i64)\n    (i64.load32_s align=1 (local.get $i))                  ;; 1684234849 'abcd'\n  )\n  (func (export \"32s_good3\") (param $i i64) (result i64)\n    (i64.load32_s offset=1 align=1 (local.get $i))         ;; 1701077858 'bcde'\n  )\n  (func (export \"32s_good4\") (param $i i64) (result i64)\n    (i64.load32_s offset=2 align=2 (local.get $i))         ;; 1717920867 'cdef'\n  )\n  (func (export \"32s_good5\") (param $i i64) (result i64)\n    (i64.load32_s offset=25 align=4 (local.get $i))        ;; 122 'z\\0\\0\\0'\n  )\n\n  (func (export \"64_good1\") (param $i i64) (result i64)\n    (i64.load offset=0 (local.get $i))                     ;; 0x6867666564636261 'abcdefgh'\n  )\n  (func (export \"64_good2\") (param $i i64) (result i64)\n    (i64.load align=1 (local.get $i))                      ;; 0x6867666564636261 'abcdefgh'\n  )\n  (func (export \"64_good3\") (param $i i64) (result i64)\n    (i64.load offset=1 align=1 (local.get $i))             ;; 0x6968676665646362 'bcdefghi'\n  )\n  (func (export \"64_good4\") (param $i i64) (result i64)\n    (i64.load offset=2 align=2 (local.get $i))             ;; 0x6a69686766656463 'cdefghij'\n  )\n  (func (export \"64_good5\") (param $i i64) (result i64)\n    (i64.load offset=25 align=8 (local.get $i))            ;; 122 'z\\0\\0\\0\\0\\0\\0\\0'\n  )\n\n  (func (export \"8u_bad\") (param $i i64)\n    (drop (i64.load8_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"8s_bad\") (param $i i64)\n    (drop (i64.load8_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"16u_bad\") (param $i i64)\n    (drop (i64.load16_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"16s_bad\") (param $i i64)\n    (drop (i64.load16_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"32u_bad\") (param $i i64)\n    (drop (i64.load32_u offset=4294967295 (local.get $i)))\n  )\n  (func (export \"32s_bad\") (param $i i64)\n    (drop (i64.load32_s offset=4294967295 (local.get $i)))\n  )\n  (func (export \"64_bad\") (param $i i64)\n    (drop (i64.load offset=4294967295 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"8u_good1\" (i64.const 0)) (i64.const 97))\n(assert_return (invoke \"8u_good2\" (i64.const 0)) (i64.const 97))\n(assert_return (invoke \"8u_good3\" (i64.const 0)) (i64.const 98))\n(assert_return (invoke \"8u_good4\" (i64.const 0)) (i64.const 99))\n(assert_return (invoke \"8u_good5\" (i64.const 0)) (i64.const 122))\n\n(assert_return (invoke \"8s_good1\" (i64.const 0)) (i64.const 97))\n(assert_return (invoke \"8s_good2\" (i64.const 0)) (i64.const 97))\n(assert_return (invoke \"8s_good3\" (i64.const 0)) (i64.const 98))\n(assert_return (invoke \"8s_good4\" (i64.const 0)) (i64.const 99))\n(assert_return (invoke \"8s_good5\" (i64.const 0)) (i64.const 122))\n\n(assert_return (invoke \"16u_good1\" (i64.const 0)) (i64.const 25185))\n(assert_return (invoke \"16u_good2\" (i64.const 0)) (i64.const 25185))\n(assert_return (invoke \"16u_good3\" (i64.const 0)) (i64.const 25442))\n(assert_return (invoke \"16u_good4\" (i64.const 0)) (i64.const 25699))\n(assert_return (invoke \"16u_good5\" (i64.const 0)) (i64.const 122))\n\n(assert_return (invoke \"16s_good1\" (i64.const 0)) (i64.const 25185))\n(assert_return (invoke \"16s_good2\" (i64.const 0)) (i64.const 25185))\n(assert_return (invoke \"16s_good3\" (i64.const 0)) (i64.const 25442))\n(assert_return (invoke \"16s_good4\" (i64.const 0)) (i64.const 25699))\n(assert_return (invoke \"16s_good5\" (i64.const 0)) (i64.const 122))\n\n(assert_return (invoke \"32u_good1\" (i64.const 0)) (i64.const 1684234849))\n(assert_return (invoke \"32u_good2\" (i64.const 0)) (i64.const 1684234849))\n(assert_return (invoke \"32u_good3\" (i64.const 0)) (i64.const 1701077858))\n(assert_return (invoke \"32u_good4\" (i64.const 0)) (i64.const 1717920867))\n(assert_return (invoke \"32u_good5\" (i64.const 0)) (i64.const 122))\n\n(assert_return (invoke \"32s_good1\" (i64.const 0)) (i64.const 1684234849))\n(assert_return (invoke \"32s_good2\" (i64.const 0)) (i64.const 1684234849))\n(assert_return (invoke \"32s_good3\" (i64.const 0)) (i64.const 1701077858))\n(assert_return (invoke \"32s_good4\" (i64.const 0)) (i64.const 1717920867))\n(assert_return (invoke \"32s_good5\" (i64.const 0)) (i64.const 122))\n\n(assert_return (invoke \"64_good1\" (i64.const 0)) (i64.const 0x6867666564636261))\n(assert_return (invoke \"64_good2\" (i64.const 0)) (i64.const 0x6867666564636261))\n(assert_return (invoke \"64_good3\" (i64.const 0)) (i64.const 0x6968676665646362))\n(assert_return (invoke \"64_good4\" (i64.const 0)) (i64.const 0x6a69686766656463))\n(assert_return (invoke \"64_good5\" (i64.const 0)) (i64.const 122))\n\n(assert_return (invoke \"8u_good1\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"8u_good2\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"8u_good3\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"8u_good4\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"8u_good5\" (i64.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"8s_good1\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"8s_good2\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"8s_good3\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"8s_good4\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"8s_good5\" (i64.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"16u_good1\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"16u_good2\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"16u_good3\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"16u_good4\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"16u_good5\" (i64.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"16s_good1\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"16s_good2\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"16s_good3\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"16s_good4\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"16s_good5\" (i64.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"32u_good1\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"32u_good2\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"32u_good3\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"32u_good4\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"32u_good5\" (i64.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"32s_good1\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"32s_good2\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"32s_good3\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"32s_good4\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"32s_good5\" (i64.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"64_good1\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"64_good2\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"64_good3\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"64_good4\" (i64.const 65503)) (i64.const 0))\n(assert_return (invoke \"64_good5\" (i64.const 65503)) (i64.const 0))\n\n(assert_return (invoke \"8u_good1\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"8u_good2\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"8u_good3\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"8u_good4\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"8u_good5\" (i64.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"8s_good1\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"8s_good2\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"8s_good3\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"8s_good4\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"8s_good5\" (i64.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"16u_good1\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"16u_good2\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"16u_good3\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"16u_good4\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"16u_good5\" (i64.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"16s_good1\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"16s_good2\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"16s_good3\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"16s_good4\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"16s_good5\" (i64.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"32u_good1\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"32u_good2\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"32u_good3\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"32u_good4\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"32u_good5\" (i64.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"32s_good1\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"32s_good2\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"32s_good3\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"32s_good4\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"32s_good5\" (i64.const 65504)) (i64.const 0))\n\n(assert_return (invoke \"64_good1\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"64_good2\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"64_good3\" (i64.const 65504)) (i64.const 0))\n(assert_return (invoke \"64_good4\" (i64.const 65504)) (i64.const 0))\n(assert_trap (invoke \"64_good5\" (i64.const 65504)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32u_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32s_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"64_bad\" (i64.const 0)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"8u_bad\" (i64.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"8s_bad\" (i64.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16u_bad\" (i64.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"16s_bad\" (i64.const 1)) \"out of bounds memory access\")\n(assert_trap (invoke \"32u_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32s_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"64_bad\" (i64.const 1)) \"out of bounds memory access\")\n\n;; Load f32 data with different offset/align arguments\n\n(module\n  (memory i64 1)\n  (data (i64.const 0) \"\\00\\00\\00\\00\\00\\00\\a0\\7f\\01\\00\\d0\\7f\")\n\n  (func (export \"32_good1\") (param $i i64) (result f32)\n    (f32.load offset=0 (local.get $i))                   ;; 0.0 '\\00\\00\\00\\00'\n  )\n  (func (export \"32_good2\") (param $i i64) (result f32)\n    (f32.load align=1 (local.get $i))                    ;; 0.0 '\\00\\00\\00\\00'\n  )\n  (func (export \"32_good3\") (param $i i64) (result f32)\n    (f32.load offset=1 align=1 (local.get $i))           ;; 0.0 '\\00\\00\\00\\00'\n  )\n  (func (export \"32_good4\") (param $i i64) (result f32)\n    (f32.load offset=2 align=2 (local.get $i))           ;; 0.0 '\\00\\00\\00\\00'\n  )\n  (func (export \"32_good5\") (param $i i64) (result f32)\n    (f32.load offset=8 align=4 (local.get $i))           ;; nan:0x500001 '\\01\\00\\d0\\7f'\n  )\n  (func (export \"32_bad\") (param $i i64)\n    (drop (f32.load offset=4294967295 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"32_good1\" (i64.const 0)) (f32.const 0.0))\n(assert_return (invoke \"32_good2\" (i64.const 0)) (f32.const 0.0))\n(assert_return (invoke \"32_good3\" (i64.const 0)) (f32.const 0.0))\n(assert_return (invoke \"32_good4\" (i64.const 0)) (f32.const 0.0))\n(assert_return (invoke \"32_good5\" (i64.const 0)) (f32.const nan:0x500001))\n\n(assert_return (invoke \"32_good1\" (i64.const 65524)) (f32.const 0.0))\n(assert_return (invoke \"32_good2\" (i64.const 65524)) (f32.const 0.0))\n(assert_return (invoke \"32_good3\" (i64.const 65524)) (f32.const 0.0))\n(assert_return (invoke \"32_good4\" (i64.const 65524)) (f32.const 0.0))\n(assert_return (invoke \"32_good5\" (i64.const 65524)) (f32.const 0.0))\n\n(assert_return (invoke \"32_good1\" (i64.const 65525)) (f32.const 0.0))\n(assert_return (invoke \"32_good2\" (i64.const 65525)) (f32.const 0.0))\n(assert_return (invoke \"32_good3\" (i64.const 65525)) (f32.const 0.0))\n(assert_return (invoke \"32_good4\" (i64.const 65525)) (f32.const 0.0))\n(assert_trap (invoke \"32_good5\" (i64.const 65525)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"32_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"32_bad\" (i64.const 1)) \"out of bounds memory access\")\n\n;; Load f64 data with different offset/align arguments\n\n(module\n  (memory i64 1)\n  (data (i64.const 0) \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\f4\\7f\\01\\00\\00\\00\\00\\00\\fc\\7f\")\n\n  (func (export \"64_good1\") (param $i i64) (result f64)\n    (f64.load offset=0 (local.get $i))                     ;; 0.0 '\\00\\00\\00\\00\\00\\00\\00\\00'\n  )\n  (func (export \"64_good2\") (param $i i64) (result f64)\n    (f64.load align=1 (local.get $i))                      ;; 0.0 '\\00\\00\\00\\00\\00\\00\\00\\00'\n  )\n  (func (export \"64_good3\") (param $i i64) (result f64)\n    (f64.load offset=1 align=1 (local.get $i))             ;; 0.0 '\\00\\00\\00\\00\\00\\00\\00\\00'\n  )\n  (func (export \"64_good4\") (param $i i64) (result f64)\n    (f64.load offset=2 align=2 (local.get $i))             ;; 0.0 '\\00\\00\\00\\00\\00\\00\\00\\00'\n  )\n  (func (export \"64_good5\") (param $i i64) (result f64)\n    (f64.load offset=18 align=8 (local.get $i))            ;; nan:0xc000000000001 '\\01\\00\\00\\00\\00\\00\\fc\\7f'\n  )\n  (func (export \"64_bad\") (param $i i64)\n    (drop (f64.load offset=4294967295 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"64_good1\" (i64.const 0)) (f64.const 0.0))\n(assert_return (invoke \"64_good2\" (i64.const 0)) (f64.const 0.0))\n(assert_return (invoke \"64_good3\" (i64.const 0)) (f64.const 0.0))\n(assert_return (invoke \"64_good4\" (i64.const 0)) (f64.const 0.0))\n(assert_return (invoke \"64_good5\" (i64.const 0)) (f64.const nan:0xc000000000001))\n\n(assert_return (invoke \"64_good1\" (i64.const 65510)) (f64.const 0.0))\n(assert_return (invoke \"64_good2\" (i64.const 65510)) (f64.const 0.0))\n(assert_return (invoke \"64_good3\" (i64.const 65510)) (f64.const 0.0))\n(assert_return (invoke \"64_good4\" (i64.const 65510)) (f64.const 0.0))\n(assert_return (invoke \"64_good5\" (i64.const 65510)) (f64.const 0.0))\n\n(assert_return (invoke \"64_good1\" (i64.const 65511)) (f64.const 0.0))\n(assert_return (invoke \"64_good2\" (i64.const 65511)) (f64.const 0.0))\n(assert_return (invoke \"64_good3\" (i64.const 65511)) (f64.const 0.0))\n(assert_return (invoke \"64_good4\" (i64.const 65511)) (f64.const 0.0))\n(assert_trap (invoke \"64_good5\" (i64.const 65511)) \"out of bounds memory access\")\n\n(assert_trap (invoke \"64_bad\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"64_bad\" (i64.const 1)) \"out of bounds memory access\")\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/align64.wast",
    "content": ";; Test alignment annotation rules\n\n(module (memory i64 0) (func (drop (i32.load8_s align=1 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i32.load8_u align=1 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i32.load16_s align=2 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i32.load16_u align=2 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i32.load align=4 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i64.load8_s align=1 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i64.load8_u align=1 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i64.load16_s align=2 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i64.load16_u align=2 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i64.load32_s align=4 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i64.load32_u align=4 (i64.const 0)))))\n(module (memory i64 0) (func (drop (i64.load align=8 (i64.const 0)))))\n(module (memory i64 0) (func (drop (f32.load align=4 (i64.const 0)))))\n(module (memory i64 0) (func (drop (f64.load align=8 (i64.const 0)))))\n(module (memory i64 0) (func (i32.store8 align=1 (i64.const 0) (i32.const 1))))\n(module (memory i64 0) (func (i32.store16 align=2 (i64.const 0) (i32.const 1))))\n(module (memory i64 0) (func (i32.store align=4 (i64.const 0) (i32.const 1))))\n(module (memory i64 0) (func (i64.store8 align=1 (i64.const 0) (i64.const 1))))\n(module (memory i64 0) (func (i64.store16 align=2 (i64.const 0) (i64.const 1))))\n(module (memory i64 0) (func (i64.store32 align=4 (i64.const 0) (i64.const 1))))\n(module (memory i64 0) (func (i64.store align=8 (i64.const 0) (i64.const 1))))\n(module (memory i64 0) (func (f32.store align=4 (i64.const 0) (f32.const 1.0))))\n(module (memory i64 0) (func (f64.store align=8 (i64.const 0) (f64.const 1.0))))\n\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load8_s align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load8_s align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load8_u align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load8_u align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load16_s align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load16_s align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load16_u align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load16_u align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i32.load align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load8_s align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load8_s align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load8_u align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load8_u align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load16_s align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load16_s align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load16_u align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load16_u align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load32_s align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load32_s align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load32_u align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load32_u align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (i64.load align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (f32.load align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (f32.load align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (f64.load align=0 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (drop (f64.load align=7 (i64.const 0)))))\"\n  )\n  \"alignment\"\n)\n\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i32.store8 align=0 (i64.const 0) (i32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i32.store8 align=7 (i64.const 0) (i32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i32.store16 align=0 (i64.const 0) (i32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i32.store16 align=7 (i64.const 0) (i32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i32.store align=0 (i64.const 0) (i32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i32.store align=7 (i64.const 0) (i32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i64.store8 align=0 (i64.const 0) (i64.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i64.store8 align=7 (i64.const 0) (i64.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i64.store16 align=0 (i64.const 0) (i64.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i64.store16 align=7 (i64.const 0) (i64.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i64.store32 align=0 (i64.const 0) (i64.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i64.store32 align=7 (i64.const 0) (i64.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i64.store align=0 (i64.const 0) (i64.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (i64.store align=7 (i64.const 0) (i64.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (f32.store align=0 (i64.const 0) (f32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (f32.store align=7 (i64.const 0) (f32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (f64.store align=0 (i64.const 0) (f32.const 0))))\"\n  )\n  \"alignment\"\n)\n(assert_malformed\n  (module quote\n    \"(module (memory i64 0) (func (f64.store align=7 (i64.const 0) (f32.const 0))))\"\n  )\n  \"alignment\"\n)\n\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load8_s align=2 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load8_u align=2 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load16_s align=4 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load16_u align=4 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load align=8 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load8_s align=2 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load8_u align=2 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load16_s align=4 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load16_u align=4 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load32_s align=8 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load32_u align=8 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load align=16 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (f32.load align=8 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (f64.load align=16 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load8_s align=2 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load8_u align=2 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load16_s align=4 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load16_u align=4 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i32.load align=8 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load8_s align=2 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load8_u align=2 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load16_s align=4 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load16_u align=4 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load32_s align=8 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load32_u align=8 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (i64.load align=16 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (f32.load align=8 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (drop (f64.load align=16 (i64.const 0)))))\n  \"alignment must not be larger than natural\"\n)\n\n(assert_invalid\n  (module (memory i64 0) (func (i32.store8 align=2 (i64.const 0) (i32.const 0))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (i32.store16 align=4 (i64.const 0) (i32.const 0))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (i32.store align=8 (i64.const 0) (i32.const 0))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (i64.store8 align=2 (i64.const 0) (i64.const 0))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (i64.store16 align=4 (i64.const 0) (i64.const 0))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (i64.store32 align=8 (i64.const 0) (i64.const 0))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (i64.store align=16 (i64.const 0) (i64.const 0))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (f32.store align=8 (i64.const 0) (f32.const 0))))\n  \"alignment must not be larger than natural\"\n)\n(assert_invalid\n  (module (memory i64 0) (func (f64.store align=16 (i64.const 0) (f64.const 0))))\n  \"alignment must not be larger than natural\"\n)\n\n;; Test aligned and unaligned read/write\n\n(module\n  (memory i64 1)\n\n  ;; $default: natural alignment, $1: align=1, $2: align=2, $4: align=4, $8: align=8\n\n  (func (export \"f32_align_switch\") (param i32) (result f32)\n    (local f32 f32)\n    (local.set 1 (f32.const 10.0))\n    (block $4\n      (block $2\n        (block $1\n          (block $default\n            (block $0\n              (br_table $0 $default $1 $2 $4 (local.get 0))\n            ) ;; 0\n            (f32.store (i64.const 0) (local.get 1))\n            (local.set 2 (f32.load (i64.const 0)))\n            (br $4)\n          ) ;; default\n          (f32.store align=1 (i64.const 0) (local.get 1))\n          (local.set 2 (f32.load align=1 (i64.const 0)))\n          (br $4)\n        ) ;; 1\n        (f32.store align=2 (i64.const 0) (local.get 1))\n        (local.set 2 (f32.load align=2 (i64.const 0)))\n        (br $4)\n      ) ;; 2\n      (f32.store align=4 (i64.const 0) (local.get 1))\n      (local.set 2 (f32.load align=4 (i64.const 0)))\n    ) ;; 4\n    (local.get 2)\n  )\n\n  (func (export \"f64_align_switch\") (param i32) (result f64)\n    (local f64 f64)\n    (local.set 1 (f64.const 10.0))\n    (block $8\n      (block $4\n        (block $2\n          (block $1\n            (block $default\n              (block $0\n                (br_table $0 $default $1 $2 $4 $8 (local.get 0))\n              ) ;; 0\n              (f64.store (i64.const 0) (local.get 1))\n              (local.set 2 (f64.load (i64.const 0)))\n              (br $8)\n            ) ;; default\n            (f64.store align=1 (i64.const 0) (local.get 1))\n            (local.set 2 (f64.load align=1 (i64.const 0)))\n            (br $8)\n          ) ;; 1\n          (f64.store align=2 (i64.const 0) (local.get 1))\n          (local.set 2 (f64.load align=2 (i64.const 0)))\n          (br $8)\n        ) ;; 2\n        (f64.store align=4 (i64.const 0) (local.get 1))\n        (local.set 2 (f64.load align=4 (i64.const 0)))\n        (br $8)\n      ) ;; 4\n      (f64.store align=8 (i64.const 0) (local.get 1))\n      (local.set 2 (f64.load align=8 (i64.const 0)))\n    ) ;; 8\n    (local.get 2)\n  )\n\n  ;; $8s: i32/i64.load8_s, $8u: i32/i64.load8_u, $16s: i32/i64.load16_s, $16u: i32/i64.load16_u, $32: i32.load\n  ;; $32s: i64.load32_s, $32u: i64.load32_u, $64: i64.load\n\n  (func (export \"i32_align_switch\") (param i32 i32) (result i32)\n    (local i32 i32)\n    (local.set 2 (i32.const 10))\n    (block $32\n      (block $16u\n        (block $16s\n          (block $8u\n            (block $8s\n              (block $0\n                (br_table $0 $8s $8u $16s $16u $32 (local.get 0))\n              ) ;; 0\n              (if (i32.eq (local.get 1) (i32.const 0))\n                (then\n                  (i32.store8 (i64.const 0) (local.get 2))\n                  (local.set 3 (i32.load8_s (i64.const 0)))\n                )\n              )\n              (if (i32.eq (local.get 1) (i32.const 1))\n                (then\n                  (i32.store8 align=1 (i64.const 0) (local.get 2))\n                  (local.set 3 (i32.load8_s align=1 (i64.const 0)))\n                )\n              )\n              (br $32)\n            ) ;; 8s\n            (if (i32.eq (local.get 1) (i32.const 0))\n              (then\n                (i32.store8 (i64.const 0) (local.get 2))\n                (local.set 3 (i32.load8_u (i64.const 0)))\n              )\n            )\n            (if (i32.eq (local.get 1) (i32.const 1))\n              (then\n                (i32.store8 align=1 (i64.const 0) (local.get 2))\n                (local.set 3 (i32.load8_u align=1 (i64.const 0)))\n              )\n            )\n            (br $32)\n          ) ;; 8u\n          (if (i32.eq (local.get 1) (i32.const 0))\n            (then\n              (i32.store16 (i64.const 0) (local.get 2))\n              (local.set 3 (i32.load16_s (i64.const 0)))\n            )\n          )\n          (if (i32.eq (local.get 1) (i32.const 1))\n            (then\n              (i32.store16 align=1 (i64.const 0) (local.get 2))\n              (local.set 3 (i32.load16_s align=1 (i64.const 0)))\n            )\n          )\n          (if (i32.eq (local.get 1) (i32.const 2))\n            (then\n              (i32.store16 align=2 (i64.const 0) (local.get 2))\n              (local.set 3 (i32.load16_s align=2 (i64.const 0)))\n            )\n          )\n          (br $32)\n        ) ;; 16s\n        (if (i32.eq (local.get 1) (i32.const 0))\n          (then\n            (i32.store16 (i64.const 0) (local.get 2))\n            (local.set 3 (i32.load16_u (i64.const 0)))\n          )\n        )\n        (if (i32.eq (local.get 1) (i32.const 1))\n          (then\n            (i32.store16 align=1 (i64.const 0) (local.get 2))\n            (local.set 3 (i32.load16_u align=1 (i64.const 0)))\n          )\n        )\n        (if (i32.eq (local.get 1) (i32.const 2))\n          (then\n            (i32.store16 align=2 (i64.const 0) (local.get 2))\n            (local.set 3 (i32.load16_u align=2 (i64.const 0)))\n          )\n        )\n        (br $32)\n      ) ;; 16u\n      (if (i32.eq (local.get 1) (i32.const 0))\n        (then\n          (i32.store (i64.const 0) (local.get 2))\n          (local.set 3 (i32.load (i64.const 0)))\n        )\n      )\n      (if (i32.eq (local.get 1) (i32.const 1))\n        (then\n          (i32.store align=1 (i64.const 0) (local.get 2))\n          (local.set 3 (i32.load align=1 (i64.const 0)))\n        )\n      )\n      (if (i32.eq (local.get 1) (i32.const 2))\n        (then\n          (i32.store align=2 (i64.const 0) (local.get 2))\n          (local.set 3 (i32.load align=2 (i64.const 0)))\n        )\n      )\n      (if (i32.eq (local.get 1) (i32.const 4))\n        (then\n          (i32.store align=4 (i64.const 0) (local.get 2))\n          (local.set 3 (i32.load align=4 (i64.const 0)))\n        )\n      )\n    ) ;; 32\n    (local.get 3)\n  )\n\n  (func (export \"i64_align_switch\") (param i32 i32) (result i64)\n    (local i64 i64)\n    (local.set 2 (i64.const 10))\n    (block $64\n      (block $32u\n        (block $32s\n          (block $16u\n            (block $16s\n              (block $8u\n                (block $8s\n                  (block $0\n                    (br_table $0 $8s $8u $16s $16u $32s $32u $64 (local.get 0))\n                  ) ;; 0\n                  (if (i32.eq (local.get 1) (i32.const 0))\n                    (then\n                      (i64.store8 (i64.const 0) (local.get 2))\n                      (local.set 3 (i64.load8_s (i64.const 0)))\n                    )\n                  )\n                  (if (i32.eq (local.get 1) (i32.const 1))\n                    (then\n                      (i64.store8 align=1 (i64.const 0) (local.get 2))\n                      (local.set 3 (i64.load8_s align=1 (i64.const 0)))\n                    )\n                  )\n                  (br $64)\n                ) ;; 8s\n                (if (i32.eq (local.get 1) (i32.const 0))\n                  (then\n                    (i64.store8 (i64.const 0) (local.get 2))\n                    (local.set 3 (i64.load8_u (i64.const 0)))\n                  )\n                )\n                (if (i32.eq (local.get 1) (i32.const 1))\n                  (then\n                    (i64.store8 align=1 (i64.const 0) (local.get 2))\n                    (local.set 3 (i64.load8_u align=1 (i64.const 0)))\n                  )\n                )\n                (br $64)\n              ) ;; 8u\n              (if (i32.eq (local.get 1) (i32.const 0))\n                (then\n                  (i64.store16 (i64.const 0) (local.get 2))\n                  (local.set 3 (i64.load16_s (i64.const 0)))\n                )\n              )\n              (if (i32.eq (local.get 1) (i32.const 1))\n                (then\n                  (i64.store16 align=1 (i64.const 0) (local.get 2))\n                  (local.set 3 (i64.load16_s align=1 (i64.const 0)))\n                )\n              )\n              (if (i32.eq (local.get 1) (i32.const 2))\n                (then\n                  (i64.store16 align=2 (i64.const 0) (local.get 2))\n                  (local.set 3 (i64.load16_s align=2 (i64.const 0)))\n                )\n              )\n              (br $64)\n            ) ;; 16s\n            (if (i32.eq (local.get 1) (i32.const 0))\n              (then\n                (i64.store16 (i64.const 0) (local.get 2))\n                (local.set 3 (i64.load16_u (i64.const 0)))\n              )\n            )\n            (if (i32.eq (local.get 1) (i32.const 1))\n              (then\n                (i64.store16 align=1 (i64.const 0) (local.get 2))\n                (local.set 3 (i64.load16_u align=1 (i64.const 0)))\n              )\n            )\n            (if (i32.eq (local.get 1) (i32.const 2))\n              (then\n                (i64.store16 align=2 (i64.const 0) (local.get 2))\n                (local.set 3 (i64.load16_u align=2 (i64.const 0)))\n              )\n            )\n            (br $64)\n          ) ;; 16u\n          (if (i32.eq (local.get 1) (i32.const 0))\n            (then\n              (i64.store32 (i64.const 0) (local.get 2))\n              (local.set 3 (i64.load32_s (i64.const 0)))\n            )\n          )\n          (if (i32.eq (local.get 1) (i32.const 1))\n            (then\n              (i64.store32 align=1 (i64.const 0) (local.get 2))\n              (local.set 3 (i64.load32_s align=1 (i64.const 0)))\n            )\n          )\n          (if (i32.eq (local.get 1) (i32.const 2))\n            (then\n              (i64.store32 align=2 (i64.const 0) (local.get 2))\n              (local.set 3 (i64.load32_s align=2 (i64.const 0)))\n            )\n          )\n          (if (i32.eq (local.get 1) (i32.const 4))\n            (then\n              (i64.store32 align=4 (i64.const 0) (local.get 2))\n              (local.set 3 (i64.load32_s align=4 (i64.const 0)))\n            )\n          )\n          (br $64)\n        ) ;; 32s\n        (if (i32.eq (local.get 1) (i32.const 0))\n          (then\n            (i64.store32 (i64.const 0) (local.get 2))\n            (local.set 3 (i64.load32_u (i64.const 0)))\n          )\n        )\n        (if (i32.eq (local.get 1) (i32.const 1))\n          (then\n            (i64.store32 align=1 (i64.const 0) (local.get 2))\n            (local.set 3 (i64.load32_u align=1 (i64.const 0)))\n          )\n        )\n        (if (i32.eq (local.get 1) (i32.const 2))\n          (then\n            (i64.store32 align=2 (i64.const 0) (local.get 2))\n            (local.set 3 (i64.load32_u align=2 (i64.const 0)))\n          )\n        )\n        (if (i32.eq (local.get 1) (i32.const 4))\n          (then\n            (i64.store32 align=4 (i64.const 0) (local.get 2))\n            (local.set 3 (i64.load32_u align=4 (i64.const 0)))\n          )\n        )\n        (br $64)\n      ) ;; 32u\n      (if (i32.eq (local.get 1) (i32.const 0))\n        (then\n          (i64.store (i64.const 0) (local.get 2))\n          (local.set 3 (i64.load (i64.const 0)))\n        )\n      )\n      (if (i32.eq (local.get 1) (i32.const 1))\n        (then\n          (i64.store align=1 (i64.const 0) (local.get 2))\n          (local.set 3 (i64.load align=1 (i64.const 0)))\n        )\n      )\n      (if (i32.eq (local.get 1) (i32.const 2))\n        (then\n          (i64.store align=2 (i64.const 0) (local.get 2))\n          (local.set 3 (i64.load align=2 (i64.const 0)))\n        )\n      )\n      (if (i32.eq (local.get 1) (i32.const 4))\n        (then\n          (i64.store align=4 (i64.const 0) (local.get 2))\n          (local.set 3 (i64.load align=4 (i64.const 0)))\n        )\n      )\n      (if (i32.eq (local.get 1) (i32.const 8))\n        (then\n          (i64.store align=8 (i64.const 0) (local.get 2))\n          (local.set 3 (i64.load align=8 (i64.const 0)))\n        )\n      )\n    ) ;; 64\n    (local.get 3)\n  )\n)\n\n(assert_return (invoke \"f32_align_switch\" (i32.const 0)) (f32.const 10.0))\n(assert_return (invoke \"f32_align_switch\" (i32.const 1)) (f32.const 10.0))\n(assert_return (invoke \"f32_align_switch\" (i32.const 2)) (f32.const 10.0))\n(assert_return (invoke \"f32_align_switch\" (i32.const 3)) (f32.const 10.0))\n\n(assert_return (invoke \"f64_align_switch\" (i32.const 0)) (f64.const 10.0))\n(assert_return (invoke \"f64_align_switch\" (i32.const 1)) (f64.const 10.0))\n(assert_return (invoke \"f64_align_switch\" (i32.const 2)) (f64.const 10.0))\n(assert_return (invoke \"f64_align_switch\" (i32.const 3)) (f64.const 10.0))\n(assert_return (invoke \"f64_align_switch\" (i32.const 4)) (f64.const 10.0))\n\n(assert_return (invoke \"i32_align_switch\" (i32.const 0) (i32.const 0)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 0) (i32.const 1)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 1) (i32.const 0)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 1) (i32.const 1)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 2) (i32.const 0)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 2) (i32.const 1)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 2) (i32.const 2)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 3) (i32.const 0)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 3) (i32.const 1)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 3) (i32.const 2)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 4) (i32.const 0)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 4) (i32.const 1)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 4) (i32.const 2)) (i32.const 10))\n(assert_return (invoke \"i32_align_switch\" (i32.const 4) (i32.const 4)) (i32.const 10))\n\n(assert_return (invoke \"i64_align_switch\" (i32.const 0) (i32.const 0)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 0) (i32.const 1)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 1) (i32.const 0)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 1) (i32.const 1)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 2) (i32.const 0)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 2) (i32.const 1)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 2) (i32.const 2)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 3) (i32.const 0)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 3) (i32.const 1)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 3) (i32.const 2)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 4) (i32.const 0)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 4) (i32.const 1)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 4) (i32.const 2)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 4) (i32.const 4)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 5) (i32.const 0)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 5) (i32.const 1)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 5) (i32.const 2)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 5) (i32.const 4)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 6) (i32.const 0)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 6) (i32.const 1)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 6) (i32.const 2)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 6) (i32.const 4)) (i64.const 10))\n(assert_return (invoke \"i64_align_switch\" (i32.const 6) (i32.const 8)) (i64.const 10))\n\n;; Test that an i64 store with 4-byte alignment that's 4 bytes out of bounds traps without storing anything\n\n(module\n  (memory i64 1)\n  (func (export \"store\") (param i64 i64)\n    (i64.store align=4 (local.get 0) (local.get 1))\n  )\n  (func (export \"load\") (param i64) (result i32)\n    (i32.load (local.get 0))\n  )\n)\n\n(assert_trap (invoke \"store\" (i64.const 65532) (i64.const -1)) \"out of bounds memory access\")\n;; No memory was changed\n(assert_return (invoke \"load\" (i64.const 65532)) (i32.const 0))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/binary-leb128.wast",
    "content": ";; Unsigned LEB128 can have non-minimal length\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\04\\01\"                          ;; Memory section with 1 entry\n  \"\\00\\82\\00\"                          ;; no max, minimum 2\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\07\\01\"                          ;; Memory section with 1 entry\n  \"\\00\\82\\80\\80\\80\\00\"                 ;; no max, minimum 2\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\06\\01\"                          ;; Memory section with 1 entry\n  \"\\01\\82\\00\"                          ;; minimum 2\n  \"\\82\\00\"                             ;; max 2\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\09\\01\"                          ;; Memory section with 1 entry\n  \"\\01\\82\\00\"                          ;; minimum 2\n  \"\\82\\80\\80\\80\\00\"                    ;; max 2\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\03\\01\"                          ;; Memory section with 1 entry\n  \"\\00\\00\"                             ;; no max, minimum 0\n  \"\\0b\\07\\01\"                          ;; Data section with 1 entry\n  \"\\80\\00\"                             ;; Memory index 0, encoded with 2 bytes\n  \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\04\\04\\01\"                          ;; Table section with 1 entry\n  \"\\70\\00\\00\"                          ;; no max, minimum 0, funcref\n  \"\\09\\09\\01\"                          ;; Element section with 1 entry\n  \"\\02\"                                ;; Element with explicit table index\n  \"\\80\\00\"                             ;; Table index 0, encoded with 2 bytes\n  \"\\41\\00\\0b\\00\\00\"                    ;; (i32.const 0) with no elements\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\00\"                                ;; custom section\n  \"\\8a\\00\"                             ;; section size 10, encoded with 2 bytes\n  \"\\01\"                                ;; name byte count\n  \"1\"                                  ;; name\n  \"23456789\"                           ;; sequence of bytes\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\00\"                                ;; custom section\n  \"\\0b\"                                ;; section size\n  \"\\88\\00\"                             ;; name byte count 8, encoded with 2 bytes\n  \"12345678\"                           ;; name\n  \"9\"                                  ;; sequence of bytes\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\08\\01\"                          ;; type section\n  \"\\60\"                                ;; func type\n  \"\\82\\00\"                             ;; num params 2, encoded with 2 bytes\n  \"\\7f\\7e\"                             ;; param type\n  \"\\01\"                                ;; num results\n  \"\\7f\"                                ;; result type\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\08\\01\"                          ;; type section\n  \"\\60\"                                ;; func type\n  \"\\02\"                                ;; num params\n  \"\\7f\\7e\"                             ;; param type\n  \"\\81\\00\"                             ;; num results 1, encoded with 2 bytes\n  \"\\7f\"                                ;; result type\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\05\\01\"                          ;; type section\n  \"\\60\\01\\7f\\00\"                       ;; function type\n  \"\\02\\17\\01\"                          ;; import section\n  \"\\88\\00\"                             ;; module name length 8, encoded with 2 bytes\n  \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n  \"\\09\"                                ;; entity name length\n  \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n  \"\\00\"                                ;; import kind\n  \"\\00\"                                ;; import signature index\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\05\\01\"                          ;; type section\n  \"\\60\\01\\7f\\00\"                       ;; function type\n  \"\\02\\17\\01\"                          ;; import section\n  \"\\08\"                                ;; module name length\n  \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n  \"\\89\\00\"                             ;; entity name length 9, encoded with 2 bytes\n  \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n  \"\\00\"                                ;; import kind\n  \"\\00\"                                ;; import signature index\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\05\\01\"                          ;; type section\n  \"\\60\\01\\7f\\00\"                       ;; function type\n  \"\\02\\17\\01\"                          ;; import section\n  \"\\08\"                                ;; module name length\n  \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n  \"\\09\"                                ;; entity name length 9\n  \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n  \"\\00\"                                ;; import kind\n  \"\\80\\00\"                             ;; import signature index, encoded with 2 bytes\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\"                          ;; type section\n  \"\\60\\00\\00\"                          ;; function type\n  \"\\03\\03\\01\"                          ;; function section\n  \"\\80\\00\"                             ;; function 0 signature index, encoded with 2 bytes\n  \"\\0a\\04\\01\"                          ;; code section\n  \"\\02\\00\\0b\"                          ;; function body\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\"                          ;; type section\n  \"\\60\\00\\00\"                          ;; fun type\n  \"\\03\\02\\01\\00\"                       ;; function section\n  \"\\07\\07\\01\"                          ;; export section\n  \"\\82\\00\"                             ;; string length 2, encoded with 2 bytes\n  \"\\66\\31\"                             ;; export name f1\n  \"\\00\"                                ;; export kind\n  \"\\00\"                                ;; export func index\n  \"\\0a\\04\\01\"                          ;; code section\n  \"\\02\\00\\0b\"                          ;; function body\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\"                          ;; type section\n  \"\\60\\00\\00\"                          ;; fun type\n  \"\\03\\02\\01\\00\"                       ;; function section\n  \"\\07\\07\\01\"                          ;; export section\n  \"\\02\"                                ;; string length 2\n  \"\\66\\31\"                             ;; export name f1\n  \"\\00\"                                ;; export kind\n  \"\\80\\00\"                             ;; export func index, encoded with 2 bytes\n  \"\\0a\\04\\01\"                          ;; code section\n  \"\\02\\00\\0b\"                          ;; function body\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\"                          ;; type section\n  \"\\60\\00\\00\"                          ;; fun type\n  \"\\03\\02\\01\\00\"                       ;; function section\n  \"\\0a\"                                ;; code section\n  \"\\05\"                                ;; section size\n  \"\\81\\00\"                             ;; num functions, encoded with 2 bytes\n  \"\\02\\00\\0b\"                          ;; function body\n)\n\n;; Signed LEB128 can have non-minimal length\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\07\\01\"                          ;; Global section with 1 entry\n  \"\\7f\\00\"                             ;; i32, immutable\n  \"\\41\\80\\00\"                          ;; i32.const 0\n  \"\\0b\"                                ;; end\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\07\\01\"                          ;; Global section with 1 entry\n  \"\\7f\\00\"                             ;; i32, immutable\n  \"\\41\\ff\\7f\"                          ;; i32.const -1\n  \"\\0b\"                                ;; end\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\0a\\01\"                          ;; Global section with 1 entry\n  \"\\7f\\00\"                             ;; i32, immutable\n  \"\\41\\80\\80\\80\\80\\00\"                 ;; i32.const 0\n  \"\\0b\"                                ;; end\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\0a\\01\"                          ;; Global section with 1 entry\n  \"\\7f\\00\"                             ;; i32, immutable\n  \"\\41\\ff\\ff\\ff\\ff\\7f\"                 ;; i32.const -1\n  \"\\0b\"                                ;; end\n)\n\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\07\\01\"                          ;; Global section with 1 entry\n  \"\\7e\\00\"                             ;; i64, immutable\n  \"\\42\\80\\00\"                          ;; i64.const 0 with unused bits set\n  \"\\0b\"                                ;; end\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\07\\01\"                          ;; Global section with 1 entry\n  \"\\7e\\00\"                             ;; i64, immutable\n  \"\\42\\ff\\7f\"                          ;; i64.const -1 with unused bits unset\n  \"\\0b\"                                ;; end\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\0f\\01\"                          ;; Global section with 1 entry\n  \"\\7e\\00\"                             ;; i64, immutable\n  \"\\42\\80\\80\\80\\80\\80\\80\\80\\80\\80\\00\"  ;; i64.const 0 with unused bits set\n  \"\\0b\"                                ;; end\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\0f\\01\"                          ;; Global section with 1 entry\n  \"\\7e\\00\"                             ;; i64, immutable\n  \"\\42\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\7f\"  ;; i64.const -1 with unused bits unset\n  \"\\0b\"                                ;; end\n)\n\n;; Unsigned LEB128 must not be overlong\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\08\\01\"                             ;; Memory section with 1 entry\n    \"\\00\\82\\80\\80\\80\\80\\80\\80\\80\\80\\80\\00\"  ;; no max, minimum 2 with one byte too many\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\0a\\01\"                          ;; Memory section with 1 entry\n    \"\\01\\82\\00\"                          ;; minimum 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\80\\00\"  ;; max 2 with one byte too many\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\03\\01\"                          ;; Memory section with 1 entry\n    \"\\00\\00\"                             ;; no max, minimum 0\n    \"\\0b\\0b\\01\"                          ;; Data section with 1 entry\n    \"\\80\\80\\80\\80\\80\\00\"                 ;; Memory index 0 with one byte too many\n    \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\04\\04\\01\"                          ;; Table section with 1 entry\n    \"\\70\\00\\00\"                          ;; no max, minimum 0, funcref\n    \"\\09\\0b\\01\"                          ;; Element section with 1 entry\n    \"\\80\\80\\80\\80\\80\\00\"                 ;; Table index 0 with one byte too many\n    \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with no elements\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\00\"                                ;; custom section\n    \"\\83\\80\\80\\80\\80\\00\"                 ;; section size 3 with one byte too many\n    \"\\01\"                                ;; name byte count\n    \"1\"                                  ;; name\n    \"2\"                                  ;; sequence of bytes\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\00\"                                ;; custom section\n    \"\\0A\"                                ;; section size\n    \"\\83\\80\\80\\80\\80\\00\"                 ;; name byte count 3 with one byte too many\n    \"123\"                                ;; name\n    \"4\"                                  ;; sequence of bytes\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\0c\\01\"                          ;; type section\n    \"\\60\"                                ;; func type\n    \"\\82\\80\\80\\80\\80\\00\"                 ;; num params 2 with one byte too many\n    \"\\7f\\7e\"                             ;; param type\n    \"\\01\"                                ;; num result\n    \"\\7f\"                                ;; result type\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\0c\\01\"                          ;; type section\n    \"\\60\"                                ;; func type\n    \"\\02\"                                ;; num params\n    \"\\7f\\7e\"                             ;; param type\n    \"\\81\\80\\80\\80\\80\\00\"                 ;; num result 1 with one byte too many\n    \"\\7f\"                                ;; result type\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\05\\01\"                          ;; type section\n    \"\\60\\01\\7f\\00\"                       ;; function type\n    \"\\02\\1b\\01\"                          ;; import section\n    \"\\88\\80\\80\\80\\80\\00\"                 ;; module name length 8 with one byte too many\n    \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n    \"\\09\"                                ;; entity name length\n    \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n    \"\\00\"                                ;; import kind\n    \"\\00\"                                ;; import signature index\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\05\\01\"                          ;; type section\n    \"\\60\\01\\7f\\00\"                       ;; function type\n    \"\\02\\1b\\01\"                          ;; import section\n    \"\\08\"                                ;; module name length\n    \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n    \"\\89\\80\\80\\80\\80\\00\"                 ;; entity name length 9 with one byte too many\n    \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n    \"\\00\"                                ;; import kind\n    \"\\00\"                                ;; import signature index\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\05\\01\"                          ;; type section\n    \"\\60\\01\\7f\\00\"                       ;; function type\n    \"\\02\\1b\\01\"                          ;; import section\n    \"\\08\"                                ;; module name length\n    \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n    \"\\09\"                                ;; entity name length 9\n    \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n    \"\\00\"                                ;; import kind\n    \"\\80\\80\\80\\80\\80\\00\"                 ;; import signature index 0 with one byte too many\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; function type\n    \"\\03\\03\\01\"                          ;; function section\n    \"\\80\\80\\80\\80\\80\\00\"                 ;; function 0 signature index with one byte too many\n    \"\\0a\\04\\01\"                          ;; code section\n    \"\\02\\00\\0b\"                          ;; function body\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; fun type\n    \"\\03\\02\\01\\00\"                       ;; function section\n    \"\\07\\0b\\01\"                          ;; export section\n    \"\\82\\80\\80\\80\\80\\00\"                 ;; string length 2 with one byte too many\n    \"\\66\\31\"                             ;; export name f1\n    \"\\00\"                                ;; export kind\n    \"\\00\"                                ;; export func index\n    \"\\0a\\04\\01\"                          ;; code section\n    \"\\02\\00\\0b\"                          ;; function body\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; fun type\n    \"\\03\\02\\01\\00\"                       ;; function section\n    \"\\07\\0b\\01\"                          ;; export section\n    \"\\02\"                                ;; string length 2\n    \"\\66\\31\"                             ;; export name f1\n    \"\\00\"                                ;; export kind\n    \"\\80\\80\\80\\80\\80\\00\"                 ;; export func index 0 with one byte too many\n    \"\\0a\\04\\01\"                          ;; code section\n    \"\\02\\00\\0b\"                          ;; function body\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; fun type\n    \"\\03\\02\\01\\00\"                       ;; function section\n    \"\\0a\"                                ;; code section\n    \"\\05\"                                ;; section size\n    \"\\81\\80\\80\\80\\80\\00\"                 ;; num functions 1 with one byte too many\n    \"\\02\\00\\0b\"                          ;; function body\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"                 ;; Type section\n    \"\\03\\02\\01\\00\"                       ;; Function section\n    \"\\05\\03\\01\\00\\01\"                    ;; Memory section\n    \"\\0a\\11\\01\"                          ;; Code section\n    ;; function 0\n    \"\\0f\\01\\01\"                          ;; local type count\n    \"\\7f\"                                ;; i32\n    \"\\41\\00\"                             ;; i32.const 0\n    \"\\28\"                                ;; i32.load\n    \"\\02\"                                ;; alignment 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\80\\00\"  ;; offset 2 with one byte too many\n    \"\\1a\"                                ;; drop\n    \"\\0b\"                                ;; end\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\05\\03\\01\\00\\01\"          ;; Memory section\n    \"\\0a\\11\\01\"                ;; Code section\n    ;; function 0\n    \"\\0f\\01\\01\"                ;; local type count\n    \"\\7f\"                      ;; i32\n    \"\\41\\00\"                   ;; i32.const 0\n    \"\\28\"                      ;; i32.load\n    \"\\82\\80\\80\\80\\80\\00\"       ;; alignment 2 with one byte too many\n    \"\\00\"                      ;; offset 0\n    \"\\1a\"                      ;; drop\n    \"\\0b\"                      ;; end\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\05\\03\\01\\00\\01\"          ;; Memory section\n    \"\\0a\\12\\01\"                ;; Code section\n    ;; function 0\n    \"\\10\\01\\01\"                ;; local type count\n    \"\\7f\"                      ;; i32\n    \"\\41\\00\"                   ;; i32.const 0\n    \"\\41\\03\"                   ;; i32.const 3\n    \"\\36\"                      ;; i32.store\n    \"\\82\\80\\80\\80\\80\\00\"       ;; alignment 2 with one byte too many\n    \"\\03\"                      ;; offset 3\n    \"\\0b\"                      ;; end\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"                 ;; Type section\n    \"\\03\\02\\01\\00\"                       ;; Function section\n    \"\\05\\03\\01\\00\\01\"                    ;; Memory section\n    \"\\0a\\12\\01\"                          ;; Code section\n    ;; function 0\n    \"\\10\\01\\01\"                          ;; local type count\n    \"\\7f\"                                ;; i32\n    \"\\41\\00\"                             ;; i32.const 0\n    \"\\41\\03\"                             ;; i32.const 3\n    \"\\36\"                                ;; i32.store\n    \"\\02\"                                ;; alignment 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\80\\00\"  ;; offset 2 with one byte too many\n    \"\\0b\"                                ;; end\n  )\n  \"integer representation too long\"\n)\n\n;; Signed LEB128 must not be overlong\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0b\\01\"                          ;; Global section with 1 entry\n    \"\\7f\\00\"                             ;; i32, immutable\n    \"\\41\\80\\80\\80\\80\\80\\00\"              ;; i32.const 0 with one byte too many\n    \"\\0b\"                                ;; end\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0b\\01\"                          ;; Global section with 1 entry\n    \"\\7f\\00\"                             ;; i32, immutable\n    \"\\41\\ff\\ff\\ff\\ff\\ff\\7f\"              ;; i32.const -1 with one byte too many\n    \"\\0b\"                                ;; end\n  )\n  \"integer representation too long\"\n)\n\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\10\\01\"                          ;; Global section with 1 entry\n    \"\\7e\\00\"                             ;; i64, immutable\n    \"\\42\\80\\80\\80\\80\\80\\80\\80\\80\\80\\80\\00\"  ;; i64.const 0 with one byte too many\n    \"\\0b\"                                ;; end\n  )\n  \"integer representation too long\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\10\\01\"                          ;; Global section with 1 entry\n    \"\\7e\\00\"                             ;; i64, immutable\n    \"\\42\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\7f\"  ;; i64.const -1 with one byte too many\n    \"\\0b\"                                ;; end\n  )\n  \"integer representation too long\"\n)\n\n;; Unsigned LEB128s zero-extend\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\07\\01\"                          ;; Memory section with 1 entry\n    \"\\00\\82\\80\\80\\80\\80\\80\\80\\80\\80\\70\"  ;; no max, minimum 2 with unused bits set\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\07\\01\"                          ;; Memory section with 1 entry\n    \"\\00\\82\\80\\80\\80\\80\\80\\80\\80\\80\\40\"  ;; no max, minimum 2 with some unused bits set\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\09\\01\"                          ;; Memory section with 1 entry\n    \"\\01\\82\\00\"                          ;; minimum 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\10\"     ;; max 2 with unused bits set\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\09\\01\"                          ;; Memory section with 1 entry\n    \"\\01\\82\\00\"                          ;; minimum 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\40\"     ;; max 2 with some unused bits set\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\03\\01\"                          ;; Memory section with 1 entry\n    \"\\00\\00\"                             ;; no max, minimum 0\n    \"\\0b\\0a\\01\"                          ;; Data section with 1 entry\n    \"\\80\\80\\80\\80\\10\"                    ;; Memory index 0 with unused bits set\n    \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\04\\04\\01\"                          ;; Table section with 1 entry\n    \"\\70\\00\\00\"                          ;; no max, minimum 0, funcref\n    \"\\09\\0a\\01\"                          ;; Element section with 1 entry\n    \"\\80\\80\\80\\80\\10\"                    ;; Table index 0 with unused bits set\n    \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with no elements\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\00\"                                ;; custom section\n    \"\\83\\80\\80\\80\\10\"                    ;; section size 3 with unused bits set\n    \"\\01\"                                ;; name byte count\n    \"1\"                                  ;; name\n    \"2\"                                  ;; sequence of bytes\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\00\"                                ;; custom section\n    \"\\09\"                                ;; section size\n    \"\\83\\80\\80\\80\\40\"                    ;; name byte count 3 with unused bits set\n    \"123\"                                ;; name\n    \"4\"                                  ;; sequence of bytes\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\0b\\01\"                          ;; type section\n    \"\\60\"                                ;; func type\n    \"\\82\\80\\80\\80\\10\"                    ;; num params 2 with unused bits set\n    \"\\7f\\7e\"                             ;; param type\n    \"\\01\"                                ;; num result\n    \"\\7f\"                                ;; result type\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\0b\\01\"                          ;; type section\n    \"\\60\"                                ;; func type\n    \"\\02\"                                ;; num params\n    \"\\7f\\7e\"                             ;; param type\n    \"\\81\\80\\80\\80\\40\"                    ;; num result 1 with unused bits set\n    \"\\7f\"                                ;; result type\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\05\\01\"                          ;; type section\n    \"\\60\\01\\7f\\00\"                       ;; function type\n    \"\\02\\1a\\01\"                          ;; import section\n    \"\\88\\80\\80\\80\\10\"                    ;; module name length 8 with unused bits set\n    \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n    \"\\09\"                                ;; entity name length\n    \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n    \"\\00\"                                ;; import kind\n    \"\\00\"                                ;; import signature index\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\05\\01\"                          ;; type section\n    \"\\60\\01\\7f\\00\"                       ;; function type\n    \"\\02\\1a\\01\"                          ;; import section\n    \"\\08\"                                ;; module name length\n    \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n    \"\\89\\80\\80\\80\\40\"                    ;; entity name length 9 with unused bits set\n    \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n    \"\\00\"                                ;; import kind\n    \"\\00\"                                ;; import signature index\n  )\n  \"integer too large\"\n)\n(assert_malformed\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\05\\01\"                          ;; type section\n  \"\\60\\01\\7f\\00\"                       ;; function type\n  \"\\02\\1a\\01\"                          ;; import section\n  \"\\08\"                                ;; module name length\n  \"\\73\\70\\65\\63\\74\\65\\73\\74\"           ;; module name\n  \"\\09\"                                ;; entity name length 9\n  \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"        ;; entity name\n  \"\\00\"                                ;; import kind\n  \"\\80\\80\\80\\80\\10\"                    ;; import signature index 0 with unused bits set\n)\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; function type\n    \"\\03\\06\\01\"                          ;; function section\n    \"\\80\\80\\80\\80\\10\"                    ;; function 0 signature index with unused bits set\n    \"\\0a\\04\\01\"                          ;; code section\n    \"\\02\\00\\0b\"                          ;; function body\n  )\n  \"integer too large\"\n)\n\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; fun type\n    \"\\03\\02\\01\\00\"                       ;; function section\n    \"\\07\\0a\\01\"                          ;; export section\n    \"\\82\\80\\80\\80\\10\"                    ;; string length 2 with unused bits set\n    \"\\66\\31\"                             ;; export name f1\n    \"\\00\"                                ;; export kind\n    \"\\00\"                                ;; export func index\n    \"\\0a\\04\\01\"                          ;; code section\n    \"\\02\\00\\0b\"                          ;; function body\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; fun type\n    \"\\03\\02\\01\\00\"                       ;; function section\n    \"\\07\\0a\\01\"                          ;; export section\n    \"\\02\"                                ;; string length 2\n    \"\\66\\31\"                             ;; export name f1\n    \"\\00\"                                ;; export kind\n    \"\\80\\80\\80\\80\\10\"                    ;; export func index with unused bits set\n    \"\\0a\\04\\01\"                          ;; code section\n    \"\\02\\00\\0b\"                          ;; function body\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; fun type\n    \"\\03\\02\\01\\00\"                       ;; function section\n    \"\\0a\"                                ;; code section\n    \"\\08\"                                ;; section size\n    \"\\81\\80\\80\\80\\10\"                    ;; num functions 1 with unused bits set\n    \"\\02\\00\\0b\"                          ;; function body\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"              ;; Type section\n    \"\\03\\02\\01\\00\"                    ;; Function section\n    \"\\05\\03\\01\\00\\01\"                 ;; Memory section\n    \"\\0a\\10\\01\"                       ;; Code section\n    ;; function 0\n    \"\\0e\\01\\01\"                       ;; local type count\n    \"\\7f\"                             ;; i32\n    \"\\41\\00\"                          ;; i32.const 0\n    \"\\28\"                             ;; i32.load\n    \"\\02\"                             ;; alignment 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\10\"  ;; offset 2 with unused bits set\n    \"\\1a\"                             ;; drop\n    \"\\0b\"                             ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"              ;; Type section\n    \"\\03\\02\\01\\00\"                    ;; Function section\n    \"\\05\\03\\01\\00\\01\"                 ;; Memory section\n    \"\\0a\\10\\01\"                       ;; Code section\n    ;; function 0\n    \"\\0e\\01\\01\"                       ;; local type count\n    \"\\7f\"                             ;; i32\n    \"\\41\\00\"                          ;; i32.const 0\n    \"\\28\"                             ;; i32.load\n    \"\\02\"                             ;; alignment 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\40\"  ;; offset 2 with some unused bits set\n    \"\\1a\"                             ;; drop\n    \"\\0b\"                             ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\05\\03\\01\\00\\01\"          ;; Memory section\n    \"\\0a\\10\\01\"                ;; Code section\n    \"\\0e\\01\\01\"                ;; local type count\n    \"\\7f\"                      ;; i32\n    \"\\41\\00\"                   ;; i32.const 0\n    \"\\28\"                      ;; i32.load\n    \"\\82\\80\\80\\80\\10\"          ;; alignment 2 with unused bits set\n    \"\\00\"                      ;; offset 0\n    \"\\1a\"                      ;; drop\n    \"\\0b\"                      ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\05\\03\\01\\00\\01\"          ;; Memory section\n    \"\\0a\\10\\01\"                ;; Code section\n    ;; function 0\n    \"\\0e\\01\\01\"                ;; local type count\n    \"\\7f\"                      ;; i32\n    \"\\41\\00\"                   ;; i32.const 0\n    \"\\28\"                      ;; i32.load\n    \"\\82\\80\\80\\80\\40\"          ;; alignment 2 with some unused bits set\n    \"\\00\"                      ;; offset 0\n    \"\\1a\"                      ;; drop\n    \"\\0b\"                      ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\05\\03\\01\\00\\01\"          ;; Memory section\n    \"\\0a\\11\\01\"                ;; Code section\n    ;; function 0\n    \"\\0f\\01\\01\"                ;; local type count\n    \"\\7f\"                      ;; i32\n    \"\\41\\00\"                   ;; i32.const 0\n    \"\\41\\03\"                   ;; i32.const 3\n    \"\\36\"                      ;; i32.store\n    \"\\82\\80\\80\\80\\10\"          ;; alignment 2 with unused bits set\n    \"\\03\"                      ;; offset 3\n    \"\\0b\"                      ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\05\\03\\01\\00\\01\"          ;; Memory section\n    \"\\0a\\11\\01\"                ;; Code section\n    ;; function 0\n    \"\\0f\\01\\01\"                ;; local type count\n    \"\\7f\"                      ;; i32\n    \"\\41\\00\"                   ;; i32.const 0\n    \"\\41\\03\"                   ;; i32.const 3\n    \"\\36\"                      ;; i32.store\n    \"\\82\\80\\80\\80\\40\"          ;; alignment 2 with some unused bits set\n    \"\\03\"                      ;; offset 3\n    \"\\0b\"                      ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"              ;; Type section\n    \"\\03\\02\\01\\00\"                    ;; Function section\n    \"\\05\\03\\01\\00\\01\"                 ;; Memory section\n    \"\\0a\\11\\01\"                       ;; Code section\n    ;; function 0\n    \"\\0f\\01\\01\"                       ;; local type count\n    \"\\7f\"                             ;; i32\n    \"\\41\\00\"                          ;; i32.const 0\n    \"\\41\\03\"                          ;; i32.const 3\n    \"\\36\"                             ;; i32.store\n    \"\\02\"                             ;; alignment 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\10\"  ;; offset 2 with unused bits set\n    \"\\0b\"                             ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"              ;; Type section\n    \"\\03\\02\\01\\00\"                    ;; Function section\n    \"\\05\\03\\01\\00\\01\"                 ;; Memory section\n    \"\\0a\\11\\01\"                       ;; Code section\n    ;; function 0\n    \"\\0f\\01\\01\"                       ;; local type count\n    \"\\7f\"                             ;; i32\n    \"\\41\\00\"                          ;; i32.const 0\n    \"\\41\\03\"                          ;; i32.const 3\n    \"\\36\"                             ;; i32.store\n    \"\\02\"                             ;; alignment 2\n    \"\\82\\80\\80\\80\\80\\80\\80\\80\\80\\40\"  ;; offset 2 with some unused bits set\n    \"\\0b\"                             ;; end\n  )\n  \"integer too large\"\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\\60\\00\\00\"             ;; Type section\n  \"\\03\\02\\01\\00\"                   ;; Function section\n  \"\\05\\03\\01\\04\\00\"                ;; Memory section (flags: i64)\n  \"\\0a\\13\\01\"                      ;; Code section\n  ;; function 0\n  \"\\11\\00\"                         ;; local type count\n  \"\\42\\00\"                         ;; i64.const 0\n  \"\\28\"                            ;; i32.load\n  \"\\02\"                            ;; alignment 2\n  \"\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\01\" ;; offset 2^64 - 1\n  \"\\1a\"                            ;; drop\n  \"\\0b\"                            ;; end\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"             ;; Type section\n    \"\\03\\02\\01\\00\"                   ;; Function section\n    \"\\05\\03\\01\\04\\00\"                ;; Memory section (flags: i64)\n    \"\\0a\\13\\01\"                      ;; Code section\n    ;; function 0\n    \"\\11\\00\"                         ;; local type count\n    \"\\42\\00\"                         ;; i64.const 0\n    \"\\28\"                            ;; i32.load\n    \"\\02\"                            ;; alignment 2\n    \"\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\02\" ;; offset 2^64 (one unused bit set)\n    \"\\1a\"                            ;; drop\n    \"\\0b\"                            ;; end\n  )\n  \"integer too large\"\n)\n\n;; Signed LEB128s sign-extend\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0a\\01\"                          ;; Global section with 1 entry\n    \"\\7f\\00\"                             ;; i32, immutable\n    \"\\41\\80\\80\\80\\80\\70\"                 ;; i32.const 0 with unused bits set\n    \"\\0b\"                                ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0a\\01\"                          ;; Global section with 1 entry\n    \"\\7f\\00\"                             ;; i32, immutable\n    \"\\41\\ff\\ff\\ff\\ff\\0f\"                 ;; i32.const -1 with unused bits unset\n    \"\\0b\"                                ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0a\\01\"                          ;; Global section with 1 entry\n    \"\\7f\\00\"                             ;; i32, immutable\n    \"\\41\\80\\80\\80\\80\\1f\"                 ;; i32.const 0 with some unused bits set\n    \"\\0b\"                                ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0a\\01\"                          ;; Global section with 1 entry\n    \"\\7f\\00\"                             ;; i32, immutable\n    \"\\41\\ff\\ff\\ff\\ff\\4f\"                 ;; i32.const -1 with some unused bits unset\n    \"\\0b\"                                ;; end\n  )\n  \"integer too large\"\n)\n\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0f\\01\"                          ;; Global section with 1 entry\n    \"\\7e\\00\"                             ;; i64, immutable\n    \"\\42\\80\\80\\80\\80\\80\\80\\80\\80\\80\\7e\"  ;; i64.const 0 with unused bits set\n    \"\\0b\"                                ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0f\\01\"                          ;; Global section with 1 entry\n    \"\\7e\\00\"                             ;; i64, immutable\n    \"\\42\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\01\"  ;; i64.const -1 with unused bits unset\n    \"\\0b\"                                ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0f\\01\"                          ;; Global section with 1 entry\n    \"\\7e\\00\"                             ;; i64, immutable\n    \"\\42\\80\\80\\80\\80\\80\\80\\80\\80\\80\\02\"  ;; i64.const 0 with some unused bits set\n    \"\\0b\"                                ;; end\n  )\n  \"integer too large\"\n)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0f\\01\"                          ;; Global section with 1 entry\n    \"\\7e\\00\"                             ;; i64, immutable\n    \"\\42\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\41\"  ;; i64.const -1 with some unused bits unset\n    \"\\0b\"                                ;; end\n  )\n  \"integer too large\"\n)\n\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\"                          ;; type section\n  \"\\60\\00\\00\"                          ;; empty function type\n  \"\\03\\02\\01\"                          ;; function section\n  \"\\00\"                                ;; function 0, type 0\n  \"\\0a\\1b\\01\\19\"                       ;; code section\n  \"\\00\"                                ;; no locals\n  \"\\00\"                                ;; unreachable\n  \"\\fc\\80\\00\"                          ;; i32_trunc_sat_f32_s with 2 bytes\n  \"\\00\"                                ;; unreachable\n  \"\\fc\\81\\80\\00\"                       ;; i32_trunc_sat_f32_u with 3 bytes\n  \"\\00\"                                ;; unreachable\n  \"\\fc\\86\\80\\80\\00\"                    ;; i64_trunc_sat_f64_s with 4 bytes\n  \"\\00\"                                ;; unreachable\n  \"\\fc\\87\\80\\80\\80\\00\"                 ;; i64_trunc_sat_f64_u with 5 bytes\n  \"\\00\"                                ;; unreachable\n  \"\\0b\"                                ;; end\n)\n\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                          ;; type section\n    \"\\60\\00\\00\"                          ;; empty function type\n    \"\\03\\02\\01\"                          ;; function section\n    \"\\00\"                                ;; function 0, type 0\n    \"\\0a\\0d\\01\\0b\"                       ;; code section\n    \"\\00\"                                ;; no locals\n    \"\\00\"                                ;; unreachable\n    \"\\fc\\87\\80\\80\\80\\80\\00\"              ;; i64_trunc_sat_f64_u with 6 bytes\n    \"\\00\"                                ;; unreachable\n    \"\\0b\"                                ;; end\n  )\n  \"integer representation too long\"\n)\n\n;; Data segment tags and memory index can have non-minimal length\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\03\\01\"                          ;; Memory section with 1 entry\n  \"\\00\\00\"                             ;; no max, minimum 0\n  \"\\0b\\07\\01\"                          ;; Data section with 1 entry\n  \"\\80\\00\"                             ;; Active segment, encoded with 2 bytes\n  \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\03\\01\"                          ;; Memory section with 1 entry\n  \"\\00\\00\"                             ;; no max, minimum 0\n  \"\\0b\\08\\01\"                          ;; Data section with 1 entry\n  \"\\82\\00\"                             ;; Active segment, encoded with 2 bytes\n  \"\\00\"                                ;; explicit memory index\n  \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\03\\01\"                          ;; Memory section with 1 entry\n  \"\\00\\00\"                             ;; no max, minimum 0\n  \"\\0b\\09\\01\"                          ;; Data section with 1 entry\n  \"\\82\\00\"                             ;; Active segment, encoded with 2 bytes\n  \"\\80\\00\"                             ;; explicit memory index, encoded with 2 bytes\n  \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n)\n\n;; Element segment tags and table index can have non-minimal length\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\04\\04\\01\"                          ;; Table section with 1 entry\n  \"\\70\\00\\00\"                          ;; no max, minimum 0, funcref\n  \"\\09\\07\\01\"                          ;; Element section with 1 entry\n  \"\\80\\00\"                             ;; Active segment\n  \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with no elements\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\04\\04\\01\"                          ;; Table section with 1 entry\n  \"\\70\\00\\00\"                          ;; no max, minimum 0, funcref\n  \"\\09\\09\\01\"                          ;; Element section with 1 entry\n  \"\\02\"                                ;; Active segment\n  \"\\80\\00\"                             ;; explicit table index, encoded with 2 bytes\n  \"\\41\\00\\0b\\00\\00\"                    ;; (i32.const 0) with no elements\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\04\\04\\01\"                          ;; Table section with 1 entry\n  \"\\70\\00\\00\"                          ;; no max, minimum 0, funcref\n  \"\\09\\09\\01\"                          ;; Element section with 1 entry\n  \"\\82\\00\"                             ;; Active segment, encoded with 2 bytes\n  \"\\00\"                                ;; explicit table index\n  \"\\41\\00\\0b\\00\\00\"                    ;; (i32.const 0) with no elements\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\04\\04\\01\"                          ;; Table section with 1 entry\n  \"\\70\\00\\00\"                          ;; no max, minimum 0, funcref\n  \"\\09\\0a\\01\"                          ;; Element section with 1 entry\n  \"\\82\\00\"                             ;; Active segment, encoded with 2 bytes\n  \"\\80\\00\"                             ;; explicit table index, encoded with 2 bytes\n  \"\\41\\00\\0b\\00\\00\"                    ;; (i32.const 0) with no elements\n)\n\n;; Type section with signed LEB128 encoded type\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\"                     ;; Type section id\n    \"\\05\"                     ;; Type section length\n    \"\\01\"                     ;; Types vector length\n    \"\\e0\\7f\"                  ;; Malformed functype, -0x20 in signed LEB128 encoding\n    \"\\00\\00\"\n  )\n  \"integer representation too long\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/binary.wast",
    "content": "(module binary \"\\00asm\\01\\00\\00\\00\")\n(module binary \"\\00asm\" \"\\01\\00\\00\\00\")\n(module $M1 binary \"\\00asm\\01\\00\\00\\00\")\n(module $M2 binary \"\\00asm\" \"\\01\\00\\00\\00\")\n\n(assert_malformed (module binary \"\") \"unexpected end\")\n(assert_malformed (module binary \"\\01\") \"unexpected end\")\n(assert_malformed (module binary \"\\00as\") \"unexpected end\")\n(assert_malformed (module binary \"asm\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"msa\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"msa\\00\\01\\00\\00\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"msa\\00\\00\\00\\00\\01\") \"magic header not detected\")\n(assert_malformed (module binary \"asm\\01\\00\\00\\00\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"wasm\\01\\00\\00\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"\\7fasm\\01\\00\\00\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"\\80asm\\01\\00\\00\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"\\82asm\\01\\00\\00\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"\\ffasm\\01\\00\\00\\00\") \"magic header not detected\")\n\n;; 8-byte endian-reversed.\n(assert_malformed (module binary \"\\00\\00\\00\\01msa\\00\") \"magic header not detected\")\n\n;; Middle-endian byte orderings.\n(assert_malformed (module binary \"a\\00ms\\00\\01\\00\\00\") \"magic header not detected\")\n(assert_malformed (module binary \"sm\\00a\\00\\00\\01\\00\") \"magic header not detected\")\n\n;; Upper-cased.\n(assert_malformed (module binary \"\\00ASM\\01\\00\\00\\00\") \"magic header not detected\")\n\n;; EBCDIC-encoded magic.\n(assert_malformed (module binary \"\\00\\81\\a2\\94\\01\\00\\00\\00\") \"magic header not detected\")\n\n;; Leading UTF-8 BOM.\n(assert_malformed (module binary \"\\ef\\bb\\bf\\00asm\\01\\00\\00\\00\") \"magic header not detected\")\n\n;; Malformed binary version.\n(assert_malformed (module binary \"\\00asm\") \"unexpected end\")\n(assert_malformed (module binary \"\\00asm\\01\") \"unexpected end\")\n(assert_malformed (module binary \"\\00asm\\01\\00\\00\") \"unexpected end\")\n(assert_malformed (module binary \"\\00asm\\00\\00\\00\\00\") \"unknown binary version\")\n(assert_malformed (module binary \"\\00asm\\0d\\00\\00\\00\") \"unknown binary version\")\n(assert_malformed (module binary \"\\00asm\\0e\\00\\00\\00\") \"unknown binary version\")\n(assert_malformed (module binary \"\\00asm\\00\\01\\00\\00\") \"unknown binary version\")\n(assert_malformed (module binary \"\\00asm\\00\\00\\01\\00\") \"unknown binary version\")\n(assert_malformed (module binary \"\\00asm\\00\\00\\00\\01\") \"unknown binary version\")\n\n;; Invalid section id.\n(assert_malformed (module binary \"\\00asm\" \"\\01\\00\\00\\00\" \"\\0e\\01\\00\") \"malformed section id\")\n(assert_malformed (module binary \"\\00asm\" \"\\01\\00\\00\\00\" \"\\7f\\01\\00\") \"malformed section id\")\n(assert_malformed (module binary \"\\00asm\" \"\\01\\00\\00\\00\" \"\\80\\01\\00\\01\\01\\00\") \"malformed section id\")\n(assert_malformed (module binary \"\\00asm\" \"\\01\\00\\00\\00\" \"\\81\\01\\00\\01\\01\\00\") \"malformed section id\")\n(assert_malformed (module binary \"\\00asm\" \"\\01\\00\\00\\00\" \"\\ff\\01\\00\\01\\01\\00\") \"malformed section id\")\n\n;; Function with missing end marker (between two functions)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section: 1 type\n    \"\\03\\03\\02\\00\\00\"          ;; Function section: 2 functions\n    \"\\0a\\0c\\02\"                ;; Code section: 2 functions\n    ;; function 0\n    \"\\04\\00\"                   ;; Function size and local type count\n    \"\\41\\01\"                   ;; i32.const 1\n    \"\\1a\"                      ;; drop\n    ;; Missing end marker here\n    ;; function 1\n    \"\\05\\00\"                   ;; Function size and local type count\n    \"\\41\\01\"                   ;; i32.const 1\n    \"\\1a\"                      ;; drop\n    \"\\0b\"                      ;; end\n  )\n  \"END opcode expected\"\n)\n\n;; Function with missing end marker (at EOF)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section: 1 type\n    \"\\03\\02\\01\\00\"             ;; Function section: 1 function\n    \"\\0a\\06\\01\"                ;; Code section: 1 function\n    ;; function 0\n    \"\\04\\00\"                   ;; Function size and local type count\n    \"\\41\\01\"                   ;; i32.const 1\n    \"\\1a\"                      ;; drop\n    ;; Missing end marker here\n  )\n  \"unexpected end of section or function\"\n)\n\n;; Function with missing end marker (at end of code sections)\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section: 1 type\n    \"\\03\\02\\01\\00\"             ;; Function section: 1 function\n    \"\\0a\\06\\01\"                ;; Code section: 1 function\n    ;; function 0\n    \"\\04\\00\"                   ;; Function size and local type count\n    \"\\41\\01\"                   ;; i32.const 1\n    \"\\1a\"                      ;; drop\n    ;; Missing end marker here\n    \"\\0b\\03\\01\\01\\00\"          ;; Data section\n  )\n  ;; The spec interpreter consumes the `\\0b` (data section start) as an\n  ;; END instruction (also happens to be `\\0b`) and reports the code section as\n  ;; being larger than declared.\n  \"section size mismatch\"\n)\n\n;; Init expression with missing end marker\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section: 1 type\n    \"\\03\\02\\01\\00\"             ;; Function section: 1 function\n    \"\\06\\05\\01\\7f\\00\\41\\00\"    ;; Global section: 1 entry with missing end marker\n    ;; Missing end marker here\n    \"\\0a\\04\\01\\02\\00\\0b\"       ;; Code section: 1 function\n  )\n  \"unexpected end of section or function\"\n)\n\n;; Local number is unsigned 32 bit\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\0a\\0c\\01\"                ;; Code section\n\n    ;; function 0\n    \"\\0a\\02\"\n    \"\\80\\80\\80\\80\\10\\7f\"       ;; 0x100000000 i32\n    \"\\02\\7e\"                   ;; 0x00000002 i64\n    \"\\0b\"                      ;; end\n  )\n  \"integer too large\"\n)\n\n;; Local number is unsigned 32 bit\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\0a\\0c\\01\"                ;; Code section\n\n    ;; function 0\n    \"\\0a\\02\"\n    \"\\80\\80\\80\\80\\10\\7f\"       ;; 0x100000000 i32\n    \"\\02\\7e\"                   ;; 0x00000002 i64\n    \"\\0b\"                      ;; end\n  )\n  \"integer too large\"\n)\n\n;; No more than 2^32-1 locals.\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\0a\\0c\\01\"                ;; Code section\n\n    ;; function 0\n    \"\\0a\\02\"\n    \"\\ff\\ff\\ff\\ff\\0f\\7f\"       ;; 0xFFFFFFFF i32\n    \"\\02\\7e\"                   ;; 0x00000002 i64\n    \"\\0b\"                      ;; end\n  )\n  \"too many locals\"\n)\n\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\06\\01\\60\\02\\7f\\7f\\00\" ;; Type section: (param i32 i32)\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\0a\\1c\\01\"                ;; Code section\n\n    ;; function 0\n    \"\\1a\\04\"\n    \"\\80\\80\\80\\80\\04\\7f\"       ;; 0x40000000 i32\n    \"\\80\\80\\80\\80\\04\\7e\"       ;; 0x40000000 i64\n    \"\\80\\80\\80\\80\\04\\7d\"       ;; 0x40000000 f32\n    \"\\80\\80\\80\\80\\04\\7c\"       ;; 0x40000000 f64\n    \"\\0b\"                      ;; end\n  )\n  \"too many locals\"\n)\n\n;; Local count can be 0.\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\\60\\00\\00\"     ;; Type section\n  \"\\03\\02\\01\\00\"           ;; Function section\n  \"\\0a\\0a\\01\"              ;; Code section\n\n  ;; function 0\n  \"\\08\\03\"\n  \"\\00\\7f\"                 ;; 0 i32\n  \"\\00\\7e\"                 ;; 0 i64\n  \"\\02\\7d\"                 ;; 2 f32\n  \"\\0b\"                    ;; end\n)\n\n;; Function section has non-zero count, but code section is absent.\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"  ;; Type section\n    \"\\03\\03\\02\\00\\00\"     ;; Function section with 2 functions\n  )\n  \"function and code section have inconsistent lengths\"\n)\n\n;; Code section has non-zero count, but function section is absent.\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\0a\\04\\01\\02\\00\\0b\"  ;; Code section with 1 empty function\n  )\n  \"function and code section have inconsistent lengths\"\n)\n\n;; Function section count > code section count\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"  ;; Type section\n    \"\\03\\03\\02\\00\\00\"     ;; Function section with 2 functions\n    \"\\0a\\04\\01\\02\\00\\0b\"  ;; Code section with 1 empty function\n  )\n  \"function and code section have inconsistent lengths\"\n)\n\n;; Function section count < code section count\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"           ;; Type section\n    \"\\03\\02\\01\\00\"                 ;; Function section with 1 function\n    \"\\0a\\07\\02\\02\\00\\0b\\02\\00\\0b\"  ;; Code section with 2 empty functions\n  )\n  \"function and code section have inconsistent lengths\"\n)\n\n;; Function section has zero count, and code section is absent.\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\03\\01\\00\"  ;; Function section with 0 functions\n)\n\n;; Code section has zero count, and function section is absent.\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\0a\\01\\00\"  ;; Code section with 0 functions\n)\n\n;; Fewer passive segments than data count\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\0c\\01\\03\"                ;; Data count section with value 3\n    \"\\0b\\05\\02\"                ;; Data section with two entries\n    \"\\01\\00\"                   ;; Passive data section\n    \"\\01\\00\"                   ;; Passive data section\n  )\n  \"data count and data section have inconsistent lengths\"\n)\n\n;; More passive segments than data count\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\0c\\01\\01\"                ;; Data count section with value 1\n    \"\\0b\\05\\02\"                ;; Data section with two entries\n    \"\\01\\00\"                   ;; Passive data section\n    \"\\01\\00\"                   ;; Passive data section\n  )\n  \"data count and data section have inconsistent lengths\"\n)\n\n;; Non-zero data count section without data section\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\03\\01\\00\\01\"          ;; Memory section with one entry\n    \"\\0c\\01\\01\"                ;; Data count section with value 1\n  )\n  \"data count and data section have inconsistent lengths\"\n)\n\n;; Zero data count section without data section\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\0c\\01\\00\"                  ;; Data count section with value 0\n)\n\n;; memory.init requires a data count section\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\05\\03\\01\\00\\00\"          ;; Memory section\n    \"\\0a\\0e\\01\"                ;; Code section\n\n    ;; function 0\n    \"\\0c\\00\"\n    \"\\41\\00\"                   ;; zero args\n    \"\\41\\00\"\n    \"\\41\\00\"\n    \"\\fc\\08\\00\\00\"             ;; memory.init\n    \"\\0b\"\n\n    \"\\0b\\03\\01\\01\\00\"          ;; Data section\n  )                            ;; end\n  \"data count section required\"\n)\n\n;; data.drop requires a data count section\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\05\\03\\01\\00\\00\"          ;; Memory section\n    \"\\0a\\07\\01\"                ;; Code section\n\n    ;; function 0\n    \"\\05\\00\"\n    \"\\fc\\09\\00\"                ;; data.drop\n    \"\\0b\"\n\n    \"\\0b\\03\\01\\01\\00\"          ;; Data section\n  )                            ;; end\n  \"data count section required\"\n)\n\n;; passive element segment containing illegal opcode\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n\n    \"\\03\\02\\01\\00\"             ;; Function section\n\n    \"\\04\\04\\01\"                ;; Table section with 1 entry\n    \"\\70\\00\\00\"                ;; no max, minimum 0, funcref\n\n    \"\\05\\03\\01\\00\\00\"          ;; Memory section\n\n    \"\\09\\07\\01\"                ;; Element section with one segment\n    \"\\05\\70\"                   ;; Passive, funcref\n    \"\\01\"                      ;; 1 element\n    \"\\f3\\00\\0b\"                ;; bad opcode, index 0, end\n\n    \"\\0a\\04\\01\"                ;; Code section\n\n    ;; function 0\n    \"\\02\\00\"\n    \"\\0b\"                      ;; end\n  )\n  \"illegal opcode\"\n)\n\n;; passive element segment containing type other than funcref\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n\n    \"\\03\\02\\01\\00\"             ;; Function section\n\n    \"\\04\\04\\01\"                ;; Table section with 1 entry\n    \"\\70\\00\\00\"                ;; no max, minimum 0, funcref\n\n    \"\\05\\03\\01\\00\\00\"          ;; Memory section\n\n    \"\\09\\07\\01\"                ;; Element section with one segment\n    \"\\05\\7f\"                   ;; Passive, i32\n    \"\\01\"                      ;; 1 element\n    \"\\d2\\00\\0b\"                ;; ref.func, index 0, end\n\n    \"\\0a\\04\\01\"                ;; Code section\n\n    ;; function 0\n    \"\\02\\00\"\n    \"\\0b\"                      ;; end\n  )\n  \"malformed reference type\"\n)\n\n;; passive element segment containing opcode ref.func\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n\n  \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n\n  \"\\03\\02\\01\\00\"             ;; Function section\n\n  \"\\04\\04\\01\"                ;; Table section with 1 entry\n  \"\\70\\00\\00\"                ;; no max, minimum 0, funcref\n\n  \"\\05\\03\\01\\00\\00\"          ;; Memory section\n\n  \"\\09\\07\\01\"                ;; Element section with one segment\n  \"\\05\\70\"                   ;; Passive, funcref\n  \"\\01\"                      ;; 1 element\n  \"\\d2\\00\\0b\"                ;; ref.func, index 0, end\n\n  \"\\0a\\04\\01\"                ;; Code section\n\n  ;; function 0\n  \"\\02\\00\"\n  \"\\0b\"                      ;; end\n)\n\n;; passive element segment containing opcode ref.null\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n\n  \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n\n  \"\\03\\02\\01\\00\"             ;; Function section\n\n  \"\\04\\04\\01\"                ;; Table section with 1 entry\n  \"\\70\\00\\00\"                ;; no max, minimum 0, funcref\n\n  \"\\05\\03\\01\\00\\00\"          ;; Memory section\n\n  \"\\09\\07\\01\"                ;; Element section with one segment\n  \"\\05\\70\"                   ;; Passive, funcref\n  \"\\01\"                      ;; 1 element\n  \"\\d0\\70\\0b\"                ;; ref.null, end\n\n  \"\\0a\\04\\01\"                ;; Code section\n\n  ;; function 0\n  \"\\02\\00\"\n  \"\\0b\"                      ;; end\n)\n\n\n;; Type count can be zero\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\01\\00\"                               ;; type count can be zero\n)\n\n;; 2 type declared, 1 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\07\\02\"                             ;; type section with inconsistent count (2 declared, 1 given)\n    \"\\60\\00\\00\"                             ;; 1st type\n    ;; \"\\60\\00\\00\"                          ;; 2nd type (missed)\n  )\n  \"length out of bounds\"\n)\n\n;; 1 type declared, 2 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\07\\01\"                             ;; type section with inconsistent count (1 declared, 2 given)\n    \"\\60\\00\\00\"                             ;; 1st type\n    \"\\60\\00\\00\"                             ;; 2nd type (redundant)\n  )\n  \"section size mismatch\"\n)\n\n;; Import count can be zero\n(module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\05\\01\"                             ;; type section\n    \"\\60\\01\\7f\\00\"                          ;; type 0\n    \"\\02\\01\\00\"                             ;; import count can be zero\n)\n\n;; Malformed import kind\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\02\\04\\01\"                           ;; import section with single entry\n      \"\\00\"                                 ;; string length 0\n      \"\\00\"                                 ;; string length 0\n      \"\\05\"                                 ;; malformed import kind\n  )\n  \"malformed import kind\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\02\\05\\01\"                           ;; import section with single entry\n      \"\\00\"                                 ;; string length 0\n      \"\\00\"                                 ;; string length 0\n      \"\\05\"                                 ;; malformed import kind\n      \"\\00\"                                 ;; dummy byte\n  )\n  \"malformed import kind\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\02\\04\\01\"                           ;; import section with single entry\n      \"\\00\"                                 ;; string length 0\n      \"\\00\"                                 ;; string length 0\n      \"\\05\"                                 ;; malformed import kind\n  )\n  \"malformed import kind\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\02\\05\\01\"                           ;; import section with single entry\n      \"\\00\"                                 ;; string length 0\n      \"\\00\"                                 ;; string length 0\n      \"\\05\"                                 ;; malformed import kind\n      \"\\00\"                                 ;; dummy byte\n  )\n  \"malformed import kind\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\02\\04\\01\"                           ;; import section with single entry\n      \"\\00\"                                 ;; string length 0\n      \"\\00\"                                 ;; string length 0\n      \"\\80\"                                 ;; malformed import kind\n  )\n  \"malformed import kind\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\02\\05\\01\"                           ;; import section with single entry\n      \"\\00\"                                 ;; string length 0\n      \"\\00\"                                 ;; string length 0\n      \"\\80\"                                 ;; malformed import kind\n      \"\\00\"                                 ;; dummy byte\n  )\n  \"malformed import kind\"\n)\n\n;; 2 import declared, 1 given\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\01\\05\\01\"                           ;; type section\n      \"\\60\\01\\7f\\00\"                        ;; type 0\n      \"\\02\\16\\02\"                           ;; import section with inconsistent count (2 declared, 1 given)\n      ;; 1st import\n      \"\\08\"                                 ;; string length\n      \"\\73\\70\\65\\63\\74\\65\\73\\74\"            ;; spectest\n      \"\\09\"                                 ;; string length\n      \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"         ;; print_i32\n      \"\\00\\00\"                              ;; import kind, import signature index\n      ;; 2nd import\n      ;; (missed)\n  )\n  \"unexpected end of section or function\"\n)\n\n;; 1 import declared, 2 given\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\01\\09\\02\"                           ;; type section\n      \"\\60\\01\\7f\\00\"                        ;; type 0\n      \"\\60\\01\\7d\\00\"                        ;; type 1\n      \"\\02\\2b\\01\"                           ;; import section with inconsistent count (1 declared, 2 given)\n      ;; 1st import\n      \"\\08\"                                 ;; string length\n      \"\\73\\70\\65\\63\\74\\65\\73\\74\"            ;; spectest\n      \"\\09\"                                 ;; string length\n      \"\\70\\72\\69\\6e\\74\\5f\\69\\33\\32\"         ;; print_i32\n      \"\\00\\00\"                              ;; import kind, import signature index\n      ;; 2nd import\n      ;; (redundant)\n      \"\\08\"                                 ;; string length\n      \"\\73\\70\\65\\63\\74\\65\\73\\74\"            ;; spectest\n      \"\\09\"                                 ;; string length\n      \"\\70\\72\\69\\6e\\74\\5f\\66\\33\\32\"         ;; print_f32\n      \"\\00\\01\"                              ;; import kind, import signature index\n  )\n  \"section size mismatch\"\n)\n\n;; Table count can be zero\n(module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\04\\01\\00\"                             ;; table count can be zero\n)\n\n;; 1 table declared, 0 given\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\04\\01\\01\"                           ;; table section with inconsistent count (1 declared, 0 given)\n      ;; \"\\70\\01\\00\\00\"                     ;; table entity\n  )\n  \"unexpected end of section or function\"\n)\n\n;; Malformed table limits flag\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\04\\03\\01\"                           ;; table section with one entry\n      \"\\70\"                                 ;; anyfunc\n      \"\\08\"                                 ;; malformed table limits flag\n  )\n  \"malformed limits flags\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\04\\04\\01\"                           ;; table section with one entry\n      \"\\70\"                                 ;; anyfunc\n      \"\\08\"                                 ;; malformed table limits flag\n      \"\\00\"                                 ;; dummy byte\n  )\n  \"malformed limits flags\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\04\\06\\01\"                           ;; table section with one entry\n      \"\\70\"                                 ;; anyfunc\n      \"\\81\\00\"                              ;; malformed table limits flag as LEB128\n      \"\\00\\00\"                              ;; dummy bytes\n  )\n  \"malformed limits flags\"\n)\n\n;; Memory count can be zero\n(module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\01\\00\"                             ;; memory count can be zero\n)\n\n;; 1 memory declared, 0 given\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\05\\01\\01\"                           ;; memory section with inconsistent count (1 declared, 0 given)\n      ;; \"\\00\\00\"                           ;; memory 0 (missed)\n  )\n  \"unexpected end of section or function\"\n)\n\n;; Malformed memory limits flag\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\05\\02\\01\"                           ;; memory section with one entry\n      \"\\08\"                                 ;; malformed memory limits flag\n  )\n  \"malformed limits flags\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\05\\03\\01\"                           ;; memory section with one entry\n      \"\\08\"                                 ;; malformed memory limits flag\n      \"\\00\"                                 ;; dummy byte\n  )\n  \"malformed limits flags\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\05\\05\\01\"                           ;; memory section with one entry\n      \"\\81\\00\"                              ;; malformed memory limits flag as LEB128\n      \"\\00\\00\"                              ;; dummy bytes\n  )\n  \"malformed limits flags\"\n)\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\05\\05\\01\"                           ;; memory section with one entry\n      \"\\81\\01\"                              ;; malformed memory limits flag as LEB128\n      \"\\00\\00\"                              ;; dummy bytes\n  )\n  \"malformed limits flags\"\n)\n\n;; Global count can be zero\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\06\\01\\00\"                               ;; global count can be zero\n)\n\n;; 2 global declared, 1 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\06\\02\"                             ;; global section with inconsistent count (2 declared, 1 given)\n    \"\\7f\\00\\41\\00\\0b\"                       ;; global 0\n    ;; \"\\7f\\00\\41\\00\\0b\"                    ;; global 1 (missed)\n  )\n  \"unexpected end of section or function\"\n)\n\n;; 1 global declared, 2 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\0b\\01\"                             ;; global section with inconsistent count (1 declared, 2 given)\n    \"\\7f\\00\\41\\00\\0b\"                       ;; global 0\n    \"\\7f\\00\\41\\00\\0b\"                       ;; global 1 (redundant)\n  )\n  \"section size mismatch\"\n)\n\n;; Export count can be 0\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\"                               ;; type section\n  \"\\60\\00\\00\"                               ;; type 0\n  \"\\03\\03\\02\\00\\00\"                         ;; func section\n  \"\\07\\01\\00\"                               ;; export count can be zero\n  \"\\0a\\07\\02\"                               ;; code section\n  \"\\02\\00\\0b\"                               ;; function body 0\n  \"\\02\\00\\0b\"                               ;; function body 1\n)\n\n;; 2 export declared, 1 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                             ;; type section\n    \"\\60\\00\\00\"                             ;; type 0\n    \"\\03\\03\\02\\00\\00\"                       ;; func section\n    \"\\07\\06\\02\"                             ;; export section with inconsistent count (2 declared, 1 given)\n    \"\\02\"                                   ;; export 0\n    \"\\66\\31\"                                ;; export name\n    \"\\00\\00\"                                ;; export kind, export func index\n    ;; \"\\02\"                                ;; export 1 (missed)\n    ;; \"\\66\\32\"                             ;; export name\n    ;; \"\\00\\01\"                             ;; export kind, export func index\n    \"\\0a\\07\\02\"                             ;; code section\n    \"\\02\\00\\0b\"                             ;; function body 0\n    \"\\02\\00\\0b\"                             ;; function body 1\n  )\n  \"length out of bounds\"\n)\n\n;; 1 export declared, 2 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                             ;; type section\n    \"\\60\\00\\00\"                             ;; type 0\n    \"\\03\\03\\02\\00\\00\"                       ;; func section\n    \"\\07\\0b\\01\"                             ;; export section with inconsistent count (1 declared, 2 given)\n    \"\\02\"                                   ;; export 0\n    \"\\66\\31\"                                ;; export name\n    \"\\00\\00\"                                ;; export kind, export func index\n    \"\\02\"                                   ;; export 1 (redundant)\n    \"\\66\\32\"                                ;; export name\n    \"\\00\\01\"                                ;; export kind, export func index\n    \"\\0a\\07\\02\"                             ;; code section\n    \"\\02\\00\\0b\"                             ;; function body 0\n    \"\\02\\00\\0b\"                             ;; function body 1\n  )\n  \"section size mismatch\"\n)\n\n;; elem segment count can be zero\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\"                               ;; type section\n  \"\\60\\00\\00\"                               ;; type 0\n  \"\\03\\02\\01\\00\"                            ;; func section\n  \"\\04\\04\\01\"                               ;; table section\n  \"\\70\\00\\01\"                               ;; table 0\n  \"\\09\\01\\00\"                               ;; elem segment count can be zero\n  \"\\0a\\04\\01\"                               ;; code section\n  \"\\02\\00\\0b\"                               ;; function body\n)\n\n;; 2 elem segment declared, 1 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                             ;; type section\n    \"\\60\\00\\00\"                             ;; type 0\n    \"\\03\\02\\01\\00\"                          ;; func section\n    \"\\04\\04\\01\"                             ;; table section\n    \"\\70\\00\\01\"                             ;; table 0\n    \"\\09\\07\\02\"                             ;; elem with inconsistent segment count (2 declared, 1 given)\n    \"\\00\\41\\00\\0b\\01\\00\"                    ;; elem 0\n    ;; \"\\00\\41\\00\\0b\\01\\00\"                 ;; elem 1 (missed)\n  )\n  \"unexpected end\"\n)\n\n;; 2 elem segment declared, 1.5 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                             ;; type section\n    \"\\60\\00\\00\"                             ;; type 0\n    \"\\03\\02\\01\\00\"                          ;; func section\n    \"\\04\\04\\01\"                             ;; table section\n    \"\\70\\00\\01\"                             ;; table 0\n    \"\\09\\0a\\02\"                             ;; elem with inconsistent segment count (2 declared, 1 given)\n    \"\\00\\41\\00\\0b\\01\\00\"                    ;; elem 0\n    \"\\00\\41\\00\"                             ;; elem 1 (partial)\n    ;; \"\\0b\\01\\00\"                          ;; elem 1 (missing part)\n  )\n  \"unexpected end\"\n)\n\n;; 1 elem segment declared, 2 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\"                             ;; type section\n    \"\\60\\00\\00\"                             ;; type 0\n    \"\\03\\02\\01\\00\"                          ;; func section\n    \"\\04\\04\\01\"                             ;; table section\n    \"\\70\\00\\01\"                             ;; table 0\n    \"\\09\\0d\\01\"                             ;; elem with inconsistent segment count (1 declared, 2 given)\n    \"\\00\\41\\00\\0b\\01\\00\"                    ;; elem 0\n    \"\\00\\41\\00\\0b\\01\\00\"                    ;; elem 1 (redundant)\n    \"\\0a\\04\\01\"                             ;; code section\n    \"\\02\\00\\0b\"                             ;; function body\n  )\n  \"section size mismatch\"\n)\n\n;; data segment count can be zero\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\03\\01\"                               ;; memory section\n  \"\\00\\01\"                                  ;; memory 0\n  \"\\0b\\01\\00\"                               ;; data segment count can be zero\n)\n\n;; 2 data segment declared, 1 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\03\\01\"                             ;; memory section\n    \"\\00\\01\"                                ;; memory 0\n    \"\\0b\\07\\02\"                             ;; data with inconsistent segment count (2 declared, 1 given)\n    \"\\00\\41\\00\\0b\\01\\61\"                    ;; data 0\n    ;; \"\\00\\41\\01\\0b\\01\\62\"                 ;; data 1 (missed)\n  )\n  \"unexpected end of section or function\"\n)\n\n;; 1 data segment declared, 2 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\03\\01\"                             ;; memory section\n    \"\\00\\01\"                                ;; memory 0\n    \"\\0b\\0d\\01\"                             ;; data with inconsistent segment count (1 declared, 2 given)\n    \"\\00\\41\\00\\0b\\01\\61\"                    ;; data 0\n    \"\\00\\41\\01\\0b\\01\\62\"                    ;; data 1 (redundant)\n  )\n  \"section size mismatch\"\n)\n\n;; data segment has 7 bytes declared, but 6 bytes given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\03\\01\"                             ;; memory section\n    \"\\00\\01\"                                ;; memory 0\n    \"\\0b\\0c\\01\"                             ;; data section\n    \"\\00\\41\\03\\0b\"                          ;; data segment 0\n    \"\\07\"                                   ;; data segment size with inconsistent lengths (7 declared, 6 given)\n    \"\\61\\62\\63\\64\\65\\66\"                    ;; 6 bytes given\n  )\n  \"unexpected end of section or function\"\n)\n\n;; data segment has 5 bytes declared, but 6 bytes given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\03\\01\"                             ;; memory section\n    \"\\00\\01\"                                ;; memory 0\n    \"\\0b\\0c\\01\"                             ;; data section\n    \"\\00\\41\\00\\0b\"                          ;; data segment 0\n    \"\\05\"                                   ;; data segment size with inconsistent lengths (5 declared, 6 given)\n    \"\\61\\62\\63\\64\\65\\66\"                    ;; 6 bytes given\n  )\n  \"section size mismatch\"\n)\n\n;; br_table target count can be zero\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\"                               ;; type section\n  \"\\60\\00\\00\"                               ;; type 0\n  \"\\03\\02\\01\\00\"                            ;; func section\n  \"\\0a\\11\\01\"                               ;; code section\n  \"\\0f\\00\"                                  ;; func 0\n  \"\\02\\40\"                                  ;; block 0\n  \"\\41\\01\"                                  ;; condition of if 0\n  \"\\04\\40\"                                  ;; if 0\n  \"\\41\\01\"                                  ;; index of br_table element\n  \"\\0e\\00\"                                  ;; br_table target count can be zero\n  \"\\02\"                                     ;; break depth for default\n  \"\\0b\\0b\\0b\"                               ;; end\n)\n\n;; 1 br_table target declared, 2 given\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\25\\0c\"                             ;; type section\n    \"\\60\\00\\00\"                             ;; type 0\n    \"\\60\\00\\00\"                             ;; type 1\n    \"\\60\\00\\00\"                             ;; type 2\n    \"\\60\\00\\00\"                             ;; type 3\n    \"\\60\\00\\00\"                             ;; type 4\n    \"\\60\\00\\00\"                             ;; type 5\n    \"\\60\\00\\00\"                             ;; type 6\n    \"\\60\\00\\00\"                             ;; type 7\n    \"\\60\\00\\00\"                             ;; type 8\n    \"\\60\\00\\00\"                             ;; type 9\n    \"\\60\\00\\00\"                             ;; type 10\n    \"\\60\\00\\00\"                             ;; type 11\n    \"\\03\\02\\01\\00\"                          ;; func section\n    \"\\0a\\13\\01\"                             ;; code section\n    \"\\11\\00\"                                ;; func 0\n    \"\\02\\40\"                                ;; block 0\n    \"\\41\\01\"                                ;; condition of if 0\n    \"\\04\\40\"                                ;; if 0\n    \"\\41\\01\"                                ;; index of br_table element\n    \"\\0e\\01\"                                ;; br_table with inconsistent target count (1 declared, 2 given)\n    \"\\00\"                                   ;; break depth 0\n    \"\\01\"                                   ;; break depth 1\n    \"\\02\"                                   ;; break depth for default, interpreted as a block\n    \"\\0b\"                                   ;; end, interpreted as type 11 for the block\n    \"\\0b\\0b\"                                ;; end\n  )\n  \"unexpected end of section or function\"\n)\n\n;; Start section\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n  \"\\03\\02\\01\\00\"             ;; Function section\n  \"\\08\\01\\00\"                ;; Start section: function 0\n\n  \"\\0a\\04\\01\"                ;; Code section\n  ;; function 0\n  \"\\02\\00\"\n  \"\\0b\"                      ;; end\n)\n\n;; Multiple start sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"       ;; Type section\n    \"\\03\\02\\01\\00\"             ;; Function section\n    \"\\08\\01\\00\"                ;; Start section: function 0\n    \"\\08\\01\\00\"                ;; Start section: function 0\n\n    \"\\0a\\04\\01\"                ;; Code section\n    ;; function 0\n    \"\\02\\00\"\n    \"\\0b\"                      ;; end\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple function sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"           ;; Type section\n    \"\\03\\02\\01\\00\"                 ;; Function section with 1 function\n    \"\\03\\02\\01\\00\"                 ;; Function section with 1 function\n    \"\\0a\\07\\02\\02\\00\\0b\\02\\00\\0b\"  ;; Code section with 2 empty functions\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple code sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"           ;; Type section\n    \"\\03\\03\\02\\00\\00\"              ;; Function section with 2 functions\n    \"\\0a\\04\\01\\02\\00\\0b\"           ;; Code section with 1 empty function\n    \"\\0a\\04\\01\\02\\00\\0b\"           ;; Code section with 1 empty function\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple data count sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\0c\\01\\01\"                   ;; Data count section with value \"1\"\n    \"\\0c\\01\\01\"                   ;; Data count section with value \"1\"\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple data sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\0b\\01\\00\"                   ;; Data section with zero entries\n    \"\\0b\\01\\00\"                   ;; Data section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple global sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\06\\01\\00\"                   ;; Global section with zero entries\n    \"\\06\\01\\00\"                   ;; Global section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple export sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\07\\01\\00\"                   ;; Export section with zero entries\n    \"\\07\\01\\00\"                   ;; Export section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple table sections\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\04\\01\\00\"                 ;; Table section with zero entries\n      \"\\04\\01\\00\"                 ;; Table section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple element sections\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\09\\01\\00\"                 ;; Element section with zero entries\n      \"\\09\\01\\00\"                 ;; Element section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple import sections\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\02\\01\\00\"                 ;; Import section with zero entries\n      \"\\02\\01\\00\"                 ;; Import section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple type sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\01\\00\"                   ;; Type section with zero entries\n    \"\\01\\01\\00\"                   ;; Type section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Multiple memory sections\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\01\\00\"                   ;; Memory section with zero entries\n    \"\\05\\01\\00\"                   ;; Memory section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Type section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\02\\01\\00\"                 ;; Import section with zero entries\n      \"\\01\\01\\00\"                 ;; Type section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Import section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\03\\01\\00\"                 ;; Function section with zero entries\n      \"\\02\\01\\00\"                 ;; Import section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Function section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\04\\01\\00\"                 ;; Table section with zero entries\n      \"\\03\\01\\00\"                 ;; Function section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Table section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\05\\01\\00\"                 ;; Memory section with zero entries\n      \"\\04\\01\\00\"                 ;; Table section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Memory section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\06\\01\\00\"                 ;; Global section with zero entries\n      \"\\05\\01\\00\"                 ;; Memory section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Global section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\07\\01\\00\"                 ;; Export section with zero entries\n      \"\\06\\01\\00\"                 ;; Global section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Export section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\03\\02\\01\\00\"              ;; Function section\n      \"\\08\\01\\00\"                 ;; Start section: function 0\n      \"\\07\\01\\00\"                 ;; Export section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Start section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\03\\02\\01\\00\"              ;; Function section\n      \"\\09\\01\\00\"                 ;; Element section with zero entries\n      \"\\08\\01\\00\"                 ;; Start section: function 0\n  )\n  \"unexpected content after last section\"\n)\n\n;; Element section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\0c\\01\\01\"                 ;; Data count section with value \"1\"\n      \"\\09\\01\\00\"                 ;; Element section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n;; Data count section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\0a\\01\\00\"                 ;; Code section with zero entries\n      \"\\0c\\01\\01\"                 ;; Data count section with value \"1\"\n  )\n  \"unexpected content after last section\"\n)\n\n;; Code section out of order\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\0b\\01\\00\"                 ;; Data section with zero entries\n      \"\\0a\\01\\00\"                 ;; Code section with zero entries\n  )\n  \"unexpected content after last section\"\n)\n\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/binary0.wast",
    "content": ";; Unsigned LEB128 can have non-minimal length\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\07\\02\"                          ;; Memory section with 2 entries\n  \"\\00\\82\\00\"                          ;; no max, minimum 2\n  \"\\00\\82\\00\"                          ;; no max, minimum 2\n)\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\13\\03\"                          ;; Memory section with 3 entries\n  \"\\00\\83\\80\\80\\80\\00\"                 ;; no max, minimum 3\n  \"\\00\\84\\80\\80\\80\\00\"                 ;; no max, minimum 4\n  \"\\00\\85\\80\\80\\80\\00\"                 ;; no max, minimum 5\n)\n\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\05\\02\"                          ;; Memory section with 2 entries\n  \"\\00\\00\"                             ;; no max, minimum 0\n  \"\\00\\00\"                             ;; no max, minimum 0\n  \"\\0b\\06\\01\"                          ;; Data section with 1 entry\n  \"\\00\"                                ;; Memory index 0\n  \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n)\n\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\05\\02\"                          ;; Memory section with 2 entries\n  \"\\00\\00\"                             ;; no max, minimum 0\n  \"\\00\\01\"                             ;; no max, minimum 1\n  \"\\0b\\07\\01\"                          ;; Data section with 1 entry\n  \"\\02\\01\"                             ;; Memory index 1\n  \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n)\n\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\05\\05\\02\"                          ;; Memory section with 2 entries\n  \"\\00\\00\"                             ;; no max, minimum 0\n  \"\\00\\01\"                             ;; no max, minimum 1\n  \"\\0b\\0a\\01\"                          ;; Data section with 1 entry\n  \"\\02\\81\\80\\80\\00\"                    ;; Memory index 1\n  \"\\41\\00\\0b\\00\"                       ;; (i32.const 0) with contents \"\"\n)\n\n;; Unsigned LEB128 must not be overlong\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\05\\10\\02\"                          ;; Memory section with 2 entries\n    \"\\00\\01\"                             ;; no max, minimum 1\n    \"\\00\\82\\80\\80\\80\\80\\80\\80\\80\\80\\80\\80\\00\"  ;; no max, minimum 2 with one byte too many\n  )\n  \"integer representation too long\"\n)\n\n;; 2 memories declared, 1 given\n(assert_malformed\n  (module binary\n      \"\\00asm\" \"\\01\\00\\00\\00\"\n      \"\\05\\03\\02\"                           ;; memory section with inconsistent count (1 declared, 0 given)\n      \"\\00\\00\"                              ;; memory 0 (missed)\n      ;; \"\\00\\00\"                           ;; memory 1 (missing)\n  )\n  \"unexpected end of section or function\"\n)\n\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/call_indirect.wast",
    "content": ";; Test `call_indirect` operator\n\n(module\n  ;; Auxiliary definitions\n  (type $proc (func))\n  (type $out-i32 (func (result i32)))\n  (type $out-i64 (func (result i64)))\n  (type $out-f32 (func (result f32)))\n  (type $out-f64 (func (result f64)))\n  (type $out-f64-i32 (func (result f64 i32)))\n  (type $over-i32 (func (param i32) (result i32)))\n  (type $over-i64 (func (param i64) (result i64)))\n  (type $over-f32 (func (param f32) (result f32)))\n  (type $over-f64 (func (param f64) (result f64)))\n  (type $over-i32-f64 (func (param i32 f64) (result i32 f64)))\n  (type $swap-i32-i64 (func (param i32 i64) (result i64 i32)))\n  (type $f32-i32 (func (param f32 i32) (result i32)))\n  (type $i32-i64 (func (param i32 i64) (result i64)))\n  (type $f64-f32 (func (param f64 f32) (result f32)))\n  (type $i64-f64 (func (param i64 f64) (result f64)))\n  (type $over-i32-duplicate (func (param i32) (result i32)))\n  (type $over-i64-duplicate (func (param i64) (result i64)))\n  (type $over-f32-duplicate (func (param f32) (result f32)))\n  (type $over-f64-duplicate (func (param f64) (result f64)))\n\n  (func $const-i32 (type $out-i32) (i32.const 0x132))\n  (func $const-i64 (type $out-i64) (i64.const 0x164))\n  (func $const-f32 (type $out-f32) (f32.const 0xf32))\n  (func $const-f64 (type $out-f64) (f64.const 0xf64))\n  (func $const-f64-i32 (type $out-f64-i32) (f64.const 0xf64) (i32.const 32))\n\n  (func $id-i32 (type $over-i32) (local.get 0))\n  (func $id-i64 (type $over-i64) (local.get 0))\n  (func $id-f32 (type $over-f32) (local.get 0))\n  (func $id-f64 (type $over-f64) (local.get 0))\n  (func $id-i32-f64 (type $over-i32-f64) (local.get 0) (local.get 1))\n  (func $swap-i32-i64 (type $swap-i32-i64) (local.get 1) (local.get 0))\n\n  (func $i32-i64 (type $i32-i64) (local.get 1))\n  (func $i64-f64 (type $i64-f64) (local.get 1))\n  (func $f32-i32 (type $f32-i32) (local.get 1))\n  (func $f64-f32 (type $f64-f32) (local.get 1))\n\n  (func $over-i32-duplicate (type $over-i32-duplicate) (local.get 0))\n  (func $over-i64-duplicate (type $over-i64-duplicate) (local.get 0))\n  (func $over-f32-duplicate (type $over-f32-duplicate) (local.get 0))\n  (func $over-f64-duplicate (type $over-f64-duplicate) (local.get 0))\n\n  (table funcref\n    (elem\n      $const-i32 $const-i64 $const-f32 $const-f64  ;; 0..3\n      $id-i32 $id-i64 $id-f32 $id-f64              ;; 4..7\n      $f32-i32 $i32-i64 $f64-f32 $i64-f64          ;; 9..11\n      $fac-i64 $fib-i64 $even $odd                 ;; 12..15\n      $runaway $mutual-runaway1 $mutual-runaway2   ;; 16..18\n      $over-i32-duplicate $over-i64-duplicate      ;; 19..20\n      $over-f32-duplicate $over-f64-duplicate      ;; 21..22\n      $fac-i32 $fac-f32 $fac-f64                   ;; 23..25\n      $fib-i32 $fib-f32 $fib-f64                   ;; 26..28\n      $const-f64-i32 $id-i32-f64 $swap-i32-i64     ;; 29..31\n    )\n  )\n\n  (table $t64 i64 funcref\n    (elem $const-i32)\n  )\n\n  ;; Syntax\n\n  (func\n    (call_indirect (i32.const 0))\n    (call_indirect $t64 (i64.const 0))\n    (call_indirect (param i64) (i64.const 0) (i32.const 0))\n    (call_indirect (param i64) (param) (param f64 i32 i64)\n      (i64.const 0) (f64.const 0) (i32.const 0) (i64.const 0) (i32.const 0)\n    )\n    (call_indirect (result) (i32.const 0))\n    (drop (i32.eqz (call_indirect (result i32) (i32.const 0))))\n    (drop (i32.eqz (call_indirect (result i32) (result) (i32.const 0))))\n    (drop (i32.eqz\n      (call_indirect (param i64) (result i32) (i64.const 0) (i32.const 0))\n    ))\n    (drop (i32.eqz\n      (call_indirect\n        (param) (param i64) (param) (param f64 i32 i64) (param) (param)\n        (result) (result i32) (result) (result)\n        (i64.const 0) (f64.const 0) (i32.const 0) (i64.const 0) (i32.const 0)\n      )\n    ))\n    (drop (i64.eqz\n      (call_indirect (type $over-i64) (param i64) (result i64)\n        (i64.const 0) (i32.const 0)\n      )\n    ))\n  )\n\n  ;; Typing\n\n  (func (export \"type-i32\") (result i32)\n    (call_indirect (type $out-i32) (i32.const 0))\n  )\n  (func (export \"type-i32-t64\") (result i32)\n    (call_indirect $t64 (type $out-i32) (i64.const 0))\n  )\n  (func (export \"type-i64\") (result i64)\n    (call_indirect (type $out-i64) (i32.const 1))\n  )\n  (func (export \"type-f32\") (result f32)\n    (call_indirect (type $out-f32) (i32.const 2))\n  )\n  (func (export \"type-f64\") (result f64)\n    (call_indirect (type $out-f64) (i32.const 3))\n  )\n  (func (export \"type-f64-i32\") (result f64 i32)\n    (call_indirect (type $out-f64-i32) (i32.const 29))\n  )\n\n  (func (export \"type-index\") (result i64)\n    (call_indirect (type $over-i64) (i64.const 100) (i32.const 5))\n  )\n\n  (func (export \"type-first-i32\") (result i32)\n    (call_indirect (type $over-i32) (i32.const 32) (i32.const 4))\n  )\n  (func (export \"type-first-i64\") (result i64)\n    (call_indirect (type $over-i64) (i64.const 64) (i32.const 5))\n  )\n  (func (export \"type-first-f32\") (result f32)\n    (call_indirect (type $over-f32) (f32.const 1.32) (i32.const 6))\n  )\n  (func (export \"type-first-f64\") (result f64)\n    (call_indirect (type $over-f64) (f64.const 1.64) (i32.const 7))\n  )\n\n  (func (export \"type-second-i32\") (result i32)\n    (call_indirect (type $f32-i32) (f32.const 32.1) (i32.const 32) (i32.const 8))\n  )\n  (func (export \"type-second-i64\") (result i64)\n    (call_indirect (type $i32-i64) (i32.const 32) (i64.const 64) (i32.const 9))\n  )\n  (func (export \"type-second-f32\") (result f32)\n    (call_indirect (type $f64-f32) (f64.const 64) (f32.const 32) (i32.const 10))\n  )\n  (func (export \"type-second-f64\") (result f64)\n    (call_indirect (type $i64-f64) (i64.const 64) (f64.const 64.1) (i32.const 11))\n  )\n\n  (func (export \"type-all-f64-i32\") (result f64 i32)\n    (call_indirect (type $out-f64-i32) (i32.const 29))\n  )\n  (func (export \"type-all-i32-f64\") (result i32 f64)\n    (call_indirect (type $over-i32-f64)\n      (i32.const 1) (f64.const 2) (i32.const 30)\n    )\n  )\n  (func (export \"type-all-i32-i64\") (result i64 i32)\n    (call_indirect (type $swap-i32-i64)\n      (i32.const 1) (i64.const 2) (i32.const 31)\n    )\n  )\n\n  ;; Dispatch\n\n  (func (export \"dispatch\") (param i32 i64) (result i64)\n    (call_indirect (type $over-i64) (local.get 1) (local.get 0))\n  )\n\n  (func (export \"dispatch-structural-i64\") (param i32) (result i64)\n    (call_indirect (type $over-i64-duplicate) (i64.const 9) (local.get 0))\n  )\n  (func (export \"dispatch-structural-i32\") (param i32) (result i32)\n    (call_indirect (type $over-i32-duplicate) (i32.const 9) (local.get 0))\n  )\n  (func (export \"dispatch-structural-f32\") (param i32) (result f32)\n    (call_indirect (type $over-f32-duplicate) (f32.const 9.0) (local.get 0))\n  )\n  (func (export \"dispatch-structural-f64\") (param i32) (result f64)\n    (call_indirect (type $over-f64-duplicate) (f64.const 9.0) (local.get 0))\n  )\n\n  ;; Recursion\n\n  (func $fac-i64 (export \"fac-i64\") (type $over-i64)\n    (if (result i64) (i64.eqz (local.get 0))\n      (then (i64.const 1))\n      (else\n        (i64.mul\n          (local.get 0)\n          (call_indirect (type $over-i64)\n            (i64.sub (local.get 0) (i64.const 1))\n            (i32.const 12)\n          )\n        )\n      )\n    )\n  )\n\n  (func $fib-i64 (export \"fib-i64\") (type $over-i64)\n    (if (result i64) (i64.le_u (local.get 0) (i64.const 1))\n      (then (i64.const 1))\n      (else\n        (i64.add\n          (call_indirect (type $over-i64)\n            (i64.sub (local.get 0) (i64.const 2))\n            (i32.const 13)\n          )\n          (call_indirect (type $over-i64)\n            (i64.sub (local.get 0) (i64.const 1))\n            (i32.const 13)\n          )\n        )\n      )\n    )\n  )\n\n  (func $fac-i32 (export \"fac-i32\") (type $over-i32)\n    (if (result i32) (i32.eqz (local.get 0))\n      (then (i32.const 1))\n      (else\n        (i32.mul\n          (local.get 0)\n          (call_indirect (type $over-i32)\n            (i32.sub (local.get 0) (i32.const 1))\n            (i32.const 23)\n          )\n        )\n      )\n    )\n  )\n\n  (func $fac-f32 (export \"fac-f32\") (type $over-f32)\n    (if (result f32) (f32.eq (local.get 0) (f32.const 0.0))\n      (then (f32.const 1.0))\n      (else\n        (f32.mul\n          (local.get 0)\n          (call_indirect (type $over-f32)\n            (f32.sub (local.get 0) (f32.const 1.0))\n            (i32.const 24)\n          )\n        )\n      )\n    )\n  )\n\n  (func $fac-f64 (export \"fac-f64\") (type $over-f64)\n    (if (result f64) (f64.eq (local.get 0) (f64.const 0.0))\n      (then (f64.const 1.0))\n      (else\n        (f64.mul\n          (local.get 0)\n          (call_indirect (type $over-f64)\n            (f64.sub (local.get 0) (f64.const 1.0))\n            (i32.const 25)\n          )\n        )\n      )\n    )\n  )\n\n  (func $fib-i32 (export \"fib-i32\") (type $over-i32)\n    (if (result i32) (i32.le_u (local.get 0) (i32.const 1))\n      (then (i32.const 1))\n      (else\n        (i32.add\n          (call_indirect (type $over-i32)\n            (i32.sub (local.get 0) (i32.const 2))\n            (i32.const 26)\n          )\n          (call_indirect (type $over-i32)\n            (i32.sub (local.get 0) (i32.const 1))\n            (i32.const 26)\n          )\n        )\n      )\n    )\n  )\n\n  (func $fib-f32 (export \"fib-f32\") (type $over-f32)\n    (if (result f32) (f32.le (local.get 0) (f32.const 1.0))\n      (then (f32.const 1.0))\n      (else\n        (f32.add\n          (call_indirect (type $over-f32)\n            (f32.sub (local.get 0) (f32.const 2.0))\n            (i32.const 27)\n          )\n          (call_indirect (type $over-f32)\n            (f32.sub (local.get 0) (f32.const 1.0))\n            (i32.const 27)\n          )\n        )\n      )\n    )\n  )\n\n  (func $fib-f64 (export \"fib-f64\") (type $over-f64)\n    (if (result f64) (f64.le (local.get 0) (f64.const 1.0))\n      (then (f64.const 1.0))\n      (else\n        (f64.add\n          (call_indirect (type $over-f64)\n            (f64.sub (local.get 0) (f64.const 2.0))\n            (i32.const 28)\n          )\n          (call_indirect (type $over-f64)\n            (f64.sub (local.get 0) (f64.const 1.0))\n            (i32.const 28)\n          )\n        )\n      )\n    )\n  )\n\n  (func $even (export \"even\") (param i32) (result i32)\n    (if (result i32) (i32.eqz (local.get 0))\n      (then (i32.const 44))\n      (else\n        (call_indirect (type $over-i32)\n          (i32.sub (local.get 0) (i32.const 1))\n          (i32.const 15)\n        )\n      )\n    )\n  )\n  (func $odd (export \"odd\") (param i32) (result i32)\n    (if (result i32) (i32.eqz (local.get 0))\n      (then (i32.const 99))\n      (else\n        (call_indirect (type $over-i32)\n          (i32.sub (local.get 0) (i32.const 1))\n          (i32.const 14)\n        )\n      )\n    )\n  )\n\n  ;; Stack exhaustion\n\n  ;; Implementations are required to have every call consume some abstract\n  ;; resource towards exhausting some abstract finite limit, such that\n  ;; infinitely recursive test cases reliably trap in finite time. This is\n  ;; because otherwise applications could come to depend on it on those\n  ;; implementations and be incompatible with implementations that don't do\n  ;; it (or don't do it under the same circumstances).\n\n  (func $runaway (export \"runaway\") (call_indirect (type $proc) (i32.const 16)))\n\n  (func $mutual-runaway1 (export \"mutual-runaway\") (call_indirect (type $proc) (i32.const 18)))\n  (func $mutual-runaway2 (call_indirect (type $proc) (i32.const 17)))\n\n  ;; As parameter of control constructs and instructions\n\n  (memory 1)\n\n  (func (export \"as-select-first\") (result i32)\n    (select (call_indirect (type $out-i32) (i32.const 0)) (i32.const 2) (i32.const 3))\n  )\n  (func (export \"as-select-mid\") (result i32)\n    (select (i32.const 2) (call_indirect (type $out-i32) (i32.const 0)) (i32.const 3))\n  )\n  (func (export \"as-select-last\") (result i32)\n    (select (i32.const 2) (i32.const 3) (call_indirect (type $out-i32) (i32.const 0)))\n  )\n\n  (func (export \"as-if-condition\") (result i32)\n    (if (result i32) (call_indirect (type $out-i32) (i32.const 0)) (then (i32.const 1)) (else (i32.const 2)))\n  )\n\n  (func (export \"as-br_if-first\") (result i64)\n    (block (result i64) (br_if 0 (call_indirect (type $out-i64) (i32.const 1)) (i32.const 2)))\n  )\n  (func (export \"as-br_if-last\") (result i32)\n    (block (result i32) (br_if 0 (i32.const 2) (call_indirect (type $out-i32) (i32.const 0))))\n  )\n\n  (func (export \"as-br_table-first\") (result f32)\n    (block (result f32) (call_indirect (type $out-f32) (i32.const 2)) (i32.const 2) (br_table 0 0))\n  )\n  (func (export \"as-br_table-last\") (result i32)\n    (block (result i32) (i32.const 2) (call_indirect (type $out-i32) (i32.const 0)) (br_table 0 0))\n  )\n\n  (func (export \"as-store-first\")\n    (call_indirect (type $out-i32) (i32.const 0)) (i32.const 1) (i32.store)\n  )\n  (func (export \"as-store-last\")\n    (i32.const 10) (call_indirect (type $out-f64) (i32.const 3)) (f64.store)\n  )\n\n  (func (export \"as-memory.grow-value\") (result i32)\n    (memory.grow (call_indirect (type $out-i32) (i32.const 0)))\n  )\n  (func (export \"as-return-value\") (result i32)\n    (call_indirect (type $over-i32) (i32.const 1) (i32.const 4)) (return)\n  )\n  (func (export \"as-drop-operand\")\n    (call_indirect (type $over-i64) (i64.const 1) (i32.const 5)) (drop)\n  )\n  (func (export \"as-br-value\") (result f32)\n    (block (result f32) (br 0 (call_indirect (type $over-f32) (f32.const 1) (i32.const 6))))\n  )\n  (func (export \"as-local.set-value\") (result f64)\n    (local f64) (local.set 0 (call_indirect (type $over-f64) (f64.const 1) (i32.const 7))) (local.get 0)\n  )\n  (func (export \"as-local.tee-value\") (result f64)\n    (local f64) (local.tee 0 (call_indirect (type $over-f64) (f64.const 1) (i32.const 7)))\n  )\n  (global $a (mut f64) (f64.const 10.0))\n  (func (export \"as-global.set-value\") (result f64)\n    (global.set $a (call_indirect (type $over-f64) (f64.const 1.0) (i32.const 7)))\n    (global.get $a)\n  )\n\n  (func (export \"as-load-operand\") (result i32)\n    (i32.load (call_indirect (type $out-i32) (i32.const 0)))\n  )\n\n  (func (export \"as-unary-operand\") (result f32)\n    (block (result f32)\n      (f32.sqrt\n        (call_indirect (type $over-f32) (f32.const 0x0p+0) (i32.const 6))\n      )\n    )\n  )\n\n  (func (export \"as-binary-left\") (result i32)\n    (block (result i32)\n      (i32.add\n        (call_indirect (type $over-i32) (i32.const 1) (i32.const 4))\n        (i32.const 10)\n      )\n    )\n  )\n  (func (export \"as-binary-right\") (result i32)\n    (block (result i32)\n      (i32.sub\n        (i32.const 10)\n        (call_indirect (type $over-i32) (i32.const 1) (i32.const 4))\n      )\n    )\n  )\n\n  (func (export \"as-test-operand\") (result i32)\n    (block (result i32)\n      (i32.eqz\n        (call_indirect (type $over-i32) (i32.const 1) (i32.const 4))\n      )\n    )\n  )\n\n  (func (export \"as-compare-left\") (result i32)\n    (block (result i32)\n      (i32.le_u\n        (call_indirect (type $over-i32) (i32.const 1) (i32.const 4))\n        (i32.const 10)\n      )\n    )\n  )\n  (func (export \"as-compare-right\") (result i32)\n    (block (result i32)\n      (i32.ne\n        (i32.const 10)\n        (call_indirect (type $over-i32) (i32.const 1) (i32.const 4))\n      )\n    )\n  )\n\n  (func (export \"as-convert-operand\") (result i64)\n    (block (result i64)\n      (i64.extend_i32_s\n        (call_indirect (type $over-i32) (i32.const 1) (i32.const 4))\n      )\n    )\n  )\n\n)\n\n(assert_return (invoke \"type-i32\") (i32.const 0x132))\n(assert_return (invoke \"type-i64\") (i64.const 0x164))\n(assert_return (invoke \"type-f32\") (f32.const 0xf32))\n(assert_return (invoke \"type-f64\") (f64.const 0xf64))\n(assert_return (invoke \"type-f64-i32\") (f64.const 0xf64) (i32.const 32))\n\n(assert_return (invoke \"type-i32-t64\") (i32.const 0x132))\n\n(assert_return (invoke \"type-index\") (i64.const 100))\n\n(assert_return (invoke \"type-first-i32\") (i32.const 32))\n(assert_return (invoke \"type-first-i64\") (i64.const 64))\n(assert_return (invoke \"type-first-f32\") (f32.const 1.32))\n(assert_return (invoke \"type-first-f64\") (f64.const 1.64))\n\n(assert_return (invoke \"type-second-i32\") (i32.const 32))\n(assert_return (invoke \"type-second-i64\") (i64.const 64))\n(assert_return (invoke \"type-second-f32\") (f32.const 32))\n(assert_return (invoke \"type-second-f64\") (f64.const 64.1))\n\n(assert_return (invoke \"type-all-f64-i32\") (f64.const 0xf64) (i32.const 32))\n(assert_return (invoke \"type-all-i32-f64\") (i32.const 1) (f64.const 2))\n(assert_return (invoke \"type-all-i32-i64\") (i64.const 2) (i32.const 1))\n\n(assert_return (invoke \"dispatch\" (i32.const 5) (i64.const 2)) (i64.const 2))\n(assert_return (invoke \"dispatch\" (i32.const 5) (i64.const 5)) (i64.const 5))\n(assert_return (invoke \"dispatch\" (i32.const 12) (i64.const 5)) (i64.const 120))\n(assert_return (invoke \"dispatch\" (i32.const 13) (i64.const 5)) (i64.const 8))\n(assert_return (invoke \"dispatch\" (i32.const 20) (i64.const 2)) (i64.const 2))\n(assert_trap (invoke \"dispatch\" (i32.const 0) (i64.const 2)) \"indirect call type mismatch\")\n(assert_trap (invoke \"dispatch\" (i32.const 15) (i64.const 2)) \"indirect call type mismatch\")\n(assert_trap (invoke \"dispatch\" (i32.const 32) (i64.const 2)) \"undefined element\")\n(assert_trap (invoke \"dispatch\" (i32.const -1) (i64.const 2)) \"undefined element\")\n(assert_trap (invoke \"dispatch\" (i32.const 1213432423) (i64.const 2)) \"undefined element\")\n\n(assert_return (invoke \"dispatch-structural-i64\" (i32.const 5)) (i64.const 9))\n(assert_return (invoke \"dispatch-structural-i64\" (i32.const 12)) (i64.const 362880))\n(assert_return (invoke \"dispatch-structural-i64\" (i32.const 13)) (i64.const 55))\n(assert_return (invoke \"dispatch-structural-i64\" (i32.const 20)) (i64.const 9))\n(assert_trap (invoke \"dispatch-structural-i64\" (i32.const 11)) \"indirect call type mismatch\")\n(assert_trap (invoke \"dispatch-structural-i64\" (i32.const 22)) \"indirect call type mismatch\")\n\n(assert_return (invoke \"dispatch-structural-i32\" (i32.const 4)) (i32.const 9))\n(assert_return (invoke \"dispatch-structural-i32\" (i32.const 23)) (i32.const 362880))\n(assert_return (invoke \"dispatch-structural-i32\" (i32.const 26)) (i32.const 55))\n(assert_return (invoke \"dispatch-structural-i32\" (i32.const 19)) (i32.const 9))\n(assert_trap (invoke \"dispatch-structural-i32\" (i32.const 9)) \"indirect call type mismatch\")\n(assert_trap (invoke \"dispatch-structural-i32\" (i32.const 21)) \"indirect call type mismatch\")\n\n(assert_return (invoke \"dispatch-structural-f32\" (i32.const 6)) (f32.const 9.0))\n(assert_return (invoke \"dispatch-structural-f32\" (i32.const 24)) (f32.const 362880.0))\n(assert_return (invoke \"dispatch-structural-f32\" (i32.const 27)) (f32.const 55.0))\n(assert_return (invoke \"dispatch-structural-f32\" (i32.const 21)) (f32.const 9.0))\n(assert_trap (invoke \"dispatch-structural-f32\" (i32.const 8)) \"indirect call type mismatch\")\n(assert_trap (invoke \"dispatch-structural-f32\" (i32.const 19)) \"indirect call type mismatch\")\n\n(assert_return (invoke \"dispatch-structural-f64\" (i32.const 7)) (f64.const 9.0))\n(assert_return (invoke \"dispatch-structural-f64\" (i32.const 25)) (f64.const 362880.0))\n(assert_return (invoke \"dispatch-structural-f64\" (i32.const 28)) (f64.const 55.0))\n(assert_return (invoke \"dispatch-structural-f64\" (i32.const 22)) (f64.const 9.0))\n(assert_trap (invoke \"dispatch-structural-f64\" (i32.const 10)) \"indirect call type mismatch\")\n(assert_trap (invoke \"dispatch-structural-f64\" (i32.const 18)) \"indirect call type mismatch\")\n\n(assert_return (invoke \"fac-i64\" (i64.const 0)) (i64.const 1))\n(assert_return (invoke \"fac-i64\" (i64.const 1)) (i64.const 1))\n(assert_return (invoke \"fac-i64\" (i64.const 5)) (i64.const 120))\n(assert_return (invoke \"fac-i64\" (i64.const 25)) (i64.const 7034535277573963776))\n\n(assert_return (invoke \"fac-i32\" (i32.const 0)) (i32.const 1))\n(assert_return (invoke \"fac-i32\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"fac-i32\" (i32.const 5)) (i32.const 120))\n(assert_return (invoke \"fac-i32\" (i32.const 10)) (i32.const 3628800))\n\n(assert_return (invoke \"fac-f32\" (f32.const 0.0)) (f32.const 1.0))\n(assert_return (invoke \"fac-f32\" (f32.const 1.0)) (f32.const 1.0))\n(assert_return (invoke \"fac-f32\" (f32.const 5.0)) (f32.const 120.0))\n(assert_return (invoke \"fac-f32\" (f32.const 10.0)) (f32.const 3628800.0))\n\n(assert_return (invoke \"fac-f64\" (f64.const 0.0)) (f64.const 1.0))\n(assert_return (invoke \"fac-f64\" (f64.const 1.0)) (f64.const 1.0))\n(assert_return (invoke \"fac-f64\" (f64.const 5.0)) (f64.const 120.0))\n(assert_return (invoke \"fac-f64\" (f64.const 10.0)) (f64.const 3628800.0))\n\n(assert_return (invoke \"fib-i64\" (i64.const 0)) (i64.const 1))\n(assert_return (invoke \"fib-i64\" (i64.const 1)) (i64.const 1))\n(assert_return (invoke \"fib-i64\" (i64.const 2)) (i64.const 2))\n(assert_return (invoke \"fib-i64\" (i64.const 5)) (i64.const 8))\n(assert_return (invoke \"fib-i64\" (i64.const 20)) (i64.const 10946))\n\n(assert_return (invoke \"fib-i32\" (i32.const 0)) (i32.const 1))\n(assert_return (invoke \"fib-i32\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"fib-i32\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"fib-i32\" (i32.const 5)) (i32.const 8))\n(assert_return (invoke \"fib-i32\" (i32.const 20)) (i32.const 10946))\n\n(assert_return (invoke \"fib-f32\" (f32.const 0.0)) (f32.const 1.0))\n(assert_return (invoke \"fib-f32\" (f32.const 1.0)) (f32.const 1.0))\n(assert_return (invoke \"fib-f32\" (f32.const 2.0)) (f32.const 2.0))\n(assert_return (invoke \"fib-f32\" (f32.const 5.0)) (f32.const 8.0))\n(assert_return (invoke \"fib-f32\" (f32.const 20.0)) (f32.const 10946.0))\n\n(assert_return (invoke \"fib-f64\" (f64.const 0.0)) (f64.const 1.0))\n(assert_return (invoke \"fib-f64\" (f64.const 1.0)) (f64.const 1.0))\n(assert_return (invoke \"fib-f64\" (f64.const 2.0)) (f64.const 2.0))\n(assert_return (invoke \"fib-f64\" (f64.const 5.0)) (f64.const 8.0))\n(assert_return (invoke \"fib-f64\" (f64.const 20.0)) (f64.const 10946.0))\n\n(assert_return (invoke \"even\" (i32.const 0)) (i32.const 44))\n(assert_return (invoke \"even\" (i32.const 1)) (i32.const 99))\n(assert_return (invoke \"even\" (i32.const 100)) (i32.const 44))\n(assert_return (invoke \"even\" (i32.const 77)) (i32.const 99))\n(assert_return (invoke \"odd\" (i32.const 0)) (i32.const 99))\n(assert_return (invoke \"odd\" (i32.const 1)) (i32.const 44))\n(assert_return (invoke \"odd\" (i32.const 200)) (i32.const 99))\n(assert_return (invoke \"odd\" (i32.const 77)) (i32.const 44))\n\n(assert_exhaustion (invoke \"runaway\") \"call stack exhausted\")\n(assert_exhaustion (invoke \"mutual-runaway\") \"call stack exhausted\")\n\n(assert_return (invoke \"as-select-first\") (i32.const 0x132))\n(assert_return (invoke \"as-select-mid\") (i32.const 2))\n(assert_return (invoke \"as-select-last\") (i32.const 2))\n\n(assert_return (invoke \"as-if-condition\") (i32.const 1))\n\n(assert_return (invoke \"as-br_if-first\") (i64.const 0x164))\n(assert_return (invoke \"as-br_if-last\") (i32.const 2))\n\n(assert_return (invoke \"as-br_table-first\") (f32.const 0xf32))\n(assert_return (invoke \"as-br_table-last\") (i32.const 2))\n\n(assert_return (invoke \"as-store-first\"))\n(assert_return (invoke \"as-store-last\"))\n\n(assert_return (invoke \"as-memory.grow-value\") (i32.const 1))\n(assert_return (invoke \"as-return-value\") (i32.const 1))\n(assert_return (invoke \"as-drop-operand\"))\n(assert_return (invoke \"as-br-value\") (f32.const 1))\n(assert_return (invoke \"as-local.set-value\") (f64.const 1))\n(assert_return (invoke \"as-local.tee-value\") (f64.const 1))\n(assert_return (invoke \"as-global.set-value\") (f64.const 1.0))\n(assert_return (invoke \"as-load-operand\") (i32.const 1))\n\n(assert_return (invoke \"as-unary-operand\") (f32.const 0x0p+0))\n(assert_return (invoke \"as-binary-left\") (i32.const 11))\n(assert_return (invoke \"as-binary-right\") (i32.const 9))\n(assert_return (invoke \"as-test-operand\") (i32.const 0))\n(assert_return (invoke \"as-compare-left\") (i32.const 1))\n(assert_return (invoke \"as-compare-right\") (i32.const 1))\n(assert_return (invoke \"as-convert-operand\") (i64.const 1))\n\n\n;; Multiple tables\n\n(module\n  (type $ii-i (func (param i32 i32) (result i32)))\n\n  (table $t1 funcref (elem $f $g))\n  (table $t2 funcref (elem $h $i $j))\n  (table $t3 4 funcref)\n  (elem (table $t3) (i32.const 0) func $g $h)\n  (elem (table $t3) (i32.const 3) func $z)\n\n  (func $f (type $ii-i) (i32.add (local.get 0) (local.get 1)))\n  (func $g (type $ii-i) (i32.sub (local.get 0) (local.get 1)))\n  (func $h (type $ii-i) (i32.mul (local.get 0) (local.get 1)))\n  (func $i (type $ii-i) (i32.div_u (local.get 0) (local.get 1)))\n  (func $j (type $ii-i) (i32.rem_u (local.get 0) (local.get 1)))\n  (func $z)\n\n  (func (export \"call-1\") (param i32 i32 i32) (result i32)\n    (call_indirect $t1 (type $ii-i) (local.get 0) (local.get 1) (local.get 2))\n  )\n  (func (export \"call-2\") (param i32 i32 i32) (result i32)\n    (call_indirect $t2 (type $ii-i) (local.get 0) (local.get 1) (local.get 2))\n  )\n  (func (export \"call-3\") (param i32 i32 i32) (result i32)\n    (call_indirect $t3 (type $ii-i) (local.get 0) (local.get 1) (local.get 2))\n  )\n)\n\n(assert_return (invoke \"call-1\" (i32.const 2) (i32.const 3) (i32.const 0)) (i32.const 5))\n(assert_return (invoke \"call-1\" (i32.const 2) (i32.const 3) (i32.const 1)) (i32.const -1))\n(assert_trap (invoke \"call-1\" (i32.const 2) (i32.const 3) (i32.const 2)) \"undefined element\")\n\n(assert_return (invoke \"call-2\" (i32.const 2) (i32.const 3) (i32.const 0)) (i32.const 6))\n(assert_return (invoke \"call-2\" (i32.const 2) (i32.const 3) (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"call-2\" (i32.const 2) (i32.const 3) (i32.const 2)) (i32.const 2))\n(assert_trap (invoke \"call-2\" (i32.const 2) (i32.const 3) (i32.const 3)) \"undefined element\")\n\n(assert_return (invoke \"call-3\" (i32.const 2) (i32.const 3) (i32.const 0)) (i32.const -1))\n(assert_return (invoke \"call-3\" (i32.const 2) (i32.const 3) (i32.const 1)) (i32.const 6))\n(assert_trap (invoke \"call-3\" (i32.const 2) (i32.const 3) (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"call-3\" (i32.const 2) (i32.const 3) (i32.const 3)) \"indirect call type mismatch\")\n(assert_trap (invoke \"call-3\" (i32.const 2) (i32.const 3) (i32.const 4)) \"undefined element\")\n\n\n;; Invalid syntax\n\n(assert_malformed\n  (module quote\n    \"(type $sig (func (param i32) (result i32)))\"\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (type $sig) (result i32) (param i32)\"\n    \"    (i32.const 0) (i32.const 0)\"\n    \"  )\"\n    \")\"\n  )\n  \"unexpected token\"\n)\n(assert_malformed\n  (module quote\n    \"(type $sig (func (param i32) (result i32)))\"\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (param i32) (type $sig) (result i32)\"\n    \"    (i32.const 0) (i32.const 0)\"\n    \"  )\"\n    \")\"\n  )\n  \"unexpected token\"\n)\n(assert_malformed\n  (module quote\n    \"(type $sig (func (param i32) (result i32)))\"\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (param i32) (result i32) (type $sig)\"\n    \"    (i32.const 0) (i32.const 0)\"\n    \"  )\"\n    \")\"\n  )\n  \"unexpected token\"\n)\n(assert_malformed\n  (module quote\n    \"(type $sig (func (param i32) (result i32)))\"\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (result i32) (type $sig) (param i32)\"\n    \"    (i32.const 0) (i32.const 0)\"\n    \"  )\"\n    \")\"\n  )\n  \"unexpected token\"\n)\n(assert_malformed\n  (module quote\n    \"(type $sig (func (param i32) (result i32)))\"\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (result i32) (param i32) (type $sig)\"\n    \"    (i32.const 0) (i32.const 0)\"\n    \"  )\"\n    \")\"\n  )\n  \"unexpected token\"\n)\n(assert_malformed\n  (module quote\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (result i32) (param i32) (i32.const 0) (i32.const 0))\"\n    \")\"\n  )\n  \"unexpected token\"\n)\n\n(assert_malformed\n  (module quote\n    \"(table 0 funcref)\"\n    \"(func (call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\"\n  )\n  \"unexpected token\"\n)\n(assert_malformed\n  (module quote\n    \"(type $sig (func))\"\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (type $sig) (result i32) (i32.const 0))\"\n    \")\"\n  )\n  \"inline function type\"\n)\n(assert_malformed\n  (module quote\n    \"(type $sig (func (param i32) (result i32)))\"\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (type $sig) (result i32) (i32.const 0))\"\n    \")\"\n  )\n  \"inline function type\"\n)\n(assert_malformed\n  (module quote\n    \"(type $sig (func (param i32) (result i32)))\"\n    \"(table 0 funcref)\"\n    \"(func\"\n    \"  (call_indirect (type $sig) (param i32) (i32.const 0) (i32.const 0))\"\n    \")\"\n  )\n  \"inline function type\"\n)\n(assert_malformed\n  (module quote\n    \"(type $sig (func (param i32 i32) (result i32)))\"\n    \"(table 0 funcref)\"\n    \"(func (result i32)\"\n    \"  (call_indirect (type $sig) (param i32) (result i32)\"\n    \"    (i32.const 0) (i32.const 0)\"\n    \"  )\"\n    \")\"\n  )\n  \"inline function type\"\n)\n\n;; Invalid typing\n\n(assert_invalid\n  (module\n    (type (func))\n    (func $no-table (call_indirect (type 0) (i32.const 0)))\n  )\n  \"unknown table\"\n)\n\n(assert_invalid\n  (module\n    (type (func))\n    (table 0 funcref)\n    (func $type-void-vs-num (i32.eqz (call_indirect (type 0) (i32.const 0))))\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (type (func (result i64)))\n    (table 0 funcref)\n    (func $type-num-vs-num (i32.eqz (call_indirect (type 0) (i32.const 0))))\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (type (func (param i32)))\n    (table 0 funcref)\n    (func $arity-0-vs-1 (call_indirect (type 0) (i32.const 0)))\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (type (func (param f64 i32)))\n    (table 0 funcref)\n    (func $arity-0-vs-2 (call_indirect (type 0) (i32.const 0)))\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (type (func))\n    (table 0 funcref)\n    (func $arity-1-vs-0 (call_indirect (type 0) (i32.const 1) (i32.const 0)))\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (type (func))\n    (table 0 funcref)\n    (func $arity-2-vs-0\n      (call_indirect (type 0) (f64.const 2) (i32.const 1) (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (type (func (param i32)))\n    (table 0 funcref)\n    (func $type-func-void-vs-i32 (call_indirect (type 0) (i32.const 1) (nop)))\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (type (func (param i32)))\n    (table 0 funcref)\n    (func $type-func-num-vs-i32 (call_indirect (type 0) (i32.const 0) (i64.const 1)))\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (type (func (param i32 i32)))\n    (table 0 funcref)\n    (func $type-first-void-vs-num\n      (call_indirect (type 0) (nop) (i32.const 1) (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (type (func (param i32 i32)))\n    (table 0 funcref)\n    (func $type-second-void-vs-num\n      (call_indirect (type 0) (i32.const 1) (nop) (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (type (func (param i32 f64)))\n    (table 0 funcref)\n    (func $type-first-num-vs-num\n      (call_indirect (type 0) (f64.const 1) (i32.const 1) (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (type (func (param f64 i32)))\n    (table 0 funcref)\n    (func $type-second-num-vs-num\n      (call_indirect (type 0) (i32.const 1) (f64.const 1) (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (func $f (param i32))\n    (type $sig (func (param i32)))\n    (table funcref (elem $f))\n    (func $type-first-empty-in-block\n      (block\n        (call_indirect (type $sig) (i32.const 0))\n      )\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (func $f (param i32 i32))\n    (type $sig (func (param i32 i32)))\n    (table funcref (elem $f))\n    (func $type-second-empty-in-block\n      (block\n        (call_indirect (type $sig) (i32.const 0) (i32.const 0))\n      )\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (func $f (param i32))\n    (type $sig (func (param i32)))\n    (table funcref (elem $f))\n    (func $type-first-empty-in-loop\n      (loop\n        (call_indirect (type $sig) (i32.const 0))\n      )\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (func $f (param i32 i32))\n    (type $sig (func (param i32 i32)))\n    (table funcref (elem $f))\n    (func $type-second-empty-in-loop\n      (loop\n        (call_indirect (type $sig) (i32.const 0) (i32.const 0))\n      )\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (func $f (param i32))\n    (type $sig (func (param i32)))\n    (table funcref (elem $f))\n    (func $type-first-empty-in-then\n      (i32.const 0) (i32.const 0)\n      (if\n        (then\n          (call_indirect (type $sig) (i32.const 0))\n        )\n      )\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (func $f (param i32 i32))\n    (type $sig (func (param i32 i32)))\n    (table funcref (elem $f))\n    (func $type-second-empty-in-then\n      (i32.const 0) (i32.const 0)\n      (if\n        (then\n          (call_indirect (type $sig) (i32.const 0) (i32.const 0))\n        )\n      )\n    )\n  )\n  \"type mismatch\"\n)\n\n\n;; Unbound type\n\n(assert_invalid\n  (module\n    (table 0 funcref)\n    (func $unbound-type (call_indirect (type 1) (i32.const 0)))\n  )\n  \"unknown type\"\n)\n(assert_invalid\n  (module\n    (table 0 funcref)\n    (func $large-type (call_indirect (type 1012321300) (i32.const 0)))\n  )\n  \"unknown type\"\n)\n\n\n;; Unbound function in table\n\n(assert_invalid\n  (module (table funcref (elem 0 0)))\n  \"unknown function\"\n)\n\n\n\n\n;; Flat syntax\n\n(module\n  (table 1 funcref)\n  (func unreachable call_indirect)\n  (func unreachable call_indirect nop)\n  (func unreachable call_indirect call_indirect)\n  (func unreachable call_indirect (call_indirect))\n  (func unreachable call_indirect call_indirect call_indirect)\n  (func unreachable call_indirect (result))\n  (func unreachable call_indirect (result) (result))\n  (func unreachable call_indirect (result) (result) call_indirect)\n  (func unreachable call_indirect (result) (result) call_indirect (result))\n  (func (result i32) unreachable call_indirect select)\n  (func (result i32) unreachable call_indirect select call_indirect)\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/endianness64.wast",
    "content": "(module\n  (memory i64 1)\n\n  ;; Stores an i16 value in little-endian-format\n  (func $i16_store_little (param $address i64) (param $value i32)\n    (i32.store8 (local.get $address) (local.get $value))\n    (i32.store8 (i64.add (local.get $address) (i64.const 1)) (i32.shr_u (local.get $value) (i32.const 8)))\n  )\n\n  ;; Stores an i32 value in little-endian format\n  (func $i32_store_little (param $address i64) (param $value i32)\n    (call $i16_store_little (local.get $address) (local.get $value))\n    (call $i16_store_little (i64.add (local.get $address) (i64.const 2)) (i32.shr_u (local.get $value) (i32.const 16)))\n  )\n\n  ;; Stores an i64 value in little-endian format\n  (func $i64_store_little (param $address i64) (param $value i64)\n    (call $i32_store_little (local.get $address) (i32.wrap_i64 (local.get $value)))\n    (call $i32_store_little (i64.add (local.get $address) (i64.const 4)) (i32.wrap_i64 (i64.shr_u (local.get $value) (i64.const 32))))\n  )\n\n  ;; Loads an i16 value in little-endian format\n  (func $i16_load_little (param $address i64) (result i32)\n    (i32.or\n      (i32.load8_u (local.get $address))\n      (i32.shl (i32.load8_u (i64.add (local.get $address) (i64.const 1))) (i32.const 8))\n    )\n  )\n\n  ;; Loads an i32 value in little-endian format\n  (func $i32_load_little (param $address i64) (result i32)\n    (i32.or\n      (call $i16_load_little (local.get $address))\n      (i32.shl (call $i16_load_little (i64.add (local.get $address) (i64.const 2))) (i32.const 16))\n    )\n  )\n\n  ;; Loads an i64 value in little-endian format\n  (func $i64_load_little (param $address i64) (result i64)\n    (i64.or\n      (i64.extend_i32_u (call $i32_load_little (local.get $address)))\n      (i64.shl (i64.extend_i32_u (call $i32_load_little (i64.add (local.get $address) (i64.const 4)))) (i64.const 32))\n    )\n  )\n\n  (func (export \"i32_load16_s\") (param $value i32) (result i32)\n    (call $i16_store_little (i64.const 0) (local.get $value))\n    (i32.load16_s (i64.const 0))\n  )\n\n  (func (export \"i32_load16_u\") (param $value i32) (result i32)\n    (call $i16_store_little (i64.const 0) (local.get $value))\n    (i32.load16_u (i64.const 0))\n  )\n\n  (func (export \"i32_load\") (param $value i32) (result i32)\n    (call $i32_store_little (i64.const 0) (local.get $value))\n    (i32.load (i64.const 0))\n  )\n\n  (func (export \"i64_load16_s\") (param $value i64) (result i64)\n    (call $i16_store_little (i64.const 0) (i32.wrap_i64 (local.get $value)))\n    (i64.load16_s (i64.const 0))\n  )\n\n  (func (export \"i64_load16_u\") (param $value i64) (result i64)\n    (call $i16_store_little (i64.const 0) (i32.wrap_i64 (local.get $value)))\n    (i64.load16_u (i64.const 0))\n  )\n\n  (func (export \"i64_load32_s\") (param $value i64) (result i64)\n    (call $i32_store_little (i64.const 0) (i32.wrap_i64 (local.get $value)))\n    (i64.load32_s (i64.const 0))\n  )\n\n  (func (export \"i64_load32_u\") (param $value i64) (result i64)\n    (call $i32_store_little (i64.const 0) (i32.wrap_i64 (local.get $value)))\n    (i64.load32_u (i64.const 0))\n  )\n\n  (func (export \"i64_load\") (param $value i64) (result i64)\n    (call $i64_store_little (i64.const 0) (local.get $value))\n    (i64.load (i64.const 0))\n  )\n\n  (func (export \"f32_load\") (param $value f32) (result f32)\n    (call $i32_store_little (i64.const 0) (i32.reinterpret_f32 (local.get $value)))\n    (f32.load (i64.const 0))\n  )\n\n  (func (export \"f64_load\") (param $value f64) (result f64)\n    (call $i64_store_little (i64.const 0) (i64.reinterpret_f64 (local.get $value)))\n    (f64.load (i64.const 0))\n  )\n\n\n  (func (export \"i32_store16\") (param $value i32) (result i32)\n    (i32.store16 (i64.const 0) (local.get $value))\n    (call $i16_load_little (i64.const 0))\n  )\n\n  (func (export \"i32_store\") (param $value i32) (result i32)\n    (i32.store (i64.const 0) (local.get $value))\n    (call $i32_load_little (i64.const 0))\n  )\n\n  (func (export \"i64_store16\") (param $value i64) (result i64)\n    (i64.store16 (i64.const 0) (local.get $value))\n    (i64.extend_i32_u (call $i16_load_little (i64.const 0)))\n  )\n\n  (func (export \"i64_store32\") (param $value i64) (result i64)\n    (i64.store32 (i64.const 0) (local.get $value))\n    (i64.extend_i32_u (call $i32_load_little (i64.const 0)))\n  )\n\n  (func (export \"i64_store\") (param $value i64) (result i64)\n    (i64.store (i64.const 0) (local.get $value))\n    (call $i64_load_little (i64.const 0))\n  )\n\n  (func (export \"f32_store\") (param $value f32) (result f32)\n    (f32.store (i64.const 0) (local.get $value))\n    (f32.reinterpret_i32 (call $i32_load_little (i64.const 0)))\n  )\n\n  (func (export \"f64_store\") (param $value f64) (result f64)\n    (f64.store (i64.const 0) (local.get $value))\n    (f64.reinterpret_i64 (call $i64_load_little (i64.const 0)))\n  )\n)\n\n(assert_return (invoke \"i32_load16_s\" (i32.const -1)) (i32.const -1))\n(assert_return (invoke \"i32_load16_s\" (i32.const -4242)) (i32.const -4242))\n(assert_return (invoke \"i32_load16_s\" (i32.const 42)) (i32.const 42))\n(assert_return (invoke \"i32_load16_s\" (i32.const 0x3210)) (i32.const 0x3210))\n\n(assert_return (invoke \"i32_load16_u\" (i32.const -1)) (i32.const 0xFFFF))\n(assert_return (invoke \"i32_load16_u\" (i32.const -4242)) (i32.const 61294))\n(assert_return (invoke \"i32_load16_u\" (i32.const 42)) (i32.const 42))\n(assert_return (invoke \"i32_load16_u\" (i32.const 0xCAFE)) (i32.const 0xCAFE))\n\n(assert_return (invoke \"i32_load\" (i32.const -1)) (i32.const -1))\n(assert_return (invoke \"i32_load\" (i32.const -42424242)) (i32.const -42424242))\n(assert_return (invoke \"i32_load\" (i32.const 42424242)) (i32.const 42424242))\n(assert_return (invoke \"i32_load\" (i32.const 0xABAD1DEA)) (i32.const 0xABAD1DEA))\n\n(assert_return (invoke \"i64_load16_s\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load16_s\" (i64.const -4242)) (i64.const -4242))\n(assert_return (invoke \"i64_load16_s\" (i64.const 42)) (i64.const 42))\n(assert_return (invoke \"i64_load16_s\" (i64.const 0x3210)) (i64.const 0x3210))\n\n(assert_return (invoke \"i64_load16_u\" (i64.const -1)) (i64.const 0xFFFF))\n(assert_return (invoke \"i64_load16_u\" (i64.const -4242)) (i64.const 61294))\n(assert_return (invoke \"i64_load16_u\" (i64.const 42)) (i64.const 42))\n(assert_return (invoke \"i64_load16_u\" (i64.const 0xCAFE)) (i64.const 0xCAFE))\n\n(assert_return (invoke \"i64_load32_s\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load32_s\" (i64.const -42424242)) (i64.const -42424242))\n(assert_return (invoke \"i64_load32_s\" (i64.const 42424242)) (i64.const 42424242))\n(assert_return (invoke \"i64_load32_s\" (i64.const 0x12345678)) (i64.const 0x12345678))\n\n(assert_return (invoke \"i64_load32_u\" (i64.const -1)) (i64.const 0xFFFFFFFF))\n(assert_return (invoke \"i64_load32_u\" (i64.const -42424242)) (i64.const 4252543054))\n(assert_return (invoke \"i64_load32_u\" (i64.const 42424242)) (i64.const 42424242))\n(assert_return (invoke \"i64_load32_u\" (i64.const 0xABAD1DEA)) (i64.const 0xABAD1DEA))\n\n(assert_return (invoke \"i64_load\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load\" (i64.const -42424242)) (i64.const -42424242))\n(assert_return (invoke \"i64_load\" (i64.const 0xABAD1DEA)) (i64.const 0xABAD1DEA))\n(assert_return (invoke \"i64_load\" (i64.const 0xABADCAFEDEAD1DEA)) (i64.const 0xABADCAFEDEAD1DEA))\n\n(assert_return (invoke \"f32_load\" (f32.const -1)) (f32.const -1))\n(assert_return (invoke \"f32_load\" (f32.const 1234e-5)) (f32.const 1234e-5))\n(assert_return (invoke \"f32_load\" (f32.const 4242.4242)) (f32.const 4242.4242))\n(assert_return (invoke \"f32_load\" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127))\n\n(assert_return (invoke \"f64_load\" (f64.const -1)) (f64.const -1))\n(assert_return (invoke \"f64_load\" (f64.const 123456789e-5)) (f64.const 123456789e-5))\n(assert_return (invoke \"f64_load\" (f64.const 424242.424242)) (f64.const 424242.424242))\n(assert_return (invoke \"f64_load\" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023))\n\n\n(assert_return (invoke \"i32_store16\" (i32.const -1)) (i32.const 0xFFFF))\n(assert_return (invoke \"i32_store16\" (i32.const -4242)) (i32.const 61294))\n(assert_return (invoke \"i32_store16\" (i32.const 42)) (i32.const 42))\n(assert_return (invoke \"i32_store16\" (i32.const 0xCAFE)) (i32.const 0xCAFE))\n\n(assert_return (invoke \"i32_store\" (i32.const -1)) (i32.const -1))\n(assert_return (invoke \"i32_store\" (i32.const -4242)) (i32.const -4242))\n(assert_return (invoke \"i32_store\" (i32.const 42424242)) (i32.const 42424242))\n(assert_return (invoke \"i32_store\" (i32.const 0xDEADCAFE)) (i32.const 0xDEADCAFE))\n\n(assert_return (invoke \"i64_store16\" (i64.const -1)) (i64.const 0xFFFF))\n(assert_return (invoke \"i64_store16\" (i64.const -4242)) (i64.const 61294))\n(assert_return (invoke \"i64_store16\" (i64.const 42)) (i64.const 42))\n(assert_return (invoke \"i64_store16\" (i64.const 0xCAFE)) (i64.const 0xCAFE))\n\n(assert_return (invoke \"i64_store32\" (i64.const -1)) (i64.const 0xFFFFFFFF))\n(assert_return (invoke \"i64_store32\" (i64.const -4242)) (i64.const 4294963054))\n(assert_return (invoke \"i64_store32\" (i64.const 42424242)) (i64.const 42424242))\n(assert_return (invoke \"i64_store32\" (i64.const 0xDEADCAFE)) (i64.const 0xDEADCAFE))\n\n(assert_return (invoke \"i64_store\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_store\" (i64.const -42424242)) (i64.const -42424242))\n(assert_return (invoke \"i64_store\" (i64.const 0xABAD1DEA)) (i64.const 0xABAD1DEA))\n(assert_return (invoke \"i64_store\" (i64.const 0xABADCAFEDEAD1DEA)) (i64.const 0xABADCAFEDEAD1DEA))\n\n(assert_return (invoke \"f32_store\" (f32.const -1)) (f32.const -1))\n(assert_return (invoke \"f32_store\" (f32.const 1234e-5)) (f32.const 1234e-5))\n(assert_return (invoke \"f32_store\" (f32.const 4242.4242)) (f32.const 4242.4242))\n(assert_return (invoke \"f32_store\" (f32.const 0x1.fffffep+127)) (f32.const 0x1.fffffep+127))\n\n(assert_return (invoke \"f64_store\" (f64.const -1)) (f64.const -1))\n(assert_return (invoke \"f64_store\" (f64.const 123456789e-5)) (f64.const 123456789e-5))\n(assert_return (invoke \"f64_store\" (f64.const 424242.424242)) (f64.const 424242.424242))\n(assert_return (invoke \"f64_store\" (f64.const 0x1.fffffffffffffp+1023)) (f64.const 0x1.fffffffffffffp+1023))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/float_memory64.wast",
    "content": ";; Test that floating-point load and store are bit-preserving.\n\n;; Test that load and store do not canonicalize NaNs as x87 does.\n\n(module\n  (memory i64 (data \"\\00\\00\\a0\\7f\"))\n\n  (func (export \"f32.load\") (result f32) (f32.load (i64.const 0)))\n  (func (export \"i32.load\") (result i32) (i32.load (i64.const 0)))\n  (func (export \"f32.store\") (f32.store (i64.const 0) (f32.const nan:0x200000)))\n  (func (export \"i32.store\") (i32.store (i64.const 0) (i32.const 0x7fa00000)))\n  (func (export \"reset\") (i32.store (i64.const 0) (i32.const 0)))\n)\n\n(assert_return (invoke \"i32.load\") (i32.const 0x7fa00000))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x200000))\n(invoke \"reset\")\n(assert_return (invoke \"i32.load\") (i32.const 0x0))\n(assert_return (invoke \"f32.load\") (f32.const 0.0))\n(invoke \"f32.store\")\n(assert_return (invoke \"i32.load\") (i32.const 0x7fa00000))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x200000))\n(invoke \"reset\")\n(assert_return (invoke \"i32.load\") (i32.const 0x0))\n(assert_return (invoke \"f32.load\") (f32.const 0.0))\n(invoke \"i32.store\")\n(assert_return (invoke \"i32.load\") (i32.const 0x7fa00000))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x200000))\n\n(module\n  (memory i64 (data \"\\00\\00\\00\\00\\00\\00\\f4\\7f\"))\n\n  (func (export \"f64.load\") (result f64) (f64.load (i64.const 0)))\n  (func (export \"i64.load\") (result i64) (i64.load (i64.const 0)))\n  (func (export \"f64.store\") (f64.store (i64.const 0) (f64.const nan:0x4000000000000)))\n  (func (export \"i64.store\") (i64.store (i64.const 0) (i64.const 0x7ff4000000000000)))\n  (func (export \"reset\") (i64.store (i64.const 0) (i64.const 0)))\n)\n\n(assert_return (invoke \"i64.load\") (i64.const 0x7ff4000000000000))\n(assert_return (invoke \"f64.load\") (f64.const nan:0x4000000000000))\n(invoke \"reset\")\n(assert_return (invoke \"i64.load\") (i64.const 0x0))\n(assert_return (invoke \"f64.load\") (f64.const 0.0))\n(invoke \"f64.store\")\n(assert_return (invoke \"i64.load\") (i64.const 0x7ff4000000000000))\n(assert_return (invoke \"f64.load\") (f64.const nan:0x4000000000000))\n(invoke \"reset\")\n(assert_return (invoke \"i64.load\") (i64.const 0x0))\n(assert_return (invoke \"f64.load\") (f64.const 0.0))\n(invoke \"i64.store\")\n(assert_return (invoke \"i64.load\") (i64.const 0x7ff4000000000000))\n(assert_return (invoke \"f64.load\") (f64.const nan:0x4000000000000))\n\n;; Test that unaligned load and store do not canonicalize NaNs.\n\n(module\n  (memory i64 (data \"\\00\\00\\00\\a0\\7f\"))\n\n  (func (export \"f32.load\") (result f32) (f32.load (i64.const 1)))\n  (func (export \"i32.load\") (result i32) (i32.load (i64.const 1)))\n  (func (export \"f32.store\") (f32.store (i64.const 1) (f32.const nan:0x200000)))\n  (func (export \"i32.store\") (i32.store (i64.const 1) (i32.const 0x7fa00000)))\n  (func (export \"reset\") (i32.store (i64.const 1) (i32.const 0)))\n)\n\n(assert_return (invoke \"i32.load\") (i32.const 0x7fa00000))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x200000))\n(invoke \"reset\")\n(assert_return (invoke \"i32.load\") (i32.const 0x0))\n(assert_return (invoke \"f32.load\") (f32.const 0.0))\n(invoke \"f32.store\")\n(assert_return (invoke \"i32.load\") (i32.const 0x7fa00000))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x200000))\n(invoke \"reset\")\n(assert_return (invoke \"i32.load\") (i32.const 0x0))\n(assert_return (invoke \"f32.load\") (f32.const 0.0))\n(invoke \"i32.store\")\n(assert_return (invoke \"i32.load\") (i32.const 0x7fa00000))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x200000))\n\n(module\n  (memory i64 (data \"\\00\\00\\00\\00\\00\\00\\00\\f4\\7f\"))\n\n  (func (export \"f64.load\") (result f64) (f64.load (i64.const 1)))\n  (func (export \"i64.load\") (result i64) (i64.load (i64.const 1)))\n  (func (export \"f64.store\") (f64.store (i64.const 1) (f64.const nan:0x4000000000000)))\n  (func (export \"i64.store\") (i64.store (i64.const 1) (i64.const 0x7ff4000000000000)))\n  (func (export \"reset\") (i64.store (i64.const 1) (i64.const 0)))\n)\n\n(assert_return (invoke \"i64.load\") (i64.const 0x7ff4000000000000))\n(assert_return (invoke \"f64.load\") (f64.const nan:0x4000000000000))\n(invoke \"reset\")\n(assert_return (invoke \"i64.load\") (i64.const 0x0))\n(assert_return (invoke \"f64.load\") (f64.const 0.0))\n(invoke \"f64.store\")\n(assert_return (invoke \"i64.load\") (i64.const 0x7ff4000000000000))\n(assert_return (invoke \"f64.load\") (f64.const nan:0x4000000000000))\n(invoke \"reset\")\n(assert_return (invoke \"i64.load\") (i64.const 0x0))\n(assert_return (invoke \"f64.load\") (f64.const 0.0))\n(invoke \"i64.store\")\n(assert_return (invoke \"i64.load\") (i64.const 0x7ff4000000000000))\n(assert_return (invoke \"f64.load\") (f64.const nan:0x4000000000000))\n\n;; Test that load and store do not canonicalize NaNs as some JS engines do.\n\n(module\n  (memory i64 (data \"\\01\\00\\d0\\7f\"))\n\n  (func (export \"f32.load\") (result f32) (f32.load (i64.const 0)))\n  (func (export \"i32.load\") (result i32) (i32.load (i64.const 0)))\n  (func (export \"f32.store\") (f32.store (i64.const 0) (f32.const nan:0x500001)))\n  (func (export \"i32.store\") (i32.store (i64.const 0) (i32.const 0x7fd00001)))\n  (func (export \"reset\") (i32.store (i64.const 0) (i32.const 0)))\n)\n\n(assert_return (invoke \"i32.load\") (i32.const 0x7fd00001))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x500001))\n(invoke \"reset\")\n(assert_return (invoke \"i32.load\") (i32.const 0x0))\n(assert_return (invoke \"f32.load\") (f32.const 0.0))\n(invoke \"f32.store\")\n(assert_return (invoke \"i32.load\") (i32.const 0x7fd00001))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x500001))\n(invoke \"reset\")\n(assert_return (invoke \"i32.load\") (i32.const 0x0))\n(assert_return (invoke \"f32.load\") (f32.const 0.0))\n(invoke \"i32.store\")\n(assert_return (invoke \"i32.load\") (i32.const 0x7fd00001))\n(assert_return (invoke \"f32.load\") (f32.const nan:0x500001))\n\n(module\n  (memory i64 (data \"\\01\\00\\00\\00\\00\\00\\fc\\7f\"))\n\n  (func (export \"f64.load\") (result f64) (f64.load (i64.const 0)))\n  (func (export \"i64.load\") (result i64) (i64.load (i64.const 0)))\n  (func (export \"f64.store\") (f64.store (i64.const 0) (f64.const nan:0xc000000000001)))\n  (func (export \"i64.store\") (i64.store (i64.const 0) (i64.const 0x7ffc000000000001)))\n  (func (export \"reset\") (i64.store (i64.const 0) (i64.const 0)))\n)\n\n(assert_return (invoke \"i64.load\") (i64.const 0x7ffc000000000001))\n(assert_return (invoke \"f64.load\") (f64.const nan:0xc000000000001))\n(invoke \"reset\")\n(assert_return (invoke \"i64.load\") (i64.const 0x0))\n(assert_return (invoke \"f64.load\") (f64.const 0.0))\n(invoke \"f64.store\")\n(assert_return (invoke \"i64.load\") (i64.const 0x7ffc000000000001))\n(assert_return (invoke \"f64.load\") (f64.const nan:0xc000000000001))\n(invoke \"reset\")\n(assert_return (invoke \"i64.load\") (i64.const 0x0))\n(assert_return (invoke \"f64.load\") (f64.const 0.0))\n(invoke \"i64.store\")\n(assert_return (invoke \"i64.load\") (i64.const 0x7ffc000000000001))\n(assert_return (invoke \"f64.load\") (f64.const nan:0xc000000000001))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/imports.wast",
    "content": ";; Auxiliary module to import from\n\n(module\n  (func (export \"func\"))\n  (func (export \"func-i32\") (param i32))\n  (func (export \"func-f32\") (param f32))\n  (func (export \"func->i32\") (result i32) (i32.const 22))\n  (func (export \"func->f32\") (result f32) (f32.const 11))\n  (func (export \"func-i32->i32\") (param i32) (result i32) (local.get 0))\n  (func (export \"func-i64->i64\") (param i64) (result i64) (local.get 0))\n  (global (export \"global-i32\") i32 (i32.const 55))\n  (global (export \"global-f32\") f32 (f32.const 44))\n  (global (export \"global-mut-i64\") (mut i64) (i64.const 66))\n  (table (export \"table-10-inf\") 10 funcref)\n  (table (export \"table-10-20\") 10 20 funcref)\n  (table (export \"table64-10-inf\") i64 10 funcref)\n  (table (export \"table64-10-20\") i64 10 20 funcref)\n  (memory (export \"memory-2-inf\") 2)\n  (memory (export \"memory-2-4\") 2 4)\n  (memory (export \"memory64-2-inf\") i64 2)\n  (memory (export \"memory64-2-4\") i64 2 4)\n  (tag (export \"tag\"))\n  (tag $tag-i32 (param i32))\n  (export \"tag-i32\" (tag $tag-i32))\n  (tag (export \"tag-f32\") (param f32))\n)\n\n(register \"test\")\n\n\n;; Functions\n\n(module\n  (type $func_i32 (func (param i32)))\n  (type $func_i64 (func (param i64)))\n  (type $func_f32 (func (param f32)))\n  (type $func_f64 (func (param f64)))\n\n  (import \"spectest\" \"print_i32\" (func (param i32)))\n  (func (import \"spectest\" \"print_i64\") (param i64))\n  (import \"spectest\" \"print_i32\" (func $print_i32 (param i32)))\n  (import \"spectest\" \"print_i64\" (func $print_i64 (param i64)))\n  (import \"spectest\" \"print_f32\" (func $print_f32 (param f32)))\n  (import \"spectest\" \"print_f64\" (func $print_f64 (param f64)))\n  (import \"spectest\" \"print_i32_f32\" (func $print_i32_f32 (param i32 f32)))\n  (import \"spectest\" \"print_f64_f64\" (func $print_f64_f64 (param f64 f64)))\n  (func $print_i32-2 (import \"spectest\" \"print_i32\") (param i32))\n  (func $print_f64-2 (import \"spectest\" \"print_f64\") (param f64))\n  (import \"test\" \"func-i64->i64\" (func $i64->i64 (param i64) (result i64)))\n\n  (tag (import \"test\" \"tag-i32\") (param i32))\n  (import \"test\" \"tag-f32\" (tag (param f32)))\n\n  (func (export \"p1\") (import \"spectest\" \"print_i32\") (param i32))\n  (func $p (export \"p2\") (import \"spectest\" \"print_i32\") (param i32))\n  (func (export \"p3\") (export \"p4\") (import \"spectest\" \"print_i32\") (param i32))\n  (func (export \"p5\") (import \"spectest\" \"print_i32\") (type 0))\n  (func (export \"p6\") (import \"spectest\" \"print_i32\") (type 0) (param i32) (result))\n\n  (import \"spectest\" \"print_i32\" (func (type $forward)))\n  (func (import \"spectest\" \"print_i32\") (type $forward))\n  (type $forward (func (param i32)))\n\n  (table funcref (elem $print_i32 $print_f64))\n\n  (func (export \"print32\") (param $i i32)\n    (local $x f32)\n    (local.set $x (f32.convert_i32_s (local.get $i)))\n    (call 0 (local.get $i))\n    (call $print_i32_f32\n      (i32.add (local.get $i) (i32.const 1))\n      (f32.const 42)\n    )\n    (call $print_i32 (local.get $i))\n    (call $print_i32-2 (local.get $i))\n    (call $print_f32 (local.get $x))\n    (call_indirect (type $func_i32) (local.get $i) (i32.const 0))\n  )\n\n  (func (export \"print64\") (param $i i64)\n    (local $x f64)\n    (local.set $x (f64.convert_i64_s (call $i64->i64 (local.get $i))))\n    (call 1 (local.get $i))\n    (call $print_f64_f64\n      (f64.add (local.get $x) (f64.const 1))\n      (f64.const 53)\n    )\n    (call $print_i64 (local.get $i))\n    (call $print_f64 (local.get $x))\n    (call $print_f64-2 (local.get $x))\n    (call_indirect (type $func_f64) (local.get $x) (i32.const 1))\n  )\n)\n\n(assert_return (invoke \"print32\" (i32.const 13)))\n(assert_return (invoke \"print64\" (i64.const 24)))\n\n(assert_invalid\n  (module \n    (type (func (result i32)))\n    (import \"test\" \"func\" (func (type 1)))\n  )\n  \"unknown type\"\n)\n\n;; Export sharing name with import\n(module\n  (import \"spectest\" \"print_i32\" (func $imported_print (param i32)))\n  (func (export \"print_i32\") (param $i i32)\n    (call $imported_print (local.get $i))\n  )\n)\n\n(assert_return (invoke \"print_i32\" (i32.const 13)))\n\n;; Export sharing name with import\n(module\n  (import \"spectest\" \"print_i32\" (func $imported_print (param i32)))\n  (func (export \"print_i32\") (param $i i32) (param $j i32) (result i32)\n    (i32.add (local.get $i) (local.get $j))\n  )\n)\n\n(assert_return (invoke \"print_i32\" (i32.const 5) (i32.const 11)) (i32.const 16))\n\n(module (import \"test\" \"func\" (func)))\n(module (import \"test\" \"func-i32\" (func (param i32))))\n(module (import \"test\" \"func-f32\" (func (param f32))))\n(module (import \"test\" \"func->i32\" (func (result i32))))\n(module (import \"test\" \"func->f32\" (func (result f32))))\n(module (import \"test\" \"func-i32->i32\" (func (param i32) (result i32))))\n(module (import \"test\" \"func-i64->i64\" (func (param i64) (result i64))))\n\n(assert_unlinkable\n  (module (import \"test\" \"unknown\" (func)))\n  \"unknown import\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"unknown\" (func)))\n  \"unknown import\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"func\" (func (param i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func\" (func (result i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func\" (func (param i32) (result i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func-i32\" (func)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func-i32\" (func (result i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func-i32\" (func (param f32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func-i32\" (func (param i64))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func-i32\" (func (param i32) (result i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func->i32\" (func)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func->i32\" (func (param i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func->i32\" (func (result f32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func->i32\" (func (result i64))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func->i32\" (func (param i32) (result i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func-i32->i32\" (func)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func-i32->i32\" (func (param i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"func-i32->i32\" (func (result i32))))\n  \"incompatible import type\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"global-i32\" (func (result i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table-10-inf\" (func)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (func)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"tag\" (func)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"global_i32\" (func)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"table\" (func)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"memory\" (func)))\n  \"incompatible import type\"\n)\n\n(assert_unlinkable\n  (module (tag (import \"test\" \"unknown\")))\n  \"unknown import\"\n)\n(assert_unlinkable\n  (module (tag (import \"test\" \"tag\") (param f32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (tag (import \"test\" \"tag-i32\")))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (tag (import \"test\" \"tag-i32\") (param f32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (tag (import \"test\" \"func-i32\") (param f32)))\n  \"incompatible import type\"\n)\n\n\n;; Globals\n\n(module\n  (import \"spectest\" \"global_i32\" (global i32))\n  (global (import \"spectest\" \"global_i32\") i32)\n\n  (import \"spectest\" \"global_i32\" (global $x i32))\n  (global $y (import \"spectest\" \"global_i32\") i32)\n\n  (import \"spectest\" \"global_i64\" (global i64))\n  (import \"spectest\" \"global_f32\" (global f32))\n  (import \"spectest\" \"global_f64\" (global f64))\n\n  (func (export \"get-0\") (result i32) (global.get 0))\n  (func (export \"get-1\") (result i32) (global.get 1))\n  (func (export \"get-x\") (result i32) (global.get $x))\n  (func (export \"get-y\") (result i32) (global.get $y))\n  (func (export \"get-4\") (result i64) (global.get 4))\n  (func (export \"get-5\") (result f32) (global.get 5))\n  (func (export \"get-6\") (result f64) (global.get 6))\n)\n\n(assert_return (invoke \"get-0\") (i32.const 666))\n(assert_return (invoke \"get-1\") (i32.const 666))\n(assert_return (invoke \"get-x\") (i32.const 666))\n(assert_return (invoke \"get-y\") (i32.const 666))\n(assert_return (invoke \"get-4\") (i64.const 666))\n(assert_return (invoke \"get-5\") (f32.const 666.6))\n(assert_return (invoke \"get-6\") (f64.const 666.6))\n\n(module (import \"test\" \"global-i32\" (global i32)))\n(module (import \"test\" \"global-f32\" (global f32)))\n(module (import \"test\" \"global-mut-i64\" (global (mut i64))))\n\n(assert_unlinkable\n  (module (import \"test\" \"unknown\" (global i32)))\n  \"unknown import\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"unknown\" (global i32)))\n  \"unknown import\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"global-i32\" (global i64)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-i32\" (global f32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-i32\" (global f64)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-i32\" (global (mut i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-f32\" (global i32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-f32\" (global i64)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-f32\" (global f64)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-f32\" (global (mut f32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-mut-i64\" (global (mut i32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-mut-i64\" (global (mut f32))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-mut-i64\" (global (mut f64))))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-mut-i64\" (global i64)))\n  \"incompatible import type\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"func\" (global i32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table-10-inf\" (global i32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (global i32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"print_i32\" (global i32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"table\" (global i32)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"memory\" (global i32)))\n  \"incompatible import type\"\n)\n\n\n;; Tables\n\n(module\n  (type (func (result i32)))\n  (import \"spectest\" \"table\" (table $tab 10 20 funcref))\n  (import \"test\" \"table64-10-inf\" (table $tab64 i64 10 funcref))\n  (elem (table $tab) (i32.const 1) func $f $g)\n\n  (func (export \"call\") (param i32) (result i32)\n    (call_indirect $tab (type 0) (local.get 0))\n  )\n  (func $f (result i32) (i32.const 11))\n  (func $g (result i32) (i32.const 22))\n)\n\n(assert_trap (invoke \"call\" (i32.const 0)) \"uninitialized element\")\n(assert_return (invoke \"call\" (i32.const 1)) (i32.const 11))\n(assert_return (invoke \"call\" (i32.const 2)) (i32.const 22))\n(assert_trap (invoke \"call\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"call\" (i32.const 100)) \"undefined element\")\n\n\n(module\n  (type (func (result i32)))\n  (table $tab (import \"spectest\" \"table\") 10 20 funcref)\n  (table $tab64 (import \"test\" \"table64-10-inf\") i64 10 funcref)\n  (elem (table $tab) (i32.const 1) func $f $g)\n\n  (func (export \"call\") (param i32) (result i32)\n    (call_indirect $tab (type 0) (local.get 0))\n  )\n  (func $f (result i32) (i32.const 11))\n  (func $g (result i32) (i32.const 22))\n)\n\n(assert_trap (invoke \"call\" (i32.const 0)) \"uninitialized element\")\n(assert_return (invoke \"call\" (i32.const 1)) (i32.const 11))\n(assert_return (invoke \"call\" (i32.const 2)) (i32.const 22))\n(assert_trap (invoke \"call\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"call\" (i32.const 100)) \"undefined element\")\n\n(module\n  (import \"spectest\" \"table\" (table 0 funcref))\n  (import \"spectest\" \"table\" (table 0 funcref))\n  (import \"test\" \"table64-10-inf\" (table i64 10 funcref))\n  (import \"test\" \"table64-10-inf\" (table i64 10 funcref))\n  (table 10 funcref)\n  (table 10 funcref)\n  (table i64 10 funcref)\n  (table i64 10 funcref)\n)\n\n(module (import \"test\" \"table-10-inf\" (table 10 funcref)))\n(module (import \"test\" \"table-10-inf\" (table 5 funcref)))\n(module (import \"test\" \"table-10-inf\" (table 0 funcref)))\n(module (import \"test\" \"table-10-20\" (table 10 funcref)))\n(module (import \"test\" \"table-10-20\" (table 5 funcref)))\n(module (import \"test\" \"table-10-20\" (table 0 funcref)))\n(module (import \"test\" \"table-10-20\" (table 10 20 funcref)))\n(module (import \"test\" \"table-10-20\" (table 5 20 funcref)))\n(module (import \"test\" \"table-10-20\" (table 0 20 funcref)))\n(module (import \"test\" \"table-10-20\" (table 10 25 funcref)))\n(module (import \"test\" \"table-10-20\" (table 5 25 funcref)))\n(module (import \"test\" \"table-10-20\" (table 0 25 funcref)))\n(module (import \"test\" \"table64-10-inf\" (table i64 10 funcref)))\n(module (import \"test\" \"table64-10-inf\" (table i64 5 funcref)))\n(module (import \"test\" \"table64-10-inf\" (table i64 0 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 10 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 5 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 0 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 10 20 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 5 20 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 0 20 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 10 25 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 5 25 funcref)))\n(module (import \"test\" \"table64-10-20\" (table i64 0 25 funcref)))\n(module (import \"spectest\" \"table\" (table 10 funcref)))\n(module (import \"spectest\" \"table\" (table 5 funcref)))\n(module (import \"spectest\" \"table\" (table 0 funcref)))\n(module (import \"spectest\" \"table\" (table 10 20 funcref)))\n(module (import \"spectest\" \"table\" (table 5 20 funcref)))\n(module (import \"spectest\" \"table\" (table 0 20 funcref)))\n(module (import \"spectest\" \"table\" (table 10 25 funcref)))\n(module (import \"spectest\" \"table\" (table 5 25 funcref)))\n\n(assert_unlinkable\n  (module (import \"test\" \"unknown\" (table 10 funcref)))\n  \"unknown import\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"unknown\" (table 10 funcref)))\n  \"unknown import\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"table-10-inf\" (table 12 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table-10-inf\" (table 10 20 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table64-10-inf\" (table i64 12 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table64-10-inf\" (table i64 10 20 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table-10-20\" (table 12 20 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table-10-20\" (table 10 18 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table64-10-20\" (table i64 12 20 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table64-10-20\" (table i64 10 18 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"table\" (table 12 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"table\" (table 10 15 funcref)))\n  \"incompatible import type\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"func\" (table 10 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-i32\" (table 10 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (table 10 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"print_i32\" (table 10 funcref)))\n  \"incompatible import type\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"table-10-inf\" (table i64 10 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table64-10-inf\" (table 10 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table-10-20\" (table i64 10 20 funcref)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table64-10-20\" (table 10 20 funcref)))\n  \"incompatible import type\"\n)\n\n\n;; Memories\n\n(module\n  (import \"spectest\" \"memory\" (memory 1 2))\n  (import \"test\" \"memory-2-inf\" (memory 2))\n  (import \"test\" \"memory64-2-inf\" (memory i64 2))\n  (data (memory 0) (i32.const 10) \"\\10\")\n\n  (func (export \"load\") (param i32) (result i32) (i32.load (local.get 0)))\n)\n\n(assert_return (invoke \"load\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 10)) (i32.const 16))\n(assert_return (invoke \"load\" (i32.const 8)) (i32.const 0x100000))\n(assert_trap (invoke \"load\" (i32.const 1000000)) \"out of bounds memory access\")\n\n(module\n  (memory (import \"spectest\" \"memory\") 1 2)\n  (memory (import \"test\" \"memory-2-inf\") 2)\n  (memory (import \"test\" \"memory64-2-inf\") i64 2)\n  (data (memory 0) (i32.const 10) \"\\10\")\n\n  (func (export \"load\") (param i32) (result i32) (i32.load (local.get 0)))\n)\n(assert_return (invoke \"load\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 10)) (i32.const 16))\n(assert_return (invoke \"load\" (i32.const 8)) (i32.const 0x100000))\n(assert_trap (invoke \"load\" (i32.const 1000000)) \"out of bounds memory access\")\n\n(module (import \"test\" \"memory-2-inf\" (memory 2)))\n(module (import \"test\" \"memory-2-inf\" (memory 1)))\n(module (import \"test\" \"memory-2-inf\" (memory 0)))\n(module (import \"test\" \"memory-2-4\" (memory 2)))\n(module (import \"test\" \"memory-2-4\" (memory 1)))\n(module (import \"test\" \"memory-2-4\" (memory 0)))\n(module (import \"test\" \"memory-2-4\" (memory 2 4)))\n(module (import \"test\" \"memory-2-4\" (memory 1 4)))\n(module (import \"test\" \"memory-2-4\" (memory 0 4)))\n(module (import \"test\" \"memory-2-4\" (memory 2 5)))\n(module (import \"test\" \"memory-2-4\" (memory 2 6)))\n(module (import \"test\" \"memory64-2-inf\" (memory i64 2)))\n(module (import \"test\" \"memory64-2-inf\" (memory i64 1)))\n(module (import \"test\" \"memory64-2-inf\" (memory i64 0)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 2)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 1)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 0)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 2 4)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 1 4)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 0 4)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 2 5)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 1 5)))\n(module (import \"test\" \"memory64-2-4\" (memory i64 0 5)))\n(module (import \"spectest\" \"memory\" (memory 1)))\n(module (import \"spectest\" \"memory\" (memory 0)))\n(module (import \"spectest\" \"memory\" (memory 1 2)))\n(module (import \"spectest\" \"memory\" (memory 0 2)))\n(module (import \"spectest\" \"memory\" (memory 1 3)))\n(module (import \"spectest\" \"memory\" (memory 0 3)))\n\n(assert_unlinkable\n  (module (import \"test\" \"unknown\" (memory 1)))\n  \"unknown import\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"unknown\" (memory 1)))\n  \"unknown import\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (memory 0 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (memory 0 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (memory 0 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (memory 2 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (memory 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 0 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 0 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 0 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 2 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 2 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 3 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 3 4)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 3 5)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 4 4)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 4 5)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 4)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory 5)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-inf\" (memory i64 0 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-inf\" (memory i64 0 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-inf\" (memory i64 0 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-inf\" (memory i64 2 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-inf\" (memory i64 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 0 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 0 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 0 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 2 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 2 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 3 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 3 4)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 3 5)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 4 4)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 4 5)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 3)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 4)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory i64 5)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"memory\" (memory 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"memory\" (memory 1 1)))\n  \"incompatible import type\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-inf\" (memory i64 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-inf\" (memory 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory-2-4\" (memory i64 2 4)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"memory64-2-4\" (memory 2 4)))\n  \"incompatible import type\"\n)\n\n(assert_unlinkable\n  (module (import \"test\" \"func-i32\" (memory 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"global-i32\" (memory 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"test\" \"table-10-inf\" (memory 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"print_i32\" (memory 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"global_i32\" (memory 1)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"table\" (memory 1)))\n  \"incompatible import type\"\n)\n\n(assert_unlinkable\n  (module (import \"spectest\" \"memory\" (memory 2)))\n  \"incompatible import type\"\n)\n(assert_unlinkable\n  (module (import \"spectest\" \"memory\" (memory 1 1)))\n  \"incompatible import type\"\n)\n\n(module\n  (import \"spectest\" \"memory\" (memory 0 3))  ;; actual has max size 2\n  (func (export \"grow\") (param i32) (result i32) (memory.grow (local.get 0)))\n)\n(assert_return (invoke \"grow\" (i32.const 0)) (i32.const 1))\n(assert_return (invoke \"grow\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"grow\" (i32.const 0)) (i32.const 2))\n(assert_return (invoke \"grow\" (i32.const 1)) (i32.const -1))\n(assert_return (invoke \"grow\" (i32.const 0)) (i32.const 2))\n\n\n;; Syntax errors\n\n(assert_malformed\n  (module quote \"(func) (import \\\"\\\" \\\"\\\" (func))\")\n  \"import after function\"\n)\n(assert_malformed\n  (module quote \"(func) (import \\\"\\\" \\\"\\\" (global i64))\")\n  \"import after function\"\n)\n(assert_malformed\n  (module quote \"(func) (import \\\"\\\" \\\"\\\" (table 0 funcref))\")\n  \"import after function\"\n)\n(assert_malformed\n  (module quote \"(func) (import \\\"\\\" \\\"\\\" (memory 0))\")\n  \"import after function\"\n)\n\n(assert_malformed\n  (module quote \"(global i64 (i64.const 0)) (import \\\"\\\" \\\"\\\" (func))\")\n  \"import after global\"\n)\n(assert_malformed\n  (module quote \"(global i64 (i64.const 0)) (import \\\"\\\" \\\"\\\" (global f32))\")\n  \"import after global\"\n)\n(assert_malformed\n  (module quote \"(global i64 (i64.const 0)) (import \\\"\\\" \\\"\\\" (table 0 funcref))\")\n  \"import after global\"\n)\n(assert_malformed\n  (module quote \"(global i64 (i64.const 0)) (import \\\"\\\" \\\"\\\" (memory 0))\")\n  \"import after global\"\n)\n\n(assert_malformed\n  (module quote \"(table 0 funcref) (import \\\"\\\" \\\"\\\" (func))\")\n  \"import after table\"\n)\n(assert_malformed\n  (module quote \"(table 0 funcref) (import \\\"\\\" \\\"\\\" (global i32))\")\n  \"import after table\"\n)\n(assert_malformed\n  (module quote \"(table 0 funcref) (import \\\"\\\" \\\"\\\" (table 0 funcref))\")\n  \"import after table\"\n)\n(assert_malformed\n  (module quote \"(table 0 funcref) (import \\\"\\\" \\\"\\\" (memory 0))\")\n  \"import after table\"\n)\n\n(assert_malformed\n  (module quote \"(memory 0) (import \\\"\\\" \\\"\\\" (func))\")\n  \"import after memory\"\n)\n(assert_malformed\n  (module quote \"(memory 0) (import \\\"\\\" \\\"\\\" (global i32))\")\n  \"import after memory\"\n)\n(assert_malformed\n  (module quote \"(memory 0) (import \\\"\\\" \\\"\\\" (table 1 3 funcref))\")\n  \"import after memory\"\n)\n(assert_malformed\n  (module quote \"(memory 0) (import \\\"\\\" \\\"\\\" (memory 1 2))\")\n  \"import after memory\"\n)\n\n;; This module is required to validate, regardless of whether it can be\n;; linked. Overloading is not possible in wasm itself, but it is possible\n;; in modules from which wasm can import.\n(module)\n(register \"not wasm\")\n(assert_unlinkable\n  (module\n    (import \"not wasm\" \"overloaded\" (func))\n    (import \"not wasm\" \"overloaded\" (func (param i32)))\n    (import \"not wasm\" \"overloaded\" (func (param i32 i32)))\n    (import \"not wasm\" \"overloaded\" (func (param i64)))\n    (import \"not wasm\" \"overloaded\" (func (param f32)))\n    (import \"not wasm\" \"overloaded\" (func (param f64)))\n    (import \"not wasm\" \"overloaded\" (func (result i32)))\n    (import \"not wasm\" \"overloaded\" (func (result i64)))\n    (import \"not wasm\" \"overloaded\" (func (result f32)))\n    (import \"not wasm\" \"overloaded\" (func (result f64)))\n    (import \"not wasm\" \"overloaded\" (global i32))\n    (import \"not wasm\" \"overloaded\" (global i64))\n    (import \"not wasm\" \"overloaded\" (global f32))\n    (import \"not wasm\" \"overloaded\" (global f64))\n    (import \"not wasm\" \"overloaded\" (table 0 funcref))\n    (import \"not wasm\" \"overloaded\" (memory 0))\n  )\n  \"unknown import\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/load64.wast",
    "content": ";; Load operator as the argument of control constructs and instructions\n\n(module\n  (memory i64 1)\n\n  (func (export \"as-br-value\") (result i32)\n    (block (result i32) (br 0 (i32.load (i64.const 0))))\n  )\n\n  (func (export \"as-br_if-cond\")\n    (block (br_if 0 (i32.load (i64.const 0))))\n  )\n  (func (export \"as-br_if-value\") (result i32)\n    (block (result i32)\n      (drop (br_if 0 (i32.load (i64.const 0)) (i32.const 1))) (i32.const 7)\n    )\n  )\n  (func (export \"as-br_if-value-cond\") (result i32)\n    (block (result i32)\n      (drop (br_if 0 (i32.const 6) (i32.load (i64.const 0)))) (i32.const 7)\n    )\n  )\n\n  (func (export \"as-br_table-index\")\n    (block (br_table 0 0 0 (i32.load (i64.const 0))))\n  )\n  (func (export \"as-br_table-value\") (result i32)\n    (block (result i32)\n      (br_table 0 0 0 (i32.load (i64.const 0)) (i32.const 1)) (i32.const 7)\n    )\n  )\n  (func (export \"as-br_table-value-index\") (result i32)\n    (block (result i32)\n      (br_table 0 0 (i32.const 6) (i32.load (i64.const 0))) (i32.const 7)\n    )\n  )\n\n  (func (export \"as-return-value\") (result i32)\n    (return (i32.load (i64.const 0)))\n  )\n\n  (func (export \"as-if-cond\") (result i32)\n    (if (result i32) (i32.load (i64.const 0))\n      (then (i32.const 0)) (else (i32.const 1))\n    )\n  )\n  (func (export \"as-if-then\") (result i32)\n    (if (result i32) (i32.const 1)\n      (then (i32.load (i64.const 0))) (else (i32.const 0))\n    )\n  )\n  (func (export \"as-if-else\") (result i32)\n    (if (result i32) (i32.const 0)\n      (then (i32.const 0)) (else (i32.load (i64.const 0)))\n    )\n  )\n\n  (func (export \"as-select-first\") (param i32 i32) (result i32)\n    (select (i32.load (i64.const 0)) (local.get 0) (local.get 1))\n  )\n  (func (export \"as-select-second\") (param i32 i32) (result i32)\n    (select (local.get 0) (i32.load (i64.const 0)) (local.get 1))\n  )\n  (func (export \"as-select-cond\") (result i32)\n    (select (i32.const 0) (i32.const 1) (i32.load (i64.const 0)))\n  )\n\n  (func $f (param i32 i32 i32) (result i32) (i32.const -1))\n  (func (export \"as-call-first\") (result i32)\n    (call $f (i32.load (i64.const 0)) (i32.const 2) (i32.const 3))\n  )\n  (func (export \"as-call-mid\") (result i32)\n    (call $f (i32.const 1) (i32.load (i64.const 0)) (i32.const 3))\n  )\n  (func (export \"as-call-last\") (result i32)\n    (call $f (i32.const 1) (i32.const 2) (i32.load (i64.const 0)))\n  )\n\n  (type $sig (func (param i32 i32 i32) (result i32)))\n  (table funcref (elem $f))\n  (func (export \"as-call_indirect-first\") (result i32)\n    (call_indirect (type $sig)\n      (i32.load (i64.const 0)) (i32.const 2) (i32.const 3) (i32.const 0)\n    )\n  )\n  (func (export \"as-call_indirect-mid\") (result i32)\n    (call_indirect (type $sig)\n      (i32.const 1) (i32.load (i64.const 0)) (i32.const 3) (i32.const 0)\n    )\n  )\n  (func (export \"as-call_indirect-last\") (result i32)\n    (call_indirect (type $sig)\n      (i32.const 1) (i32.const 2) (i32.load (i64.const 0)) (i32.const 0)\n    )\n  )\n  (func (export \"as-call_indirect-index\") (result i32)\n    (call_indirect (type $sig)\n      (i32.const 1) (i32.const 2) (i32.const 3) (i32.load (i64.const 0))\n    )\n  )\n\n  (func (export \"as-local.set-value\") (local i32)\n    (local.set 0 (i32.load (i64.const 0)))\n  )\n  (func (export \"as-local.tee-value\") (result i32) (local i32)\n    (local.tee 0 (i32.load (i64.const 0)))\n  )\n  (global $g (mut i32) (i32.const 0))\n  (func (export \"as-global.set-value\") (local i32)\n    (global.set $g (i32.load (i64.const 0)))\n  )\n\n  (func (export \"as-load-address\") (result i32)\n    (i32.load (i64.load (i64.const 0)))\n  )\n  (func (export \"as-loadN-address\") (result i32)\n    (i32.load8_s (i64.load (i64.const 0)))\n  )\n\n  (func (export \"as-store-address\")\n    (i32.store (i64.load (i64.const 0)) (i32.const 7))\n  )\n  (func (export \"as-store-value\")\n    (i32.store (i64.const 2) (i32.load (i64.const 0)))\n  )\n\n  (func (export \"as-storeN-address\")\n    (i32.store8 (i64.load8_s (i64.const 0)) (i32.const 7))\n  )\n  (func (export \"as-storeN-value\")\n    (i32.store16 (i64.const 2) (i32.load (i64.const 0)))\n  )\n\n  (func (export \"as-unary-operand\") (result i32)\n    (i32.clz (i32.load (i64.const 100)))\n  )\n\n  (func (export \"as-binary-left\") (result i32)\n    (i32.add (i32.load (i64.const 100)) (i32.const 10))\n  )\n  (func (export \"as-binary-right\") (result i32)\n    (i32.sub (i32.const 10) (i32.load (i64.const 100)))\n  )\n\n  (func (export \"as-test-operand\") (result i32)\n    (i32.eqz (i32.load (i64.const 100)))\n  )\n\n  (func (export \"as-compare-left\") (result i32)\n    (i32.le_s (i32.load (i64.const 100)) (i32.const 10))\n  )\n  (func (export \"as-compare-right\") (result i32)\n    (i32.ne (i32.const 10) (i32.load (i64.const 100)))\n  )\n\n  (func (export \"as-memory.grow-size\") (result i64)\n    (memory.grow (i64.load (i64.const 100)))\n  )\n)\n\n(assert_return (invoke \"as-br-value\") (i32.const 0))\n\n(assert_return (invoke \"as-br_if-cond\"))\n(assert_return (invoke \"as-br_if-value\") (i32.const 0))\n(assert_return (invoke \"as-br_if-value-cond\") (i32.const 7))\n\n(assert_return (invoke \"as-br_table-index\"))\n(assert_return (invoke \"as-br_table-value\") (i32.const 0))\n(assert_return (invoke \"as-br_table-value-index\") (i32.const 6))\n\n(assert_return (invoke \"as-return-value\") (i32.const 0))\n\n(assert_return (invoke \"as-if-cond\") (i32.const 1))\n(assert_return (invoke \"as-if-then\") (i32.const 0))\n(assert_return (invoke \"as-if-else\") (i32.const 0))\n\n(assert_return (invoke \"as-select-first\" (i32.const 0) (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"as-select-second\" (i32.const 0) (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"as-select-cond\") (i32.const 1))\n\n(assert_return (invoke \"as-call-first\") (i32.const -1))\n(assert_return (invoke \"as-call-mid\") (i32.const -1))\n(assert_return (invoke \"as-call-last\") (i32.const -1))\n\n(assert_return (invoke \"as-call_indirect-first\") (i32.const -1))\n(assert_return (invoke \"as-call_indirect-mid\") (i32.const -1))\n(assert_return (invoke \"as-call_indirect-last\") (i32.const -1))\n(assert_return (invoke \"as-call_indirect-index\") (i32.const -1))\n\n(assert_return (invoke \"as-local.set-value\"))\n(assert_return (invoke \"as-local.tee-value\") (i32.const 0))\n(assert_return (invoke \"as-global.set-value\"))\n\n(assert_return (invoke \"as-load-address\") (i32.const 0))\n(assert_return (invoke \"as-loadN-address\") (i32.const 0))\n(assert_return (invoke \"as-store-address\"))\n(assert_return (invoke \"as-store-value\"))\n(assert_return (invoke \"as-storeN-address\"))\n(assert_return (invoke \"as-storeN-value\"))\n\n(assert_return (invoke \"as-unary-operand\") (i32.const 32))\n\n(assert_return (invoke \"as-binary-left\") (i32.const 10))\n(assert_return (invoke \"as-binary-right\") (i32.const 10))\n\n(assert_return (invoke \"as-test-operand\") (i32.const 1))\n\n(assert_return (invoke \"as-compare-left\") (i32.const 1))\n(assert_return (invoke \"as-compare-right\") (i32.const 1))\n\n(assert_return (invoke \"as-memory.grow-size\") (i64.const 1))\n\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i32) (i32.load32 (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i32) (i32.load32_u (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i32) (i32.load32_s (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i32) (i32.load64 (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i32) (i32.load64_u (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i32) (i32.load64_s (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i64) (i64.load64 (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i64) (i64.load64_u (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result i64) (i64.load64_s (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result f32) (f32.load32 (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result f32) (f32.load64 (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result f64) (f64.load32 (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n(assert_malformed\n  (module quote\n    \"(memory i64 1)\"\n    \"(func (param i64) (result f64) (f64.load64 (local.get 0)))\"\n  )\n  \"unknown operator\"\n)\n\n\n;; load should have retval\n\n(assert_invalid\n  (module (memory i64 1) (func $load_i32 (i32.load (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load8_s_i32 (i32.load8_s (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load8_u_i32 (i32.load8_u (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load16_s_i32 (i32.load16_s (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load16_u_i32 (i32.load16_u (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load_i64 (i64.load (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load8_s_i64 (i64.load8_s (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load8_u_i64 (i64.load8_u (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load16_s_i64 (i64.load16_s (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load16_u_i64 (i64.load16_u (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load32_s_i64 (i64.load32_s (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load32_u_i64 (i64.load32_u (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load_f32 (f32.load (i64.const 0))))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (memory i64 1) (func $load_f64 (f64.load (i64.const 0))))\n  \"type mismatch\"\n)\n\n\n;; Type check\n\n(assert_invalid (module (memory i64 1) (func (result i32) (i32.load (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i32) (i32.load8_s (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i32) (i32.load8_u (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i32) (i32.load16_s (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i32) (i32.load16_u (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i64) (i64.load (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i64) (i64.load8_s (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i64) (i64.load8_u (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i64) (i64.load16_s (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i64) (i64.load16_u (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i64) (i64.load32_s (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result i64) (i64.load32_u (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result f32) (f32.load (f32.const 0)))) \"type mismatch\")\n(assert_invalid (module (memory i64 1) (func (result f64) (f64.load (f32.const 0)))) \"type mismatch\")\n\n\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty\n      (i32.load) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-block\n      (i32.const 0)\n      (block (i32.load) (drop))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-loop\n      (i32.const 0)\n      (loop (i32.load) (drop))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-then\n      (i32.const 0) (i32.const 0)\n      (if (then (i32.load) (drop)))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-else\n      (i32.const 0) (i32.const 0)\n      (if (result i32) (then (i32.const 0)) (else (i32.load))) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-br\n      (i32.const 0)\n      (block (br 0 (i32.load)) (drop))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-br_if\n      (i32.const 0)\n      (block (br_if 0 (i32.load) (i32.const 1)) (drop))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-br_table\n      (i32.const 0)\n      (block (br_table 0 (i32.load)) (drop))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-return\n      (return (i32.load)) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-select\n      (select (i32.load) (i32.const 1) (i32.const 2)) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-call\n      (call 1 (i32.load)) (drop)\n    )\n    (func (param i32) (result i32) (local.get 0))\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $f (param i32) (result i32) (local.get 0))\n    (type $sig (func (param i32) (result i32)))\n    (table funcref (elem $f))\n    (func $type-address-empty-in-call_indirect\n      (block (result i32)\n        (call_indirect (type $sig)\n          (i32.load) (i32.const 0)\n        )\n        (drop)\n      )\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-local.set\n      (local i32)\n      (local.set 0 (i32.load)) (local.get 0) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-local.tee\n      (local i32)\n      (local.tee 0 (i32.load)) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (global $x (mut i32) (i32.const 0))\n    (func $type-address-empty-in-global.set\n      (global.set $x (i32.load)) (global.get $x) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-memory.grow\n      (memory.grow (i64.load)) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 0)\n    (func $type-address-empty-in-load\n      (i32.load (i32.load)) (drop)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (memory i64 1)\n    (func $type-address-empty-in-store\n      (i32.store (i32.load) (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/memory.wast",
    "content": ";; Test memory section structure\n\n(module (memory 0))\n(module (memory 1))\n(module (memory 0 0))\n(module (memory 0 1))\n(module (memory 1 256))\n(module (memory 0 65536))\n\n(module (memory (data)) (func (export \"memsize\") (result i32) (memory.size)))\n(assert_return (invoke \"memsize\") (i32.const 0))\n(module (memory (data \"\")) (func (export \"memsize\") (result i32) (memory.size)))\n(assert_return (invoke \"memsize\") (i32.const 0))\n(module (memory (data \"x\")) (func (export \"memsize\") (result i32) (memory.size)))\n(assert_return (invoke \"memsize\") (i32.const 1))\n\n(assert_invalid (module (data (i32.const 0))) \"unknown memory\")\n(assert_invalid (module (data (i32.const 0) \"\")) \"unknown memory\")\n(assert_invalid (module (data (i32.const 0) \"x\")) \"unknown memory\")\n\n(assert_invalid\n  (module (func (drop (f32.load (i32.const 0)))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (f32.store (i32.const 0) (f32.const 0))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (drop (i32.load8_s (i32.const 0)))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (i32.store8 (i32.const 0) (i32.const 0))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (drop (memory.size))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (drop (memory.grow (i32.const 0)))))\n  \"unknown memory\"\n)\n\n\n(assert_invalid\n  (module (memory 1 0))\n  \"size minimum must not be greater than maximum\"\n)\n(assert_invalid\n  (module (memory 65537))\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n(assert_invalid\n  (module (memory 2147483648))\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n(assert_invalid\n  (module (memory 4294967295))\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n(assert_invalid\n  (module (memory 0 65537))\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n(assert_invalid\n  (module (memory 0 2147483648))\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n(assert_invalid\n  (module (memory 0 4294967295))\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n\n(assert_invalid\n  (module quote \"(memory 0x1_0000_0000)\")\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n(assert_invalid\n  (module quote \"(memory 0x1_0000_0000 0x1_0000_0000)\")\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n(assert_invalid\n  (module quote \"(memory 0 0x1_0000_0000)\")\n  \"memory size must be at most 65536 pages (4GiB)\"\n)\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"ABC\\a7D\") (data (i32.const 20) \"WASM\")\n\n  ;; Data section\n  (func (export \"data\") (result i32)\n    (i32.and\n      (i32.and\n        (i32.and\n          (i32.eq (i32.load8_u (i32.const 0)) (i32.const 65))\n          (i32.eq (i32.load8_u (i32.const 3)) (i32.const 167))\n        )\n        (i32.and\n          (i32.eq (i32.load8_u (i32.const 6)) (i32.const 0))\n          (i32.eq (i32.load8_u (i32.const 19)) (i32.const 0))\n        )\n      )\n      (i32.and\n        (i32.and\n          (i32.eq (i32.load8_u (i32.const 20)) (i32.const 87))\n          (i32.eq (i32.load8_u (i32.const 23)) (i32.const 77))\n        )\n        (i32.and\n          (i32.eq (i32.load8_u (i32.const 24)) (i32.const 0))\n          (i32.eq (i32.load8_u (i32.const 1023)) (i32.const 0))\n        )\n      )\n    )\n  )\n\n  ;; Memory cast\n  (func (export \"cast\") (result f64)\n    (i64.store (i32.const 8) (i64.const -12345))\n    (if\n      (f64.eq\n        (f64.load (i32.const 8))\n        (f64.reinterpret_i64 (i64.const -12345))\n      )\n      (then (return (f64.const 0)))\n    )\n    (i64.store align=1 (i32.const 9) (i64.const 0))\n    (i32.store16 align=1 (i32.const 15) (i32.const 16453))\n    (f64.load align=1 (i32.const 9))\n  )\n\n  ;; Sign and zero extending memory loads\n  (func (export \"i32_load8_s\") (param $i i32) (result i32)\n    (i32.store8 (i32.const 8) (local.get $i))\n    (i32.load8_s (i32.const 8))\n  )\n  (func (export \"i32_load8_u\") (param $i i32) (result i32)\n    (i32.store8 (i32.const 8) (local.get $i))\n    (i32.load8_u (i32.const 8))\n  )\n  (func (export \"i32_load16_s\") (param $i i32) (result i32)\n    (i32.store16 (i32.const 8) (local.get $i))\n    (i32.load16_s (i32.const 8))\n  )\n  (func (export \"i32_load16_u\") (param $i i32) (result i32)\n    (i32.store16 (i32.const 8) (local.get $i))\n    (i32.load16_u (i32.const 8))\n  )\n  (func (export \"i64_load8_s\") (param $i i64) (result i64)\n    (i64.store8 (i32.const 8) (local.get $i))\n    (i64.load8_s (i32.const 8))\n  )\n  (func (export \"i64_load8_u\") (param $i i64) (result i64)\n    (i64.store8 (i32.const 8) (local.get $i))\n    (i64.load8_u (i32.const 8))\n  )\n  (func (export \"i64_load16_s\") (param $i i64) (result i64)\n    (i64.store16 (i32.const 8) (local.get $i))\n    (i64.load16_s (i32.const 8))\n  )\n  (func (export \"i64_load16_u\") (param $i i64) (result i64)\n    (i64.store16 (i32.const 8) (local.get $i))\n    (i64.load16_u (i32.const 8))\n  )\n  (func (export \"i64_load32_s\") (param $i i64) (result i64)\n    (i64.store32 (i32.const 8) (local.get $i))\n    (i64.load32_s (i32.const 8))\n  )\n  (func (export \"i64_load32_u\") (param $i i64) (result i64)\n    (i64.store32 (i32.const 8) (local.get $i))\n    (i64.load32_u (i32.const 8))\n  )\n)\n\n(assert_return (invoke \"data\") (i32.const 1))\n(assert_return (invoke \"cast\") (f64.const 42.0))\n\n(assert_return (invoke \"i32_load8_s\" (i32.const -1)) (i32.const -1))\n(assert_return (invoke \"i32_load8_u\" (i32.const -1)) (i32.const 255))\n(assert_return (invoke \"i32_load16_s\" (i32.const -1)) (i32.const -1))\n(assert_return (invoke \"i32_load16_u\" (i32.const -1)) (i32.const 65535))\n\n(assert_return (invoke \"i32_load8_s\" (i32.const 100)) (i32.const 100))\n(assert_return (invoke \"i32_load8_u\" (i32.const 200)) (i32.const 200))\n(assert_return (invoke \"i32_load16_s\" (i32.const 20000)) (i32.const 20000))\n(assert_return (invoke \"i32_load16_u\" (i32.const 40000)) (i32.const 40000))\n\n(assert_return (invoke \"i32_load8_s\" (i32.const 0xfedc6543)) (i32.const 0x43))\n(assert_return (invoke \"i32_load8_s\" (i32.const 0x3456cdef)) (i32.const 0xffffffef))\n(assert_return (invoke \"i32_load8_u\" (i32.const 0xfedc6543)) (i32.const 0x43))\n(assert_return (invoke \"i32_load8_u\" (i32.const 0x3456cdef)) (i32.const 0xef))\n(assert_return (invoke \"i32_load16_s\" (i32.const 0xfedc6543)) (i32.const 0x6543))\n(assert_return (invoke \"i32_load16_s\" (i32.const 0x3456cdef)) (i32.const 0xffffcdef))\n(assert_return (invoke \"i32_load16_u\" (i32.const 0xfedc6543)) (i32.const 0x6543))\n(assert_return (invoke \"i32_load16_u\" (i32.const 0x3456cdef)) (i32.const 0xcdef))\n\n(assert_return (invoke \"i64_load8_s\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load8_u\" (i64.const -1)) (i64.const 255))\n(assert_return (invoke \"i64_load16_s\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load16_u\" (i64.const -1)) (i64.const 65535))\n(assert_return (invoke \"i64_load32_s\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load32_u\" (i64.const -1)) (i64.const 4294967295))\n\n(assert_return (invoke \"i64_load8_s\" (i64.const 100)) (i64.const 100))\n(assert_return (invoke \"i64_load8_u\" (i64.const 200)) (i64.const 200))\n(assert_return (invoke \"i64_load16_s\" (i64.const 20000)) (i64.const 20000))\n(assert_return (invoke \"i64_load16_u\" (i64.const 40000)) (i64.const 40000))\n(assert_return (invoke \"i64_load32_s\" (i64.const 20000)) (i64.const 20000))\n(assert_return (invoke \"i64_load32_u\" (i64.const 40000)) (i64.const 40000))\n\n(assert_return (invoke \"i64_load8_s\" (i64.const 0xfedcba9856346543)) (i64.const 0x43))\n(assert_return (invoke \"i64_load8_s\" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffffffffffef))\n(assert_return (invoke \"i64_load8_u\" (i64.const 0xfedcba9856346543)) (i64.const 0x43))\n(assert_return (invoke \"i64_load8_u\" (i64.const 0x3456436598bacdef)) (i64.const 0xef))\n(assert_return (invoke \"i64_load16_s\" (i64.const 0xfedcba9856346543)) (i64.const 0x6543))\n(assert_return (invoke \"i64_load16_s\" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffffffffcdef))\n(assert_return (invoke \"i64_load16_u\" (i64.const 0xfedcba9856346543)) (i64.const 0x6543))\n(assert_return (invoke \"i64_load16_u\" (i64.const 0x3456436598bacdef)) (i64.const 0xcdef))\n(assert_return (invoke \"i64_load32_s\" (i64.const 0xfedcba9856346543)) (i64.const 0x56346543))\n(assert_return (invoke \"i64_load32_s\" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffff98bacdef))\n(assert_return (invoke \"i64_load32_u\" (i64.const 0xfedcba9856346543)) (i64.const 0x56346543))\n(assert_return (invoke \"i64_load32_u\" (i64.const 0x3456436598bacdef)) (i64.const 0x98bacdef))\n\n;; Duplicate identifier errors\n\n(assert_malformed (module quote\n  \"(memory $foo 1)\"\n  \"(memory $foo 1)\")\n  \"duplicate memory\")\n(assert_malformed (module quote\n  \"(import \\\"\\\" \\\"\\\" (memory $foo 1))\"\n  \"(memory $foo 1)\")\n  \"duplicate memory\")\n(assert_malformed (module quote\n  \"(import \\\"\\\" \\\"\\\" (memory $foo 1))\"\n  \"(import \\\"\\\" \\\"\\\" (memory $foo 1))\")\n  \"duplicate memory\")\n\n;; Test that exporting random globals does not change a memory's semantics.\n\n(module\n  (memory (export \"memory\") 1 1)\n\n  ;; These should not change the behavior of memory accesses.\n  (global (export \"__data_end\") i32 (i32.const 10000))\n  (global (export \"__stack_top\") i32 (i32.const 10000))\n  (global (export \"__heap_base\") i32 (i32.const 10000))\n\n  (func (export \"load\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))\n  )\n)\n\n;; None of these memory accesses should trap.\n(assert_return (invoke \"load\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 10000)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 20000)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 30000)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 40000)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 50000)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 60000)) (i32.const 0))\n(assert_return (invoke \"load\" (i32.const 65535)) (i32.const 0))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/memory64.wast",
    "content": ";; Test memory section structure\n;; Largely duplicated from memory, but with all memories using a 64-bit index.\n\n(module (memory i64 0 0))\n(module (memory i64 0 1))\n(module (memory i64 1 256))\n(module (memory i64 0 65536))\n\n(module (memory i64 (data)) (func (export \"memsize\") (result i64) (memory.size)))\n(assert_return (invoke \"memsize\") (i64.const 0))\n(module (memory i64 (data \"\")) (func (export \"memsize\") (result i64) (memory.size)))\n(assert_return (invoke \"memsize\") (i64.const 0))\n(module (memory i64 (data \"x\")) (func (export \"memsize\") (result i64) (memory.size)))\n(assert_return (invoke \"memsize\") (i64.const 1))\n\n(assert_invalid (module (data (i64.const 0))) \"unknown memory\")\n(assert_invalid (module (data (i64.const 0) \"\")) \"unknown memory\")\n(assert_invalid (module (data (i64.const 0) \"x\")) \"unknown memory\")\n\n(assert_invalid\n  (module (func (drop (f32.load (i64.const 0)))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (f32.store (i64.const 0) (f32.const 0))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (drop (i32.load8_s (i64.const 0)))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (i32.store8 (i64.const 0) (i32.const 0))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (drop (memory.size))))\n  \"unknown memory\"\n)\n(assert_invalid\n  (module (func (drop (memory.grow (i64.const 0)))))\n  \"unknown memory\"\n)\n\n\n(assert_invalid\n  (module (memory i64 1 0))\n  \"size minimum must not be greater than maximum\"\n)\n\n(module\n  (memory i64 1)\n  (data (i64.const 0) \"ABC\\a7D\") (data (i64.const 20) \"WASM\")\n\n  ;; Data section\n  (func (export \"data\") (result i32)\n    (i32.and\n      (i32.and\n        (i32.and\n          (i32.eq (i32.load8_u (i64.const 0)) (i32.const 65))\n          (i32.eq (i32.load8_u (i64.const 3)) (i32.const 167))\n        )\n        (i32.and\n          (i32.eq (i32.load8_u (i64.const 6)) (i32.const 0))\n          (i32.eq (i32.load8_u (i64.const 19)) (i32.const 0))\n        )\n      )\n      (i32.and\n        (i32.and\n          (i32.eq (i32.load8_u (i64.const 20)) (i32.const 87))\n          (i32.eq (i32.load8_u (i64.const 23)) (i32.const 77))\n        )\n        (i32.and\n          (i32.eq (i32.load8_u (i64.const 24)) (i32.const 0))\n          (i32.eq (i32.load8_u (i64.const 1023)) (i32.const 0))\n        )\n      )\n    )\n  )\n\n  ;; Memory cast\n  (func (export \"cast\") (result f64)\n    (i64.store (i64.const 8) (i64.const -12345))\n    (if\n      (f64.eq\n        (f64.load (i64.const 8))\n        (f64.reinterpret_i64 (i64.const -12345))\n      )\n      (then (return (f64.const 0)))\n    )\n    (i64.store align=1 (i64.const 9) (i64.const 0))\n    (i32.store16 align=1 (i64.const 15) (i32.const 16453))\n    (f64.load align=1 (i64.const 9))\n  )\n\n  ;; Sign and zero extending memory loads\n  (func (export \"i32_load8_s\") (param $i i32) (result i32)\n    (i32.store8 (i64.const 8) (local.get $i))\n    (i32.load8_s (i64.const 8))\n  )\n  (func (export \"i32_load8_u\") (param $i i32) (result i32)\n    (i32.store8 (i64.const 8) (local.get $i))\n    (i32.load8_u (i64.const 8))\n  )\n  (func (export \"i32_load16_s\") (param $i i32) (result i32)\n    (i32.store16 (i64.const 8) (local.get $i))\n    (i32.load16_s (i64.const 8))\n  )\n  (func (export \"i32_load16_u\") (param $i i32) (result i32)\n    (i32.store16 (i64.const 8) (local.get $i))\n    (i32.load16_u (i64.const 8))\n  )\n  (func (export \"i64_load8_s\") (param $i i64) (result i64)\n    (i64.store8 (i64.const 8) (local.get $i))\n    (i64.load8_s (i64.const 8))\n  )\n  (func (export \"i64_load8_u\") (param $i i64) (result i64)\n    (i64.store8 (i64.const 8) (local.get $i))\n    (i64.load8_u (i64.const 8))\n  )\n  (func (export \"i64_load16_s\") (param $i i64) (result i64)\n    (i64.store16 (i64.const 8) (local.get $i))\n    (i64.load16_s (i64.const 8))\n  )\n  (func (export \"i64_load16_u\") (param $i i64) (result i64)\n    (i64.store16 (i64.const 8) (local.get $i))\n    (i64.load16_u (i64.const 8))\n  )\n  (func (export \"i64_load32_s\") (param $i i64) (result i64)\n    (i64.store32 (i64.const 8) (local.get $i))\n    (i64.load32_s (i64.const 8))\n  )\n  (func (export \"i64_load32_u\") (param $i i64) (result i64)\n    (i64.store32 (i64.const 8) (local.get $i))\n    (i64.load32_u (i64.const 8))\n  )\n)\n\n(assert_return (invoke \"data\") (i32.const 1))\n(assert_return (invoke \"cast\") (f64.const 42.0))\n\n(assert_return (invoke \"i32_load8_s\" (i32.const -1)) (i32.const -1))\n(assert_return (invoke \"i32_load8_u\" (i32.const -1)) (i32.const 255))\n(assert_return (invoke \"i32_load16_s\" (i32.const -1)) (i32.const -1))\n(assert_return (invoke \"i32_load16_u\" (i32.const -1)) (i32.const 65535))\n\n(assert_return (invoke \"i32_load8_s\" (i32.const 100)) (i32.const 100))\n(assert_return (invoke \"i32_load8_u\" (i32.const 200)) (i32.const 200))\n(assert_return (invoke \"i32_load16_s\" (i32.const 20000)) (i32.const 20000))\n(assert_return (invoke \"i32_load16_u\" (i32.const 40000)) (i32.const 40000))\n\n(assert_return (invoke \"i32_load8_s\" (i32.const 0xfedc6543)) (i32.const 0x43))\n(assert_return (invoke \"i32_load8_s\" (i32.const 0x3456cdef)) (i32.const 0xffffffef))\n(assert_return (invoke \"i32_load8_u\" (i32.const 0xfedc6543)) (i32.const 0x43))\n(assert_return (invoke \"i32_load8_u\" (i32.const 0x3456cdef)) (i32.const 0xef))\n(assert_return (invoke \"i32_load16_s\" (i32.const 0xfedc6543)) (i32.const 0x6543))\n(assert_return (invoke \"i32_load16_s\" (i32.const 0x3456cdef)) (i32.const 0xffffcdef))\n(assert_return (invoke \"i32_load16_u\" (i32.const 0xfedc6543)) (i32.const 0x6543))\n(assert_return (invoke \"i32_load16_u\" (i32.const 0x3456cdef)) (i32.const 0xcdef))\n\n(assert_return (invoke \"i64_load8_s\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load8_u\" (i64.const -1)) (i64.const 255))\n(assert_return (invoke \"i64_load16_s\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load16_u\" (i64.const -1)) (i64.const 65535))\n(assert_return (invoke \"i64_load32_s\" (i64.const -1)) (i64.const -1))\n(assert_return (invoke \"i64_load32_u\" (i64.const -1)) (i64.const 4294967295))\n\n(assert_return (invoke \"i64_load8_s\" (i64.const 100)) (i64.const 100))\n(assert_return (invoke \"i64_load8_u\" (i64.const 200)) (i64.const 200))\n(assert_return (invoke \"i64_load16_s\" (i64.const 20000)) (i64.const 20000))\n(assert_return (invoke \"i64_load16_u\" (i64.const 40000)) (i64.const 40000))\n(assert_return (invoke \"i64_load32_s\" (i64.const 20000)) (i64.const 20000))\n(assert_return (invoke \"i64_load32_u\" (i64.const 40000)) (i64.const 40000))\n\n(assert_return (invoke \"i64_load8_s\" (i64.const 0xfedcba9856346543)) (i64.const 0x43))\n(assert_return (invoke \"i64_load8_s\" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffffffffffef))\n(assert_return (invoke \"i64_load8_u\" (i64.const 0xfedcba9856346543)) (i64.const 0x43))\n(assert_return (invoke \"i64_load8_u\" (i64.const 0x3456436598bacdef)) (i64.const 0xef))\n(assert_return (invoke \"i64_load16_s\" (i64.const 0xfedcba9856346543)) (i64.const 0x6543))\n(assert_return (invoke \"i64_load16_s\" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffffffffcdef))\n(assert_return (invoke \"i64_load16_u\" (i64.const 0xfedcba9856346543)) (i64.const 0x6543))\n(assert_return (invoke \"i64_load16_u\" (i64.const 0x3456436598bacdef)) (i64.const 0xcdef))\n(assert_return (invoke \"i64_load32_s\" (i64.const 0xfedcba9856346543)) (i64.const 0x56346543))\n(assert_return (invoke \"i64_load32_s\" (i64.const 0x3456436598bacdef)) (i64.const 0xffffffff98bacdef))\n(assert_return (invoke \"i64_load32_u\" (i64.const 0xfedcba9856346543)) (i64.const 0x56346543))\n(assert_return (invoke \"i64_load32_u\" (i64.const 0x3456436598bacdef)) (i64.const 0x98bacdef))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/memory_copy.wast",
    "content": ";;\n;; Generated by ../meta/generate_memory_copy.js\n;; DO NOT EDIT THIS FILE.  CHANGE THE SOURCE AND REGENERATE.\n;;\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (nop))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i32.const 13) (i32.const 2) (i32.const 3)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i32.const 25) (i32.const 15) (i32.const 2)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i32.const 13) (i32.const 25) (i32.const 3)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i32.const 20) (i32.const 22) (i32.const 4)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i32.const 25) (i32.const 1) (i32.const 3)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i32.const 10) (i32.const 12) (i32.const 7)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i32.const 12) (i32.const 10) (i32.const 7)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 0) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 0) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 19))\n(assert_return (invoke \"load8_u\" (i32.const 218)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 417)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 616)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 815)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1014)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1213)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1412)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1611)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1810)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2009)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2208)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2407)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2606)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2805)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3004)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3203)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3402)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3601)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3800)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3999)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65490)) (i32.const 0))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 0) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\\14\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65515) (i32.const 0) (i32.const 39))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 19))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 20))\n(assert_return (invoke \"load8_u\" (i32.const 219)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 418)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 617)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 816)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1015)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1214)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1413)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1612)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1811)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2010)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2209)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2408)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2607)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2806)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3005)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3204)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3403)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3602)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3801)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4000)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4199)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4398)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4597)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4796)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4995)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5194)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5393)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5592)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5791)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5990)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6189)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6388)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6587)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6786)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6985)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7184)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7383)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7582)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7781)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7980)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8179)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8378)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8577)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8776)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8975)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9174)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9373)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9572)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9771)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9970)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10169)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10368)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10567)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10766)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10965)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11164)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11363)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11562)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11761)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11960)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12159)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12358)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12557)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12756)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12955)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13154)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13353)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13552)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13751)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13950)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14149)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14348)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14547)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14746)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14945)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15144)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15343)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15542)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15741)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15940)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16139)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16338)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16537)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16736)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16935)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17134)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17333)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17532)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17731)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17930)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18129)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18328)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18527)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18726)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18925)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19124)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19323)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19522)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19721)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19920)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20119)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20318)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20517)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20716)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20915)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21114)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21313)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21512)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21711)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21910)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22109)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22308)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22507)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22706)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22905)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23104)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23303)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23502)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23701)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23900)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24099)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24298)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24497)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24696)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24895)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25094)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25293)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25492)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25691)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25890)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26089)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26288)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26487)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26686)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26885)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27084)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27283)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27482)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27681)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27880)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28079)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28278)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28477)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28676)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28875)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29074)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29273)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29472)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29671)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29870)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30069)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30268)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30467)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30666)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30865)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31064)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31263)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31462)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31661)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31860)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32059)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32258)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32457)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32656)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32855)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33054)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33253)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33452)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33651)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33850)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34049)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34248)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34447)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34646)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34845)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35044)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35243)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35442)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35641)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35840)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36039)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36238)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36437)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36636)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36835)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37034)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37233)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37432)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37631)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37830)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38029)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38228)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38427)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38626)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38825)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39024)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39223)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39422)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39621)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39820)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40019)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40218)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40417)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40616)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40815)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41014)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41213)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41412)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41611)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41810)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42009)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42208)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42407)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42606)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42805)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43004)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43203)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43402)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43601)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43800)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43999)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65491)) (i32.const 0))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 65516) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65515) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\\14\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 65515) (i32.const 39))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 19))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 20))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65486) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 65486) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65487)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65488)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65489)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65490)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65491)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65492)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65493)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65494)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65495)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65496)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65497)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65498)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65499)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65500)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65501)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65502)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65503)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65504)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65505)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65486) (i32.const 65516) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65506) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 65506) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65507)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65508)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65509)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65510)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65511)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65512)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65513)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65514)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65515)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65506) (i32.const 65516) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 65516) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1  )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 65516) (i32.const 4294963200))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 61440) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 61440) (i32.const 4294967040))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61440)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61441)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 61442)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 61443)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 61444)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 61445)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 61446)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 61447)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 61448)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 61449)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 61450)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 61451)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 61452)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 61453)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 61454)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 61455)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 61456)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 61457)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 61458)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 61459)) (i32.const 19))\n(assert_return (invoke \"load8_u\" (i32.const 61510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65490)) (i32.const 0))\n\n(assert_invalid\n  (module\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i32.const 20) (i32.const 30))))\n  \"unknown memory 0\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.fill (i32.const 10) (i32.const 0x55) (i32.const 10))\n    (memory.copy (i32.const 9) (i32.const 10) (i32.const 5)))\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n)\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 9) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 9) (i32.const 20) (i32.const 85))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 20) (i32.const 65536) (i32.const 0))\n               (i32.const -1))\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.fill (i32.const 10) (i32.const 0x55) (i32.const 10))\n    (memory.copy (i32.const 16) (i32.const 15) (i32.const 5)))\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n)\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 10) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 10) (i32.const 21) (i32.const 85))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 21) (i32.const 65536) (i32.const 0))\n               (i32.const -1))\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0xFF00) (i32.const 0x8000) (i32.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0xFFFFFF00) (i32.const 0x4000) (i32.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0x8000) (i32.const 0xFF00) (i32.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n (memory 1 1)\n (func (export \"test\")\n   (memory.copy (i32.const 0x4000) (i32.const 0xFFFFFF00) (i32.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.fill (i32.const 0x0000) (i32.const 0x55) (i32.const 0x8000))\n    (memory.fill (i32.const 0x8000) (i32.const 0xAA) (i32.const 0x8000))\n    (memory.copy (i32.const 0x9000) (i32.const 0x7000) (i32.const 0)))\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n)\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 32768) (i32.const 85))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 32768) (i32.const 65536) (i32.const 170))\n               (i32.const -1))\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0x10000) (i32.const 0x7000) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0x20000) (i32.const 0x7000) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0x9000) (i32.const 0x10000) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0x9000) (i32.const 0x20000) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0x10000) (i32.const 0x10000) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.copy (i32.const 0x20000) (i32.const 0x20000) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  (func (export \"test\")\n    (memory.fill (i32.const 17767) (i32.const 1) (i32.const 1344))\n    (memory.fill (i32.const 39017) (i32.const 2) (i32.const 1055))\n    (memory.fill (i32.const 56401) (i32.const 3) (i32.const 988))\n    (memory.fill (i32.const 37962) (i32.const 4) (i32.const 322))\n    (memory.fill (i32.const 7977) (i32.const 5) (i32.const 1994))\n    (memory.fill (i32.const 22714) (i32.const 6) (i32.const 3036))\n    (memory.fill (i32.const 16882) (i32.const 7) (i32.const 2372))\n    (memory.fill (i32.const 43491) (i32.const 8) (i32.const 835))\n    (memory.fill (i32.const 124) (i32.const 9) (i32.const 1393))\n    (memory.fill (i32.const 2132) (i32.const 10) (i32.const 2758))\n    (memory.fill (i32.const 8987) (i32.const 11) (i32.const 3098))\n    (memory.fill (i32.const 52711) (i32.const 12) (i32.const 741))\n    (memory.fill (i32.const 3958) (i32.const 13) (i32.const 2823))\n    (memory.fill (i32.const 49715) (i32.const 14) (i32.const 1280))\n    (memory.fill (i32.const 50377) (i32.const 15) (i32.const 1466))\n    (memory.fill (i32.const 20493) (i32.const 16) (i32.const 3158))\n    (memory.fill (i32.const 47665) (i32.const 17) (i32.const 544))\n    (memory.fill (i32.const 12451) (i32.const 18) (i32.const 2669))\n    (memory.fill (i32.const 24869) (i32.const 19) (i32.const 2651))\n    (memory.fill (i32.const 45317) (i32.const 20) (i32.const 1570))\n    (memory.fill (i32.const 43096) (i32.const 21) (i32.const 1691))\n    (memory.fill (i32.const 33886) (i32.const 22) (i32.const 646))\n    (memory.fill (i32.const 48555) (i32.const 23) (i32.const 1858))\n    (memory.fill (i32.const 53453) (i32.const 24) (i32.const 2657))\n    (memory.fill (i32.const 30363) (i32.const 25) (i32.const 981))\n    (memory.fill (i32.const 9300) (i32.const 26) (i32.const 1807))\n    (memory.fill (i32.const 50190) (i32.const 27) (i32.const 487))\n    (memory.fill (i32.const 62753) (i32.const 28) (i32.const 530))\n    (memory.fill (i32.const 36316) (i32.const 29) (i32.const 943))\n    (memory.fill (i32.const 6768) (i32.const 30) (i32.const 381))\n    (memory.fill (i32.const 51262) (i32.const 31) (i32.const 3089))\n    (memory.fill (i32.const 49729) (i32.const 32) (i32.const 658))\n    (memory.fill (i32.const 44540) (i32.const 33) (i32.const 1702))\n    (memory.fill (i32.const 33342) (i32.const 34) (i32.const 1092))\n    (memory.fill (i32.const 50814) (i32.const 35) (i32.const 1410))\n    (memory.fill (i32.const 47594) (i32.const 36) (i32.const 2204))\n    (memory.fill (i32.const 54123) (i32.const 37) (i32.const 2394))\n    (memory.fill (i32.const 55183) (i32.const 38) (i32.const 250))\n    (memory.fill (i32.const 22620) (i32.const 39) (i32.const 2097))\n    (memory.fill (i32.const 17132) (i32.const 40) (i32.const 3264))\n    (memory.fill (i32.const 54331) (i32.const 41) (i32.const 3299))\n    (memory.fill (i32.const 39474) (i32.const 42) (i32.const 2796))\n    (memory.fill (i32.const 36156) (i32.const 43) (i32.const 2070))\n    (memory.fill (i32.const 35308) (i32.const 44) (i32.const 2763))\n    (memory.fill (i32.const 32731) (i32.const 45) (i32.const 312))\n    (memory.fill (i32.const 63746) (i32.const 46) (i32.const 192))\n    (memory.fill (i32.const 30974) (i32.const 47) (i32.const 596))\n    (memory.fill (i32.const 16635) (i32.const 48) (i32.const 501))\n    (memory.fill (i32.const 57002) (i32.const 49) (i32.const 686))\n    (memory.fill (i32.const 34299) (i32.const 50) (i32.const 385))\n    (memory.fill (i32.const 60881) (i32.const 51) (i32.const 903))\n    (memory.fill (i32.const 61445) (i32.const 52) (i32.const 2390))\n    (memory.fill (i32.const 46972) (i32.const 53) (i32.const 1441))\n    (memory.fill (i32.const 25973) (i32.const 54) (i32.const 3162))\n    (memory.fill (i32.const 5566) (i32.const 55) (i32.const 2135))\n    (memory.fill (i32.const 35977) (i32.const 56) (i32.const 519))\n    (memory.fill (i32.const 44892) (i32.const 57) (i32.const 3280))\n    (memory.fill (i32.const 46760) (i32.const 58) (i32.const 1678))\n    (memory.fill (i32.const 46607) (i32.const 59) (i32.const 3168))\n    (memory.fill (i32.const 22449) (i32.const 60) (i32.const 1441))\n    (memory.fill (i32.const 58609) (i32.const 61) (i32.const 663))\n    (memory.fill (i32.const 32261) (i32.const 62) (i32.const 1671))\n    (memory.fill (i32.const 3063) (i32.const 63) (i32.const 721))\n    (memory.fill (i32.const 34025) (i32.const 64) (i32.const 84))\n    (memory.fill (i32.const 33338) (i32.const 65) (i32.const 2029))\n    (memory.fill (i32.const 36810) (i32.const 66) (i32.const 29))\n    (memory.fill (i32.const 19147) (i32.const 67) (i32.const 3034))\n    (memory.fill (i32.const 12616) (i32.const 68) (i32.const 1043))\n    (memory.fill (i32.const 18276) (i32.const 69) (i32.const 3324))\n    (memory.fill (i32.const 4639) (i32.const 70) (i32.const 1091))\n    (memory.fill (i32.const 16158) (i32.const 71) (i32.const 1997))\n    (memory.fill (i32.const 18204) (i32.const 72) (i32.const 2259))\n    (memory.fill (i32.const 50532) (i32.const 73) (i32.const 3189))\n    (memory.fill (i32.const 11028) (i32.const 74) (i32.const 1968))\n    (memory.fill (i32.const 15962) (i32.const 75) (i32.const 1455))\n    (memory.fill (i32.const 45406) (i32.const 76) (i32.const 1177))\n    (memory.fill (i32.const 54137) (i32.const 77) (i32.const 1568))\n    (memory.fill (i32.const 33083) (i32.const 78) (i32.const 1642))\n    (memory.fill (i32.const 61028) (i32.const 79) (i32.const 3284))\n    (memory.fill (i32.const 51729) (i32.const 80) (i32.const 223))\n    (memory.fill (i32.const 4361) (i32.const 81) (i32.const 2171))\n    (memory.fill (i32.const 57514) (i32.const 82) (i32.const 1322))\n    (memory.fill (i32.const 55724) (i32.const 83) (i32.const 2648))\n    (memory.fill (i32.const 24091) (i32.const 84) (i32.const 1045))\n    (memory.fill (i32.const 43183) (i32.const 85) (i32.const 3097))\n    (memory.fill (i32.const 32307) (i32.const 86) (i32.const 2796))\n    (memory.fill (i32.const 3811) (i32.const 87) (i32.const 2010))\n    (memory.fill (i32.const 54856) (i32.const 88) (i32.const 0))\n    (memory.fill (i32.const 49941) (i32.const 89) (i32.const 2069))\n    (memory.fill (i32.const 20411) (i32.const 90) (i32.const 2896))\n    (memory.fill (i32.const 33826) (i32.const 91) (i32.const 192))\n    (memory.fill (i32.const 9402) (i32.const 92) (i32.const 2195))\n    (memory.fill (i32.const 12413) (i32.const 93) (i32.const 24))\n    (memory.fill (i32.const 14091) (i32.const 94) (i32.const 577))\n    (memory.fill (i32.const 44058) (i32.const 95) (i32.const 2089))\n    (memory.fill (i32.const 36735) (i32.const 96) (i32.const 3436))\n    (memory.fill (i32.const 23288) (i32.const 97) (i32.const 2765))\n    (memory.fill (i32.const 6392) (i32.const 98) (i32.const 830))\n    (memory.fill (i32.const 33307) (i32.const 99) (i32.const 1938))\n    (memory.fill (i32.const 21941) (i32.const 100) (i32.const 2750))\n    (memory.copy (i32.const 59214) (i32.const 54248) (i32.const 2098))\n    (memory.copy (i32.const 63026) (i32.const 39224) (i32.const 230))\n    (memory.copy (i32.const 51833) (i32.const 23629) (i32.const 2300))\n    (memory.copy (i32.const 6708) (i32.const 23996) (i32.const 639))\n    (memory.copy (i32.const 6990) (i32.const 33399) (i32.const 1097))\n    (memory.copy (i32.const 19403) (i32.const 10348) (i32.const 3197))\n    (memory.copy (i32.const 27308) (i32.const 54406) (i32.const 100))\n    (memory.copy (i32.const 27221) (i32.const 43682) (i32.const 1717))\n    (memory.copy (i32.const 60528) (i32.const 8629) (i32.const 119))\n    (memory.copy (i32.const 5947) (i32.const 2308) (i32.const 658))\n    (memory.copy (i32.const 4787) (i32.const 51631) (i32.const 2269))\n    (memory.copy (i32.const 12617) (i32.const 19197) (i32.const 833))\n    (memory.copy (i32.const 11854) (i32.const 46505) (i32.const 3300))\n    (memory.copy (i32.const 11376) (i32.const 45012) (i32.const 2281))\n    (memory.copy (i32.const 34186) (i32.const 6697) (i32.const 2572))\n    (memory.copy (i32.const 4936) (i32.const 1690) (i32.const 1328))\n    (memory.copy (i32.const 63164) (i32.const 7637) (i32.const 1670))\n    (memory.copy (i32.const 44568) (i32.const 18344) (i32.const 33))\n    (memory.copy (i32.const 43918) (i32.const 22348) (i32.const 1427))\n    (memory.copy (i32.const 46637) (i32.const 49819) (i32.const 1434))\n    (memory.copy (i32.const 63684) (i32.const 8755) (i32.const 834))\n    (memory.copy (i32.const 33485) (i32.const 20131) (i32.const 3317))\n    (memory.copy (i32.const 40575) (i32.const 54317) (i32.const 3201))\n    (memory.copy (i32.const 25812) (i32.const 59254) (i32.const 2452))\n    (memory.copy (i32.const 19678) (i32.const 56882) (i32.const 346))\n    (memory.copy (i32.const 15852) (i32.const 35914) (i32.const 2430))\n    (memory.copy (i32.const 11824) (i32.const 35574) (i32.const 300))\n    (memory.copy (i32.const 59427) (i32.const 13957) (i32.const 3153))\n    (memory.copy (i32.const 34299) (i32.const 60594) (i32.const 1281))\n    (memory.copy (i32.const 8964) (i32.const 12276) (i32.const 943))\n    (memory.copy (i32.const 2827) (i32.const 10425) (i32.const 1887))\n    (memory.copy (i32.const 43194) (i32.const 43910) (i32.const 738))\n    (memory.copy (i32.const 63038) (i32.const 18949) (i32.const 122))\n    (memory.copy (i32.const 24044) (i32.const 44761) (i32.const 1755))\n    (memory.copy (i32.const 22608) (i32.const 14755) (i32.const 702))\n    (memory.copy (i32.const 11284) (i32.const 26579) (i32.const 1830))\n    (memory.copy (i32.const 23092) (i32.const 20471) (i32.const 1064))\n    (memory.copy (i32.const 57248) (i32.const 54770) (i32.const 2631))\n    (memory.copy (i32.const 25492) (i32.const 1025) (i32.const 3113))\n    (memory.copy (i32.const 49588) (i32.const 44220) (i32.const 975))\n    (memory.copy (i32.const 28280) (i32.const 41722) (i32.const 2336))\n    (memory.copy (i32.const 61289) (i32.const 230) (i32.const 2872))\n    (memory.copy (i32.const 22480) (i32.const 52506) (i32.const 2197))\n    (memory.copy (i32.const 40553) (i32.const 9578) (i32.const 1958))\n    (memory.copy (i32.const 29004) (i32.const 20862) (i32.const 2186))\n    (memory.copy (i32.const 53029) (i32.const 43955) (i32.const 1037))\n    (memory.copy (i32.const 25476) (i32.const 35667) (i32.const 1650))\n    (memory.copy (i32.const 58516) (i32.const 45819) (i32.const 1986))\n    (memory.copy (i32.const 38297) (i32.const 5776) (i32.const 1955))\n    (memory.copy (i32.const 28503) (i32.const 55364) (i32.const 2368))\n    (memory.copy (i32.const 62619) (i32.const 18108) (i32.const 1356))\n    (memory.copy (i32.const 50149) (i32.const 13861) (i32.const 382))\n    (memory.copy (i32.const 16904) (i32.const 36341) (i32.const 1900))\n    (memory.copy (i32.const 48098) (i32.const 11358) (i32.const 2807))\n    (memory.copy (i32.const 28512) (i32.const 40362) (i32.const 323))\n    (memory.copy (i32.const 35506) (i32.const 27856) (i32.const 1670))\n    (memory.copy (i32.const 62970) (i32.const 53332) (i32.const 1341))\n    (memory.copy (i32.const 14133) (i32.const 46312) (i32.const 644))\n    (memory.copy (i32.const 29030) (i32.const 19074) (i32.const 496))\n    (memory.copy (i32.const 44952) (i32.const 47577) (i32.const 2784))\n    (memory.copy (i32.const 39559) (i32.const 44661) (i32.const 1350))\n    (memory.copy (i32.const 10352) (i32.const 29274) (i32.const 1475))\n    (memory.copy (i32.const 46911) (i32.const 46178) (i32.const 1467))\n    (memory.copy (i32.const 4905) (i32.const 28740) (i32.const 1895))\n    (memory.copy (i32.const 38012) (i32.const 57253) (i32.const 1751))\n    (memory.copy (i32.const 26446) (i32.const 27223) (i32.const 1127))\n    (memory.copy (i32.const 58835) (i32.const 24657) (i32.const 1063))\n    (memory.copy (i32.const 61356) (i32.const 38790) (i32.const 766))\n    (memory.copy (i32.const 44160) (i32.const 2284) (i32.const 1520))\n    (memory.copy (i32.const 32740) (i32.const 47237) (i32.const 3014))\n    (memory.copy (i32.const 11148) (i32.const 21260) (i32.const 1011))\n    (memory.copy (i32.const 7665) (i32.const 31612) (i32.const 3034))\n    (memory.copy (i32.const 18044) (i32.const 12987) (i32.const 3320))\n    (memory.copy (i32.const 57306) (i32.const 55905) (i32.const 308))\n    (memory.copy (i32.const 24675) (i32.const 16815) (i32.const 1155))\n    (memory.copy (i32.const 19900) (i32.const 10115) (i32.const 722))\n    (memory.copy (i32.const 2921) (i32.const 5935) (i32.const 2370))\n    (memory.copy (i32.const 32255) (i32.const 50095) (i32.const 2926))\n    (memory.copy (i32.const 15126) (i32.const 17299) (i32.const 2607))\n    (memory.copy (i32.const 45575) (i32.const 28447) (i32.const 2045))\n    (memory.copy (i32.const 55149) (i32.const 36113) (i32.const 2596))\n    (memory.copy (i32.const 28461) (i32.const 54157) (i32.const 1168))\n    (memory.copy (i32.const 47951) (i32.const 53385) (i32.const 3137))\n    (memory.copy (i32.const 30646) (i32.const 45155) (i32.const 2649))\n    (memory.copy (i32.const 5057) (i32.const 4295) (i32.const 52))\n    (memory.copy (i32.const 6692) (i32.const 24195) (i32.const 441))\n    (memory.copy (i32.const 32984) (i32.const 27117) (i32.const 3445))\n    (memory.copy (i32.const 32530) (i32.const 59372) (i32.const 2785))\n    (memory.copy (i32.const 34361) (i32.const 8962) (i32.const 2406))\n    (memory.copy (i32.const 17893) (i32.const 54538) (i32.const 3381))\n    (memory.copy (i32.const 22685) (i32.const 44151) (i32.const 136))\n    (memory.copy (i32.const 59089) (i32.const 7077) (i32.const 1045))\n    (memory.copy (i32.const 42945) (i32.const 55028) (i32.const 2389))\n    (memory.copy (i32.const 44693) (i32.const 20138) (i32.const 877))\n    (memory.copy (i32.const 36810) (i32.const 25196) (i32.const 3447))\n    (memory.copy (i32.const 45742) (i32.const 31888) (i32.const 854))\n    (memory.copy (i32.const 24236) (i32.const 31866) (i32.const 1377))\n    (memory.copy (i32.const 33778) (i32.const 692) (i32.const 1594))\n    (memory.copy (i32.const 60618) (i32.const 18585) (i32.const 2987))\n    (memory.copy (i32.const 50370) (i32.const 41271) (i32.const 1406))\n  )\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n)\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 124) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 124) (i32.const 1517) (i32.const 9))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 1517) (i32.const 2132) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 2132) (i32.const 2827) (i32.const 10))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 2827) (i32.const 2921) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 2921) (i32.const 3538) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 3538) (i32.const 3786) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 3786) (i32.const 4042) (i32.const 97))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 4042) (i32.const 4651) (i32.const 99))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 4651) (i32.const 5057) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 5057) (i32.const 5109) (i32.const 99))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 5109) (i32.const 5291) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 5291) (i32.const 5524) (i32.const 72))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 5524) (i32.const 5691) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 5691) (i32.const 6552) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 6552) (i32.const 7133) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 7133) (i32.const 7665) (i32.const 99))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 7665) (i32.const 8314) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 8314) (i32.const 8360) (i32.const 62))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 8360) (i32.const 8793) (i32.const 86))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 8793) (i32.const 8979) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 8979) (i32.const 9373) (i32.const 79))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 9373) (i32.const 9518) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 9518) (i32.const 9934) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 9934) (i32.const 10087) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 10087) (i32.const 10206) (i32.const 5))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 10206) (i32.const 10230) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 10230) (i32.const 10249) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 10249) (i32.const 11148) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 11148) (i32.const 11356) (i32.const 74))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 11356) (i32.const 11380) (i32.const 93))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 11380) (i32.const 11939) (i32.const 74))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 11939) (i32.const 12159) (i32.const 68))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 12159) (i32.const 12575) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 12575) (i32.const 12969) (i32.const 79))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 12969) (i32.const 13114) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 13114) (i32.const 14133) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 14133) (i32.const 14404) (i32.const 76))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 14404) (i32.const 14428) (i32.const 57))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 14428) (i32.const 14458) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 14458) (i32.const 14580) (i32.const 32))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 14580) (i32.const 14777) (i32.const 89))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 14777) (i32.const 15124) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 15124) (i32.const 15126) (i32.const 36))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 15126) (i32.const 15192) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 15192) (i32.const 15871) (i32.const 96))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 15871) (i32.const 15998) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 15998) (i32.const 17017) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17017) (i32.const 17288) (i32.const 76))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17288) (i32.const 17312) (i32.const 57))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17312) (i32.const 17342) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17342) (i32.const 17464) (i32.const 32))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17464) (i32.const 17661) (i32.const 89))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17661) (i32.const 17727) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17727) (i32.const 17733) (i32.const 5))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17733) (i32.const 17893) (i32.const 96))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 17893) (i32.const 18553) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 18553) (i32.const 18744) (i32.const 42))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 18744) (i32.const 18801) (i32.const 76))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 18801) (i32.const 18825) (i32.const 57))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 18825) (i32.const 18876) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 18876) (i32.const 18885) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 18885) (i32.const 18904) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 18904) (i32.const 19567) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 19567) (i32.const 20403) (i32.const 96))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 20403) (i32.const 21274) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 21274) (i32.const 21364) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 21364) (i32.const 21468) (i32.const 74))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 21468) (i32.const 21492) (i32.const 93))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 21492) (i32.const 22051) (i32.const 74))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 22051) (i32.const 22480) (i32.const 68))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 22480) (i32.const 22685) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 22685) (i32.const 22694) (i32.const 68))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 22694) (i32.const 22821) (i32.const 10))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 22821) (i32.const 22869) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 22869) (i32.const 24107) (i32.const 97))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 24107) (i32.const 24111) (i32.const 37))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 24111) (i32.const 24236) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 24236) (i32.const 24348) (i32.const 72))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 24348) (i32.const 24515) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 24515) (i32.const 24900) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 24900) (i32.const 25136) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 25136) (i32.const 25182) (i32.const 85))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 25182) (i32.const 25426) (i32.const 68))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 25426) (i32.const 25613) (i32.const 89))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 25613) (i32.const 25830) (i32.const 96))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 25830) (i32.const 26446) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 26446) (i32.const 26517) (i32.const 10))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 26517) (i32.const 27468) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 27468) (i32.const 27503) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 27503) (i32.const 27573) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 27573) (i32.const 28245) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 28245) (i32.const 28280) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 28280) (i32.const 29502) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 29502) (i32.const 29629) (i32.const 42))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 29629) (i32.const 30387) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 30387) (i32.const 30646) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 30646) (i32.const 31066) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31066) (i32.const 31131) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31131) (i32.const 31322) (i32.const 42))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31322) (i32.const 31379) (i32.const 76))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31379) (i32.const 31403) (i32.const 57))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31403) (i32.const 31454) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31454) (i32.const 31463) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31463) (i32.const 31482) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31482) (i32.const 31649) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31649) (i32.const 31978) (i32.const 72))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 31978) (i32.const 32145) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 32145) (i32.const 32530) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 32530) (i32.const 32766) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 32766) (i32.const 32812) (i32.const 85))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 32812) (i32.const 33056) (i32.const 68))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 33056) (i32.const 33660) (i32.const 89))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 33660) (i32.const 33752) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 33752) (i32.const 33775) (i32.const 36))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 33775) (i32.const 33778) (i32.const 32))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 33778) (i32.const 34603) (i32.const 9))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 34603) (i32.const 35218) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 35218) (i32.const 35372) (i32.const 10))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 35372) (i32.const 35486) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 35486) (i32.const 35605) (i32.const 5))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 35605) (i32.const 35629) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 35629) (i32.const 35648) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 35648) (i32.const 36547) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 36547) (i32.const 36755) (i32.const 74))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 36755) (i32.const 36767) (i32.const 93))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 36767) (i32.const 36810) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 36810) (i32.const 36839) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 36839) (i32.const 37444) (i32.const 96))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 37444) (i32.const 38060) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 38060) (i32.const 38131) (i32.const 10))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 38131) (i32.const 39082) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 39082) (i32.const 39117) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 39117) (i32.const 39187) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 39187) (i32.const 39859) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 39859) (i32.const 39894) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 39894) (i32.const 40257) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 40257) (i32.const 40344) (i32.const 89))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 40344) (i32.const 40371) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 40371) (i32.const 40804) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 40804) (i32.const 40909) (i32.const 5))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 40909) (i32.const 42259) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 42259) (i32.const 42511) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 42511) (i32.const 42945) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 42945) (i32.const 43115) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 43115) (i32.const 43306) (i32.const 42))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 43306) (i32.const 43363) (i32.const 76))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 43363) (i32.const 43387) (i32.const 57))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 43387) (i32.const 43438) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 43438) (i32.const 43447) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 43447) (i32.const 43466) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 43466) (i32.const 44129) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 44129) (i32.const 44958) (i32.const 96))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 44958) (i32.const 45570) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 45570) (i32.const 45575) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 45575) (i32.const 45640) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 45640) (i32.const 45742) (i32.const 42))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 45742) (i32.const 45832) (i32.const 72))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 45832) (i32.const 45999) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 45999) (i32.const 46384) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 46384) (i32.const 46596) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 46596) (i32.const 46654) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 46654) (i32.const 47515) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 47515) (i32.const 47620) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 47620) (i32.const 47817) (i32.const 79))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 47817) (i32.const 47951) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 47951) (i32.const 48632) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 48632) (i32.const 48699) (i32.const 97))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 48699) (i32.const 48703) (i32.const 37))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 48703) (i32.const 49764) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 49764) (i32.const 49955) (i32.const 42))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 49955) (i32.const 50012) (i32.const 76))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 50012) (i32.const 50036) (i32.const 57))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 50036) (i32.const 50087) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 50087) (i32.const 50096) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 50096) (i32.const 50115) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 50115) (i32.const 50370) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 50370) (i32.const 51358) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 51358) (i32.const 51610) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 51610) (i32.const 51776) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 51776) (i32.const 51833) (i32.const 89))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 51833) (i32.const 52895) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 52895) (i32.const 53029) (i32.const 97))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 53029) (i32.const 53244) (i32.const 68))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 53244) (i32.const 54066) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 54066) (i32.const 54133) (i32.const 97))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 54133) (i32.const 54137) (i32.const 37))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 54137) (i32.const 55198) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 55198) (i32.const 55389) (i32.const 42))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 55389) (i32.const 55446) (i32.const 76))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 55446) (i32.const 55470) (i32.const 57))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 55470) (i32.const 55521) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 55521) (i32.const 55530) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 55530) (i32.const 55549) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 55549) (i32.const 56212) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 56212) (i32.const 57048) (i32.const 96))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 57048) (i32.const 58183) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 58183) (i32.const 58202) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 58202) (i32.const 58516) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 58516) (i32.const 58835) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 58835) (i32.const 58855) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 58855) (i32.const 59089) (i32.const 95))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 59089) (i32.const 59145) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 59145) (i32.const 59677) (i32.const 99))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 59677) (i32.const 60134) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60134) (i32.const 60502) (i32.const 89))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60502) (i32.const 60594) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60594) (i32.const 60617) (i32.const 36))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60617) (i32.const 60618) (i32.const 32))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60618) (i32.const 60777) (i32.const 42))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60777) (i32.const 60834) (i32.const 76))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60834) (i32.const 60858) (i32.const 57))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60858) (i32.const 60909) (i32.const 59))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60909) (i32.const 60918) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60918) (i32.const 60937) (i32.const 41))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 60937) (i32.const 61600) (i32.const 83))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 61600) (i32.const 62436) (i32.const 96))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 62436) (i32.const 63307) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 63307) (i32.const 63397) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 63397) (i32.const 63501) (i32.const 74))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 63501) (i32.const 63525) (i32.const 93))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 63525) (i32.const 63605) (i32.const 74))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 63605) (i32.const 63704) (i32.const 100))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 63704) (i32.const 63771) (i32.const 97))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 63771) (i32.const 63775) (i32.const 37))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 63775) (i32.const 64311) (i32.const 77))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 64311) (i32.const 64331) (i32.const 26))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 64331) (i32.const 64518) (i32.const 92))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 64518) (i32.const 64827) (i32.const 11))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 64827) (i32.const 64834) (i32.const 26))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 64834) (i32.const 65536) (i32.const 0))\n               (i32.const -1))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (nop))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i64.const 13) (i64.const 2) (i64.const 3)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i64.const 25) (i64.const 15) (i64.const 2)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i64.const 13) (i64.const 25) (i64.const 3)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i64.const 20) (i64.const 22) (i64.const 4)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i64.const 25) (i64.const 1) (i64.const 3)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i64.const 10) (i64.const 12) (i64.const 7)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (func (export \"test\")\n    (memory.copy (i64.const 12) (i64.const 10) (i64.const 7)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 0) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 0) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 19))\n(assert_return (invoke \"load8_u\" (i32.const 218)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 417)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 616)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 815)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1014)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1213)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1412)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1611)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1810)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2009)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2208)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2407)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2606)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2805)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3004)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3203)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3402)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3601)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3800)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3999)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65490)) (i32.const 0))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 0) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\\14\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65515) (i32.const 0) (i32.const 39))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 19))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 20))\n(assert_return (invoke \"load8_u\" (i32.const 219)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 418)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 617)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 816)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1015)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1214)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1413)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1612)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1811)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2010)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2209)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2408)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2607)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2806)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3005)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3204)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3403)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3602)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3801)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4000)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4199)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4398)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4597)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4796)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4995)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5194)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5393)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5592)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5791)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5990)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6189)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6388)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6587)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6786)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6985)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7184)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7383)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7582)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7781)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7980)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8179)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8378)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8577)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8776)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8975)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9174)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9373)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9572)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9771)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9970)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10169)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10368)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10567)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10766)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10965)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11164)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11363)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11562)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11761)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11960)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12159)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12358)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12557)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12756)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12955)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13154)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13353)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13552)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13751)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13950)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14149)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14348)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14547)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14746)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14945)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15144)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15343)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15542)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15741)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15940)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16139)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16338)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16537)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16736)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16935)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17134)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17333)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17532)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17731)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17930)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18129)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18328)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18527)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18726)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18925)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19124)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19323)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19522)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19721)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19920)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20119)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20318)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20517)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20716)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20915)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21114)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21313)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21512)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21711)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21910)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22109)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22308)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22507)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22706)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22905)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23104)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23303)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23502)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23701)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23900)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24099)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24298)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24497)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24696)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24895)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25094)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25293)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25492)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25691)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25890)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26089)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26288)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26487)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26686)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26885)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27084)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27283)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27482)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27681)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27880)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28079)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28278)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28477)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28676)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28875)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29074)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29273)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29472)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29671)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29870)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30069)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30268)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30467)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30666)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30865)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31064)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31263)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31462)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31661)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31860)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32059)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32258)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32457)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32656)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32855)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33054)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33253)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33452)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33651)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33850)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34049)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34248)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34447)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34646)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34845)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35044)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35243)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35442)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35641)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35840)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36039)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36238)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36437)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36636)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36835)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37034)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37233)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37432)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37631)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37830)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38029)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38228)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38427)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38626)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38825)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39024)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39223)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39422)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39621)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39820)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40019)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40218)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40417)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40616)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40815)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41014)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41213)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41412)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41611)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41810)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42009)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42208)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42407)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42606)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42805)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43004)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43203)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43402)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43601)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43800)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43999)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65491)) (i32.const 0))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 65516) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65515) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\\14\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 65515) (i32.const 39))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 19))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 20))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65486) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 65486) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65487)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65488)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65489)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65490)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65491)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65492)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65493)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65494)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65495)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65496)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65497)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65498)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65499)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65500)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65501)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65502)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65503)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65504)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65505)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65486) (i32.const 65516) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65506) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 65506) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65507)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65508)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65509)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65510)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65511)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65512)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65513)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65514)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65515)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65506) (i32.const 65516) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 65516) (i32.const 40))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1  )\n  (data (i32.const 65516) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 65516) (i32.const 4294963200))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61490)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61689)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61888)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62087)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62286)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62485)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62684)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62883)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63082)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63281)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63480)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63679)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63878)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64077)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64276)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64475)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64674)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64873)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65072)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65271)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65470)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65517)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 65518)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 65519)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 65520)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 65521)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 65522)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 65523)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 65524)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 65525)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 65526)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 65527)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 65528)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 65529)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 65530)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 65531)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 65532)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 65533)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 65534)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 65535)) (i32.const 19))\n\n(module\n  (memory (export \"mem\") 1 1 )\n  (data (i32.const 61440) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\")\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (memory.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(assert_trap (invoke \"run\" (i32.const 65516) (i32.const 61440) (i32.const 4294967040))\n             \"out of bounds memory access\")\n\n(assert_return (invoke \"load8_u\" (i32.const 198)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 397)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 596)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 795)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 994)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1193)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1392)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1591)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1790)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1989)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2188)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2387)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2586)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2785)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2984)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3183)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3382)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3581)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3780)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 3979)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4178)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4377)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4576)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4775)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 4974)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5173)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5372)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5571)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5770)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 5969)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6168)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6367)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6566)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6765)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 6964)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7163)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7362)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7561)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7760)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7959)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8158)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8357)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8556)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8755)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8954)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9153)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9352)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9551)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9750)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9949)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10148)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10347)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10546)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10745)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10944)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11143)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11342)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11541)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11740)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11939)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12138)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12337)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12536)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12735)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12934)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13133)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13332)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13531)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13730)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 13929)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14128)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14327)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14526)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14725)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14924)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15123)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15322)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15521)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15720)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 15919)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16118)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16317)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16516)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16715)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 16914)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17113)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17312)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17511)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17710)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 17909)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18108)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18307)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18506)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18705)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18904)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19103)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19302)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19501)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19700)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19899)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20098)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20297)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20496)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20695)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20894)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21093)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21292)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21491)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21690)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21889)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22088)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22287)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22486)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22685)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22884)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23083)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23282)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23481)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23680)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23879)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24078)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24277)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24476)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24675)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24874)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25073)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25272)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25471)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25670)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25869)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26068)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26267)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26466)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26665)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26864)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27063)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27262)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27461)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27660)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27859)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28058)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28257)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28456)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28655)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28854)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29053)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29252)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29451)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29650)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29849)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30048)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30247)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30446)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30645)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 30844)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31043)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31242)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31441)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31640)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 31839)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32038)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32237)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32436)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32635)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 32834)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33033)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33232)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33431)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33630)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 33829)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34028)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34227)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34426)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34625)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 34824)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35023)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35222)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35421)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35620)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 35819)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36018)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36217)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36416)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36615)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 36814)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37013)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37212)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37411)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37610)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 37809)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38008)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38207)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38406)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38605)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 38804)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39003)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39202)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39401)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39600)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39799)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 39998)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40197)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40396)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40595)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40794)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 40993)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41192)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41391)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41590)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41789)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 41988)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42187)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42386)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42585)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42784)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 42983)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43182)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43381)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43580)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43779)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 43978)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44177)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44376)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44575)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44774)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 44973)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45172)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45371)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45570)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45769)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 45968)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46167)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46366)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46565)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46764)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 46963)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47162)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47361)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47560)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47759)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 47958)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48157)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48356)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48555)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48754)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 48953)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49152)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49351)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49550)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49749)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 49948)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50147)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50346)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50545)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50744)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 50943)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51142)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51341)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51540)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51739)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 51938)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52137)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52336)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52535)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52734)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 52933)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53132)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53331)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53530)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53729)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 53928)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54127)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54326)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54525)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54724)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 54923)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55122)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55321)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55520)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55719)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 55918)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56117)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56316)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56515)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56714)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 56913)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57112)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57311)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 57908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 58903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 59898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 60893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61440)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61441)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 61442)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 61443)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 61444)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 61445)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 61446)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 61447)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 61448)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 61449)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 61450)) (i32.const 10))\n(assert_return (invoke \"load8_u\" (i32.const 61451)) (i32.const 11))\n(assert_return (invoke \"load8_u\" (i32.const 61452)) (i32.const 12))\n(assert_return (invoke \"load8_u\" (i32.const 61453)) (i32.const 13))\n(assert_return (invoke \"load8_u\" (i32.const 61454)) (i32.const 14))\n(assert_return (invoke \"load8_u\" (i32.const 61455)) (i32.const 15))\n(assert_return (invoke \"load8_u\" (i32.const 61456)) (i32.const 16))\n(assert_return (invoke \"load8_u\" (i32.const 61457)) (i32.const 17))\n(assert_return (invoke \"load8_u\" (i32.const 61458)) (i32.const 18))\n(assert_return (invoke \"load8_u\" (i32.const 61459)) (i32.const 19))\n(assert_return (invoke \"load8_u\" (i32.const 61510)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61709)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 61908)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62107)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62306)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62505)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62704)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 62903)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63102)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63301)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63500)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63699)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 63898)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64097)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64296)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64495)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64694)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 64893)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65092)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65291)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 65490)) (i32.const 0))\n\n(assert_invalid\n  (module\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i64.const 20) (i64.const 30))))\n  \"unknown memory 0\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i32.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f32.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (i64.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.copy (f64.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.fill (i64.const 10) (i32.const 0x55) (i64.const 10))\n    (memory.copy (i64.const 9) (i64.const 10) (i64.const 5)))\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n)\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 9) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 9) (i64.const 20) (i32.const 85))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 20) (i64.const 65536) (i32.const 0))\n               (i64.const -1))\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.fill (i64.const 10) (i32.const 0x55) (i64.const 10))\n    (memory.copy (i64.const 16) (i64.const 15) (i64.const 5)))\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n)\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 10) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 10) (i64.const 21) (i32.const 85))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 21) (i64.const 65536) (i32.const 0))\n               (i64.const -1))\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0xFF00) (i64.const 0x8000) (i64.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0xFFFFFF00) (i64.const 0x4000) (i64.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0x8000) (i64.const 0xFF00) (i64.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n (memory i64 1 1)\n (func (export \"test\")\n   (memory.copy (i64.const 0x4000) (i64.const 0xFFFFFF00) (i64.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.fill (i64.const 0x0000) (i32.const 0x55) (i64.const 0x8000))\n    (memory.fill (i64.const 0x8000) (i32.const 0xAA) (i64.const 0x8000))\n    (memory.copy (i64.const 0x9000) (i64.const 0x7000) (i64.const 0)))\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n)\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 32768) (i32.const 85))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 32768) (i64.const 65536) (i32.const 170))\n               (i64.const -1))\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0x10000) (i64.const 0x7000) (i64.const 0))))\n(invoke \"test\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0x20000) (i64.const 0x7000) (i64.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0x9000) (i64.const 0x10000) (i64.const 0))))\n(invoke \"test\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0x9000) (i64.const 0x20000) (i64.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0x10000) (i64.const 0x10000) (i64.const 0))))\n(invoke \"test\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.copy (i64.const 0x20000) (i64.const 0x20000) (i64.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  (func (export \"test\")\n    (memory.fill (i64.const 17767) (i32.const 1) (i64.const 1344))\n    (memory.fill (i64.const 39017) (i32.const 2) (i64.const 1055))\n    (memory.fill (i64.const 56401) (i32.const 3) (i64.const 988))\n    (memory.fill (i64.const 37962) (i32.const 4) (i64.const 322))\n    (memory.fill (i64.const 7977) (i32.const 5) (i64.const 1994))\n    (memory.fill (i64.const 22714) (i32.const 6) (i64.const 3036))\n    (memory.fill (i64.const 16882) (i32.const 7) (i64.const 2372))\n    (memory.fill (i64.const 43491) (i32.const 8) (i64.const 835))\n    (memory.fill (i64.const 124) (i32.const 9) (i64.const 1393))\n    (memory.fill (i64.const 2132) (i32.const 10) (i64.const 2758))\n    (memory.fill (i64.const 8987) (i32.const 11) (i64.const 3098))\n    (memory.fill (i64.const 52711) (i32.const 12) (i64.const 741))\n    (memory.fill (i64.const 3958) (i32.const 13) (i64.const 2823))\n    (memory.fill (i64.const 49715) (i32.const 14) (i64.const 1280))\n    (memory.fill (i64.const 50377) (i32.const 15) (i64.const 1466))\n    (memory.fill (i64.const 20493) (i32.const 16) (i64.const 3158))\n    (memory.fill (i64.const 47665) (i32.const 17) (i64.const 544))\n    (memory.fill (i64.const 12451) (i32.const 18) (i64.const 2669))\n    (memory.fill (i64.const 24869) (i32.const 19) (i64.const 2651))\n    (memory.fill (i64.const 45317) (i32.const 20) (i64.const 1570))\n    (memory.fill (i64.const 43096) (i32.const 21) (i64.const 1691))\n    (memory.fill (i64.const 33886) (i32.const 22) (i64.const 646))\n    (memory.fill (i64.const 48555) (i32.const 23) (i64.const 1858))\n    (memory.fill (i64.const 53453) (i32.const 24) (i64.const 2657))\n    (memory.fill (i64.const 30363) (i32.const 25) (i64.const 981))\n    (memory.fill (i64.const 9300) (i32.const 26) (i64.const 1807))\n    (memory.fill (i64.const 50190) (i32.const 27) (i64.const 487))\n    (memory.fill (i64.const 62753) (i32.const 28) (i64.const 530))\n    (memory.fill (i64.const 36316) (i32.const 29) (i64.const 943))\n    (memory.fill (i64.const 6768) (i32.const 30) (i64.const 381))\n    (memory.fill (i64.const 51262) (i32.const 31) (i64.const 3089))\n    (memory.fill (i64.const 49729) (i32.const 32) (i64.const 658))\n    (memory.fill (i64.const 44540) (i32.const 33) (i64.const 1702))\n    (memory.fill (i64.const 33342) (i32.const 34) (i64.const 1092))\n    (memory.fill (i64.const 50814) (i32.const 35) (i64.const 1410))\n    (memory.fill (i64.const 47594) (i32.const 36) (i64.const 2204))\n    (memory.fill (i64.const 54123) (i32.const 37) (i64.const 2394))\n    (memory.fill (i64.const 55183) (i32.const 38) (i64.const 250))\n    (memory.fill (i64.const 22620) (i32.const 39) (i64.const 2097))\n    (memory.fill (i64.const 17132) (i32.const 40) (i64.const 3264))\n    (memory.fill (i64.const 54331) (i32.const 41) (i64.const 3299))\n    (memory.fill (i64.const 39474) (i32.const 42) (i64.const 2796))\n    (memory.fill (i64.const 36156) (i32.const 43) (i64.const 2070))\n    (memory.fill (i64.const 35308) (i32.const 44) (i64.const 2763))\n    (memory.fill (i64.const 32731) (i32.const 45) (i64.const 312))\n    (memory.fill (i64.const 63746) (i32.const 46) (i64.const 192))\n    (memory.fill (i64.const 30974) (i32.const 47) (i64.const 596))\n    (memory.fill (i64.const 16635) (i32.const 48) (i64.const 501))\n    (memory.fill (i64.const 57002) (i32.const 49) (i64.const 686))\n    (memory.fill (i64.const 34299) (i32.const 50) (i64.const 385))\n    (memory.fill (i64.const 60881) (i32.const 51) (i64.const 903))\n    (memory.fill (i64.const 61445) (i32.const 52) (i64.const 2390))\n    (memory.fill (i64.const 46972) (i32.const 53) (i64.const 1441))\n    (memory.fill (i64.const 25973) (i32.const 54) (i64.const 3162))\n    (memory.fill (i64.const 5566) (i32.const 55) (i64.const 2135))\n    (memory.fill (i64.const 35977) (i32.const 56) (i64.const 519))\n    (memory.fill (i64.const 44892) (i32.const 57) (i64.const 3280))\n    (memory.fill (i64.const 46760) (i32.const 58) (i64.const 1678))\n    (memory.fill (i64.const 46607) (i32.const 59) (i64.const 3168))\n    (memory.fill (i64.const 22449) (i32.const 60) (i64.const 1441))\n    (memory.fill (i64.const 58609) (i32.const 61) (i64.const 663))\n    (memory.fill (i64.const 32261) (i32.const 62) (i64.const 1671))\n    (memory.fill (i64.const 3063) (i32.const 63) (i64.const 721))\n    (memory.fill (i64.const 34025) (i32.const 64) (i64.const 84))\n    (memory.fill (i64.const 33338) (i32.const 65) (i64.const 2029))\n    (memory.fill (i64.const 36810) (i32.const 66) (i64.const 29))\n    (memory.fill (i64.const 19147) (i32.const 67) (i64.const 3034))\n    (memory.fill (i64.const 12616) (i32.const 68) (i64.const 1043))\n    (memory.fill (i64.const 18276) (i32.const 69) (i64.const 3324))\n    (memory.fill (i64.const 4639) (i32.const 70) (i64.const 1091))\n    (memory.fill (i64.const 16158) (i32.const 71) (i64.const 1997))\n    (memory.fill (i64.const 18204) (i32.const 72) (i64.const 2259))\n    (memory.fill (i64.const 50532) (i32.const 73) (i64.const 3189))\n    (memory.fill (i64.const 11028) (i32.const 74) (i64.const 1968))\n    (memory.fill (i64.const 15962) (i32.const 75) (i64.const 1455))\n    (memory.fill (i64.const 45406) (i32.const 76) (i64.const 1177))\n    (memory.fill (i64.const 54137) (i32.const 77) (i64.const 1568))\n    (memory.fill (i64.const 33083) (i32.const 78) (i64.const 1642))\n    (memory.fill (i64.const 61028) (i32.const 79) (i64.const 3284))\n    (memory.fill (i64.const 51729) (i32.const 80) (i64.const 223))\n    (memory.fill (i64.const 4361) (i32.const 81) (i64.const 2171))\n    (memory.fill (i64.const 57514) (i32.const 82) (i64.const 1322))\n    (memory.fill (i64.const 55724) (i32.const 83) (i64.const 2648))\n    (memory.fill (i64.const 24091) (i32.const 84) (i64.const 1045))\n    (memory.fill (i64.const 43183) (i32.const 85) (i64.const 3097))\n    (memory.fill (i64.const 32307) (i32.const 86) (i64.const 2796))\n    (memory.fill (i64.const 3811) (i32.const 87) (i64.const 2010))\n    (memory.fill (i64.const 54856) (i32.const 88) (i64.const 0))\n    (memory.fill (i64.const 49941) (i32.const 89) (i64.const 2069))\n    (memory.fill (i64.const 20411) (i32.const 90) (i64.const 2896))\n    (memory.fill (i64.const 33826) (i32.const 91) (i64.const 192))\n    (memory.fill (i64.const 9402) (i32.const 92) (i64.const 2195))\n    (memory.fill (i64.const 12413) (i32.const 93) (i64.const 24))\n    (memory.fill (i64.const 14091) (i32.const 94) (i64.const 577))\n    (memory.fill (i64.const 44058) (i32.const 95) (i64.const 2089))\n    (memory.fill (i64.const 36735) (i32.const 96) (i64.const 3436))\n    (memory.fill (i64.const 23288) (i32.const 97) (i64.const 2765))\n    (memory.fill (i64.const 6392) (i32.const 98) (i64.const 830))\n    (memory.fill (i64.const 33307) (i32.const 99) (i64.const 1938))\n    (memory.fill (i64.const 21941) (i32.const 100) (i64.const 2750))\n    (memory.copy (i64.const 59214) (i64.const 54248) (i64.const 2098))\n    (memory.copy (i64.const 63026) (i64.const 39224) (i64.const 230))\n    (memory.copy (i64.const 51833) (i64.const 23629) (i64.const 2300))\n    (memory.copy (i64.const 6708) (i64.const 23996) (i64.const 639))\n    (memory.copy (i64.const 6990) (i64.const 33399) (i64.const 1097))\n    (memory.copy (i64.const 19403) (i64.const 10348) (i64.const 3197))\n    (memory.copy (i64.const 27308) (i64.const 54406) (i64.const 100))\n    (memory.copy (i64.const 27221) (i64.const 43682) (i64.const 1717))\n    (memory.copy (i64.const 60528) (i64.const 8629) (i64.const 119))\n    (memory.copy (i64.const 5947) (i64.const 2308) (i64.const 658))\n    (memory.copy (i64.const 4787) (i64.const 51631) (i64.const 2269))\n    (memory.copy (i64.const 12617) (i64.const 19197) (i64.const 833))\n    (memory.copy (i64.const 11854) (i64.const 46505) (i64.const 3300))\n    (memory.copy (i64.const 11376) (i64.const 45012) (i64.const 2281))\n    (memory.copy (i64.const 34186) (i64.const 6697) (i64.const 2572))\n    (memory.copy (i64.const 4936) (i64.const 1690) (i64.const 1328))\n    (memory.copy (i64.const 63164) (i64.const 7637) (i64.const 1670))\n    (memory.copy (i64.const 44568) (i64.const 18344) (i64.const 33))\n    (memory.copy (i64.const 43918) (i64.const 22348) (i64.const 1427))\n    (memory.copy (i64.const 46637) (i64.const 49819) (i64.const 1434))\n    (memory.copy (i64.const 63684) (i64.const 8755) (i64.const 834))\n    (memory.copy (i64.const 33485) (i64.const 20131) (i64.const 3317))\n    (memory.copy (i64.const 40575) (i64.const 54317) (i64.const 3201))\n    (memory.copy (i64.const 25812) (i64.const 59254) (i64.const 2452))\n    (memory.copy (i64.const 19678) (i64.const 56882) (i64.const 346))\n    (memory.copy (i64.const 15852) (i64.const 35914) (i64.const 2430))\n    (memory.copy (i64.const 11824) (i64.const 35574) (i64.const 300))\n    (memory.copy (i64.const 59427) (i64.const 13957) (i64.const 3153))\n    (memory.copy (i64.const 34299) (i64.const 60594) (i64.const 1281))\n    (memory.copy (i64.const 8964) (i64.const 12276) (i64.const 943))\n    (memory.copy (i64.const 2827) (i64.const 10425) (i64.const 1887))\n    (memory.copy (i64.const 43194) (i64.const 43910) (i64.const 738))\n    (memory.copy (i64.const 63038) (i64.const 18949) (i64.const 122))\n    (memory.copy (i64.const 24044) (i64.const 44761) (i64.const 1755))\n    (memory.copy (i64.const 22608) (i64.const 14755) (i64.const 702))\n    (memory.copy (i64.const 11284) (i64.const 26579) (i64.const 1830))\n    (memory.copy (i64.const 23092) (i64.const 20471) (i64.const 1064))\n    (memory.copy (i64.const 57248) (i64.const 54770) (i64.const 2631))\n    (memory.copy (i64.const 25492) (i64.const 1025) (i64.const 3113))\n    (memory.copy (i64.const 49588) (i64.const 44220) (i64.const 975))\n    (memory.copy (i64.const 28280) (i64.const 41722) (i64.const 2336))\n    (memory.copy (i64.const 61289) (i64.const 230) (i64.const 2872))\n    (memory.copy (i64.const 22480) (i64.const 52506) (i64.const 2197))\n    (memory.copy (i64.const 40553) (i64.const 9578) (i64.const 1958))\n    (memory.copy (i64.const 29004) (i64.const 20862) (i64.const 2186))\n    (memory.copy (i64.const 53029) (i64.const 43955) (i64.const 1037))\n    (memory.copy (i64.const 25476) (i64.const 35667) (i64.const 1650))\n    (memory.copy (i64.const 58516) (i64.const 45819) (i64.const 1986))\n    (memory.copy (i64.const 38297) (i64.const 5776) (i64.const 1955))\n    (memory.copy (i64.const 28503) (i64.const 55364) (i64.const 2368))\n    (memory.copy (i64.const 62619) (i64.const 18108) (i64.const 1356))\n    (memory.copy (i64.const 50149) (i64.const 13861) (i64.const 382))\n    (memory.copy (i64.const 16904) (i64.const 36341) (i64.const 1900))\n    (memory.copy (i64.const 48098) (i64.const 11358) (i64.const 2807))\n    (memory.copy (i64.const 28512) (i64.const 40362) (i64.const 323))\n    (memory.copy (i64.const 35506) (i64.const 27856) (i64.const 1670))\n    (memory.copy (i64.const 62970) (i64.const 53332) (i64.const 1341))\n    (memory.copy (i64.const 14133) (i64.const 46312) (i64.const 644))\n    (memory.copy (i64.const 29030) (i64.const 19074) (i64.const 496))\n    (memory.copy (i64.const 44952) (i64.const 47577) (i64.const 2784))\n    (memory.copy (i64.const 39559) (i64.const 44661) (i64.const 1350))\n    (memory.copy (i64.const 10352) (i64.const 29274) (i64.const 1475))\n    (memory.copy (i64.const 46911) (i64.const 46178) (i64.const 1467))\n    (memory.copy (i64.const 4905) (i64.const 28740) (i64.const 1895))\n    (memory.copy (i64.const 38012) (i64.const 57253) (i64.const 1751))\n    (memory.copy (i64.const 26446) (i64.const 27223) (i64.const 1127))\n    (memory.copy (i64.const 58835) (i64.const 24657) (i64.const 1063))\n    (memory.copy (i64.const 61356) (i64.const 38790) (i64.const 766))\n    (memory.copy (i64.const 44160) (i64.const 2284) (i64.const 1520))\n    (memory.copy (i64.const 32740) (i64.const 47237) (i64.const 3014))\n    (memory.copy (i64.const 11148) (i64.const 21260) (i64.const 1011))\n    (memory.copy (i64.const 7665) (i64.const 31612) (i64.const 3034))\n    (memory.copy (i64.const 18044) (i64.const 12987) (i64.const 3320))\n    (memory.copy (i64.const 57306) (i64.const 55905) (i64.const 308))\n    (memory.copy (i64.const 24675) (i64.const 16815) (i64.const 1155))\n    (memory.copy (i64.const 19900) (i64.const 10115) (i64.const 722))\n    (memory.copy (i64.const 2921) (i64.const 5935) (i64.const 2370))\n    (memory.copy (i64.const 32255) (i64.const 50095) (i64.const 2926))\n    (memory.copy (i64.const 15126) (i64.const 17299) (i64.const 2607))\n    (memory.copy (i64.const 45575) (i64.const 28447) (i64.const 2045))\n    (memory.copy (i64.const 55149) (i64.const 36113) (i64.const 2596))\n    (memory.copy (i64.const 28461) (i64.const 54157) (i64.const 1168))\n    (memory.copy (i64.const 47951) (i64.const 53385) (i64.const 3137))\n    (memory.copy (i64.const 30646) (i64.const 45155) (i64.const 2649))\n    (memory.copy (i64.const 5057) (i64.const 4295) (i64.const 52))\n    (memory.copy (i64.const 6692) (i64.const 24195) (i64.const 441))\n    (memory.copy (i64.const 32984) (i64.const 27117) (i64.const 3445))\n    (memory.copy (i64.const 32530) (i64.const 59372) (i64.const 2785))\n    (memory.copy (i64.const 34361) (i64.const 8962) (i64.const 2406))\n    (memory.copy (i64.const 17893) (i64.const 54538) (i64.const 3381))\n    (memory.copy (i64.const 22685) (i64.const 44151) (i64.const 136))\n    (memory.copy (i64.const 59089) (i64.const 7077) (i64.const 1045))\n    (memory.copy (i64.const 42945) (i64.const 55028) (i64.const 2389))\n    (memory.copy (i64.const 44693) (i64.const 20138) (i64.const 877))\n    (memory.copy (i64.const 36810) (i64.const 25196) (i64.const 3447))\n    (memory.copy (i64.const 45742) (i64.const 31888) (i64.const 854))\n    (memory.copy (i64.const 24236) (i64.const 31866) (i64.const 1377))\n    (memory.copy (i64.const 33778) (i64.const 692) (i64.const 1594))\n    (memory.copy (i64.const 60618) (i64.const 18585) (i64.const 2987))\n    (memory.copy (i64.const 50370) (i64.const 41271) (i64.const 1406))\n  )\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n)\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 124) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 124) (i64.const 1517) (i32.const 9))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 1517) (i64.const 2132) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 2132) (i64.const 2827) (i32.const 10))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 2827) (i64.const 2921) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 2921) (i64.const 3538) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 3538) (i64.const 3786) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 3786) (i64.const 4042) (i32.const 97))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 4042) (i64.const 4651) (i32.const 99))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 4651) (i64.const 5057) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 5057) (i64.const 5109) (i32.const 99))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 5109) (i64.const 5291) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 5291) (i64.const 5524) (i32.const 72))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 5524) (i64.const 5691) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 5691) (i64.const 6552) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 6552) (i64.const 7133) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 7133) (i64.const 7665) (i32.const 99))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 7665) (i64.const 8314) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 8314) (i64.const 8360) (i32.const 62))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 8360) (i64.const 8793) (i32.const 86))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 8793) (i64.const 8979) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 8979) (i64.const 9373) (i32.const 79))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 9373) (i64.const 9518) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 9518) (i64.const 9934) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 9934) (i64.const 10087) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 10087) (i64.const 10206) (i32.const 5))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 10206) (i64.const 10230) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 10230) (i64.const 10249) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 10249) (i64.const 11148) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 11148) (i64.const 11356) (i32.const 74))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 11356) (i64.const 11380) (i32.const 93))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 11380) (i64.const 11939) (i32.const 74))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 11939) (i64.const 12159) (i32.const 68))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 12159) (i64.const 12575) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 12575) (i64.const 12969) (i32.const 79))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 12969) (i64.const 13114) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 13114) (i64.const 14133) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 14133) (i64.const 14404) (i32.const 76))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 14404) (i64.const 14428) (i32.const 57))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 14428) (i64.const 14458) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 14458) (i64.const 14580) (i32.const 32))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 14580) (i64.const 14777) (i32.const 89))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 14777) (i64.const 15124) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 15124) (i64.const 15126) (i32.const 36))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 15126) (i64.const 15192) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 15192) (i64.const 15871) (i32.const 96))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 15871) (i64.const 15998) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 15998) (i64.const 17017) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17017) (i64.const 17288) (i32.const 76))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17288) (i64.const 17312) (i32.const 57))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17312) (i64.const 17342) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17342) (i64.const 17464) (i32.const 32))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17464) (i64.const 17661) (i32.const 89))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17661) (i64.const 17727) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17727) (i64.const 17733) (i32.const 5))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17733) (i64.const 17893) (i32.const 96))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 17893) (i64.const 18553) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 18553) (i64.const 18744) (i32.const 42))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 18744) (i64.const 18801) (i32.const 76))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 18801) (i64.const 18825) (i32.const 57))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 18825) (i64.const 18876) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 18876) (i64.const 18885) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 18885) (i64.const 18904) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 18904) (i64.const 19567) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 19567) (i64.const 20403) (i32.const 96))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 20403) (i64.const 21274) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 21274) (i64.const 21364) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 21364) (i64.const 21468) (i32.const 74))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 21468) (i64.const 21492) (i32.const 93))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 21492) (i64.const 22051) (i32.const 74))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 22051) (i64.const 22480) (i32.const 68))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 22480) (i64.const 22685) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 22685) (i64.const 22694) (i32.const 68))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 22694) (i64.const 22821) (i32.const 10))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 22821) (i64.const 22869) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 22869) (i64.const 24107) (i32.const 97))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 24107) (i64.const 24111) (i32.const 37))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 24111) (i64.const 24236) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 24236) (i64.const 24348) (i32.const 72))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 24348) (i64.const 24515) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 24515) (i64.const 24900) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 24900) (i64.const 25136) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 25136) (i64.const 25182) (i32.const 85))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 25182) (i64.const 25426) (i32.const 68))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 25426) (i64.const 25613) (i32.const 89))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 25613) (i64.const 25830) (i32.const 96))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 25830) (i64.const 26446) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 26446) (i64.const 26517) (i32.const 10))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 26517) (i64.const 27468) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 27468) (i64.const 27503) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 27503) (i64.const 27573) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 27573) (i64.const 28245) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 28245) (i64.const 28280) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 28280) (i64.const 29502) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 29502) (i64.const 29629) (i32.const 42))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 29629) (i64.const 30387) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 30387) (i64.const 30646) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 30646) (i64.const 31066) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31066) (i64.const 31131) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31131) (i64.const 31322) (i32.const 42))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31322) (i64.const 31379) (i32.const 76))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31379) (i64.const 31403) (i32.const 57))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31403) (i64.const 31454) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31454) (i64.const 31463) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31463) (i64.const 31482) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31482) (i64.const 31649) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31649) (i64.const 31978) (i32.const 72))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 31978) (i64.const 32145) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 32145) (i64.const 32530) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 32530) (i64.const 32766) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 32766) (i64.const 32812) (i32.const 85))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 32812) (i64.const 33056) (i32.const 68))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 33056) (i64.const 33660) (i32.const 89))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 33660) (i64.const 33752) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 33752) (i64.const 33775) (i32.const 36))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 33775) (i64.const 33778) (i32.const 32))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 33778) (i64.const 34603) (i32.const 9))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 34603) (i64.const 35218) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 35218) (i64.const 35372) (i32.const 10))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 35372) (i64.const 35486) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 35486) (i64.const 35605) (i32.const 5))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 35605) (i64.const 35629) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 35629) (i64.const 35648) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 35648) (i64.const 36547) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 36547) (i64.const 36755) (i32.const 74))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 36755) (i64.const 36767) (i32.const 93))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 36767) (i64.const 36810) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 36810) (i64.const 36839) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 36839) (i64.const 37444) (i32.const 96))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 37444) (i64.const 38060) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 38060) (i64.const 38131) (i32.const 10))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 38131) (i64.const 39082) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 39082) (i64.const 39117) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 39117) (i64.const 39187) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 39187) (i64.const 39859) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 39859) (i64.const 39894) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 39894) (i64.const 40257) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 40257) (i64.const 40344) (i32.const 89))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 40344) (i64.const 40371) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 40371) (i64.const 40804) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 40804) (i64.const 40909) (i32.const 5))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 40909) (i64.const 42259) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 42259) (i64.const 42511) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 42511) (i64.const 42945) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 42945) (i64.const 43115) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 43115) (i64.const 43306) (i32.const 42))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 43306) (i64.const 43363) (i32.const 76))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 43363) (i64.const 43387) (i32.const 57))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 43387) (i64.const 43438) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 43438) (i64.const 43447) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 43447) (i64.const 43466) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 43466) (i64.const 44129) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 44129) (i64.const 44958) (i32.const 96))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 44958) (i64.const 45570) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 45570) (i64.const 45575) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 45575) (i64.const 45640) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 45640) (i64.const 45742) (i32.const 42))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 45742) (i64.const 45832) (i32.const 72))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 45832) (i64.const 45999) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 45999) (i64.const 46384) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 46384) (i64.const 46596) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 46596) (i64.const 46654) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 46654) (i64.const 47515) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 47515) (i64.const 47620) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 47620) (i64.const 47817) (i32.const 79))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 47817) (i64.const 47951) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 47951) (i64.const 48632) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 48632) (i64.const 48699) (i32.const 97))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 48699) (i64.const 48703) (i32.const 37))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 48703) (i64.const 49764) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 49764) (i64.const 49955) (i32.const 42))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 49955) (i64.const 50012) (i32.const 76))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 50012) (i64.const 50036) (i32.const 57))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 50036) (i64.const 50087) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 50087) (i64.const 50096) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 50096) (i64.const 50115) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 50115) (i64.const 50370) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 50370) (i64.const 51358) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 51358) (i64.const 51610) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 51610) (i64.const 51776) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 51776) (i64.const 51833) (i32.const 89))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 51833) (i64.const 52895) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 52895) (i64.const 53029) (i32.const 97))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 53029) (i64.const 53244) (i32.const 68))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 53244) (i64.const 54066) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 54066) (i64.const 54133) (i32.const 97))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 54133) (i64.const 54137) (i32.const 37))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 54137) (i64.const 55198) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 55198) (i64.const 55389) (i32.const 42))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 55389) (i64.const 55446) (i32.const 76))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 55446) (i64.const 55470) (i32.const 57))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 55470) (i64.const 55521) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 55521) (i64.const 55530) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 55530) (i64.const 55549) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 55549) (i64.const 56212) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 56212) (i64.const 57048) (i32.const 96))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 57048) (i64.const 58183) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 58183) (i64.const 58202) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 58202) (i64.const 58516) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 58516) (i64.const 58835) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 58835) (i64.const 58855) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 58855) (i64.const 59089) (i32.const 95))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 59089) (i64.const 59145) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 59145) (i64.const 59677) (i32.const 99))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 59677) (i64.const 60134) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60134) (i64.const 60502) (i32.const 89))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60502) (i64.const 60594) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60594) (i64.const 60617) (i32.const 36))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60617) (i64.const 60618) (i32.const 32))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60618) (i64.const 60777) (i32.const 42))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60777) (i64.const 60834) (i32.const 76))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60834) (i64.const 60858) (i32.const 57))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60858) (i64.const 60909) (i32.const 59))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60909) (i64.const 60918) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60918) (i64.const 60937) (i32.const 41))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 60937) (i64.const 61600) (i32.const 83))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 61600) (i64.const 62436) (i32.const 96))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 62436) (i64.const 63307) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 63307) (i64.const 63397) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 63397) (i64.const 63501) (i32.const 74))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 63501) (i64.const 63525) (i32.const 93))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 63525) (i64.const 63605) (i32.const 74))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 63605) (i64.const 63704) (i32.const 100))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 63704) (i64.const 63771) (i32.const 97))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 63771) (i64.const 63775) (i32.const 37))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 63775) (i64.const 64311) (i32.const 77))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 64311) (i64.const 64331) (i32.const 26))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 64331) (i64.const 64518) (i32.const 92))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 64518) (i64.const 64827) (i32.const 11))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 64827) (i64.const 64834) (i32.const 26))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 64834) (i64.const 65536) (i32.const 0))\n               (i64.const -1))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/memory_fill.wast",
    "content": ";;\n;; Generated by ../meta/generate_memory_fill.js\n;; DO NOT EDIT THIS FILE.  CHANGE THE SOURCE AND REGENERATE.\n;;\n\n(module\n  (memory 1 1)\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i32.const 0xFF00) (i32.const 0x55) (i32.const 256))))\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 65280) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 65280) (i32.const 65536) (i32.const 85))\n               (i32.const -1))\n(module\n  (memory 1 1)\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i32.const 0xFF00) (i32.const 0x55) (i32.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i32.const 0xFFFFFF00) (i32.const 0x55) (i32.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i32.const 0x12) (i32.const 0x55) (i32.const 0))))\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 65536) (i32.const 0))\n               (i32.const -1))\n(module\n  (memory 1 1)\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i32.const 0x10000) (i32.const 0x55) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory 1 1)\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i32.const 0x20000) (i32.const 0x55) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1 1)\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i32.const 0x1) (i32.const 0xAA) (i32.const 0xFFFE))))\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 1) (i32.const 65535) (i32.const 170))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 65535) (i32.const 65536) (i32.const 0))\n               (i32.const -1))\n\n(module\n  (memory 1 1)\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n     (memory.fill (i32.const 0x12) (i32.const 0x55) (i32.const 10))\n     (memory.fill (i32.const 0x15) (i32.const 0xAA) (i32.const 4))))\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 18) (i32.const 0))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 18) (i32.const 21) (i32.const 85))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 21) (i32.const 25) (i32.const 170))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 25) (i32.const 28) (i32.const 85))\n               (i32.const -1))\n(assert_return (invoke \"checkRange\" (i32.const 28) (i32.const 65536) (i32.const 0))\n               (i32.const -1))\n(assert_invalid\n  (module\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i32.const 20) (i32.const 30))))\n  \"unknown memory 0\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(module\n  (memory 1 1 )\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $val i32) (param $len i32)\n    (memory.fill (local.get $offs) (local.get $val) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 65280) (i32.const 37) (i32.const 512))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n(module\n  (memory 1 1 )\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $val i32) (param $len i32)\n    (memory.fill (local.get $offs) (local.get $val) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 65279) (i32.const 37) (i32.const 514))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n(module\n  (memory 1 1 )\n  \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $val i32) (param $len i32)\n    (memory.fill (local.get $offs) (local.get $val) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 65279) (i32.const 37) (i32.const 4294967295))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n\n(module\n  (memory i64 1 1)\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i64.const 0xFF00) (i32.const 0x55) (i64.const 256))))\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 65280) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 65280) (i64.const 65536) (i32.const 85))\n               (i64.const -1))\n(module\n  (memory i64 1 1)\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i64.const 0xFF00) (i32.const 0x55) (i64.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i64.const 0xFFFFFF00) (i32.const 0x55) (i64.const 257))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i64.const 0x12) (i32.const 0x55) (i64.const 0))))\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 65536) (i32.const 0))\n               (i64.const -1))\n(module\n  (memory i64 1 1)\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i64.const 0x10000) (i32.const 0x55) (i64.const 0))))\n(invoke \"test\")\n\n(module\n  (memory i64 1 1)\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i64.const 0x20000) (i32.const 0x55) (i64.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1 1)\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n    (memory.fill (i64.const 0x1) (i32.const 0xAA) (i64.const 0xFFFE))))\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 1) (i64.const 65535) (i32.const 170))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 65535) (i64.const 65536) (i32.const 0))\n               (i64.const -1))\n\n(module\n  (memory i64 1 1)\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"test\")\n     (memory.fill (i64.const 0x12) (i32.const 0x55) (i64.const 10))\n     (memory.fill (i64.const 0x15) (i32.const 0xAA) (i64.const 4))))\n(invoke \"test\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 18) (i32.const 0))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 18) (i64.const 21) (i32.const 85))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 21) (i64.const 25) (i32.const 170))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 25) (i64.const 28) (i32.const 85))\n               (i64.const -1))\n(assert_return (invoke \"checkRange\" (i64.const 28) (i64.const 65536) (i32.const 0))\n               (i64.const -1))\n(assert_invalid\n  (module\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i32.const 20) (i64.const 30))))\n  \"unknown memory 0\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i32.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f32.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (i64.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f32.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f32.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f32.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f32.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (i64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f64.const 20) (i32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f64.const 20) (f32.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f64.const 20) (i64.const 30))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1 1)\n    (func (export \"testfn\")\n      (memory.fill (f64.const 10) (f64.const 20) (f64.const 30))))\n  \"type mismatch\")\n\n(module\n  (memory i64 1 1 )\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $val i32) (param $len i64)\n    (memory.fill (local.get $offs) (local.get $val) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 65280) (i32.const 37) (i64.const 512))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n(module\n  (memory i64 1 1 )\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $val i32) (param $len i64)\n    (memory.fill (local.get $offs) (local.get $val) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 65279) (i32.const 37) (i64.const 514))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n(module\n  (memory i64 1 1 )\n  \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $val i32) (param $len i64)\n    (memory.fill (local.get $offs) (local.get $val) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 65279) (i32.const 37) (i64.const 4294967295))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/memory_grow64.wast",
    "content": "(module\n    (memory i64 0)\n\n    (func (export \"load_at_zero\") (result i32) (i32.load (i64.const 0)))\n    (func (export \"store_at_zero\") (i32.store (i64.const 0) (i32.const 2)))\n\n    (func (export \"load_at_page_size\") (result i32) (i32.load (i64.const 0x10000)))\n    (func (export \"store_at_page_size\") (i32.store (i64.const 0x10000) (i32.const 3)))\n\n    (func (export \"grow\") (param $sz i64) (result i64) (memory.grow (local.get $sz)))\n    (func (export \"size\") (result i64) (memory.size))\n)\n\n(assert_return (invoke \"size\") (i64.const 0))\n(assert_trap (invoke \"store_at_zero\") \"out of bounds memory access\")\n(assert_trap (invoke \"load_at_zero\") \"out of bounds memory access\")\n(assert_trap (invoke \"store_at_page_size\") \"out of bounds memory access\")\n(assert_trap (invoke \"load_at_page_size\") \"out of bounds memory access\")\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 0))\n(assert_return (invoke \"size\") (i64.const 1))\n(assert_return (invoke \"load_at_zero\") (i32.const 0))\n(assert_return (invoke \"store_at_zero\"))\n(assert_return (invoke \"load_at_zero\") (i32.const 2))\n(assert_trap (invoke \"store_at_page_size\") \"out of bounds memory access\")\n(assert_trap (invoke \"load_at_page_size\") \"out of bounds memory access\")\n(assert_return (invoke \"grow\" (i64.const 4)) (i64.const 1))\n(assert_return (invoke \"size\") (i64.const 5))\n(assert_return (invoke \"load_at_zero\") (i32.const 2))\n(assert_return (invoke \"store_at_zero\"))\n(assert_return (invoke \"load_at_zero\") (i32.const 2))\n(assert_return (invoke \"load_at_page_size\") (i32.const 0))\n(assert_return (invoke \"store_at_page_size\"))\n(assert_return (invoke \"load_at_page_size\") (i32.const 3))\n\n\n(module\n  (memory i64 0)\n  (func (export \"grow\") (param i64) (result i64) (memory.grow (local.get 0)))\n)\n\n(assert_return (invoke \"grow\" (i64.const 0)) (i64.const 0))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 0))\n(assert_return (invoke \"grow\" (i64.const 0)) (i64.const 1))\n(assert_return (invoke \"grow\" (i64.const 2)) (i64.const 1))\n(assert_return (invoke \"grow\" (i64.const 800)) (i64.const 3))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 803))\n\n(module\n  (memory i64 0 10)\n  (func (export \"grow\") (param i64) (result i64) (memory.grow (local.get 0)))\n)\n\n(assert_return (invoke \"grow\" (i64.const 0)) (i64.const 0))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 0))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 1))\n(assert_return (invoke \"grow\" (i64.const 2)) (i64.const 2))\n(assert_return (invoke \"grow\" (i64.const 6)) (i64.const 4))\n(assert_return (invoke \"grow\" (i64.const 0)) (i64.const 10))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const -1))\n(assert_return (invoke \"grow\" (i64.const 0x10000)) (i64.const -1))\n\n;; Test that newly allocated memory (program start and memory.grow) is zeroed\n\n(module\n  (memory i64 1)\n  (func (export \"grow\") (param i64) (result i64)\n    (memory.grow (local.get 0))\n  )\n  (func (export \"check-memory-zero\") (param i64 i64) (result i32)\n    (local i32)\n    (local.set 2 (i32.const 1))\n    (block\n      (loop\n        (local.set 2 (i32.load8_u (local.get 0)))\n        (br_if 1 (i32.ne (local.get 2) (i32.const 0)))\n        (br_if 1 (i64.ge_u (local.get 0) (local.get 1)))\n        (local.set 0 (i64.add (local.get 0) (i64.const 1)))\n        (br_if 0 (i64.le_u (local.get 0) (local.get 1)))\n      )\n    )\n    (local.get 2)\n  )\n)\n\n(assert_return (invoke \"check-memory-zero\" (i64.const 0) (i64.const 0xffff)) (i32.const 0))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 1))\n(assert_return (invoke \"check-memory-zero\" (i64.const 0x10000) (i64.const 0x1_ffff)) (i32.const 0))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 2))\n(assert_return (invoke \"check-memory-zero\" (i64.const 0x20000) (i64.const 0x2_ffff)) (i32.const 0))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 3))\n(assert_return (invoke \"check-memory-zero\" (i64.const 0x30000) (i64.const 0x3_ffff)) (i32.const 0))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 4))\n(assert_return (invoke \"check-memory-zero\" (i64.const 0x40000) (i64.const 0x4_ffff)) (i32.const 0))\n(assert_return (invoke \"grow\" (i64.const 1)) (i64.const 5))\n(assert_return (invoke \"check-memory-zero\" (i64.const 0x50000) (i64.const 0x5_ffff)) (i32.const 0))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/memory_init.wast",
    "content": ";;\n;; Generated by ../meta/generate_memory_init.js\n;; DO NOT EDIT THIS FILE.  CHANGE THE SOURCE AND REGENERATE.\n;;\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data \"\\02\\07\\01\\08\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (data \"\\05\\09\\02\\07\\06\")\n  (func (export \"test\")\n    (nop))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data \"\\02\\07\\01\\08\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (data \"\\05\\09\\02\\07\\06\")\n  (func (export \"test\")\n    (memory.init 1 (i32.const 7) (i32.const 0) (i32.const 4)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data \"\\02\\07\\01\\08\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (data \"\\05\\09\\02\\07\\06\")\n  (func (export \"test\")\n    (memory.init 3 (i32.const 15) (i32.const 1) (i32.const 3)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") 1 1)\n  (data (i32.const 2) \"\\03\\01\\04\\01\")\n  (data \"\\02\\07\\01\\08\")\n  (data (i32.const 12) \"\\07\\05\\02\\03\\06\")\n  (data \"\\05\\09\\02\\07\\06\")\n  (func (export \"test\")\n    (memory.init 1 (i32.const 7) (i32.const 0) (i32.const 4))\n    (data.drop 1)\n    (memory.init 3 (i32.const 15) (i32.const 1) (i32.const 3))\n    (data.drop 3)\n    (memory.copy (i32.const 20) (i32.const 15) (i32.const 5))\n    (memory.copy (i32.const 21) (i32.const 29) (i32.const 1))\n    (memory.copy (i32.const 24) (i32.const 10) (i32.const 1))\n    (memory.copy (i32.const 13) (i32.const 11) (i32.const 4))\n    (memory.copy (i32.const 19) (i32.const 20) (i32.const 5)))\n  (func (export \"load8_u\") (param i32) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 7)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 8)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 9)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i32.const 10)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 13)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 14)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 15)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i32.const 17)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 19)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i32.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 21)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i32.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 23)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 24)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i32.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i32.const 29)) (i32.const 0))\n(assert_invalid\n   (module\n     (func (export \"test\")\n       (data.drop 0)))\n   \"unknown data segment\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (data.drop 4)))\n  \"unknown data segment\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (data.drop 0)\n    (data.drop 0)))\n(invoke \"test\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (data.drop 0)\n    (memory.init 0 (i32.const 1234) (i32.const 1) (i32.const 1))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n   (memory 1)\n   (data (i32.const 0) \"\\37\")\n   (func (export \"test\")\n     (memory.init 0 (i32.const 1234) (i32.const 1) (i32.const 1))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(assert_invalid\n  (module\n    (func (export \"test\")\n      (memory.init 1 (i32.const 1234) (i32.const 1) (i32.const 1))))\n  \"unknown memory 0\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 1 (i32.const 1234) (i32.const 1) (i32.const 1))))\n  \"unknown data segment 1\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 1) (i32.const 0) (i32.const 1))\n    (memory.init 0 (i32.const 1) (i32.const 0) (i32.const 1))))\n(invoke \"test\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 1234) (i32.const 0) (i32.const 5))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 1234) (i32.const 2) (i32.const 3))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 0xFFFE) (i32.const 1) (i32.const 3))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 1234) (i32.const 4) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 1234) (i32.const 1) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 0x10001) (i32.const 0) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 0x10000) (i32.const 0) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 0x10000) (i32.const 1) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i32.const 0x10001) (i32.const 4) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(module\n  (memory 1 1 )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 65528) (i32.const 16))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n(module\n  (memory 1 1 )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 65527) (i32.const 16))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n(module\n  (memory 1 1 )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 65472) (i32.const 30))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n(module\n  (memory 1 1 )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 65473) (i32.const 31))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n(module\n  (memory 1  )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 65528) (i32.const 4294967040))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n(module\n  (memory 1  )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i32) (param $to i32) (param $expected i32) (result i32)\n    (loop $cont\n      (if (i32.eq (local.get $from) (local.get $to))\n        (then\n          (return (i32.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i32.add (local.get $from) (i32.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 4294967292))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i32.const 0) (i32.const 1) (i32.const 0))\n               (i32.const -1))\n\n(module\n  (memory 1)\n  ;; 65 data segments. 64 is the smallest positive number that is encoded\n  ;; differently as a signed LEB.\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\")\n  (func (memory.init 64 (i32.const 0) (i32.const 0) (i32.const 0))))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data \"\\02\\07\\01\\08\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (data \"\\05\\09\\02\\07\\06\")\n  (func (export \"test\")\n    (nop))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data \"\\02\\07\\01\\08\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (data \"\\05\\09\\02\\07\\06\")\n  (func (export \"test\")\n    (memory.init 1 (i64.const 7) (i32.const 0) (i32.const 4)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 6))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data \"\\02\\07\\01\\08\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (data \"\\05\\09\\02\\07\\06\")\n  (func (export \"test\")\n    (memory.init 3 (i64.const 15) (i32.const 1) (i32.const 3)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n\n(module\n  (memory (export \"memory0\") i64 1 1)\n  (data (i64.const 2) \"\\03\\01\\04\\01\")\n  (data \"\\02\\07\\01\\08\")\n  (data (i64.const 12) \"\\07\\05\\02\\03\\06\")\n  (data \"\\05\\09\\02\\07\\06\")\n  (func (export \"test\")\n    (memory.init 1 (i64.const 7) (i32.const 0) (i32.const 4))\n    (data.drop 1)\n    (memory.init 3 (i64.const 15) (i32.const 1) (i32.const 3))\n    (data.drop 3)\n    (memory.copy (i64.const 20) (i64.const 15) (i64.const 5))\n    (memory.copy (i64.const 21) (i64.const 29) (i64.const 1))\n    (memory.copy (i64.const 24) (i64.const 10) (i64.const 1))\n    (memory.copy (i64.const 13) (i64.const 11) (i64.const 4))\n    (memory.copy (i64.const 19) (i64.const 20) (i64.const 5)))\n  (func (export \"load8_u\") (param i64) (result i32)\n    (i32.load8_u (local.get 0))))\n\n(invoke \"test\")\n\n(assert_return (invoke \"load8_u\" (i64.const 0)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 1)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"load8_u\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"load8_u\" (i64.const 5)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 6)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 7)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 8)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 9)) (i32.const 1))\n(assert_return (invoke \"load8_u\" (i64.const 10)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i64.const 11)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 13)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 14)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 15)) (i32.const 5))\n(assert_return (invoke \"load8_u\" (i64.const 16)) (i32.const 2))\n(assert_return (invoke \"load8_u\" (i64.const 17)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 18)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 19)) (i32.const 9))\n(assert_return (invoke \"load8_u\" (i64.const 20)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 21)) (i32.const 7))\n(assert_return (invoke \"load8_u\" (i64.const 22)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 23)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i64.const 24)) (i32.const 8))\n(assert_return (invoke \"load8_u\" (i64.const 25)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 26)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 27)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 28)) (i32.const 0))\n(assert_return (invoke \"load8_u\" (i64.const 29)) (i32.const 0))\n(assert_invalid\n   (module\n     (func (export \"test\")\n       (data.drop 0)))\n   \"unknown data segment\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (data.drop 4)))\n  \"unknown data segment\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (data.drop 0)\n    (data.drop 0)))\n(invoke \"test\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (data.drop 0)\n    (memory.init 0 (i64.const 1234) (i32.const 1) (i32.const 1))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n   (memory i64 1)\n   (data (i64.const 0) \"\\37\")\n   (func (export \"test\")\n     (memory.init 0 (i64.const 1234) (i32.const 1) (i32.const 1))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(assert_invalid\n  (module\n    (func (export \"test\")\n      (memory.init 1 (i64.const 1234) (i32.const 1) (i32.const 1))))\n  \"unknown memory 0\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 1 (i64.const 1234) (i32.const 1) (i32.const 1))))\n  \"unknown data segment 1\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 1) (i32.const 0) (i32.const 1))\n    (memory.init 0 (i64.const 1) (i32.const 0) (i32.const 1))))\n(invoke \"test\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 1234) (i32.const 0) (i32.const 5))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 1234) (i32.const 2) (i32.const 3))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 0xFFFE) (i32.const 1) (i32.const 3))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 1234) (i32.const 4) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 1234) (i32.const 1) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 0x10001) (i32.const 0) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 0x10000) (i32.const 0) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 0x10000) (i32.const 1) (i32.const 0))))\n(invoke \"test\")\n\n(module\n  (memory i64 1)\n    (data \"\\37\")\n  (func (export \"test\")\n    (memory.init 0 (i64.const 0x10001) (i32.const 4) (i32.const 0))))\n(assert_trap (invoke \"test\") \"out of bounds memory access\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i32.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f32.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (i64.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (memory i64 1)\n    (data \"\\37\")\n    (func (export \"test\")\n      (memory.init 0 (f64.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(module\n  (memory i64 1 1 )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 65528) (i32.const 16))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n(module\n  (memory i64 1 1 )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 65527) (i32.const 16))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n(module\n  (memory i64 1 1 )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 65472) (i32.const 30))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n(module\n  (memory i64 1 1 )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 65473) (i32.const 31))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n(module\n  (memory i64 1  )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 65528) (i32.const 4294967040))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n(module\n  (memory i64 1  )\n  (data \"\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\\42\")\n   \n  (func (export \"checkRange\") (param $from i64) (param $to i64) (param $expected i32) (result i64)\n    (loop $cont\n      (if (i64.eq (local.get $from) (local.get $to))\n        (then\n          (return (i64.const -1))))\n      (if (i32.eq (i32.load8_u (local.get $from)) (local.get $expected))\n        (then\n          (local.set $from (i64.add (local.get $from) (i64.const 1)))\n          (br $cont))))\n    (return (local.get $from)))\n\n  (func (export \"run\") (param $offs i64) (param $len i32)\n    (memory.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i64.const 0) (i32.const 4294967292))\n              \"out of bounds memory access\")\n\n(assert_return (invoke \"checkRange\" (i64.const 0) (i64.const 1) (i32.const 0))\n               (i64.const -1))\n\n(module\n  (memory i64 1)\n  ;; 65 data segments. 64 is the smallest positive number that is encoded\n  ;; differently as a signed LEB.\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\") (data \"\")\n  (data \"\")\n  (func (memory.init 64 (i64.const 0) (i32.const 0) (i32.const 0))))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/memory_redundancy64.wast",
    "content": ";; Test that optimizers don't do redundant-load, store-to-load, or dead-store\n;; optimizations when there are interfering stores, even of different types\n;; and to non-identical addresses.\n\n(module\n  (memory i64 1 1)\n\n  (func (export \"zero_everything\")\n    (i32.store (i64.const 0) (i32.const 0))\n    (i32.store (i64.const 4) (i32.const 0))\n    (i32.store (i64.const 8) (i32.const 0))\n    (i32.store (i64.const 12) (i32.const 0))\n  )\n\n  (func (export \"test_store_to_load\") (result i32)\n    (i32.store (i64.const 8) (i32.const 0))\n    (f32.store (i64.const 5) (f32.const -0.0))\n    (i32.load (i64.const 8))\n  )\n\n  (func (export \"test_redundant_load\") (result i32)\n    (local $t i32)\n    (local $s i32)\n    (local.set $t (i32.load (i64.const 8)))\n    (i32.store (i64.const 5) (i32.const 0x80000000))\n    (local.set $s (i32.load (i64.const 8)))\n    (i32.add (local.get $t) (local.get $s))\n  )\n\n  (func (export \"test_dead_store\") (result f32)\n    (local $t f32)\n    (i32.store (i64.const 8) (i32.const 0x23232323))\n    (local.set $t (f32.load (i64.const 11)))\n    (i32.store (i64.const 8) (i32.const 0))\n    (local.get $t)\n  )\n\n  ;; A function named \"malloc\" which implementations nonetheless shouldn't\n  ;; assume behaves like C malloc.\n  (func $malloc (export \"malloc\")\n     (param $size i64)\n     (result i64)\n     (i64.const 16)\n  )\n\n  ;; Call malloc twice, but unlike C malloc, we don't get non-aliasing pointers.\n  (func (export \"malloc_aliasing\")\n     (result i32)\n     (local $x i64)\n     (local $y i64)\n     (local.set $x (call $malloc (i64.const 4)))\n     (local.set $y (call $malloc (i64.const 4)))\n     (i32.store (local.get $x) (i32.const 42))\n     (i32.store (local.get $y) (i32.const 43))\n     (i32.load (local.get $x))\n  )\n)\n\n(assert_return (invoke \"test_store_to_load\") (i32.const 0x00000080))\n(invoke \"zero_everything\")\n(assert_return (invoke \"test_redundant_load\") (i32.const 0x00000080))\n(invoke \"zero_everything\")\n(assert_return (invoke \"test_dead_store\") (f32.const 0x1.18p-144))\n(invoke \"zero_everything\")\n(assert_return (invoke \"malloc_aliasing\") (i32.const 43))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/memory_trap64.wast",
    "content": "(module\n    (memory i64 1)\n\n    (func $addr_limit (result i64)\n      (i64.mul (memory.size) (i64.const 0x10000))\n    )\n\n    (func (export \"store\") (param $i i64) (param $v i32)\n      (i32.store (i64.add (call $addr_limit) (local.get $i)) (local.get $v))\n    )\n\n    (func (export \"load\") (param $i i64) (result i32)\n      (i32.load (i64.add (call $addr_limit) (local.get $i)))\n    )\n\n    (func (export \"memory.grow\") (param i64) (result i64)\n      (memory.grow (local.get 0))\n    )\n)\n\n(assert_return (invoke \"store\" (i64.const -4) (i32.const 42)))\n(assert_return (invoke \"load\" (i64.const -4)) (i32.const 42))\n(assert_trap (invoke \"store\" (i64.const -3) (i32.const 13)) \"out of bounds memory access\")\n(assert_trap (invoke \"load\" (i64.const -3)) \"out of bounds memory access\")\n(assert_trap (invoke \"store\" (i64.const -2) (i32.const 13)) \"out of bounds memory access\")\n(assert_trap (invoke \"load\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"store\" (i64.const -1) (i32.const 13)) \"out of bounds memory access\")\n(assert_trap (invoke \"load\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"store\" (i64.const 0) (i32.const 13)) \"out of bounds memory access\")\n(assert_trap (invoke \"load\" (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"store\" (i64.const 0x80000000) (i32.const 13)) \"out of bounds memory access\")\n(assert_trap (invoke \"load\" (i64.const 0x80000000)) \"out of bounds memory access\")\n\n(module\n  (memory i64 1)\n  (data (i64.const 0) \"abcdefgh\")\n  (data (i64.const 0xfff8) \"abcdefgh\")\n\n  (func (export \"i32.load\") (param $a i64) (result i32)\n    (i32.load (local.get $a))\n  )\n  (func (export \"i64.load\") (param $a i64) (result i64)\n    (i64.load (local.get $a))\n  )\n  (func (export \"f32.load\") (param $a i64) (result f32)\n    (f32.load (local.get $a))\n  )\n  (func (export \"f64.load\") (param $a i64) (result f64)\n    (f64.load (local.get $a))\n  )\n  (func (export \"i32.load8_s\") (param $a i64) (result i32)\n    (i32.load8_s (local.get $a))\n  )\n  (func (export \"i32.load8_u\") (param $a i64) (result i32)\n    (i32.load8_u (local.get $a))\n  )\n  (func (export \"i32.load16_s\") (param $a i64) (result i32)\n    (i32.load16_s (local.get $a))\n  )\n  (func (export \"i32.load16_u\") (param $a i64) (result i32)\n    (i32.load16_u (local.get $a))\n  )\n  (func (export \"i64.load8_s\") (param $a i64) (result i64)\n    (i64.load8_s (local.get $a))\n  )\n  (func (export \"i64.load8_u\") (param $a i64) (result i64)\n    (i64.load8_u (local.get $a))\n  )\n  (func (export \"i64.load16_s\") (param $a i64) (result i64)\n    (i64.load16_s (local.get $a))\n  )\n  (func (export \"i64.load16_u\") (param $a i64) (result i64)\n    (i64.load16_u (local.get $a))\n  )\n  (func (export \"i64.load32_s\") (param $a i64) (result i64)\n    (i64.load32_s (local.get $a))\n  )\n  (func (export \"i64.load32_u\") (param $a i64) (result i64)\n    (i64.load32_u (local.get $a))\n  )\n  (func (export \"i32.store\") (param $a i64) (param $v i32)\n    (i32.store (local.get $a) (local.get $v))\n  )\n  (func (export \"i64.store\") (param $a i64) (param $v i64)\n    (i64.store (local.get $a) (local.get $v))\n  )\n  (func (export \"f32.store\") (param $a i64) (param $v f32)\n    (f32.store (local.get $a) (local.get $v))\n  )\n  (func (export \"f64.store\") (param $a i64) (param $v f64)\n    (f64.store (local.get $a) (local.get $v))\n  )\n  (func (export \"i32.store8\") (param $a i64) (param $v i32)\n    (i32.store8 (local.get $a) (local.get $v))\n  )\n  (func (export \"i32.store16\") (param $a i64) (param $v i32)\n    (i32.store16 (local.get $a) (local.get $v))\n  )\n  (func (export \"i64.store8\") (param $a i64) (param $v i64)\n    (i64.store8 (local.get $a) (local.get $v))\n  )\n  (func (export \"i64.store16\") (param $a i64) (param $v i64)\n    (i64.store16 (local.get $a) (local.get $v))\n  )\n  (func (export \"i64.store32\") (param $a i64) (param $v i64)\n    (i64.store32 (local.get $a) (local.get $v))\n  )\n)\n\n(assert_trap (invoke \"i32.store\" (i64.const 0x10000) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store\" (i64.const 0xffff) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store\" (i64.const 0xfffe) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store\" (i64.const 0xfffd) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store\" (i64.const -1) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store\" (i64.const -2) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store\" (i64.const -3) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store\" (i64.const -4) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const 0x10000) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const 0xffff) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const 0xfffe) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const 0xfffd) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const 0xfffc) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const 0xfffb) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const 0xfffa) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const 0xfff9) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const -1) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const -2) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const -3) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const -4) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const -5) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const -6) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const -7) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store\" (i64.const -8) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.store\" (i64.const 0x10000) (f32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.store\" (i64.const 0xffff) (f32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.store\" (i64.const 0xfffe) (f32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.store\" (i64.const 0xfffd) (f32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.store\" (i64.const -1) (f32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.store\" (i64.const -2) (f32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.store\" (i64.const -3) (f32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.store\" (i64.const -4) (f32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const 0x10000) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const 0xffff) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const 0xfffe) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const 0xfffd) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const 0xfffc) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const 0xfffb) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const 0xfffa) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const 0xfff9) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const -1) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const -2) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const -3) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const -4) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const -5) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const -6) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const -7) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.store\" (i64.const -8) (f64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store8\" (i64.const 0x10000) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store8\" (i64.const -1) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store16\" (i64.const 0x10000) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store16\" (i64.const 0xffff) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store16\" (i64.const -1) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.store16\" (i64.const -2) (i32.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store8\" (i64.const 0x10000) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store8\" (i64.const -1) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store16\" (i64.const 0x10000) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store16\" (i64.const 0xffff) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store16\" (i64.const -1) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store16\" (i64.const -2) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store32\" (i64.const 0x10000) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store32\" (i64.const 0xffff) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store32\" (i64.const 0xfffe) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store32\" (i64.const 0xfffd) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store32\" (i64.const -1) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store32\" (i64.const -2) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store32\" (i64.const -3) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.store32\" (i64.const -4) (i64.const 0)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load\" (i64.const 0xfffe)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load\" (i64.const 0xfffd)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load\" (i64.const -3)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load\" (i64.const -4)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const 0xfffe)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const 0xfffd)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const 0xfffc)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const 0xfffb)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const 0xfffa)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const 0xfff9)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const -3)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const -4)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const -5)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const -6)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const -7)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load\" (i64.const -8)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.load\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.load\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.load\" (i64.const 0xfffe)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.load\" (i64.const 0xfffd)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.load\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.load\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.load\" (i64.const -3)) \"out of bounds memory access\")\n(assert_trap (invoke \"f32.load\" (i64.const -4)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const 0xfffe)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const 0xfffd)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const 0xfffc)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const 0xfffb)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const 0xfffa)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const 0xfff9)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const -3)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const -4)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const -5)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const -6)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const -7)) \"out of bounds memory access\")\n(assert_trap (invoke \"f64.load\" (i64.const -8)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load8_s\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load8_s\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load8_u\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load8_u\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load16_s\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load16_s\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load16_s\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load16_s\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load16_u\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load16_u\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load16_u\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i32.load16_u\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load8_s\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load8_s\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load8_u\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load8_u\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load16_s\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load16_s\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load16_s\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load16_s\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load16_u\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load16_u\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load16_u\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load16_u\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_s\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_s\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_s\" (i64.const 0xfffe)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_s\" (i64.const 0xfffd)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_s\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_s\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_s\" (i64.const -3)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_s\" (i64.const -4)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_u\" (i64.const 0x10000)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_u\" (i64.const 0xffff)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_u\" (i64.const 0xfffe)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_u\" (i64.const 0xfffd)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_u\" (i64.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_u\" (i64.const -2)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_u\" (i64.const -3)) \"out of bounds memory access\")\n(assert_trap (invoke \"i64.load32_u\" (i64.const -4)) \"out of bounds memory access\")\n\n;; No memory was changed\n(assert_return (invoke \"i64.load\" (i64.const 0xfff8)) (i64.const 0x6867666564636261))\n(assert_return (invoke \"i64.load\" (i64.const 0)) (i64.const 0x6867666564636261))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/simd_address.wast",
    "content": ";; Load/Store v128 data with different valid offset/alignment\n\n(module\n  (memory 1)\n  (data (i32.const 0) \"\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\10\\11\\12\\13\\14\\15\")\n  (data (offset (i32.const 65505)) \"\\16\\17\\18\\19\\20\\21\\22\\23\\24\\25\\26\\27\\28\\29\\30\\31\")\n\n  (func (export \"load_data_1\") (param $i i32) (result v128)\n    (v128.load offset=0 (local.get $i))                   ;; 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 0x11 0x12 0x13 0x14 0x15\n  )\n  (func (export \"load_data_2\") (param $i i32) (result v128)\n    (v128.load align=1 (local.get $i))                    ;; 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 0x11 0x12 0x13 0x14 0x15\n  )\n  (func (export \"load_data_3\") (param $i i32) (result v128)\n    (v128.load offset=1 align=1 (local.get $i))           ;; 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 0x11 0x12 0x13 0x14 0x15 0x00\n  )\n  (func (export \"load_data_4\") (param $i i32) (result v128)\n    (v128.load offset=2 align=1 (local.get $i))           ;; 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 0x11 0x12 0x13 0x14 0x15 0x00 0x00\n  )\n  (func (export \"load_data_5\") (param $i i32) (result v128)\n    (v128.load offset=15 align=1 (local.get $i))          ;; 0x15 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00\n  )\n\n  (func (export \"store_data_0\") (result v128)\n    (v128.store offset=0 (i32.const 0) (v128.const f32x4 0 1 2 3))\n    (v128.load offset=0 (i32.const 0))\n  )\n  (func (export \"store_data_1\") (result v128)\n    (v128.store align=1 (i32.const 0) (v128.const i32x4 0 1 2 3))\n    (v128.load align=1 (i32.const 0))\n  )\n  (func (export \"store_data_2\") (result v128)\n    (v128.store offset=1 align=1 (i32.const 0) (v128.const i16x8 0 1 2 3 4 5 6 7))\n    (v128.load offset=1 align=1 (i32.const 0))\n  )\n  (func (export \"store_data_3\") (result v128)\n    (v128.store offset=2 align=1 (i32.const 0) (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))\n    (v128.load offset=2 align=1 (i32.const 0))\n  )\n  (func (export \"store_data_4\") (result v128)\n    (v128.store offset=15 align=1 (i32.const 0) (v128.const i32x4 0 1 2 3))\n    (v128.load offset=15 (i32.const 0))\n  )\n  (func (export \"store_data_5\") (result v128)\n    (v128.store offset=65520 align=1 (i32.const 0) (v128.const i32x4 0 1 2 3))\n    (v128.load offset=65520 (i32.const 0))\n  )\n  (func (export \"store_data_6\") (param $i i32)\n    (v128.store offset=1 align=1 (local.get $i) (v128.const i32x4 0 1 2 3))\n  )\n)\n\n(assert_return (invoke \"load_data_1\" (i32.const 0)) (v128.const i32x4 0x03020100 0x07060504 0x11100908 0x15141312))\n(assert_return (invoke \"load_data_2\" (i32.const 0)) (v128.const i32x4 0x03020100 0x07060504 0x11100908 0x15141312))\n(assert_return (invoke \"load_data_3\" (i32.const 0)) (v128.const i32x4 0x04030201 0x08070605 0x12111009 0x00151413))\n(assert_return (invoke \"load_data_4\" (i32.const 0)) (v128.const i32x4 0x05040302 0x09080706 0x13121110 0x00001514))\n(assert_return (invoke \"load_data_5\" (i32.const 0)) (v128.const i32x4 0x00000015 0x00000000 0x00000000 0x00000000))\n\n(assert_return (invoke \"load_data_1\" (i32.const 0)) (v128.const i16x8 0x0100 0x0302 0x0504 0x0706 0x0908 0x1110 0x1312 0x1514))\n(assert_return (invoke \"load_data_2\" (i32.const 0)) (v128.const i16x8 0x0100 0x0302 0x0504 0x0706 0x0908 0x1110 0x1312 0x1514))\n(assert_return (invoke \"load_data_3\" (i32.const 0)) (v128.const i16x8 0x0201 0x0403 0x0605 0x0807 0x1009 0x1211 0x1413 0x0015))\n(assert_return (invoke \"load_data_4\" (i32.const 0)) (v128.const i16x8 0x0302 0x0504 0x0706 0x0908 0x1110 0x1312 0x1514 0x0000))\n(assert_return (invoke \"load_data_5\" (i32.const 0)) (v128.const i16x8 0x0015 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000))\n\n(assert_return (invoke \"load_data_1\" (i32.const 0)) (v128.const i8x16 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 0x11 0x12 0x13 0x14 0x15))\n(assert_return (invoke \"load_data_2\" (i32.const 0)) (v128.const i8x16 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 0x11 0x12 0x13 0x14 0x15))\n(assert_return (invoke \"load_data_3\" (i32.const 0)) (v128.const i8x16 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 0x11 0x12 0x13 0x14 0x15 0x00))\n(assert_return (invoke \"load_data_4\" (i32.const 0)) (v128.const i8x16 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x10 0x11 0x12 0x13 0x14 0x15 0x00 0x00))\n(assert_return (invoke \"load_data_5\" (i32.const 0)) (v128.const i8x16 0x15 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00))\n\n(assert_return (invoke \"load_data_1\" (i32.const 65505)) (v128.const i32x4 0x19181716 0x23222120 0x27262524 0x31302928))\n(assert_return (invoke \"load_data_2\" (i32.const 65505)) (v128.const i32x4 0x19181716 0x23222120 0x27262524 0x31302928))\n(assert_return (invoke \"load_data_3\" (i32.const 65505)) (v128.const i32x4 0x20191817 0x24232221 0x28272625 0x00313029))\n(assert_return (invoke \"load_data_4\" (i32.const 65505)) (v128.const i32x4 0x21201918 0x25242322 0x29282726 0x00003130))\n(assert_return (invoke \"load_data_5\" (i32.const 65505)) (v128.const i32x4 0x00000031 0x00000000 0x00000000 0x00000000))\n\n(assert_return (invoke \"load_data_1\" (i32.const 65505)) (v128.const i16x8 0x1716 0x1918 0x2120 0x2322 0x2524 0x2726 0x2928 0x3130))\n(assert_return (invoke \"load_data_2\" (i32.const 65505)) (v128.const i16x8 0x1716 0x1918 0x2120 0x2322 0x2524 0x2726 0x2928 0x3130))\n(assert_return (invoke \"load_data_3\" (i32.const 65505)) (v128.const i16x8 0x1817 0x2019 0x2221 0x2423 0x2625 0x2827 0x3029 0x0031))\n(assert_return (invoke \"load_data_4\" (i32.const 65505)) (v128.const i16x8 0x1918 0x2120 0x2322 0x2524 0x2726 0x2928 0x3130 0x0000))\n(assert_return (invoke \"load_data_5\" (i32.const 65505)) (v128.const i16x8 0x0031 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000))\n\n(assert_return (invoke \"load_data_1\" (i32.const 65505)) (v128.const i8x16 0x16 0x17 0x18 0x19 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x30 0x31))\n(assert_return (invoke \"load_data_2\" (i32.const 65505)) (v128.const i8x16 0x16 0x17 0x18 0x19 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x30 0x31))\n(assert_return (invoke \"load_data_3\" (i32.const 65505)) (v128.const i8x16 0x17 0x18 0x19 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x30 0x31 0x00))\n(assert_return (invoke \"load_data_4\" (i32.const 65505)) (v128.const i8x16 0x18 0x19 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x30 0x31 0x00 0x00))\n(assert_return (invoke \"load_data_5\" (i32.const 65505)) (v128.const i8x16 0x31 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00))\n\n(assert_trap (invoke \"load_data_3\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"load_data_5\" (i32.const 65506)) \"out of bounds memory access\")\n\n(assert_return (invoke \"store_data_0\") (v128.const f32x4 0 1 2 3))\n(assert_return (invoke \"store_data_1\") (v128.const i32x4 0 1 2 3))\n(assert_return (invoke \"store_data_2\") (v128.const i16x8 0 1 2 3 4 5 6 7))\n(assert_return (invoke \"store_data_3\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"store_data_4\") (v128.const i32x4 0 1 2 3))\n(assert_return (invoke \"store_data_5\") (v128.const i32x4 0 1 2 3))\n\n(assert_trap (invoke \"store_data_6\" (i32.const -1)) \"out of bounds memory access\")\n(assert_trap (invoke \"store_data_6\" (i32.const 65535)) \"out of bounds memory access\")\n\n;; Load/Store v128 data with invalid offset\n\n(module\n  (memory 1)\n  (func (export \"v128.load_offset_65521\")\n    (drop (v128.load offset=65521 (i32.const 0)))\n  )\n)\n(assert_trap (invoke \"v128.load_offset_65521\") \"out of bounds memory access\")\n\n(assert_malformed\n  (module quote\n    \"(memory 1)\"\n    \"(func\"\n    \"  (drop (v128.load offset=-1 (i32.const 0)))\"\n    \")\"\n  )\n  \"unknown operator\"\n)\n\n(module\n  (memory 1)\n  (func (export \"v128.store_offset_65521\")\n    (v128.store offset=65521 (i32.const 0) (v128.const i32x4 0 0 0 0))\n  )\n)\n(assert_trap (invoke \"v128.store_offset_65521\") \"out of bounds memory access\")\n\n(assert_malformed\n  (module quote\n    \"(memory 1)\"\n    \"(func\"\n    \"  (v128.store offset=-1 (i32.const 0) (v128.const i32x4 0 0 0 0))\"\n    \")\"\n  )\n  \"unknown operator\"\n)\n\n\n;; Offset constant out of range\n\n(assert_invalid\n  (module quote\n    \"(memory 1)\"\n    \"(func (drop (v128.load offset=4294967296 (i32.const 0))))\"\n  )\n  \"offset out of range\"\n)\n\n(assert_invalid\n  (module quote\n    \"(memory 1)\"\n    \"(func (v128.store offset=4294967296 (i32.const 0) (v128.const i32x4 0 0 0 0)))\"\n  )\n  \"offset out of range\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table.wast",
    "content": ";; Test table section structure\n\n(module (table 0 funcref))\n(module (table 1 funcref))\n(module (table 0 0 funcref))\n(module (table 0 1 funcref))\n(module (table 1 256 funcref))\n(module (table 0 65536 funcref))\n(module (table 0 0xffff_ffff funcref))\n\n(module (table 1 (ref null func)))\n(module (table 1 (ref null extern)))\n(module (table 1 (ref null $t)) (type $t (func)))\n\n(module (table 0 funcref) (table 0 funcref))\n(module (table (import \"spectest\" \"table\") 0 funcref) (table 0 funcref))\n\n(module (table 0 funcref (ref.null func)))\n(module (table 1 funcref (ref.null func)))\n(module (table 1 (ref null func) (ref.null func)))\n\n(assert_invalid (module (elem (i32.const 0))) \"unknown table\")\n(assert_invalid (module (elem (i32.const 0) $f) (func $f)) \"unknown table\")\n\n(assert_invalid\n  (module (table 1 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n(assert_invalid\n  (module (table 0xffff_ffff 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n\n(assert_invalid\n  (module quote \"(table 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n(assert_invalid\n  (module quote \"(table 0x1_0000_0000 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n(assert_invalid\n  (module quote \"(table 0 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n\n;; Same as above but with i64 address types\n\n(module (table i64 0 funcref))\n(module (table i64 1 funcref))\n(module (table i64 0 0 funcref))\n(module (table i64 0 1 funcref))\n(module (table i64 1 256 funcref))\n(module (table i64 0 65536 funcref))\n(module (table i64 0 0xffff_ffff funcref))\n\n(module (table i64 0 funcref) (table i64 0 funcref))\n(module (table (import \"spectest\" \"table64\") i64 0 funcref) (table i64 0 funcref))\n\n(assert_invalid\n  (module (table i64 1 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n(assert_invalid\n  (module (table i64 0xffff_ffff 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n\n;; Elem segments with no table\n\n(assert_invalid (module (elem (i32.const 0))) \"unknown table\")\n(assert_invalid (module (elem (i32.const 0) $f) (func $f)) \"unknown table\")\n\n(assert_invalid\n  (module (table 1 (ref null func) (i32.const 0)))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (table 1 (ref func) (ref.null extern)))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (type $t (func)) (table 1 (ref $t) (ref.null func)))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (table 1 (ref func) (ref.null func)))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (table 0 (ref func)))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (table 0 (ref extern)))\n  \"type mismatch\"\n)\n(assert_invalid\n  (module (type $t (func)) (table 0 (ref $t)))\n  \"type mismatch\"\n)\n\n\n;; Table initializer\n\n(module\n  (global (export \"g\") (ref $f) (ref.func $f))\n  (type $f (func))\n  (func $f)\n)\n(register \"M\")\n\n(module\n  (global $g (import \"M\" \"g\") (ref $dummy))\n\n  (type $dummy (func))\n  (func $dummy)\n\n  (table $t1 10 funcref)\n  (table $t2 10 funcref (ref.func $dummy))\n  (table $t3 10 (ref $dummy) (ref.func $dummy))\n  (table $t4 10 funcref (global.get $g))\n  (table $t5 10 (ref $dummy) (global.get $g))\n\n  (func (export \"get1\") (result funcref) (table.get $t1 (i32.const 1)))\n  (func (export \"get2\") (result funcref) (table.get $t2 (i32.const 4)))\n  (func (export \"get3\") (result funcref) (table.get $t3 (i32.const 7)))\n  (func (export \"get4\") (result funcref) (table.get $t4 (i32.const 8)))\n  (func (export \"get5\") (result funcref) (table.get $t5 (i32.const 9)))\n)\n\n(assert_return (invoke \"get1\") (ref.null))\n(assert_return (invoke \"get2\") (ref.func))\n(assert_return (invoke \"get3\") (ref.func))\n(assert_return (invoke \"get4\") (ref.func))\n(assert_return (invoke \"get5\") (ref.func))\n\n\n(assert_invalid\n  (module\n    (type $f (func))\n    (table 10 (ref $f))\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (type $f (func))\n    (table 0 (ref $f))\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (type $f (func))\n    (table 0 0 (ref $f))\n  )\n  \"type mismatch\"\n)\n\n\n;; Duplicate table identifiers\n\n(assert_malformed\n  (module quote\n    \"(table $foo 1 funcref)\"\n    \"(table $foo 1 funcref)\"\n  )\n  \"duplicate table\"\n)\n(assert_malformed\n  (module quote\n    \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\"\n    \"(table $foo 1 funcref)\"\n  )\n  \"duplicate table\"\n)\n(assert_malformed\n  (module quote\n    \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\"\n    \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\"\n  )\n  \"duplicate table\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table_copy.wast",
    "content": ";;\n;; Generated by ../meta/generate_table_copy.js\n;; DO NOT EDIT THIS FILE.  CHANGE THE SOURCE AND REGENERATE.\n;;\n\n(module\n  (func (export \"ef0\") (result i32) (i32.const 0))\n  (func (export \"ef1\") (result i32) (i32.const 1))\n  (func (export \"ef2\") (result i32) (i32.const 2))\n  (func (export \"ef3\") (result i32) (i32.const 3))\n  (func (export \"ef4\") (result i32) (i32.const 4))\n)\n(register \"a\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (nop))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 13) (i32.const 2) (i32.const 3)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 25) (i32.const 15) (i32.const 2)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 25)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 26)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 13) (i32.const 25) (i32.const 3)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_trap (invoke \"check_t0\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 15)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 20) (i32.const 22) (i32.const 4)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 25) (i32.const 1) (i32.const 3)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 26)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 27)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 10) (i32.const 12) (i32.const 7)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 10)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 11)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 12) (i32.const 10) (i32.const 7)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 13)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 17)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 18)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t1) (i32.const 3) func 1 3 1 4)\n  (elem (table $t1) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 10) (i32.const 0) (i32.const 20)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 4))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 1))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 22)) (i32.const 7))\n(assert_return (invoke \"check_t1\" (i32.const 23)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 24)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 25)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 26)) (i32.const 6))\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (nop))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t1 $t1 (i32.const 13) (i32.const 2) (i32.const 3)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t1 $t1 (i32.const 25) (i32.const 15) (i32.const 2)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 25)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 26)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t1 $t1 (i32.const 13) (i32.const 25) (i32.const 3)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_trap (invoke \"check_t0\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 15)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t1 $t1 (i32.const 20) (i32.const 22) (i32.const 4)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t1 $t1 (i32.const 25) (i32.const 1) (i32.const 3)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 26)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 27)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t1 $t1 (i32.const 10) (i32.const 12) (i32.const 7)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 10)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 11)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t1 $t1 (i32.const 12) (i32.const 10) (i32.const 7)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 13)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 17)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 18)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 11)) (i32.const 6))\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 7))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (elem (table $t0) (i32.const 3) func 1 3 1 4)\n  (elem (table $t0) (i32.const 11) func 6 3 2 5 7)\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.copy $t0 $t1 (i32.const 10) (i32.const 0) (i32.const 20)))\n  (func (export \"check_t0\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n  (func (export \"check_t1\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check_t0\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t0\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check_t0\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check_t0\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t0\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check_t0\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check_t0\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check_t0\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check_t0\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check_t0\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t0\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 2)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 4)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 5)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 6)) (i32.const 4))\n(assert_trap (invoke \"check_t1\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 12)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 13)) (i32.const 1))\n(assert_return (invoke \"check_t1\" (i32.const 14)) (i32.const 4))\n(assert_return (invoke \"check_t1\" (i32.const 15)) (i32.const 1))\n(assert_trap (invoke \"check_t1\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 21)) \"uninitialized element\")\n(assert_return (invoke \"check_t1\" (i32.const 22)) (i32.const 7))\n(assert_return (invoke \"check_t1\" (i32.const 23)) (i32.const 5))\n(assert_return (invoke \"check_t1\" (i32.const 24)) (i32.const 2))\n(assert_return (invoke \"check_t1\" (i32.const 25)) (i32.const 3))\n(assert_return (invoke \"check_t1\" (i32.const 26)) (i32.const 6))\n(assert_trap (invoke \"check_t1\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check_t1\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 28) (i32.const 1) (i32.const 3))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 0xFFFFFFFE) (i32.const 1) (i32.const 2))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 15) (i32.const 25) (i32.const 6))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 15) (i32.const 0xFFFFFFFE) (i32.const 2))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 15) (i32.const 25) (i32.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 30) (i32.const 15) (i32.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 31) (i32.const 15) (i32.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 15) (i32.const 30) (i32.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 15) (i32.const 31) (i32.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 30) (i32.const 30) (i32.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i32.const 31) (i32.const 31) (i32.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 28) (i32.const 1) (i32.const 3))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 0xFFFFFFFE) (i32.const 1) (i32.const 2))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 15) (i32.const 25) (i32.const 6))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 15) (i32.const 0xFFFFFFFE) (i32.const 2))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 15) (i32.const 25) (i32.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 30) (i32.const 15) (i32.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 31) (i32.const 15) (i32.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 15) (i32.const 30) (i32.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 15) (i32.const 31) (i32.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 30) (i32.const 30) (i32.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i32.const 31) (i32.const 31) (i32.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 28) (i64.const 1) (i64.const 3))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 0xFFFFFFFE) (i64.const 1) (i64.const 2))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 15) (i64.const 25) (i64.const 6))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 15) (i64.const 0xFFFFFFFE) (i64.const 2))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 15) (i64.const 25) (i64.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 30) (i64.const 15) (i64.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 31) (i64.const 15) (i64.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 15) (i64.const 30) (i64.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 15) (i64.const 31) (i64.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 30) (i64.const 30) (i64.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t0 $t0 (i64.const 31) (i64.const 31) (i64.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 28) (i64.const 1) (i64.const 3))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 0xFFFFFFFE) (i64.const 1) (i64.const 2))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 15) (i64.const 25) (i64.const 6))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 15) (i64.const 0xFFFFFFFE) (i64.const 2))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 15) (i64.const 25) (i64.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 30) (i64.const 15) (i64.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 31) (i64.const 15) (i64.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 15) (i64.const 30) (i64.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 15) (i64.const 31) (i64.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 30) (i64.const 30) (i64.const 0))\n    ))\n\n(invoke \"test\")\n\n(module\n  (table $t0 i64 30 30 funcref)\n  (table $t1 i64 30 30 funcref)\n  (elem (table $t0) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.copy $t1 $t0 (i64.const 31) (i64.const 31) (i64.const 0))\n    ))\n\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 0)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 24) (i32.const 0) (i32.const 16))\n             \"out of bounds table access\")\n(assert_return (invoke \"test\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 3)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 5)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 6)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 7)) (i32.const 7))\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 0)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 23) (i32.const 0) (i32.const 15))\n             \"out of bounds table access\")\n(assert_return (invoke \"test\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 3)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 5)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 6)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 7)) (i32.const 7))\n(assert_return (invoke \"test\" (i32.const 8)) (i32.const 8))\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 24)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 24) (i32.const 16))\n             \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_return (invoke \"test\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 25)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 26)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 27)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 28)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 29)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 30)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 31)) (i32.const 7))\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 23)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 23) (i32.const 15))\n             \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_return (invoke \"test\" (i32.const 23)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 24)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 25)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 26)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 27)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 28)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 29)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 30)) (i32.const 7))\n(assert_return (invoke \"test\" (i32.const 31)) (i32.const 8))\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 11)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 24) (i32.const 11) (i32.const 16))\n             \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_return (invoke \"test\" (i32.const 11)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 12)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 13)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 14)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 15)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 16)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 17)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 18)) (i32.const 7))\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 24)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 11) (i32.const 24) (i32.const 16))\n             \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_return (invoke \"test\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 25)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 26)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 27)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 28)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 29)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 30)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 31)) (i32.const 7))\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 21)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 24) (i32.const 21) (i32.const 16))\n             \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_return (invoke \"test\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 22)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 23)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 24)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 25)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 26)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 27)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 28)) (i32.const 7))\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 24)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 21) (i32.const 24) (i32.const 16))\n             \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_return (invoke \"test\" (i32.const 24)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 25)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 26)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 27)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 28)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 29)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 30)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 31)) (i32.const 7))\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem (i32.const 21)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8 $f9 $f10)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 21) (i32.const 21) (i32.const 16))\n             \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_return (invoke \"test\" (i32.const 21)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 22)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 23)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 24)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 25)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 26)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 27)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 28)) (i32.const 7))\n(assert_return (invoke \"test\" (i32.const 29)) (i32.const 8))\n(assert_return (invoke \"test\" (i32.const 30)) (i32.const 9))\n(assert_return (invoke \"test\" (i32.const 31)) (i32.const 10))\n\n(module\n  (type (func (result i32)))\n  (table 128 128 funcref)\n  (elem (i32.const 112)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 112) (i32.const 4294967264))\n             \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 32)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 33)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 34)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 35)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 36)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 37)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 38)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 39)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 40)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 41)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 42)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 43)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 44)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 45)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 46)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 47)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 48)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 49)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 50)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 51)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 52)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 53)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 54)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 55)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 56)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 57)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 58)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 59)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 60)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 61)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 62)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 63)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 64)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 65)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 66)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 67)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 68)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 69)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 70)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 71)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 72)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 73)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 74)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 75)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 76)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 77)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 78)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 79)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 80)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 81)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 82)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 83)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 84)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 85)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 86)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 87)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 88)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 89)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 90)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 91)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 92)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 93)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 94)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 95)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 96)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 97)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 98)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 99)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 100)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 101)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 102)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 103)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 104)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 105)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 106)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 107)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 108)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 109)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 110)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 111)) \"uninitialized element\")\n(assert_return (invoke \"test\" (i32.const 112)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 113)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 114)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 115)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 116)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 117)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 118)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 119)) (i32.const 7))\n(assert_return (invoke \"test\" (i32.const 120)) (i32.const 8))\n(assert_return (invoke \"test\" (i32.const 121)) (i32.const 9))\n(assert_return (invoke \"test\" (i32.const 122)) (i32.const 10))\n(assert_return (invoke \"test\" (i32.const 123)) (i32.const 11))\n(assert_return (invoke \"test\" (i32.const 124)) (i32.const 12))\n(assert_return (invoke \"test\" (i32.const 125)) (i32.const 13))\n(assert_return (invoke \"test\" (i32.const 126)) (i32.const 14))\n(assert_return (invoke \"test\" (i32.const 127)) (i32.const 15))\n\n(module\n  (type (func (result i32)))\n  (table 128 128 funcref)\n  (elem (i32.const 0)\n         $f0 $f1 $f2 $f3 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15)\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $targetOffs i32) (param $srcOffs i32) (param $len i32)\n    (table.copy (local.get $targetOffs) (local.get $srcOffs) (local.get $len))))\n\n(assert_trap (invoke \"run\" (i32.const 112) (i32.const 0) (i32.const 4294967264))\n             \"out of bounds table access\")\n(assert_return (invoke \"test\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"test\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"test\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"test\" (i32.const 3)) (i32.const 3))\n(assert_return (invoke \"test\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"test\" (i32.const 5)) (i32.const 5))\n(assert_return (invoke \"test\" (i32.const 6)) (i32.const 6))\n(assert_return (invoke \"test\" (i32.const 7)) (i32.const 7))\n(assert_return (invoke \"test\" (i32.const 8)) (i32.const 8))\n(assert_return (invoke \"test\" (i32.const 9)) (i32.const 9))\n(assert_return (invoke \"test\" (i32.const 10)) (i32.const 10))\n(assert_return (invoke \"test\" (i32.const 11)) (i32.const 11))\n(assert_return (invoke \"test\" (i32.const 12)) (i32.const 12))\n(assert_return (invoke \"test\" (i32.const 13)) (i32.const 13))\n(assert_return (invoke \"test\" (i32.const 14)) (i32.const 14))\n(assert_return (invoke \"test\" (i32.const 15)) (i32.const 15))\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 32)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 33)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 34)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 35)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 36)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 37)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 38)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 39)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 40)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 41)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 42)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 43)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 44)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 45)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 46)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 47)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 48)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 49)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 50)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 51)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 52)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 53)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 54)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 55)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 56)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 57)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 58)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 59)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 60)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 61)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 62)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 63)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 64)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 65)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 66)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 67)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 68)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 69)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 70)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 71)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 72)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 73)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 74)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 75)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 76)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 77)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 78)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 79)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 80)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 81)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 82)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 83)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 84)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 85)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 86)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 87)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 88)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 89)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 90)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 91)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 92)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 93)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 94)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 95)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 96)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 97)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 98)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 99)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 100)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 101)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 102)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 103)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 104)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 105)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 106)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 107)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 108)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 109)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 110)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 111)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 112)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 113)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 114)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 115)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 116)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 117)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 118)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 119)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 120)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 121)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 122)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 123)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 124)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 125)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 126)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 127)) \"uninitialized element\")\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table_copy_mixed.wast",
    "content": ";; Valid cases\n(module\n  (table $t32 30 30 funcref)\n  (table $t64 i64 30 30 funcref)\n\n  (func (export \"test32\")\n    (table.copy $t32 $t32 (i32.const 13) (i32.const 2) (i32.const 3)))\n\n  (func (export \"test64\")\n    (table.copy $t64 $t64 (i64.const 13) (i64.const 2) (i64.const 3)))\n\n  (func (export \"test_64to32\")\n    (table.copy $t32 $t64 (i32.const 13) (i64.const 2) (i32.const 3)))\n\n  (func (export \"test_32to64\")\n    (table.copy $t64 $t32 (i64.const 13) (i32.const 2) (i32.const 3)))\n)\n\n;; Invalid cases\n(assert_invalid (module\n  (table $t32 30 30 funcref)\n  (table $t64 i64 30 30 funcref)\n\n  (func (export \"bad_size_arg\")\n    (table.copy $t32 $t64 (i32.const 13) (i64.const 2) (i64.const 3)))\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid (module\n  (table $t32 30 30 funcref)\n  (table $t64 i64 30 30 funcref)\n\n  (func (export \"bad_src_idx\")\n    (table.copy $t32 $t64 (i32.const 13) (i32.const 2) (i32.const 3)))\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid (module\n  (table $t32 30 30 funcref)\n  (table $t64 i64 30 30 funcref)\n\n  (func (export \"bad_dst_idx\")\n    (table.copy $t32 $t64 (i64.const 13) (i64.const 2) (i32.const 3)))\n  )\n  \"type mismatch\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table_fill.wast",
    "content": "(module\n  (table $t 10 externref)\n\n  (func (export \"fill\") (param $i i32) (param $r externref) (param $n i32)\n    (table.fill $t (local.get $i) (local.get $r) (local.get $n))\n  )\n\n  (func (export \"fill-abbrev\") (param $i i32) (param $r externref) (param $n i32)\n    (table.fill (local.get $i) (local.get $r) (local.get $n))\n  )\n\n  (func (export \"get\") (param $i i32) (result externref)\n    (table.get $t (local.get $i))\n  )\n\n  (table $t64 i64 10 externref)\n\n  (func (export \"fill-t64\") (param $i i64) (param $r externref) (param $n i64)\n    (table.fill $t64 (local.get $i) (local.get $r) (local.get $n))\n  )\n\n  (func (export \"get-t64\") (param $i i64) (result externref)\n    (table.get $t64 (local.get $i))\n  )\n)\n\n(assert_return (invoke \"get\" (i32.const 1)) (ref.null extern))\n(assert_return (invoke \"get\" (i32.const 2)) (ref.null extern))\n(assert_return (invoke \"get\" (i32.const 3)) (ref.null extern))\n(assert_return (invoke \"get\" (i32.const 4)) (ref.null extern))\n(assert_return (invoke \"get\" (i32.const 5)) (ref.null extern))\n\n(assert_return (invoke \"fill\" (i32.const 2) (ref.extern 1) (i32.const 3)))\n(assert_return (invoke \"get\" (i32.const 1)) (ref.null extern))\n(assert_return (invoke \"get\" (i32.const 2)) (ref.extern 1))\n(assert_return (invoke \"get\" (i32.const 3)) (ref.extern 1))\n(assert_return (invoke \"get\" (i32.const 4)) (ref.extern 1))\n(assert_return (invoke \"get\" (i32.const 5)) (ref.null extern))\n\n(assert_return (invoke \"fill\" (i32.const 4) (ref.extern 2) (i32.const 2)))\n(assert_return (invoke \"get\" (i32.const 3)) (ref.extern 1))\n(assert_return (invoke \"get\" (i32.const 4)) (ref.extern 2))\n(assert_return (invoke \"get\" (i32.const 5)) (ref.extern 2))\n(assert_return (invoke \"get\" (i32.const 6)) (ref.null extern))\n\n(assert_return (invoke \"fill\" (i32.const 4) (ref.extern 3) (i32.const 0)))\n(assert_return (invoke \"get\" (i32.const 3)) (ref.extern 1))\n(assert_return (invoke \"get\" (i32.const 4)) (ref.extern 2))\n(assert_return (invoke \"get\" (i32.const 5)) (ref.extern 2))\n\n(assert_return (invoke \"fill\" (i32.const 8) (ref.extern 4) (i32.const 2)))\n(assert_return (invoke \"get\" (i32.const 7)) (ref.null extern))\n(assert_return (invoke \"get\" (i32.const 8)) (ref.extern 4))\n(assert_return (invoke \"get\" (i32.const 9)) (ref.extern 4))\n\n(assert_return (invoke \"fill-abbrev\" (i32.const 9) (ref.null extern) (i32.const 1)))\n(assert_return (invoke \"get\" (i32.const 8)) (ref.extern 4))\n(assert_return (invoke \"get\" (i32.const 9)) (ref.null extern))\n\n(assert_return (invoke \"fill\" (i32.const 10) (ref.extern 5) (i32.const 0)))\n(assert_return (invoke \"get\" (i32.const 9)) (ref.null extern))\n\n(assert_trap\n  (invoke \"fill\" (i32.const 8) (ref.extern 6) (i32.const 3))\n  \"out of bounds table access\"\n)\n(assert_return (invoke \"get\" (i32.const 7)) (ref.null extern))\n(assert_return (invoke \"get\" (i32.const 8)) (ref.extern 4))\n(assert_return (invoke \"get\" (i32.const 9)) (ref.null extern))\n\n(assert_trap\n  (invoke \"fill\" (i32.const 11) (ref.null extern) (i32.const 0))\n  \"out of bounds table access\"\n)\n\n(assert_trap\n  (invoke \"fill\" (i32.const 11) (ref.null extern) (i32.const 10))\n  \"out of bounds table access\"\n)\n\n;; Same as above but for t64\n\n(assert_return (invoke \"get-t64\" (i64.const 1)) (ref.null extern))\n(assert_return (invoke \"get-t64\" (i64.const 2)) (ref.null extern))\n(assert_return (invoke \"get-t64\" (i64.const 3)) (ref.null extern))\n(assert_return (invoke \"get-t64\" (i64.const 4)) (ref.null extern))\n(assert_return (invoke \"get-t64\" (i64.const 5)) (ref.null extern))\n\n(assert_return (invoke \"fill-t64\" (i64.const 2) (ref.extern 1) (i64.const 3)))\n(assert_return (invoke \"get-t64\" (i64.const 1)) (ref.null extern))\n(assert_return (invoke \"get-t64\" (i64.const 2)) (ref.extern 1))\n(assert_return (invoke \"get-t64\" (i64.const 3)) (ref.extern 1))\n(assert_return (invoke \"get-t64\" (i64.const 4)) (ref.extern 1))\n(assert_return (invoke \"get-t64\" (i64.const 5)) (ref.null extern))\n\n(assert_return (invoke \"fill-t64\" (i64.const 4) (ref.extern 2) (i64.const 2)))\n(assert_return (invoke \"get-t64\" (i64.const 3)) (ref.extern 1))\n(assert_return (invoke \"get-t64\" (i64.const 4)) (ref.extern 2))\n(assert_return (invoke \"get-t64\" (i64.const 5)) (ref.extern 2))\n(assert_return (invoke \"get-t64\" (i64.const 6)) (ref.null extern))\n\n(assert_return (invoke \"fill-t64\" (i64.const 4) (ref.extern 3) (i64.const 0)))\n(assert_return (invoke \"get-t64\" (i64.const 3)) (ref.extern 1))\n(assert_return (invoke \"get-t64\" (i64.const 4)) (ref.extern 2))\n(assert_return (invoke \"get-t64\" (i64.const 5)) (ref.extern 2))\n\n(assert_return (invoke \"fill-t64\" (i64.const 8) (ref.extern 4) (i64.const 2)))\n(assert_return (invoke \"get-t64\" (i64.const 7)) (ref.null extern))\n(assert_return (invoke \"get-t64\" (i64.const 8)) (ref.extern 4))\n(assert_return (invoke \"get-t64\" (i64.const 9)) (ref.extern 4))\n\n(assert_return (invoke \"fill-t64\" (i64.const 9) (ref.null extern) (i64.const 1)))\n(assert_return (invoke \"get-t64\" (i64.const 8)) (ref.extern 4))\n(assert_return (invoke \"get-t64\" (i64.const 9)) (ref.null extern))\n\n(assert_return (invoke \"fill-t64\" (i64.const 10) (ref.extern 5) (i64.const 0)))\n(assert_return (invoke \"get-t64\" (i64.const 9)) (ref.null extern))\n\n(assert_trap\n  (invoke \"fill-t64\" (i64.const 8) (ref.extern 6) (i64.const 3))\n  \"out of bounds table access\"\n)\n(assert_return (invoke \"get-t64\" (i64.const 7)) (ref.null extern))\n(assert_return (invoke \"get-t64\" (i64.const 8)) (ref.extern 4))\n(assert_return (invoke \"get-t64\" (i64.const 9)) (ref.null extern))\n\n(assert_trap\n  (invoke \"fill-t64\" (i64.const 11) (ref.null extern) (i64.const 0))\n  \"out of bounds table access\"\n)\n\n(assert_trap\n  (invoke \"fill-t64\" (i64.const 11) (ref.null extern) (i64.const 10))\n  \"out of bounds table access\"\n)\n\n;; Type errors\n\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-index-value-length-empty-vs-i32-i32\n      (table.fill $t)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-index-empty-vs-i32\n      (table.fill $t (ref.null extern) (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-value-empty-vs\n      (table.fill $t (i32.const 1) (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-length-empty-vs-i32\n      (table.fill $t (i32.const 1) (ref.null extern))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 0 externref)\n    (func $type-index-f32-vs-i32\n      (table.fill $t (f32.const 1) (ref.null extern) (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 0 funcref)\n    (func $type-value-vs-funcref (param $r externref)\n      (table.fill $t (i32.const 1) (local.get $r) (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 0 externref)\n    (func $type-length-f32-vs-i32\n      (table.fill $t (i32.const 1) (ref.null extern) (f32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (table $t1 1 externref)\n    (table $t2 1 funcref)\n    (func $type-value-externref-vs-funcref-multi (param $r externref)\n      (table.fill $t2 (i32.const 0) (local.get $r) (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (table $t 1 externref)\n    (func $type-result-empty-vs-num (result i32)\n      (table.fill $t (i32.const 0) (ref.null extern) (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table_get.wast",
    "content": "(module\n  (table $t2 2 externref)\n  (table $t3 3 funcref)\n  (table $t64 i64 3 funcref)\n  (elem (table $t3) (i32.const 1) func $dummy)\n  (func $dummy)\n\n  (func (export \"init\") (param $r externref)\n    (table.set $t2 (i32.const 1) (local.get $r))\n    (table.set $t3 (i32.const 2) (table.get $t3 (i32.const 1)))\n  )\n\n  (func (export \"get-externref\") (param $i i32) (result externref)\n    (table.get (local.get $i))\n  )\n  (func $f3 (export \"get-funcref\") (param $i i32) (result funcref)\n    (table.get $t3 (local.get $i))\n  )\n  (func $f4 (export \"get-funcref-t64\") (param $i i64) (result funcref)\n    (table.get $t64 (local.get $i))\n  )\n\n  (func (export \"is_null-funcref\") (param $i i32) (result i32)\n    (ref.is_null (call $f3 (local.get $i)))\n  )\n)\n\n(invoke \"init\" (ref.extern 1))\n\n(assert_return (invoke \"get-externref\" (i32.const 0)) (ref.null extern))\n(assert_return (invoke \"get-externref\" (i32.const 1)) (ref.extern 1))\n\n(assert_return (invoke \"get-funcref\" (i32.const 0)) (ref.null func))\n(assert_return (invoke \"get-funcref-t64\" (i64.const 0)) (ref.null func))\n(assert_return (invoke \"is_null-funcref\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"is_null-funcref\" (i32.const 2)) (i32.const 0))\n\n(assert_trap (invoke \"get-externref\" (i32.const 2)) \"out of bounds table access\")\n(assert_trap (invoke \"get-funcref\" (i32.const 3)) \"out of bounds table access\")\n(assert_trap (invoke \"get-externref\" (i32.const -1)) \"out of bounds table access\")\n(assert_trap (invoke \"get-funcref\" (i32.const -1)) \"out of bounds table access\")\n\n\n;; Type errors\n\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-index-empty-vs-i32 (result externref)\n      (table.get $t)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-index-f32-vs-i32 (result externref)\n      (table.get $t (f32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-result-externref-vs-empty\n      (table.get $t (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-result-externref-vs-funcref (result funcref)\n      (table.get $t (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (table $t1 1 funcref)\n    (table $t2 1 externref)\n    (func $type-result-externref-vs-funcref-multi (result funcref)\n      (table.get $t2 (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table_grow.wast",
    "content": "(module\n  (table $t 0 externref)\n\n  (func (export \"get\") (param $i i32) (result externref) (table.get $t (local.get $i)))\n  (func (export \"set\") (param $i i32) (param $r externref) (table.set $t (local.get $i) (local.get $r)))\n\n  (func (export \"grow\") (param $sz i32) (param $init externref) (result i32)\n    (table.grow $t (local.get $init) (local.get $sz))\n  )\n  (func (export \"grow-abbrev\") (param $sz i32) (param $init externref) (result i32)\n    (table.grow (local.get $init) (local.get $sz))\n  )\n  (func (export \"size\") (result i32) (table.size $t))\n\n  (table $t64 i64 0 externref)\n\n  (func (export \"get-t64\") (param $i i64) (result externref) (table.get $t64 (local.get $i)))\n  (func (export \"set-t64\") (param $i i64) (param $r externref) (table.set $t64 (local.get $i) (local.get $r)))\n  (func (export \"grow-t64\") (param $sz i64) (param $init externref) (result i64)\n    (table.grow $t64 (local.get $init) (local.get $sz))\n  )\n  (func (export \"size-t64\") (result i64) (table.size $t64))\n)\n\n(assert_return (invoke \"size\") (i32.const 0))\n(assert_trap (invoke \"set\" (i32.const 0) (ref.extern 2)) \"out of bounds table access\")\n(assert_trap (invoke \"get\" (i32.const 0)) \"out of bounds table access\")\n\n(assert_return (invoke \"grow\" (i32.const 1) (ref.null extern)) (i32.const 0))\n(assert_return (invoke \"size\") (i32.const 1))\n(assert_return (invoke \"get\" (i32.const 0)) (ref.null extern))\n(assert_return (invoke \"set\" (i32.const 0) (ref.extern 2)))\n(assert_return (invoke \"get\" (i32.const 0)) (ref.extern 2))\n(assert_trap (invoke \"set\" (i32.const 1) (ref.extern 2)) \"out of bounds table access\")\n(assert_trap (invoke \"get\" (i32.const 1)) \"out of bounds table access\")\n\n(assert_return (invoke \"grow-abbrev\" (i32.const 4) (ref.extern 3)) (i32.const 1))\n(assert_return (invoke \"size\") (i32.const 5))\n(assert_return (invoke \"get\" (i32.const 0)) (ref.extern 2))\n(assert_return (invoke \"set\" (i32.const 0) (ref.extern 2)))\n(assert_return (invoke \"get\" (i32.const 0)) (ref.extern 2))\n(assert_return (invoke \"get\" (i32.const 1)) (ref.extern 3))\n(assert_return (invoke \"get\" (i32.const 4)) (ref.extern 3))\n(assert_return (invoke \"set\" (i32.const 4) (ref.extern 4)))\n(assert_return (invoke \"get\" (i32.const 4)) (ref.extern 4))\n(assert_trap (invoke \"set\" (i32.const 5) (ref.extern 2)) \"out of bounds table access\")\n(assert_trap (invoke \"get\" (i32.const 5)) \"out of bounds table access\")\n\n;; Similar to above but for t64\n(assert_return (invoke \"size-t64\") (i64.const 0))\n(assert_trap (invoke \"set-t64\" (i64.const 0) (ref.extern 2)) \"out of bounds table access\")\n(assert_trap (invoke \"get-t64\" (i64.const 0)) \"out of bounds table access\")\n\n(assert_return (invoke \"grow-t64\" (i64.const 1) (ref.null extern)) (i64.const 0))\n(assert_return (invoke \"size-t64\") (i64.const 1))\n(assert_return (invoke \"get-t64\" (i64.const 0)) (ref.null extern))\n(assert_return (invoke \"set-t64\" (i64.const 0) (ref.extern 2)))\n(assert_return (invoke \"get-t64\" (i64.const 0)) (ref.extern 2))\n(assert_trap (invoke \"set-t64\" (i64.const 1) (ref.extern 2)) \"out of bounds table access\")\n(assert_trap (invoke \"get-t64\" (i64.const 1)) \"out of bounds table access\")\n\n(assert_return (invoke \"grow-t64\" (i64.const 4) (ref.extern 3)) (i64.const 1))\n(assert_return (invoke \"size-t64\") (i64.const 5))\n(assert_return (invoke \"get-t64\" (i64.const 0)) (ref.extern 2))\n(assert_return (invoke \"set-t64\" (i64.const 0) (ref.extern 2)))\n(assert_return (invoke \"get-t64\" (i64.const 0)) (ref.extern 2))\n(assert_return (invoke \"get-t64\" (i64.const 1)) (ref.extern 3))\n(assert_return (invoke \"get-t64\" (i64.const 4)) (ref.extern 3))\n(assert_return (invoke \"set-t64\" (i64.const 4) (ref.extern 4)))\n(assert_return (invoke \"get-t64\" (i64.const 4)) (ref.extern 4))\n(assert_trap (invoke \"set-t64\" (i64.const 5) (ref.extern 2)) \"out of bounds table access\")\n(assert_trap (invoke \"get-t64\" (i64.const 5)) \"out of bounds table access\")\n\n;; Reject growing to size outside i32 value range\n(module\n  (table $t 0x10 funcref)\n  (elem declare func $f)\n  (func $f (export \"grow\") (result i32)\n    (table.grow $t (ref.func $f) (i32.const 0xffff_fff0))\n  )\n)\n\n(assert_return (invoke \"grow\") (i32.const -1))\n\n\n(module\n  (table $t 0 externref)\n  (func (export \"grow\") (param i32) (result i32)\n    (table.grow $t (ref.null extern) (local.get 0))\n  )\n)\n\n(assert_return (invoke \"grow\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"grow\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"grow\" (i32.const 0)) (i32.const 1))\n(assert_return (invoke \"grow\" (i32.const 2)) (i32.const 1))\n(assert_return (invoke \"grow\" (i32.const 800)) (i32.const 3))\n\n\n(module\n  (table $t 0 10 externref)\n  (func (export \"grow\") (param i32) (result i32)\n    (table.grow $t (ref.null extern) (local.get 0))\n  )\n)\n\n(assert_return (invoke \"grow\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"grow\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"grow\" (i32.const 1)) (i32.const 1))\n(assert_return (invoke \"grow\" (i32.const 2)) (i32.const 2))\n(assert_return (invoke \"grow\" (i32.const 6)) (i32.const 4))\n(assert_return (invoke \"grow\" (i32.const 0)) (i32.const 10))\n(assert_return (invoke \"grow\" (i32.const 1)) (i32.const -1))\n(assert_return (invoke \"grow\" (i32.const 0x10000)) (i32.const -1))\n\n\n(module\n  (table $t 10 funcref)\n  (func (export \"grow\") (param i32) (result i32)\n    (table.grow $t (ref.null func) (local.get 0))\n  )\n  (elem declare func 1)\n  (func (export \"check-table-null\") (param i32 i32) (result funcref)\n    (local funcref)\n    (local.set 2 (ref.func 1))\n    (block\n      (loop\n        (local.set 2 (table.get $t (local.get 0)))\n        (br_if 1 (i32.eqz (ref.is_null (local.get 2))))\n        (br_if 1 (i32.ge_u (local.get 0) (local.get 1)))\n        (local.set 0 (i32.add (local.get 0) (i32.const 1)))\n        (br_if 0 (i32.le_u (local.get 0) (local.get 1)))\n      )\n    )\n    (local.get 2)\n  )\n)\n\n(assert_return (invoke \"check-table-null\" (i32.const 0) (i32.const 9)) (ref.null func))\n(assert_return (invoke \"grow\" (i32.const 10)) (i32.const 10))\n(assert_return (invoke \"check-table-null\" (i32.const 0) (i32.const 19)) (ref.null func))\n\n\n(module $Tgt\n  (table (export \"table\") 1 funcref) ;; initial size is 1\n  (func (export \"grow\") (result i32) (table.grow (ref.null func) (i32.const 1)))\n)\n(register \"grown-table\" $Tgt)\n(assert_return (invoke $Tgt \"grow\") (i32.const 1)) ;; now size is 2\n(module $Tgit1\n  ;; imported table limits should match, because external table size is 2 now\n  (table (export \"table\") (import \"grown-table\" \"table\") 2 funcref)\n  (func (export \"grow\") (result i32) (table.grow (ref.null func) (i32.const 1)))\n)\n(register \"grown-imported-table\" $Tgit1)\n(assert_return (invoke $Tgit1 \"grow\") (i32.const 2)) ;; now size is 3\n(module $Tgit2\n  ;; imported table limits should match, because external table size is 3 now\n  (import \"grown-imported-table\" \"table\" (table 3 funcref))\n  (func (export \"size\") (result i32) (table.size))\n)\n(assert_return (invoke $Tgit2 \"size\") (i32.const 3))\n\n\n;; Type errors\n\n(assert_invalid\n  (module\n    (table $t 0 externref)\n    (func $type-init-size-empty-vs-i32-externref (result i32)\n      (table.grow $t)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 0 externref)\n    (func $type-size-empty-vs-i32 (result i32)\n      (table.grow $t (ref.null extern))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 0 externref)\n    (func $type-init-empty-vs-externref (result i32)\n      (table.grow $t (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 0 externref)\n    (func $type-size-f32-vs-i32 (result i32)\n      (table.grow $t (ref.null extern) (f32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 0 funcref)\n    (func $type-init-externref-vs-funcref (param $r externref) (result i32)\n      (table.grow $t (local.get $r) (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (table $t 1 externref)\n    (func $type-result-i32-vs-empty\n      (table.grow $t (ref.null extern) (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 1 externref)\n    (func $type-result-i32-vs-f32 (result f32)\n      (table.grow $t (ref.null extern) (i32.const 0))\n    )\n  )\n  \"type mismatch\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table_init.wast",
    "content": ";;\n;; Generated by ../meta/generate_table_init.js\n;; DO NOT EDIT THIS FILE.  CHANGE THE SOURCE AND REGENERATE.\n;;\n\n(module\n  (func (export \"ef0\") (result i32) (i32.const 0))\n  (func (export \"ef1\") (result i32) (i32.const 1))\n  (func (export \"ef2\") (result i32) (i32.const 2))\n  (func (export \"ef3\") (result i32) (i32.const 3))\n  (func (export \"ef4\") (result i32) (i32.const 4))\n)\n(register \"a\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 7) (i32.const 0) (i32.const 4)))\n  (func (export \"check\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i32.const 6)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 7)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 8)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 9)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 10)) (i32.const 8))\n(assert_trap (invoke \"check\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t0 3 (i32.const 15) (i32.const 1) (i32.const 3)))\n  (func (export \"check\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 15)) (i32.const 9))\n(assert_return (invoke \"check\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 17)) (i32.const 7))\n(assert_trap (invoke \"check\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 7) (i32.const 0) (i32.const 4))\n         (elem.drop 1)\n         (table.init $t0 3 (i32.const 15) (i32.const 1) (i32.const 3))\n         (elem.drop 3)\n         (table.copy $t0 0 (i32.const 20) (i32.const 15) (i32.const 5))\n         (table.copy $t0 0 (i32.const 21) (i32.const 29) (i32.const 1))\n         (table.copy $t0 0 (i32.const 24) (i32.const 10) (i32.const 1))\n         (table.copy $t0 0 (i32.const 13) (i32.const 11) (i32.const 4))\n         (table.copy $t0 0 (i32.const 19) (i32.const 20) (i32.const 5)))\n  (func (export \"check\") (param i32) (result i32)\n    (call_indirect $t0 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i32.const 6)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 7)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 8)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 9)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 10)) (i32.const 8))\n(assert_trap (invoke \"check\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 12)) (i32.const 7))\n(assert_trap (invoke \"check\" (i32.const 13)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 14)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 15)) (i32.const 5))\n(assert_return (invoke \"check\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 17)) (i32.const 7))\n(assert_trap (invoke \"check\" (i32.const 18)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 19)) (i32.const 9))\n(assert_trap (invoke \"check\" (i32.const 20)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 21)) (i32.const 7))\n(assert_trap (invoke \"check\" (i32.const 22)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 23)) (i32.const 8))\n(assert_return (invoke \"check\" (i32.const 24)) (i32.const 8))\n(assert_trap (invoke \"check\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 7) (i32.const 0) (i32.const 4)))\n  (func (export \"check\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i32.const 6)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 7)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 8)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 9)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 10)) (i32.const 8))\n(assert_trap (invoke \"check\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 15)) (i32.const 3))\n(assert_return (invoke \"check\" (i32.const 16)) (i32.const 6))\n(assert_trap (invoke \"check\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t1 3 (i32.const 15) (i32.const 1) (i32.const 3)))\n  (func (export \"check\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 12)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 13)) (i32.const 5))\n(assert_return (invoke \"check\" (i32.const 14)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 15)) (i32.const 9))\n(assert_return (invoke \"check\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 17)) (i32.const 7))\n(assert_trap (invoke \"check\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 7) (i32.const 0) (i32.const 4))\n         (elem.drop 1)\n         (table.init $t1 3 (i32.const 15) (i32.const 1) (i32.const 3))\n         (elem.drop 3)\n         (table.copy $t1 1 (i32.const 20) (i32.const 15) (i32.const 5))\n         (table.copy $t1 1 (i32.const 21) (i32.const 29) (i32.const 1))\n         (table.copy $t1 1 (i32.const 24) (i32.const 10) (i32.const 1))\n         (table.copy $t1 1 (i32.const 13) (i32.const 11) (i32.const 4))\n         (table.copy $t1 1 (i32.const 19) (i32.const 20) (i32.const 5)))\n  (func (export \"check\") (param i32) (result i32)\n    (call_indirect $t1 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i32.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i32.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i32.const 6)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 7)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 8)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 9)) (i32.const 1))\n(assert_return (invoke \"check\" (i32.const 10)) (i32.const 8))\n(assert_trap (invoke \"check\" (i32.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 12)) (i32.const 7))\n(assert_trap (invoke \"check\" (i32.const 13)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 14)) (i32.const 7))\n(assert_return (invoke \"check\" (i32.const 15)) (i32.const 5))\n(assert_return (invoke \"check\" (i32.const 16)) (i32.const 2))\n(assert_return (invoke \"check\" (i32.const 17)) (i32.const 7))\n(assert_trap (invoke \"check\" (i32.const 18)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 19)) (i32.const 9))\n(assert_trap (invoke \"check\" (i32.const 20)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 21)) (i32.const 7))\n(assert_trap (invoke \"check\" (i32.const 22)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i32.const 23)) (i32.const 8))\n(assert_return (invoke \"check\" (i32.const 24)) (i32.const 8))\n(assert_trap (invoke \"check\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i32.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t2) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t2) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t2 1 (i64.const 7) (i32.const 0) (i32.const 4)))\n  (func (export \"check\") (param i64) (result i32)\n    (call_indirect $t2 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i64.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i64.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i64.const 6)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 7)) (i32.const 2))\n(assert_return (invoke \"check\" (i64.const 8)) (i32.const 7))\n(assert_return (invoke \"check\" (i64.const 9)) (i32.const 1))\n(assert_return (invoke \"check\" (i64.const 10)) (i32.const 8))\n(assert_trap (invoke \"check\" (i64.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"check\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"check\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"check\" (i64.const 15)) (i32.const 3))\n(assert_return (invoke \"check\" (i64.const 16)) (i32.const 6))\n(assert_trap (invoke \"check\" (i64.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t2) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t2) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t2 3 (i64.const 15) (i32.const 1) (i32.const 3)))\n  (func (export \"check\") (param i64) (result i32)\n    (call_indirect $t2 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i64.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i64.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i64.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 12)) (i32.const 7))\n(assert_return (invoke \"check\" (i64.const 13)) (i32.const 5))\n(assert_return (invoke \"check\" (i64.const 14)) (i32.const 2))\n(assert_return (invoke \"check\" (i64.const 15)) (i32.const 9))\n(assert_return (invoke \"check\" (i64.const 16)) (i32.const 2))\n(assert_return (invoke \"check\" (i64.const 17)) (i32.const 7))\n(assert_trap (invoke \"check\" (i64.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 29)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))  ;; type #0\n  (import \"a\" \"ef0\" (func (result i32)))    ;; index 0\n  (import \"a\" \"ef1\" (func (result i32)))\n  (import \"a\" \"ef2\" (func (result i32)))\n  (import \"a\" \"ef3\" (func (result i32)))\n  (import \"a\" \"ef4\" (func (result i32)))    ;; index 4\n  (table $t0 30 30 funcref)\n  (table $t1 30 30 funcref)\n  (table $t2 i64 30 30 funcref)\n  (elem (table $t2) (i64.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t2) (i64.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 5))  ;; index 5\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))  ;; index 9\n  (func (export \"test\")\n    (table.init $t2 1 (i64.const 7) (i32.const 0) (i32.const 4))\n         (elem.drop 1)\n         (table.init $t2 3 (i64.const 15) (i32.const 1) (i32.const 3))\n         (elem.drop 3)\n         (table.copy $t2 2 (i64.const 20) (i64.const 15) (i64.const 5))\n         (table.copy $t2 2 (i64.const 21) (i64.const 29) (i64.const 1))\n         (table.copy $t2 2 (i64.const 24) (i64.const 10) (i64.const 1))\n         (table.copy $t2 2 (i64.const 13) (i64.const 11) (i64.const 4))\n         (table.copy $t2 2 (i64.const 19) (i64.const 20) (i64.const 5)))\n  (func (export \"check\") (param i64) (result i32)\n    (call_indirect $t2 (type 0) (local.get 0)))\n)\n\n(invoke \"test\")\n(assert_trap (invoke \"check\" (i64.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 1)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 2)) (i32.const 3))\n(assert_return (invoke \"check\" (i64.const 3)) (i32.const 1))\n(assert_return (invoke \"check\" (i64.const 4)) (i32.const 4))\n(assert_return (invoke \"check\" (i64.const 5)) (i32.const 1))\n(assert_trap (invoke \"check\" (i64.const 6)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 7)) (i32.const 2))\n(assert_return (invoke \"check\" (i64.const 8)) (i32.const 7))\n(assert_return (invoke \"check\" (i64.const 9)) (i32.const 1))\n(assert_return (invoke \"check\" (i64.const 10)) (i32.const 8))\n(assert_trap (invoke \"check\" (i64.const 11)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 12)) (i32.const 7))\n(assert_trap (invoke \"check\" (i64.const 13)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 14)) (i32.const 7))\n(assert_return (invoke \"check\" (i64.const 15)) (i32.const 5))\n(assert_return (invoke \"check\" (i64.const 16)) (i32.const 2))\n(assert_return (invoke \"check\" (i64.const 17)) (i32.const 7))\n(assert_trap (invoke \"check\" (i64.const 18)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 19)) (i32.const 9))\n(assert_trap (invoke \"check\" (i64.const 20)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 21)) (i32.const 7))\n(assert_trap (invoke \"check\" (i64.const 22)) \"uninitialized element\")\n(assert_return (invoke \"check\" (i64.const 23)) (i32.const 8))\n(assert_return (invoke \"check\" (i64.const 24)) (i32.const 8))\n(assert_trap (invoke \"check\" (i64.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"check\" (i64.const 29)) \"uninitialized element\")\n(assert_invalid\n  (module\n    (func (export \"test\")\n      (elem.drop 0)))\n  \"unknown elem segment 0\")\n\n(assert_invalid\n  (module\n    (func (export \"test\")\n      (table.init 0 (i32.const 12) (i32.const 1) (i32.const 1))))\n  \"unknown table 0\")\n\n(assert_invalid\n  (module\n    (elem funcref (ref.func 0))\n    (func (result i32) (i32.const 0))\n    (func (export \"test\")\n      (elem.drop 4)))\n  \"unknown elem segment 4\")\n\n(assert_invalid\n  (module\n    (elem funcref (ref.func 0))\n    (func (result i32) (i32.const 0))\n    (func (export \"test\")\n      (table.init 4 (i32.const 12) (i32.const 1) (i32.const 1))))\n  \"unknown table 0\")\n\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (elem.drop 2)\n    ))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init 2 (i32.const 12) (i32.const 1) (i32.const 1))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))\n    (table.init 1 (i32.const 21) (i32.const 1) (i32.const 1))))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (elem.drop 1)\n    (elem.drop 1)))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (elem.drop 1)\n    (table.init 1 (i32.const 12) (i32.const 1) (i32.const 1))))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init 1 (i32.const 12) (i32.const 0) (i32.const 5))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init 1 (i32.const 12) (i32.const 2) (i32.const 3))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 28) (i32.const 1) (i32.const 3))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 12) (i32.const 4) (i32.const 0))\n    ))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 12) (i32.const 5) (i32.const 0))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 30) (i32.const 2) (i32.const 0))\n    ))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 31) (i32.const 2) (i32.const 0))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 30) (i32.const 4) (i32.const 0))\n    ))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t0) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t0) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t0 1 (i32.const 31) (i32.const 5) (i32.const 0))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 26) (i32.const 1) (i32.const 3))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 12) (i32.const 4) (i32.const 0))\n    ))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 12) (i32.const 5) (i32.const 0))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 28) (i32.const 2) (i32.const 0))\n    ))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 29) (i32.const 2) (i32.const 0))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 28) (i32.const 4) (i32.const 0))\n    ))\n(invoke \"test\")\n\n(module\n  (table $t0 30 30 funcref)\n  (table $t1 28 28 funcref)\n  (elem (table $t1) (i32.const 2) func 3 1 4 1)\n  (elem funcref\n    (ref.func 2) (ref.func 7) (ref.func 1) (ref.func 8))\n  (elem (table $t1) (i32.const 12) func 7 5 2 3 6)\n  (elem funcref\n    (ref.func 5) (ref.func 9) (ref.func 2) (ref.func 7) (ref.func 6))\n  (func (result i32) (i32.const 0))\n  (func (result i32) (i32.const 1))\n  (func (result i32) (i32.const 2))\n  (func (result i32) (i32.const 3))\n  (func (result i32) (i32.const 4))\n  (func (result i32) (i32.const 5))\n  (func (result i32) (i32.const 6))\n  (func (result i32) (i32.const 7))\n  (func (result i32) (i32.const 8))\n  (func (result i32) (i32.const 9))\n  (func (export \"test\")\n    (table.init $t1 1 (i32.const 29) (i32.const 5) (i32.const 0))\n    ))\n(assert_trap (invoke \"test\") \"out of bounds table access\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i32.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f32.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (i64.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (i32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (i32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (i32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (i32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (f32.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (f32.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (f32.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (f32.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (i64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (i64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (i64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (i64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (f64.const 1) (i32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (f64.const 1) (f32.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (f64.const 1) (i64.const 1))))\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (table 10 funcref)\n    (elem funcref (ref.func $f0) (ref.func $f0) (ref.func $f0))\n    (func $f0)\n    (func (export \"test\")\n      (table.init 0 (f64.const 1) (f64.const 1) (f64.const 1))))\n  \"type mismatch\")\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem funcref\n    (ref.func $f0) (ref.func $f1) (ref.func $f2) (ref.func $f3)\n    (ref.func $f4) (ref.func $f5) (ref.func $f6) (ref.func $f7)\n    (ref.func $f8) (ref.func $f9) (ref.func $f10) (ref.func $f11)\n    (ref.func $f12) (ref.func $f13) (ref.func $f14) (ref.func $f15))\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (table.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n(assert_trap (invoke \"run\" (i32.const 24) (i32.const 16)) \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 32 64 funcref)\n  (elem funcref\n    (ref.func $f0) (ref.func $f1) (ref.func $f2) (ref.func $f3)\n    (ref.func $f4) (ref.func $f5) (ref.func $f6) (ref.func $f7)\n    (ref.func $f8) (ref.func $f9) (ref.func $f10) (ref.func $f11)\n    (ref.func $f12) (ref.func $f13) (ref.func $f14) (ref.func $f15))\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (table.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n(assert_trap (invoke \"run\" (i32.const 25) (i32.const 16)) \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 160 320 funcref)\n  (elem funcref\n    (ref.func $f0) (ref.func $f1) (ref.func $f2) (ref.func $f3)\n    (ref.func $f4) (ref.func $f5) (ref.func $f6) (ref.func $f7)\n    (ref.func $f8) (ref.func $f9) (ref.func $f10) (ref.func $f11)\n    (ref.func $f12) (ref.func $f13) (ref.func $f14) (ref.func $f15))\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (table.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n(assert_trap (invoke \"run\" (i32.const 96) (i32.const 32)) \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 32)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 33)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 34)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 35)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 36)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 37)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 38)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 39)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 40)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 41)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 42)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 43)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 44)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 45)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 46)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 47)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 48)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 49)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 50)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 51)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 52)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 53)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 54)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 55)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 56)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 57)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 58)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 59)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 60)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 61)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 62)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 63)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 64)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 65)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 66)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 67)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 68)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 69)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 70)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 71)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 72)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 73)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 74)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 75)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 76)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 77)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 78)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 79)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 80)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 81)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 82)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 83)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 84)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 85)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 86)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 87)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 88)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 89)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 90)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 91)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 92)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 93)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 94)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 95)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 96)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 97)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 98)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 99)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 100)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 101)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 102)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 103)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 104)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 105)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 106)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 107)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 108)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 109)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 110)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 111)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 112)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 113)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 114)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 115)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 116)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 117)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 118)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 119)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 120)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 121)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 122)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 123)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 124)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 125)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 126)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 127)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 128)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 129)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 130)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 131)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 132)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 133)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 134)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 135)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 136)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 137)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 138)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 139)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 140)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 141)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 142)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 143)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 144)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 145)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 146)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 147)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 148)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 149)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 150)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 151)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 152)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 153)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 154)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 155)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 156)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 157)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 158)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 159)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 160 320 funcref)\n  (elem funcref\n    (ref.func $f0) (ref.func $f1) (ref.func $f2) (ref.func $f3)\n    (ref.func $f4) (ref.func $f5) (ref.func $f6) (ref.func $f7)\n    (ref.func $f8) (ref.func $f9) (ref.func $f10) (ref.func $f11)\n    (ref.func $f12) (ref.func $f13) (ref.func $f14) (ref.func $f15))\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (table.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n(assert_trap (invoke \"run\" (i32.const 97) (i32.const 31)) \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 32)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 33)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 34)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 35)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 36)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 37)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 38)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 39)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 40)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 41)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 42)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 43)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 44)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 45)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 46)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 47)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 48)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 49)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 50)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 51)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 52)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 53)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 54)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 55)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 56)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 57)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 58)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 59)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 60)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 61)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 62)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 63)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 64)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 65)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 66)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 67)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 68)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 69)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 70)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 71)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 72)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 73)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 74)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 75)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 76)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 77)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 78)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 79)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 80)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 81)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 82)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 83)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 84)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 85)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 86)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 87)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 88)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 89)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 90)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 91)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 92)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 93)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 94)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 95)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 96)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 97)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 98)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 99)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 100)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 101)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 102)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 103)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 104)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 105)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 106)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 107)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 108)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 109)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 110)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 111)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 112)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 113)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 114)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 115)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 116)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 117)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 118)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 119)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 120)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 121)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 122)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 123)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 124)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 125)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 126)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 127)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 128)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 129)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 130)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 131)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 132)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 133)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 134)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 135)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 136)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 137)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 138)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 139)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 140)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 141)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 142)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 143)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 144)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 145)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 146)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 147)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 148)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 149)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 150)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 151)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 152)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 153)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 154)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 155)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 156)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 157)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 158)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 159)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 64 64 funcref)\n  (elem funcref\n    (ref.func $f0) (ref.func $f1) (ref.func $f2) (ref.func $f3)\n    (ref.func $f4) (ref.func $f5) (ref.func $f6) (ref.func $f7)\n    (ref.func $f8) (ref.func $f9) (ref.func $f10) (ref.func $f11)\n    (ref.func $f12) (ref.func $f13) (ref.func $f14) (ref.func $f15))\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (table.init 0 (local.get $offs) (i32.const 0) (local.get $len))))\n(assert_trap (invoke \"run\" (i32.const 48) (i32.const 4294967280)) \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 16)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 17)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 18)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 19)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 20)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 21)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 22)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 23)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 24)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 25)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 26)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 27)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 28)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 29)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 30)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 31)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 32)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 33)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 34)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 35)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 36)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 37)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 38)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 39)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 40)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 41)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 42)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 43)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 44)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 45)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 46)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 47)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 48)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 49)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 50)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 51)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 52)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 53)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 54)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 55)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 56)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 57)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 58)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 59)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 60)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 61)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 62)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 63)) \"uninitialized element\")\n\n(module\n  (type (func (result i32)))\n  (table 16 16 funcref)\n  (elem funcref\n    (ref.func $f0) (ref.func $f1) (ref.func $f2) (ref.func $f3)\n    (ref.func $f4) (ref.func $f5) (ref.func $f6) (ref.func $f7)\n    (ref.func $f8) (ref.func $f9) (ref.func $f10) (ref.func $f11)\n    (ref.func $f12) (ref.func $f13) (ref.func $f14) (ref.func $f15))\n  (func $f0 (export \"f0\") (result i32) (i32.const 0))\n  (func $f1 (export \"f1\") (result i32) (i32.const 1))\n  (func $f2 (export \"f2\") (result i32) (i32.const 2))\n  (func $f3 (export \"f3\") (result i32) (i32.const 3))\n  (func $f4 (export \"f4\") (result i32) (i32.const 4))\n  (func $f5 (export \"f5\") (result i32) (i32.const 5))\n  (func $f6 (export \"f6\") (result i32) (i32.const 6))\n  (func $f7 (export \"f7\") (result i32) (i32.const 7))\n  (func $f8 (export \"f8\") (result i32) (i32.const 8))\n  (func $f9 (export \"f9\") (result i32) (i32.const 9))\n  (func $f10 (export \"f10\") (result i32) (i32.const 10))\n  (func $f11 (export \"f11\") (result i32) (i32.const 11))\n  (func $f12 (export \"f12\") (result i32) (i32.const 12))\n  (func $f13 (export \"f13\") (result i32) (i32.const 13))\n  (func $f14 (export \"f14\") (result i32) (i32.const 14))\n  (func $f15 (export \"f15\") (result i32) (i32.const 15))\n  (func (export \"test\") (param $n i32) (result i32)\n    (call_indirect (type 0) (local.get $n)))\n  (func (export \"run\") (param $offs i32) (param $len i32)\n    (table.init 0 (local.get $offs) (i32.const 8) (local.get $len))))\n(assert_trap (invoke \"run\" (i32.const 0) (i32.const 4294967292)) \"out of bounds table access\")\n(assert_trap (invoke \"test\" (i32.const 0)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 1)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 2)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 3)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 4)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 5)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 6)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 7)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 8)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 9)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 10)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 11)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 12)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 13)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 14)) \"uninitialized element\")\n(assert_trap (invoke \"test\" (i32.const 15)) \"uninitialized element\")\n\n(module\n  (table 1 funcref)\n  ;; 65 elem segments. 64 is the smallest positive number that is encoded\n  ;; differently as a signed LEB.\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref) (elem funcref) (elem funcref) (elem funcref)\n  (elem funcref)\n  (func (table.init 64 (i32.const 0) (i32.const 0) (i32.const 0))))\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table_set.wast",
    "content": "(module\n  (table $t2 1 externref)\n  (table $t3 2 funcref)\n  (table $t64 i64 2 funcref)\n  (elem (table $t3) (i32.const 1) func $dummy)\n  (func $dummy)\n\n  (func (export \"get-externref\") (param $i i32) (result externref)\n    (table.get $t2 (local.get $i))\n  )\n  (func $f3 (export \"get-funcref\") (param $i i32) (result funcref)\n    (table.get $t3 (local.get $i))\n  )\n  (func $f4 (export \"get-funcref-t64\") (param $i i64) (result funcref)\n    (table.get $t64 (local.get $i))\n  )\n\n  (func (export \"set-externref\") (param $i i32) (param $r externref)\n    (table.set (local.get $i) (local.get $r))\n  )\n  (func (export \"set-funcref\") (param $i i32) (param $r funcref)\n    (table.set $t3 (local.get $i) (local.get $r))\n  )\n  (func (export \"set-funcref-from\") (param $i i32) (param $j i32)\n    (table.set $t3 (local.get $i) (table.get $t3 (local.get $j)))\n  )\n  (func (export \"set-funcref-t64\") (param $i i64) (param $r funcref)\n    (table.set $t64 (local.get $i) (local.get $r))\n  )\n\n  (func (export \"is_null-funcref\") (param $i i32) (result i32)\n    (ref.is_null (call $f3 (local.get $i)))\n  )\n)\n\n(assert_return (invoke \"get-externref\" (i32.const 0)) (ref.null extern))\n(assert_return (invoke \"set-externref\" (i32.const 0) (ref.extern 1)))\n(assert_return (invoke \"get-externref\" (i32.const 0)) (ref.extern 1))\n(assert_return (invoke \"set-externref\" (i32.const 0) (ref.null extern)))\n(assert_return (invoke \"get-externref\" (i32.const 0)) (ref.null extern))\n\n(assert_return (invoke \"set-funcref-t64\" (i64.const 0) (ref.null func)))\n(assert_return (invoke \"get-funcref-t64\" (i64.const 0)) (ref.null func))\n\n(assert_return (invoke \"get-funcref\" (i32.const 0)) (ref.null func))\n(assert_return (invoke \"set-funcref-from\" (i32.const 0) (i32.const 1)))\n(assert_return (invoke \"is_null-funcref\" (i32.const 0)) (i32.const 0))\n(assert_return (invoke \"set-funcref\" (i32.const 0) (ref.null func)))\n(assert_return (invoke \"get-funcref\" (i32.const 0)) (ref.null func))\n\n(assert_trap (invoke \"set-externref\" (i32.const 2) (ref.null extern)) \"out of bounds table access\")\n(assert_trap (invoke \"set-funcref\" (i32.const 3) (ref.null func)) \"out of bounds table access\")\n(assert_trap (invoke \"set-externref\" (i32.const -1) (ref.null extern)) \"out of bounds table access\")\n(assert_trap (invoke \"set-funcref\" (i32.const -1) (ref.null func)) \"out of bounds table access\")\n\n(assert_trap (invoke \"set-externref\" (i32.const 2) (ref.extern 0)) \"out of bounds table access\")\n(assert_trap (invoke \"set-funcref-from\" (i32.const 3) (i32.const 1)) \"out of bounds table access\")\n(assert_trap (invoke \"set-externref\" (i32.const -1) (ref.extern 0)) \"out of bounds table access\")\n(assert_trap (invoke \"set-funcref-from\" (i32.const -1) (i32.const 1)) \"out of bounds table access\")\n\n\n;; Type errors\n\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-index-value-empty-vs-i32-externref\n      (table.set $t)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-index-empty-vs-i32\n      (table.set $t (ref.null extern))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-value-empty-vs-externref\n      (table.set $t (i32.const 1))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-size-f32-vs-i32\n      (table.set $t (f32.const 1) (ref.null extern))\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 10 funcref)\n    (func $type-value-externref-vs-funcref (param $r externref)\n      (table.set $t (i32.const 1) (local.get $r))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (table $t1 1 externref)\n    (table $t2 1 funcref)\n    (func $type-value-externref-vs-funcref-multi (param $r externref)\n      (table.set $t2 (i32.const 0) (local.get $r))\n    )\n  )\n  \"type mismatch\"\n)\n\n(assert_invalid\n  (module\n    (table $t 10 externref)\n    (func $type-result-empty-vs-num (result i32)\n      (table.set $t (i32.const 0) (ref.null extern))\n    )\n  )\n  \"type mismatch\"\n)\n"
  },
  {
    "path": "test/old-spec/proposals/memory64/table_size.wast",
    "content": "(module\n  (table $t0 0 externref)\n  (table $t1 1 externref)\n  (table $t2 0 2 externref)\n  (table $t3 3 8 externref)\n  (table $t64 i64 42 42 externref)\n\n  (func (export \"size-t0\") (result i32) table.size)\n  (func (export \"size-t1\") (result i32) (table.size $t1))\n  (func (export \"size-t2\") (result i32) (table.size $t2))\n  (func (export \"size-t3\") (result i32) (table.size $t3))\n  (func (export \"size-t64\") (result i64) (table.size $t64))\n\n  (func (export \"grow-t0\") (param $sz i32)\n    (drop (table.grow $t0 (ref.null extern) (local.get $sz)))\n  )\n  (func (export \"grow-t1\") (param $sz i32)\n    (drop (table.grow $t1 (ref.null extern) (local.get $sz)))\n  )\n  (func (export \"grow-t2\") (param $sz i32)\n    (drop (table.grow $t2 (ref.null extern) (local.get $sz)))\n  )\n  (func (export \"grow-t3\") (param $sz i32)\n    (drop (table.grow $t3 (ref.null extern) (local.get $sz)))\n  )\n)\n\n(assert_return (invoke \"size-t0\") (i32.const 0))\n(assert_return (invoke \"grow-t0\" (i32.const 1)))\n(assert_return (invoke \"size-t0\") (i32.const 1))\n(assert_return (invoke \"grow-t0\" (i32.const 4)))\n(assert_return (invoke \"size-t0\") (i32.const 5))\n(assert_return (invoke \"grow-t0\" (i32.const 0)))\n(assert_return (invoke \"size-t0\") (i32.const 5))\n\n(assert_return (invoke \"size-t1\") (i32.const 1))\n(assert_return (invoke \"grow-t1\" (i32.const 1)))\n(assert_return (invoke \"size-t1\") (i32.const 2))\n(assert_return (invoke \"grow-t1\" (i32.const 4)))\n(assert_return (invoke \"size-t1\") (i32.const 6))\n(assert_return (invoke \"grow-t1\" (i32.const 0)))\n(assert_return (invoke \"size-t1\") (i32.const 6))\n\n(assert_return (invoke \"size-t2\") (i32.const 0))\n(assert_return (invoke \"grow-t2\" (i32.const 3)))\n(assert_return (invoke \"size-t2\") (i32.const 0))\n(assert_return (invoke \"grow-t2\" (i32.const 1)))\n(assert_return (invoke \"size-t2\") (i32.const 1))\n(assert_return (invoke \"grow-t2\" (i32.const 0)))\n(assert_return (invoke \"size-t2\") (i32.const 1))\n(assert_return (invoke \"grow-t2\" (i32.const 4)))\n(assert_return (invoke \"size-t2\") (i32.const 1))\n(assert_return (invoke \"grow-t2\" (i32.const 1)))\n(assert_return (invoke \"size-t2\") (i32.const 2))\n\n(assert_return (invoke \"size-t3\") (i32.const 3))\n(assert_return (invoke \"grow-t3\" (i32.const 1)))\n(assert_return (invoke \"size-t3\") (i32.const 4))\n(assert_return (invoke \"grow-t3\" (i32.const 3)))\n(assert_return (invoke \"size-t3\") (i32.const 7))\n(assert_return (invoke \"grow-t3\" (i32.const 0)))\n(assert_return (invoke \"size-t3\") (i32.const 7))\n(assert_return (invoke \"grow-t3\" (i32.const 2)))\n(assert_return (invoke \"size-t3\") (i32.const 7))\n(assert_return (invoke \"grow-t3\" (i32.const 1)))\n(assert_return (invoke \"size-t3\") (i32.const 8))\n\n(assert_return (invoke \"size-t64\") (i64.const 42))\n\n;; Type errors\n\n(assert_invalid\n  (module\n    (table $t 1 externref)\n    (func $type-result-i32-vs-empty\n      (table.size $t)\n    )\n  )\n  \"type mismatch\"\n)\n(assert_invalid\n  (module\n    (table $t 1 externref)\n    (func $type-result-i32-vs-f32 (result f32)\n      (table.size $t)\n    )\n  )\n  \"type mismatch\"\n)\n"
  },
  {
    "path": "test/parse/all-features.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-all\n(module\n  ;; threads\n  (memory 1 1 shared)\n\n  ;; mutable globals\n  (global (mut i32) (i32.const 0))\n\n  ;; exceptions\n  (tag $e)\n\n  ;; annotations\n  (func $f (@name \"func\") (result i32)\n    (i32.const 0))\n\n  (func (result i32)\n    ;; mutable globals\n    i32.const 0\n    global.set 0\n\n    ;; saturating float-to-int\n    f32.const 0\n    i32.trunc_sat_f32_s\n    drop\n\n    ;; sign extention\n    i32.const 0\n    i32.extend8_s\n    drop\n\n    ;; simd\n    v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n    v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155\n    i8x16.shuffle 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n    drop\n\n    ;; threads\n    i32.const 0\n    i32.const 0\n    i32.atomic.rmw.add\n    drop\n\n    ;; multi-value\n    block (result i32 i32)\n      i32.const 0\n      i32.const 0\n    end\n    drop\n    drop\n\n    ;; bulk memory\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy\n\n    ;; reference types\n    ref.null func\n    drop\n\n    ;; exceptions\n    throw $e\n\n    ;; tail call\n    return_call $f))\n"
  },
  {
    "path": "test/parse/annotations.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-annotations\n(module\n  (func (@name \"some func\") (result i32)\n    i32.const 42\n    return)\n  (@annot annotation (@nested section))\n  (@section section)\n  (@section (@nested section))\n  (@section (section) (@with \"other\") nested-subsections))\n"
  },
  {
    "path": "test/parse/assert/assert-after-module.txt",
    "content": ";;; TOOL: wast2json\n(module\n  (export \"f\" (func 0))\n  (func (result i32)\n     i32.const 0 \n     return))\n(assert_return (invoke \"f\") (i32.const 0))\n"
  },
  {
    "path": "test/parse/assert/assert-return-arithmetic-nan.txt",
    "content": ";;; TOOL: wast2json\n(module\n  (func $foo (param f32) (result f32)\n    local.get 0\n    f32.const 0\n    f32.div)\n  (export \"foo\" (func $foo)))\n\n(assert_return (invoke \"foo\" (f32.const 0)) (f32.const nan:arithmetic))\n"
  },
  {
    "path": "test/parse/assert/assert-return-canonical-nan.txt",
    "content": ";;; TOOL: wast2json\n(module\n  (func $foo (param f32) (result f32)\n    local.get 0\n    f32.const 0\n    f32.div)\n  (export \"foo\" (func $foo)))\n\n(assert_return (invoke \"foo\" (f32.const 0)) (f32.const nan:canonical))\n"
  },
  {
    "path": "test/parse/assert/assertexception.txt",
    "content": ";;; TOOL: wast2json\n;;; ARGS: --enable-exceptions\n(module\n  (tag $t)\n  (func $foo (throw $t))\n  (export \"foo\" (func $foo)))\n\n(assert_exception (invoke \"foo\"))\n"
  },
  {
    "path": "test/parse/assert/assertinvalid-binary-module.txt",
    "content": ";;; TOOL: wast2json\n(assert_invalid (module binary \"\\00ASM\") \"bad magic\")\n(module)\n"
  },
  {
    "path": "test/parse/assert/assertinvalid.txt",
    "content": ";;; TOOL: wast2json\n(assert_invalid\n  (module\n    (func \n      i32.const 1\n      drop)\n    (export \"foo\" (func 1)))\n  \"unknown function 1\") ;; string is ignored\n(assert_invalid\n  (module\n    (func (result i32)\n      nop))\n  \"type mismatch\")\n"
  },
  {
    "path": "test/parse/assert/assertmalformed.txt",
    "content": ";;; TOOL: wast2json\n(assert_malformed\n  (module binary\n    \"\\00asm\\bc\\0a\\00\\00\")\n  \"unknown binary version\")\n"
  },
  {
    "path": "test/parse/assert/assertreturn.txt",
    "content": ";;; TOOL: wast2json\n(module\n  (func $foo (result i32) i32.const 0)\n  (export \"foo\" (func $foo))\n  (func $bar (param f32) (result f32) \n    local.get 0)\n  (export \"bar\" (func $bar)))\n\n(assert_return (invoke \"foo\") (i32.const 0))\n(assert_return (invoke \"bar\" (f32.const 0)) (f32.const 0))\n"
  },
  {
    "path": "test/parse/assert/bad-assert-before-module.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(assert_return (invoke \"f\") (i32.const 0))\n(;; STDERR ;;;\nout/test/parse/assert/bad-assert-before-module.txt:3:17: error: unknown module\n(assert_return (invoke \"f\") (i32.const 0))\n                ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-assertexception.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ARGS:\n;;; ERROR: 1\n(module (func (export \"foo\")))\n(assert_exception (invoke \"foo\"))\n(;; STDERR ;;;\nout/test/parse/assert/bad-assertexception/bad-assertexception.json:4:30: invalid command: exceptions not allowed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-assertreturn-non-const.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func $bar (param f32) (result f32) \n    local.get 0)\n  (export \"bar\" (func $bar)))\n\n;; NOT ok to use more complex exprs\n(assert_return\n  (invoke \"bar\"\n    (f32.add (f32.const 1) (f32.const 10)))\n  (f32.const 11))\n(;; STDERR ;;;\nout/test/parse/assert/bad-assertreturn-non-const.txt:11:5: error: unexpected token (, expected ).\n    (f32.add (f32.const 1) (f32.const 10)))\n    ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-assertreturn-too-few.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func $foo (param i32) (result i32) \n    local.get 0)\n  (export \"foo\" (func $foo)))\n(assert_return (invoke \"foo\") (i32.const 0))\n(;; STDERR ;;;\nout/test/parse/assert/bad-assertreturn-too-few.txt:7:17: error: too few parameters to function. got 0, expected 1\n(assert_return (invoke \"foo\") (i32.const 0))\n                ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-assertreturn-too-many.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func $foo (result i32) \n    i32.const 0)\n  (export \"foo\" (func $foo)))\n(assert_return (invoke \"foo\" (i32.const 0)) (i32.const 0))\n(;; STDERR ;;;\nout/test/parse/assert/bad-assertreturn-too-many.txt:7:17: error: too many parameters to function. got 1, expected 0\n(assert_return (invoke \"foo\" (i32.const 0)) (i32.const 0))\n                ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-assertreturn-unknown-function.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module)\n(assert_return (invoke \"foo\") (i32.const 0))\n(;; STDERR ;;;\nout/test/parse/assert/bad-assertreturn-unknown-function.txt:4:17: error: unknown function export \"foo\"\n(assert_return (invoke \"foo\") (i32.const 0))\n                ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-invoke-no-module.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(invoke \"foo\")\n(;; STDERR ;;;\nout/test/parse/assert/bad-invoke-no-module.txt:3:2: error: unknown module\n(invoke \"foo\")\n ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-invoke-too-few.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func (param i32))\n  (export \"foo\" (func 0)))\n(invoke \"foo\")\n(;; STDERR ;;;\nout/test/parse/assert/bad-invoke-too-few.txt:6:2: error: too few parameters to function. got 0, expected 1\n(invoke \"foo\")\n ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-invoke-too-many.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func (param i32))\n  (export \"foo\" (func 0)))\n(invoke \"foo\" (i32.const 0) (i32.const 1))\n(;; STDERR ;;;\nout/test/parse/assert/bad-invoke-too-many.txt:6:2: error: too many parameters to function. got 2, expected 1\n(invoke \"foo\" (i32.const 0) (i32.const 1))\n ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/bad-invoke-unknown-function.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (export \"foo\" (func $foo))\n  (func $foo))\n\n(invoke \"bar\")\n(;; STDERR ;;;\nout/test/parse/assert/bad-invoke-unknown-function.txt:7:2: error: unknown function export \"bar\"\n(invoke \"bar\")\n ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/assert/invoke.txt",
    "content": ";;; TOOL: wast2json\n(module\n  (export \"test\" (func $test))\n  (func $test (param i32) (result i32)\n    local.get 0\n    i32.const 100\n    i32.add))\n\n(invoke \"test\" (i32.const 1))\n(invoke \"test\" (i32.const 100))\n(invoke \"test\" (i32.const -30))\n"
  },
  {
    "path": "test/parse/bad-annotations.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (@name \"some func\") (result i32)\n    i32.const 42\n    return)\n  (@custom section)\n  (@custom (@nested section))\n  (@custom (section) (@with \"other\") nested-subsections))\n(;; STDERR ;;;\nout/test/parse/bad-annotations.txt:4:9: error: annotations not enabled: name\n  (func (@name \"some func\") (result i32)\n        ^^^^^^\nout/test/parse/bad-annotations.txt:4:9: error: unexpected token Invalid, expected ).\n  (func (@name \"some func\") (result i32)\n        ^^^^^^\nout/test/parse/bad-annotations.txt:7:3: error: annotations not enabled: custom\n  (@custom section)\n  ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-call-ref.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n;;; ERROR: 1\n(module\n  ;; Implicit type declarations are not allowed\n  (type $t0 (func (param f32 f32)))\n\n  (func $f1\n    i32.const 1\n    i32.const 2\n    i32.const 3\n    call_ref $t0\n  )\n\n  (func $f2\n    i32.const 1\n    i32.const 2\n    i32.const 3\n    return_call_ref $t0\n  )\n)\n(;; STDERR ;;;\nout/test/parse/bad-call-ref.txt:12:5: error: type mismatch in call_ref, expected [(ref null 0)] but got [... i32]\n    call_ref $t0\n    ^^^^^^^^\nout/test/parse/bad-call-ref.txt:12:5: error: type mismatch in call_ref, expected [f32, f32] but got [i32, i32]\n    call_ref $t0\n    ^^^^^^^^\nout/test/parse/bad-call-ref.txt:19:5: error: type mismatch in return_call_ref, expected [(ref null 0)] but got [... i32]\n    return_call_ref $t0\n    ^^^^^^^^^^^^^^^\nout/test/parse/bad-call-ref.txt:19:5: error: type mismatch in return_call_ref, expected [f32, f32] but got [i32, i32]\n    return_call_ref $t0\n    ^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-crlf.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\nmodulez\r\nfuncz\r\n(;; STDERR ;;;\nout/test/parse/bad-crlf.txt:3:1: error: unexpected token \"modulez\", expected a module field or a module.\nmodulez\n^^^^^^^\nout/test/parse/bad-crlf.txt:4:1: error: unexpected token funcz, expected EOF.\nfuncz\n^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-delegate-label.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n;;; ERROR: 1\n(module\n  (func\n    try $t\n      nop\n    delegate $t\n  )\n)\n(;; STDERR ;;;\nout/test/parse/bad-delegate-label.txt:8:14: error: undefined label variable \"$t\"\n    delegate $t\n             ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-error-long-line.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n                                                                                                                                                                         whoops                      (; some text at the end of the line ;)\n(;; STDERR ;;;\nout/test/parse/bad-error-long-line.txt:3:170: error: unexpected token \"whoops\", expected a module field or a module.\n...                                  whoops                      (; some text...\n                                     ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-error-long-token.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n              abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz                                                   \n(;; STDERR ;;;\nout/test/parse/bad-error-long-token.txt:3:15: error: unexpected token \"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxy...\", expected a module field or a module.\n              abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk...\n              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-identifiers-with-annotations.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-annotations\n;;; ERROR: 1\n(module\n  (func $)\n  (func $ (param i32))\n  (func $\"\")\n  (func $\"\" (param i32))\n  (func $\"\\80\")\n  (func $\"\\80\" (param i32))\n)\n(;; STDERR ;;;\nout/test/parse/bad-identifiers-with-annotations.txt:5:9: error: empty identifier.\n  (func $)\n        ^\nout/test/parse/bad-identifiers-with-annotations.txt:6:9: error: empty identifier.\n  (func $ (param i32))\n        ^\nout/test/parse/bad-identifiers-with-annotations.txt:7:9: error: empty identifier.\n  (func $\"\")\n        ^^^\nout/test/parse/bad-identifiers-with-annotations.txt:8:9: error: empty identifier.\n  (func $\"\" (param i32))\n        ^^^\nout/test/parse/bad-identifiers-with-annotations.txt:9:9: error: quoted identifier has an invalid utf-8 encoding\n  (func $\"\\80\")\n        ^^^^^^\nout/test/parse/bad-identifiers-with-annotations.txt:10:9: error: quoted identifier has an invalid utf-8 encoding\n  (func $\"\\80\" (param i32))\n        ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-identifiers.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func $)\n  (func $ (param i32))\n  (func $\"\")\n  (func $\"\" (param i32))\n  (func $\"a\")\n  (func $\"a\" (param i32))\n)\n(;; STDERR ;;;\nout/test/parse/bad-identifiers.txt:4:9: error: empty identifier.\n  (func $)\n        ^\nout/test/parse/bad-identifiers.txt:5:9: error: empty identifier.\n  (func $ (param i32))\n        ^\nout/test/parse/bad-identifiers.txt:6:9: error: quoted identifiers are not supported without annotations\n  (func $\"\")\n        ^^^\nout/test/parse/bad-identifiers.txt:7:9: error: quoted identifiers are not supported without annotations\n  (func $\"\" (param i32))\n        ^^^\nout/test/parse/bad-identifiers.txt:8:9: error: quoted identifiers are not supported without annotations\n  (func $\"a\")\n        ^^^^\nout/test/parse/bad-identifiers.txt:9:9: error: quoted identifiers are not supported without annotations\n  (func $\"a\" (param i32))\n        ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-input-command.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n;; syntax is (input name? text)\n(input \"hello\")\n(input $var \"hello\")\n(;; STDERR ;;;\nout/test/parse/bad-input-command.txt:4:2: error: input command is not supported\n(input \"hello\")\n ^^^^^\nout/test/parse/bad-input-command.txt:5:2: error: input command is not supported\n(input $var \"hello\")\n ^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-output-command.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n;; syntax is (output name? text?)\n(output)\n(output \"hello\")\n(output $var)\n(output $var \"hello\")\n(;; STDERR ;;;\nout/test/parse/bad-output-command.txt:4:2: error: output command is not supported\n(output)\n ^^^^^^\nout/test/parse/bad-output-command.txt:5:2: error: output command is not supported\n(output \"hello\")\n ^^^^^^\nout/test/parse/bad-output-command.txt:6:2: error: output command is not supported\n(output $var)\n ^^^^^^\nout/test/parse/bad-output-command.txt:7:2: error: output command is not supported\n(output $var \"hello\")\n ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-references.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n;;; ERROR: 1\n(module\n  ;; Implicit type declarations are not allowed\n  (type $t0 (func (param (ref 2))))\n  (type $t1 (func (param (ref 33)) (result (ref 444))))\n\n  (func $f (param $p1 (ref 5555))\n    (local $p2 (ref 66666))\n  )\n)\n(;; STDERR ;;;\nout/test/parse/bad-references.txt:6:4: error: reference 2 is out of range (max: 0) in params\n  (type $t0 (func (param (ref 2))))\n   ^^^^\nout/test/parse/bad-references.txt:7:4: error: reference 33 is out of range (max: 1) in params\n  (type $t1 (func (param (ref 33)) (result (ref 444))))\n   ^^^^\nout/test/parse/bad-references.txt:7:4: error: reference 444 is out of range (max: 1) in results\n  (type $t1 (func (param (ref 33)) (result (ref 444))))\n   ^^^^\nout/test/parse/bad-references.txt:9:4: error: reference 5555 is out of range (max: 2) in params\n  (func $f (param $p1 (ref 5555))\n   ^^^^\nout/test/parse/bad-references.txt:9:12: error: reference 66666 is out of range (max: 3) in locals\n  (func $f (param $p1 (ref 5555))\n           ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-refs-in-trytable.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references --enable-exceptions\n;;; ERROR: 1\n(module\n  (func (param (ref func))\n    (local (ref func) (ref func))\n    local.get 0\n    local.set 1\n    try_table\n      try_table\n        local.get 0\n        local.set 2\n      end\n      local.get 1\n      local.set 0\n      local.get 2\n      local.set 0\n    end\n    local.get 1\n    local.set 0\n    local.get 2\n    local.set 0\n  )\n)\n(;; STDERR ;;;\nout/test/parse/bad-refs-in-trytable.txt:16:17: error: uninitialized local reference\n      local.get 2\n                ^\nout/test/parse/bad-refs-in-trytable.txt:21:15: error: uninitialized local reference\n    local.get 2\n              ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-single-semicolon.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n; foo bar\n(module)\n(;; STDERR ;;;\nout/test/parse/bad-single-semicolon.txt:3:1: error: unexpected char\n; foo bar\n^\nout/test/parse/bad-single-semicolon.txt:3:3: error: unexpected token \"foo\", expected a module field or a module.\n; foo bar\n  ^^^\nout/test/parse/bad-single-semicolon.txt:3:7: error: unexpected token bar, expected EOF.\n; foo bar\n      ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-eof.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"\n(;; STDERR ;;;\nout/test/parse/bad-string-eof.txt:3:25: error: newline in string\n(module (func) (export \"\n                        ^\nout/test/parse/bad-string-eof.txt:4:1: error: unexpected token \"EOF\", expected a quoted string (e.g. \"foo\").\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-escape.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"foobar\\x\\n\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/bad-string-escape.txt:3:31: error: bad escape \"\\x\"\n(module (func) (export \"foobar\\x\\n\" (func 0)))\n                              ^^\nout/test/parse/bad-string-escape.txt:3:24: error: unexpected token \"Invalid\", expected a quoted string (e.g. \"foo\").\n(module (func) (export \"foobar\\x\\n\" (func 0)))\n                       ^^^^^^^^^^^^\nout/test/parse/bad-string-escape.txt:3:43: error: unexpected token 0, expected ).\n(module (func) (export \"foobar\\x\\n\" (func 0)))\n                                          ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-hex-escape.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"foo\\az\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/bad-string-hex-escape.txt:3:28: error: bad escape \"\\a\"\n(module (func) (export \"foo\\az\" (func 0)))\n                           ^^\nout/test/parse/bad-string-hex-escape.txt:3:24: error: unexpected token \"Invalid\", expected a quoted string (e.g. \"foo\").\n(module (func) (export \"foo\\az\" (func 0)))\n                       ^^^^^^^^\nout/test/parse/bad-string-hex-escape.txt:3:39: error: unexpected token 0, expected ).\n(module (func) (export \"foo\\az\" (func 0)))\n                                      ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-unicode-escape-large.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"foo\\u{1100000}\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/bad-string-unicode-escape-large.txt:3:28: error: bad escape \"\\u{110000\"\n(module (func) (export \"foo\\u{1100000}\" (func 0)))\n                           ^^^^^^^^^\nout/test/parse/bad-string-unicode-escape-large.txt:3:24: error: unexpected token \"Invalid\", expected a quoted string (e.g. \"foo\").\n(module (func) (export \"foo\\u{1100000}\" (func 0)))\n                       ^^^^^^^^^^^^^^^^\nout/test/parse/bad-string-unicode-escape-large.txt:3:47: error: unexpected token 0, expected ).\n(module (func) (export \"foo\\u{1100000}\" (func 0)))\n                                              ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-unicode-escape-short.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"foo\\u{}bar\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/bad-string-unicode-escape-short.txt:3:28: error: bad escape \"\\u{}\"\n(module (func) (export \"foo\\u{}bar\" (func 0)))\n                           ^^^^\nout/test/parse/bad-string-unicode-escape-short.txt:3:24: error: unexpected token \"Invalid\", expected a quoted string (e.g. \"foo\").\n(module (func) (export \"foo\\u{}bar\" (func 0)))\n                       ^^^^^^^^^^^^\nout/test/parse/bad-string-unicode-escape-short.txt:3:43: error: unexpected token 0, expected ).\n(module (func) (export \"foo\\u{}bar\" (func 0)))\n                                          ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-unicode-escape-unallowed.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"foo\\u{d900}bar\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/bad-string-unicode-escape-unallowed.txt:3:28: error: bad escape \"\\u{d900}\"\n(module (func) (export \"foo\\u{d900}bar\" (func 0)))\n                           ^^^^^^^^\nout/test/parse/bad-string-unicode-escape-unallowed.txt:3:24: error: unexpected token \"Invalid\", expected a quoted string (e.g. \"foo\").\n(module (func) (export \"foo\\u{d900}bar\" (func 0)))\n                       ^^^^^^^^^^^^^^^^\nout/test/parse/bad-string-unicode-escape-unallowed.txt:3:47: error: unexpected token 0, expected ).\n(module (func) (export \"foo\\u{d900}bar\" (func 0)))\n                                              ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-unicode-escape-unexpected.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"foo\\u{0x12}\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/bad-string-unicode-escape-unexpected.txt:3:28: error: bad escape \"\\u{0\"\n(module (func) (export \"foo\\u{0x12}\" (func 0)))\n                           ^^^^\nout/test/parse/bad-string-unicode-escape-unexpected.txt:3:24: error: unexpected token \"Invalid\", expected a quoted string (e.g. \"foo\").\n(module (func) (export \"foo\\u{0x12}\" (func 0)))\n                       ^^^^^^^^^^^^^\nout/test/parse/bad-string-unicode-escape-unexpected.txt:3:44: error: unexpected token 0, expected ).\n(module (func) (export \"foo\\u{0x12}\" (func 0)))\n                                           ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-unicode-escape-unterminated.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"foo\\u{045\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/bad-string-unicode-escape-unterminated.txt:3:28: error: bad escape \"\\u{045\"\n(module (func) (export \"foo\\u{045\" (func 0)))\n                           ^^^^^^\nout/test/parse/bad-string-unicode-escape-unterminated.txt:3:24: error: unexpected token \"Invalid\", expected a quoted string (e.g. \"foo\").\n(module (func) (export \"foo\\u{045\" (func 0)))\n                       ^^^^^^^^^^^\nout/test/parse/bad-string-unicode-escape-unterminated.txt:3:42: error: unexpected token 0, expected ).\n(module (func) (export \"foo\\u{045\" (func 0)))\n                                         ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-string-unicode-escape.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func) (export \"foo\\ubar\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/bad-string-unicode-escape.txt:3:28: error: bad escape \"\\ub\"\n(module (func) (export \"foo\\ubar\" (func 0)))\n                           ^^^\nout/test/parse/bad-string-unicode-escape.txt:3:24: error: unexpected token \"Invalid\", expected a quoted string (e.g. \"foo\").\n(module (func) (export \"foo\\ubar\" (func 0)))\n                       ^^^^^^^^^^\nout/test/parse/bad-string-unicode-escape.txt:3:41: error: unexpected token 0, expected ).\n(module (func) (export \"foo\\ubar\" (func 0)))\n                                        ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/bad-toplevel.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(foo bar)\n(;; STDERR ;;;\nout/test/parse/bad-toplevel.txt:3:2: error: unexpected token \"foo\", expected a module field or a module.\n(foo bar)\n ^^^\nout/test/parse/bad-toplevel.txt:3:6: error: unexpected token bar, expected EOF.\n(foo bar)\n     ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/basic.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    i32.const 42\n    return))\n"
  },
  {
    "path": "test/parse/branch-hints.txt",
    "content": ";;; TOOL: run-objdump\n;;; ARGS0: --enable-annotations --enable-code-metadata\n;;; ARGS1: -x -j \"metadata.code.branch_hint\"\n;; combined from https://github.com/bytecodealliance/wasm-tools/tree/6ed178840fae8599312ab14c2cad6faea9f80bf1/tests/cli/branch-hinting\n(module\n  (func $main (result i32)\n    (local i32 i32 i32 i32)\n    i32.const 0\n    local.tee 2\n    local.set 3\n    loop  ;; label = @1\n      local.get 2\n      i32.const 50000\n      i32.eq\n      (@metadata.code.branch_hint \"\\00\") if  ;; label = @2\n        i32.const 1\n        local.set 3\n      end\n      local.get 2\n      i32.const 1\n      i32.add\n      local.tee 2\n      i32.const 100000\n      i32.ne\n      (@metadata.code.branch_hint \"\\01\") br_if 0 (;@1;)\n    end\n    local.get 3)\n\n  (func\n    i32.const 0\n    (@metadata.code.branch_hint \"\\00\")\n    if\n    end)\n\n\n  (func\n    i32.const 0\n    (@metadata.code.branch_hint \"\\00\")\n    if\n      i32.const 0\n      (@metadata.code.branch_hint \"\\01\")\n      br_if 0\n    end)\n\n  (func\n    i32.const 0\n    (@metadata.code.branch_hint \"\\01\")\n    if\n      i32.const 0\n      (@metadata.code.branch_hint \"\\00\")\n      br_if 0\n    end)\n)\n\n(;; STDOUT ;;;\n\nbranch-hints.wasm:\tfile format wasm 0x1\n\nSection Details:\n\nCustom:\n - name: \"metadata.code.branch_hint\"\n   - func[0]:\n    - meta[12]:\n     - 0000000: 00                                       .\n    - meta[25]:\n     - 0000000: 01                                       .\n   - func[1]:\n    - meta[3]:\n     - 0000000: 00                                       .\n   - func[2]:\n    - meta[3]:\n     - 0000000: 00                                       .\n    - meta[7]:\n     - 0000000: 01                                       .\n   - func[3]:\n    - meta[3]:\n     - 0000000: 01                                       .\n    - meta[7]:\n     - 0000000: 00                                       .\n\nCode Disassembly:\n\n000057 func[0]:\n 000058: 04 7f                      | local[0..3] type=i32\n 00005a: 41 00                      | i32.const 0\n 00005c: 22 02                      | local.tee 2\n 00005e: 21 03                      | local.set 3\n 000060: 03 40                      | loop\n 000062: 20 02                      |   local.get 2\n 000064: 41 d0 86 03                |   i32.const 50000\n 000068: 46                         |   i32.eq\n 000069: 04 40                      |   if\n 00006b: 41 01                      |     i32.const 1\n 00006d: 21 03                      |     local.set 3\n 00006f: 0b                         |   end\n 000070: 20 02                      |   local.get 2\n 000072: 41 01                      |   i32.const 1\n 000074: 6a                         |   i32.add\n 000075: 22 02                      |   local.tee 2\n 000077: 41 a0 8d 06                |   i32.const 100000\n 00007b: 47                         |   i32.ne\n 00007c: 0d 00                      |   br_if 0\n 00007e: 0b                         | end\n 00007f: 20 03                      | local.get 3\n 000081: 0b                         | end\n000083 func[1]:\n 000084: 41 00                      | i32.const 0\n 000086: 04 40                      | if\n 000088: 0b                         | end\n 000089: 0b                         | end\n00008b func[2]:\n 00008c: 41 00                      | i32.const 0\n 00008e: 04 40                      | if\n 000090: 41 00                      |   i32.const 0\n 000092: 0d 00                      |   br_if 0\n 000094: 0b                         | end\n 000095: 0b                         | end\n000097 func[3]:\n 000098: 41 00                      | i32.const 0\n 00009a: 04 40                      | if\n 00009c: 41 00                      |   i32.const 0\n 00009e: 0d 00                      |   br_if 0\n 0000a0: 0b                         | end\n 0000a1: 0b                         | end\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/parse/custom-sections.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-annotations\n(module\n  (@custom \"custom\" \"contents\")\n  (@custom \"custom2\" (after code) \"stuff\"))\n"
  },
  {
    "path": "test/parse/empty-file.txt",
    "content": ";;; TOOL: wat2wasm\n;; empty file\n(;; STDERR ;;;\nout/test/parse/empty-file.txt:3:1: warning: empty module\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/export-mutable-global.txt",
    "content": ";;; TOOL: wat2wasm\n(module (global (export \"g\") (mut f32) (f32.const 1.5)))\n"
  },
  {
    "path": "test/parse/expr/atomic-align.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-threads\n(module\n  (memory 1 1 shared)\n  (func\n    i32.const 0 i32.const 0 memory.atomic.notify align=4 drop\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 align=4 drop\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 align=8 drop\n\n    i32.const 0 i32.atomic.load align=4 drop\n    i32.const 0 i64.atomic.load align=8 drop\n    i32.const 0 i32.atomic.load8_u align=1 drop\n    i32.const 0 i32.atomic.load16_u align=2 drop\n    i32.const 0 i64.atomic.load8_u align=1 drop\n    i32.const 0 i64.atomic.load16_u align=2 drop\n    i32.const 0 i64.atomic.load32_u align=4 drop\n\n    i32.const 0 i32.const 0 i32.atomic.store align=4\n    i32.const 0 i64.const 0 i64.atomic.store align=8\n    i32.const 0 i32.const 0 i32.atomic.store8 align=1\n    i32.const 0 i32.const 0 i32.atomic.store16 align=2\n    i32.const 0 i64.const 0 i64.atomic.store8 align=1\n    i32.const 0 i64.const 0 i64.atomic.store16 align=2\n    i32.const 0 i64.const 0 i64.atomic.store32 align=4\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.add align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.add align=8 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u align=1 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u align=1 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u align=4 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub align=8 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u align=1 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u align=1 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u align=4 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.and align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.and align=8 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u align=1 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u align=1 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u align=4 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.or align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.or align=8 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u align=1 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u align=1 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u align=4 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor align=8 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u align=1 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u align=1 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u align=4 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg align=8 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u align=1 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u align=1 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u align=4 drop\n\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg align=4 drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg align=8 drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u align=1 drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u align=2 drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u align=1 drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u align=2 drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u align=4 drop\n\n))\n"
  },
  {
    "path": "test/parse/expr/atomic-disabled.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\n(module\n  (memory 1)\n  (func\n    i32.const 0 i32.const 0 memory.atomic.notify drop\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop\n\n    i32.const 0 i32.atomic.load drop\n    i32.const 0 i64.atomic.load drop\n    i32.const 0 i32.atomic.load8_u drop\n    i32.const 0 i32.atomic.load16_u drop\n    i32.const 0 i64.atomic.load8_u drop\n    i32.const 0 i64.atomic.load16_u drop\n    i32.const 0 i64.atomic.load32_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.store\n    i32.const 0 i64.const 0 i64.atomic.store\n    i32.const 0 i32.const 0 i32.atomic.store8\n    i32.const 0 i32.const 0 i32.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store8\n    i32.const 0 i64.const 0 i64.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store32\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.add drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.add drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.and drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.and drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.or drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.or drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop\n\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop\n\n))\n(;; STDERR ;;;\nout/test/parse/expr/atomic-disabled.txt:7:29: error: opcode not allowed: memory.atomic.notify\n    i32.const 0 i32.const 0 memory.atomic.notify drop\n                            ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:8:41: error: opcode not allowed: memory.atomic.wait32\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop\n                                        ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:9:41: error: opcode not allowed: memory.atomic.wait64\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop\n                                        ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:11:17: error: opcode not allowed: i32.atomic.load\n    i32.const 0 i32.atomic.load drop\n                ^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:12:17: error: opcode not allowed: i64.atomic.load\n    i32.const 0 i64.atomic.load drop\n                ^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:13:17: error: opcode not allowed: i32.atomic.load8_u\n    i32.const 0 i32.atomic.load8_u drop\n                ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:14:17: error: opcode not allowed: i32.atomic.load16_u\n    i32.const 0 i32.atomic.load16_u drop\n                ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:15:17: error: opcode not allowed: i64.atomic.load8_u\n    i32.const 0 i64.atomic.load8_u drop\n                ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:16:17: error: opcode not allowed: i64.atomic.load16_u\n    i32.const 0 i64.atomic.load16_u drop\n                ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:17:17: error: opcode not allowed: i64.atomic.load32_u\n    i32.const 0 i64.atomic.load32_u drop\n                ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:19:29: error: opcode not allowed: i32.atomic.store\n    i32.const 0 i32.const 0 i32.atomic.store\n                            ^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:20:29: error: opcode not allowed: i64.atomic.store\n    i32.const 0 i64.const 0 i64.atomic.store\n                            ^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:21:29: error: opcode not allowed: i32.atomic.store8\n    i32.const 0 i32.const 0 i32.atomic.store8\n                            ^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:22:29: error: opcode not allowed: i32.atomic.store16\n    i32.const 0 i32.const 0 i32.atomic.store16\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:23:29: error: opcode not allowed: i64.atomic.store8\n    i32.const 0 i64.const 0 i64.atomic.store8\n                            ^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:24:29: error: opcode not allowed: i64.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store16\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:25:29: error: opcode not allowed: i64.atomic.store32\n    i32.const 0 i64.const 0 i64.atomic.store32\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:27:29: error: opcode not allowed: i32.atomic.rmw.add\n    i32.const 0 i32.const 0 i32.atomic.rmw.add drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:28:29: error: opcode not allowed: i64.atomic.rmw.add\n    i32.const 0 i64.const 0 i64.atomic.rmw.add drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:29:29: error: opcode not allowed: i32.atomic.rmw8.add_u\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:30:29: error: opcode not allowed: i32.atomic.rmw16.add_u\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:31:29: error: opcode not allowed: i64.atomic.rmw8.add_u\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:32:29: error: opcode not allowed: i64.atomic.rmw16.add_u\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:33:29: error: opcode not allowed: i64.atomic.rmw32.add_u\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:35:29: error: opcode not allowed: i32.atomic.rmw.sub\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:36:29: error: opcode not allowed: i64.atomic.rmw.sub\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:37:29: error: opcode not allowed: i32.atomic.rmw8.sub_u\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:38:29: error: opcode not allowed: i32.atomic.rmw16.sub_u\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:39:29: error: opcode not allowed: i64.atomic.rmw8.sub_u\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:40:29: error: opcode not allowed: i64.atomic.rmw16.sub_u\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:41:29: error: opcode not allowed: i64.atomic.rmw32.sub_u\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:43:29: error: opcode not allowed: i32.atomic.rmw.and\n    i32.const 0 i32.const 0 i32.atomic.rmw.and drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:44:29: error: opcode not allowed: i64.atomic.rmw.and\n    i32.const 0 i64.const 0 i64.atomic.rmw.and drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:45:29: error: opcode not allowed: i32.atomic.rmw8.and_u\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:46:29: error: opcode not allowed: i32.atomic.rmw16.and_u\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:47:29: error: opcode not allowed: i64.atomic.rmw8.and_u\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:48:29: error: opcode not allowed: i64.atomic.rmw16.and_u\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:49:29: error: opcode not allowed: i64.atomic.rmw32.and_u\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:51:29: error: opcode not allowed: i32.atomic.rmw.or\n    i32.const 0 i32.const 0 i32.atomic.rmw.or drop\n                            ^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:52:29: error: opcode not allowed: i64.atomic.rmw.or\n    i32.const 0 i64.const 0 i64.atomic.rmw.or drop\n                            ^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:53:29: error: opcode not allowed: i32.atomic.rmw8.or_u\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u drop\n                            ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:54:29: error: opcode not allowed: i32.atomic.rmw16.or_u\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:55:29: error: opcode not allowed: i64.atomic.rmw8.or_u\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u drop\n                            ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:56:29: error: opcode not allowed: i64.atomic.rmw16.or_u\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:57:29: error: opcode not allowed: i64.atomic.rmw32.or_u\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:59:29: error: opcode not allowed: i32.atomic.rmw.xor\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:60:29: error: opcode not allowed: i64.atomic.rmw.xor\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:61:29: error: opcode not allowed: i32.atomic.rmw8.xor_u\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:62:29: error: opcode not allowed: i32.atomic.rmw16.xor_u\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:63:29: error: opcode not allowed: i64.atomic.rmw8.xor_u\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:64:29: error: opcode not allowed: i64.atomic.rmw16.xor_u\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:65:29: error: opcode not allowed: i64.atomic.rmw32.xor_u\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:67:29: error: opcode not allowed: i32.atomic.rmw.xchg\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg drop\n                            ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:68:29: error: opcode not allowed: i64.atomic.rmw.xchg\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg drop\n                            ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:69:29: error: opcode not allowed: i32.atomic.rmw8.xchg_u\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:70:29: error: opcode not allowed: i32.atomic.rmw16.xchg_u\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:71:29: error: opcode not allowed: i64.atomic.rmw8.xchg_u\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:72:29: error: opcode not allowed: i64.atomic.rmw16.xchg_u\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:73:29: error: opcode not allowed: i64.atomic.rmw32.xchg_u\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop\n                            ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:75:41: error: opcode not allowed: i32.atomic.rmw.cmpxchg\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:76:41: error: opcode not allowed: i64.atomic.rmw.cmpxchg\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:77:41: error: opcode not allowed: i32.atomic.rmw8.cmpxchg_u\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:78:41: error: opcode not allowed: i32.atomic.rmw16.cmpxchg_u\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:79:41: error: opcode not allowed: i64.atomic.rmw8.cmpxchg_u\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:80:41: error: opcode not allowed: i64.atomic.rmw16.cmpxchg_u\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/atomic-disabled.txt:81:41: error: opcode not allowed: i64.atomic.rmw32.cmpxchg_u\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/atomic.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-threads\n(module\n  (memory 1 1 shared)\n  (func\n    i32.const 0 i32.const 0 memory.atomic.notify drop\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop\n\n    i32.const 0 i32.atomic.load drop\n    i32.const 0 i64.atomic.load drop\n    i32.const 0 i32.atomic.load8_u drop\n    i32.const 0 i32.atomic.load16_u drop\n    i32.const 0 i64.atomic.load8_u drop\n    i32.const 0 i64.atomic.load16_u drop\n    i32.const 0 i64.atomic.load32_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.store\n    i32.const 0 i64.const 0 i64.atomic.store\n    i32.const 0 i32.const 0 i32.atomic.store8\n    i32.const 0 i32.const 0 i32.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store8\n    i32.const 0 i64.const 0 i64.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store32\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.add drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.add drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.and drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.and drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.or drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.or drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop\n\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop\n\n))\n"
  },
  {
    "path": "test/parse/expr/atomic64.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-threads --enable-memory64\n(module\n  (memory i64 1 1 shared)\n  (func\n    i64.const 0 i32.const 0 memory.atomic.notify drop\n    i64.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop\n    i64.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop\n\n    i64.const 0 i32.atomic.load drop\n    i64.const 0 i64.atomic.load drop\n    i64.const 0 i32.atomic.load8_u drop\n    i64.const 0 i32.atomic.load16_u drop\n    i64.const 0 i64.atomic.load8_u drop\n    i64.const 0 i64.atomic.load16_u drop\n    i64.const 0 i64.atomic.load32_u drop\n\n    i64.const 0 i32.const 0 i32.atomic.store\n    i64.const 0 i64.const 0 i64.atomic.store\n    i64.const 0 i32.const 0 i32.atomic.store8\n    i64.const 0 i32.const 0 i32.atomic.store16\n    i64.const 0 i64.const 0 i64.atomic.store8\n    i64.const 0 i64.const 0 i64.atomic.store16\n    i64.const 0 i64.const 0 i64.atomic.store32\n\n    i64.const 0 i32.const 0 i32.atomic.rmw.add drop\n    i64.const 0 i64.const 0 i64.atomic.rmw.add drop\n    i64.const 0 i32.const 0 i32.atomic.rmw8.add_u drop\n    i64.const 0 i32.const 0 i32.atomic.rmw16.add_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw8.add_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw16.add_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw32.add_u drop\n\n    i64.const 0 i32.const 0 i32.atomic.rmw.sub drop\n    i64.const 0 i64.const 0 i64.atomic.rmw.sub drop\n    i64.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop\n    i64.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop\n\n    i64.const 0 i32.const 0 i32.atomic.rmw.and drop\n    i64.const 0 i64.const 0 i64.atomic.rmw.and drop\n    i64.const 0 i32.const 0 i32.atomic.rmw8.and_u drop\n    i64.const 0 i32.const 0 i32.atomic.rmw16.and_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw8.and_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw16.and_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw32.and_u drop\n\n    i64.const 0 i32.const 0 i32.atomic.rmw.or drop\n    i64.const 0 i64.const 0 i64.atomic.rmw.or drop\n    i64.const 0 i32.const 0 i32.atomic.rmw8.or_u drop\n    i64.const 0 i32.const 0 i32.atomic.rmw16.or_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw8.or_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw16.or_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw32.or_u drop\n\n    i64.const 0 i32.const 0 i32.atomic.rmw.xor drop\n    i64.const 0 i64.const 0 i64.atomic.rmw.xor drop\n    i64.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop\n    i64.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop\n\n    i64.const 0 i32.const 0 i32.atomic.rmw.xchg drop\n    i64.const 0 i64.const 0 i64.atomic.rmw.xchg drop\n    i64.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop\n    i64.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop\n    i64.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop\n\n    i64.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop\n    i64.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop\n    i64.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop\n    i64.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop\n    i64.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop\n    i64.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop\n    i64.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop\n\n))\n"
  },
  {
    "path": "test/parse/expr/bad-atomic-unnatural-align.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n;;; ARGS: --enable-threads\n(module\n  (memory 1 1 shared)\n  (func\n    i32.const 0 i32.const 0 memory.atomic.notify align=8 drop\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 align=8 drop\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 align=16 drop\n\n    i32.const 0 i32.atomic.load align=8 drop\n    i32.const 0 i64.atomic.load align=16 drop\n    i32.const 0 i32.atomic.load8_u align=2 drop\n    i32.const 0 i32.atomic.load16_u align=4 drop\n    i32.const 0 i64.atomic.load8_u align=2 drop\n    i32.const 0 i64.atomic.load16_u align=4 drop\n    i32.const 0 i64.atomic.load32_u align=8 drop\n\n    i32.const 0 i32.const 0 i32.atomic.store align=8\n    i32.const 0 i64.const 0 i64.atomic.store align=16\n    i32.const 0 i32.const 0 i32.atomic.store8 align=1\n    i32.const 0 i32.const 0 i32.atomic.store16 align=4\n    i32.const 0 i64.const 0 i64.atomic.store8 align=1\n    i32.const 0 i64.const 0 i64.atomic.store16 align=4\n    i32.const 0 i64.const 0 i64.atomic.store32 align=8\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.add align=8 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.add align=16 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u align=2 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u align=8 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub align=8 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub align=16 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u align=2 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u align=8 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.and align=8 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.and align=16 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u align=2 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u align=8 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.or align=8 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.or align=16 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u align=2 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u align=8 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor align=8 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor align=16 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u align=2 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u align=8 drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg align=8 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg align=16 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u align=2 drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u align=2 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u align=4 drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u align=8 drop\n\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg align=8 drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg align=16 drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u align=2 drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u align=4 drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u align=2 drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u align=4 drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u align=8 drop\n\n))\n\n(;; STDERR ;;;\nout/test/parse/expr/bad-atomic-unnatural-align.txt:7:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 memory.atomic.notify align=8 drop\n                            ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:8:41: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 align=8 drop\n                                        ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:9:41: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 align=16 drop\n                                        ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:11:17: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.atomic.load align=8 drop\n                ^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:12:17: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.atomic.load align=16 drop\n                ^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:13:17: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i32.atomic.load8_u align=2 drop\n                ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:14:17: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.atomic.load16_u align=4 drop\n                ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:15:17: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i64.atomic.load8_u align=2 drop\n                ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:16:17: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.atomic.load16_u align=4 drop\n                ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:17:17: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.atomic.load32_u align=8 drop\n                ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:19:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i32.atomic.store align=8\n                            ^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:20:29: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.atomic.store align=16\n                            ^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:22:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.const 0 i32.atomic.store16 align=4\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:24:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.const 0 i64.atomic.store16 align=4\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:25:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.const 0 i64.atomic.store32 align=8\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:27:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i32.atomic.rmw.add align=8 drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:28:29: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.atomic.rmw.add align=16 drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:29:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:30:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:31:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:32:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:33:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u align=8 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:35:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub align=8 drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:36:29: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub align=16 drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:37:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:38:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:39:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:40:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:41:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u align=8 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:43:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i32.atomic.rmw.and align=8 drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:44:29: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.atomic.rmw.and align=16 drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:45:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:46:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:47:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:48:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:49:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u align=8 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:51:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i32.atomic.rmw.or align=8 drop\n                            ^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:52:29: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.atomic.rmw.or align=16 drop\n                            ^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:53:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:54:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:55:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:56:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:57:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u align=8 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:59:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor align=8 drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:60:29: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor align=16 drop\n                            ^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:61:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:62:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:63:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:64:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:65:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u align=8 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:67:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg align=8 drop\n                            ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:68:29: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg align=16 drop\n                            ^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:69:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:70:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:71:29: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u align=2 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:72:29: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u align=4 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:73:29: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u align=8 drop\n                            ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:75:41: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg align=8 drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:76:41: error: alignment must be equal to natural alignment (8)\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg align=16 drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:77:41: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u align=2 drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:78:41: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u align=4 drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:79:41: error: alignment must be equal to natural alignment (1)\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u align=2 drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:80:41: error: alignment must be equal to natural alignment (2)\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u align=4 drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/parse/expr/bad-atomic-unnatural-align.txt:81:41: error: alignment must be equal to natural alignment (4)\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u align=8 drop\n                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-binary-one-expr.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n   i32.const 0 \n   i32.add))\n(;; STDERR ;;;\nout/test/parse/expr/bad-binary-one-expr.txt:5:4: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n   i32.add))\n   ^^^^^^^\nout/test/parse/expr/bad-binary-one-expr.txt:5:4: error: type mismatch at end of function, expected [] but got [i32]\n   i32.add))\n   ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-block-end-label.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    block\n    end $foo))\n(;; STDERR ;;;\nout/test/parse/expr/bad-block-end-label.txt:6:9: error: unexpected label \"$foo\"\n    end $foo))\n        ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-block-mismatch-label.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    block $foo\n    end $bar))\n(;; STDERR ;;;\nout/test/parse/expr/bad-block-mismatch-label.txt:6:9: error: mismatching label \"$foo\" != \"$bar\"\n    end $bar))\n        ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-br-bad-depth.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func     ;; 2 (implicit)\n    block   ;; 1\n      block ;; 0\n        br 3\n      end\n    end))\n(;; STDERR ;;;\nout/test/parse/expr/bad-br-bad-depth.txt:7:9: error: invalid depth: 3 (max 2)\n        br 3\n        ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-br-defined-later.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    br 1\n    block \n      nop\n    end))\n(;; STDERR ;;;\nout/test/parse/expr/bad-br-defined-later.txt:5:5: error: invalid depth: 1 (max 0)\n    br 1\n    ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-br-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func br $n))\n(;; STDERR ;;;\nout/test/parse/expr/bad-br-name-undefined.txt:3:18: error: undefined label variable \"$n\"\n(module (func br $n))\n                 ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-br-name.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func \n          block $foo \n            br foo \n          end))\n(;; STDERR ;;;\nout/test/parse/expr/bad-br-name.txt:5:16: error: unexpected token \"foo\", expected a numeric index or a name (e.g. 12 or $foo).\n            br foo \n               ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-br-no-depth.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    block\n      br\n    end))\n(;; STDERR ;;;\nout/test/parse/expr/bad-br-no-depth.txt:7:5: error: unexpected token \"end\", expected a numeric index or a name (e.g. 12 or $foo).\n    end))\n    ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-br-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func br 1))\n(;; STDERR ;;;\nout/test/parse/expr/bad-br-undefined.txt:3:15: error: invalid depth: 1 (max 0)\n(module (func br 1))\n              ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-brtable-bad-depth.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func    ;; depth 1 (implicit)\n    block  ;; depth 0\n      i32.const 0\n      br_table 2\n    end))\n(;; STDERR ;;;\nout/test/parse/expr/bad-brtable-bad-depth.txt:7:7: error: invalid depth: 2 (max 1)\n      br_table 2\n      ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-brtable-no-vars.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func br_table))\n(;; STDERR ;;;\nout/test/parse/expr/bad-brtable-no-vars.txt:3:23: error: unexpected token \")\", expected a var (e.g. 12 or $foo).\n(module (func br_table))\n                      ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-compare-one-expr.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 0 \n          i32.lt_s))\n(;; STDERR ;;;\nout/test/parse/expr/bad-compare-one-expr.txt:5:11: error: type mismatch in i32.lt_s, expected [i32, i32] but got [i32]\n          i32.lt_s))\n          ^^^^^^^^\nout/test/parse/expr/bad-compare-one-expr.txt:5:11: error: type mismatch at end of function, expected [] but got [i32]\n          i32.lt_s))\n          ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-f32-nan-arith.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(func f32.const nan:arithmetic)\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-f32-nan-arith.txt:3:17: error: invalid literal \"nan:arithmetic\"\n(func f32.const nan:arithmetic)\n                ^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-f32-trailing.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func f32.const 1234.5678foo))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-f32-trailing.txt:3:25: error: unexpected token \"1234.5678foo\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n(module (func f32.const 1234.5678foo))\n                        ^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-f64-nan-arith.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(func f64.const nan:arithmetic)\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-f64-nan-arith.txt:3:17: error: invalid literal \"nan:arithmetic\"\n(func f64.const nan:arithmetic)\n                ^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-i32-garbage.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func i32.const one-hundred))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-i32-garbage.txt:3:25: error: unexpected token \"one-hundred\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n(module (func i32.const one-hundred))\n                        ^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-i32-just-negative-sign.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func i32.const -))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-i32-just-negative-sign.txt:4:19: error: unexpected token \"-\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func i32.const -))\n                  ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-i32-overflow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func i32.const 4294967296))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-i32-overflow.txt:3:25: error: invalid literal \"4294967296\"\n(module (func i32.const 4294967296))\n                        ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-i32-trailing.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func i32.const 100x))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-i32-trailing.txt:3:25: error: unexpected token \"100x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n(module (func i32.const 100x))\n                        ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-i32-underflow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func i32.const -2147483649))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-i32-underflow.txt:3:25: error: invalid literal \"-2147483649\"\n(module (func i32.const -2147483649))\n                        ^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-i64-overflow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func i64.const 18446744073709551616))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-i64-overflow.txt:3:25: error: invalid literal \"18446744073709551616\"\n(module (func i64.const 18446744073709551616))\n                        ^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-type-i32-in-non-simd-const.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func i32.const i32 100))\n(module (func i64.const i32 100))\n(module (func f32.const i32 100))\n(module (func f64.const i32 100))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt:3:25: error: unexpected token \"i32\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n(module (func i32.const i32 100))\n                        ^^^\nout/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt:4:25: error: unexpected token \"i32\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n(module (func i64.const i32 100))\n                        ^^^\nout/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt:5:25: error: unexpected token \"i32\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n(module (func f32.const i32 100))\n                        ^^^\nout/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt:6:25: error: unexpected token \"i32\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n(module (func f64.const i32 100))\n                        ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-v128-i16x8-overflow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func v128.const i16x8 -32768 -32767 32767 65535 65536 0 0 0)\n  (func v128.const i16x8 -32768 -32769 32767 65535 65536 0 0 0)\n)\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-v128-i16x8-overflow.txt:4:52: error: invalid literal \"65536\"\n  (func v128.const i16x8 -32768 -32767 32767 65535 65536 0 0 0)\n                                                   ^^^^^\nout/test/parse/expr/bad-const-v128-i16x8-overflow.txt:5:33: error: invalid literal \"-32769\"\n  (func v128.const i16x8 -32768 -32769 32767 65535 65536 0 0 0)\n                                ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-v128-i32x4-overflow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func v128.const i32x4 -2147483648 2147483648 4294967295 4294967296)\n  (func v128.const i32x4 -2147483648 -2147483649 4294967295 4294967296)\n)\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-v128-i32x4-overflow.txt:4:60: error: invalid literal \"4294967296\"\n  (func v128.const i32x4 -2147483648 2147483648 4294967295 4294967296)\n                                                           ^^^^^^^^^^\nout/test/parse/expr/bad-const-v128-i32x4-overflow.txt:5:38: error: invalid literal \"-2147483649\"\n  (func v128.const i32x4 -2147483648 -2147483649 4294967295 4294967296)\n                                     ^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-v128-i8x16-overflow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func v128.const i8x16 -127 -128 128 255 256 0 0 0 0 0 0 0 0 0 0 0)\n  (func v128.const i8x16 -127 -129 128 255 256 0 0 0 0 0 0 0 0 0 0 0)\n)\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-v128-i8x16-overflow.txt:4:44: error: invalid literal \"256\"\n  (func v128.const i8x16 -127 -128 128 255 256 0 0 0 0 0 0 0 0 0 0 0)\n                                           ^^^\nout/test/parse/expr/bad-const-v128-i8x16-overflow.txt:5:31: error: invalid literal \"-129\"\n  (func v128.const i8x16 -127 -129 128 255 256 0 0 0 0 0 0 0 0 0 0 0)\n                              ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-v128-nat-overflow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func v128.const i32x4 0x12345678 0x123 4294967296 0xabcd3478))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-v128-nat-overflow.txt:4:43: error: invalid literal \"4294967296\"\n  (func v128.const i32x4 0x12345678 0x123 4294967296 0xabcd3478))\n                                          ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-const-v128-type-i32-expected.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func v128.const 0x12345678 0x00000000 0x00000000 0xabcd3478))\n(module (func v128.const i64 0x12345678 0x00000000 0x00000000 0xabcd3478))\n(;; STDERR ;;;\nout/test/parse/expr/bad-const-v128-type-i32-expected.txt:3:26: error: Unexpected type at start of simd constant. Expected one of: i8x16, i16x8, i32x4, i64x2, f32x4, f64x2. Found \"NAT\".\n(module (func v128.const 0x12345678 0x00000000 0x00000000 0xabcd3478))\n                         ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-convert-float-sign.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          f32.const 0 \n          f32.converts.f64))\n(;; STDERR ;;;\nout/test/parse/expr/bad-convert-float-sign.txt:5:11: error: unexpected token f32.converts.f64, expected ).\n          f32.converts.f64))\n          ^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-convert-int-no-sign.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const \n          i32.convert.i32))\n(;; STDERR ;;;\nout/test/parse/expr/bad-convert-int-no-sign.txt:5:11: error: unexpected token \"i32.convert.i32\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n          i32.convert.i32))\n          ^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-globalget-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func global.get $n))\n(;; STDERR ;;;\nout/test/parse/expr/bad-globalget-name-undefined.txt:3:26: error: undefined global variable \"$n\"\n(module (func global.get $n))\n                         ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-globalget-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    global.get 0\n    drop))\n(;; STDERR ;;;\nout/test/parse/expr/bad-globalget-undefined.txt:5:16: error: global variable out of range: 0 (max 0)\n    global.get 0\n               ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-globalset-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 1 \n          global.set $f))\n(;; STDERR ;;;\nout/test/parse/expr/bad-globalset-name-undefined.txt:5:22: error: undefined global variable \"$f\"\n          global.set $f))\n                     ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-globalset-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func \n          i32.const 1\n          global.set 0))\n(;; STDERR ;;;\nout/test/parse/expr/bad-globalset-undefined.txt:5:22: error: global variable out of range: 0 (max 0)\n          global.set 0))\n                     ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-if-end-label.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 0\n    if\n    else $foo\n    end $bar))\n(;; STDERR ;;;\nout/test/parse/expr/bad-if-end-label.txt:7:10: error: unexpected label \"$foo\"\n    else $foo\n         ^^^^\nout/test/parse/expr/bad-if-end-label.txt:8:9: error: unexpected label \"$bar\"\n    end $bar))\n        ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-if-mismatch-label.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 1\n    if $foo\n    else $bar\n    end $baz))\n(;; STDERR ;;;\nout/test/parse/expr/bad-if-mismatch-label.txt:7:10: error: mismatching label \"$foo\" != \"$bar\"\n    else $bar\n         ^^^^\nout/test/parse/expr/bad-if-mismatch-label.txt:8:9: error: mismatching label \"$foo\" != \"$baz\"\n    end $baz))\n        ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-if-no-then.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (if (i32.const 0))))\n(;; STDERR ;;;\nout/test/parse/expr/bad-if-no-then.txt:3:32: error: unexpected token ), expected (.\n(module (func (if (i32.const 0))))\n                               ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-load-align-misspelled.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 0\n    i32.load aline=64))\n(;; STDERR ;;;\nout/test/parse/expr/bad-load-align-misspelled.txt:6:14: error: unexpected token aline=64, expected ).\n    i32.load aline=64))\n             ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-load-align-negative.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func \n          i32.const 0 \n          i32.load8_s align=-1))\n(;; STDERR ;;;\nout/test/parse/expr/bad-load-align-negative.txt:5:23: error: unexpected token align=-1, expected ).\n          i32.load8_s align=-1))\n                      ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-load-align-not-pot.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.load align=3 \n    drop))\n(;; STDERR ;;;\nout/test/parse/expr/bad-load-align-not-pot.txt:7:14: error: alignment must be power-of-two\n    i32.load align=3 \n             ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-load-align.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (i32.load align=foo (i32.const 0))))\n(;; STDERR ;;;\nout/test/parse/expr/bad-load-align.txt:3:25: error: unexpected token align=foo, expected ).\n(module (func (i32.load align=foo (i32.const 0))))\n                        ^^^^^^^^^\nout/test/parse/expr/bad-load-align.txt:3:50: error: unexpected token ), expected EOF.\n(module (func (i32.load align=foo (i32.const 0))))\n                                                 ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-load-float-sign.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 0\n          f32.loads))\n(;; STDERR ;;;\nout/test/parse/expr/bad-load-float-sign.txt:5:11: error: unexpected token f32.loads, expected ).\n          f32.loads))\n          ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-load-offset-negative.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 0 \n          i32.load8_s offset=-1))\n(;; STDERR ;;;\nout/test/parse/expr/bad-load-offset-negative.txt:5:23: error: unexpected token offset=-1, expected ).\n          i32.load8_s offset=-1))\n                      ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-load-type.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 0\n          load.x32))\n(;; STDERR ;;;\nout/test/parse/expr/bad-load-type.txt:5:11: error: unexpected token load.x32, expected ).\n          load.x32))\n          ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-localget-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func local.get $n))\n(;; STDERR ;;;\nout/test/parse/expr/bad-localget-name-undefined.txt:3:25: error: undefined local variable \"$n\"\n(module (func local.get $n))\n                        ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-localget-name.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (local $f f32) local.get f))\n(;; STDERR ;;;\nout/test/parse/expr/bad-localget-name.txt:3:40: error: unexpected token \"f\", expected a numeric index or a name (e.g. 12 or $foo).\n(module (func (local $f f32) local.get f))\n                                       ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-localget-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    local.get 0\n    drop))\n(;; STDERR ;;;\nout/test/parse/expr/bad-localget-undefined.txt:5:15: error: local variable out of range (max 0)\n    local.get 0\n              ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-localset-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func \n          i32.const 0\n          local.set $n))\n(;; STDERR ;;;\nout/test/parse/expr/bad-localset-name-undefined.txt:5:21: error: undefined local variable \"$n\"\n          local.set $n))\n                    ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-localset-name.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n  (local $n i32)\n  i32.const 0\n  local.set n))\n(;; STDERR ;;;\nout/test/parse/expr/bad-localset-name.txt:6:13: error: unexpected token \"n\", expected a numeric index or a name (e.g. 12 or $foo).\n  local.set n))\n            ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-localset-no-value.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n  (local i32)\n  local.set 0))\n(;; STDERR ;;;\nout/test/parse/expr/bad-localset-no-value.txt:5:3: error: type mismatch in local.set, expected [i32] but got []\n  local.set 0))\n  ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-localset-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 0 \n          local.set 0))\n(;; STDERR ;;;\nout/test/parse/expr/bad-localset-undefined.txt:5:21: error: local variable out of range (max 0)\n          local.set 0))\n                    ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-loop-end-label.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    loop\n    end $foo))\n(;; STDERR ;;;\nout/test/parse/expr/bad-loop-end-label.txt:6:9: error: unexpected label \"$foo\"\n    end $foo))\n        ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-loop-mismatch-label.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    loop $foo\n    end $bar))\n(;; STDERR ;;;\nout/test/parse/expr/bad-loop-mismatch-label.txt:6:9: error: mismatching label \"$foo\" != \"$bar\"\n    end $bar))\n        ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-memory-copy-differing-type.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n;;; ARGS: --enable-all\n\n(;\nNote that this test covers an interaction between the memory64 and\nmulti-memory proposals.\n\nNeither proposal includes a test like this because each proposal only\nimplements itself on top of the current standard. Once one of the two proposals\nis standardized, this test should be removed in favor of a spec test in the\nproposal that is yet to be standardized.\n;)\n\n(module\n  (memory $mem64 i64 1)\n  (memory $mem32 i32 1)\n  (func\n    (; i64 -> i32 ;)\n    i64.const 0\n    i64.const 0\n    i32.const 0\n    memory.copy $mem32 $mem64\n\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy $mem32 $mem64\n\n    i32.const 0\n    i64.const 0\n    i64.const 0\n    memory.copy $mem32 $mem64\n\n    (; i32 -> i64 ;)\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy $mem64 $mem32\n\n    i64.const 0\n    i64.const 0\n    i32.const 0\n    memory.copy $mem64 $mem32\n\n    i64.const 0\n    i32.const 0\n    i64.const 0\n    memory.copy $mem64 $mem32\n\n    (; i64 -> i64 ;)\n    i32.const 0\n    i64.const 0\n    i64.const 0\n    memory.copy $mem64 $mem64\n\n    i64.const 0\n    i32.const 0\n    i64.const 0\n    memory.copy $mem64 $mem64\n\n    i64.const 0\n    i64.const 0\n    i32.const 0\n    memory.copy $mem64 $mem64\n\n    (; i32 -> i32 ;)\n    i64.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy $mem32 $mem32\n\n    i32.const 0\n    i64.const 0\n    i32.const 0\n    memory.copy $mem32 $mem32\n\n    i32.const 0\n    i32.const 0\n    i64.const 0\n    memory.copy $mem32 $mem32\n  )\n)\n\n(;; STDERR ;;;\nout/test/parse/expr/bad-memory-copy-differing-type.txt:23:5: error: type mismatch in memory.copy, expected [i32, i64, i32] but got [i64, i64, i32]\n    memory.copy $mem32 $mem64\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:28:5: error: type mismatch in memory.copy, expected [i32, i64, i32] but got [i32, i32, i32]\n    memory.copy $mem32 $mem64\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:33:5: error: type mismatch in memory.copy, expected [i32, i64, i32] but got [i32, i64, i64]\n    memory.copy $mem32 $mem64\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:39:5: error: type mismatch in memory.copy, expected [i64, i32, i32] but got [i32, i32, i32]\n    memory.copy $mem64 $mem32\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:44:5: error: type mismatch in memory.copy, expected [i64, i32, i32] but got [i64, i64, i32]\n    memory.copy $mem64 $mem32\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:49:5: error: type mismatch in memory.copy, expected [i64, i32, i32] but got [i64, i32, i64]\n    memory.copy $mem64 $mem32\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:55:5: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i64, i64]\n    memory.copy $mem64 $mem64\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:60:5: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i32, i64]\n    memory.copy $mem64 $mem64\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:65:5: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i64, i32]\n    memory.copy $mem64 $mem64\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:71:5: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, i32]\n    memory.copy $mem32 $mem32\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:76:5: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, i32]\n    memory.copy $mem32 $mem32\n    ^^^^^^^^^^^\nout/test/parse/expr/bad-memory-copy-differing-type.txt:81:5: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i32, i64]\n    memory.copy $mem32 $mem32\n    ^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-nop.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func \n          nop\n          foo))\n(;; STDERR ;;;\nout/test/parse/expr/bad-nop.txt:5:11: error: unexpected token foo, expected ).\n          foo))\n          ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-select-multi.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    select (result i32 i32)\n    unreachable\n    ))\n(;; STDERR ;;;\nout/test/parse/expr/bad-select-multi.txt:10:5: error: invalid arity in select instruction: 2.\n    select (result i32 i32)\n    ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-simd-shuffle-lane-index-overflow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n    v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155\n    i8x16.shuffle 0x01020304 05060708 0x090a0b0c 0x00000000\n    ))\n\n(;; STDERR ;;;\nout/test/parse/expr/bad-simd-shuffle-lane-index-overflow.txt:7:19: error: lane index \"0x01020304\" out-of-range [0, 32)\n    i8x16.shuffle 0x01020304 05060708 0x090a0b0c 0x00000000\n                  ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-simd-shuffle-lane-index-overflow2.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n    v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155\n    i8x16.shuffle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 33\n    drop\n    ))\n\n(;; STDERR ;;;\nout/test/parse/expr/bad-simd-shuffle-lane-index-overflow2.txt:7:5: error: lane index must be less than 32 (got 33)\n    i8x16.shuffle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 33\n    ^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-simd-shuffle-nat-expected.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n    v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155\n    i8x16.shuffle $0x01020304 0x05060708 0x090a0b0c 0x00000000\n    ))\n\n(;; STDERR ;;;\nout/test/parse/expr/bad-simd-shuffle-nat-expected.txt:7:19: error: unexpected token \"$0x01020304\", expected a natural number in range [0, 32).\n    i8x16.shuffle $0x01020304 0x05060708 0x090a0b0c 0x00000000\n                  ^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-simd-shuffle-not-enough-indices.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n    v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155\n    i8x16.shuffle 1 1 1 1\n    ))\n\n(;; STDERR ;;;\nout/test/parse/expr/bad-simd-shuffle-not-enough-indices.txt:8:5: error: unexpected token \")\", expected a natural number in range [0, 32).\n    ))\n    ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-store-align-not-pot.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    f32.const 0.0\n    f32.store align=3))\n(;; STDERR ;;;\nout/test/parse/expr/bad-store-align-not-pot.txt:8:15: error: alignment must be power-of-two\n    f32.store align=3))\n              ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-store-align.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 0 \n          i32.const 0\n          i32.store align=foo))\n(;; STDERR ;;;\nout/test/parse/expr/bad-store-align.txt:6:21: error: unexpected token align=foo, expected ).\n          i32.store align=foo))\n                    ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-store-float.sign.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 0\n          f32.const 0 \n          f32.storeu))\n(;; STDERR ;;;\nout/test/parse/expr/bad-store-float.sign.txt:6:11: error: unexpected token f32.storeu, expected ).\n          f32.storeu))\n          ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-store-offset-negative.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func \n          i32.const 0\n          i32.const 0\n          i32.store8 offset=-1))\n(;; STDERR ;;;\nout/test/parse/expr/bad-store-offset-negative.txt:6:22: error: unexpected token offset=-1, expected ).\n          i32.store8 offset=-1))\n                     ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-store-type.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func\n          i32.const 0\n          f32.const 0 \n          store.float32))\n(;; STDERR ;;;\nout/test/parse/expr/bad-store-type.txt:6:11: error: unexpected token store.float32, expected ).\n          store.float32))\n          ^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-try-clause.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n;;; ERROR: 1\n(module\n  (func (try (do) (foo)))\n(;; STDERR ;;;\nout/test/parse/expr/bad-try-clause.txt:5:20: error: unexpected token \"foo\", expected catch, catch_all or delegate.\n  (func (try (do) (foo)))\n                   ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-try-delegate.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n;;; ERROR: 1\n(module\n  (func try nop delegate)\n  (func try nop delegate 0 end)\n)\n(;; STDERR ;;;\nout/test/parse/expr/bad-try-delegate.txt:5:25: error: unexpected token \")\", expected a numeric index or a name (e.g. 12 or $foo).\n  (func try nop delegate)\n                        ^\nout/test/parse/expr/bad-try-delegate.txt:6:28: error: unexpected token end, expected ).\n  (func try nop delegate 0 end)\n                           ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-try-multiple-catch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n;;; ERROR: 1\n(module\n  ;; flat\n  (func\n    try\n      nop\n    catch_all\n      nop\n    catch_all\n      nop\n    end)\n\n  ;; folded\n  (func\n    (try\n      (do\n        (nop))\n      (catch_all\n        (nop))\n      (catch_all\n        (nop))))\n(;; STDERR ;;;\nout/test/parse/expr/bad-try-multiple-catch.txt:11:5: error: multiple catch_all clauses not allowed\n    catch_all\n    ^^^^^^^^^\nout/test/parse/expr/bad-try-multiple-catch.txt:13:5: error: unexpected token end, expected ).\n    end)\n    ^^^\nout/test/parse/expr/bad-try-multiple-catch.txt:22:8: error: multiple catch_all clauses not allowed\n      (catch_all\n       ^^^^^^^^^\nout/test/parse/expr/bad-try-multiple-catch.txt:23:16: error: unexpected token ), expected EOF.\n        (nop))))\n               ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bad-unexpected.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (module)))\n(;; STDERR ;;;\nout/test/parse/expr/bad-unexpected.txt:3:16: error: unexpected token \"module\", expected an instr.\n(module (func (module)))\n               ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/binary.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 0\n    i32.const 0\n    i32.add\n    drop\n    i64.const 0\n    i64.const 0\n    i64.add\n    drop\n    f32.const 0\n    f32.const 0\n    f32.add\n    drop\n    f64.const 0\n    f64.const 0\n    f64.add\n    drop\n    i32.const 0\n    i32.const 0\n    i32.sub\n    drop\n    i64.const 0\n    i64.const 0\n    i64.sub\n    drop\n    f32.const 0\n    f32.const 0\n    f32.sub\n    drop\n    f64.const 0\n    f64.const 0\n    f64.sub\n    drop\n    i32.const 0\n    i32.const 0\n    i32.mul\n    drop\n    i64.const 0\n    i64.const 0\n    i64.mul\n    drop\n    f32.const 0\n    f32.const 0\n    f32.mul\n    drop\n    f64.const 0\n    f64.const 0\n    f64.mul\n    drop\n    i32.const 0\n    i32.const 0\n    i32.div_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.div_s\n    drop\n    i32.const 0\n    i32.const 0\n    i32.div_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.div_u\n    drop\n    f32.const 0\n    f32.const 0\n    f32.div\n    drop\n    f64.const 0\n    f64.const 0\n    f64.div\n    drop\n    i32.const 0\n    i32.const 0\n    i32.rem_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.rem_s\n    drop\n    i32.const 0\n    i32.const 0\n    i32.rem_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.rem_u\n    drop\n    f32.const 0\n    f32.const 0\n    f32.min\n    drop\n    f64.const 0\n    f64.const 0\n    f64.min\n    drop\n    f32.const 0\n    f32.const 0\n    f32.max\n    drop\n    f64.const 0\n    f64.const 0\n    f64.max\n    drop\n    i32.const 0\n    i32.const 0\n    i32.and\n    drop\n    i64.const 0\n    i64.const 0\n    i64.and\n    drop\n    i32.const 0\n    i32.const 0\n    i32.or\n    drop\n    i64.const 0\n    i64.const 0\n    i64.or\n    drop\n    i32.const 0\n    i32.const 0\n    i32.xor\n    drop\n    i64.const 0\n    i64.const 0\n    i64.xor\n    drop\n    i32.const 0\n    i32.const 0\n    i32.shl\n    drop\n    i64.const 0\n    i64.const 0\n    i64.shl\n    drop\n    i32.const 0\n    i32.const 0\n    i32.shr_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.shr_u\n    drop\n    i32.const 0\n    i32.const 0\n    i32.shr_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.shr_s\n    drop\n    i32.const 0\n    i32.const 0\n    i32.rotl\n    drop\n    i64.const 0\n    i64.const 0\n    i64.rotl\n    drop\n    i32.const 0\n    i32.const 0\n    i32.rotr\n    drop\n    i64.const 0\n    i64.const 0\n    i64.rotr\n    drop\n    f32.const 0\n    f32.const 0\n    f32.copysign\n    drop\n    f64.const 0\n    f64.const 0\n    f64.copysign\n    drop))\n"
  },
  {
    "path": "test/parse/expr/block-multi-named.txt",
    "content": ";;; TOOL: wat2wasm\n(type $v_v (func))\n(type $v_ii (func (param i32 i32)))\n(type $ii_v (func (result i32 i32)))\n(type $ff_ff (func (param f32 f32) (result f32 f32)))\n\n(func\n  block (type $v_v)\n  end)\n\n(func\n  i32.const 1\n  i32.const 2\n  block (type $v_ii)\n    drop\n    drop\n  end)\n\n(func\n  block (type $ii_v)\n    i32.const 1\n    i32.const 2\n  end\n  drop\n  drop)\n\n(func\n  f32.const 1\n  f32.const 2\n  block (type $ff_ff)\n  end\n  drop\n  drop)\n"
  },
  {
    "path": "test/parse/expr/block-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  ;; block w/ multiple results\n  (func\n    block (result i32 i64)\n      i32.const 0\n      i64.const 0\n    end\n    return)\n\n  ;; block w/ params\n  (func\n    i32.const 0\n    block (param i32) (result i32 i32)\n      i32.const 1\n    end\n    return)\n)\n"
  },
  {
    "path": "test/parse/expr/block-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block $foo\n      nop\n      nop\n    end))\n"
  },
  {
    "path": "test/parse/expr/block-return.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    block (result i32)\n      nop\n      i32.const 1\n      return\n    end))\n\n"
  },
  {
    "path": "test/parse/expr/block.txt",
    "content": ";;; TOOL: wat2wasm\n(module \n  (func \n    block \n      nop \n      block \n        nop\n        nop\n      end \n    end))\n"
  },
  {
    "path": "test/parse/expr/br-block.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block $exit1\n      br 0\n    end\n    block $exit2\n      br $exit2\n    end))\n"
  },
  {
    "path": "test/parse/expr/br-loop.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    loop $exit\n      br $exit\n    end))\n"
  },
  {
    "path": "test/parse/expr/br-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func\n  block $foo\n    br $foo\n  end))\n"
  },
  {
    "path": "test/parse/expr/br.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block\n      br 0\n    end))\n"
  },
  {
    "path": "test/parse/expr/brif-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block $foo\n      i32.const 1\n      br_if $foo\n    end))\n"
  },
  {
    "path": "test/parse/expr/brif.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block $foo\n      i32.const 1\n      br_if 0\n    end))\n"
  },
  {
    "path": "test/parse/expr/brtable-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block\n      block\n        block\n          block\n            block\n              i32.const 0 \n              br_table 4 3 2 1 0\n            end\n            nop\n          end\n          nop\n        end\n        nop\n      end\n      nop\n    end))\n"
  },
  {
    "path": "test/parse/expr/brtable-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block $exit\n      block $1\n        block $0\n          i32.const 0\n          br_table $0 $1 $exit \n        end\n        nop\n      end\n      nop\n     end))\n"
  },
  {
    "path": "test/parse/expr/brtable.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block\n      block\n        block \n         i32.const 0\n         br_table 0 1 \n        end\n        nop\n      end\n      nop\n    end))\n"
  },
  {
    "path": "test/parse/expr/bulk-memory-disabled.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS*: --disable-reference-types --disable-bulk-memory\n;;; ERROR: 1\n\n(module\n  (memory 1)\n  (data $data \"a\")\n  (func\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n    data.drop 0\n    i32.const 0 i32.const 0 i32.const 0 memory.copy\n    i32.const 0 i32.const 0 i32.const 0 memory.fill\n  )\n\n  (table 1 funcref)\n  (elem $elem funcref 0)\n  (elem funcref (ref.null func))\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n    elem.drop 0\n    i32.const 0 i32.const 0 i32.const 0 table.copy\n  )\n)\n(;; STDERR ;;;\nout/test/parse/expr/bulk-memory-disabled.txt:7:4: error: passive data segments are not allowed\n  (data $data \"a\")\n   ^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:9:41: error: opcode not allowed: memory.init\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n                                        ^^^^^^^^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:10:5: error: opcode not allowed: data.drop\n    data.drop 0\n    ^^^^^^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:11:41: error: opcode not allowed: memory.copy\n    i32.const 0 i32.const 0 i32.const 0 memory.copy\n                                        ^^^^^^^^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:12:41: error: opcode not allowed: memory.fill\n    i32.const 0 i32.const 0 i32.const 0 memory.fill\n                                        ^^^^^^^^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:16:15: error: unexpected token \"funcref\", expected an offset expr (e.g. (i32.const 123)).\n  (elem $elem funcref 0)\n              ^^^^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:17:9: error: unexpected token \"funcref\", expected an offset expr (e.g. (i32.const 123)).\n  (elem funcref (ref.null func))\n        ^^^^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:19:41: error: opcode not allowed: table.init\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n                                        ^^^^^^^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:20:5: error: opcode not allowed: elem.drop\n    elem.drop 0\n    ^^^^^^^^^\nout/test/parse/expr/bulk-memory-disabled.txt:21:41: error: opcode not allowed: table.copy\n    i32.const 0 i32.const 0 i32.const 0 table.copy\n                                        ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/bulk-memory-named.txt",
    "content": ";;; TOOL: wat2wasm\n\n(module\n  (memory 1)\n  (data $data \"a\")\n  (func\n    i32.const 0 i32.const 0 i32.const 0 memory.init $data\n    data.drop $data\n  )\n\n  (table 1 funcref)\n  (elem $elem funcref (ref.func 0) (ref.null func))\n  (elem $elem2 func 0)\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init $elem\n    elem.drop $elem\n  )\n)\n"
  },
  {
    "path": "test/parse/expr/bulk-memory-named64.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-memory64\n\n\n(module\n  (memory i64 1)\n  (data $data \"a\")\n  (func\n    i64.const 0 i32.const 0 i32.const 0 memory.init $data\n    data.drop $data\n  )\n\n  (table 1 funcref)\n  (elem $elem funcref (ref.func 0) (ref.null func))\n  (elem $elem2 func 0)\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init $elem\n    elem.drop $elem\n  )\n)\n"
  },
  {
    "path": "test/parse/expr/call-defined-later.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func $foo\n    i32.const 1\n    i32.const 0\n    call $bar\n    drop)\n  (func $bar (param i32 i32) (result i32)\n    i32.const 0))\n"
  },
  {
    "path": "test/parse/expr/call-name-prefix.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func $foomore\n    i32.const 0\n    call $foo)\n  (func $foo (param i32)\n    nop))\n"
  },
  {
    "path": "test/parse/expr/call-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func $foo (param f32)\n    f32.const 0.0\n    call $foo))\n"
  },
  {
    "path": "test/parse/expr/call.txt",
    "content": ";;; TOOL: wat2wasm\n(module \n  (func (param i32)\n  i32.const 1\n  call 0))\n"
  },
  {
    "path": "test/parse/expr/callimport-defined-later.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    f32.const 0\n    call $baz)\n  (import \"foo\" \"bar\" (func $baz (param f32))))\n(;; STDERR ;;;\nout/test/parse/expr/callimport-defined-later.txt:7:4: error: imports must occur before all non-import definitions\n  (import \"foo\" \"bar\" (func $baz (param f32))))\n   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/callimport-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"foo\" \"bar\" (func $bar (param f32)))\n  (func\n    f32.const 0\n    call $bar))\n"
  },
  {
    "path": "test/parse/expr/callimport-type.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (type (func (param i32) (result i32)))\n  (import \"foo\" \"bar\" (func (type 0)))\n  (func (param i32) (result i32)\n    i32.const 0\n    call 0))\n"
  },
  {
    "path": "test/parse/expr/callimport.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"foo\" \"bar\" (func (param i32) (result i32)))\n  (func (param i32) (result i32)\n    i32.const 0\n    call 0))\n"
  },
  {
    "path": "test/parse/expr/callindirect-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (table funcref (elem 0))\n  (type $t (func (param i32)))\n  (func $g\n    i32.const 0\n    i32.const 0\n    call_indirect (type $t)))\n"
  },
  {
    "path": "test/parse/expr/callindirect.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (table funcref (elem 0))\n  (type (func (param i32)))\n  (func\n    i32.const 0\n    i32.const 0\n    call_indirect (type 0)))\n"
  },
  {
    "path": "test/parse/expr/callref-imported-function.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n(module\n  (import \"\" \"foo\" (func $foo (param i32) (result i32)))\n  (func (export \"main\") (result i32)\n    (call_ref $t (i32.const 10)\n                 (ref.func $foo)\n    )\n  )\n  (elem declare funcref (ref.func $foo))\n  (type $t (func (param i32) (result i32)))\n)\n"
  },
  {
    "path": "test/parse/expr/callref-internal-function.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n(module\n  (func (export \"main\") (result i32)\n    (call_ref 0 (i32.const 10)\n                (ref.func $foo)\n    )\n  )\n  (func $foo (param $x i32) (result i32)\n    (i32.add (local.get $x)\n             (i32.const 19))\n  )\n\n  (elem declare funcref (ref.func $foo))\n  (type (func (param i32) (result i32)))\n)\n"
  },
  {
    "path": "test/parse/expr/cast.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 0\n    f32.reinterpret_i32\n    drop\n    f32.const 0\n    i32.reinterpret_f32 \n    drop\n    i64.const 0\n    f64.reinterpret_i64\n    drop\n    f64.const 0\n    i64.reinterpret_f64\n    drop))\n"
  },
  {
    "path": "test/parse/expr/compare.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 0\n    i32.const 0\n    i32.eq\n    drop\n    i64.const 0\n    i64.const 0\n    i64.eq\n    drop\n    f32.const 0\n    f32.const 0\n    f32.eq\n    drop\n    f64.const 0\n    f64.const 0\n    f64.eq\n    drop\n    i32.const 0\n    i32.const 0\n    i32.ne\n    drop\n    i64.const 0\n    i64.const 0\n    i64.ne\n    drop\n    f32.const 0\n    f32.const 0\n    f32.ne\n    drop\n    f64.const 0\n    f64.const 0\n    f64.ne\n    drop\n    i32.const 0\n    i32.const 0\n    i32.lt_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.lt_s\n    drop\n    i32.const 0\n    i32.const 0\n    i32.lt_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.lt_u\n    drop\n    f32.const 0\n    f32.const 0\n    f32.lt\n    drop\n    f64.const 0\n    f64.const 0\n    f64.lt\n    drop\n    i32.const 0\n    i32.const 0\n    i32.le_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.le_s\n    drop\n    i32.const 0\n    i32.const 0\n    i32.le_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.le_u\n    drop\n    f32.const 0\n    f32.const 0\n    f32.le\n    drop\n    f64.const 0\n    f64.const 0\n    f64.le\n    drop\n    i32.const 0\n    i32.const 0\n    i32.gt_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.gt_s\n    drop\n    i32.const 0\n    i32.const 0\n    i32.gt_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.gt_u\n    drop\n    f32.const 0\n    f32.const 0\n    f32.gt\n    drop\n    f64.const 0\n    f64.const 0\n    f64.gt\n    drop\n    i32.const 0\n    i32.const 0\n    i32.ge_s\n    drop\n    i64.const 0\n    i64.const 0\n    i64.ge_s\n    drop\n    i32.const 0\n    i32.const 0\n    i32.ge_u\n    drop\n    i64.const 0\n    i64.const 0\n    i64.ge_u\n    drop\n    f32.const 0\n    f32.const 0\n    f32.ge\n    drop\n    f64.const 0\n    f64.const 0\n    f64.ge\n    drop))\n"
  },
  {
    "path": "test/parse/expr/const.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 0\n    drop\n    i32.const -2147483648\n    drop\n    i32.const 4294967295\n    drop\n    i32.const -0x80000000\n    drop\n    i32.const 0xffffffff\n    drop\n    i64.const 0\n    drop\n    i64.const -9223372036854775808\n    drop\n    i64.const 18446744073709551615\n    drop\n    i64.const -0x8000000000000000\n    drop\n    i64.const 0xffffffffffffffff\n    drop\n    f32.const 0\n    drop\n    f32.const 1.e15\n    drop\n    f32.const 1e23\n    drop\n    f32.const 1.23457e-5\n    drop\n    f32.const nan\n    drop\n    f32.const -nan\n    drop\n    f32.const +nan\n    drop\n    f32.const nan:0xabc\n    drop\n    f32.const -nan:0xabc\n    drop\n    f32.const +nan:0xabc\n    drop\n    f32.const inf\n    drop\n    f32.const -inf\n    drop\n    f32.const +inf\n    drop\n    f32.const -0x1p-1\n    drop\n    f32.const 0x1.921fb6p+2\n    drop\n    f64.const 0.0\n    drop\n    f64.const 1.e300\n    drop\n    f64.const -0.987654321\n    drop\n    f64.const 6.283185307179586\n    drop\n    f64.const nan\n    drop\n    f64.const -nan\n    drop\n    f64.const +nan\n    drop\n    f64.const nan:0xabc\n    drop\n    f64.const -nan:0xabc\n    drop\n    f64.const +nan:0xabc\n    drop\n    f64.const inf\n    drop\n    f64.const -inf\n    drop\n    f64.const +inf\n    drop\n    f64.const -0x1p-1\n    drop\n    f64.const 0x1.921fb54442d18p+2\n    drop\n    v128.const i32x4 0x11223344 0x55667788 0x99aabbcc 0xddeeff00\n    drop\n    v128.const i32x4 0x11223344 1432778632 2578103244 0xddeeff00\n    drop))\n"
  },
  {
    "path": "test/parse/expr/convert-sat.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    f32.const 0\n    i32.trunc_sat_f32_s\n    drop\n\n    f32.const 0\n    i32.trunc_sat_f32_u\n    drop\n\n    f64.const 0\n    i32.trunc_sat_f64_s\n    drop\n\n    f64.const 0\n    i32.trunc_sat_f64_u\n    drop\n\n    f32.const 0\n    i64.trunc_sat_f32_s\n    drop\n\n    f32.const 0\n    i64.trunc_sat_f32_u\n    drop\n\n    f64.const 0\n    i64.trunc_sat_f64_s\n    drop\n\n    f64.const 0\n    i64.trunc_sat_f64_u\n    drop))\n"
  },
  {
    "path": "test/parse/expr/convert.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i64.const 0\n    i32.wrap_i64\n    drop\n    i32.const 0\n    i64.extend_i32_u\n    drop\n    i32.const 0\n    i64.extend_i32_s\n    drop\n    f32.const 0\n    i32.trunc_f32_s\n    drop\n    f32.const 0\n    i32.trunc_f32_u\n    drop\n    f64.const 0\n    i32.trunc_f64_s\n    drop\n    f64.const 0\n    i32.trunc_f64_u\n    drop\n    f32.const 0\n    i64.trunc_f32_s\n    drop\n    f32.const 0\n    i64.trunc_f32_u\n    drop\n    f64.const 0\n    i64.trunc_f64_s\n    drop\n    f64.const 0\n    i64.trunc_f64_u\n    drop\n    i32.const 0\n    f32.convert_i32_s\n    drop\n    i32.const 0\n    f32.convert_i32_u\n    drop\n    i64.const 0\n    f32.convert_i64_s\n    drop\n    i64.const 0\n    f32.convert_i64_u\n    drop\n    i32.const 0\n    f64.convert_i32_s\n    drop\n    i32.const 0\n    f64.convert_i32_u\n    drop\n    i64.const 0\n    f64.convert_i64_s\n    drop\n    i64.const 0\n    f64.convert_i64_u\n    drop\n    f64.const 0\n    f32.demote_f64\n    drop\n    f32.const 0\n    f64.promote_f32\n    drop))\n\n"
  },
  {
    "path": "test/parse/expr/drop.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 0\n    drop\n    i64.const 0\n    drop\n    f32.const 0\n    drop\n    f64.const 0\n    drop))\n"
  },
  {
    "path": "test/parse/expr/expr-br.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    block $exit (result i32)\n      i32.const 0\n      br 0 \n    end))\n"
  },
  {
    "path": "test/parse/expr/expr-brif.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    block $exit (result i32)\n      i32.const 0\n      i32.const 0\n      br_if 0\n      drop  \n      i32.const 1\n    end))\n"
  },
  {
    "path": "test/parse/expr/globalget-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (global $g i32 (i32.const 1))\n  (func (result i32)\n    global.get $g))\n"
  },
  {
    "path": "test/parse/expr/globalget.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (global i32 (i32.const 1))\n  (func (result i32)\n    global.get 0))\n"
  },
  {
    "path": "test/parse/expr/globalset-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (global $g (mut f32) (f32.const 1))\n  (func\n    f32.const 2\n    global.set $g))\n"
  },
  {
    "path": "test/parse/expr/globalset.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (global (mut f32) (f32.const 1))\n  (func\n    f32.const 2\n    global.set 0))\n"
  },
  {
    "path": "test/parse/expr/if-multi-named.txt",
    "content": ";;; TOOL: wat2wasm\n(type $v_v (func))\n(type $v_ii (func (param i32 i32)))\n(type $ii_v (func (result i32 i32)))\n(type $ff_ff (func (param f32 f32) (result f32 f32)))\n\n(func\n  i32.const 0\n  if (type $v_v)\n  end)\n\n(func\n  i32.const 0\n  i32.const 1\n  i32.const 2\n  if (type $v_ii)\n    drop\n    drop\n  else\n    drop\n    drop\n  end)\n\n(func\n  i32.const 0\n  if (type $ii_v)\n    i32.const 1\n    i32.const 2\n  else\n    i32.const 3\n    i32.const 4\n  end\n  drop\n  drop)\n\n(func\n  f32.const 1\n  f32.const 2\n  i32.const 0\n  if (type $ff_ff)\n  end\n  drop\n  drop)\n"
  },
  {
    "path": "test/parse/expr/if-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  ;; if w/ multiple results\n  (func\n    i32.const 0\n    if (result i32 f32 f64)\n      i32.const 0\n      f32.const 0\n      f64.const 0\n    else\n      i32.const 1\n      f32.const 1\n      f64.const 1\n    end\n    return)\n\n  ;; if w/ params\n  (func\n    i32.const 1  ;; param\n    i32.const 0  ;; cond\n    if (param i32) (result i64)\n      drop\n      i64.const 1\n    else\n      i64.extend_i32_u\n    end\n    return)\n)\n"
  },
  {
    "path": "test/parse/expr/if-return.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    i32.const 1\n    if (result i32)\n      i32.const 2\n      return\n    else\n      i32.const 3\n      return\n    end))\n"
  },
  {
    "path": "test/parse/expr/if-then-br-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 1\n    if $exit \n      br $exit\n    end))\n"
  },
  {
    "path": "test/parse/expr/if-then-br.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 1\n    if \n      br 0\n    end))\n"
  },
  {
    "path": "test/parse/expr/if-then-else-br-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    i32.const 1\n    if $exit (result i32)\n      i32.const 1\n      br $exit\n    else\n      i32.const 2 \n      br $exit\n    end))\n"
  },
  {
    "path": "test/parse/expr/if-then-else-br.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    i32.const 1\n    if (result i32)\n      i32.const 1\n      br 0\n    else\n      i32.const 1\n      br 0\n    end))\n"
  },
  {
    "path": "test/parse/expr/if-then-else-list.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 1\n    if \n      nop\n      nop\n    else \n      nop\n      nop\n    end))\n"
  },
  {
    "path": "test/parse/expr/if-then-else.txt",
    "content": ";;; TOOL: wat2wasm\n(module \n  (func\n    (i32.const 0) \n    if  \n      nop \n    else\n      nop\n    end))\n"
  },
  {
    "path": "test/parse/expr/if.txt",
    "content": ";;; TOOL: wat2wasm\n(module \n  (func \n    i32.const 1\n    if  \n      nop\n    end))\n"
  },
  {
    "path": "test/parse/expr/load-aligned.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.load align=4\n    drop\n    i32.const 0\n    i64.load align=4\n    drop\n    i32.const 0\n    i64.load8_s align=1\n    drop\n    i32.const 0\n    i64.load16_s align=2\n    drop\n    i32.const 0\n    i64.load32_s align=4\n    drop\n    i32.const 0\n    i64.load8_u align=1\n    drop\n    i32.const 0\n    i64.load16_u align=2\n    drop\n    i32.const 0\n    i64.load32_u align=4\n    drop\n    i32.const 0\n    i32.load8_s align=1\n    drop\n    i32.const 0\n    i32.load16_s align=2\n    drop\n    i32.const 0\n    i32.load8_u align=1\n    drop\n    i32.const 0\n    i32.load16_u align=2\n    drop\n    i32.const 0\n    f32.load align=2\n    drop\n    i32.const 0\n    f64.load align=8 \n    drop))\n"
  },
  {
    "path": "test/parse/expr/load-offset.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.load offset=0\n    drop\n    i32.const 0\n    i64.load offset=1\n    drop\n    i32.const 0\n    i64.load8_s offset=2\n    drop\n    i32.const 0\n    i64.load16_s offset=3\n    drop\n    i32.const 0\n    i64.load32_s offset=4\n    drop\n    i32.const 0\n    i64.load8_u offset=5\n    drop \n    i32.const 0\n    i64.load16_u offset=6\n    drop\n    i32.const 0\n    i64.load32_u offset=7\n    drop\n    i32.const 0\n    i32.load8_s offset=8\n    drop\n    i32.const 0\n    i32.load16_s offset=9\n    drop\n    i32.const 0\n    i32.load8_u offset=10\n    drop\n    i32.const 0\n    i32.load16_u offset=11\n    drop\n    i32.const 0\n    f32.load offset=12\n    drop\n    i32.const 0\n    f64.load offset=13\n    drop\n    i32.const 0\n    i32.load offset=0 align=1\n    drop\n    i32.const 0\n    i64.load offset=1 align=2\n    drop\n    i32.const 0\n    i64.load8_s offset=2 align=1\n    drop\n    i32.const 0\n    i64.load16_s offset=3 align=1\n    drop\n    i32.const 0\n    i64.load32_s offset=4 align=1\n    drop\n    i32.const 0\n    i64.load8_u offset=5 align=1\n    drop\n    i32.const 0\n    i64.load16_u offset=6 align=2\n    drop\n    i32.const 0\n    i64.load32_u offset=7 align=2\n    drop\n    i32.const 0\n    i32.load8_s offset=8 align=1\n    drop\n    i32.const 0\n    i32.load16_s offset=9 align=2\n    drop\n    i32.const 0\n    i32.load8_u offset=10 align=1\n    drop\n    i32.const 0\n    i32.load16_u offset=11 align=2\n    drop\n    i32.const 0\n    f32.load offset=12 align=4\n    drop\n    i32.const 0\n    f64.load offset=13 align=2 \n    drop))\n"
  },
  {
    "path": "test/parse/expr/load.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.load\n    drop\n    i32.const 0\n    i32.load8_s\n    drop\n    i32.const 0\n    i32.load16_s\n    drop\n    i32.const 0\n    i32.load8_u\n    drop\n    i32.const 0\n    i32.load16_u\n    drop\n    i32.const 0\n    i64.load\n    drop\n    i32.const 0\n    i64.load8_s\n    drop\n    i32.const 0\n    i64.load16_s\n    drop\n    i32.const 0\n    i64.load32_s\n    drop\n    i32.const 0\n    i64.load8_u\n    drop\n    i32.const 0\n    i64.load16_u\n    drop\n    i32.const 0\n    i64.load32_u\n    drop\n    i32.const 0\n    f32.load\n    drop\n    i32.const 0\n    f64.load\n    drop))\n"
  },
  {
    "path": "test/parse/expr/load64.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-memory64\n(module\n  (memory i64 1)\n  (func\n    i64.const 0\n    i32.load\n    drop\n    i64.const 0\n    i32.load8_s\n    drop\n    i64.const 0\n    i32.load16_s\n    drop\n    i64.const 0\n    i32.load8_u\n    drop\n    i64.const 0\n    i32.load16_u\n    drop\n    i64.const 0\n    i64.load\n    drop\n    i64.const 0\n    i64.load8_s\n    drop\n    i64.const 0\n    i64.load16_s\n    drop\n    i64.const 0\n    i64.load32_s\n    drop\n    i64.const 0\n    i64.load8_u\n    drop\n    i64.const 0\n    i64.load16_u\n    drop\n    i64.const 0\n    i64.load32_u\n    drop\n    i64.const 0\n    f32.load\n    drop\n    i64.const 0\n    f64.load\n    drop))\n"
  },
  {
    "path": "test/parse/expr/local-tee.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    (local i32)\n    i32.const 0\n    local.tee 0\n    drop))\n"
  },
  {
    "path": "test/parse/expr/localget-index-after-param.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (param i32) (local i32)\n    local.get 1\n    drop))\n"
  },
  {
    "path": "test/parse/expr/localget-index-mixed-named-unnamed.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (param i32) (param $n f32)\n    (local i32 i64)\n    (local $m f64)\n    local.get 0\n    drop\n    local.get 1\n    drop\n    local.get $n  ;; 1\n    drop\n    local.get 2\n    drop\n    local.get 3\n    drop\n    local.get $m  ;; 4\n    drop \n    local.get 4\n    drop))\n"
  },
  {
    "path": "test/parse/expr/localget-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (local $foo i32)\n    local.get $foo\n    drop))\n"
  },
  {
    "path": "test/parse/expr/localget-param-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (param $n i32)\n    local.get $n\n    drop))\n"
  },
  {
    "path": "test/parse/expr/localget-param.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (param i32)\n    local.get 0\n    drop))\n"
  },
  {
    "path": "test/parse/expr/localget.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (local i32)\n    local.get 0\n    drop))\n"
  },
  {
    "path": "test/parse/expr/localset-index-after-param.txt",
    "content": ";;; TOOL: wat2wasm\n(module \n  (func (param i32) \n    (local i32) \n    i32.const 0\n    local.set 1))\n"
  },
  {
    "path": "test/parse/expr/localset-index-mixed-named-unnamed.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (param i32) (param $n f32)\n    (local i32 i64)\n    (local $m f64)\n    i32.const 0\n    local.set 0\n    f32.const 0\n    local.set 1\n    f32.const 0\n    local.set $n ;; 1\n    i32.const 0\n    local.set 2\n    i64.const 0\n    local.set 3\n    f64.const 0\n    local.set $m ;; 4\n    f64.const 0\n    local.set 4))\n"
  },
  {
    "path": "test/parse/expr/localset-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func\n  (local $n i32)\n  i32.const 12\n  local.set $n))\n"
  },
  {
    "path": "test/parse/expr/localset-param-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module \n  (func (param $n i32) \n    i32.const 0\n    local.set $n))\n"
  },
  {
    "path": "test/parse/expr/localset-param.txt",
    "content": ";;; TOOL: wat2wasm\n(module \n  (func (param i32) \n    i32.const 0\n    local.set 0))\n"
  },
  {
    "path": "test/parse/expr/localset.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (local i32)\n  i32.const 0\n  local.set 0))\n"
  },
  {
    "path": "test/parse/expr/loop-multi-named.txt",
    "content": ";;; TOOL: wat2wasm\n(type $v_v (func))\n(type $v_ii (func (param i32 i32)))\n(type $ii_v (func (result i32 i32)))\n(type $ff_ff (func (param f32 f32) (result f32 f32)))\n\n(func\n  loop (type $v_v)\n  end)\n\n(func\n  i32.const 1\n  i32.const 2\n  loop (type $v_ii)\n    drop\n    drop\n  end)\n\n(func\n  loop (type $ii_v)\n    i32.const 1\n    i32.const 2\n  end\n  drop\n  drop)\n\n(func\n  f32.const 1\n  f32.const 2\n  loop (type $ff_ff)\n  end\n  drop\n  drop)\n"
  },
  {
    "path": "test/parse/expr/loop-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  ;; loop w/ multiple results\n  (func\n    loop (result i32 i64)\n      i32.const 0\n      i64.const 0\n    end\n    return)\n\n  ;; loop w/ params\n  (func\n    i64.const 0\n    loop (param i64) (result i32)\n      drop\n      i32.const 1\n    end\n    return)\n)\n"
  },
  {
    "path": "test/parse/expr/loop-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    loop \n      nop\n    end\n    loop $inner \n      nop\n    end))\n"
  },
  {
    "path": "test/parse/expr/loop.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    loop \n      nop\n      nop\n    end))\n"
  },
  {
    "path": "test/parse/expr/memory-copy-differing-type.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-all\n\n(;\nNote that this test covers an interaction between the memory64 and\nmulti-memory proposals.\n\nNeither proposal includes a test like this because each proposal only\nimplements itself on top of the current standard. Once one of the two proposals\nis standardized, this test should be removed in favor of a spec test in the\nproposal that is yet to be standardized.\n;)\n\n(module\n  (memory $mem64 i64 1)\n  (memory $mem32 i32 1)\n  (func\n    i32.const 0\n    i64.const 0\n    i32.const 0\n    memory.copy $mem32 $mem64\n    i64.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy $mem64 $mem32\n    i64.const 0\n    i64.const 0\n    i64.const 0\n    memory.copy $mem64 $mem64\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy $mem32 $mem32\n  )\n)\n"
  },
  {
    "path": "test/parse/expr/memory-copy.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 0)\n\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy))\n"
  },
  {
    "path": "test/parse/expr/memory-copy64.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-memory64\n(module\n  (memory i64 0)\n\n  (func\n    i64.const 0\n    i64.const 0\n    i64.const 0\n    memory.copy))\n"
  },
  {
    "path": "test/parse/expr/memory-drop.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 0)\n\n  (func\n    data.drop 0)\n\n  (data \"hi\"))\n"
  },
  {
    "path": "test/parse/expr/memory-fill.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 0)\n\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.fill))\n"
  },
  {
    "path": "test/parse/expr/memory-fill64.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-memory64\n(module\n  (memory i64 0)\n\n  (func\n    i64.const 0\n    i32.const 0\n    i64.const 0\n    memory.fill))\n"
  },
  {
    "path": "test/parse/expr/memory-grow.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n    i32.const 100\n    memory.grow\n    drop))\n"
  },
  {
    "path": "test/parse/expr/memory-grow64.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-memory64\n(module\n  (memory i64 1)\n  (func\n    i64.const 100\n    memory.grow\n    drop))\n"
  },
  {
    "path": "test/parse/expr/memory-init.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 0)\n\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.init 0)\n\n  (data \"hi\"))\n"
  },
  {
    "path": "test/parse/expr/memory-init64.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-memory64\n(module\n  (memory i64 0)\n\n  (func\n    i64.const 0\n    i32.const 0\n    i32.const 0\n    memory.init 0)\n\n  (data \"hi\"))\n"
  },
  {
    "path": "test/parse/expr/memory-size.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n    memory.size\n    drop))\n"
  },
  {
    "path": "test/parse/expr/nop.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func nop))\n"
  },
  {
    "path": "test/parse/expr/reference-types-call-indirect.txt",
    "content": ";;; TOOL: wat2wasm\n\n(module\n  (table $foo 1 funcref)\n  (table $bar 1 funcref)\n\n  (func (result i32) i32.const 0)\n  (func (result i32) i32.const 1)\n\n  (func (result i32)\n    i32.const 0\n    call_indirect $foo (type 0))\n\n  (func (result i32)\n    i32.const 0\n    call_indirect $bar (type 0))\n)\n"
  },
  {
    "path": "test/parse/expr/reference-types-named.txt",
    "content": ";;; TOOL: wat2wasm\n\n(module\n  (table $foo 1 externref)\n  (func (result externref)\n    i32.const 0\n    table.get $foo\n  )\n  (func (param externref)\n    i32.const 0\n    local.get 0\n    table.set $foo\n  )\n  (func (result i32)\n    ref.null extern\n    i32.const 0\n    table.grow $foo\n  )\n)\n\n"
  },
  {
    "path": "test/parse/expr/reference-types.txt",
    "content": ";;; TOOL: wat2wasm\n\n(module\n  (table $foo 1 externref)\n  (table $bar 1 externref)\n  (table $baz 1 funcref)\n  (elem declare func 0)\n\n  (func (result externref)\n    i32.const 0\n    table.get $foo\n  )\n  (func (result externref)\n    i32.const 0\n    table.get $bar\n  )\n\n  (func (param externref)\n    i32.const 0\n    local.get 0\n    table.set $foo\n  )\n  (func (param externref)\n    i32.const 0\n    local.get 0\n    table.set $bar\n  )\n\n  (func (result i32)\n    ref.null extern\n    i32.const 0\n    table.grow $foo\n  )\n  (func (result i32)\n    ref.null extern\n    i32.const 0\n    table.grow $bar\n  )\n\n  (func (param externref) (result i32)\n    local.get 0\n    ref.is_null\n  )\n\n  (func (result funcref)\n    ref.func 0\n  )\n\n  (func (result i32)\n    table.size $foo\n  )\n  (func (result i32)\n    table.size $bar\n  )\n  (func (result i32)\n    table.size $baz\n  )\n)\n"
  },
  {
    "path": "test/parse/expr/rethrow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e1)\n  (func\n    try\n    catch $e1\n      rethrow 0\n    end))\n"
  },
  {
    "path": "test/parse/expr/return-block.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n     block (result i32)\n       nop\n       i32.const 1\n     end\n     return))\n"
  },
  {
    "path": "test/parse/expr/return-if.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    i32.const 1\n    if (result i32)\n       i32.const 2\n    else\n       i32.const 3\n    end\n    return))\n"
  },
  {
    "path": "test/parse/expr/return-void.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func return))\n"
  },
  {
    "path": "test/parse/expr/return.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    i32.const 42\n    return))\n"
  },
  {
    "path": "test/parse/expr/select.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 2\n    i32.const 3\n    i32.const 1\n    select\n    drop\n    i64.const 2\n    i64.const 3\n    i32.const 1\n    select\n    drop\n    f32.const 2\n    f32.const 3\n    i32.const 1\n    select\n    drop\n    f64.const 2\n    f64.const 3\n    i32.const 1\n    select\n    drop))\n"
  },
  {
    "path": "test/parse/expr/simd.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    v128.const i32x4 0xff00ff01 0xff00ff0f 0xff00ffff 0xff00ff7f\n    v128.const i32x4 0x00550055 0x00550055 0x00550055 0x00550155\n    i8x16.shuffle 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n    drop\n    ))\n"
  },
  {
    "path": "test/parse/expr/store-aligned.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.const 0\n    i32.store8 align=1\n    i32.const 0\n    i32.const 0\n    i32.store16 align=2\n    i32.const 0\n    i32.const 0\n    i32.store align=4\n    i32.const 0\n    i64.const 0\n    i64.store align=8\n    i32.const 0\n    i64.const 0\n    i64.store8 align=1\n    i32.const 0\n    i64.const 0\n    i64.store16 align=2\n    i32.const 0\n    i64.const 0\n    i64.store32 align=4\n    i32.const 0\n    f32.const 0\n    f32.store align=4\n    i32.const 0\n    f64.const 0\n    f64.store align=8 ))\n"
  },
  {
    "path": "test/parse/expr/store-offset.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.const 0\n    i32.store8 offset=0\n    i32.const 0\n    i32.const 0\n    i32.store16 offset=1\n    i32.const 0\n    i32.const 0\n    i32.store offset=2\n    i32.const 0\n    i64.const 0\n    i64.store offset=3\n    i32.const 0\n    i64.const 0\n    i64.store8 offset=4\n    i32.const 0 \n    i64.const 0\n    i64.store16 offset=5\n    i32.const 0\n    i64.const 0\n    i64.store32 offset=6\n    i32.const 0\n    f32.const 0\n    f32.store offset=7\n    i32.const 0\n    f64.const 0\n    f64.store offset=8\n\n    ;; alignment must come after\n    i32.const 0\n    i32.const 0\n    i32.store8 offset=0 align=1\n    i32.const 0\n    i32.const 0\n    i32.store16 offset=1 align=2\n    i32.const 0\n    i32.const 0\n    i32.store offset=2 align=4\n    i32.const 0\n    i64.const 0\n    i64.store offset=3 align=8\n    i32.const 0\n    i64.const 0\n    i64.store8 offset=4 align=1\n    i32.const 0\n    i64.const 0\n    i64.store16 offset=5 align=1\n    i32.const 0\n    i64.const 0\n    i64.store32 offset=6 align=4\n    i32.const 0\n    f32.const 0\n    f32.store offset=7 align=2\n    i32.const 0\n    f64.const 0\n    f64.store offset=8 align=1))\n"
  },
  {
    "path": "test/parse/expr/store.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    i32.const 0\n    i32.store8\n    i32.const 0\n    i32.const 0\n    i32.store16\n    i32.const 0\n    i32.const 0\n    i32.store\n    i32.const 0\n    i64.const 0\n    i64.store\n    i32.const 0\n    i64.const 0\n    i64.store8\n    i32.const 0\n    i64.const 0\n    i64.store16\n    i32.const 0\n    i64.const 0\n    i64.store32\n    i32.const 0\n    f32.const 0\n    f32.store\n    i32.const 0\n    f64.const 0\n    f64.store))\n"
  },
  {
    "path": "test/parse/expr/store64.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-memory64\n(module\n  (memory i64 1)\n  (func\n    i64.const 0\n    i32.const 0\n    i32.store8\n    i64.const 0\n    i32.const 0\n    i32.store16\n    i64.const 0\n    i32.const 0\n    i32.store\n    i64.const 0\n    i64.const 0\n    i64.store\n    i64.const 0\n    i64.const 0\n    i64.store8\n    i64.const 0\n    i64.const 0\n    i64.store16\n    i64.const 0\n    i64.const 0\n    i64.store32\n    i64.const 0\n    f32.const 0\n    f32.store\n    i64.const 0\n    f64.const 0\n    f64.store))\n"
  },
  {
    "path": "test/parse/expr/table-copy.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 0)\n\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.copy)\n\n  (table 0 funcref))\n"
  },
  {
    "path": "test/parse/expr/table-drop.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 0)\n\n  (func\n    elem.drop 0)\n\n  (func)\n\n  (table 0 funcref)\n  (elem func 1))\n"
  },
  {
    "path": "test/parse/expr/table-get.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result externref)\n    i32.const 0\n    table.get 0)\n\n  (table 1 externref))\n"
  },
  {
    "path": "test/parse/expr/table-grow.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    ref.null extern\n    i32.const 0\n    table.grow 0)\n\n  (table 1 externref))\n"
  },
  {
    "path": "test/parse/expr/table-init.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 0)\n\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.init 0)\n\n  (func)\n\n  (table 0 funcref)\n  (elem func 1))\n"
  },
  {
    "path": "test/parse/expr/table-set.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (param externref)\n    i32.const 0\n    local.get 0\n    table.set 0)\n\n  (table 1 externref))\n"
  },
  {
    "path": "test/parse/expr/tail-call-disabled.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\n(module\n  (table 1 funcref)\n  (func return_call 0)\n  (func i32.const 0 return_call_indirect)\n)\n(;; STDERR ;;;\nout/test/parse/expr/tail-call-disabled.txt:6:9: error: opcode not allowed: return_call\n  (func return_call 0)\n        ^^^^^^^^^^^\nout/test/parse/expr/tail-call-disabled.txt:7:21: error: opcode not allowed: return_call_indirect\n  (func i32.const 0 return_call_indirect)\n                    ^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/expr/tail-call-named.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS0: --enable-tail-call\n(module\n  (type $t (func))\n  (table 1 funcref)\n  (elem (i32.const 0) 0)\n  (func $f return_call $f)\n  (func i32.const 0 return_call_indirect (type $t))\n)\n"
  },
  {
    "path": "test/parse/expr/tail-call.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS0: --enable-tail-call\n(module\n  (table 1 funcref)\n  (func return_call 0)\n  (func i32.const 0 return_call_indirect)\n)\n"
  },
  {
    "path": "test/parse/expr/throw.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e1)\n  (func throw $e1))\n"
  },
  {
    "path": "test/parse/expr/try-catch-all.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e1 (param i32))\n  (tag $e2 (param i32 i32))\n\n  ;; multiple catch clauses ending with catch_all\n  (func\n    try\n      nop\n    catch $e1\n      drop\n    catch $e2\n      drop\n      drop\n    catch_all\n    end)\n)\n"
  },
  {
    "path": "test/parse/expr/try-delegate.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag (param i32))\n\n  (func\n    try\n      try\n        nop\n      delegate 0\n      try\n        nop\n      delegate 1\n    catch 0\n      drop\n    end))\n"
  },
  {
    "path": "test/parse/expr/try-multi.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag (param i32))\n\n  ;; try w/ multiple results\n  (func\n    try (result f32 f32)\n      f32.const 0\n      f32.const 1\n    catch 0\n      drop\n      f32.const 2\n      f32.const 3\n    end\n    return)\n\n  ;; try w/ params\n  (func\n    i32.const 0\n    try (param i32) (result i32)\n      i32.eqz\n    catch 0\n      drop\n      i32.const 0\n    end\n    return)\n)\n"
  },
  {
    "path": "test/parse/expr/try-table.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e1 (param i32))\n  (tag $e2 (param i32 i32))\n\n  (func $func\n    block $a\n      block $b (result i32)\n        block $c (result i32 i32)\n          try_table (catch $e1 $b) (catch $e2 $c) (catch_all $a)\n            nop\n          end\n          i32.const 0\n          i32.const 0\n        end\n        drop\n      end\n      drop\n    end)\n)\n"
  },
  {
    "path": "test/parse/expr/try.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag (param i32))\n\n  ;; no catch\n  (func\n    try\n      nop\n    end)\n\n  ;; bare\n  (func\n    try\n      nop\n    catch 0\n      drop\n    end)\n\n  ;; with label\n  (func\n    try $foo\n      nop\n    catch 0\n      drop\n    end)\n\n  ;; with result type\n  (func\n    try (result i32)\n      i32.const 1\n    catch 0\n      drop\n      i32.const 2\n    end\n    drop))\n"
  },
  {
    "path": "test/parse/expr/unary-extend.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    i32.const 0\n    i32.extend8_s\n    drop\n\n    i32.const 0\n    i32.extend16_s\n    drop\n\n    i64.const 0\n    i64.extend8_s\n    drop\n\n    i64.const 0\n    i64.extend16_s\n    drop\n\n    i64.const 0\n    i64.extend32_s\n    drop))\n"
  },
  {
    "path": "test/parse/expr/unary.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    f32.const 0\n    f32.neg\n    drop\n    f64.const 0\n    f64.neg\n    drop\n    f32.const 0\n    f32.abs\n    drop\n    f64.const 0\n    f64.abs\n    drop\n    f32.const 0\n    f32.sqrt\n    drop\n    f64.const 0\n    f64.sqrt\n    drop\n    i32.const 0\n    i32.eqz\n    drop\n    i64.const 0\n    i64.eqz\n    drop\n    i32.const 0\n    i32.clz\n    drop\n    i64.const 0\n    i64.clz\n    drop\n    i32.const 0\n    i32.ctz\n    drop\n    i64.const 0\n    i64.ctz\n    drop\n    i32.const 0\n    i32.popcnt\n    drop\n    i64.const 0\n    i64.popcnt\n    drop\n    f32.const 0\n    f32.ceil\n    drop\n    f64.const 0\n    f64.ceil\n    drop\n    f32.const 0\n    f32.floor\n    drop\n    f64.const 0\n    f64.floor\n    drop\n    f32.const 0\n    f32.trunc\n    drop\n    f64.const 0\n    f64.trunc\n    drop\n    f32.const 0\n    f32.nearest\n    drop\n    f64.const 0\n    f64.nearest\n    drop))\n"
  },
  {
    "path": "test/parse/expr/unreachable.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func unreachable))\n"
  },
  {
    "path": "test/parse/force-color.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ENV: FORCE_COLOR=1\n;;; ERROR: 1\n(module\n  (func badname (param i32) (result badtype)\n    drop))\n(;; STDERR ;;;\n\u001b[1mout/test/parse/force-color.txt:5:9: \u001b[31merror: \u001b[0munexpected token badname, expected ).\n  (func badname (param i32) (result badtype)\n        \u001b[1m\u001b[32m^^^^^^^\u001b[0m\n\u001b[1mout/test/parse/force-color.txt:5:37: \u001b[31merror: \u001b[0munexpected token badtype.\n  (func badname (param i32) (result badtype)\n                                    \u001b[1m\u001b[32m^^^^^^^\u001b[0m\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-func-name.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func foo))\n(;; STDERR ;;;\nout/test/parse/func/bad-func-name.txt:4:9: error: unexpected token foo, expected ).\n  (func foo))\n        ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-local-binding-no-type.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (local $n)))\n(;; STDERR ;;;\nout/test/parse/func/bad-local-binding-no-type.txt:3:24: error: unexpected token \")\", expected i32, i64, f32, f64, v128, externref, exnref or funcref.\n(module (func (local $n)))\n                       ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-local-binding.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (local $foo $bar)))\n(;; STDERR ;;;\nout/test/parse/func/bad-local-binding.txt:3:27: error: unexpected token \"$bar\", expected i32, i64, f32, f64, v128, externref, exnref or funcref.\n(module (func (local $foo $bar)))\n                          ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-local-name.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (local 0 i32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-local-name.txt:3:22: error: unexpected token 0, expected ).\n(module (func (local 0 i32)))\n                     ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-local-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (param $n i32) (local $n f32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-local-redefinition.txt:3:37: error: redefinition of parameter \"$n\"\n(module (func (param $n i32) (local $n f32)))\n                                    ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-local-type-list.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (local i32 i64 foo f32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-local-type-list.txt:3:30: error: unexpected token foo, expected ).\n(module (func (local i32 i64 foo f32)))\n                             ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-local-type.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (local foo)))\n(;; STDERR ;;;\nout/test/parse/func/bad-local-type.txt:3:22: error: unexpected token foo, expected ).\n(module (func (local foo)))\n                     ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-param-binding.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (param $bar $baz)))\n(;; STDERR ;;;\nout/test/parse/func/bad-param-binding.txt:3:27: error: unexpected token \"$baz\", expected i32, i64, f32, f64, v128, externref, exnref or funcref.\n(module (func (param $bar $baz)))\n                          ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-param-name.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (param 0 i32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-param-name.txt:3:22: error: unexpected token 0, expected ).\n(module (func (param 0 i32)))\n                     ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-param-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (param $n i32) (param $n f32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-param-redefinition.txt:3:37: error: redefinition of parameter \"$n\"\n(module (func (param $n i32) (param $n f32)))\n                                    ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-param-type-list.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (param i32 i64 foo f32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-param-type-list.txt:3:30: error: unexpected token foo, expected ).\n(module (func (param i32 i64 foo f32)))\n                             ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-param.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (param foo)))\n(;; STDERR ;;;\nout/test/parse/func/bad-param.txt:3:22: error: unexpected token foo, expected ).\n(module (func (param foo)))\n                     ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-result-type.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (result foo)))\n(;; STDERR ;;;\nout/test/parse/func/bad-result-type.txt:3:23: error: unexpected token foo, expected ).\n(module (func (result foo)))\n                      ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-sig-param-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $t (func (param i32 f32)))\n  (func (type $t) (param f32 f32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-sig-param-type-mismatch.txt:5:4: error: type mismatch for argument 0 of function. got f32, expected i32\n  (func (type $t) (param f32 f32)))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-sig-params-empty.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $t (func))\n  (func (type $t) (param i32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-sig-params-empty.txt:5:4: error: expected 0 arguments, got 1\n  (func (type $t) (param i32)))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-sig-result-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $t (func (param i32) (result f32)))\n  (func (type $t) (param i32) (result i64)))\n(;; STDERR ;;;\nout/test/parse/func/bad-sig-result-type-mismatch.txt:5:4: error: type mismatch for result 0 of function. got i64, expected f32\n  (func (type $t) (param i32) (result i64)))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-sig-result-type-not-void.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $t (func (param i32)))\n  (func (type $t) (param i32) (result f32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-sig-result-type-not-void.txt:5:4: error: expected 0 results, got 1\n  (func (type $t) (param i32) (result f32)))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-sig-result-type-void.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $t (func (param i32) (result f32)))\n  (func (type $t) (param i32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-sig-result-type-void.txt:5:4: error: expected 1 results, got 0\n  (func (type $t) (param i32)))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-sig-too-few-params.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $t (func (param i32 f32)))\n  (func (type $t) (param i32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-sig-too-few-params.txt:5:4: error: expected 2 arguments, got 1\n  (func (type $t) (param i32)))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/bad-sig-too-many-params.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $t (func (param i32)))\n  (func (type $t) (param i32 i32)))\n(;; STDERR ;;;\nout/test/parse/func/bad-sig-too-many-params.txt:5:4: error: expected 1 arguments, got 2\n  (func (type $t) (param i32 i32)))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/func/func-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func $foo))\n"
  },
  {
    "path": "test/parse/func/local-empty.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (local)))\n"
  },
  {
    "path": "test/parse/func/local-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (local i32) (local $n i64)))\n"
  },
  {
    "path": "test/parse/func/local.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (local i32)))\n"
  },
  {
    "path": "test/parse/func/no-space.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func $foomore\n    i32.const 0x0\n    call $foo)\n  (func $foo (param i32) nop)\n)\n"
  },
  {
    "path": "test/parse/func/param-binding.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (param $foo i32)))\n"
  },
  {
    "path": "test/parse/func/param-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (param i32) (param $n f64)))\n"
  },
  {
    "path": "test/parse/func/param-type-1.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (param i32)))\n"
  },
  {
    "path": "test/parse/func/param-type-2.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (param i32 f32)))\n"
  },
  {
    "path": "test/parse/func/result-empty.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (result)))\n"
  },
  {
    "path": "test/parse/func/result-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32 i32)\n    i32.const 0\n    i32.const 1))\n"
  },
  {
    "path": "test/parse/func/result.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func (result i32) i32.const 0))\n"
  },
  {
    "path": "test/parse/func/sig-match.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (type $empty (func))\n  (type $i_v (func (param i32)))\n  (type $f_i (func (param f32) (result i32)))\n  (type $ii_i (func (param i32 i32) (result i32)))\n  (type $v_f (func (result f32)))\n\n  (func (type $empty))\n  (func (type $i_v) (param i32))\n  (func (type $f_i) (param f32) (result i32) i32.const 0)\n  (func (type $ii_i) (param i32 i32) (result i32) i32.const 0)\n  (func (type $v_f) (result f32) f32.const 0))\n"
  },
  {
    "path": "test/parse/func/sig.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (type $t (func (param i32) (result i32)))\n  (func (type $t) (i32.const 0)))\n"
  },
  {
    "path": "test/parse/identifiers-with-annotations.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-annotations\n(module\n  (func $abc)\n  (func $\"hi\\6a\")\n  (func $\"xyz\")\n\n  (func\n    call $\"abc\"\n    call $\"\\61bc\"\n    call $\"ab\\u{63}\"\n\n    call $hij\n    call $\"hij\"\n    call $\"\\u{68}ij\"\n\n    call $xyz\n    call $\"\\u{78}yz\"\n    call $\"xy\\7a\"\n  )\n)\n"
  },
  {
    "path": "test/parse/line-comment.txt",
    "content": ";;; TOOL: wat2wasm\n;; here is a comment\n(module)\n;; here is another\n"
  },
  {
    "path": "test/parse/module/array-mut-field.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n(type (array (mut f32)))\n"
  },
  {
    "path": "test/parse/module/array.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n(type (array i32))\n"
  },
  {
    "path": "test/parse/module/bad-array-no-fields.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n;;; ERROR: 1\n(type (array))\n(;; STDERR ;;;\nout/test/parse/module/bad-array-no-fields.txt:4:13: error: unexpected token \")\", expected i32, i64, f32, f64, v128, externref, exnref or funcref.\n(type (array))\n            ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-array-too-many-fields.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n;;; ERROR: 1\n(type (array i32 i32))\n(;; STDERR ;;;\nout/test/parse/module/bad-array-too-many-fields.txt:4:18: error: unexpected token i32, expected ).\n(type (array i32 i32))\n                 ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-binary-module-magic.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module binary\n  \"\\00ASM\"\n  \"\\0b\\00\\00\\00\")\n(;; STDERR ;;;\nout/test/parse/module/bad-binary-module-magic.txt:3:2: error: error in binary module: @0x00000004: bad magic value\n(module binary\n ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-elem-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (elem $elem funcref 0)\n  (elem $elem funcref 0)\n  (func))\n\n(;; STDERR ;;;\nout/test/parse/module/bad-elem-redefinition.txt:4:23: error: unexpected token 0, expected ).\n  (elem $elem funcref 0)\n                      ^\nout/test/parse/module/bad-elem-redefinition.txt:5:23: error: unexpected token 0, expected ).\n  (elem $elem funcref 0)\n                      ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-element-followed-by-illegal-expression.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n;;; ERROR: 1\n( elem f64 ( ) ) \n(;; STDERR ;;;\nout/test/parse/module/bad-element-followed-by-illegal-expression.txt:4:8: error: value type not allowed: f64\n( elem f64 ( ) ) \n       ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-func-empty.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-func-empty.txt:3:16: error: unexpected token \")\", expected a quoted string (e.g. \"foo\").\n(module (export))\n               ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-func-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export \"foo\" (func $foo)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-func-name-undefined.txt:3:29: error: undefined function variable \"$foo\"\n(module (export \"foo\" (func $foo)))\n                            ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-func-name.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export \"foo\" (func foo)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-func-name.txt:3:29: error: unexpected token \"foo\", expected a numeric index or a name (e.g. 12 or $foo).\n(module (export \"foo\" (func foo)))\n                            ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-func-no-string.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func nop) (export nop nop))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-func-no-string.txt:3:28: error: unexpected token \"nop\", expected a quoted string (e.g. \"foo\").\n(module (func nop) (export nop nop))\n                           ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-func-too-many.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func nop) (export \"nop\" (func 0 foo)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-func-too-many.txt:3:42: error: unexpected token foo, expected ).\n(module (func nop) (export \"nop\" (func 0 foo)))\n                                         ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-func-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export \"foo\" (func 0)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-func-undefined.txt:3:29: error: function variable out of range: 0 (max 0)\n(module (export \"foo\" (func 0)))\n                            ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-global-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export \"foo\" (global $bar)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-global-name-undefined.txt:3:31: error: undefined global variable \"$bar\"\n(module (export \"foo\" (global $bar)))\n                              ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-global-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export \"foo\" (global 0)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-global-undefined.txt:3:31: error: global variable out of range: 0 (max 0)\n(module (export \"foo\" (global 0)))\n                              ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-memory-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export \"foo\" (memory $bar)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-memory-name-undefined.txt:3:31: error: undefined memory variable \"$bar\"\n(module (export \"foo\" (memory $bar)))\n                              ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-memory-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (export \"mem\" (memory 0)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-memory-undefined.txt:4:25: error: memory variable out of range: 0 (max 0)\n  (export \"mem\" (memory 0)))\n                        ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-table-name-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export \"foo\" (table $bar)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-table-name-undefined.txt:3:30: error: undefined table variable \"$bar\"\n(module (export \"foo\" (table $bar)))\n                             ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-export-table-undefined.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (export \"foo\" (table 0)))\n(;; STDERR ;;;\nout/test/parse/module/bad-export-table-undefined.txt:3:30: error: table variable out of range: 0 (max 0)\n(module (export \"foo\" (table 0)))\n                             ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-func-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func $n nop)\n  (func $n nop))\n(;; STDERR ;;;\nout/test/parse/module/bad-func-redefinition.txt:5:4: error: redefinition of function \"$n\"\n  (func $n nop))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-global-invalid-expr.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (global i32 \n    i32.const 1\n    i32.const 2\n    i32.add))\n(;; STDERR ;;;\nout/test/parse/module/bad-global-invalid-expr.txt:7:5: error: invalid initializer: instruction not valid in initializer expression: i32.add\n    i32.add))\n    ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-global-invalid-globalget.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (global i32 (global.get 1)))\n(;; STDERR ;;;\nout/test/parse/module/bad-global-invalid-globalget.txt:4:27: error: global variable out of range: 1 (max 1)\n  (global i32 (global.get 1)))\n                          ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-import-func-not-param.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (import \"foo\" \"bar\" (func (parump i32))))\n(;; STDERR ;;;\nout/test/parse/module/bad-import-func-not-param.txt:3:36: error: unexpected token \"parump\", expected param or result.\n(module (import \"foo\" \"bar\" (func (parump i32))))\n                                   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-import-func-not-result.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (import \"foo\" \"bar\" (func (param i32) (resalt i32))))\n(;; STDERR ;;;\nout/test/parse/module/bad-import-func-not-result.txt:3:48: error: unexpected token \"resalt\", expected param or result.\n(module (import \"foo\" \"bar\" (func (param i32) (resalt i32))))\n                                               ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-import-func-one-string.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (import \"foo\" (param i32)))\n(;; STDERR ;;;\nout/test/parse/module/bad-import-func-one-string.txt:3:23: error: unexpected token \"(\", expected a quoted string (e.g. \"foo\").\n(module (import \"foo\" (param i32)))\n                      ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-import-func-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (import \"bar\" \"baz\" (func $foo (param i32)))\n  (import \"quux\" \"blorf\" (func $foo (param f32))))\n(;; STDERR ;;;\nout/test/parse/module/bad-import-func-redefinition.txt:5:4: error: redefinition of function \"$foo\"\n  (import \"quux\" \"blorf\" (func $foo (param f32))))\n   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-import-global-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (import \"foo\" \"bar\" (global $baz i32))\n  (import \"oof\" \"rab\" (global $baz i32)))\n(;; STDERR ;;;\nout/test/parse/module/bad-import-global-redefinition.txt:5:4: error: redefinition of global \"$baz\"\n  (import \"oof\" \"rab\" (global $baz i32)))\n   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-import-memory-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (import \"foo\" \"bar\" (memory $baz 0))\n  (import \"foo\" \"blah\" (memory $baz 0)))\n(;; STDERR ;;;\nout/test/parse/module/bad-import-memory-redefinition.txt:5:4: error: redefinition of memory \"$baz\"\n  (import \"foo\" \"blah\" (memory $baz 0)))\n   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-import-table-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (import \"foo\" \"bar\" (table $baz 0 funcref))\n  (import \"foo\" \"blah\" (table $baz 0 funcref)))\n(;; STDERR ;;;\nout/test/parse/module/bad-import-table-redefinition.txt:5:4: error: redefinition of table \"$baz\"\n  (import \"foo\" \"blah\" (table $baz 0 funcref)))\n   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-import-table-shared.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (import \"foo\" \"bar\" (table 0 3 shared funcref))\n)\n(;; STDERR ;;;\nout/test/parse/module/bad-import-table-shared.txt:4:4: error: tables may not be shared\n  (import \"foo\" \"bar\" (table 0 3 shared funcref))\n   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-empty.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-empty.txt:3:16: error: unexpected token \")\", expected a natural number (e.g. 123).\n(module (memory))\n               ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-init-size-negative.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory -100))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-init-size-negative.txt:3:17: error: unexpected token \"-100\", expected a natural number (e.g. 123).\n(module (memory -100))\n                ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-init-size-too-big.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory 65537))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-init-size-too-big.txt:3:10: error: initial pages (65537) must be <= (65536)\n(module (memory 65537))\n         ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-init-size.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory foo))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-init-size.txt:3:17: error: unexpected token \"foo\", expected a natural number (e.g. 123).\n(module (memory foo))\n                ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-max-less-than-init.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory 2 1))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-max-less-than-init.txt:3:10: error: max pages (1) must be >= initial pages (2)\n(module (memory 2 1))\n         ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-max-size-negative.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory 100 -5))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-max-size-negative.txt:3:21: error: unexpected token -5, expected ).\n(module (memory 100 -5))\n                    ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-max-size-too-big.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory 0 65537))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-max-size-too-big.txt:3:10: error: max pages (65537) must be <= (65536)\n(module (memory 0 65537))\n         ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-max-size.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory 100 foo))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-max-size.txt:3:21: error: unexpected token foo, expected ).\n(module (memory 100 foo))\n                    ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-segment-address.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (memory 100)\n  (data foo))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-segment-address.txt:5:9: error: unexpected token foo, expected ).\n  (data foo))\n        ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-shared-nomax.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-threads\n;;; ERROR: 1\n(module (memory 1 shared))\n\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-shared-nomax.txt:4:10: error: shared memories must have max sizes\n(module (memory 1 shared))\n         ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-memory-too-many.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (memory 1)\n  (memory 2))\n(;; STDERR ;;;\nout/test/parse/module/bad-memory-too-many.txt:5:4: error: only one memory block allowed\n  (memory 2))\n   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-module-multi.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func))\n\n;; Can't have two modules in a .wat file.\n(module)\n(;; STDERR ;;;\nout/test/parse/module/bad-module-multi.txt:6:1: error: unexpected token (, expected EOF.\n(module)\n^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-module-no-close.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n(;; STDERR ;;;\nout/test/parse/module/bad-module-no-close.txt:4:1: error: unexpected token \"EOF\", expected a module field.\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-module-with-assert.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (func (export \"f\")))\n\n;; Can't use assert_return when parsing a .wat file.\n(assert_return (invoke \"f\"))\n(;; STDERR ;;;\nout/test/parse/module/bad-module-with-assert.txt:6:1: error: unexpected token (, expected EOF.\n(assert_return (invoke \"f\"))\n^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-start-not-nullary.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (start 0)\n  (func (param i32)))\n(;; STDERR ;;;\nout/test/parse/module/bad-start-not-nullary.txt:4:4: error: start function must be nullary\n  (start 0)\n   ^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-start-not-void.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (start 0)\n  (func (result i32)\n    i32.const 0))\n(;; STDERR ;;;\nout/test/parse/module/bad-start-not-void.txt:4:4: error: start function must not return anything\n  (start 0)\n   ^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-start-too-many.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (start 0)\n  (start 1)\n  (func)\n  (func))\n(;; STDERR ;;;\nout/test/parse/module/bad-start-too-many.txt:5:4: error: multiple start sections\n  (start 1)\n   ^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-table-elem.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (table funcref (elem garbage)))\n(;; STDERR ;;;\nout/test/parse/module/bad-table-elem.txt:4:24: error: unexpected token garbage, expected ).\n  (table funcref (elem garbage)))\n                       ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-table-invalid-function.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (table 1 funcref)\n  (func $f)\n  (elem (i32.const 0) $f 1))\n(;; STDERR ;;;\nout/test/parse/module/bad-table-invalid-function.txt:6:26: error: function variable out of range: 1 (max 1)\n  (elem (i32.const 0) $f 1))\n                         ^\n0:0: error: type mismatch in initializer expression, expected [funcref] but got []\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-table-no-offset.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --disable-reference-types --disable-bulk-memory\n;;; ERROR: 1\n(module\n  (table 1 funcref)\n  (func)\n  (elem 0))\n(;; STDERR ;;;\nout/test/parse/module/bad-table-no-offset.txt:7:10: error: unexpected token \")\", expected an offset expr (e.g. (i32.const 123)).\n  (elem 0))\n         ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/bad-table-too-many.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --disable-reference-types\n;;; ERROR: 1\n(module\n  (func (param i32))\n  (table funcref (elem 0))\n  (table funcref (elem 0)))\n(;; STDERR ;;;\nout/test/parse/module/bad-table-too-many.txt:7:4: error: only one table allowed\n  (table funcref (elem 0)))\n   ^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/binary-module.txt",
    "content": ";;; TOOL: wat2wasm\n(module binary\n  \"\\00asm\"            ;; magic\n  \"\\01\\00\\00\\00\"      ;; version\n  \"\\01\\05\"            ;; type section, 5 bytes\n  \"\\01\\60\\00\\01\\7f\"   ;; 1 type, function, no params, i32 result\n  \"\\03\\02\"            ;; function section, 2 bytes\n  \"\\01\\00\"            ;; 1 function, type 0\n  \"\\07\\08\"            ;; export section, 8 bytes\n  \"\\01\\04main\\00\\00\"  ;; 1 export, function 0, named \"main\"\n  \"\\0a\\08\"            ;; code section, 8 bytes\n  \"\\01\\06\"            ;; 1 function, 6 bytes\n  \"\\00\"               ;; 0 locals\n  \"\\41\"               ;; i32.const\n  \"\\dc\\7c\"            ;; -420\n  \"\\0f\"               ;; return\n  \"\\0b\"               ;; end (of function)\n)\n"
  },
  {
    "path": "test/parse/module/data-offset.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"foo\" \"bar\" (global i32))\n  (memory 1)\n  (global i32 i32.const 1)\n  (data (global.get 0) \"hi\"))\n"
  },
  {
    "path": "test/parse/module/elem-offset.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"foo\" \"bar\" (global i32))\n  (global i32 i32.const 1)\n  (func)\n  (table 2 funcref)\n  (elem (global.get 0) 0))\n"
  },
  {
    "path": "test/parse/module/export-func-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (nop))\n  (export \"a\" (func 0))\n  (export \"b\" (func 0)))\n"
  },
  {
    "path": "test/parse/module/export-func-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func $n (result i32) (i32.const 0))\n  (export \"n\" (func $n)))\n"
  },
  {
    "path": "test/parse/module/export-func.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (nop))\n  (export \"nop\" (func 0)))\n"
  },
  {
    "path": "test/parse/module/export-global.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (global i32 (i32.const 0))\n  (global (mut f32) (f32.const 0))\n  (export \"global0\" (global 0)))\n"
  },
  {
    "path": "test/parse/module/export-memory-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (export \"mem1\" (memory 0))\n  (export \"mem2\" (memory 0)))\n"
  },
  {
    "path": "test/parse/module/export-memory.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (export \"mem\" (memory 0)))\n"
  },
  {
    "path": "test/parse/module/export-table.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (table 0 funcref)\n  (export \"my_table\" (table 0)))\n"
  },
  {
    "path": "test/parse/module/export-tag.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag (param i32 i32))\n  (export \"my_tag\" (tag 0))\n  (tag (export \"my_tag_2\") (param i32)))\n"
  },
  {
    "path": "test/parse/module/global.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"foo\" \"i32_global\" (global i32))\n  (import \"foo\" \"i64_global\" (global i64))\n  (import \"foo\" \"f32_global\" (global f32))\n  (import \"foo\" \"f64_global\" (global f64))\n  (table 10 funcref)\n  (elem declare func $foo)\n\n  (global i32 (i32.const 1))\n  (global i64 (i64.const 2))\n  (global f32 (f32.const 3))\n  (global f64 (f64.const 4))\n\n  (global i32 (global.get 0))\n  (global i64 (global.get 1))\n  (global f32 (global.get 2))\n  (global f64 (global.get 3))\n\n  (func $foo)\n  (global externref (ref.null extern))\n  (global funcref (ref.func $foo)))\n"
  },
  {
    "path": "test/parse/module/import-func-no-param.txt",
    "content": ";;; TOOL: wat2wasm\n(module (import \"foo\" \"bar\" (func)))\n"
  },
  {
    "path": "test/parse/module/import-func-type.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (type (func (param i32 i64 f32 f64) (result i32)))\n  (import \"foo\" \"bar\" (func (type 0))))\n"
  },
  {
    "path": "test/parse/module/import-func.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (type $add_type (func (param i32 i32) (result i32)))\n\n  ;; unnamed\n  (import \"foo\" \"bar\" (func (param i32) (result i64)))\n\n  ;; named\n  (import \"stdio\" \"print\" (func $print_i32 (param i32)))\n  (import \"math\" \"add\" (func $add_i32 (param i32 i32) (result i32)))\n  (import \"test\" \"f32\" (func $f32 (param f32) (result f32)))\n  (import \"test\" \"f64\" (func $f64 (param f64) (result f64)))\n  (import \"test\" \"i64\" (func $i64 (param i64) (result i64)))\n\n  ;; named type\n  (import \"math\" \"add\" (func $add_i32_2 (type $add_type)))\n\n  ;; named type, with repetition of type inline\n  (import \"math\" \"add\" (func $add_i32_3 (type $add_type) (param i32 i32) (result i32)))\n)\n"
  },
  {
    "path": "test/parse/module/import-global-globalget.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"a\" \"global\" (global i32))\n  (global i32 (global.get 0)))\n"
  },
  {
    "path": "test/parse/module/import-global.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"foo\" \"1\" (global i32))\n  (import \"foo\" \"2\" (global i64))\n  (import \"foo\" \"3\" (global f32))\n  (import \"foo\" \"4\" (global f64)))\n"
  },
  {
    "path": "test/parse/module/import-memory-shared.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-threads\n(module\n  (import \"foo\" \"2\" (memory 0 2 shared)))\n"
  },
  {
    "path": "test/parse/module/import-memory.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"foo\" \"2\" (memory 0 2)))\n"
  },
  {
    "path": "test/parse/module/import-mutable-global.txt",
    "content": ";;; TOOL: wat2wasm\n(module (import \"mod\" \"field\" (global (mut f32))))\n"
  },
  {
    "path": "test/parse/module/import-table.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (import \"foo\" \"2\" (table 0 10 funcref)))\n"
  },
  {
    "path": "test/parse/module/import-tag.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (import \"foo\" \"1\" (tag (param f64 f32)))\n  (tag $t2 (import \"foo\" \"2\") (param i32 i64)))\n"
  },
  {
    "path": "test/parse/module/memory-init-max-size.txt",
    "content": ";;; TOOL: wat2wasm\n(module (memory 1 2))\n"
  },
  {
    "path": "test/parse/module/memory-init-size.txt",
    "content": ";;; TOOL: wat2wasm\n(module (memory 1))\n"
  },
  {
    "path": "test/parse/module/memory-segment-1.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory (data \"hello, world!\")))\n"
  },
  {
    "path": "test/parse/module/memory-segment-long.txt",
    "content": ";;; TOOL: wat2wasm\n;; This is a regression test to ensure we read and parse integer tokens ASAP.\n;; Otherwise the memory that is used to store them may be reused. In this case,\n;; the very long data segment strings were causing the strings that store the\n;; initial size and max size to be clobbered.\n(module\n  (memory 1 65535)\n  (data (i32.const 8) \"\\10\\01\\00\\00\")\n  (data (i32.const 16) \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\03 \\02 \\02 \\02 \\02 \\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\02\\00\\01`\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\08\\d8\\08\\d8\\08\\d8\\08\\d8\\08\\d8\\08\\d8\\08\\d8\\08\\d8\\08\\d8\\08\\d8\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\08\\d5\\08\\d5\\08\\d5\\08\\d5\\08\\d5\\08\\d5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\08\\c5\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\08\\d6\\08\\d6\\08\\d6\\08\\d6\\08\\d6\\08\\d6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\08\\c6\\04\\c0\\04\\c0\\04\\c0\\04\\c0\\02\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\")\n  (data (i32.const 784) \" \\05\\00\\00\")\n  (data (i32.const 800) \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\01\\00\\00\\00\\02\\00\\00\\00\\03\\00\\00\\00\\04\\00\\00\\00\\05\\00\\00\\00\\06\\00\\00\\00\\07\\00\\00\\00\\08\\00\\00\\00\\t\\00\\00\\00\\n\\00\\00\\00\\0b\\00\\00\\00\\0c\\00\\00\\00\\0d\\00\\00\\00\\0e\\00\\00\\00\\0f\\00\\00\\00\\10\\00\\00\\00\\11\\00\\00\\00\\12\\00\\00\\00\\13\\00\\00\\00\\14\\00\\00\\00\\15\\00\\00\\00\\16\\00\\00\\00\\17\\00\\00\\00\\18\\00\\00\\00\\19\\00\\00\\00\\1a\\00\\00\\00\\1b\\00\\00\\00\\1c\\00\\00\\00\\1d\\00\\00\\00\\1e\\00\\00\\00\\1f\\00\\00\\00 \\00\\00\\00!\\00\\00\\00\\\"\\00\\00\\00#\\00\\00\\00$\\00\\00\\00%\\00\\00\\00&\\00\\00\\00\\'\\00\\00\\00(\\00\\00\\00)\\00\\00\\00*\\00\\00\\00+\\00\\00\\00,\\00\\00\\00-\\00\\00\\00.\\00\\00\\00/\\00\\00\\000\\00\\00\\001\\00\\00\\002\\00\\00\\003\\00\\00\\004\\00\\00\\005\\00\\00\\006\\00\\00\\007\\00\\00\\008\\00\\00\\009\\00\\00\\00:\\00\\00\\00;\\00\\00\\00<\\00\\00\\00=\\00\\00\\00>\\00\\00\\00?\\00\\00\\00@\\00\\00\\00a\\00\\00\\00b\\00\\00\\00c\\00\\00\\00d\\00\\00\\00e\\00\\00\\00f\\00\\00\\00g\\00\\00\\00h\\00\\00\\00i\\00\\00\\00j\\00\\00\\00k\\00\\00\\00l\\00\\00\\00m\\00\\00\\00n\\00\\00\\00o\\00\\00\\00p\\00\\00\\00q\\00\\00\\00r\\00\\00\\00s\\00\\00\\00t\\00\\00\\00u\\00\\00\\00v\\00\\00\\00w\\00\\00\\00x\\00\\00\\00y\\00\\00\\00z\\00\\00\\00[\\00\\00\\00\\\\\\00\\00\\00]\\00\\00\\00^\\00\\00\\00_\\00\\00\\00`\\00\\00\\00a\\00\\00\\00b\\00\\00\\00c\\00\\00\\00d\\00\\00\\00e\\00\\00\\00f\\00\\00\\00g\\00\\00\\00h\\00\\00\\00i\\00\\00\\00j\\00\\00\\00k\\00\\00\\00l\\00\\00\\00m\\00\\00\\00n\\00\\00\\00o\\00\\00\\00p\\00\\00\\00q\\00\\00\\00r\\00\\00\\00s\\00\\00\\00t\\00\\00\\00u\\00\\00\\00v\\00\\00\\00w\\00\\00\\00x\\00\\00\\00y\\00\\00\\00z\\00\\00\\00{\\00\\00\\00|\\00\\00\\00}\\00\\00\\00~\\00\\00\\00\\7f\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\")\n  (data (i32.const 2336) \"0\\0b\\00\\00\")\n  (data (i32.const 2352) \"\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\01\\00\\00\\00\\02\\00\\00\\00\\03\\00\\00\\00\\04\\00\\00\\00\\05\\00\\00\\00\\06\\00\\00\\00\\07\\00\\00\\00\\08\\00\\00\\00\\t\\00\\00\\00\\n\\00\\00\\00\\0b\\00\\00\\00\\0c\\00\\00\\00\\0d\\00\\00\\00\\0e\\00\\00\\00\\0f\\00\\00\\00\\10\\00\\00\\00\\11\\00\\00\\00\\12\\00\\00\\00\\13\\00\\00\\00\\14\\00\\00\\00\\15\\00\\00\\00\\16\\00\\00\\00\\17\\00\\00\\00\\18\\00\\00\\00\\19\\00\\00\\00\\1a\\00\\00\\00\\1b\\00\\00\\00\\1c\\00\\00\\00\\1d\\00\\00\\00\\1e\\00\\00\\00\\1f\\00\\00\\00 \\00\\00\\00!\\00\\00\\00\\\"\\00\\00\\00#\\00\\00\\00$\\00\\00\\00%\\00\\00\\00&\\00\\00\\00\\'\\00\\00\\00(\\00\\00\\00)\\00\\00\\00*\\00\\00\\00+\\00\\00\\00,\\00\\00\\00-\\00\\00\\00.\\00\\00\\00/\\00\\00\\000\\00\\00\\001\\00\\00\\002\\00\\00\\003\\00\\00\\004\\00\\00\\005\\00\\00\\006\\00\\00\\007\\00\\00\\008\\00\\00\\009\\00\\00\\00:\\00\\00\\00;\\00\\00\\00<\\00\\00\\00=\\00\\00\\00>\\00\\00\\00?\\00\\00\\00@\\00\\00\\00A\\00\\00\\00B\\00\\00\\00C\\00\\00\\00D\\00\\00\\00E\\00\\00\\00F\\00\\00\\00G\\00\\00\\00H\\00\\00\\00I\\00\\00\\00J\\00\\00\\00K\\00\\00\\00L\\00\\00\\00M\\00\\00\\00N\\00\\00\\00O\\00\\00\\00P\\00\\00\\00Q\\00\\00\\00R\\00\\00\\00S\\00\\00\\00T\\00\\00\\00U\\00\\00\\00V\\00\\00\\00W\\00\\00\\00X\\00\\00\\00Y\\00\\00\\00Z\\00\\00\\00[\\00\\00\\00\\\\\\00\\00\\00]\\00\\00\\00^\\00\\00\\00_\\00\\00\\00`\\00\\00\\00A\\00\\00\\00B\\00\\00\\00C\\00\\00\\00D\\00\\00\\00E\\00\\00\\00F\\00\\00\\00G\\00\\00\\00H\\00\\00\\00I\\00\\00\\00J\\00\\00\\00K\\00\\00\\00L\\00\\00\\00M\\00\\00\\00N\\00\\00\\00O\\00\\00\\00P\\00\\00\\00Q\\00\\00\\00R\\00\\00\\00S\\00\\00\\00T\\00\\00\\00U\\00\\00\\00V\\00\\00\\00W\\00\\00\\00X\\00\\00\\00Y\\00\\00\\00Z\\00\\00\\00{\\00\\00\\00|\\00\\00\\00}\\00\\00\\00~\\00\\00\\00\\7f\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\\00\")\n)\n"
  },
  {
    "path": "test/parse/module/memory-segment-many.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (data (i32.const 0) \"hi\")\n  (data (i32.const 4) \"hello\")\n  (data (i32.const 10) \"goodbye\")\n  (data (i32.const 20) \"adios\"))\n"
  },
  {
    "path": "test/parse/module/memory-segment-multi-string.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory\n    (data \"hi\" \"there\" \"how\" \"are\" \"you\")))\n"
  },
  {
    "path": "test/parse/module/memory-segment-passive.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (data \"hi\"))\n"
  },
  {
    "path": "test/parse/module/memory-shared.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-threads\n(module (memory 1 1 shared))\n"
  },
  {
    "path": "test/parse/module/module-empty.txt",
    "content": ";;; TOOL: wat2wasm\n(module)\n"
  },
  {
    "path": "test/parse/module/reference-types-disabled.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --disable-reference-types\n;;; ERROR: 1\n\n(module\n  (table $t 1 externref)\n  (func\n    i32.const 0\n    i32.const 0\n    table.get $t\n    table.set $t\n  )\n)\n(;; STDERR ;;;\nout/test/parse/module/reference-types-disabled.txt:6:15: error: value type not allowed: externref\n  (table $t 1 externref)\n              ^^^^^^^^^\nout/test/parse/module/reference-types-disabled.txt:10:5: error: opcode not allowed: table.get\n    table.get $t\n    ^^^^^^^^^\nout/test/parse/module/reference-types-disabled.txt:11:5: error: opcode not allowed: table.set\n    table.set $t\n    ^^^^^^^^^\nout/test/parse/module/reference-types-disabled.txt:10:15: error: undefined table variable \"$t\"\n    table.get $t\n              ^^\nout/test/parse/module/reference-types-disabled.txt:11:15: error: undefined table variable \"$t\"\n    table.set $t\n              ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/parse/module/start-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (start $foo)\n  (func $foo))\n"
  },
  {
    "path": "test/parse/module/start.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (start 0)\n  (func))\n"
  },
  {
    "path": "test/parse/module/struct-and-func.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n(type (struct i32 i32))\n(type (func (result i32)))\n\n(func (result i32)\n  i32.const 0)\n"
  },
  {
    "path": "test/parse/module/struct-field-name.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n(type\n  (struct (field $a f32)\n          (field $b (mut f64))))\n"
  },
  {
    "path": "test/parse/module/struct-mut-field.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n(type (struct (mut f32) (field (mut f64))))\n"
  },
  {
    "path": "test/parse/module/struct.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-gc\n(type (struct i32 (field i64)))\n"
  },
  {
    "path": "test/parse/module/table-elem-expr.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func)\n  (func)\n  (table funcref (elem (ref.func 1) (ref.func 0))))\n"
  },
  {
    "path": "test/parse/module/table-elem-var.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func)\n  (func)\n  (table funcref (elem 0 1 0)))\n"
  },
  {
    "path": "test/parse/module/table-named.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func $f (param i32))\n  (func $g (param i32 i64))\n  (func $h (result i64) (i64.const 0))\n  (table funcref (elem $f $f $g $h)))\n"
  },
  {
    "path": "test/parse/module/table.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (param i32))\n  (func (param i32 i64))\n  (func (result i64) i64.const 0)\n  (table funcref (elem 0 0 1 2)))\n"
  },
  {
    "path": "test/parse/module/tag.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (type $t (func (param f64)))\n  (tag)\n  (tag $e1 (param i32))\n  (tag $e2 (param f32 f32 f32))\n  (tag $e3 (type $t)))\n"
  },
  {
    "path": "test/parse/module/type-empty-param.txt",
    "content": ";;; TOOL: wat2wasm\n(module (type (func (param))))\n"
  },
  {
    "path": "test/parse/module/type-empty.txt",
    "content": ";;; TOOL: wat2wasm\n(module (type (func)))\n"
  },
  {
    "path": "test/parse/module/type-multi-param.txt",
    "content": ";;; TOOL: wat2wasm\n(module (type (func (param i32 f32 f64) (result f32))))\n"
  },
  {
    "path": "test/parse/module/type-no-param.txt",
    "content": ";;; TOOL: wat2wasm\n(module (type (func (result i32))))\n"
  },
  {
    "path": "test/parse/module/type.txt",
    "content": ";;; TOOL: wat2wasm\n(module (type (func (param i32) (result i32))))\n"
  },
  {
    "path": "test/parse/nested-comments.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (; foo bar\n    (; baz\n    ;)\n  ;)\n)\n"
  },
  {
    "path": "test/parse/stdin.txt",
    "content": ";;; RUN: %(wat2wasm)s -o %(out_dir)s/tmp.wasm\n;;; ARGS: -\n;;; STDIN: %(in_file)s\n;;; RUN: %(wasm-objdump)s -x\n;;; STDIN: %(out_dir)s/tmp.wasm\n;;; ARGS: -\n(module\n  (func (result i32)\n    i32.const 42\n    return)\n)\n(;; STDOUT ;;;\n\n<stdin>:\tfile format wasm 0x1\n\nSection Details:\n\nType[1]:\n - type[0] () -> i32\nFunction[1]:\n - func[0] sig=0\nCode[1]:\n - func[0] size=5\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/parse/string-escape.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func) (export \"tab:\\t newline:\\n slash:\\\\ quote:\\' double:\\\"\" (func 0)))\n"
  },
  {
    "path": "test/parse/string-hex.txt",
    "content": ";;; TOOL: wat2wasm\n(module (func) (export \"foo\\de\\ad\\ca\\bb\" (func 0)))\n"
  },
  {
    "path": "test/pipes.txt",
    "content": ";;; PLATFORMS: Linux Darwin\n;;; RUN: bash -c '%(wasm-stats)s <(%(wat2wasm)s /dev/stdin <<<\"(module)\" -o /dev/stdout)'\n(;; STDOUT ;;;\nTotal opcodes: 0\n\nOpcode counts:\n\nOpcode counts with immediates:\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/bad-annotation.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(@\"annotation\n\n(;; STDERR ;;;\nout/test/regress/bad-annotation.txt:3:14: error: newline in string\n(@\"annotation\n             ^\nout/test/regress/bad-annotation.txt:4:1: error: newline in string\nout/test/regress/bad-annotation.txt:5:1: error: annotations not enabled: \nout/test/regress/bad-annotation.txt:5:1: error: unexpected token \"Invalid\", expected a module field or a module.\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/bad-annotation2.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory $mem 1)\n   (@_memory\" (memory $mem))\n(;; STDERR ;;;\nout/test/regress/bad-annotation2.txt:4:29: error: newline in string\n   (@_memory\" (memory $mem))\n                            ^\nout/test/regress/bad-annotation2.txt:5:1: error: annotations not enabled: \nout/test/regress/bad-annotation2.txt:5:1: error: unexpected token Invalid, expected ).\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/bad-missing-end.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(GLOBAL) { count[1] i32 mut[0] init_expr[] }\nsection(CODE) { count[1] func { locals[0] } }\n(;; STDERR ;;;\n0000017: error: init expression must end with END opcode\n0000017: error: init expression must end with END opcode\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/bad-u64-leb128.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ARGS: --enable-memory64\n;; u64 LEB128s are only used by memory64, for memory limits and\n;; for the offset in a load/store. Limits are in units of pages, so\n;; validation limits them to 2^48 for i64 memories. The offset can\n;; reach UINT64_MAX but can't go over (tested here).\n(assert_malformed\n  (module binary\n    \"\\00asm\" \"\\01\\00\\00\\00\"\n    \"\\01\\04\\01\\60\\00\\00\"             ;; Type section\n    \"\\03\\02\\01\\00\"                   ;; Function section\n    \"\\05\\03\\01\\04\\00\"                ;; Memory section (flags: i64)\n    \"\\0a\\13\\01\"                      ;; Code section\n    ;; function 0\n    \"\\11\\00\"                         ;; local type count\n    \"\\42\\00\"                         ;; i64.const 0\n    \"\\28\"                            ;; i32.load\n    \"\\02\"                            ;; alignment 2\n    \"\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\ff\\02\" ;; offset 2^64 (one unused bit set)\n    \"\\1a\"                            ;; drop\n    \"\\0b\"                            ;; end\n  )\n  \"malformed u64 LEB128\"\n)\n(;; STDOUT ;;;\nout/test/regress/bad-u64-leb128.txt:8: assert_malformed passed:\n  0000020: error: unable to read u64 leb128: load offset\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/empty-quoted-module.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module quote \"\")\n(;; STDERR ;;;\nout/test/regress/empty-quoted-module.txt:3:2: error: error in quoted module: @0x100000001: empty module\n(module quote \"\")\n ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/huge-offset.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --enable-memory64 --fold-exprs --stdout\n(memory i64 0)\n(func (drop (i32.load offset=18446744073709551615 (i64.const 0))))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (drop\n      (i32.load offset=18446744073709551615\n        (i64.const 0))))\n  (memory (;0;) i64 0))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/interp-ehv3-locals.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ARGS*: --enable-exceptions\n;;; NOTE: ref: issue-2476\n(module\n  (tag $e0)\n  (func (export \"set-local\") (result i32)\n    (local $value i32)\n    (try $try\n      (do\n        (local.set $value (i32.const 1))\n        (throw $e0)\n      )\n      (catch $e0)\n    )\n    (local.get $value)\n  )\n  (func (export \"multiple-locals\") (result i32)\n    (local $a i32)\n    (local $b i32)\n    (try $try\n      (do\n        (throw $e0)\n      )\n      (catch $e0)\n    )\n    (local.get $a)\n  )\n)\n\n(assert_return (invoke \"set-local\") (i32.const 1))\n(assert_return (invoke \"multiple-locals\") (i32.const 0))\n(;; STDOUT ;;;\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/interp-throw-before-try.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ARGS*: --enable-exceptions\n(module\n  (tag $e0)\n  (func (export \"throws\")\n    (throw $e0)\n    (try $try\n      (do\n      )\n      (catch $e0)\n    )\n  )\n)\n\n(assert_exception (invoke \"throws\"))\n(;; STDOUT ;;;\nout/test/regress/interp-throw-before-try.txt:15: assert_exception passed\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/issue-2423-wasm2c-no-extension.txt",
    "content": ";;; TOOL: run-wasm2c\n;;; ARGS: -o %(out_dir)s/out\n(module $empty)\n"
  },
  {
    "path": "test/regress/recursion-issue.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; NOTE: ref: issue-2398\n(module\n  (type $out-i32 (func (result i32)))\n\n  (table funcref\n    (elem\n      $runaway-with-return\n    )\n  )\n\n  (func $runaway-with-return (export \"runaway-with-return\") (type $out-i32)\n    (call_indirect (type $out-i32) (i32.const 0))\n  )\n)\n\n(assert_exhaustion (invoke \"runaway-with-return\") \"call stack exhausted\")\n(;; STDOUT ;;;\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-1.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func(call $i32 ))\n  (func $UemoOy_size ))\n(;; STDERR ;;;\nout/test/regress/regress-1.txt:4:14: error: undefined function variable \"$i32\"\n  (func(call $i32 ))\n             ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-10.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    (local i32)\n    block\n      unreachable\n      local.tee 0\n    end))\n(;; STDERR ;;;\nout/test/regress/regress-10.txt:9:5: error: type mismatch at end of block, expected [] but got [i32]\n    end))\n    ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-11.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i32)\n    block (result i32)\n      block\n        unreachable\n        br_if 1\n      end\n      i32.const 1\n    end))\n(;; STDERR ;;;\nout/test/regress/regress-11.txt:9:7: error: type mismatch at end of block, expected [] but got [i32]\n      end\n      ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-12.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func)\n)\n\n(func))\n(;; STDERR ;;;\nout/test/regress/regress-12.txt:7:1: error: unexpected token (, expected EOF.\n(func))\n^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-13.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (test))\n(;; STDERR ;;;\nout/test/regress/regress-13.txt:3:10: error: unexpected token \"test\", expected a module field.\n(module (test))\n         ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-14.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result(i32)\n    (return (i32.const 42))))\n\n(;; STDERR ;;;\nout/test/regress/regress-14.txt:4:16: error: unexpected token (, expected ).\n  (func (result(i32)\n               ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-15.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i32)\n    (return (i32.const 42)))(\n(;; STDERR ;;;\nout/test/regress/regress-15.txt:5:29: error: unexpected token (, expected ).\n    (return (i32.const 42)))(\n                            ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-16.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(start $2)\n(start 42)\n(;; STDERR ;;;\nout/test/regress/regress-16.txt:4:2: error: multiple start sections\n(start 42)\n ^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-1674.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (memory 1)\n  (func\n      i32.const 0\n      v128.const i32x4 0 0 0 0\n      v128.load32_lane align=1 0\n      drop\n  )\n)\n"
  },
  {
    "path": "test/regress/regress-17.txt",
    "content": ";;; RUN: %(wast2json)s %(in_file)s\n;;; ERROR: 1\n(module (func (export \"foo\") (param i64)))\n\n;; Make sure that the error below has the correct location.\n(invoke \"foo\" (i32.const 1))\n(;; STDERR ;;;\nout/test/regress/regress-17.txt:6:26: error: type mismatch for argument 0 of invoke. got i32, expected i64\n(invoke \"foo\" (i32.const 1))\n                         ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-18.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --generate-names\n\n;; This was folding incorrectly since the import index was being used as the\n;; function index, so the folder didn't know how many parameters the function\n;; had.\n\n(module\n  (import \"a\" \"b\" (global i32))\n  (import \"c\" \"d\" (func $g (param i32 i32) (result i32)))\n  (func $f (param i32))\n  (func\n    (call $f\n      (call $g\n        (i32.const 1)\n        (i32.const 2)))))\n\n(;; STDOUT ;;;\n(module\n  (type $t0 (func (param i32 i32) (result i32)))\n  (type $t1 (func (param i32)))\n  (type $t2 (func))\n  (import \"a\" \"b\" (global $a.b i32))\n  (import \"c\" \"d\" (func $c.d (type $t0)))\n  (func $f1 (type $t1) (param $p0 i32))\n  (func $f2 (type $t2)\n    (call $f1\n      (call $c.d\n        (i32.const 1)\n        (i32.const 2)))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-19.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --inline-export --stdout\n(module\n  (import \"foo\" \"bar\" (func))\n  (export \"baz\" (func 0))\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (import \"foo\" \"bar\" (func (;0;) (type 0)))\n  (export \"baz\" (func 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-1922.txt",
    "content": ";;; TOOL: run-wasm-decompile\n(module\n  (type (;0;) (func (param i32 i32) (result i32)))\n  (func (;0;) (type 0) (param i32 i32) (result i32)\n    local.get 0\n    loop (param i32) (result i32)  ;; label = @1\n      unreachable\n      br_table 0 (;@1;) 0 (;@1;)\n      i32.add\n    end))\n(;; STDOUT ;;;\nfunction f_a(a:int, b:int):int { // func0\n  a + br_table[L_a, ..L_a](unreachable);\n  return loop L_a {\n         }\n}\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-1924.txt",
    "content": ";;; TOOL: run-wasm-decompile\n(module\n  (type (;0;) (func (result i64)))\n  (func (;0;) (type 0) (result i64)\n    global.get 0)\n  (global (;0;) i64 (i64.const 8))\n  (export \"\" (global 0))\n)\n(;; STDOUT ;;;\nexport global __empty:long = 8L;\n\nfunction f_a():long { // func0\n  return __empty\n}\n\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-2.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func(call 2 ))\n  (func $memor(call 2 ))\n  (func $memory(param f32)(call 332 ))\n  (func $memor(call 2 ))\n  (func $memornc(call 2 ))\n  (func $mYmor(call 2 ))\n  (func $memo```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````r(call 2 ))\n  (func $memory(param f32)(call 332 ))\n  (func $memorGe ))\n(;; STDERR ;;;\nout/test/regress/regress-2.txt:7:4: error: redefinition of function \"$memor\"\n  (func $memor(call 2 ))\n   ^^^^\nout/test/regress/regress-2.txt:11:4: error: redefinition of function \"$memory\"\n  (func $memory(param f32)(call 332 ))\n   ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-20.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[\n      decl_count[1]\n      local_count[leb_i32(3334443763)]  ;; <- huge number of locals\n      42  ;; <- invalid type\n    ]\n  }\n}\n(;; STDERR ;;;\n000001e: error: expected valid local type\n000001e: error: expected valid local type\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-2034.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS: --debug-names --enable-exceptions\n(module\n (func $foo)\n (export \"func\" (func $foo))\n (global $foo i32 (i32.const 14))\n (table $foo (export \"tab\") 0 funcref)\n (elem $foo)\n (memory $foo (export \"mem\") 0)\n (data $foo)\n (tag $foo (export \"tag\"))\n)\n\n(assert_return (invoke \"func\"))\n(;; STDOUT ;;;\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-2039.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS: --debug-names --enable-exceptions\n(module (tag $t (export \"tag\")))\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-21.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $foo.ty       (func))\n  (global $g i32 (i32.const -1))\n  (func $foo (type $foo.ty)\n     (global.set $g (i32.const 1))\n  )\n  (export \"foo\" (func $foo))\n)\n(;; STDERR ;;;\nout/test/regress/regress-21.txt:7:7: error: can't global.set on immutable global at index 0.\n     (global.set $g (i32.const 1))\n      ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-2110.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (tag $e0 (param i32))\n)\n\n(;; STDERR ;;;\nout/test/regress/regress-2110.txt:4:3: error: tag not allowed\n  (tag $e0 (param i32))\n  ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-22.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n    (type $sig (func (param i32) (result i32)))\n    (table 0 funcref)\n    (func (result i32)\n      (call_indirect (type $sig) (result i32) (i32.const 0))\n    )\n)\n(;; STDERR ;;;\nout/test/regress/regress-22.txt:7:8: error: expected 1 arguments, got 0\n      (call_indirect (type $sig) (result i32) (i32.const 0))\n       ^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-23.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\n;; This regression test makes sure that the end_loc of `if` blocks is properly\n;; set when using the folded format.\n\n;; if/else with `then`/`else` keywords, error in true branch.\n(func (result i32)\n  (if (result i32)\n    (i32.const 0)\n    (then\n      (block\n        (unreachable)\n      )\n    )\n    (else\n      (i32.const 0)\n    )\n  )\n)\n\n;; if/else with `then`/`else` keywords, error in false branch.\n(func (result i32)\n  (if (result i32)\n    (i32.const 0)\n    (then\n      (i32.const 0)\n    )\n    (else\n      (block\n        (unreachable)\n      )\n    )\n  )\n)\n(;; STDERR ;;;\nout/test/regress/regress-23.txt:14:7: error: type mismatch in `if true` branch, expected [i32] but got []\n      )\n      ^\nout/test/regress/regress-23.txt:34:3: error: type mismatch in `if false` branch, expected [i32] but got []\n  )\n  ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-24.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: -d\n(module (func (export \"fn\")))\n(;; STDOUT ;;;\n0000000: 0061 736d 0100 0000 0104 0160 0000 0302 \n0000010: 0100 0706 0102 666e 0000 0a04 0102 000b \n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-26.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ERROR: 1\nmagic\nversion\nsection(TABLE) {\n  count[1]\n  funcref\n  has_max[0]\n  initial[0]\n}\nsection(ELEM) {\n  count[1]\n  flags[0]\n  addr[end]\n}\n(;; STDERR ;;;\nout/test/regress/regress-26/regress-26.wasm:0000012: error: type mismatch in initializer expression, expected [i32] but got []\n0000013: error: EndElemSegmentInitExpr callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-2670.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --generate-names --enable-function-references --enable-exceptions\n\n;; This test was failed because the \"local is set\" bitvector\n;; was not cleared in BeginFunctionBody, and the bitvector\n;; save/restore operations was missing for try tables\n\n(module\n  (tag $e0)\n\n  (func (local (ref func) (ref func) (ref func)))\n  (func\n    (local (ref func) (ref func))\n    try_table\n    end)\n  (func\n    (local (ref func))\n    try_table (catch $e0 0) (catch_all 0)\n    end)\n  (func\n    unreachable\n    try_table\n    end))\n\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $f0 (type $t0)\n    (local $l0 (ref func)) (local $l1 (ref func)) (local $l2 (ref func)))\n  (func $f1 (type $t0)\n    (local $l0 (ref func)) (local $l1 (ref func))\n    (try_table $T0\n    ))\n  (func $f2 (type $t0)\n    (local $l0 (ref func))\n    (try_table $T0\n      (catch $e0 0 (;@0;))\n      (catch_all 0 (;@0;))))\n  (func $f3 (type $t0)\n    (unreachable)\n    (try_table $T0\n    ))\n  (tag $e0 (type $t0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-27.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ERROR: 1\nmagic\nversion\nsection(MEMORY) {\n  count[1]\n  has_max[0]\n  initial[0]\n}\nsection(DATA) {\n  count[1]\n  flags[0]\n  addr[end]\n  data[str(\"test\")]\n}\n(;; STDERR ;;;\nout/test/regress/regress-27/regress-27.wasm:0000011: error: type mismatch in initializer expression, expected [i32] but got []\n0000012: error: EndDataSegmentInitExpr callback failed\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-28.txt",
    "content": ";;; TOOL: run-gen-wasm-interp\n;;; ERROR: 1\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    unreachable\n    end\n    i32.div_s\n    select\n  }\n}\n(;; STDERR ;;;\n0000019: error: function body shorter than given size\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-29.txt",
    "content": ";;; TOOL: run-interp\n;;; ARGS*: --enable-tail-call\n(table funcref (elem $f))\n(func $f (result i32) i32.const 65)\n\n(func (export \"g\") (result i32)\n  i32.const 7  ;; extra i32 on stack\n  return_call $f\n)\n(func (export \"h\") (result i32)\n  i32.const 7  ;; extra i32 on stack\n  i32.const 0\n  return_call_indirect (result i32)\n)\n(;; STDOUT ;;;\ng() => i32:65\nh() => i32:65\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-3.txt",
    "content": ";;; TOOL: wat2wasm\n;;; NOTE: bug when calling function defined with type after call\n(module\n  (type $t (func (result i32)))\n  (func\n    call $f\n    i32.const 0\n    i32.eq\n    drop)\n  (func $f (type $t) (i32.const 42)))\n"
  },
  {
    "path": "test/regress/regress-30.txt",
    "content": ";;; TOOL: run-interp-spec\n(assert_malformed\n  (module quote \"\\80\")\n  \"\")\n(;; STDOUT ;;;\nout/test/regress/regress-30.txt:3: assert_malformed passed:\n  out/test/regress/regress-30/regress-30.0.wat:1:1: error: unexpected char\n  \n  ^\n  out/test/regress/regress-30/regress-30.0.wat:1:2: warning: empty module\n  \n   ^\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-31.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\"\n\"\n(;; STDERR ;;;\nout/test/regress/regress-31.txt:3:2: error: newline in string\n\"\n ^\nout/test/regress/regress-31.txt:4:1: error: unexpected token \"Invalid\", expected a module field or a module.\n\"\n^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-32.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(func f32.const 0xcab.ba6ep41e100)\n(;; STDERR ;;;\nout/test/regress/regress-32.txt:3:17: error: unexpected token \"0xcab.ba6ep41e100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n(func f32.const 0xcab.ba6ep41e100)\n                ^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-33.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(data \"\\d\")\n(;; STDERR ;;;\nout/test/regress/regress-33.txt:3:8: error: bad escape \"\\d\"\n(data \"\\d\")\n       ^^\nout/test/regress/regress-33.txt:3:7: error: unexpected token Invalid, expected ).\n(data \"\\d\")\n      ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-34.txt",
    "content": ";;; TOOL: run-interp-spec\n(module (func (v128.const f32x4  340282356779733623858607532500980858880 340282356779733623858607532500980858880\n                                 340282356779733623858607532500980858880 340282356779733623858607532500980858880) drop))\n(assert_malformed\n  (module quote \"(func (v128.const i8x16 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100) drop)\")\n  \"constant out of range\"\n)\n(;; STDOUT ;;;\nout/test/regress/regress-34.txt:5: assert_malformed passed:\n  out/test/regress/regress-34/regress-34.1.wat:1:25: error: invalid literal \"0x100\"\n  (func (v128.const i8x16 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100...\n                          ^^^^^\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-35.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: -r\n(module \n  (type (func (param i32)(param i32)(result i32)))\n  (func $add (param i32)(param i32)(result i32)\n    local.get 0\n    local.get 1\n    i32.add\n    return\n  )\n  (table 1 funcref)\n  (elem (i32.const 0) $add)\n  (func $run\n    i32.const 4444\n    i32.const 5555\n    i32.const 0\n    ;;call_indirect (type 0) ;; fails\n    call_indirect (param i32)(param i32)(result i32)\n    drop\n  )\n  (export \"run\" (func $run))\n)\n"
  },
  {
    "path": "test/regress/regress-36.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --disable-bulk-memory\n;;; ERROR: 1\n(data \"hello\")\n(;; STDERR ;;;\nout/test/regress/regress-36.txt:4:2: error: passive data segments are not allowed\n(data \"hello\")\n ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-37.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ERROR: 36\n(module\n  (func (export \"i8x16\") (result v128) (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))\n  (func (export \"i16x8\") (result v128) (v128.const i16x8 0 1 2 3 4 5 6 7))\n  (func (export \"i32x4\") (result v128) (v128.const i32x4 0 1 2 3))\n  (func (export \"i64x2\") (result v128) (v128.const i64x2 0 1))\n  (func (export \"f32x4\") (result v128) (v128.const f32x4 0 1 2 3))\n  (func (export \"f64x2\") (result v128) (v128.const f64x2 0 1))\n)\n\n;; passing tests\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i16x8\") (v128.const i16x8 0 1 2 3 4 5 6 7))\n(assert_return (invoke \"i32x4\") (v128.const i32x4 0 1 2 3))\n(assert_return (invoke \"i64x2\") (v128.const i64x2 0 1))\n(assert_return (invoke \"f32x4\") (v128.const f32x4 0 1 2 3))\n(assert_return (invoke \"f64x2\") (v128.const f64x2 0 1))\n\n;; should fail\n(assert_return (invoke \"i8x16\") (v128.const i8x16 -1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 -1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 -2 3 4 5 6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 -3 4 5 6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 -4 5 6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 -5 6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 -6 7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 -7 8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 -8 9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 -9 10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 -10 11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 -11 12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 -12 13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 -13 14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 -14 15))\n(assert_return (invoke \"i8x16\") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -15))\n\n(assert_return (invoke \"i16x8\") (v128.const i16x8 -1 1 2 3 4 5 6 7))\n(assert_return (invoke \"i16x8\") (v128.const i16x8 0 -1 2 3 4 5 6 7))\n(assert_return (invoke \"i16x8\") (v128.const i16x8 0 1 -2 3 4 5 6 7))\n(assert_return (invoke \"i16x8\") (v128.const i16x8 0 1 2 -3 4 5 6 7))\n(assert_return (invoke \"i16x8\") (v128.const i16x8 0 1 2 3 -4 5 6 7))\n(assert_return (invoke \"i16x8\") (v128.const i16x8 0 1 2 3 4 -5 6 7))\n(assert_return (invoke \"i16x8\") (v128.const i16x8 0 1 2 3 4 5 -6 7))\n(assert_return (invoke \"i16x8\") (v128.const i16x8 0 1 2 3 4 5 6 -7))\n\n(assert_return (invoke \"i32x4\") (v128.const i32x4 -1 1 2 3))\n(assert_return (invoke \"i32x4\") (v128.const i32x4 0 -1 2 3))\n(assert_return (invoke \"i32x4\") (v128.const i32x4 0 1 -2 3))\n(assert_return (invoke \"i32x4\") (v128.const i32x4 0 1 2 -3))\n\n(assert_return (invoke \"i64x2\") (v128.const i64x2 -1 1))\n(assert_return (invoke \"i64x2\") (v128.const i64x2 0 -1))\n\n(assert_return (invoke \"f32x4\") (v128.const f32x4 -1 1 2 3))\n(assert_return (invoke \"f32x4\") (v128.const f32x4 0 -1 2 3))\n(assert_return (invoke \"f32x4\") (v128.const f32x4 0 1 -2 3))\n(assert_return (invoke \"f32x4\") (v128.const f32x4 0 1 2 -3))\n\n(assert_return (invoke \"f64x2\") (v128.const f64x2 -1 1))\n(assert_return (invoke \"f64x2\") (v128.const f64x2 0 -1))\n(;; STDOUT ;;;\nout/test/regress/regress-37.txt:21: mismatch in lane 0 of result 0 of assert_return: expected i8:255, got i8:0\nout/test/regress/regress-37.txt:21: mismatch in result 0 of assert_return: expected v128 i8:255i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:22: mismatch in lane 1 of result 0 of assert_return: expected i8:255, got i8:1\nout/test/regress/regress-37.txt:22: mismatch in result 0 of assert_return: expected v128 i8:0i8:255i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:23: mismatch in lane 2 of result 0 of assert_return: expected i8:254, got i8:2\nout/test/regress/regress-37.txt:23: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:254i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:24: mismatch in lane 3 of result 0 of assert_return: expected i8:253, got i8:3\nout/test/regress/regress-37.txt:24: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:253i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:25: mismatch in lane 4 of result 0 of assert_return: expected i8:252, got i8:4\nout/test/regress/regress-37.txt:25: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:252i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:26: mismatch in lane 5 of result 0 of assert_return: expected i8:251, got i8:5\nout/test/regress/regress-37.txt:26: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:251i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:27: mismatch in lane 6 of result 0 of assert_return: expected i8:250, got i8:6\nout/test/regress/regress-37.txt:27: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:250i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:28: mismatch in lane 7 of result 0 of assert_return: expected i8:249, got i8:7\nout/test/regress/regress-37.txt:28: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:249i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:29: mismatch in lane 8 of result 0 of assert_return: expected i8:248, got i8:8\nout/test/regress/regress-37.txt:29: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:248i8:9i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:30: mismatch in lane 9 of result 0 of assert_return: expected i8:247, got i8:9\nout/test/regress/regress-37.txt:30: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:247i8:10i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:31: mismatch in lane 10 of result 0 of assert_return: expected i8:246, got i8:10\nout/test/regress/regress-37.txt:31: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:246i8:11i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:32: mismatch in lane 11 of result 0 of assert_return: expected i8:245, got i8:11\nout/test/regress/regress-37.txt:32: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:245i8:12i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:33: mismatch in lane 12 of result 0 of assert_return: expected i8:244, got i8:12\nout/test/regress/regress-37.txt:33: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:244i8:13i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:34: mismatch in lane 13 of result 0 of assert_return: expected i8:243, got i8:13\nout/test/regress/regress-37.txt:34: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:243i8:14i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:35: mismatch in lane 14 of result 0 of assert_return: expected i8:242, got i8:14\nout/test/regress/regress-37.txt:35: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:242i8:15, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:36: mismatch in lane 15 of result 0 of assert_return: expected i8:241, got i8:15\nout/test/regress/regress-37.txt:36: mismatch in result 0 of assert_return: expected v128 i8:0i8:1i8:2i8:3i8:4i8:5i8:6i8:7i8:8i8:9i8:10i8:11i8:12i8:13i8:14i8:241, got v128 i32x4:0x03020100 0x07060504 0x0b0a0908 0x0f0e0d0c\nout/test/regress/regress-37.txt:38: mismatch in lane 0 of result 0 of assert_return: expected i16:65535, got i16:0\nout/test/regress/regress-37.txt:38: mismatch in result 0 of assert_return: expected v128 i16:65535i16:1i16:2i16:3i16:4i16:5i16:6i16:7, got v128 i32x4:0x00010000 0x00030002 0x00050004 0x00070006\nout/test/regress/regress-37.txt:39: mismatch in lane 1 of result 0 of assert_return: expected i16:65535, got i16:1\nout/test/regress/regress-37.txt:39: mismatch in result 0 of assert_return: expected v128 i16:0i16:65535i16:2i16:3i16:4i16:5i16:6i16:7, got v128 i32x4:0x00010000 0x00030002 0x00050004 0x00070006\nout/test/regress/regress-37.txt:40: mismatch in lane 2 of result 0 of assert_return: expected i16:65534, got i16:2\nout/test/regress/regress-37.txt:40: mismatch in result 0 of assert_return: expected v128 i16:0i16:1i16:65534i16:3i16:4i16:5i16:6i16:7, got v128 i32x4:0x00010000 0x00030002 0x00050004 0x00070006\nout/test/regress/regress-37.txt:41: mismatch in lane 3 of result 0 of assert_return: expected i16:65533, got i16:3\nout/test/regress/regress-37.txt:41: mismatch in result 0 of assert_return: expected v128 i16:0i16:1i16:2i16:65533i16:4i16:5i16:6i16:7, got v128 i32x4:0x00010000 0x00030002 0x00050004 0x00070006\nout/test/regress/regress-37.txt:42: mismatch in lane 4 of result 0 of assert_return: expected i16:65532, got i16:4\nout/test/regress/regress-37.txt:42: mismatch in result 0 of assert_return: expected v128 i16:0i16:1i16:2i16:3i16:65532i16:5i16:6i16:7, got v128 i32x4:0x00010000 0x00030002 0x00050004 0x00070006\nout/test/regress/regress-37.txt:43: mismatch in lane 5 of result 0 of assert_return: expected i16:65531, got i16:5\nout/test/regress/regress-37.txt:43: mismatch in result 0 of assert_return: expected v128 i16:0i16:1i16:2i16:3i16:4i16:65531i16:6i16:7, got v128 i32x4:0x00010000 0x00030002 0x00050004 0x00070006\nout/test/regress/regress-37.txt:44: mismatch in lane 6 of result 0 of assert_return: expected i16:65530, got i16:6\nout/test/regress/regress-37.txt:44: mismatch in result 0 of assert_return: expected v128 i16:0i16:1i16:2i16:3i16:4i16:5i16:65530i16:7, got v128 i32x4:0x00010000 0x00030002 0x00050004 0x00070006\nout/test/regress/regress-37.txt:45: mismatch in lane 7 of result 0 of assert_return: expected i16:65529, got i16:7\nout/test/regress/regress-37.txt:45: mismatch in result 0 of assert_return: expected v128 i16:0i16:1i16:2i16:3i16:4i16:5i16:6i16:65529, got v128 i32x4:0x00010000 0x00030002 0x00050004 0x00070006\nout/test/regress/regress-37.txt:47: mismatch in lane 0 of result 0 of assert_return: expected i32:4294967295, got i32:0\nout/test/regress/regress-37.txt:47: mismatch in result 0 of assert_return: expected v128 i32:4294967295i32:1i32:2i32:3, got v128 i32x4:0x00000000 0x00000001 0x00000002 0x00000003\nout/test/regress/regress-37.txt:48: mismatch in lane 1 of result 0 of assert_return: expected i32:4294967295, got i32:1\nout/test/regress/regress-37.txt:48: mismatch in result 0 of assert_return: expected v128 i32:0i32:4294967295i32:2i32:3, got v128 i32x4:0x00000000 0x00000001 0x00000002 0x00000003\nout/test/regress/regress-37.txt:49: mismatch in lane 2 of result 0 of assert_return: expected i32:4294967294, got i32:2\nout/test/regress/regress-37.txt:49: mismatch in result 0 of assert_return: expected v128 i32:0i32:1i32:4294967294i32:3, got v128 i32x4:0x00000000 0x00000001 0x00000002 0x00000003\nout/test/regress/regress-37.txt:50: mismatch in lane 3 of result 0 of assert_return: expected i32:4294967293, got i32:3\nout/test/regress/regress-37.txt:50: mismatch in result 0 of assert_return: expected v128 i32:0i32:1i32:2i32:4294967293, got v128 i32x4:0x00000000 0x00000001 0x00000002 0x00000003\nout/test/regress/regress-37.txt:52: mismatch in lane 0 of result 0 of assert_return: expected i64:18446744073709551615, got i64:0\nout/test/regress/regress-37.txt:52: mismatch in result 0 of assert_return: expected v128 i64:18446744073709551615i64:1, got v128 i32x4:0x00000000 0x00000000 0x00000001 0x00000000\nout/test/regress/regress-37.txt:53: mismatch in lane 1 of result 0 of assert_return: expected i64:18446744073709551615, got i64:1\nout/test/regress/regress-37.txt:53: mismatch in result 0 of assert_return: expected v128 i64:0i64:18446744073709551615, got v128 i32x4:0x00000000 0x00000000 0x00000001 0x00000000\nout/test/regress/regress-37.txt:55: mismatch in lane 0 of result 0 of assert_return: expected f32:-1.000000, got f32:0.000000\nout/test/regress/regress-37.txt:55: mismatch in result 0 of assert_return: expected v128 f32:-1.000000f32:1.000000f32:2.000000f32:3.000000, got v128 i32x4:0x00000000 0x3f800000 0x40000000 0x40400000\nout/test/regress/regress-37.txt:56: mismatch in lane 1 of result 0 of assert_return: expected f32:-1.000000, got f32:1.000000\nout/test/regress/regress-37.txt:56: mismatch in result 0 of assert_return: expected v128 f32:0.000000f32:-1.000000f32:2.000000f32:3.000000, got v128 i32x4:0x00000000 0x3f800000 0x40000000 0x40400000\nout/test/regress/regress-37.txt:57: mismatch in lane 2 of result 0 of assert_return: expected f32:-2.000000, got f32:2.000000\nout/test/regress/regress-37.txt:57: mismatch in result 0 of assert_return: expected v128 f32:0.000000f32:1.000000f32:-2.000000f32:3.000000, got v128 i32x4:0x00000000 0x3f800000 0x40000000 0x40400000\nout/test/regress/regress-37.txt:58: mismatch in lane 3 of result 0 of assert_return: expected f32:-3.000000, got f32:3.000000\nout/test/regress/regress-37.txt:58: mismatch in result 0 of assert_return: expected v128 f32:0.000000f32:1.000000f32:2.000000f32:-3.000000, got v128 i32x4:0x00000000 0x3f800000 0x40000000 0x40400000\nout/test/regress/regress-37.txt:60: mismatch in lane 0 of result 0 of assert_return: expected f64:-1.000000, got f64:0.000000\nout/test/regress/regress-37.txt:60: mismatch in result 0 of assert_return: expected v128 f64:-1.000000f64:1.000000, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x3ff00000\nout/test/regress/regress-37.txt:61: mismatch in lane 1 of result 0 of assert_return: expected f64:-1.000000, got f64:1.000000\nout/test/regress/regress-37.txt:61: mismatch in result 0 of assert_return: expected v128 f64:0.000000f64:-1.000000, got v128 i32x4:0x00000000 0x00000000 0x00000000 0x3ff00000\n7/43 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-4.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n;; bug where looking up an undefined name would not produce an error if there\n;; was any name at all.\n(module\n  (func (param $p i32)\n    (local.get $n)))\n(;; STDERR ;;;\nout/test/regress/regress-4.txt:7:16: error: undefined local variable \"$n\"\n    (local.get $n)))\n               ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-5.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n;; error when displaying source line when the line wasn't in the first 8192\n;; bytes.\n(module\n  (memory 1)\n  (data (i32.const 0) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 60) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 120) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 180) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 240) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 300) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 360) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 420) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 480) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 540) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 600) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 660) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 720) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 780) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 840) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 900) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 960) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1020) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1080) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1140) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1200) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1260) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1320) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1380) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1440) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1500) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1560) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1620) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1680) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1740) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1800) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1860) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1920) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 1980) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2040) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2100) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2160) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2220) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2280) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2340) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2400) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2460) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2520) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2580) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2640) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2700) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2760) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2820) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2880) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 2940) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3000) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3060) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3120) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3180) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3240) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3300) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3360) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3420) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3480) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3540) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3600) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3660) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3720) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3780) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3840) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3900) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 3960) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4020) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4080) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4140) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4200) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4260) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4320) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4380) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4440) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4500) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4560) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4620) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4680) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4740) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4800) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4860) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4920) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 4980) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5040) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5100) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5160) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5220) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5280) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5340) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5400) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5460) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5520) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5580) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5640) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5700) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5760) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5820) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5880) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 5940) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6000) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6060) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6120) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6180) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6240) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6300) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6360) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6420) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6480) \"000000000000000000000000000000000000000000000000000000000000\")\n  (data (i32.const 6540) \"000000000000000000000000000000000000000000000000000000000000\")\n  (func (result i32)\n    (i64.const 0))  ;; deliberate type-check error\n)\n(;; STDERR ;;;\nout/test/regress/regress-5.txt:118:6: error: type mismatch in implicit return, expected [i32] but got [i64]\n    (i64.const 0))  ;; deliberate type-check error\n     ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/regress-6.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    block (result i32)\n      f32.const 1\n      i32.const 1\n      br 0\n    end))\n"
  },
  {
    "path": "test/regress/regress-7.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(IMPORT) {\n  count[10]\n  str(\"m\") str(\"0\") func_kind type[0]\n  str(\"m\") str(\"1\") func_kind type[0]\n  str(\"m\") str(\"2\") func_kind type[0]\n  str(\"m\") str(\"3\") func_kind type[0]\n  str(\"m\") str(\"4\") func_kind type[0]\n  str(\"m\") str(\"5\") func_kind type[0]\n  str(\"m\") str(\"6\") func_kind type[0]\n  str(\"m\") str(\"7\") func_kind type[0]\n  str(\"m\") str(\"8\") func_kind type[0]\n  str(\"m\") str(\"9\") func_kind type[0]\n}\nsection(FUNCTION) {\n  count[10]\n  type[0]\n  type[0]\n  type[0]\n  type[0]\n  type[0]\n  type[0]\n  type[0]\n  type[0]\n  type[0]\n  type[0]\n}\nsection(CODE) {\n  count[10]\n  func { locals[0] }\n  func { locals[0] }\n  func { locals[0] }\n  func { locals[0] }\n  func { locals[0] }\n  func { locals[0] }\n  func { locals[0] }\n  func { locals[0] }\n  func { locals[0] }\n  func { locals[0] }\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (import \"m\" \"0\" (func (;0;) (type 0)))\n  (import \"m\" \"1\" (func (;1;) (type 0)))\n  (import \"m\" \"2\" (func (;2;) (type 0)))\n  (import \"m\" \"3\" (func (;3;) (type 0)))\n  (import \"m\" \"4\" (func (;4;) (type 0)))\n  (import \"m\" \"5\" (func (;5;) (type 0)))\n  (import \"m\" \"6\" (func (;6;) (type 0)))\n  (import \"m\" \"7\" (func (;7;) (type 0)))\n  (import \"m\" \"8\" (func (;8;) (type 0)))\n  (import \"m\" \"9\" (func (;9;) (type 0)))\n  (func (;10;) (type 0))\n  (func (;11;) (type 0))\n  (func (;12;) (type 0))\n  (func (;13;) (type 0))\n  (func (;14;) (type 0))\n  (func (;15;) (type 0))\n  (func (;16;) (type 0))\n  (func (;17;) (type 0))\n  (func (;18;) (type 0))\n  (func (;19;) (type 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-8.txt",
    "content": ";;; TOOL: run-gen-wasm\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(IMPORT) {\n  count[10]\n  str(\"m\") str(\"0\") global_kind i32 mut[0]\n  str(\"m\") str(\"1\") global_kind i32 mut[0]\n  str(\"m\") str(\"2\") global_kind i32 mut[0]\n  str(\"m\") str(\"3\") global_kind i32 mut[0]\n  str(\"m\") str(\"4\") global_kind i32 mut[0]\n  str(\"m\") str(\"5\") global_kind i32 mut[0]\n  str(\"m\") str(\"6\") global_kind i32 mut[0]\n  str(\"m\") str(\"7\") global_kind i32 mut[0]\n  str(\"m\") str(\"8\") global_kind i32 mut[0]\n  str(\"m\") str(\"9\") global_kind i32 mut[0]\n}\nsection(GLOBAL) {\n  count[10]\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n  i64 mut[0] i64.const 0 end\n}\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (import \"m\" \"0\" (global (;0;) i32))\n  (import \"m\" \"1\" (global (;1;) i32))\n  (import \"m\" \"2\" (global (;2;) i32))\n  (import \"m\" \"3\" (global (;3;) i32))\n  (import \"m\" \"4\" (global (;4;) i32))\n  (import \"m\" \"5\" (global (;5;) i32))\n  (import \"m\" \"6\" (global (;6;) i32))\n  (import \"m\" \"7\" (global (;7;) i32))\n  (import \"m\" \"8\" (global (;8;) i32))\n  (import \"m\" \"9\" (global (;9;) i32))\n  (global (;10;) i64 (i64.const 0))\n  (global (;11;) i64 (i64.const 0))\n  (global (;12;) i64 (i64.const 0))\n  (global (;13;) i64 (i64.const 0))\n  (global (;14;) i64 (i64.const 0))\n  (global (;15;) i64 (i64.const 0))\n  (global (;16;) i64 (i64.const 0))\n  (global (;17;) i64 (i64.const 0))\n  (global (;18;) i64 (i64.const 0))\n  (global (;19;) i64 (i64.const 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/regress-9.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  ;; This used to cause an infinite loop in wat-writer when writing out long\n  ;; indentation.\n  (func\n    block block block block block block block block\n    block block block block block block block block\n    block block block block block block block block\n    block block block block block block block block\n    block block block block block block block block\n    block block block block block block block block\n    block block block block block block block block\n    block block block block block block block block\n    block block block block block block block block\n    block block block block block block block block\n    nop\n    end end end end end end end end\n    end end end end end end end end\n    end end end end end end end end\n    end end end end end end end end\n    end end end end end end end end\n    end end end end end end end end\n    end end end end end end end end\n    end end end end end end end end\n    end end end end end end end end\n    end end end end end end end end\n    ))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    block  ;; label = @1\n      block  ;; label = @2\n        block  ;; label = @3\n          block  ;; label = @4\n            block  ;; label = @5\n              block  ;; label = @6\n                block  ;; label = @7\n                  block  ;; label = @8\n                    block  ;; label = @9\n                      block  ;; label = @10\n                        block  ;; label = @11\n                          block  ;; label = @12\n                            block  ;; label = @13\n                              block  ;; label = @14\n                                block  ;; label = @15\n                                  block  ;; label = @16\n                                    block  ;; label = @17\n                                      block  ;; label = @18\n                                        block  ;; label = @19\n                                          block  ;; label = @20\n                                            block  ;; label = @21\n                                              block  ;; label = @22\n                                                block  ;; label = @23\n                                                  block  ;; label = @24\n                                                    block  ;; label = @25\n                                                      block  ;; label = @26\n                                                        block  ;; label = @27\n                                                          block  ;; label = @28\n                                                            block  ;; label = @29\n                                                              block  ;; label = @30\n                                                                block  ;; label = @31\n                                                                  block  ;; label = @32\n                                                                    block  ;; label = @33\n                                                                      block  ;; label = @34\n                                                                        block  ;; label = @35\n                                                                          block  ;; label = @36\n                                                                            block  ;; label = @37\n                                                                              block  ;; label = @38\n                                                                                block  ;; label = @39\n                                                                                  block  ;; label = @40\n                                                                                    block  ;; label = @41\n                                                                                      block  ;; label = @42\n                                                                                        block  ;; label = @43\n                                                                                          block  ;; label = @44\n                                                                                            block  ;; label = @45\n                                                                                              block  ;; label = @46\n                                                                                                block  ;; label = @47\n                                                                                                  block  ;; label = @48\n                                                                                                    block  ;; label = @49\n                                                                                                      block  ;; label = @50\n                                                                                                        block  ;; label = @51\n                                                                                                          block  ;; label = @52\n                                                                                                            block  ;; label = @53\n                                                                                                              block  ;; label = @54\n                                                                                                                block  ;; label = @55\n                                                                                                                  block  ;; label = @56\n                                                                                                                    block  ;; label = @57\n                                                                                                                      block  ;; label = @58\n                                                                                                                        block  ;; label = @59\n                                                                                                                          block  ;; label = @60\n                                                                                                                            block  ;; label = @61\n                                                                                                                              block  ;; label = @62\n                                                                                                                                block  ;; label = @63\n                                                                                                                                  block  ;; label = @64\n                                                                                                                                    block  ;; label = @65\n                                                                                                                                      block  ;; label = @66\n                                                                                                                                        block  ;; label = @67\n                                                                                                                                          block  ;; label = @68\n                                                                                                                                            block  ;; label = @69\n                                                                                                                                              block  ;; label = @70\n                                                                                                                                                block  ;; label = @71\n                                                                                                                                                  block  ;; label = @72\n                                                                                                                                                    block  ;; label = @73\n                                                                                                                                                      block  ;; label = @74\n                                                                                                                                                        block  ;; label = @75\n                                                                                                                                                          block  ;; label = @76\n                                                                                                                                                            block  ;; label = @77\n                                                                                                                                                              block  ;; label = @78\n                                                                                                                                                                block  ;; label = @79\n                                                                                                                                                                  block  ;; label = @80\n                                                                                                                                                                    nop\n                                                                                                                                                                  end\n                                                                                                                                                                end\n                                                                                                                                                              end\n                                                                                                                                                            end\n                                                                                                                                                          end\n                                                                                                                                                        end\n                                                                                                                                                      end\n                                                                                                                                                    end\n                                                                                                                                                  end\n                                                                                                                                                end\n                                                                                                                                              end\n                                                                                                                                            end\n                                                                                                                                          end\n                                                                                                                                        end\n                                                                                                                                      end\n                                                                                                                                    end\n                                                                                                                                  end\n                                                                                                                                end\n                                                                                                                              end\n                                                                                                                            end\n                                                                                                                          end\n                                                                                                                        end\n                                                                                                                      end\n                                                                                                                    end\n                                                                                                                  end\n                                                                                                                end\n                                                                                                              end\n                                                                                                            end\n                                                                                                          end\n                                                                                                        end\n                                                                                                      end\n                                                                                                    end\n                                                                                                  end\n                                                                                                end\n                                                                                              end\n                                                                                            end\n                                                                                          end\n                                                                                        end\n                                                                                      end\n                                                                                    end\n                                                                                  end\n                                                                                end\n                                                                              end\n                                                                            end\n                                                                          end\n                                                                        end\n                                                                      end\n                                                                    end\n                                                                  end\n                                                                end\n                                                              end\n                                                            end\n                                                          end\n                                                        end\n                                                      end\n                                                    end\n                                                  end\n                                                end\n                                              end\n                                            end\n                                          end\n                                        end\n                                      end\n                                    end\n                                  end\n                                end\n                              end\n                            end\n                          end\n                        end\n                      end\n                    end\n                  end\n                end\n              end\n            end\n          end\n        end\n      end\n    end))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/undefined-shifts.txt",
    "content": ";;; TOOL: run-gen-wasm-bad\n;;; ARGS1: --enable-multi-memory\n;;; ARGS2: --enable-multi-memory\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[0] }\nsection(FUNCTION) { count[1] type[0] }\nsection(MEMORY) { count[1] flags[0] min[1] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const leb_u32(0)\n    i32.load align[63] offset[0]\n    drop\n  }\n}\n(;; STDERR ;;;\n0000020: error: invalid load alignment: 63\n0000020: error: invalid load alignment: 63\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/unterminated-annotation.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-annotations --enable-code-metadata\n;;; ERROR: 1\n(module\n   (func (@metadata.code.data \"this is a test\"\n(;; STDERR ;;;\nout/test/regress/unterminated-annotation.txt:6:1: error: unexpected token EOF, expected ).\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/unterminated-annotation2.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-annotations\n;;; ERROR: 1\n(module\n   (func (@hello \"this is a test\"\n(;; STDERR ;;;\nout/test/regress/unterminated-annotation2.txt:6:1: error: unterminated annotation\nout/test/regress/unterminated-annotation2.txt:6:1: error: unexpected token EOF, expected ).\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/regress/wasm2c-ehv3-setjmp-volatile.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS*: --enable-exceptions\n;;; NOTE: ref: issue-2469\n(module\n  (tag $e0)\n  (func $longjmp-bait (throw $e0))\n  (func (export \"setjmp-bait\") (param $return-early i32) (result i32)\n    (local $value i32)\n    (try $try\n      (do\n        (br_if $try (local.get $return-early))\n        (local.set $value (i32.const 1))\n        (call $longjmp-bait)\n      )\n      (catch $e0)\n    )\n    (local.get $value)\n  )\n)\n\n(assert_return (invoke \"setjmp-bait\" (i32.const 1)) (i32.const 0))\n(assert_return (invoke \"setjmp-bait\" (i32.const 0)) (i32.const 1))\n(;; STDOUT ;;;\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/wasm2c-try-br.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS: --debug-names --enable-exceptions\n(module\n  (func (export \"break-try\")\n    (try (do (br 0)) (delegate 0))\n  )\n)\n\n(assert_return (invoke \"break-try\"))\n(;; STDOUT ;;;\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/wasm2c-try-reset.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS*: --enable-exceptions\n(module\n  (tag $e0)\n  (func $throw (throw $e0))\n  (func (export \"break-throw\") (result i32)\n    (try $outer (result i32)\n      (do\n        (try (result i32)\n          (do\n            (block $a\n              (try (do (br $a)) (delegate $outer))\n            )\n            (call $throw)\n            (i32.const 0)\n          )\n          (catch $e0 (i32.const 1))\n        )\n      )\n      (catch $e0 (i32.const 2))\n    )\n  )\n)\n\n(assert_return (invoke \"break-throw\") (i32.const 1))\n(;; STDOUT ;;;\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/regress/write-memuse.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS*: --enable-multi-memory --debug-names --stdout\n(memory 0)\n(memory $k (data))\n(;; STDOUT ;;;\n(module\n  (memory (;0;) 0)\n  (memory $k 0 0)\n  (data (;0;) (memory $k) (i32.const 0) \"\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/apply-global-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n(module\n  (import \"m\" \"g\" (global $g i32))\n  (func)\n  (table 1 funcref)\n  (memory 1)\n\n  (global i32 (global.get $g))\n  (elem (global.get $g) 0)\n  (data (global.get $g) \"hi\")\n)\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (import \"m\" \"g\" (global $m.g i32))\n  (func $f0 (type $t0))\n  (table $T0 1 funcref)\n  (memory $M0 1)\n  (global $g1 i32 (global.get $m.g))\n  (elem $e0 (global.get $m.g) func $f0)\n  (data $d0 (global.get $m.g) \"hi\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/apply-memory-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names --enable-multi-memory\n(module\n  (memory 1)\n  (memory 1)\n  \n  (func\n    \n   i32.const 0\n   i32.const 0\n   i32.const 0\n   memory.copy (memory 0) (memory 1)\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $f0 (type $t0)\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy $M0 $M1)\n  (memory $M0 1)\n  (memory $M1 1))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/bulk-memory.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (memory 0)\n  (table 0 funcref)\n\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.init 0\n\n    data.drop 0\n\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy\n\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.fill\n\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.init 0\n\n    elem.drop 0\n\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.copy\n\n    )\n\n  (func)\n\n  (data \"hi\")\n  (elem funcref (ref.func 0) (ref.null func))\n  (elem func 1)\n\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.init 0\n    data.drop 0\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.copy\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.fill\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.init 0\n    elem.drop 0\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.copy)\n  (func (;1;) (type 0))\n  (table (;0;) 0 funcref)\n  (memory (;0;) 0)\n  (elem (;0;) funcref (ref.func 0) (ref.null func))\n  (elem (;1;) func 1)\n  (data (;0;) \"hi\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/bulk-memory64.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-memory64\n(module\n  (memory i64 0)\n  (table 0 funcref)\n\n  (func\n    i64.const 0\n    i32.const 0\n    i32.const 0\n    memory.init 0\n\n    data.drop 0\n\n    i64.const 0\n    i64.const 0\n    i64.const 0\n    memory.copy\n\n    i64.const 0\n    i32.const 0\n    i64.const 0\n    memory.fill\n\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.init 0\n\n    elem.drop 0\n\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.copy\n\n    )\n\n  (func)\n\n  (data \"hi\")\n  (elem funcref (ref.func 0) (ref.null func))\n  (elem func 1)\n\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    i64.const 0\n    i32.const 0\n    i32.const 0\n    memory.init 0\n    data.drop 0\n    i64.const 0\n    i64.const 0\n    i64.const 0\n    memory.copy\n    i64.const 0\n    i32.const 0\n    i64.const 0\n    memory.fill\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.init 0\n    elem.drop 0\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.copy)\n  (func (;1;) (type 0))\n  (table (;0;) 0 funcref)\n  (memory (;0;) i64 0)\n  (elem (;0;) funcref (ref.func 0) (ref.null func))\n  (elem (;1;) func 1)\n  (data (;0;) \"hi\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/code-metadata.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --enable-annotations --enable-code-metadata\n(module\n  (func $f (param i32) (result i32)\n    i32.const 1234\n    local.get 0\n    (@metadata.code.test \"aa\\01a\\ff\") i32.add\n    return))\n"
  },
  {
    "path": "test/roundtrip/custom-page-sizes.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS*: --stdout --enable-custom-page-sizes --enable-multi-memory --enable-memory64 --debug-names\n(module\n  (import \"n\" \"mem2\" (memory 23 (pagesize 1)))\n  (import \"o\" \"mem3\" (memory 24 25 (pagesize 1)))\n  (import \"n\" \"mem2\" (memory 23 (pagesize 65536)))\n  (import \"o\" \"mem3\" (memory 24 25 (pagesize 65536)))\n  (import \"n\" \"mem2\" (memory $g i64 23 (pagesize 1)))\n  (import \"o\" \"mem3\" (memory $h i64 24 25 (pagesize 1)))\n  (import \"n\" \"mem2\" (memory i64 23 (pagesize 65536)))\n  (import \"o\" \"mem3\" (memory i64 24 25 (pagesize 65536)))\n\n  (memory (import \"m\" \"mem1\") 107 (pagesize 1))\n  (memory (import \"m\" \"mem1\") 107 (pagesize 65536))\n  (memory $c (import \"m\" \"mem1\") i64 107 (pagesize 1))\n  (memory (import \"m\" \"mem1\") i64 107 (pagesize 65536))\n\n  (memory 57 (pagesize 1))\n  (memory 73 92 (pagesize 1))\n  (memory (pagesize 1) (data))\n  (memory (pagesize 1) (data \"xyz\"))\n  (memory 57 (pagesize 65536))\n  (memory 73 92 (pagesize 65536))\n  (memory (pagesize 65536) (data))\n  (memory (pagesize 65536) (data \"xyz\"))\n  (memory $a i64 57 (pagesize 1))\n  (memory $b i64 73 92 (pagesize 1))\n  (memory $d i64 (pagesize 1) (data))\n  (memory $e i64 (pagesize 1) (data \"xyz\"))\n  (memory $k i64 (data))\n  (memory $i i64 (pagesize 65536) (data))\n  (memory $j i64 (pagesize 65536) (data \"xyz\"))\n  (memory i64 57 (pagesize 65536))\n  (memory i64 73 92 (pagesize 65536))\n  (memory i64 (pagesize 65536) (data))\n  (memory i64 (pagesize 65536) (data \"xyz\"))\n\n  (memory 0xFFFF_FFFF (pagesize 1))\n  (memory i64 0xFFFF_FFFF_FFFF_FFFF (pagesize 1))\n  (memory 0x10000 (pagesize 0x10000))\n  (memory i64 0x1_0000_0000_0000 (pagesize 0x10000))\n)\n(;; STDOUT ;;;\n(module\n  (import \"n\" \"mem2\" (memory (;0;) 23 (pagesize 1)))\n  (import \"o\" \"mem3\" (memory (;1;) 24 25 (pagesize 1)))\n  (import \"n\" \"mem2\" (memory (;2;) 23))\n  (import \"o\" \"mem3\" (memory (;3;) 24 25))\n  (import \"n\" \"mem2\" (memory $g i64 23 (pagesize 1)))\n  (import \"o\" \"mem3\" (memory $h i64 24 25 (pagesize 1)))\n  (import \"n\" \"mem2\" (memory (;6;) i64 23))\n  (import \"o\" \"mem3\" (memory (;7;) i64 24 25))\n  (import \"m\" \"mem1\" (memory (;8;) 107 (pagesize 1)))\n  (import \"m\" \"mem1\" (memory (;9;) 107))\n  (import \"m\" \"mem1\" (memory $c i64 107 (pagesize 1)))\n  (import \"m\" \"mem1\" (memory (;11;) i64 107))\n  (memory (;12;) 57 (pagesize 1))\n  (memory (;13;) 73 92 (pagesize 1))\n  (memory (;14;) 0 0 (pagesize 1))\n  (memory (;15;) 3 3 (pagesize 1))\n  (memory (;16;) 57)\n  (memory (;17;) 73 92)\n  (memory (;18;) 0 0)\n  (memory (;19;) 1 1)\n  (memory $a i64 57 (pagesize 1))\n  (memory $b i64 73 92 (pagesize 1))\n  (memory $d i64 0 0 (pagesize 1))\n  (memory $e i64 3 3 (pagesize 1))\n  (memory $k i64 0 0)\n  (memory $i i64 0 0)\n  (memory $j i64 1 1)\n  (memory (;27;) i64 57)\n  (memory (;28;) i64 73 92)\n  (memory (;29;) i64 0 0)\n  (memory (;30;) i64 1 1)\n  (memory (;31;) 4294967295 (pagesize 1))\n  (memory (;32;) i64 18446744073709551615 (pagesize 1))\n  (memory (;33;) 65536)\n  (memory (;34;) i64 281474976710656)\n  (data (;0;) (memory 14) (i32.const 0) \"\")\n  (data (;1;) (memory 15) (i32.const 0) \"xyz\")\n  (data (;2;) (memory 18) (i32.const 0) \"\")\n  (data (;3;) (memory 19) (i32.const 0) \"xyz\")\n  (data (;4;) (memory $d) (i64.const 0) \"\")\n  (data (;5;) (memory $e) (i64.const 0) \"xyz\")\n  (data (;6;) (memory $k) (i64.const 0) \"\")\n  (data (;7;) (memory $i) (i64.const 0) \"\")\n  (data (;8;) (memory $j) (i64.const 0) \"xyz\")\n  (data (;9;) (memory 29) (i64.const 0) \"\")\n  (data (;10;) (memory 30) (i64.const 0) \"xyz\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/custom-sections.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --enable-annotations --stdout\n(module\n  (@custom \"stuff\" (before import) \"hello\")\n  (import \"a\" \"b\" (func (result i32)))\n  (@custom \"section\" \"nice\"))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (import \"a\" \"b\" (func (;0;) (type 0)))\n  (@custom \"stuff\" \"hello\")\n  (@custom \"section\" \"nice\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/debug-import-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --debug-names\n(module\n  (import \"bar\" \"foo\" (func $foo)))\n"
  },
  {
    "path": "test/roundtrip/debug-names-after-data.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --debug-names\n(module\n  (memory 1)\n  (data (i32.const 0) \"hi\")\n  (func $foo))\n"
  },
  {
    "path": "test/roundtrip/debug-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --debug-names\n(module $m1\n  (type $t1 (func (param i32 i64)))\n  (memory $foo_memory 1)\n  (table $bar_table 0 funcref)\n  (data $baz_data_seg (i32.const 1024) \"hello world\")\n  (elem $foo_elem_seg (i32.const 0) $f1 $f2)\n  (func $f1)\n  (func $f2 (param $p1 i32) (param $p2 i64)\n    (local $l1 f32)\n    (local $l2 f64)))\n"
  },
  {
    "path": "test/roundtrip/elem-declare.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (table 2 funcref)\n  (elem declare funcref (ref.func $f) (ref.null func))\n  (func $f)\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0))\n  (table (;0;) 2 funcref)\n  (elem (;0;) declare funcref (ref.func 0) (ref.null func)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/elem-nonzero-table.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (table 1 funcref)\n  (table 1 funcref)\n  (elem (table 1) (i32.const 0) 0)\n  (func)\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0))\n  (table (;0;) 1 funcref)\n  (table (;1;) 1 funcref)\n  (elem (;0;) (table 1) (i32.const 0) func 0))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-atomic-fence.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-threads\n(module\n  (func $f\n    atomic.fence\n    atomic.fence))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (atomic.fence)\n    (atomic.fence)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-atomic.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-threads\n\n(module\n  (memory 1 1 shared)\n  (func\n    i32.const 0 i32.const 0 memory.atomic.notify drop\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop\n\n    i32.const 0 i32.atomic.load drop\n    i32.const 0 i64.atomic.load drop\n    i32.const 0 i32.atomic.load8_u drop\n    i32.const 0 i32.atomic.load16_u drop\n    i32.const 0 i64.atomic.load8_u drop\n    i32.const 0 i64.atomic.load16_u drop\n    i32.const 0 i64.atomic.load32_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.store\n    i32.const 0 i64.const 0 i64.atomic.store\n    i32.const 0 i32.const 0 i32.atomic.store8\n    i32.const 0 i32.const 0 i32.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store8\n    i32.const 0 i64.const 0 i64.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store32\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.add drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.add drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.and drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.and drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.or drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.or drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop\n\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop\n\n))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (drop\n      (memory.atomic.notify\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (memory.atomic.wait32\n        (i32.const 0)\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (memory.atomic.wait64\n        (i32.const 0)\n        (i64.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.load\n        (i32.const 0)))\n    (drop\n      (i64.atomic.load\n        (i32.const 0)))\n    (drop\n      (i32.atomic.load8_u\n        (i32.const 0)))\n    (drop\n      (i32.atomic.load16_u\n        (i32.const 0)))\n    (drop\n      (i64.atomic.load8_u\n        (i32.const 0)))\n    (drop\n      (i64.atomic.load16_u\n        (i32.const 0)))\n    (drop\n      (i64.atomic.load32_u\n        (i32.const 0)))\n    (i32.atomic.store\n      (i32.const 0)\n      (i32.const 0))\n    (i64.atomic.store\n      (i32.const 0)\n      (i64.const 0))\n    (i32.atomic.store8\n      (i32.const 0)\n      (i32.const 0))\n    (i32.atomic.store16\n      (i32.const 0)\n      (i32.const 0))\n    (i64.atomic.store8\n      (i32.const 0)\n      (i64.const 0))\n    (i64.atomic.store16\n      (i32.const 0)\n      (i64.const 0))\n    (i64.atomic.store32\n      (i32.const 0)\n      (i64.const 0))\n    (drop\n      (i32.atomic.rmw.add\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw.add\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw8.add_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i32.atomic.rmw16.add_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw8.add_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw16.add_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw32.add_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw.sub\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw.sub\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw8.sub_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i32.atomic.rmw16.sub_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw8.sub_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw16.sub_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw32.sub_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw.and\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw.and\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw8.and_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i32.atomic.rmw16.and_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw8.and_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw16.and_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw32.and_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw.or\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw.or\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw8.or_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i32.atomic.rmw16.or_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw8.or_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw16.or_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw32.or_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw.xor\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw.xor\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw8.xor_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i32.atomic.rmw16.xor_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw8.xor_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw16.xor_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw32.xor_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw.xchg\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw.xchg\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw8.xchg_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i32.atomic.rmw16.xchg_u\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw8.xchg_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw16.xchg_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw32.xchg_u\n        (i32.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw.cmpxchg\n        (i32.const 0)\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw.cmpxchg\n        (i32.const 0)\n        (i64.const 0)\n        (i64.const 0)))\n    (drop\n      (i32.atomic.rmw8.cmpxchg_u\n        (i32.const 0)\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i32.atomic.rmw16.cmpxchg_u\n        (i32.const 0)\n        (i32.const 0)\n        (i32.const 0)))\n    (drop\n      (i64.atomic.rmw8.cmpxchg_u\n        (i32.const 0)\n        (i64.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw16.cmpxchg_u\n        (i32.const 0)\n        (i64.const 0)\n        (i64.const 0)))\n    (drop\n      (i64.atomic.rmw32.cmpxchg_u\n        (i32.const 0)\n        (i64.const 0)\n        (i64.const 0))))\n  (memory (;0;) 1 1 shared))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-basic.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n(module\n  (func $fold-binary (result i32)\n    i32.const 1\n    i32.const 2\n    i32.add)\n\n  (func $fold-binary-chain (result i32)\n    i32.const 1\n    i32.const 1\n    i32.const 1\n    i32.add\n    i32.sub)\n\n  (func $fold-compare (result i32)\n    f32.const 1\n    f32.const 2\n    f32.le)\n\n  (func $fold-unary (result f32)\n    f32.const 1\n    f32.neg\n    f32.neg)\n\n  (func $fold-convert (result i64)\n    f64.const 0\n    f32.demote_f64\n    i32.trunc_f32_s\n    i64.extend_i32_s)\n\n  (func $fold-select (result f32)\n    f32.const 1\n    f32.const 2\n    i32.const 3\n    select))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (type (;1;) (func (result f32)))\n  (type (;2;) (func (result i64)))\n  (func (;0;) (type 0) (result i32)\n    (i32.add\n      (i32.const 1)\n      (i32.const 2)))\n  (func (;1;) (type 0) (result i32)\n    (i32.sub\n      (i32.const 1)\n      (i32.add\n        (i32.const 1)\n        (i32.const 1))))\n  (func (;2;) (type 0) (result i32)\n    (f32.le\n      (f32.const 0x1p+0 (;=1;))\n      (f32.const 0x1p+1 (;=2;))))\n  (func (;3;) (type 1) (result f32)\n    (f32.neg\n      (f32.neg\n        (f32.const 0x1p+0 (;=1;)))))\n  (func (;4;) (type 2) (result i64)\n    (i64.extend_i32_s\n      (i32.trunc_f32_s\n        (f32.demote_f64\n          (f64.const 0x0p+0 (;=0;))))))\n  (func (;5;) (type 1) (result f32)\n    (select\n      (f32.const 0x1p+0 (;=1;))\n      (f32.const 0x1p+1 (;=2;))\n      (i32.const 3))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-block-labels.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-exceptions --debug-names\n(module\n  (func\n    block\n      br 0\n    end\n    block\n      br 0\n    end)\n\n  (func\n    block\n      br 0\n      block\n        br 0\n      end\n    end\n    block\n      br 0\n    end)\n\n  (func\n    (i32.const 0)\n    if\n      br 0\n    end\n    (i32.const 0)\n    if\n      br 0\n    end)\n\n  (func\n    loop\n      br 0\n    end\n    loop\n      br 0\n    end)\n\n  (func\n    try\n      br 0\n    catch_all\n    end\n    try\n      br 0\n    catch_all\n    end)\n  )\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (block  ;; label = @1\n      (br 0 (;@1;)))\n    (block  ;; label = @1\n      (br 0 (;@1;))))\n  (func (;1;) (type 0)\n    (block  ;; label = @1\n      (br 0 (;@1;))\n      (block  ;; label = @2\n        (br 0 (;@2;))))\n    (block  ;; label = @1\n      (br 0 (;@1;))))\n  (func (;2;) (type 0)\n    (if  ;; label = @1\n      (i32.const 0)\n      (then\n        (br 0 (;@1;))))\n    (if  ;; label = @1\n      (i32.const 0)\n      (then\n        (br 0 (;@1;)))))\n  (func (;3;) (type 0)\n    (loop  ;; label = @1\n      (br 0 (;@1;)))\n    (loop  ;; label = @1\n      (br 0 (;@1;))))\n  (func (;4;) (type 0)\n    (try  ;; label = @1\n      (do\n        (br 0 (;@1;)))\n      (catch_all))\n    (try  ;; label = @1\n      (do\n        (br 0 (;@1;)))\n      (catch_all))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-block.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --debug-names\n(module\n  (func $fold-block (result f32)\n    f32.const 2\n    block\n      f32.const 3\n      br 0\n    end\n    f32.const 1\n    f32.add)\n\n  (func $fold-block-br-value (result i32)\n    block (result i32)\n      i32.const 1\n      br 0\n    end)\n\n  (func $fold-loop\n    loop (result i64)\n      br 0\n      i64.const 1\n    end\n    drop)\n\n  (func $fold-loop-br (result i32)\n    loop (result i32)\n      i32.const 1\n      br 0\n    end)\n\n  (func $fold-if\n    i32.const 1\n    if\n      nop\n      nop\n    end)\n\n  (func $fold-if-else\n    i32.const 1\n    if (result i32)\n      i32.const 2\n    else\n      i32.const 3\n    end\n    drop)\n\n  (func $fold-if-else-br\n    i32.const 1\n    if (result i32)\n      i32.const 2\n      br 0\n    else\n      i32.const 3\n    end\n    drop))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result f32)))\n  (type (;1;) (func (result i32)))\n  (type (;2;) (func))\n  (func $fold-block (type 0) (result f32)\n    (f32.const 0x1p+1 (;=2;))\n    (block  ;; label = @1\n      (f32.const 0x1.8p+1 (;=3;))\n      (br 0 (;@1;)))\n    (f32.const 0x1p+0 (;=1;))\n    (f32.add))\n  (func $fold-block-br-value (type 1) (result i32)\n    (block (result i32)  ;; label = @1\n      (br 0 (;@1;)\n        (i32.const 1))))\n  (func $fold-loop (type 2)\n    (drop\n      (loop (result i64)  ;; label = @1\n        (br 0 (;@1;))\n        (i64.const 1))))\n  (func $fold-loop-br (type 1) (result i32)\n    (loop (result i32)  ;; label = @1\n      (i32.const 1)\n      (br 0 (;@1;))))\n  (func $fold-if (type 2)\n    (if  ;; label = @1\n      (i32.const 1)\n      (then\n        (nop)\n        (nop))))\n  (func $fold-if-else (type 2)\n    (drop\n      (if (result i32)  ;; label = @1\n        (i32.const 1)\n        (then\n          (i32.const 2))\n        (else\n          (i32.const 3)))))\n  (func $fold-if-else-br (type 2)\n    (drop\n      (if (result i32)  ;; label = @1\n        (i32.const 1)\n        (then\n          (br 0 (;@1;)\n            (i32.const 2)))\n        (else\n          (i32.const 3))))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-bulk-memory.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n\n(module\n  (memory 1)\n  (data \"a\")\n  (func\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n    data.drop 0\n    i32.const 0 i32.const 0 i32.const 0 memory.copy\n    i32.const 0 i32.const 0 i32.const 0 memory.fill\n  )\n\n  (table 1 funcref)\n  (elem func 0)\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n    elem.drop 0\n    i32.const 0 i32.const 0 i32.const 0 table.copy\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (memory.init 0\n      (i32.const 0)\n      (i32.const 0)\n      (i32.const 0))\n    (data.drop 0)\n    (memory.copy\n      (i32.const 0)\n      (i32.const 0)\n      (i32.const 0))\n    (memory.fill\n      (i32.const 0)\n      (i32.const 0)\n      (i32.const 0)))\n  (func (;1;) (type 0)\n    (table.init 0\n      (i32.const 0)\n      (i32.const 0)\n      (i32.const 0))\n    (elem.drop 0)\n    (table.copy\n      (i32.const 0)\n      (i32.const 0)\n      (i32.const 0)))\n  (table (;0;) 1 funcref)\n  (memory (;0;) 1)\n  (elem (;0;) func 0)\n  (data (;0;) \"a\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-call-import-gen-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --generate-names\n(module\n  (import \"a\" \"b\" (func (param i32) (result i32)))\n\n  (func (export \"c\") (param i64) (result i32)\n    local.get 0\n    i32.wrap_i64)\n\n  ;; Make sure that calls are folded properly when referencing generated names\n  ;; (there was a bug here).\n\n  (func (result i32)\n    i32.const 1\n    call 0\n    i32.const 2\n    call 0\n    i32.add\n\n    i64.const 3\n    call 1\n    drop))\n\n(;; STDOUT ;;;\n(module\n  (type $t0 (func (param i32) (result i32)))\n  (type $t1 (func (param i64) (result i32)))\n  (type $t2 (func (result i32)))\n  (import \"a\" \"b\" (func $a.b (type $t0)))\n  (func $c (type $t1) (param $p0 i64) (result i32)\n    (i32.wrap_i64\n      (local.get $p0)))\n  (func $f2 (type $t2) (result i32)\n    (i32.add\n      (call $a.b\n        (i32.const 1))\n      (call $a.b\n        (i32.const 2)))\n    (drop\n      (call $c\n        (i64.const 3))))\n  (export \"c\" (func $c)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-call.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n(module\n  (type $i_i (func (param i32) (result i32)))\n\n  (func $i_i (type $i_i)\n    i32.const 1)\n\n  (func $if_f (param i32 f32) (result f32)\n    f32.const 0)\n\n  (func $ffff_v (param f32 f32 f32 f32))\n\n  (func $fold-call (result i32)\n    i32.const 1\n    call $i_i\n    drop\n    i32.const 2\n    call $i_i)\n\n  (func $fold-call-2\n    f32.const 0\n    f32.const 1\n    f32.const 2\n    i32.const 3\n    f32.const 4\n    call $if_f\n    call $ffff_v)\n\n  (table funcref (elem $i_i $if_f))\n  (func $fold-call-indirect (result i32)\n    i32.const 1\n    i32.const 2\n    call_indirect (type $i_i))\n)\n\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32) (result i32)))\n  (type (;1;) (func (param i32 f32) (result f32)))\n  (type (;2;) (func (param f32 f32 f32 f32)))\n  (type (;3;) (func (result i32)))\n  (type (;4;) (func))\n  (func (;0;) (type 0) (param i32) (result i32)\n    (i32.const 1))\n  (func (;1;) (type 1) (param i32 f32) (result f32)\n    (f32.const 0x0p+0 (;=0;)))\n  (func (;2;) (type 2) (param f32 f32 f32 f32))\n  (func (;3;) (type 3) (result i32)\n    (drop\n      (call 0\n        (i32.const 1)))\n    (call 0\n      (i32.const 2)))\n  (func (;4;) (type 4)\n    (call 2\n      (f32.const 0x0p+0 (;=0;))\n      (f32.const 0x1p+0 (;=1;))\n      (f32.const 0x1p+1 (;=2;))\n      (call 1\n        (i32.const 3)\n        (f32.const 0x1p+2 (;=4;)))))\n  (func (;5;) (type 3) (result i32)\n    (call_indirect (type 0)\n      (i32.const 1)\n      (i32.const 2)))\n  (table (;0;) 2 2 funcref)\n  (elem (;0;) (i32.const 0) func 0 1))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-callref.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-function-references\n(module\n  (func $i32_r_i32 (type $i_i)\n    i32.const 1)\n\n  (func $i32_f32_r_f32 (type $if_f)\n    f32.const 0)\n\n  (func $f32_f32_f32_f32_r_v (type $ffff))\n\n  (elem declare funcref (ref.func $i32_r_i32) (ref.func $i32_f32_r_f32) (ref.func $f32_f32_f32_f32_r_v))\n\n  (func $fold-callref (result i32)\n    i32.const 1\n    ref.func $i32_r_i32\n    call_ref $i_i\n    drop\n    i32.const 2\n    ref.func $i32_r_i32\n    call_ref $i_i)\n\n  (func $fold-call-2\n    f32.const 0\n    f32.const 1\n    f32.const 2\n    i32.const 3\n    f32.const 4\n    ref.func $i32_f32_r_f32\n    call_ref $if_f\n    ref.func $f32_f32_f32_f32_r_v\n    call_ref $ffff)\n\n  (type $i_i (func (param i32) (result i32)))\n  (type $if_f (func (param i32 f32) (result f32)))\n  (type $ffff (func (param f32 f32 f32 f32)))\n)\n\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32) (result i32)))\n  (type (;1;) (func (param i32 f32) (result f32)))\n  (type (;2;) (func (param f32 f32 f32 f32)))\n  (type (;3;) (func (result i32)))\n  (type (;4;) (func))\n  (func (;0;) (type 0) (param i32) (result i32)\n    (i32.const 1))\n  (func (;1;) (type 1) (param i32 f32) (result f32)\n    (f32.const 0x0p+0 (;=0;)))\n  (func (;2;) (type 2) (param f32 f32 f32 f32))\n  (func (;3;) (type 3) (result i32)\n    (drop\n      (call_ref 0\n        (i32.const 1)\n        (ref.func 0)))\n    (call_ref 0\n      (i32.const 2)\n      (ref.func 0)))\n  (func (;4;) (type 4)\n    (call_ref 2\n      (f32.const 0x0p+0 (;=0;))\n      (f32.const 0x1p+0 (;=1;))\n      (f32.const 0x1p+1 (;=2;))\n      (call_ref 1\n        (i32.const 3)\n        (f32.const 0x1p+2 (;=4;))\n        (ref.func 1))\n      (ref.func 2)))\n  (elem (;0;) declare funcref (ref.func 0) (ref.func 1) (ref.func 2)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-fac.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --debug-names --generate-names\n(module\n  (func $fac-stack-raw (param $n i64) (result i64)\n    (local $i i64)\n    (local $res i64)\n    local.get $n\n    local.set $i\n    i64.const 1\n    local.set $res\n    block $done\n      loop $loop\n        local.get $i\n        i64.const 0\n        i64.eq\n        if $body\n          br $done\n        else $body\n          local.get $i\n          local.get $res\n          i64.mul\n          local.set $res\n          local.get $i\n          i64.const 1\n          i64.sub\n          local.set $i\n        end $body\n        br $loop\n      end $loop\n    end $done\n    local.get $res))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func (param i64) (result i64)))\n  (func $fac-stack-raw (type $t0) (param $n i64) (result i64)\n    (local $i i64) (local $res i64)\n    (local.set $i\n      (local.get $n))\n    (local.set $res\n      (i64.const 1))\n    (block $B0\n      (loop $L1\n        (if $I2\n          (i64.eq\n            (local.get $i)\n            (i64.const 0))\n          (then\n            (br $B0))\n          (else\n            (local.set $res\n              (i64.mul\n                (local.get $i)\n                (local.get $res)))\n            (local.set $i\n              (i64.sub\n                (local.get $i)\n                (i64.const 1)))))\n        (br $L1)))\n    (local.get $res)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-function-references.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; SKIP: requires fix to parser for typed function refs (#1889)\n;;; ARGS: --stdout --fold-exprs --enable-function-references\n(module\n  (type $f32-f32 (func (param f32) (result f32)))\n\n  (func $deriv (param $f (ref $f32-f32)) (param $x f32) (param $delta f32) (result f32)\n    (f32.div\n      (f32.sub (call_ref (f32.add (local.get $delta) (local.get $x)) (local.get $f))\n               (call_ref (local.get $x) (local.get $f))\n      )\n      (local.get $delta)\n    )\n  )\n\n  (func $choice (param $f (ref $f32-f32))\n                (param $g (ref $f32-f32))\n                (param $cond i32)\n                (result (ref $f32-f32))\n    (if (result (ref $f32-f32))\n      (i32.eq\n        (local.get $cond)\n        (i32.const 1)\n      )\n      (then\n        (local.get $f)\n      )\n      (else\n        (local.get $g)\n      )\n    )\n  )\n\n  (func $square (param $x f32) (result f32)\n    (f32.mul (local.get $x)\n             (local.get $x))\n  )\n\n  (func $double (param $x f32) (result f32)\n    (f32.add (local.get $x)\n             (local.get $x))\n  )\n\n  (func (export \"main\") (result f32)\n    (call $deriv (call $choice (ref.func $square) (ref.func $double) (i32.const 1))\n                 (f32.const 1.0)\n                 (f32.const 0.01)\n    )\n  )\n\n  (elem declare funcref (ref.func $square) (ref.func $double))\n)\n\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param f32) (result f32)))\n  (type (;1;) (func (param (ref 0) f32 f32) (result f32)))\n  (type (;2;) (func (param (ref 0) (ref 0) i32) (result (ref 0))))\n  (type (;3;) (func (result f32)))\n  (func (;0;) (type 1) (param (ref 0) f32 f32) (result f32)\n    (f32.div\n      (f32.sub\n        (f32.add\n          (local.get 2)\n          (local.get 1))\n        (call_ref (local.get 0)\n          (call_ref)\n          (local.get 1)\n          (local.get 0)))\n      (local.get 2)))\n  (func (;1;) (type 2) (param (ref 0) (ref 0) i32) (result (ref 0))\n    (if (result (ref 0))  ;; label = @1\n      (i32.eq\n        (local.get 2)\n        (i32.const 1))\n      (then\n        (local.get 0))\n      (else\n        (local.get 1))))\n  (func (;2;) (type 0) (param f32) (result f32)\n    (f32.mul\n      (local.get 0)\n      (local.get 0)))\n  (func (;3;) (type 0) (param f32) (result f32)\n    (f32.add\n      (local.get 0)\n      (local.get 0)))\n  (func (;4;) (type 3) (result f32)\n    (call 0\n      (call 1\n        (ref.func 2)\n        (ref.func 3)\n        (i32.const 1))\n      (f32.const 0x1p+0 (;=1;))\n      (f32.const 0x1.47ae14p-7 (;=0.01;))))\n  (export \"main\" (func 4))\n  (elem (;0;) declare func 2 3))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-global-getset.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n(module\n  (global (mut i32) (i32.const 1))\n  (global (mut f32) (f32.const 1.5))\n\n  (func $fold-global-get (result i32)\n    global.get 1\n    drop\n    global.get 0\n    global.get 0\n    i32.mul)\n\n  (func $fold-global-set\n    global.get 0\n    i32.const 1\n    i32.add\n    global.set 0\n    f32.const 2\n    global.set 1)\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (type (;1;) (func))\n  (func (;0;) (type 0) (result i32)\n    (drop\n      (global.get 1))\n    (i32.mul\n      (global.get 0)\n      (global.get 0)))\n  (func (;1;) (type 1)\n    (global.set 0\n      (i32.add\n        (global.get 0)\n        (i32.const 1)))\n    (global.set 1\n      (f32.const 0x1p+1 (;=2;))))\n  (global (;0;) (mut i32) (i32.const 1))\n  (global (;1;) (mut f32) (f32.const 0x1.8p+0 (;=1.5;))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-load-store.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n(module\n  (memory 1)\n  (func $fold-load\n    i32.const 1\n    i32.load\n    drop\n    i32.const 2\n    i32.load\n    drop)\n\n  (func $fold-store\n    i32.const 1\n    i32.load\n    f32.const 2\n    f32.store)\n\n  (func $fold-memory-size (result i32)\n    memory.size\n    i32.const 1\n    i32.add\n    drop\n    i32.const 2)\n\n  (func $fold-memory-grow (result i32)\n    i32.const 1\n    i32.const 2\n    memory.grow\n    i32.lt_s))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (type (;1;) (func (result i32)))\n  (func (;0;) (type 0)\n    (drop\n      (i32.load\n        (i32.const 1)))\n    (drop\n      (i32.load\n        (i32.const 2))))\n  (func (;1;) (type 0)\n    (f32.store\n      (i32.load\n        (i32.const 1))\n      (f32.const 0x1p+1 (;=2;))))\n  (func (;2;) (type 1) (result i32)\n    (drop\n      (i32.add\n        (memory.size)\n        (i32.const 1)))\n    (i32.const 2))\n  (func (;3;) (type 1) (result i32)\n    (i32.lt_s\n      (i32.const 1)\n      (memory.grow\n        (i32.const 2))))\n  (memory (;0;) 1))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-load-store64.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-memory64\n(module\n  (memory i64 1)\n  (func $fold-load\n    i64.const 1\n    i32.load\n    drop\n    i64.const 2\n    i32.load\n    drop)\n\n  (func $fold-store\n    i64.const 1\n    i64.load\n    f32.const 2\n    f32.store)\n\n  (func $fold-memory-size (result i32)\n    memory.size\n    i64.const 1\n    i64.add\n    drop\n    i32.const 2)\n\n  (func $fold-memory-grow (result i32)\n    i64.const 1\n    i64.const 2\n    memory.grow\n    i64.lt_s))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (type (;1;) (func (result i32)))\n  (func (;0;) (type 0)\n    (drop\n      (i32.load\n        (i64.const 1)))\n    (drop\n      (i32.load\n        (i64.const 2))))\n  (func (;1;) (type 0)\n    (f32.store\n      (i64.load\n        (i64.const 1))\n      (f32.const 0x1p+1 (;=2;))))\n  (func (;2;) (type 1) (result i32)\n    (drop\n      (i64.add\n        (memory.size)\n        (i64.const 1)))\n    (i32.const 2))\n  (func (;3;) (type 1) (result i32)\n    (i64.lt_s\n      (i64.const 1)\n      (memory.grow\n        (i64.const 2))))\n  (memory (;0;) i64 1))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-local-getset.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n(module\n  (func $fold-local-get (result f32)\n    (local f32 f32 f64 f64)\n    local.get 0\n    local.get 1\n    f32.add\n    local.get 2\n    local.get 3\n    f64.add\n    f32.demote_f64\n    f32.add)\n\n  (func $fold-local-set\n    (local i64 i32)\n    i64.const 1\n    i64.const 2\n    i64.const 3\n    i64.xor\n    i64.xor\n    local.set 0\n    i32.const 4\n    local.set 1)\n\n  (func $fold-local-tee (result i32)\n    (local i32 i32)\n    i32.const 1\n    local.tee 0\n    i32.const 2\n    local.tee 1\n    i32.add)\n  )\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result f32)))\n  (type (;1;) (func))\n  (type (;2;) (func (result i32)))\n  (func (;0;) (type 0) (result f32)\n    (local f32 f32 f64 f64)\n    (f32.add\n      (f32.add\n        (local.get 0)\n        (local.get 1))\n      (f32.demote_f64\n        (f64.add\n          (local.get 2)\n          (local.get 3)))))\n  (func (;1;) (type 1)\n    (local i64 i32)\n    (local.set 0\n      (i64.xor\n        (i64.const 1)\n        (i64.xor\n          (i64.const 2)\n          (i64.const 3))))\n    (local.set 1\n      (i32.const 4)))\n  (func (;2;) (type 2) (result i32)\n    (local i32 i32)\n    (i32.add\n      (local.tee 0\n        (i32.const 1))\n      (local.tee 1\n        (i32.const 2)))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-multi.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n(module\n  (func $dup (result i32 i32)\n    i32.const 0\n    i32.const 1\n  )\n\n  (func $fold-two (result i32)\n    call $dup\n    i32.add\n  )\n\n  (func $cant-fold (result i32)\n    call $dup\n    i32.const 1\n    i32.add\n    drop\n  )\n\n  (func $partial-fold (result i32)\n    call $dup\n    call $dup\n    i32.add\n    i32.sub\n    drop\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32 i32)))\n  (type (;1;) (func (result i32)))\n  (func (;0;) (type 0) (result i32 i32)\n    (i32.const 0)\n    (i32.const 1))\n  (func (;1;) (type 1) (result i32)\n    (i32.add\n      (call 0)))\n  (func (;2;) (type 1) (result i32)\n    (call 0)\n    (i32.const 1)\n    (i32.add)\n    (drop))\n  (func (;3;) (type 1) (result i32)\n    (call 0)\n    (i32.add\n      (call 0))\n    (i32.sub)\n    (drop)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-nop.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n(module\n  (func (result i32)\n    i32.const 1\n    i32.const 2\n    nop\n    i32.add))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (func (;0;) (type 0) (result i32)\n    (i32.const 1)\n    (i32.const 2)\n    (nop)\n    (i32.add)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-reference-types.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n\n(module\n  (table $t 1 externref)\n  (elem declare func 0)\n  (func\n    (local externref)\n\n    i32.const 0 table.get $t drop\n    i32.const 0 local.get 0 table.set $t\n    local.get 0 i32.const 0 table.grow $t drop\n    table.size $t drop\n    i32.const 0 local.get 0 i32.const 0 table.fill $t\n    ref.null extern drop\n    local.get 0 ref.is_null drop\n    ref.func 0 drop\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (local externref)\n    (drop\n      (table.get 0\n        (i32.const 0)))\n    (table.set 0\n      (i32.const 0)\n      (local.get 0))\n    (drop\n      (table.grow 0\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (table.size 0))\n    (table.fill 0\n      (i32.const 0)\n      (local.get 0)\n      (i32.const 0))\n    (drop\n      (ref.null extern))\n    (drop\n      (ref.is_null\n        (local.get 0)))\n    (drop\n      (ref.func 0)))\n  (table (;0;) 1 externref)\n  (elem (;0;) declare func 0))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-rethrow.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-exceptions\n(module\n  (tag $e0 (param i32))\n\n  (func\n    try\n    catch $e0\n      rethrow 0\n    end\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32)))\n  (type (;1;) (func))\n  (func (;0;) (type 1)\n    (try  ;; label = @1\n      (do)\n      (catch 0\n        (rethrow 0 (;@1;)))))\n  (tag (;0;) (type 0) (param i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-simd.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs\n\n(module\n  (memory 1)\n  (func\n    (local v128)\n    i32.const 0 v128.load drop\n    i32.const 0 v128.load8x8_s drop\n    i32.const 0 v128.load8x8_u drop\n    i32.const 0 v128.load16x4_s drop\n    i32.const 0 v128.load16x4_u drop\n    i32.const 0 v128.load32x2_s drop\n    i32.const 0 v128.load32x2_u drop\n    i32.const 0 v128.load8_splat drop\n    i32.const 0 v128.load16_splat drop\n    i32.const 0 v128.load32_splat drop\n    i32.const 0 v128.load64_splat drop\n    i32.const 0 local.get 0 v128.store\n    v128.const i32x4 0 0 0 0 drop\n\n    i32.const 0 local.get 0 v128.load8_lane 0 drop\n    i32.const 0 local.get 0 v128.load16_lane 0 drop\n    i32.const 0 local.get 0 v128.load32_lane 0 drop\n    i32.const 0 local.get 0 v128.load64_lane 0 drop\n    i32.const 0 local.get 0 v128.store8_lane 0\n    i32.const 0 local.get 0 v128.store16_lane 0\n    i32.const 0 local.get 0 v128.store32_lane 0\n    i32.const 0 local.get 0 v128.store64_lane 0\n\n    local.get 0 local.get 0 i8x16.shuffle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 drop\n    local.get 0 local.get 0 i8x16.swizzle drop\n\n    i32.const 0 i8x16.splat drop\n    i32.const 0 i16x8.splat drop\n    i32.const 0 i32x4.splat drop\n    i64.const 0 i64x2.splat drop\n    f32.const 0 f32x4.splat drop\n    f64.const 0 f64x2.splat drop\n    local.get 0 i8x16.extract_lane_s 0 drop\n    local.get 0 i8x16.extract_lane_u 0 drop\n    local.get 0 i32.const 0 i8x16.replace_lane 0 drop\n    local.get 0 i16x8.extract_lane_s 0 drop\n    local.get 0 i16x8.extract_lane_u 0 drop\n    local.get 0 i32.const 0 i16x8.replace_lane 0 drop\n    local.get 0 i32x4.extract_lane 0 drop\n    local.get 0 i32.const 0 i32x4.replace_lane 0 drop\n    local.get 0 i64x2.extract_lane 0 drop\n    local.get 0 i64.const 0 i64x2.replace_lane 0 drop\n    local.get 0 f32x4.extract_lane 0 drop\n    local.get 0 f32.const 0 f32x4.replace_lane 0 drop\n    local.get 0 f64x2.extract_lane 0 drop\n    local.get 0 f64.const 0 f64x2.replace_lane 0 drop\n\n    local.get 0 local.get 0 i8x16.eq drop\n    local.get 0 local.get 0 i8x16.ne drop\n    local.get 0 local.get 0 i8x16.lt_s drop\n    local.get 0 local.get 0 i8x16.lt_u drop\n    local.get 0 local.get 0 i8x16.gt_s drop\n    local.get 0 local.get 0 i8x16.gt_u drop\n    local.get 0 local.get 0 i8x16.le_s drop\n    local.get 0 local.get 0 i8x16.le_u drop\n    local.get 0 local.get 0 i8x16.ge_s drop\n    local.get 0 local.get 0 i8x16.ge_u drop\n    local.get 0 local.get 0 i16x8.eq drop\n    local.get 0 local.get 0 i16x8.ne drop\n    local.get 0 local.get 0 i16x8.lt_s drop\n    local.get 0 local.get 0 i16x8.lt_u drop\n    local.get 0 local.get 0 i16x8.gt_s drop\n    local.get 0 local.get 0 i16x8.gt_u drop\n    local.get 0 local.get 0 i16x8.le_s drop\n    local.get 0 local.get 0 i16x8.le_u drop\n    local.get 0 local.get 0 i16x8.ge_s drop\n    local.get 0 local.get 0 i16x8.ge_u drop\n    local.get 0 local.get 0 i32x4.eq drop\n    local.get 0 local.get 0 i32x4.ne drop\n    local.get 0 local.get 0 i32x4.lt_s drop\n    local.get 0 local.get 0 i32x4.lt_u drop\n    local.get 0 local.get 0 i32x4.gt_s drop\n    local.get 0 local.get 0 i32x4.gt_u drop\n    local.get 0 local.get 0 i32x4.le_s drop\n    local.get 0 local.get 0 i32x4.le_u drop\n    local.get 0 local.get 0 i32x4.ge_s drop\n    local.get 0 local.get 0 i32x4.ge_u drop\n    local.get 0 local.get 0 f32x4.eq drop\n    local.get 0 local.get 0 f32x4.ne drop\n    local.get 0 local.get 0 f32x4.lt drop\n    local.get 0 local.get 0 f32x4.gt drop\n    local.get 0 local.get 0 f32x4.le drop\n    local.get 0 local.get 0 f32x4.ge drop\n    local.get 0 local.get 0 f64x2.eq drop\n    local.get 0 local.get 0 f64x2.ne drop\n    local.get 0 local.get 0 f64x2.lt drop\n    local.get 0 local.get 0 f64x2.gt drop\n    local.get 0 local.get 0 f64x2.le drop\n    local.get 0 local.get 0 f64x2.ge drop\n\n    local.get 0 v128.not drop\n    local.get 0 local.get 0 v128.and drop\n    local.get 0 local.get 0 v128.andnot drop\n    local.get 0 local.get 0 v128.or drop\n    local.get 0 local.get 0 v128.xor drop\n    local.get 0 local.get 0 local.get 0 v128.bitselect drop\n    local.get 0 v128.any_true drop\n\n    local.get 0 i8x16.abs drop\n    local.get 0 i8x16.neg drop\n    local.get 0 i8x16.all_true drop\n    local.get 0 local.get 0 i8x16.narrow_i16x8_s drop\n    local.get 0 local.get 0 i8x16.narrow_i16x8_u drop\n    local.get 0 i32.const 0 i8x16.shl drop\n    local.get 0 i32.const 0 i8x16.shr_s drop\n    local.get 0 i32.const 0 i8x16.shr_u drop\n    local.get 0 local.get 0 i8x16.add drop\n    local.get 0 local.get 0 i8x16.add_sat_s drop\n    local.get 0 local.get 0 i8x16.add_sat_u drop\n    local.get 0 local.get 0 i8x16.sub drop\n    local.get 0 local.get 0 i8x16.sub_sat_s drop\n    local.get 0 local.get 0 i8x16.sub_sat_u drop\n    local.get 0 local.get 0 i8x16.min_s drop\n    local.get 0 local.get 0 i8x16.min_u drop\n    local.get 0 local.get 0 i8x16.max_s drop\n    local.get 0 local.get 0 i8x16.max_u drop\n    local.get 0 local.get 0 i8x16.avgr_u drop\n\n    local.get 0 i16x8.abs drop\n    local.get 0 i16x8.neg drop\n    local.get 0 i16x8.all_true drop\n    local.get 0 local.get 0 i16x8.narrow_i32x4_s drop\n    local.get 0 local.get 0 i16x8.narrow_i32x4_u drop\n    local.get 0 i16x8.extend_low_i8x16_s drop\n    local.get 0 i16x8.extend_high_i8x16_s drop\n    local.get 0 i16x8.extend_low_i8x16_u drop\n    local.get 0 i16x8.extend_high_i8x16_u drop\n    local.get 0 i32.const 0 i16x8.shl drop\n    local.get 0 i32.const 0 i16x8.shr_s drop\n    local.get 0 i32.const 0 i16x8.shr_u drop\n    local.get 0 local.get 0 i16x8.add drop\n    local.get 0 local.get 0 i16x8.add_sat_s drop\n    local.get 0 local.get 0 i16x8.add_sat_u drop\n    local.get 0 local.get 0 i16x8.sub drop\n    local.get 0 local.get 0 i16x8.sub_sat_s drop\n    local.get 0 local.get 0 i16x8.sub_sat_u drop\n    local.get 0 local.get 0 i16x8.mul drop\n    local.get 0 local.get 0 i16x8.min_s drop\n    local.get 0 local.get 0 i16x8.min_u drop\n    local.get 0 local.get 0 i16x8.max_s drop\n    local.get 0 local.get 0 i16x8.max_u drop\n    local.get 0 local.get 0 i16x8.avgr_u drop\n\n    local.get 0 i32x4.abs drop\n    local.get 0 i32x4.neg drop\n    local.get 0 i32x4.all_true drop\n    local.get 0 i32x4.extend_low_i16x8_s drop\n    local.get 0 i32x4.extend_high_i16x8_s drop\n    local.get 0 i32x4.extend_low_i16x8_u drop\n    local.get 0 i32x4.extend_high_i16x8_u drop\n    local.get 0 i32.const 0 i32x4.shl drop\n    local.get 0 i32.const 0 i32x4.shr_s drop\n    local.get 0 i32.const 0 i32x4.shr_u drop\n    local.get 0 local.get 0 i32x4.add drop\n    local.get 0 local.get 0 i32x4.sub drop\n    local.get 0 local.get 0 i32x4.mul drop\n    local.get 0 local.get 0 i32x4.min_s drop\n    local.get 0 local.get 0 i32x4.min_u drop\n    local.get 0 local.get 0 i32x4.max_s drop\n    local.get 0 local.get 0 i32x4.max_u drop\n\n    local.get 0 i64x2.neg drop\n    local.get 0 i32.const 0 i64x2.shl drop\n    local.get 0 i32.const 0 i64x2.shr_s drop\n    local.get 0 i32.const 0 i64x2.shr_u drop\n    local.get 0 local.get 0 i64x2.add drop\n    local.get 0 local.get 0 i64x2.sub drop\n    local.get 0 local.get 0 i64x2.mul drop\n\n    local.get 0 f32x4.abs drop\n    local.get 0 f32x4.neg drop\n    local.get 0 f32x4.sqrt drop\n    local.get 0 local.get 0 f32x4.add drop\n    local.get 0 local.get 0 f32x4.sub drop\n    local.get 0 local.get 0 f32x4.mul drop\n    local.get 0 local.get 0 f32x4.div drop\n    local.get 0 local.get 0 f32x4.min drop\n    local.get 0 local.get 0 f32x4.max drop\n\n    local.get 0 f64x2.abs drop\n    local.get 0 f64x2.neg drop\n    local.get 0 f64x2.sqrt drop\n    local.get 0 local.get 0 f64x2.add drop\n    local.get 0 local.get 0 f64x2.sub drop\n    local.get 0 local.get 0 f64x2.mul drop\n    local.get 0 local.get 0 f64x2.div drop\n    local.get 0 local.get 0 f64x2.min drop\n    local.get 0 local.get 0 f64x2.max drop\n\n    local.get 0 i32x4.trunc_sat_f32x4_s drop\n    local.get 0 i32x4.trunc_sat_f32x4_u drop\n    local.get 0 f32x4.convert_i32x4_s drop\n    local.get 0 f32x4.convert_i32x4_u drop\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (local v128)\n    (drop\n      (v128.load\n        (i32.const 0)))\n    (drop\n      (v128.load8x8_s\n        (i32.const 0)))\n    (drop\n      (v128.load8x8_u\n        (i32.const 0)))\n    (drop\n      (v128.load16x4_s\n        (i32.const 0)))\n    (drop\n      (v128.load16x4_u\n        (i32.const 0)))\n    (drop\n      (v128.load32x2_s\n        (i32.const 0)))\n    (drop\n      (v128.load32x2_u\n        (i32.const 0)))\n    (drop\n      (v128.load8_splat\n        (i32.const 0)))\n    (drop\n      (v128.load16_splat\n        (i32.const 0)))\n    (drop\n      (v128.load32_splat\n        (i32.const 0)))\n    (drop\n      (v128.load64_splat\n        (i32.const 0)))\n    (v128.store\n      (i32.const 0)\n      (local.get 0))\n    (drop\n      (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000))\n    (drop\n      (v128.load8_lane 0\n        (i32.const 0)\n        (local.get 0)))\n    (drop\n      (v128.load16_lane 0\n        (i32.const 0)\n        (local.get 0)))\n    (drop\n      (v128.load32_lane 0\n        (i32.const 0)\n        (local.get 0)))\n    (drop\n      (v128.load64_lane 0\n        (i32.const 0)\n        (local.get 0)))\n    (v128.store8_lane 0\n      (i32.const 0)\n      (local.get 0))\n    (v128.store16_lane 0\n      (i32.const 0)\n      (local.get 0))\n    (v128.store32_lane 0\n      (i32.const 0)\n      (local.get 0))\n    (v128.store64_lane 0\n      (i32.const 0)\n      (local.get 0))\n    (drop\n      (i8x16.shuffle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.swizzle\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.splat\n        (i32.const 0)))\n    (drop\n      (i16x8.splat\n        (i32.const 0)))\n    (drop\n      (i32x4.splat\n        (i32.const 0)))\n    (drop\n      (i64x2.splat\n        (i64.const 0)))\n    (drop\n      (f32x4.splat\n        (f32.const 0x0p+0 (;=0;))))\n    (drop\n      (f64x2.splat\n        (f64.const 0x0p+0 (;=0;))))\n    (drop\n      (i8x16.extract_lane_s 0\n        (local.get 0)))\n    (drop\n      (i8x16.extract_lane_u 0\n        (local.get 0)))\n    (drop\n      (i8x16.replace_lane 0\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i16x8.extract_lane_s 0\n        (local.get 0)))\n    (drop\n      (i16x8.extract_lane_u 0\n        (local.get 0)))\n    (drop\n      (i16x8.replace_lane 0\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i32x4.extract_lane 0\n        (local.get 0)))\n    (drop\n      (i32x4.replace_lane 0\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i64x2.extract_lane 0\n        (local.get 0)))\n    (drop\n      (i64x2.replace_lane 0\n        (local.get 0)\n        (i64.const 0)))\n    (drop\n      (f32x4.extract_lane 0\n        (local.get 0)))\n    (drop\n      (f32x4.replace_lane 0\n        (local.get 0)\n        (f32.const 0x0p+0 (;=0;))))\n    (drop\n      (f64x2.extract_lane 0\n        (local.get 0)))\n    (drop\n      (f64x2.replace_lane 0\n        (local.get 0)\n        (f64.const 0x0p+0 (;=0;))))\n    (drop\n      (i8x16.eq\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.ne\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.lt_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.lt_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.gt_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.gt_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.le_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.le_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.ge_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.ge_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.eq\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.ne\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.lt_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.lt_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.gt_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.gt_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.le_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.le_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.ge_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.ge_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.eq\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.ne\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.lt_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.lt_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.gt_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.gt_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.le_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.le_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.ge_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.ge_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.eq\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.ne\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.lt\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.gt\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.le\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.ge\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.eq\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.ne\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.lt\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.gt\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.le\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.ge\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (v128.not\n        (local.get 0)))\n    (drop\n      (v128.and\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (v128.andnot\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (v128.or\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (v128.xor\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (v128.bitselect\n        (local.get 0)\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (v128.any_true\n        (local.get 0)))\n    (drop\n      (i8x16.abs\n        (local.get 0)))\n    (drop\n      (i8x16.neg\n        (local.get 0)))\n    (drop\n      (i8x16.all_true\n        (local.get 0)))\n    (drop\n      (i8x16.narrow_i16x8_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.narrow_i16x8_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.shl\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i8x16.shr_s\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i8x16.shr_u\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i8x16.add\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.add_sat_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.add_sat_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.sub\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.sub_sat_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.sub_sat_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.min_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.min_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.max_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.max_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i8x16.avgr_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.abs\n        (local.get 0)))\n    (drop\n      (i16x8.neg\n        (local.get 0)))\n    (drop\n      (i16x8.all_true\n        (local.get 0)))\n    (drop\n      (i16x8.narrow_i32x4_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.narrow_i32x4_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.extend_low_i8x16_s\n        (local.get 0)))\n    (drop\n      (i16x8.extend_high_i8x16_s\n        (local.get 0)))\n    (drop\n      (i16x8.extend_low_i8x16_u\n        (local.get 0)))\n    (drop\n      (i16x8.extend_high_i8x16_u\n        (local.get 0)))\n    (drop\n      (i16x8.shl\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i16x8.shr_s\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i16x8.shr_u\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i16x8.add\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.add_sat_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.add_sat_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.sub\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.sub_sat_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.sub_sat_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.mul\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.min_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.min_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.max_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.max_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i16x8.avgr_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.abs\n        (local.get 0)))\n    (drop\n      (i32x4.neg\n        (local.get 0)))\n    (drop\n      (i32x4.all_true\n        (local.get 0)))\n    (drop\n      (i32x4.extend_low_i16x8_s\n        (local.get 0)))\n    (drop\n      (i32x4.extend_high_i16x8_s\n        (local.get 0)))\n    (drop\n      (i32x4.extend_low_i16x8_u\n        (local.get 0)))\n    (drop\n      (i32x4.extend_high_i16x8_u\n        (local.get 0)))\n    (drop\n      (i32x4.shl\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i32x4.shr_s\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i32x4.shr_u\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i32x4.add\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.sub\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.mul\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.min_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.min_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.max_s\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.max_u\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i64x2.neg\n        (local.get 0)))\n    (drop\n      (i64x2.shl\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i64x2.shr_s\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i64x2.shr_u\n        (local.get 0)\n        (i32.const 0)))\n    (drop\n      (i64x2.add\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i64x2.sub\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i64x2.mul\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.abs\n        (local.get 0)))\n    (drop\n      (f32x4.neg\n        (local.get 0)))\n    (drop\n      (f32x4.sqrt\n        (local.get 0)))\n    (drop\n      (f32x4.add\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.sub\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.mul\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.div\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.min\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f32x4.max\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.abs\n        (local.get 0)))\n    (drop\n      (f64x2.neg\n        (local.get 0)))\n    (drop\n      (f64x2.sqrt\n        (local.get 0)))\n    (drop\n      (f64x2.add\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.sub\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.mul\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.div\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.min\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (f64x2.max\n        (local.get 0)\n        (local.get 0)))\n    (drop\n      (i32x4.trunc_sat_f32x4_s\n        (local.get 0)))\n    (drop\n      (i32x4.trunc_sat_f32x4_u\n        (local.get 0)))\n    (drop\n      (f32x4.convert_i32x4_s\n        (local.get 0)))\n    (drop\n      (f32x4.convert_i32x4_u\n        (local.get 0))))\n  (memory (;0;) 1))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-tail-call.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-tail-call\n(module\n  (type $t (func))\n  (type $t2 (func (param f32 f32) (result f32)))\n  (table 1 funcref)\n\n  (func $f\n    return_call $f)\n\n  (func $f2 (param f32 f32) (result f32)\n    f32.const 0\n    f32.const 0\n    return_call $f2)\n\n  (func\n    i32.const 0\n    return_call_indirect (type $t))\n\n  (func (result f32)\n    f32.const 0\n    f32.const 0\n    i32.const 0\n    return_call_indirect (type $t2))\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (type (;1;) (func (param f32 f32) (result f32)))\n  (type (;2;) (func (result f32)))\n  (func (;0;) (type 0)\n    (return_call 0))\n  (func (;1;) (type 1) (param f32 f32) (result f32)\n    (return_call 1\n      (f32.const 0x0p+0 (;=0;))\n      (f32.const 0x0p+0 (;=0;))))\n  (func (;2;) (type 0)\n    (return_call_indirect (type 0)\n      (i32.const 0)))\n  (func (;3;) (type 2) (result f32)\n    (return_call_indirect (type 1)\n      (f32.const 0x0p+0 (;=0;))\n      (f32.const 0x0p+0 (;=0;))\n      (i32.const 0)))\n  (table (;0;) 1 funcref))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-throw.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-exceptions\n(module\n  (tag $e0 (param i32))\n  (tag $e1 (param f32 i32))\n\n  (func i32.const 1 throw $e0)\n  (func f32.const 2 i32.const 1 throw $e1))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32)))\n  (type (;1;) (func (param f32 i32)))\n  (type (;2;) (func))\n  (func (;0;) (type 2)\n    (throw 0\n      (i32.const 1)))\n  (func (;1;) (type 2)\n    (throw 1\n      (f32.const 0x1p+1 (;=2;))\n      (i32.const 1)))\n  (tag (;0;) (type 0) (param i32))\n  (tag (;1;) (type 1) (param f32 i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-try-delegate.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-exceptions --debug-names\n(module\n  (func (result i32)\n    try (result i32)\n      try\n        nop\n      delegate 1\n      i32.const 7\n    catch_all\n      i32.const 8\n    end\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (func (;0;) (type 0) (result i32)\n    (try (result i32)  ;; label = @1\n      (do\n        (try  ;; label = @2\n          (do\n            (nop))\n          (delegate 1))\n        (i32.const 7))\n      (catch_all\n        (i32.const 8)))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-try-table.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-exceptions --debug-names\n(module\n  (func (result i32)\n    try_table (result i32)\n      i32.const 6\n    end\n    drop\n    block\n      try_table (result i32) (catch_all 0)\n        nop\n        i32.const 7\n        br 2\n      end\n      drop\n    end\n    i32.const 8\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (func (;0;) (type 0) (result i32)\n    (drop\n      (try_table (result i32)  ;; label = @1\n        (i32.const 6)))\n    (block  ;; label = @1\n      (drop\n        (try_table (result i32)  ;; label = @2\n          (catch_all 0 (;@1;))\n          (nop)\n          (br 2 (;@0;)\n            (i32.const 7)))))\n    (i32.const 8)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-try.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --fold-exprs --enable-exceptions --debug-names\n(module\n  (func (result i32)\n    try (result i32)\n      i32.const 6\n    end\n    drop\n    try (result i32)\n      nop\n      i32.const 7\n    catch_all\n      i32.const 8\n    end\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (func (;0;) (type 0) (result i32)\n    (drop\n      (try (result i32)  ;; label = @1\n        (do\n          (i32.const 6))))\n    (try (result i32)  ;; label = @1\n      (do\n        (nop)\n        (i32.const 7))\n      (catch_all\n        (i32.const 8)))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/fold-unreachable.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-exceptions --fold-exprs\n(module\n  (func (result i32)\n    i32.const 1\n    unreachable\n    i32.add)\n\n  (func\n    br 0\n    drop)\n\n  (func\n    block\n      block\n        block\n          i32.const 1\n          br_table 0 1 2 0\n          i32.const 2\n          i32.div_s\n          return\n        end\n      end\n    end)\n\n  (func (result i32)\n    i32.const 0\n    return\n    i32.eqz)\n\n  (func\n    ref.null exn\n    throw_ref\n    drop\n  ))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (type (;1;) (func))\n  (func (;0;) (type 0) (result i32)\n    (i32.add\n      (i32.const 1)\n      (unreachable)))\n  (func (;1;) (type 1)\n    (drop\n      (br 0 (;@0;))))\n  (func (;2;) (type 1)\n    (block  ;; label = @1\n      (block  ;; label = @2\n        (block  ;; label = @3\n          (i32.div_s\n            (br_table 0 (;@3;) 1 (;@2;) 2 (;@1;) 0 (;@3;)\n              (i32.const 1))\n            (i32.const 2))\n          (return)))))\n  (func (;3;) (type 0) (result i32)\n    (i32.eqz\n      (return\n        (i32.const 0))))\n  (func (;4;) (type 1)\n    (drop\n      (throw_ref\n        (ref.null exn)))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/func-index.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (import \"a\" \"b\" (func (result i32)))\n  (func (param f32)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (type (;1;) (func (param f32)))\n  (import \"a\" \"b\" (func (;0;) (type 0)))\n  (func (;1;) (type 1) (param f32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-bulk-memory-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n\n(module\n  (memory 1)\n  (data \"a\")\n  (func\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n    data.drop 0\n  )\n\n  (table 1 funcref)\n  (elem func 0)\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n    elem.drop 0\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $f0 (type $t0)\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    memory.init $d0\n    data.drop $d0)\n  (func $f1 (type $t0)\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.init $T0 $e0\n    elem.drop $e0)\n  (table $T0 1 funcref)\n  (memory $M0 1)\n  (elem $e0 func $f0)\n  (data $d0 \"a\"))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-existing-name.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --debug-names --generate-names\n\n;; The name generator should choose a different name if it already exists. This\n;; can only be tested for funcs/locals, since no other names are roundtrippable\n;; yet.\n\n(module\n  ;; Test func\n  (func)\n  (func $f0)\n\n  ;; Test local\n  (func\n    (local i32)\n    (local $l0 i32))\n)\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $f0_1 (type $t0))\n  (func $f0 (type $t0))\n  (func $f2 (type $t0)\n    (local $l0_1 i32) (local $l0 i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-from-export-name.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --debug-names --generate-names\n\n(module\n  (func (export \"my_func\"))\n  (table (export \"my_table\") 1 funcref)\n  (memory (export \"my_memory\") 1)\n  (global (export \"my_global\") i32 (i32.const 1))\n\n  ;; Handle name collisions\n  (func $foo (result i32)\n    (i32.const 123))\n  (func $foo_1 (result i32)\n    (i32.const 456))\n  (func (export \"foo\") (result i32)\n    (i32.const 789))\n)\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (type $t1 (func (result i32)))\n  (func $my_func (type $t0))\n  (func $foo (type $t1) (result i32)\n    i32.const 123)\n  (func $foo_1 (type $t1) (result i32)\n    i32.const 456)\n  (func $foo_2 (type $t1) (result i32)\n    i32.const 789)\n  (table $my_table 1 funcref)\n  (memory $my_memory 1)\n  (global $my_global i32 (i32.const 1))\n  (export \"my_func\" (func $my_func))\n  (export \"my_table\" (table $my_table))\n  (export \"my_memory\" (memory $my_memory))\n  (export \"my_global\" (global $my_global))\n  (export \"foo\" (func $foo_2)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-from-import-name.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --debug-names --generate-names\n\n(module\n  (func (import \"m1\" \"my_func\"))\n  (table (import \"m2\" \"my_table\") 1 funcref)\n  (memory (import \"m3\" \"my_memory\") 1)\n  (global (import \"m4\" \"my_global\") i32)\n\n  ;; Handle name collisions\n  (func (import \"m5\" \"foo_1\") (result f32))\n  (func (import \"m5\" \"foo\") (result i32))\n  (func $m5.foo (result i32)\n    (i32.const 123))\n)\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (type $t1 (func (result f32)))\n  (type $t2 (func (result i32)))\n  (import \"m1\" \"my_func\" (func $m1.my_func (type $t0)))\n  (import \"m2\" \"my_table\" (table $m2.my_table 1 funcref))\n  (import \"m3\" \"my_memory\" (memory $m3.my_memory 1))\n  (import \"m4\" \"my_global\" (global $m4.my_global i32))\n  (import \"m5\" \"foo_1\" (func $m5.foo_1 (type $t1)))\n  (import \"m5\" \"foo\" (func $m5.foo_2 (type $t2)))\n  (func $m5.foo (type $t2) (result i32)\n    i32.const 123))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-func-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n(module\n  (func)\n  (func\n    call 0)\n  (func (; not exported ;))\n  (table funcref (elem 0 1 0))\n  (export \"zero\" (func 0))\n  (export \"one\" (func 1)))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $zero (type $t0))\n  (func $one (type $t0)\n    call $zero)\n  (func $f2 (type $t0))\n  (table $T0 3 3 funcref)\n  (export \"zero\" (func $zero))\n  (export \"one\" (func $one))\n  (elem $e0 (i32.const 0) func $zero $one $zero))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-func-type-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n(module\n  (import \"foo\" \"bar\" (func (type 0)))\n  (table funcref (elem 0))\n  (type (func))\n  (type (func (result i32)))\n  (func (type 0))\n  (func (type 1)\n    i32.const 0\n    call_indirect (type 0)\n    i32.const 1))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (type $t1 (func (result i32)))\n  (import \"foo\" \"bar\" (func $foo.bar (type $t0)))\n  (func $f1 (type $t0))\n  (func $f2 (type $t1) (result i32)\n    i32.const 0\n    call_indirect $T0 (type $t0)\n    i32.const 1)\n  (table $T0 1 1 funcref)\n  (elem $e0 (i32.const 0) func $foo.bar))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-global-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n(module\n  (global i32 (i32.const 42))\n  (global (mut f32) (f32.const -1.5))\n  (func (result i32)\n    f32.const 3.0\n    global.set 1\n    global.get 0))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func (result i32)))\n  (func $f0 (type $t0) (result i32)\n    f32.const 0x1.8p+1 (;=3;)\n    global.set $g1\n    global.get $g0)\n  (global $g0 i32 (i32.const 42))\n  (global $g1 (mut f32) (f32.const -0x1.8p+0 (;=-1.5;))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-if-label-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n(module\n  (func \n    i32.const 1\n    if  \n      br 0 \n    end\n    i32.const 2\n    if \n      br 0 \n    else\n      br 0 \n    end))\n\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $f0 (type $t0)\n    i32.const 1\n    if $I0\n      br $I0\n    end\n    i32.const 2\n    if $I1\n      br $I1\n    else\n      br $I1\n    end))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-import-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n(module\n  (import \"an\" \"import\" (func (param i32)))\n  (import \"another\" \"import\" (func (param f32)))\n  (func\n    i32.const 0\n    call 0\n    f32.const 0\n    call 1))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func (param i32)))\n  (type $t1 (func (param f32)))\n  (type $t2 (func))\n  (import \"an\" \"import\" (func $an.import (type $t0)))\n  (import \"another\" \"import\" (func $another.import (type $t1)))\n  (func $f2 (type $t2)\n    i32.const 0\n    call $an.import\n    f32.const 0x0p+0 (;=0;)\n    call $another.import))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-label-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n(module\n  (func \n    block  \n      loop  \n        br 0 \n        br 1 \n        br 2 ;; equivalent to return\n        i32.const 0\n        br_table 0 1 2 \n        i32.const 1\n        br_if 2\n      end\n    end\n    block  \n      br 0 \n    end))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $f0 (type $t0)\n    block $B0\n      loop $L1\n        br $L1\n        br $B0\n        br 2 (;@0;)\n        i32.const 0\n        br_table $L1 $B0 2 (;@0;)\n        i32.const 1\n        br_if 2 (;@0;)\n      end\n    end\n    block $B2\n      br $B2\n    end))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-local-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names\n(module\n  (func (param i32) (param f32)\n    (local f64)\n    (local i64)\n    local.get 0\n    drop\n    local.get 1\n    drop\n    local.get 2\n    drop\n    local.get 3\n    drop\n    i32.const 1\n    local.set 0\n    f32.const 1\n    local.set 1\n    f64.const 1\n    local.set 2\n    i64.const 1\n    local.set 3))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func (param i32 f32)))\n  (func $f0 (type $t0) (param $p0 i32) (param $p1 f32)\n    (local $l2 f64) (local $l3 i64)\n    local.get $p0\n    drop\n    local.get $p1\n    drop\n    local.get $l2\n    drop\n    local.get $l3\n    drop\n    i32.const 1\n    local.set $p0\n    f32.const 0x1p+0 (;=1;)\n    local.set $p1\n    f64.const 0x1p+0 (;=1;)\n    local.set $l2\n    i64.const 1\n    local.set $l3))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-some-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --debug-names --generate-names\n\n;; currently, only function names and local names are saved in the debug\n;; section\n\n(module\n  (type (func (param i32) (result f32)))\n  (import \"foo\" \"bar\" (func $import (result i32)))\n  (table funcref (elem 0))\n  (func $func0 (type 0) f32.const 1)\n  (func (param i32) (param $param1 i64)\n    (local f32)\n    (local $local1 f64)\n    call 0\n    drop\n    i32.const 0\n    call 1\n    drop\n    i32.const 0\n    i32.const 1\n    call_indirect (type 0)\n    drop\n    local.get 1\n    drop\n    f32.const 0\n    local.set 2)\n  (export \"baz\" (func 0))\n  (export \"quux\" (func 1)))\n\n(;; STDOUT ;;;\n(module\n  (type $t0 (func (param i32) (result f32)))\n  (type $t1 (func (result i32)))\n  (type $t2 (func (param i32 i64)))\n  (import \"foo\" \"bar\" (func $import (type $t1)))\n  (func $func0 (type $t0) (param $p0 i32) (result f32)\n    f32.const 0x1p+0 (;=1;))\n  (func $f2 (type $t2) (param $p0 i32) (param $param1 i64)\n    (local $l2 f32) (local $local1 f64)\n    call $import\n    drop\n    i32.const 0\n    call $func0\n    drop\n    i32.const 0\n    i32.const 1\n    call_indirect $T0 (type $t0)\n    drop\n    local.get $param1\n    drop\n    f32.const 0x0p+0 (;=0;)\n    local.set $l2)\n  (table $T0 1 1 funcref)\n  (export \"baz\" (func $import))\n  (export \"quux\" (func $func0))\n  (elem $e0 (i32.const 0) func $import))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-start-name.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --debug-names --generate-names\n(module\n  (func)\n  (start 0))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $f0 (type $t0))\n  (start $f0))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-tag-names.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --generate-names --enable-exceptions\n(module\n  (tag (param i32)))\n(;; STDOUT ;;;\n(module\n  (type $t0 (func (param i32)))\n  (tag $e0 (type $t0) (param i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/generate-tail-call.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --debug-names --generate-names --enable-tail-call\n(module\n  (table 1 funcref)\n  (func return_call 0)\n  (func i32.const 0 return_call_indirect)\n)\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (func $f0 (type $t0)\n    return_call $f0)\n  (func $f1 (type $t0)\n    i32.const 0\n    return_call_indirect (type $t0))\n  (table $T0 1 funcref))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/global-index.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (import \"a\" \"b\" (global i32))\n  (global f32 (f32.const 12345.625)))\n(;; STDOUT ;;;\n(module\n  (import \"a\" \"b\" (global (;0;) i32))\n  (global (;1;) f32 (f32.const 0x1.81cdp+13 (;=12345.6;))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-export-func-name.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-export --debug-names\n(module\n  (func $foo\n    nop)\n  (export \"foo\" (func $foo)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func $foo (export \"foo\") (type 0)\n    nop))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-export-func.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-export\n(module\n  (func $foo (param i32)\n    nop)\n  (export \"foo\" (func $foo)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32)))\n  (func (;0;) (export \"foo\") (type 0) (param i32)\n    nop))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-export-global.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-export\n(module\n  (global $foo i32 (i32.const 0))\n  (export \"foo\" (global $foo)))\n(;; STDOUT ;;;\n(module\n  (global (;0;) (export \"foo\") i32 (i32.const 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-export-memory.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-export\n(module\n  (memory $foo 0)\n  (export \"foo\" (memory $foo)))\n(;; STDOUT ;;;\n(module\n  (memory (;0;) (export \"foo\") 0))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-export-multi.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-export\n(module\n  (func $func nop)\n  (export \"func0\" (func $func))\n  (export \"func1\" (func $func))\n\n  (global $global i32 (i32.const 0))\n  (export \"global0\" (global $global))\n  (export \"global1\" (global $global))\n\n  (table $table 1 1 funcref)\n  (export \"table0\" (table $table))\n  (export \"table1\" (table $table))\n\n  (memory $memory 0)\n  (export \"memory0\" (memory $memory))\n  (export \"memory1\" (memory $memory)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (export \"func0\") (export \"func1\") (type 0)\n    nop)\n  (table (;0;) (export \"table0\") (export \"table1\") 1 1 funcref)\n  (memory (;0;) (export \"memory0\") (export \"memory1\") 0)\n  (global (;0;) (export \"global0\") (export \"global1\") i32 (i32.const 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-export-table.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-export\n(module\n  (func $f1)\n  (func $f2)\n  (table $foo funcref (elem $f1 $f2))\n  (export \"foo\" (table $foo)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0))\n  (func (;1;) (type 0))\n  (table (;0;) (export \"foo\") 2 2 funcref)\n  (elem (;0;) (i32.const 0) func 0 1))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-export-tag.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-export --enable-exceptions\n(module\n  (tag $foo (param i32))\n  (export \"foo\" (tag $foo)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32)))\n  (tag (;0;) (export \"foo\") (type 0) (param i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-import-export.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-import --inline-export\n(module\n  (import \"mod\" \"f\" (func $f (param i32)))\n  (import \"mod\" \"g\" (global $g f32))\n  (import \"mod\" \"t\" (table $t 1 2 funcref))\n  (import \"mod\" \"m\" (memory $m 3))\n\n  (export \"F\" (func $f))\n  (export \"G\" (global $g))\n  (export \"T\" (table $t))\n  (export \"M\" (memory $m))\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32)))\n  (func (;0;) (export \"F\") (import \"mod\" \"f\") (type 0) (param i32))\n  (global (;0;) (export \"G\") (import \"mod\" \"g\") f32)\n  (table (;0;) (export \"T\") (import \"mod\" \"t\") 1 2 funcref)\n  (memory (;0;) (export \"M\") (import \"mod\" \"m\") 3))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-import-func.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-import\n(module\n  (import \"mod\" \"f1\" (func (param i32 f32) (result f64)))\n  (import \"mod\" \"f2\" (func (result i64)))\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32 f32) (result f64)))\n  (type (;1;) (func (result i64)))\n  (func (;0;) (import \"mod\" \"f1\") (type 0) (param i32 f32) (result f64))\n  (func (;1;) (import \"mod\" \"f2\") (type 1) (result i64)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-import-global.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-import\n(module\n  (import \"mod\" \"g1\" (global i32))\n  (import \"mod\" \"g2\" (global f32))\n  (import \"mod\" \"g3\" (global i64))\n  (import \"mod\" \"g4\" (global f64))\n)\n(;; STDOUT ;;;\n(module\n  (global (;0;) (import \"mod\" \"g1\") i32)\n  (global (;1;) (import \"mod\" \"g2\") f32)\n  (global (;2;) (import \"mod\" \"g3\") i64)\n  (global (;3;) (import \"mod\" \"g4\") f64))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-import-memory.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-import\n(module\n  (import \"mod\" \"m1\" (memory 2 3))\n)\n(;; STDOUT ;;;\n(module\n  (memory (;0;) (import \"mod\" \"m1\") 2 3))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-import-table.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-import\n(module\n  (import \"mod\" \"t1\" (table 1 funcref))\n)\n(;; STDOUT ;;;\n(module\n  (table (;0;) (import \"mod\" \"t1\") 1 funcref))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/inline-import-tag.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --inline-import --enable-exceptions\n(module\n  (import \"mod\" \"e1\" (tag (param i32 f32)))\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32 f32)))\n  (tag (;0;) (import \"mod\" \"e1\") (type 0) (param i32 f32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/invalid-br-var.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --no-check\n(module\n  (func\n    br 1))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    br 1 (; INVALID ;)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/invalid-local-index.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --no-check\n(module\n  (func\n    local.set 0))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    local.set 0))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/label.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (func (param i32) (result f32)\n    block (result f32)\n      f32.const 1\n      local.get 0\n      i32.eqz\n      br_if 0\n      drop\n      f32.const 2\n    end))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32) (result f32)))\n  (func (;0;) (type 0) (param i32) (result f32)\n    block (result f32)  ;; label = @1\n      f32.const 0x1p+0 (;=1;)\n      local.get 0\n      i32.eqz\n      br_if 0 (;@1;)\n      drop\n      f32.const 0x1p+1 (;=2;)\n    end))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/memory-index.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (import \"a\" \"b\" (memory 1)))\n(;; STDOUT ;;;\n(module\n  (import \"a\" \"b\" (memory (;0;) 1)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/memory-index64.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-memory64\n(module\n  (import \"a\" \"b\" (memory i64 1)))\n(;; STDOUT ;;;\n(module\n  (import \"a\" \"b\" (memory (;0;) i64 1)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/memory-max.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (import \"a\" \"b\" (memory 1 65536)))\n(;; STDOUT ;;;\n(module\n  (import \"a\" \"b\" (memory (;0;) 1 65536)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/memory-max64.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-memory64\n(module\n  (import \"a\" \"b\" (memory i64 1 4294967296)))\n(;; STDOUT ;;;\n(module\n  (import \"a\" \"b\" (memory (;0;) i64 1 4294967296)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/multi-value-block-type.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --reloc\n(module\n  ;; 64 random types to force the block type below to get encoded as sleb\n  (type (func (param f32 f32 f32 f32 f32 f32)))\n  (type (func (param i32 f32 f32 f32 f32 f32)))\n  (type (func (param f32 i32 f32 f32 f32 f32)))\n  (type (func (param i32 i32 f32 f32 f32 f32)))\n  (type (func (param f32 f32 i32 f32 f32 f32)))\n  (type (func (param i32 f32 i32 f32 f32 f32)))\n  (type (func (param f32 i32 i32 f32 f32 f32)))\n  (type (func (param i32 i32 i32 f32 f32 f32)))\n  (type (func (param f32 f32 f32 i32 f32 f32)))\n  (type (func (param i32 f32 f32 i32 f32 f32)))\n  (type (func (param f32 i32 f32 i32 f32 f32)))\n  (type (func (param i32 i32 f32 i32 f32 f32)))\n  (type (func (param f32 f32 i32 i32 f32 f32)))\n  (type (func (param i32 f32 i32 i32 f32 f32)))\n  (type (func (param f32 i32 i32 i32 f32 f32)))\n  (type (func (param i32 i32 i32 i32 f32 f32)))\n  (type (func (param f32 f32 f32 f32 i32 f32)))\n  (type (func (param i32 f32 f32 f32 i32 f32)))\n  (type (func (param f32 i32 f32 f32 i32 f32)))\n  (type (func (param i32 i32 f32 f32 i32 f32)))\n  (type (func (param f32 f32 i32 f32 i32 f32)))\n  (type (func (param i32 f32 i32 f32 i32 f32)))\n  (type (func (param f32 i32 i32 f32 i32 f32)))\n  (type (func (param i32 i32 i32 f32 i32 f32)))\n  (type (func (param f32 f32 f32 i32 i32 f32)))\n  (type (func (param i32 f32 f32 i32 i32 f32)))\n  (type (func (param f32 i32 f32 i32 i32 f32)))\n  (type (func (param i32 i32 f32 i32 i32 f32)))\n  (type (func (param f32 f32 i32 i32 i32 f32)))\n  (type (func (param i32 f32 i32 i32 i32 f32)))\n  (type (func (param f32 i32 i32 i32 i32 f32)))\n  (type (func (param i32 i32 i32 i32 i32 f32)))\n  (type (func (param f32 f32 f32 f32 f32 i32)))\n  (type (func (param i32 f32 f32 f32 f32 i32)))\n  (type (func (param f32 i32 f32 f32 f32 i32)))\n  (type (func (param i32 i32 f32 f32 f32 i32)))\n  (type (func (param f32 f32 i32 f32 f32 i32)))\n  (type (func (param i32 f32 i32 f32 f32 i32)))\n  (type (func (param f32 i32 i32 f32 f32 i32)))\n  (type (func (param i32 i32 i32 f32 f32 i32)))\n  (type (func (param f32 f32 f32 i32 f32 i32)))\n  (type (func (param i32 f32 f32 i32 f32 i32)))\n  (type (func (param f32 i32 f32 i32 f32 i32)))\n  (type (func (param i32 i32 f32 i32 f32 i32)))\n  (type (func (param f32 f32 i32 i32 f32 i32)))\n  (type (func (param i32 f32 i32 i32 f32 i32)))\n  (type (func (param f32 i32 i32 i32 f32 i32)))\n  (type (func (param i32 i32 i32 i32 f32 i32)))\n  (type (func (param f32 f32 f32 f32 i32 i32)))\n  (type (func (param i32 f32 f32 f32 i32 i32)))\n  (type (func (param f32 i32 f32 f32 i32 i32)))\n  (type (func (param i32 i32 f32 f32 i32 i32)))\n  (type (func (param f32 f32 i32 f32 i32 i32)))\n  (type (func (param i32 f32 i32 f32 i32 i32)))\n  (type (func (param f32 i32 i32 f32 i32 i32)))\n  (type (func (param i32 i32 i32 f32 i32 i32)))\n  (type (func (param f32 f32 f32 i32 i32 i32)))\n  (type (func (param i32 f32 f32 i32 i32 i32)))\n  (type (func (param f32 i32 f32 i32 i32 i32)))\n  (type (func (param i32 i32 f32 i32 i32 i32)))\n  (type (func (param f32 f32 i32 i32 i32 i32)))\n  (type (func (param i32 f32 i32 i32 i32 i32)))\n  (type (func (param f32 i32 i32 i32 i32 i32)))\n  (type (func (param i32 i32 i32 i32 i32 i32)))\n\n  (func (result i32)\n    (i32.add\n      (block (result i32 i32)\n        (i32.const 32)\n        (i32.const 10)))))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param f32 f32 f32 f32 f32 f32)))\n  (type (;1;) (func (param i32 f32 f32 f32 f32 f32)))\n  (type (;2;) (func (param f32 i32 f32 f32 f32 f32)))\n  (type (;3;) (func (param i32 i32 f32 f32 f32 f32)))\n  (type (;4;) (func (param f32 f32 i32 f32 f32 f32)))\n  (type (;5;) (func (param i32 f32 i32 f32 f32 f32)))\n  (type (;6;) (func (param f32 i32 i32 f32 f32 f32)))\n  (type (;7;) (func (param i32 i32 i32 f32 f32 f32)))\n  (type (;8;) (func (param f32 f32 f32 i32 f32 f32)))\n  (type (;9;) (func (param i32 f32 f32 i32 f32 f32)))\n  (type (;10;) (func (param f32 i32 f32 i32 f32 f32)))\n  (type (;11;) (func (param i32 i32 f32 i32 f32 f32)))\n  (type (;12;) (func (param f32 f32 i32 i32 f32 f32)))\n  (type (;13;) (func (param i32 f32 i32 i32 f32 f32)))\n  (type (;14;) (func (param f32 i32 i32 i32 f32 f32)))\n  (type (;15;) (func (param i32 i32 i32 i32 f32 f32)))\n  (type (;16;) (func (param f32 f32 f32 f32 i32 f32)))\n  (type (;17;) (func (param i32 f32 f32 f32 i32 f32)))\n  (type (;18;) (func (param f32 i32 f32 f32 i32 f32)))\n  (type (;19;) (func (param i32 i32 f32 f32 i32 f32)))\n  (type (;20;) (func (param f32 f32 i32 f32 i32 f32)))\n  (type (;21;) (func (param i32 f32 i32 f32 i32 f32)))\n  (type (;22;) (func (param f32 i32 i32 f32 i32 f32)))\n  (type (;23;) (func (param i32 i32 i32 f32 i32 f32)))\n  (type (;24;) (func (param f32 f32 f32 i32 i32 f32)))\n  (type (;25;) (func (param i32 f32 f32 i32 i32 f32)))\n  (type (;26;) (func (param f32 i32 f32 i32 i32 f32)))\n  (type (;27;) (func (param i32 i32 f32 i32 i32 f32)))\n  (type (;28;) (func (param f32 f32 i32 i32 i32 f32)))\n  (type (;29;) (func (param i32 f32 i32 i32 i32 f32)))\n  (type (;30;) (func (param f32 i32 i32 i32 i32 f32)))\n  (type (;31;) (func (param i32 i32 i32 i32 i32 f32)))\n  (type (;32;) (func (param f32 f32 f32 f32 f32 i32)))\n  (type (;33;) (func (param i32 f32 f32 f32 f32 i32)))\n  (type (;34;) (func (param f32 i32 f32 f32 f32 i32)))\n  (type (;35;) (func (param i32 i32 f32 f32 f32 i32)))\n  (type (;36;) (func (param f32 f32 i32 f32 f32 i32)))\n  (type (;37;) (func (param i32 f32 i32 f32 f32 i32)))\n  (type (;38;) (func (param f32 i32 i32 f32 f32 i32)))\n  (type (;39;) (func (param i32 i32 i32 f32 f32 i32)))\n  (type (;40;) (func (param f32 f32 f32 i32 f32 i32)))\n  (type (;41;) (func (param i32 f32 f32 i32 f32 i32)))\n  (type (;42;) (func (param f32 i32 f32 i32 f32 i32)))\n  (type (;43;) (func (param i32 i32 f32 i32 f32 i32)))\n  (type (;44;) (func (param f32 f32 i32 i32 f32 i32)))\n  (type (;45;) (func (param i32 f32 i32 i32 f32 i32)))\n  (type (;46;) (func (param f32 i32 i32 i32 f32 i32)))\n  (type (;47;) (func (param i32 i32 i32 i32 f32 i32)))\n  (type (;48;) (func (param f32 f32 f32 f32 i32 i32)))\n  (type (;49;) (func (param i32 f32 f32 f32 i32 i32)))\n  (type (;50;) (func (param f32 i32 f32 f32 i32 i32)))\n  (type (;51;) (func (param i32 i32 f32 f32 i32 i32)))\n  (type (;52;) (func (param f32 f32 i32 f32 i32 i32)))\n  (type (;53;) (func (param i32 f32 i32 f32 i32 i32)))\n  (type (;54;) (func (param f32 i32 i32 f32 i32 i32)))\n  (type (;55;) (func (param i32 i32 i32 f32 i32 i32)))\n  (type (;56;) (func (param f32 f32 f32 i32 i32 i32)))\n  (type (;57;) (func (param i32 f32 f32 i32 i32 i32)))\n  (type (;58;) (func (param f32 i32 f32 i32 i32 i32)))\n  (type (;59;) (func (param i32 i32 f32 i32 i32 i32)))\n  (type (;60;) (func (param f32 f32 i32 i32 i32 i32)))\n  (type (;61;) (func (param i32 f32 i32 i32 i32 i32)))\n  (type (;62;) (func (param f32 i32 i32 i32 i32 i32)))\n  (type (;63;) (func (param i32 i32 i32 i32 i32 i32)))\n  (type (;64;) (func (result i32)))\n  (type (;65;) (func (result i32 i32)))\n  (func (;0;) (type 64) (result i32)\n    block (result i32 i32)  ;; label = @1\n      i32.const 32\n      i32.const 10\n    end\n    i32.add))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/named-locals.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --debug-names\n(module (func (local i32 i32) (local $b i32) (local i32)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    (local i32 i32) (local $b i32) (local i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/named-params.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --debug-names\n(module (func (param i32) (param $b i32)))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32 i32)))\n  (func (;0;) (type 0) (param i32) (param $b i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/ref-types.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-function-references\n(module\n  (type $ii (func))\n  (func $dummy)\n\n  (global (ref func) ref.func $dummy)\n  (global (ref $ii) ref.func $dummy)\n  (global (ref null func) ref.null $ii)\n  (global (ref null $ii) ref.null $ii)\n\n  (func $f1 (param (ref func) (ref extern) (ref $ii))\n    (local (ref func) (ref func)\n           (ref extern) (ref extern)\n           (ref $ii) (ref $ii))\n  )\n  (func $f2 (param (ref null func) (ref null extern) (ref null $ii))\n    (local (ref null func) (ref null func)\n           (ref null extern) (ref null extern)\n           (ref null $ii) (ref null $ii))\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (type (;1;) (func (param (ref func) (ref extern) (ref 0))))\n  (type (;2;) (func (param funcref externref (ref null 0))))\n  (func (;0;) (type 0))\n  (func (;1;) (type 1) (param (ref func) (ref extern) (ref 0))\n    (local (ref func) (ref func) (ref extern) (ref extern) (ref 0) (ref 0)))\n  (func (;2;) (type 2) (param funcref externref (ref null 0))\n    (local funcref funcref externref externref (ref null 0) (ref null 0)))\n  (global (;0;) (ref func) (ref.func 0))\n  (global (;1;) (ref 0) (ref.func 0))\n  (global (;2;) funcref (ref.null 0))\n  (global (;3;) (ref null 0) (ref.null 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/reference-types.txt",
    "content": ";;; TOOL: wat-desugar\n(module\n  (func)\n  (func\n    ref.func 0\n    drop))\n(;; STDOUT ;;;\n(module\n  (func (;0;))\n  (func (;1;)\n    ref.func 0\n    drop)\n  (type (;0;) (func)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/rethrow.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-exceptions\n(module\n  (tag $e0 (param i32))\n\n  (func\n    try\n    catch $e0\n      rethrow 0\n    end\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param i32)))\n  (type (;1;) (func))\n  (func (;0;) (type 1)\n    try  ;; label = @1\n    catch 0\n      rethrow 0 (;@1;)\n    end)\n  (tag (;0;) (type 0) (param i32)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/select-type.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (func\n    unreachable\n    select (result funcref)\n    drop\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    unreachable\n    select (result funcref)\n    drop))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/simd.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (func (param v128) (result v128)\n    local.get 0\n    local.get 0\n    i8x16.shuffle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)\n  (func (param v128) (result f32)\n    local.get 0\n    f32x4.extract_lane 1))\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (param v128) (result v128)))\n  (type (;1;) (func (param v128) (result f32)))\n  (func (;0;) (type 0) (param v128) (result v128)\n    local.get 0\n    local.get 0\n    i8x16.shuffle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)\n  (func (;1;) (type 1) (param v128) (result f32)\n    local.get 0\n    f32x4.extract_lane 1))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/string-unicode-escape.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (func)\n  (func)\n\n  (export \"a:\\u{0} b:\\u{00001} c:\\u{7f} d:\\u{80} e:\\u{7ff} f:\\u{800} g:\\u{ffff} h:\\u{10000} i:\\u{10ffff}\" (func 0))\n  (export \"\\u{48}\\u{65}\\u{6c}\\u{6c}\\u{6f}\" (func 1))\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0))\n  (func (;1;) (type 0))\n  (export \"a:\\00 b:\\01 c:\\7f d:\\c2\\80 e:\\df\\bf f:\\e0\\a0\\80 g:\\ef\\bf\\bf h:\\f0\\90\\80\\80 i:\\f4\\8f\\bf\\bf\" (func 0))\n  (export \"Hello\" (func 1)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/table-copy-index.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (table $t 0 funcref)\n  (table $u 0 funcref)\n\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.copy $t $u)\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.copy 0 1)\n  (table (;0;) 0 funcref)\n  (table (;1;) 0 funcref))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/table-import-externref.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (table (import \"m\" \"func\") 1 funcref)\n  (table (import \"m\" \"extern\") 1 externref)\n)\n(;; STDOUT ;;;\n(module\n  (import \"m\" \"func\" (table (;0;) 1 funcref))\n  (import \"m\" \"extern\" (table (;1;) 1 externref)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/table-index.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (import \"a\" \"b\" (table 2 funcref)))\n(;; STDOUT ;;;\n(module\n  (import \"a\" \"b\" (table (;0;) 2 funcref)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/table-init-index.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout\n(module\n  (table $t 0 funcref)\n  (table $u 0 funcref)\n  (elem $e 0)\n  (func\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.init $u $e)\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    i32.const 0\n    i32.const 0\n    i32.const 0\n    table.init 1 0)\n  (table (;0;) 0 funcref)\n  (table (;1;) 0 funcref)\n  (elem (;0;) func))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/try-delegate.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-exceptions --debug-names\n(module\n  (func\n    try\n      try\n        nop\n      delegate 0\n      try\n        nop\n      delegate 0\n    catch_all\n    end\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)\n    try  ;; label = @1\n      try  ;; label = @2\n        nop\n      delegate 0\n      try  ;; label = @2\n        nop\n      delegate 0\n    catch_all\n    end))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/try-table.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-exceptions --debug-names\n(module\n  (func (result i32)\n    try_table (result i32)\n      i32.const 6\n    end\n    drop\n    block\n      try_table (result i32) (catch_all 0)\n        nop\n        i32.const 7\n        br 2\n      end\n      drop\n    end\n    i32.const 8\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func (result i32)))\n  (func (;0;) (type 0) (result i32)\n    try_table (result i32)  ;; label = @1\n      i32.const 6\n    end\n    drop\n    block  ;; label = @1\n      try_table (result i32)  ;; label = @2\n        (catch_all 0 (;@1;))\n        nop\n        i32.const 7\n        br 2 (;@0;)\n      end\n      drop\n    end\n    i32.const 8))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/roundtrip/typed-func-refs.txt",
    "content": ";;; TOOL: run-roundtrip\n;;; ARGS: --stdout --enable-function-references --debug-names\n(module\n  (type $t0 (func))\n  (type $t1 (func))\n\n  (type $t2 (func (param (ref $t0) (ref $t1) (ref 1))))\n\n  (func $f1 (param (ref $t0) (ref 0))\n    (local (ref $t0) (ref 0)\n           (ref $t1) (ref 1))\n  )\n)\n(;; STDOUT ;;;\n(module\n  (type $t0 (func))\n  (type $t1 (func))\n  (type $t2 (func (param (ref 0) (ref 1) (ref 1))))\n  (type (;3;) (func (param (ref 0) (ref 0))))\n  (func $f1 (type 3) (param (ref 0) (ref 0))\n    (local (ref 0) (ref 0) (ref 1) (ref 1))))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/run-c-api-examples.py",
    "content": "#!/usr/bin/env python\n#\n# Copyright 2020 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport argparse\nimport os\nimport subprocess\nimport sys\n\nimport find_exe\n\nALL_EXAMPLES = [\n    'callback',\n    'finalize',\n    'global',\n    'hello',\n    'hostref',\n    'memory',\n    'multi',\n    'reflect',\n    'serialize',\n    'start',\n    'table',\n    'threads',\n    'trap',\n]\n\n# We don't currently yet support shared modules which is required for threads.\nSKIP_EXAMPLES = [\n    'threads',  # We don't yet support threads\n    'finalize',  # This test is really slow\n    'hostref',  # The wasm module is currently invalid (needs subtyping changes)\n]\n\nIS_WINDOWS = sys.platform == 'win32'\n\n\ndef run_test(test_exe):\n    print('Running.. %s' % test_exe)\n    proc = subprocess.Popen([test_exe], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\n    stdout, _ = proc.communicate()\n    if proc.returncode == 0:\n        return 0\n    print(\"Failed with returncode=%d\" % proc.returncode)\n    print(stdout)\n    print('FAIL(%d): %s' % (proc.returncode, test_exe))\n    return 1\n\n\ndef error(msg):\n    print(msg)\n    sys.exit(1)\n\n\ndef check_for_missing(upstream_examples):\n    # Check that all the expected examples are found\n\n    upstream_examples = set(upstream_examples)\n    all_examples = set(ALL_EXAMPLES)\n    unexpected = upstream_examples - all_examples\n    if unexpected:\n        error('Unexpected examples found: %s' % str(unexpected))\n    missing = all_examples - upstream_examples\n    if missing:\n        error('Missing example binaries not found: %s' % str(missing))\n\n\ndef main(args):\n    print('Running c-api examples..')\n    parser = argparse.ArgumentParser()\n    parser.add_argument('--bindir', metavar='PATH',\n                        default=find_exe.GetDefaultPath(),\n                        help='directory to search for all executables.')\n\n    options = parser.parse_args(args)\n    script_dir = os.path.dirname(os.path.abspath(__file__))\n    root = os.path.dirname(script_dir)\n    upstream_dir = os.path.join(root, 'third_party', 'wasm-c-api', 'example')\n    upstream_examples = [f for f in os.listdir(upstream_dir) if os.path.splitext(f)[1] == '.wasm']\n    upstream_examples = [os.path.splitext(f)[0] for f in upstream_examples]\n    check_for_missing(upstream_examples)\n\n    def should_skip(e):\n        return any(e.startswith(skip) for skip in SKIP_EXAMPLES)\n\n    to_run = [e for e in upstream_examples if not should_skip(e)]\n\n    os.chdir(options.bindir)\n    count = 0\n    fail_count = 0\n    for f in to_run:\n        if IS_WINDOWS:\n            f += '.exe'\n        exe = os.path.join(options.bindir, 'wasm-c-api-' + f)\n        if not os.path.exists(exe):\n            error('test executable not found: %s' % exe)\n\n        count += 1\n        if run_test(exe) != 0:\n            fail_count += 1\n\n    if fail_count:\n        print('[%d/%d] c-api examples failed' % (fail_count, count))\n        return 1\n    return 0\n\n\nif __name__ == '__main__':\n    sys.exit(main(sys.argv[1:]))\n"
  },
  {
    "path": "test/run-roundtrip.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport argparse\nimport difflib\nimport os\nimport sys\n\nimport find_exe\nimport utils\nfrom utils import Error\n\nOK = 0\nERROR = 1\nSKIPPED = 2\n\n\ndef FilesAreEqual(filename1, filename2, verbose=False):\n    try:\n        with open(filename1, 'rb') as file1:\n            data1 = file1.read()\n\n        with open(filename2, 'rb') as file2:\n            data2 = file2.read()\n    except OSError as e:\n        return (ERROR, str(e))\n\n    if data1 != data2:\n        msg = 'files differ'\n        if verbose:\n            hexdump1 = utils.Hexdump(data1)\n            hexdump2 = utils.Hexdump(data2)\n            diff_lines = []\n            for line in difflib.unified_diff(hexdump1, hexdump2,\n                                             fromfile=filename1,\n                                             tofile=filename2):\n                diff_lines.append(line)\n            msg += ''.join(diff_lines)\n        msg += '\\n'\n        return (ERROR, msg)\n    return (OK, '')\n\n\ndef DoRoundtrip(wat2wasm, wasm2wat, out_dir, filename, verbose, stdout, skip_roundtrip_check):\n    basename = os.path.basename(filename)\n    basename_noext = os.path.splitext(basename)[0]\n    wasm1_file = os.path.join(out_dir, basename_noext + '-1.wasm')\n    wat2_file = os.path.join(out_dir, basename_noext + '-2.wat')\n    wasm3_file = os.path.join(out_dir, basename_noext + '-3.wasm')\n    try:\n        wat2wasm.RunWithArgs('-o', wasm1_file, filename)\n    except Error:\n        # if the file doesn't parse properly, just skip it (it may be a \"bad-*\"\n        # test)\n        return (SKIPPED, None)\n    try:\n        wasm2wat.RunWithArgs('-o', wat2_file, wasm1_file)\n        wat2wasm.RunWithArgs('-o', wasm3_file, wat2_file)\n    except Error as e:\n        return (ERROR, str(e))\n    if stdout:\n        with open(wat2_file) as f:\n            sys.stdout.write(f.read())\n    if skip_roundtrip_check:\n        return (OK, '')\n    return FilesAreEqual(wasm1_file, wasm3_file, verbose)\n\n\ndef main(args):\n    parser = argparse.ArgumentParser()\n    parser.add_argument('-v', '--verbose', help='print more diagnotic messages.',\n                        action='store_true')\n    parser.add_argument('-o', '--out-dir', metavar='PATH',\n                        help='output directory for files.')\n    parser.add_argument('--bindir', metavar='PATH',\n                        default=find_exe.GetDefaultPath(),\n                        help='directory to search for all executables.')\n    parser.add_argument('--stdout', action='store_true',\n                        help='write wat output to stdout')\n    parser.add_argument('--no-error-cmdline',\n                        help='don\\'t display the subprocess\\'s commandline when '\n                        'an error occurs', dest='error_cmdline',\n                        action='store_false')\n    parser.add_argument('-p', '--print-cmd',\n                        help='print the commands that are run.',\n                        action='store_true')\n    parser.add_argument('--no-check', action='store_true')\n    parser.add_argument('--debug-names', action='store_true')\n    # --generate-names modifies name section, so skip roundtrip check\n    parser.add_argument('--generate-names', action='store_true',\n                        help=\"write debug names and skip end-to-end roundtrip check\")\n    parser.add_argument('--fold-exprs', action='store_true')\n    parser.add_argument('--enable-exceptions', action='store_true')\n    parser.add_argument('--enable-saturating-float-to-int', action='store_true')\n    parser.add_argument('--enable-function-references', action='store_true')\n    parser.add_argument('--enable-threads', action='store_true')\n    parser.add_argument('--enable-sign-extension', action='store_true')\n    parser.add_argument('--enable-multi-value', action='store_true')\n    parser.add_argument('--enable-tail-call', action='store_true')\n    parser.add_argument('--disable-reference-types', action='store_true')\n    parser.add_argument('--enable-memory64', action='store_true')\n    parser.add_argument('--enable-multi-memory', action='store_true')\n    parser.add_argument('--enable-annotations', action='store_true')\n    parser.add_argument('--enable-code-metadata', action='store_true')\n    parser.add_argument('--enable-custom-page-sizes', action='store_true')\n    # --inline-exports can reorder exports, so skip roundtrip check\n    parser.add_argument('--inline-exports', action='store_true',\n                        help=\"write exports inline and skip end-to-end roundtrip check\")\n    parser.add_argument('--inline-imports', action='store_true')\n    parser.add_argument('--reloc', action='store_true')\n    parser.add_argument('file', help='test file.')\n    options = parser.parse_args(args)\n\n    wat2wasm = utils.Executable(\n        find_exe.GetWat2WasmExecutable(options.bindir),\n        error_cmdline=options.error_cmdline)\n    wat2wasm.AppendOptionalArgs({\n        '--debug-names': options.debug_names,\n        '--enable-exceptions': options.enable_exceptions,\n        '--enable-multi-value': options.enable_multi_value,\n        '--enable-saturating-float-to-int':\n            options.enable_saturating_float_to_int,\n        '--enable-sign-extension': options.enable_sign_extension,\n        '--enable-function-references': options.enable_function_references,\n        '--enable-threads': options.enable_threads,\n        '--enable-tail-call': options.enable_tail_call,\n        '--disable-reference-types': options.disable_reference_types,\n        '--enable-memory64': options.enable_memory64,\n        '--enable-multi-memory': options.enable_multi_memory,\n        '--enable-annotations': options.enable_annotations,\n        '--enable-code-metadata': options.enable_code_metadata,\n        '--enable-custom-page-sizes': options.enable_custom_page_sizes,\n        '--reloc': options.reloc,\n        '--no-check': options.no_check,\n    })\n\n    wasm2wat = utils.Executable(\n        find_exe.GetWasm2WatExecutable(options.bindir),\n        error_cmdline=options.error_cmdline)\n    wasm2wat.AppendOptionalArgs({\n        '--fold-exprs': options.fold_exprs,\n        '--enable-exceptions': options.enable_exceptions,\n        '--enable-multi-value': options.enable_multi_value,\n        '--enable-saturating-float-to-int':\n            options.enable_saturating_float_to_int,\n        '--enable-sign-extension': options.enable_sign_extension,\n        '--enable-tail-call': options.enable_tail_call,\n        '--enable-function-references': options.enable_function_references,\n        '--disable-reference-types': options.disable_reference_types,\n        '--enable-threads': options.enable_threads,\n        '--enable-memory64': options.enable_memory64,\n        '--enable-multi-memory': options.enable_multi_memory,\n        '--enable-annotations': options.enable_annotations,\n        '--enable-code-metadata': options.enable_code_metadata,\n        '--enable-custom-page-sizes': options.enable_custom_page_sizes,\n        '--inline-exports': options.inline_exports,\n        '--inline-imports': options.inline_imports,\n        '--no-debug-names': not options.debug_names,\n        '--generate-names': options.generate_names,\n        '--no-check': options.no_check,\n    })\n\n    wat2wasm.verbose = options.print_cmd\n    wasm2wat.verbose = options.print_cmd\n\n    filename = options.file\n    if not os.path.exists(filename):\n        sys.stderr.write('File not found: %s\\n' % filename)\n        return ERROR\n\n    skip_roundtrip_check = options.generate_names or options.inline_exports\n    with utils.TempDirectory(options.out_dir, 'roundtrip-') as out_dir:\n        result, msg = DoRoundtrip(wat2wasm, wasm2wat, out_dir, filename,\n                                  options.verbose, options.stdout, skip_roundtrip_check)\n        if result == ERROR:\n            sys.stderr.write(msg)\n        return result\n\n\nif __name__ == '__main__':\n    try:\n        sys.exit(main(sys.argv[1:]))\n    except Error as e:\n        sys.stderr.write(str(e) + '\\n')\n        sys.exit(1)\n"
  },
  {
    "path": "test/run-spec-wasm2c.py",
    "content": "#!/usr/bin/env python\n#\n# Copyright 2017 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport argparse\nimport io\nimport json\nimport os\nimport platform\nimport re\nimport struct\nimport sys\nimport shlex\nimport subprocess\n\nimport find_exe\nimport utils\nfrom utils import Error\n\nSCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))\nWASM2C_DIR = os.path.join(find_exe.REPO_ROOT_DIR, 'wasm2c')\nSIMDE_DIR = os.path.join(find_exe.REPO_ROOT_DIR, 'third_party/simde')\nIS_WINDOWS = sys.platform == 'win32'\nIS_MACOS = platform.mac_ver()[0] != ''\nMAX_COMMANDS_PER_FUNCTION = 1024  # GCC has trouble with extremely long function bodies\nSKIPPED = 3\n\n\ndef ReinterpretF32(f32_bits):\n    return struct.unpack('<f', struct.pack('<I', f32_bits))[0]\n\n\ndef F32ToC(f32_bits):\n    F32_SIGN_BIT = 0x80000000\n    F32_INF = 0x7f800000\n    F32_SIG_MASK = 0x7fffff\n\n    if (f32_bits & F32_INF) == F32_INF:\n        sign = '-' if (f32_bits & F32_SIGN_BIT) == F32_SIGN_BIT else ''\n        # NaN or infinity\n        if f32_bits & F32_SIG_MASK:\n            # NaN\n            return '%smake_nan_f32(0x%06x)' % (sign, f32_bits & F32_SIG_MASK)\n        else:\n            return '%sINFINITY' % sign\n    elif f32_bits == F32_SIGN_BIT:\n        return '-0.f'\n    else:\n        s = '%.9g' % ReinterpretF32(f32_bits)\n        if '.' not in s:\n            s += '.'\n        return s + 'f'\n\n\ndef ReinterpretF64(f64_bits):\n    return struct.unpack('<d', struct.pack('<Q', f64_bits))[0]\n\n\ndef F64ToC(f64_bits):\n    F64_SIGN_BIT = 0x8000000000000000\n    F64_INF = 0x7ff0000000000000\n    F64_SIG_MASK = 0xfffffffffffff\n\n    if (f64_bits & F64_INF) == F64_INF:\n        sign = '-' if (f64_bits & F64_SIGN_BIT) == F64_SIGN_BIT else ''\n        # NaN or infinity\n        if f64_bits & F64_SIG_MASK:\n            # NaN\n            return '%smake_nan_f64(0x%06x)' % (sign, f64_bits & F64_SIG_MASK)\n        else:\n            return '%sINFINITY' % sign\n    elif f64_bits == F64_SIGN_BIT:\n        return '-0.0'\n    else:\n        return '%#.17g' % ReinterpretF64(f64_bits)\n\n\ndef MangleType(t):\n    return {'i32': 'i', 'i64': 'j', 'f32': 'f', 'f64': 'd', 'v128': 'o',\n            'externref': 'e', 'funcref': 'r', 'exnref': 'x'}[t]\n\n\ndef MangleTypes(types):\n    if not types:\n        return 'v'\n    return ''.join(MangleType(t) for t in types)\n\n\ndef MangleName(s):\n    def Mangle(match):\n        s = match.group(0)\n        return b'0x%02X' % s[0]\n\n    # escape underscores at beginning and end\n    s = re.sub(b'((^_)|(_$))', Mangle, s.encode('utf-8'))\n\n    # NOTE(keithw): forced escapes for '0x[hexdigit]' not implemented here\n    pattern = b'([^_a-zA-Z0-9])'\n    return re.sub(pattern, Mangle, s).decode('utf-8')\n\n\ndef MangleModuleName(s):\n    # double underscores\n    return MangleName(re.sub('(_)', '__', s))\n\n\ndef IsModuleCommand(command):\n    return (command['type'] == 'module' or\n            command['type'] == 'assert_uninstantiable')\n\n\nclass CWriter(object):\n\n    def __init__(self, spec_json, prefix, out_file, out_dir):\n        self.source_filename = os.path.basename(spec_json['source_filename'])\n        self.commands = spec_json['commands']\n        self.out_file = out_file\n        self.out_dir = out_dir\n        self.prefix = prefix\n        self.module_idx = 0\n        self.module_name_to_idx = {}\n        self.module_prefix_map = {}\n        self.unmangled_names = {}\n        self.idx_to_module_name = {}\n        self._MaybeWriteDummyModule()\n        self._CacheModulePrefixes()\n\n    def Write(self):\n        self._WriteIncludes()\n        self.out_file.write(self.prefix)\n        self._WriteModuleInstances()\n        test_function_num = 0\n        self.out_file.write('\\nvoid run_spec_tests_0(void) {\\n\\n')\n        for i, command in enumerate(self.commands):\n            self._WriteCommand(command)\n            if i % MAX_COMMANDS_PER_FUNCTION == MAX_COMMANDS_PER_FUNCTION - 1:\n                test_function_num += 1\n                self.out_file.write('\\n}\\n\\nvoid run_spec_tests_%d(void) {\\n\\n' % test_function_num)\n\n        self.out_file.write('\\n}\\n\\nvoid run_spec_tests(void) {\\n\\n')\n        for i in range(test_function_num + 1):\n            self.out_file.write('run_spec_tests_%d();\\n' % i)\n        self._WriteModuleCleanUps()\n        self.out_file.write('\\n}\\n')\n\n    def GetModuleFilenames(self):\n        return [c['filename'] for c in self.commands if IsModuleCommand(c)]\n\n    def GetModulePrefix(self, idx_or_name=None):\n        if idx_or_name is None:\n            idx_or_name = self.module_idx - 1\n        return self.module_prefix_map[idx_or_name]\n\n    def GetModulePrefixUnmangled(self, idx):\n        return self.unmangled_names[idx]\n\n    def GetModuleInstanceName(self, idx_or_name=None):\n        return self.GetModulePrefix(idx_or_name) + '_instance'\n\n    def _CacheModulePrefixes(self):\n        idx = 0\n        for command in self.commands:\n            if IsModuleCommand(command):\n                name = os.path.basename(command['filename'])\n                name = re.sub(r'[^a-zA-Z0-9_]', '_', name)\n                name = os.path.splitext(name)[0]\n                self.unmangled_names[idx] = name\n                name = MangleModuleName(name)\n\n                self.module_prefix_map[idx] = name\n\n                if 'name' in command:\n                    self.module_name_to_idx[command['name']] = idx\n                    self.idx_to_module_name[idx] = command['name']\n                    self.module_prefix_map[command['name']] = name\n\n                idx += 1\n            elif command['type'] == 'register':\n                name = MangleModuleName(command['as'])\n                if 'name' in command:\n                    self.module_prefix_map[command['name']] = name\n                    name_idx = self.module_name_to_idx[command['name']]\n                else:\n                    name_idx = idx - 1\n\n                if name_idx in self.idx_to_module_name:\n                    self.module_prefix_map[self.idx_to_module_name[name_idx]] = name\n                self.module_prefix_map[name_idx] = name\n                self.unmangled_names[name_idx] = command['as']\n\n    def _WriteModuleInitCall(self, command, uninstantiable):\n        header_filename = utils.ChangeExt(command['filename'], '.h')\n        with open(os.path.join(self.out_dir, header_filename), encoding='utf-8') as f:\n            imported_modules = set()\n            for line in f:\n                if 'import: ' in line:\n                    line_split = line.split()\n                    import_module_name = MangleModuleName(line_split[2][1:-1])\n                    imported_modules.add(import_module_name)\n\n        if uninstantiable:\n            self.out_file.write('ASSERT_TRAP(')\n\n        self.out_file.write('wasm2c_%s_instantiate(&%s_instance' % (self.GetModulePrefix(), self.GetModulePrefix()))\n        for imported_module in sorted(imported_modules):\n            self.out_file.write(', &%s_instance' % imported_module)\n        self.out_file.write(')')\n\n        if uninstantiable:\n            self.out_file.write(')')\n\n        self.out_file.write(';\\n')\n\n    def _MaybeWriteDummyModule(self):\n        if len(self.GetModuleFilenames()) == 0:\n            # This test doesn't have any valid modules, so just use a dummy instead.\n            filename = utils.ChangeExt(self.source_filename, '-dummy.wasm')\n            with open(os.path.join(self.out_dir, filename), 'wb') as wasm_file:\n                wasm_file.write(b'\\x00\\x61\\x73\\x6d\\x01\\x00\\x00\\x00')\n\n            dummy_command = {'type': 'module', 'line': 0, 'filename': filename}\n            self.commands.insert(0, dummy_command)\n\n    def _WriteFileAndLine(self, command):\n        self.out_file.write('#line {line:d} \"{name:s}\"\\n'.format(name=self.source_filename, line=command['line']))\n\n    def _WriteIncludes(self):\n        idx = 0\n        for filename in self.GetModuleFilenames():\n            header = os.path.splitext(filename)[0] + '.h'\n            self.out_file.write(\"#include \\\"%s\\\"\\n\" % header)\n            idx += 1\n\n    def _WriteCommand(self, command):\n        command_funcs = {\n            'module': self._WriteModuleCommand,\n            'assert_uninstantiable': self._WriteAssertUninstantiableCommand,\n            'action': self._WriteActionCommand,\n            'assert_return': self._WriteAssertReturnCommand,\n            'assert_trap': self._WriteAssertActionCommand,\n            'assert_exception': self._WriteAssertActionCommand,\n            'assert_exhaustion': self._WriteAssertActionCommand,\n        }\n\n        func = command_funcs.get(command['type'])\n        if func is not None:\n            self._WriteFileAndLine(command)\n            func(command)\n            self.out_file.write('\\n')\n\n    def _WriteModuleCommand(self, command):\n        self.module_idx += 1\n        self._WriteModuleInitCall(command, False)\n\n    def _WriteModuleInstances(self):\n        idx = 0\n        for command in self.commands:\n            if IsModuleCommand(command):\n                self.out_file.write('w2c_%s %s;\\n' % (self.GetModulePrefix(idx), self.GetModuleInstanceName(idx)))\n                idx += 1\n\n    def _WriteModuleCleanUps(self):\n        for idx in range(self.module_idx):\n            self.out_file.write(\"wasm2c_%s_free(&%s);\\n\" % (self.GetModulePrefix(idx), self.GetModuleInstanceName(idx)))\n\n    def _WriteAssertUninstantiableCommand(self, command):\n        self.module_idx += 1\n        self._WriteModuleInitCall(command, True)\n\n    def _WriteActionCommand(self, command):\n        self.out_file.write('%s;\\n' % self._Action(command))\n\n    def _WriteAssertReturnCommand(self, command):\n        expected = command['expected']\n        if len(expected) == 1:\n            type_ = expected[0]['type']\n            value = expected[0]['value']\n            if type_ == 'v128':\n                lane_type = expected[0]['lane_type']\n                lane_count = len(expected[0]['value'])\n                # type, fmt_expected, fmt_got, f, compare, expected, found\n                self.out_file.write('ASSERT_RETURN_MULTI_T(%s, %s, %s, %s, %s, (%s), (%s));\\n' %\n                                    (\"v128\",\n                                     \" \".join(\"MULTI_\" + (\"str\" if val in ('nan:canonical', 'nan:arithmetic') else lane_type) for val in value),\n                                     \" \".join(\"MULTI_\" + lane_type for _ in value),\n                                     self._Action(command),\n                                     self._SIMDCompareVector(expected[0]),\n                                     self._SIMDConstantList(expected[0]),\n                                     self._SIMDFoundList(lane_type, lane_count)))\n            elif value == 'nan:canonical':\n                assert_map = {\n                    'f32': 'ASSERT_RETURN_CANONICAL_NAN_F32',\n                    'f64': 'ASSERT_RETURN_CANONICAL_NAN_F64',\n                }\n                assert_macro = assert_map[(type_)]\n                self.out_file.write('%s(%s);\\n' % (assert_macro, self._Action(command)))\n            elif value == 'nan:arithmetic':\n                assert_map = {\n                    'f32': 'ASSERT_RETURN_ARITHMETIC_NAN_F32',\n                    'f64': 'ASSERT_RETURN_ARITHMETIC_NAN_F64',\n                }\n                assert_macro = assert_map[(type_)]\n                self.out_file.write('%s(%s);\\n' % (assert_macro, self._Action(command)))\n            else:\n                assert_map = {\n                    'i32': 'ASSERT_RETURN_I32',\n                    'f32': 'ASSERT_RETURN_F32',\n                    'i64': 'ASSERT_RETURN_I64',\n                    'f64': 'ASSERT_RETURN_F64',\n                    'externref': 'ASSERT_RETURN_EXTERNREF',\n                    'exnref': 'ASSERT_RETURN_EXNREF',\n                    'funcref': 'ASSERT_RETURN_FUNCREF',\n                }\n\n                assert_macro = assert_map[type_]\n                self.out_file.write('%s(%s, %s);\\n' %\n                                    (assert_macro,\n                                     self._Action(command),\n                                     self._ConstantList(expected)))\n        elif len(expected) == 0:\n            self._WriteAssertActionCommand(command)\n        else:\n            result_types = [result['type'] for result in expected]\n            # type, fmt_expected, fmt_got, f, compare, expected, found\n            self.out_file.write('ASSERT_RETURN_MULTI_T(%s, %s, %s, %s, %s, (%s), (%s));\\n' %\n                                (\"struct wasm_multi_\" + MangleTypes(result_types),\n                                 \" \".join(\"MULTI_\" + ty for ty in result_types),\n                                 \" \".join(\"MULTI_\" + ty for ty in result_types),\n                                 self._Action(command),\n                                 self._CompareList(expected),\n                                 self._ConstantList(expected),\n                                 self._FoundList(result_types)))\n\n    def _WriteAssertActionCommand(self, command):\n        assert_map = {\n            'assert_exhaustion': 'ASSERT_EXHAUSTION',\n            'assert_return': 'ASSERT_RETURN',\n            'assert_trap': 'ASSERT_TRAP',\n            'assert_exception': 'ASSERT_EXCEPTION',\n        }\n\n        assert_macro = assert_map[command['type']]\n        self.out_file.write('%s(%s);\\n' % (assert_macro, self._Action(command)))\n\n    def _Constant(self, const):\n        type_ = const['type']\n        value = const['value']\n        if type_ == 'i8':\n            return '%su' % int(value)\n        if type_ == 'i16':\n            return '%su' % int(value)\n        if type_ == 'i32':\n            return '%su' % int(value)\n        elif type_ == 'i64':\n            return '%sull' % int(value)\n        elif type_ == 'f32':\n            if value in ('nan:canonical', 'nan:arithmetic'):\n                return '\"(f32 %s)\"' % value\n            return F32ToC(int(value))\n        elif type_ == 'f64':\n            if value in ('nan:canonical', 'nan:arithmetic'):\n                return '\"(f64 %s)\"' % value\n            return F64ToC(int(value))\n        elif type_ == 'v128':\n            return 'v128_' + const['lane_type'] + 'x' + str(len(const['value'])) + '_make(' + ','.join([self._Constant({'type': const['lane_type'], 'value': x}) for x in value]) + ')'\n        elif type_ == 'externref':\n            if value == 'null':\n                return 'wasm_rt_externref_null_value'\n            else:\n                return 'spectest_make_externref(%s)' % value\n        elif type_ == 'funcref':\n            if value == 'null':\n                return 'wasm_rt_funcref_null_value'\n            else:\n                assert False  # can't make an arbitrary funcref from an integer value\n        elif type_ == 'exnref':\n            if value == 'null':\n                return 'wasm_rt_exnref_null_value'\n            else:\n                assert False  # can't make an arbitrary exnref from an integer value\n        else:\n            assert False\n\n    def _ConstantList(self, consts):\n        return ', '.join(self._Constant(const) for const in consts)\n\n    def _Found(self, num, type_):\n        return \"actual.%s%s\" % (MangleType(type_), num)\n\n    def _FoundList(self, types):\n        return ', '.join(self._Found(num, type_) for num, type_ in enumerate(types))\n\n    def _Compare(self, num, const):\n        return \"is_equal_%s(%s, %s)\" % (const['type'],\n                                        self._Constant(const),\n                                        self._Found(num, const['type']))\n\n    def _CompareList(self, consts):\n        return ' && '.join(self._Compare(num, const) for num, const in enumerate(consts))\n\n    def _SIMDConstantList(self, const):\n        return ', '.join(self._Constant({'type': const['lane_type'], 'value': val}) for val in const['value'])\n\n    def _SIMDFound(self, num, lane_type, lane_count):\n        return 'v128_%sx%d_extract_lane(actual, %d)' % (lane_type, lane_count, num)\n\n    def _SIMDFoundList(self, lane_type, lane_count):\n        return ', '.join(self._SIMDFound(num, lane_type, lane_count) for num in range(lane_count))\n\n    def _SIMDCompare(self, num, val, lane_type, lane_count):\n        if val == 'nan:canonical':\n            return 'is_canonical_nan_%s(%s_bits(%s))' % (lane_type, lane_type, self._SIMDFound(num, lane_type, lane_count))\n        elif val == 'nan:arithmetic':\n            return 'is_arithmetic_nan_%s(%s_bits(%s))' % (lane_type, lane_type, self._SIMDFound(num, lane_type, lane_count))\n        else:\n            return \"is_equal_%s(%s, %s)\" % (lane_type,\n                                            self._Constant({'type': lane_type, 'value': val}),\n                                            self._SIMDFound(num, lane_type, lane_count))\n\n    def _SIMDCompareVector(self, const):\n        return ' && '.join(self._SIMDCompare(num, val, const['lane_type'], len(const['value'])) for num, val in enumerate(const['value']))\n\n    def _Action(self, command):\n        action = command['action']\n        type_ = action['type']\n        mangled_module_name = self.GetModulePrefix(action.get('module'))\n        field = \"w2c_\" + mangled_module_name + '_' + MangleName(action['field'])\n        if type_ == 'invoke':\n            args = self._ConstantList(action.get('args', []))\n            if len(args) == 0:\n                args = f'&{mangled_module_name}_instance'\n            else:\n                args = f'&{mangled_module_name}_instance, {args}'\n            return '%s(%s)' % (field, args)\n        elif type_ == 'get':\n            return '*%s(%s)' % (field, '&' + mangled_module_name + '_instance')\n        else:\n            raise Error('Unexpected action type: %s' % type_)\n\n\ndef Compile(cc, c_filename, out_dir, use_c11, *cflags):\n    if IS_WINDOWS:\n        ext = '.obj'\n    else:\n        ext = '.o'\n    o_filename = utils.ChangeDir(utils.ChangeExt(c_filename, ext), out_dir)\n    args = list(cflags)\n\n    if IS_WINDOWS:\n        cstd_flag = ['/std:c11', '/experimental:c11atomics'] if use_c11 else []\n        args += cstd_flag + ['/nologo', '/MDd', '/c', c_filename, '/Fo' + o_filename]\n    else:\n        # See \"Compiling the wasm2c output\" section of wasm2c/README.md\n        # When compiling with -O2, GCC and clang require '-fno-optimize-sibling-calls'\n        # and '-frounding-math' to maintain conformance with the spec tests\n        # (GCC also requires '-fsignaling-nans')\n        if use_c11:\n            args.append('-std=c11')\n        else:\n            args.append('-std=c99')\n        args += ['-c', c_filename, '-o', o_filename, '-O2',\n                 '-Wall', '-Werror', '-Wno-unused',\n                 '-Wno-array-bounds',\n                 '-Wno-ignored-optimization-argument',\n                 '-Wno-tautological-constant-out-of-range-compare',\n                 '-Wno-infinite-recursion',\n                 # simde calls for pragma clang loop vectorize(enable),\n                 # which can generate warnings if the optimization pass fails.\n                 '-Wno-pass-failed',\n                 '-fno-optimize-sibling-calls',\n                 '-frounding-math', '-fsignaling-nans',\n                 '-D_DEFAULT_SOURCE']\n    # Use RunWithArgsForStdout and discard stdout because cl.exe\n    # unconditionally prints the name of input files on stdout\n    # and we don't want that to be part of our stdout.\n    cc.RunWithArgsForStdout(*args)\n    return o_filename\n\n\ndef Link(cc, o_filenames, main_exe, *extra_args):\n    args = o_filenames\n    if IS_WINDOWS:\n        # Windows default to 1Mb of stack but `spec/skip-stack-guard-page.wast`\n        # uses more than this.  Set to 8Mb for parity with linux.\n        args += ['/nologo', '/MDd', '/link', '/stack:8388608', '/out:' + main_exe]\n    else:\n        args += ['-o', main_exe]\n    args += list(extra_args)\n    # Use RunWithArgsForStdout and discard stdout because cl.exe\n    # unconditionally prints the name of input files on stdout\n    # and we don't want that to be part of our stdout.\n    cc.RunWithArgsForStdout(*args)\n\n\ndef main(args):\n    default_compiler = 'cc'\n    if IS_WINDOWS:\n        default_compiler = 'cl.exe'\n    default_compiler = os.getenv('WASM2C_CC', os.getenv('CC', default_compiler))\n    parser = argparse.ArgumentParser()\n    parser.add_argument('-o', '--out-dir', metavar='PATH',\n                        help='output directory for files.')\n    parser.add_argument('-P', '--prefix', metavar='PATH', help='prefix file.',\n                        default=os.path.join(SCRIPT_DIR, 'spec-wasm2c-prefix.c'))\n    parser.add_argument('--bindir', metavar='PATH',\n                        default=find_exe.GetDefaultPath(),\n                        help='directory to search for all executables.')\n    parser.add_argument('--wasmrt-dir', metavar='PATH',\n                        help='directory with wasm-rt files', default=WASM2C_DIR)\n    parser.add_argument('--simde-dir', metavar='PATH',\n                        help='directory with SIMD Everywhere files', default=SIMDE_DIR)\n    parser.add_argument('--cc', metavar='PATH',\n                        help='the path to the C compiler',\n                        default=default_compiler)\n    parser.add_argument('--cflags', metavar='FLAGS',\n                        help='additional flags for C compiler.',\n                        action='append', default=[])\n    parser.add_argument('--compile', help='compile the C code (default)',\n                        dest='compile', action='store_true')\n    parser.add_argument('--no-compile', help='don\\'t compile the C code',\n                        dest='compile', action='store_false')\n    parser.set_defaults(compile=True)\n    parser.add_argument('--no-run', help='don\\'t run the compiled executable',\n                        dest='run', action='store_false')\n    parser.add_argument('-v', '--verbose', help='print more diagnotic messages.',\n                        action='store_true')\n    parser.add_argument('--no-error-cmdline',\n                        help='don\\'t display the subprocess\\'s commandline when '\n                        'an error occurs', dest='error_cmdline',\n                        action='store_false')\n    parser.add_argument('-p', '--print-cmd',\n                        help='print the commands that are run.',\n                        action='store_true')\n    parser.add_argument('file', help='wast file.')\n    parser.add_argument('--enable-exceptions', action='store_true')\n    parser.add_argument('--enable-multi-memory', action='store_true')\n    parser.add_argument('--enable-memory64', action='store_true')\n    parser.add_argument('--enable-extended-const', action='store_true')\n    parser.add_argument('--enable-threads', action='store_true')\n    parser.add_argument('--enable-tail-call', action='store_true')\n    parser.add_argument('--enable-custom-page-sizes', action='store_true')\n    parser.add_argument('--disable-bulk-memory', action='store_true')\n    parser.add_argument('--disable-reference-types', action='store_true')\n    parser.add_argument('--debug-names', action='store_true')\n    parser.add_argument('--num-outputs', metavar='COUNT',\n                        help='number of output c files for wasm2c', dest='num_outputs',\n                        default=1, type=int, action='store')\n    options = parser.parse_args(args)\n\n    with utils.TempDirectory(options.out_dir, 'run-spec-wasm2c-') as out_dir:\n        # Parse JSON file and generate main .c file with calls to test functions.\n        wast2json = utils.Executable(\n            find_exe.GetWast2JsonExecutable(options.bindir),\n            error_cmdline=options.error_cmdline)\n        wast2json.verbose = options.print_cmd\n        wast2json.AppendOptionalArgs({\n            '-v': options.verbose,\n            '--enable-exceptions': options.enable_exceptions,\n            '--enable-memory64': options.enable_memory64,\n            '--enable-extended-const': options.enable_extended_const,\n            '--enable-threads': options.enable_threads,\n            '--enable-tail-call': options.enable_tail_call,\n            '--enable-custom-page-sizes': options.enable_custom_page_sizes,\n            '--enable-multi-memory': options.enable_multi_memory,\n            '--disable-bulk-memory': options.disable_bulk_memory,\n            '--disable-reference-types': options.disable_reference_types,\n            '--debug-names': options.debug_names})\n\n        json_file_path = utils.ChangeDir(\n            utils.ChangeExt(options.file, '.json'), out_dir)\n        wast2json.RunWithArgs(options.file, '-o', json_file_path)\n\n        wasm2c = utils.Executable(\n            find_exe.GetWasm2CExecutable(options.bindir),\n            error_cmdline=options.error_cmdline)\n        wasm2c.verbose = options.print_cmd\n        wasm2c.AppendOptionalArgs({\n            '--enable-exceptions': options.enable_exceptions,\n            '--enable-memory64': options.enable_memory64,\n            '--enable-extended-const': options.enable_extended_const,\n            '--enable-threads': options.enable_threads,\n            '--enable-tail-call': options.enable_tail_call,\n            '--enable-custom-page-sizes': options.enable_custom_page_sizes,\n            '--enable-multi-memory': options.enable_multi_memory})\n\n        options.cflags += shlex.split(os.environ.get('WASM2C_CFLAGS', ''))\n        cc = utils.Executable(options.cc, *options.cflags, forward_stderr=True,\n                              forward_stdout=False)\n        cc.verbose = options.print_cmd\n\n        with open(json_file_path, encoding='utf-8') as json_file:\n            spec_json = json.load(json_file)\n\n        prefix = ''\n        if options.prefix:\n            with open(options.prefix) as prefix_file:\n                prefix = prefix_file.read() + '\\n'\n\n        output = io.StringIO()\n        cwriter = CWriter(spec_json, prefix, output, out_dir)\n\n        o_filenames = []\n        cflags = ['-I%s' % options.wasmrt_dir, '-I%s' % options.simde_dir]\n        if options.enable_memory64:\n            if IS_WINDOWS:\n                sys.stderr.write('skipping: wasm2c+memory64 is not yet supported under msvc\\n')\n                return SKIPPED\n\n        use_c11 = options.enable_threads\n\n        for i, wasm_filename in enumerate(cwriter.GetModuleFilenames()):\n            wasm_filename = os.path.join(out_dir, wasm_filename)\n            c_filename_input = utils.ChangeExt(wasm_filename, '.c')\n            c_filenames = []\n            if options.num_outputs > 1:\n                base = os.path.splitext(c_filename_input)[0]\n                for j in range(options.num_outputs):\n                    c_filenames.append(base + '_' + str(j) + '.c')\n            else:\n                c_filenames.append(utils.ChangeExt(wasm_filename, '.c'))\n            args = ['-n', cwriter.GetModulePrefixUnmangled(i), '--num-outputs', str(options.num_outputs)]\n            wasm2c.RunWithArgs(wasm_filename, '-o', c_filename_input, *args)\n            if options.compile:\n                for j, c_filename in enumerate(c_filenames):\n                    o_filenames.append(Compile(cc, c_filename, out_dir, use_c11, *cflags))\n\n        cwriter.Write()\n        main_filename = utils.ChangeExt(json_file_path, '-main.c')\n        with open(main_filename, 'w') as out_main_file:\n            out_main_file.write(output.getvalue())\n\n        if options.compile:\n            # Compile runtime code\n            source_files = [\n                main_filename,\n                os.path.join(options.wasmrt_dir, 'wasm-rt-impl.c'),\n                os.path.join(options.wasmrt_dir, 'wasm-rt-exceptions-impl.c'),\n                os.path.join(options.wasmrt_dir, 'wasm-rt-mem-impl.c'),\n            ]\n\n            for f in source_files:\n                o_filenames.append(Compile(cc, f, out_dir, use_c11, *cflags))\n\n            if IS_WINDOWS:\n                exe_ext = '.exe'\n                libs = []\n            else:\n                exe_ext = ''\n                libs = ['-lm']\n            main_exe = utils.ChangeExt(json_file_path, exe_ext)\n            Link(cc, o_filenames, main_exe, *libs)\n\n            # Run the resulting binary\n            if options.run:\n                test_runner = os.getenv('WASM2C_TEST_RUNNER', '').split()\n                return subprocess.run(test_runner + [main_exe]).returncode\n    return 0\n\n\nif __name__ == '__main__':\n    sys.exit(main(sys.argv[1:]))\n"
  },
  {
    "path": "test/run-tests.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport argparse\nimport difflib\nimport fnmatch\nimport multiprocessing\nimport os\nimport platform\nimport re\nimport shlex\nimport shutil\nimport subprocess\nimport sys\nimport threading\nimport time\n\nimport find_exe\nfrom utils import Error\n\nIS_WINDOWS = sys.platform == 'win32'\nTEST_DIR = os.path.dirname(os.path.abspath(__file__))\nREPO_ROOT_DIR = os.path.dirname(TEST_DIR)\nOUT_DIR = os.path.join(REPO_ROOT_DIR, 'out')\nDEFAULT_TIMEOUT = 120    # seconds\nSLOW_TIMEOUT_MULTIPLIER = 3\n\n# default configurations for tests\nTOOLS = {\n    'wat2wasm': [\n        ('RUN', '%(wat2wasm)s'),\n        ('ARGS', ['%(in_file)s', '-o', '%(out_dir)s/out.wasm']),\n        ('VERBOSE-ARGS', ['-v']),\n    ],\n    'wast2json': [\n        ('RUN', '%(wast2json)s'),\n        ('ARGS', ['%(in_file)s', '-o', '%(out_dir)s/out.json']),\n        ('VERBOSE-ARGS', ['-v']),\n    ],\n    'wat-desugar': [\n        ('RUN', '%(wat-desugar)s'),\n        ('ARGS', ['%(in_file)s']),\n    ],\n    'run-objdump': [\n        ('RUN', '%(wat2wasm)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-objdump)s -r -d %(temp_file)s.wasm'),\n        ('VERBOSE-ARGS', ['-v']),\n    ],\n    'run-objdump-gen-wasm': [\n        ('RUN', '%(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-objdump)s -r -d %(temp_file)s.wasm'),\n        ('VERBOSE-ARGS', ['-v']),\n    ],\n    'run-objdump-spec': [\n        ('RUN', '%(wast2json)s %(in_file)s -o %(temp_file)s.json'),\n        # NOTE: wasm files must be passed in manually via ARGS1\n        ('RUN', '%(wasm-objdump)s -r -d'),\n        ('VERBOSE-ARGS', ['-v']),\n    ],\n    'run-roundtrip': [\n        ('RUN', 'test/run-roundtrip.py'),\n        ('ARGS', [\n            '%(in_file)s',\n            '-v',\n            '--bindir=%(bindir)s',\n            '--no-error-cmdline',\n            '-o',\n            '%(out_dir)s',\n        ]),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-interp': [\n        ('RUN', '%(wat2wasm)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-interp)s %(temp_file)s.wasm --run-all-exports'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-interp-wasi': [\n        ('RUN', '%(wat2wasm)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-interp)s --wasi %(temp_file)s.wasm'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-interp-spec': [\n        ('RUN', '%(wast2json)s %(in_file)s -o %(temp_file)s.json'),\n        ('RUN', '%(spectest-interp)s %(temp_file)s.json'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-gen-wasm': [\n        ('RUN', '%(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-validate)s %(temp_file)s.wasm'),\n        ('RUN', '%(wasm2wat)s %(temp_file)s.wasm'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-gen-wasm-bad': [\n        ('RUN', '%(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-validate)s %(temp_file)s.wasm'),\n        ('ERROR', '1'),\n        ('RUN', '%(wasm2wat)s %(temp_file)s.wasm'),\n        ('ERROR', '1'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-gen-wasm-interp': [\n        ('RUN', '%(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-interp)s --run-all-exports %(temp_file)s.wasm'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-gen-wasm-strip': [\n        ('RUN', '%(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-strip)s %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-objdump)s -h %(temp_file)s.wasm'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-gen-wasm-decompile': [\n        ('RUN', '%(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-validate)s %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-decompile)s %(temp_file)s.wasm'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-stats': [\n        ('RUN', '%(wat2wasm)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-stats)s %(temp_file)s.wasm'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-gen-spec-js': [\n        ('RUN', '%(wast2json)s %(in_file)s -o %(temp_file)s.json'),\n        ('RUN', '%(gen_spec_js_py)s %(temp_file)s.json'),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-spec-wasm2c': [\n        ('RUN', 'test/run-spec-wasm2c.py'),\n        ('ARGS', [\n            '%(in_file)s',\n            '--bindir=%(bindir)s',\n            '--no-error-cmdline',\n            '-o',\n            '%(out_dir)s',\n        ]),\n        ('VERBOSE-ARGS', ['--print-cmd', '-v']),\n    ],\n    'run-wasm2c': [\n        ('RUN', '%(wat2wasm)s %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm2c)s -n test %(temp_file)s.wasm'),\n    ],\n    'run-wasm-decompile': [\n        ('RUN', '%(wat2wasm)s --enable-all %(in_file)s -o %(temp_file)s.wasm'),\n        ('RUN', '%(wasm-decompile)s --enable-all %(temp_file)s.wasm'),\n    ]\n}\n\nROUNDTRIP_TOOLS = ('wat2wasm',)\n\n\nclass NoRoundtripError(Error):\n    pass\n\n\ndef Indent(s, spaces):\n    return ''.join(' ' * spaces + line for line in s.splitlines(1))\n\n\ndef DiffLines(expected, actual):\n    def Decode(s):\n        return s.decode('utf-8', 'replace')\n\n    expected_lines = [Decode(line) for line in expected.splitlines() if line]\n    actual_lines = [Decode(line) for line in actual.splitlines() if line]\n    return list(\n        difflib.unified_diff(expected_lines, actual_lines, fromfile='expected',\n                             tofile='actual', lineterm=''))\n\n\nclass Cell(object):\n\n    def __init__(self, value):\n        self.value = [value]\n\n    def Set(self, value):\n        self.value[0] = value\n\n    def Get(self):\n        return self.value[0]\n\n\ndef SplitArgs(value):\n    if isinstance(value, list):\n        return value\n    return shlex.split(value)\n\n\ndef FixPythonExecutable(args):\n    \"\"\"Given an argument list beginning with a `*.py` file, return one with that\n         uses sys.executable as arg[0].\n    \"\"\"\n    exe, rest = args[0], args[1:]\n    if os.path.splitext(exe)[1] == '.py':\n        return [sys.executable, os.path.join(REPO_ROOT_DIR, exe)] + rest\n    return args\n\n\nclass CommandTemplate(object):\n\n    def __init__(self, exe):\n        self.args = SplitArgs(exe)\n        self.verbose_args = []\n        self.stdin = None\n        self.expected_returncode = 0\n\n    def AppendArgs(self, args):\n        self.args += SplitArgs(args)\n\n    def SetExpectedReturncode(self, returncode):\n        self.expected_returncode = returncode\n\n    def AppendVerboseArgs(self, args_list):\n        for level, level_args in enumerate(args_list):\n            while level >= len(self.verbose_args):\n                self.verbose_args.append([])\n            self.verbose_args[level] += SplitArgs(level_args)\n\n    def SetStdin(self, filename):\n        self.stdin = filename\n\n    def _Format(self, cmd, variables):\n        return [arg % variables for arg in cmd]\n\n    def GetCommand(self, variables, extra_args=None, verbose_level=0):\n        args = self.args[:]\n        vl = 0\n        while vl < verbose_level and vl < len(self.verbose_args):\n            args += self.verbose_args[vl]\n            vl += 1\n        if extra_args:\n            args += extra_args\n        args = self._Format(args, variables)\n        stdin = self.stdin\n        if stdin:\n            stdin = stdin % variables\n        return Command(self, FixPythonExecutable(args), stdin)\n\n\nclass Command(object):\n\n    def __init__(self, template, args, stdin):\n        self.template = template\n        self.args = args\n        self.stdin = stdin\n\n    def GetExpectedReturncode(self):\n        return self.template.expected_returncode\n\n    def Run(self, cwd, timeout, console_out=False, env=None):\n        process = None\n        is_timeout = Cell(False)\n\n        cmd = self.args\n        stdout_filename = None\n        # Hacky support for stdout redirection `cmd > output`\n        if len(cmd) > 2 and cmd[-2] == '>':\n            stdout_filename = os.path.join(cwd, cmd[-1])\n            cmd = cmd[:-2]\n\n        def KillProcess(timeout=True):\n            if process:\n                try:\n                    if IS_WINDOWS:\n                        # http://stackoverflow.com/a/10830753: deleting child processes in\n                        # Windows\n                        subprocess.call(['taskkill', '/F', '/T', '/PID', str(process.pid)])\n                    else:\n                        os.killpg(os.getpgid(process.pid), 15)\n                except OSError:\n                    pass\n            is_timeout.Set(timeout)\n\n        try:\n            start_time = time.time()\n            kwargs = {}\n            if not IS_WINDOWS:\n                kwargs['preexec_fn'] = os.setsid\n            stdin_data = None\n            if self.stdin:\n                stdin_data = open(self.stdin, 'rb').read()\n\n            # http://stackoverflow.com/a/10012262: subprocess with a timeout\n            # http://stackoverflow.com/a/22582602: kill subprocess and children\n            process = subprocess.Popen(cmd, cwd=cwd, env=env,\n                                       stdout=None if console_out else subprocess.PIPE,\n                                       stderr=None if console_out else subprocess.PIPE,\n                                       stdin=None if not self.stdin else subprocess.PIPE,\n                                       **kwargs)\n            timer = threading.Timer(timeout, KillProcess)\n            try:\n                timer.start()\n                stdout, stderr = process.communicate(input=stdin_data)\n            finally:\n                returncode = process.returncode\n                process = None\n                timer.cancel()\n            if is_timeout.Get():\n                raise Error('TIMEOUT')\n            duration = time.time() - start_time\n        except OSError as e:\n            raise Error(str(e))\n        finally:\n            KillProcess(False)\n\n        if stdout_filename:\n            open(stdout_filename, 'wb').write(stdout)\n            stdout = None\n\n        return RunResult(self, stdout, stderr, returncode, duration)\n\n    def __str__(self):\n        return ' '.join(self.args)\n\n\nclass RunResult(object):\n\n    def __init__(self, cmd=None, stdout='', stderr='', returncode=0, duration=0):\n        self.cmd = cmd\n        self.stdout = stdout\n        self.stderr = stderr\n        self.returncode = returncode\n        self.duration = duration\n\n    def GetExpectedReturncode(self):\n        return self.cmd.GetExpectedReturncode()\n\n    def Failed(self):\n        return self.returncode != self.GetExpectedReturncode()\n\n    def __repr__(self):\n        return 'RunResult(%s, %s, %s, %s, %s)' % (\n            self.cmd, self.stdout, self.stderr, self.returncode, self.duration)\n\n\nclass TestResult(object):\n\n    def __init__(self):\n        self.results = []\n        self.stdout = b''\n        self.stderr = b''\n        self.duration = 0\n\n    def GetLastCommand(self):\n        return self.results[-1].cmd\n\n    def GetLastFailure(self):\n        return [r for r in self.results if r.Failed()][-1]\n\n    def Failed(self):\n        return any(r.Failed() for r in self.results)\n\n    def Append(self, result):\n        self.results.append(result)\n\n        if result.stdout is not None:\n            self.stdout += result.stdout\n\n        if result.stderr is not None:\n            self.stderr += result.stderr\n\n        self.duration += result.duration\n\n\nclass TestInfo(object):\n\n    def __init__(self):\n        self.filename = ''\n        self.header = []\n        self.input_filename = ''\n        self.input_ = ''\n        self.expected_stdout = ''\n        self.expected_stderr = ''\n        self.tool = None\n        self.cmds = []\n        self.env = {}\n        self.slow = False\n        self.skip = False\n        self.is_roundtrip = False\n        self.is_wasm2c = False\n\n    def CreateRoundtripInfo(self, fold_exprs):\n        if self.tool not in ROUNDTRIP_TOOLS:\n            raise NoRoundtripError()\n\n        if len(self.cmds) != 1:\n            raise NoRoundtripError()\n\n        result = TestInfo()\n        result.SetTool('run-roundtrip')\n        result.filename = self.filename\n        result.header = self.header\n        result.input_filename = self.input_filename\n        result.input_ = self.input_\n        result.expected_stdout = ''\n        result.expected_stderr = ''\n\n        # TODO(binji): It's kind of cheesy to keep the enable flag based on prefix.\n        # Maybe it would be nicer to add a new directive ENABLE instead.\n        old_cmd = self.cmds[0]\n        new_cmd = result.cmds[0]\n        new_cmd.AppendArgs([f for f in old_cmd.args if f.startswith('--enable')])\n        if fold_exprs:\n            new_cmd.AppendArgs('--fold-exprs')\n\n        result.env = self.env\n        result.slow = self.slow\n        result.skip = self.skip\n        result.is_roundtrip = True\n        result.fold_exprs = fold_exprs\n        return result\n\n    def GetName(self):\n        name = self.filename\n        if self.is_roundtrip:\n            if self.fold_exprs:\n                name += ' (roundtrip fold-exprs)'\n            else:\n                name += ' (roundtrip)'\n        return name\n\n    def GetGeneratedInputFilename(self):\n        # All tests should be generated in their own directories, even if they\n        # share the same input filename. We want the input filename to be correct,\n        # though, so we use the directory of the test (.txt) file, but the basename\n        # of the input file (likely a .wast).\n\n        path = OUT_DIR\n        if self.input_filename:\n            basename = os.path.basename(self.input_filename)\n        else:\n            basename = os.path.basename(self.filename)\n\n        path = os.path.join(path, os.path.dirname(self.filename), basename)\n\n        if self.is_roundtrip:\n            dirname = os.path.dirname(path)\n            basename = os.path.basename(path)\n            if self.fold_exprs:\n                path = os.path.join(dirname, 'roundtrip_folded', basename)\n            else:\n                path = os.path.join(dirname, 'roundtrip', basename)\n\n        return path\n\n    def SetTool(self, tool):\n        if tool not in TOOLS:\n            raise Error('Unknown tool: %s' % tool)\n        self.tool = tool\n        self.is_wasm2c = self.tool == 'run-spec-wasm2c'\n        for tool_key, tool_value in TOOLS[tool]:\n            self.ParseDirective(tool_key, tool_value)\n\n    def GetCommand(self, index):\n        try:\n            return self.cmds[index]\n        except IndexError:\n            raise Error('Invalid command index: %s' % index)\n\n    def GetLastCommand(self):\n        return self.GetCommand(len(self.cmds) - 1)\n\n    def ApplyToCommandBySuffix(self, suffix, fn):\n        if suffix == '':\n            fn(self.GetLastCommand())\n        elif re.match(r'^\\d+$', suffix):\n            fn(self.GetCommand(int(suffix)))\n        elif suffix == '*':\n            for cmd in self.cmds:\n                fn(cmd)\n        else:\n            raise Error('Invalid directive suffix: %s' % suffix)\n\n    def ParseDirective(self, key, value):\n        if key == 'RUN':\n            self.cmds.append(CommandTemplate(value))\n        elif key == 'STDIN_FILE':\n            self.input_filename = value\n        elif key.startswith('ARGS'):\n            suffix = key[len('ARGS'):]\n            self.ApplyToCommandBySuffix(suffix, lambda cmd: cmd.AppendArgs(value))\n        elif key.startswith('ERROR'):\n            suffix = key[len('ERROR'):]\n            self.ApplyToCommandBySuffix(\n                suffix, lambda cmd: cmd.SetExpectedReturncode(int(value)))\n        elif key == 'SLOW':\n            self.slow = True\n        elif key == 'SKIP':\n            self.skip = True\n        elif key == 'VERBOSE-ARGS':\n            self.GetLastCommand().AppendVerboseArgs(value)\n        elif key in ['TODO', 'NOTE']:\n            pass\n        elif key == 'TOOL':\n            self.SetTool(value)\n        elif key == 'STDIN':\n            self.GetLastCommand().SetStdin(value)\n        elif key == 'ENV':\n            # Pattern: FOO=1 BAR=stuff\n            self.env = dict(x.split('=') for x in value.split())\n        elif key == 'PLATFORMS':\n            self.skip = platform.system() not in value.split()\n        elif key == 'NOT-PLATFORMS':\n            self.skip = platform.system() in value.split()\n        else:\n            raise Error('Unknown directive: %s' % key)\n\n    def Parse(self, filename):\n        self.filename = filename\n\n        test_path = os.path.join(REPO_ROOT_DIR, filename)\n        # Read/write as binary because spec tests may have invalid UTF-8 codes.\n        with open(test_path, 'rb') as f:\n            state = 'header'\n            empty = True\n            header_lines = []\n            input_lines = []\n            stdout_lines = []\n            stderr_lines = []\n            for line in f.readlines():\n                empty = False\n                m = re.match(b'\\\\s*\\\\(;; (STDOUT|STDERR) ;;;$', line.strip())\n                if m:\n                    directive = m.group(1).decode('utf-8')\n                    if directive == 'STDERR':\n                        state = 'stderr'\n                        continue\n                    elif directive == 'STDOUT':\n                        state = 'stdout'\n                        continue\n                else:\n                    m = re.match(b'\\\\s*;;;(.*)$', line)\n                    if m:\n                        directive = m.group(1).decode('utf-8').strip()\n                        if state == 'header':\n                            key, value = directive.split(':', 1)\n                            key = key.strip()\n                            value = value.strip()\n                            self.ParseDirective(key, value)\n                        elif state in ('stdout', 'stderr'):\n                            if not re.match(r'%s ;;\\)$' % state.upper(), directive):\n                                raise Error('Bad directive in %s block: %s' % (state,\n                                                                               directive))\n                            state = 'none'\n                        else:\n                            raise Error('Unexpected directive: %s' % directive)\n                    elif state == 'header':\n                        state = 'input'\n\n                if state == 'header':\n                    header_lines.append(line.decode('utf-8'))\n                if state == 'input':\n                    if self.input_filename:\n                        raise Error('Can\\'t have STDIN_FILE and input')\n                    input_lines.append(line)\n                elif state == 'stderr':\n                    stderr_lines.append(line)\n                elif state == 'stdout':\n                    stdout_lines.append(line)\n        if empty:\n            raise Error('empty test file')\n\n        self.header = ''.join(header_lines)\n        self.input_ = b''.join(input_lines)\n        self.expected_stdout = b''.join(stdout_lines)\n        self.expected_stderr = b''.join(stderr_lines)\n\n        if not self.cmds:\n            raise Error('test has no commands')\n\n    def CreateInputFile(self):\n        gen_input_path = self.GetGeneratedInputFilename()\n        gen_input_dir = os.path.dirname(gen_input_path)\n        try:\n            os.makedirs(gen_input_dir)\n        except OSError:\n            if not os.path.isdir(gen_input_dir):\n                raise\n\n        # Read/write as binary because spec tests may have invalid UTF-8 codes.\n        with open(gen_input_path, 'wb') as gen_input_file:\n            if self.input_filename:\n                input_path = os.path.join(REPO_ROOT_DIR, self.input_filename)\n                with open(input_path, 'rb') as input_file:\n                    gen_input_file.write(input_file.read())\n            else:\n                # add an empty line for each header line so the line numbers match\n                gen_input_file.write(('\\n' * self.header.count('\\n')).encode('ascii'))\n                gen_input_file.write(self.input_)\n            gen_input_file.flush()\n            return gen_input_file.name\n\n    def Rebase(self, stdout, stderr):\n        test_path = os.path.join(REPO_ROOT_DIR, self.filename)\n        with open(test_path, 'wb') as f:\n            f.write(self.header.encode('ascii'))\n            f.write(self.input_)\n            if stderr:\n                f.write(b'(;; STDERR ;;;\\n')\n                f.write(stderr)\n                f.write(b';;; STDERR ;;)\\n')\n            if stdout:\n                f.write(b'(;; STDOUT ;;;\\n')\n                f.write(stdout)\n                f.write(b';;; STDOUT ;;)\\n')\n\n    def Diff(self, stdout, stderr):\n        msg = ''\n        if self.expected_stderr != stderr:\n            diff_lines = DiffLines(self.expected_stderr, stderr)\n            if len(diff_lines) > 0:\n                msg += 'STDERR MISMATCH:\\n' + '\\n'.join(diff_lines) + '\\n'\n\n        if self.expected_stdout != stdout:\n            diff_lines = DiffLines(self.expected_stdout, stdout)\n            if len(diff_lines) > 0:\n                msg += 'STDOUT MISMATCH:\\n' + '\\n'.join(diff_lines) + '\\n'\n\n        if msg:\n            raise Error(msg)\n\n\nclass Status(object):\n\n    def __init__(self, isatty):\n        self.isatty = isatty\n        self.start_time = None\n        self.last_length = 0\n        self.last_finished = None\n        self.skipped = 0\n        self.passed = 0\n        self.failed = 0\n        self.total = 0\n        self.failed_tests = []\n\n    def Start(self, total):\n        self.total = total\n        self.start_time = time.time()\n\n    def Passed(self, info, duration):\n        self.passed += 1\n        if self.isatty:\n            self._Clear()\n            self._PrintShortStatus(info)\n        else:\n            sys.stderr.write('+ %s (%.3fs)\\n' % (info.GetName(), duration))\n\n    def Failed(self, info, error_msg, result=None):\n        self.failed += 1\n        self.failed_tests.append((info, result))\n        if self.isatty:\n            self._Clear()\n        sys.stderr.write('- %s\\n%s\\n' % (info.GetName(), Indent(error_msg, 2)))\n\n    def Skipped(self, info):\n        self.skipped += 1\n        if not self.isatty:\n            sys.stderr.write('. %s (skipped)\\n' % info.GetName())\n\n    def Done(self):\n        if self.isatty:\n            sys.stderr.write('\\n')\n\n    def _PrintShortStatus(self, info):\n        assert self.isatty\n        total_duration = time.time() - self.start_time\n        name = info.GetName() if info else ''\n        if self.total - self.skipped:\n            percent = 100 * (self.passed + self.failed) / (self.total - self.skipped)\n        else:\n            percent = 100\n        status = '[+%d|-%d|%%%d] (%.2fs) %s' % (self.passed, self.failed,\n                                                percent, total_duration, name)\n        self.last_length = len(status)\n        self.last_finished = info\n        sys.stderr.write(status)\n        sys.stderr.flush()\n\n    def _Clear(self):\n        assert self.isatty\n        sys.stderr.write('\\r%s\\r' % (' ' * self.last_length))\n\n\ndef FindTestFiles(ext, filter_pattern_re, exclude_dirs):\n    tests = []\n    for root, dirs, files in os.walk(TEST_DIR):\n        for ex in exclude_dirs:\n            if ex in dirs:\n                # Filtering out dirs here causes os.walk not to descend into them\n                dirs.remove(ex)\n        for f in files:\n            path = os.path.join(root, f)\n            if os.path.splitext(f)[1] == ext:\n                tests.append(os.path.relpath(path, REPO_ROOT_DIR))\n    tests.sort()\n    return [test for test in tests if re.match(filter_pattern_re, test)]\n\n\ndef GetAllTestInfo(test_names, status):\n    infos = []\n    for test_name in test_names:\n        info = TestInfo()\n        try:\n            info.Parse(test_name)\n            infos.append(info)\n        except Error as e:\n            status.Failed(info, str(e))\n    return infos\n\n\ndef CanonicalizePath(path):\n    \"\"\"In order to get identical test results we canonicalize path\n    names that we pass into test code.  We use posix path separators\n    because they work sufficiently well on all platforms (including\n    windows).\"\"\"\n    # For some reason this doesn't work on winows:\n    # return str(pathlib.PurePosixPath(path))\n    return path.replace(os.path.sep, '/')\n\n\ndef RunTest(info, options, variables, verbose_level=0):\n    timeout = options.timeout\n    if info.slow:\n        timeout *= SLOW_TIMEOUT_MULTIPLIER\n\n    # Clone variables dict so it can be safely modified.\n    variables = dict(variables)\n\n    cwd = REPO_ROOT_DIR\n    env = dict(os.environ)\n    env.update(info.env)\n    gen_input_path = info.CreateInputFile()\n    rel_gen_input_path = os.path.relpath(gen_input_path, cwd)\n    variables['in_file'] = CanonicalizePath(rel_gen_input_path)\n\n    # Each test runs with a unique output directory which is removed before\n    # we run the test.\n    out_dir = os.path.splitext(rel_gen_input_path)[0]\n    if os.path.isdir(out_dir):\n        shutil.rmtree(out_dir)\n    os.makedirs(out_dir)\n    variables['out_dir'] = CanonicalizePath(out_dir)\n\n    # Temporary files typically are placed in `out_dir` and use the same test's\n    # basename. This name does include an extension.\n    input_basename = os.path.basename(rel_gen_input_path)\n    temp_file = os.path.join(out_dir, os.path.splitext(input_basename)[0])\n    variables['temp_file'] = CanonicalizePath(temp_file)\n\n    test_result = TestResult()\n\n    for cmd_template in info.cmds:\n        cmd = cmd_template.GetCommand(variables, options.arg, verbose_level)\n        if options.print_cmd:\n            print(cmd)\n\n        try:\n            result = cmd.Run(cwd, timeout, verbose_level > 0, env)\n        except (Error, KeyboardInterrupt) as e:\n            return e\n\n        test_result.Append(result)\n        if result.Failed():\n            break\n\n    return test_result\n\n\ndef HandleTestResult(status, info, result, rebase=False):\n    try:\n        if isinstance(result, (Error, KeyboardInterrupt)):\n            raise result\n\n        if info.is_roundtrip:\n            if result.Failed():\n                if result.GetLastFailure().returncode == 2:\n                    # run-roundtrip.py returns 2 if the file couldn't be parsed.\n                    # it's likely a \"bad-*\" file.\n                    status.Skipped(info)\n                else:\n                    raise Error(result.stderr)\n            else:\n                status.Passed(info, result.duration)\n        else:\n            if result.Failed():\n                if result.GetLastFailure().returncode == 3:\n                    # run-spec-wasm2c.py returns 3 to signal that the test\n                    # should be skipped.\n                    status.Skipped(info)\n                    return\n                # This test has already failed, but diff it anyway.\n                last_failure = result.GetLastFailure()\n                msg = 'expected error code %d, got %d.' % (\n                    last_failure.GetExpectedReturncode(),\n                    last_failure.returncode)\n                try:\n                    info.Diff(result.stdout, result.stderr)\n                except Error as e:\n                    msg += '\\n' + str(e)\n                raise Error(msg)\n            else:\n                if rebase:\n                    info.Rebase(result.stdout, result.stderr)\n                else:\n                    info.Diff(result.stdout, result.stderr)\n                status.Passed(info, result.duration)\n    except Error as e:\n        status.Failed(info, str(e), result)\n\n\n# Source : http://stackoverflow.com/questions/3041986/python-command-line-yes-no-input\ndef YesNoPrompt(question, default='yes'):\n    \"\"\"Ask a yes/no question via input() and return their answer.\n\n    \"question\" is a string that is presented to the user.\n    \"default\" is the presumed answer if the user just hits <Enter>.\n        It must be \"yes\" (the default), \"no\" or None (meaning\n        an answer is required of the user).\n\n    The \"answer\" return value is True for \"yes\" or False for \"no\".\n    \"\"\"\n    valid = {'yes': True, 'y': True, 'ye': True, 'no': False, 'n': False}\n    if default is None:\n        prompt = ' [y/n] '\n    elif default == 'yes':\n        prompt = ' [Y/n] '\n    elif default == 'no':\n        prompt = ' [y/N] '\n    else:\n        raise ValueError('invalid default answer: \\'%s\\'' % default)\n\n    while True:\n        sys.stdout.write(question + prompt)\n        choice = input().lower()\n        if default is not None and choice == '':\n            return valid[default]\n        elif choice in valid:\n            return valid[choice]\n        else:\n            sys.stdout.write('Please respond with \\'yes\\' or \\'no\\' '\n                             '(or \\'y\\' or \\'n\\').\\n')\n\n\ndef RunMultiThreaded(infos_to_run, status, options, variables):\n    pool = multiprocessing.Pool(options.jobs)\n    try:\n        results = [(info, pool.apply_async(RunTest, (info, options, variables)))\n                   for info in infos_to_run]\n        while results:\n            new_results = []\n            for info, result in results:\n                if result.ready():\n                    HandleTestResult(status, info, result.get(0), options.rebase)\n                else:\n                    new_results.append((info, result))\n            time.sleep(0.01)\n            results = new_results\n        pool.close()\n    finally:\n        pool.terminate()\n        pool.join()\n\n\ndef RunSingleThreaded(infos_to_run, status, options, variables):\n    continued_errors = 0\n\n    for info in infos_to_run:\n        result = RunTest(info, options, variables)\n        HandleTestResult(status, info, result, options.rebase)\n        if status.failed > continued_errors:\n            if options.fail_fast:\n                break\n            elif options.stop_interactive:\n                rerun_verbose = YesNoPrompt(question='Rerun with verbose option?',\n                                            default='no')\n                if rerun_verbose:\n                    RunTest(info, options, variables, verbose_level=2)\n                should_continue = YesNoPrompt(question='Continue testing?',\n                                              default='yes')\n                if not should_continue:\n                    break\n            elif options.verbose:\n                RunTest(info, options, variables, verbose_level=1)\n            continued_errors += 1\n\n\ndef GetDefaultJobCount():\n    cpu_count = multiprocessing.cpu_count()\n    if cpu_count <= 1:\n        return 1\n    else:\n        return cpu_count // 2\n\n\ndef main(args):\n    parser = argparse.ArgumentParser()\n    parser.add_argument('-a', '--arg',\n                        help='additional args to pass to executable',\n                        action='append')\n    parser.add_argument('--bindir', metavar='PATH',\n                        default=find_exe.GetDefaultPath(),\n                        help='directory to search for all executables.')\n    parser.add_argument('-v', '--verbose', help='print more diagnotic messages.',\n                        action='store_true')\n    parser.add_argument('-f', '--fail-fast', help='Exit on first failure. '\n                        'Extra options with \\'--jobs 1\\'', action='store_true')\n    parser.add_argument('--stop-interactive',\n                        help='Enter interactive mode on errors. '\n                        'Extra options with \\'--jobs 1\\'', action='store_true')\n    parser.add_argument('-l', '--list', help='list all tests.',\n                        action='store_true')\n    parser.add_argument('-r', '--rebase',\n                        help='rebase a test to its current output.',\n                        action='store_true')\n    parser.add_argument('-j', '--jobs',\n                        help='number of jobs to use to run tests', type=int,\n                        default=GetDefaultJobCount())\n    parser.add_argument('-t', '--timeout', type=float, default=DEFAULT_TIMEOUT,\n                        help='per test timeout in seconds')\n    parser.add_argument('--no-roundtrip',\n                        help='don\\'t run roundtrip.py on all tests',\n                        action='store_false', default=True, dest='roundtrip')\n    parser.add_argument('-p', '--print-cmd',\n                        help='print the commands that are run.',\n                        action='store_true')\n    parser.add_argument('patterns', metavar='pattern', nargs='*',\n                        help='test patterns.')\n    parser.add_argument('--exclude-dir', action='append', default=[],\n                        help='directory to exclude.')\n    options = parser.parse_args(args)\n    exclude_dirs = options.exclude_dir\n\n    if options.jobs != 1:\n        if options.fail_fast:\n            parser.error('--fail-fast only works with -j1')\n        if options.stop_interactive:\n            parser.error('--stop-interactive only works with -j1')\n\n    if options.patterns:\n        pattern_re = '|'.join(\n            fnmatch.translate('*%s*' % p) for p in options.patterns)\n    else:\n        pattern_re = '.*'\n        # By default, exclude wasi tests because WASI support is not include\n        # by int the build by default.\n        # TODO(sbc): Find some way to detect the WASI support.\n        exclude_dirs += ['wasi']\n\n    test_names = FindTestFiles('.txt', pattern_re, exclude_dirs)\n\n    if options.list:\n        for test_name in test_names:\n            print(test_name)\n        return 0\n    if not test_names:\n        print('no tests match that filter')\n        return 1\n\n    variables = {}\n    variables['test_dir'] = os.path.abspath(TEST_DIR)\n    variables['bindir'] = options.bindir\n    variables['gen_wasm_py'] = os.path.join(TEST_DIR, 'gen-wasm.py')\n    variables['gen_spec_js_py'] = os.path.join(TEST_DIR, 'gen-spec-js.py')\n    for exe_basename in find_exe.EXECUTABLES:\n        exe_override = os.path.join(options.bindir, exe_basename)\n        variables[exe_basename] = find_exe.FindExecutable(exe_basename,\n                                                          exe_override)\n\n    status = Status(sys.stderr.isatty() and not options.verbose)\n    infos = GetAllTestInfo(test_names, status)\n    infos_to_run = []\n    for info in infos:\n        if info.skip:\n            status.Skipped(info)\n            continue\n        infos_to_run.append(info)\n\n        if options.roundtrip:\n            for fold_exprs in False, True:\n                try:\n                    infos_to_run.append(info.CreateRoundtripInfo(fold_exprs=fold_exprs))\n                except NoRoundtripError:\n                    pass\n\n    if not os.path.exists(OUT_DIR):\n        os.makedirs(OUT_DIR)\n\n    status.Start(len(infos_to_run))\n\n    try:\n        if options.jobs > 1:\n            RunMultiThreaded(infos_to_run, status, options, variables)\n        else:\n            RunSingleThreaded(infos_to_run, status, options, variables)\n    except KeyboardInterrupt:\n        print('\\nInterrupted testing\\n')\n\n    status.Done()\n\n    ret = 0\n    if status.failed:\n        sys.stderr.write('**** FAILED %s\\n' % ('*' * (80 - 14)))\n        for info, result in status.failed_tests:\n            if isinstance(result, TestResult):\n                msg = result.GetLastCommand()\n            elif isinstance(result, Error):\n                msg = result\n            else:\n                msg = ''\n            sys.stderr.write('- %s\\n    %s\\n' % (info.GetName(), msg))\n        ret = 1\n\n    return ret\n\n\nif __name__ == '__main__':\n    try:\n        sys.exit(main(sys.argv[1:]))\n    except Error as e:\n        sys.stderr.write(str(e) + '\\n')\n        sys.exit(1)\n"
  },
  {
    "path": "test/spec/address.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/address.wast\n(;; STDOUT ;;;\nout/test/spec/address.wast:192: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/address.wast:194: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/address.wast:195: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/address.wast:196: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/address.wast:197: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/address.wast:198: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/address.wast:199: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/address.wast:201: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/address.wast:202: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/address.wast:203: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/address.wast:204: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/address.wast:205: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/address.wast:207: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/address.wast:208: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/address.wast:209: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/address.wast:210: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/address.wast:211: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/address.wast:214: assert_malformed passed:\n  out/test/spec/address/address.1.wat:1:33: error: offset must be less than or equal to 0xffffffff\n  (memory 1)(func (drop (i32.load offset=4294967296 (i32.const 0))))\n                                  ^^^^^^^^^^^^^^^^^\nout/test/spec/address.wast:486: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/address.wast:488: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/address.wast:489: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/address.wast:490: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/address.wast:491: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/address.wast:492: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/address.wast:493: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/address.wast:494: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/address.wast:496: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/address.wast:497: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/address.wast:498: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/address.wast:499: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/address.wast:500: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/address.wast:501: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/address.wast:502: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/address.wast:504: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/address.wast:505: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/address.wast:506: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/address.wast:507: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/address.wast:508: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/address.wast:509: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/address.wast:510: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/address.wast:554: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/address.wast:556: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/address.wast:557: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/address.wast:559: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/address.wast:560: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/address.wast:604: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/address.wast:606: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/address.wast:607: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/address.wast:609: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/address.wast:610: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\n260/260 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/align.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/align.wast\n(;; STDOUT ;;;\nout/test/spec/align.wast:28: assert_malformed passed:\n  out/test/spec/align/align.23.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load8_s align=0 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/align.wast:34: assert_malformed passed:\n  out/test/spec/align/align.24.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load8_s align=7 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/align.wast:40: assert_malformed passed:\n  out/test/spec/align/align.25.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load8_u align=0 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/align.wast:46: assert_malformed passed:\n  out/test/spec/align/align.26.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load8_u align=7 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/align.wast:52: assert_malformed passed:\n  out/test/spec/align/align.27.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load16_s align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:58: assert_malformed passed:\n  out/test/spec/align/align.28.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load16_s align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:64: assert_malformed passed:\n  out/test/spec/align/align.29.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load16_u align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:70: assert_malformed passed:\n  out/test/spec/align/align.30.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load16_u align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:76: assert_malformed passed:\n  out/test/spec/align/align.31.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load align=0 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/align.wast:82: assert_malformed passed:\n  out/test/spec/align/align.32.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load align=7 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/align.wast:88: assert_malformed passed:\n  out/test/spec/align/align.33.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load8_s align=0 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/align.wast:94: assert_malformed passed:\n  out/test/spec/align/align.34.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load8_s align=7 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/align.wast:100: assert_malformed passed:\n  out/test/spec/align/align.35.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load8_u align=0 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/align.wast:106: assert_malformed passed:\n  out/test/spec/align/align.36.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load8_u align=7 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/align.wast:112: assert_malformed passed:\n  out/test/spec/align/align.37.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load16_s align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:118: assert_malformed passed:\n  out/test/spec/align/align.38.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load16_s align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:124: assert_malformed passed:\n  out/test/spec/align/align.39.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load16_u align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:130: assert_malformed passed:\n  out/test/spec/align/align.40.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load16_u align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:136: assert_malformed passed:\n  out/test/spec/align/align.41.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load32_s align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:142: assert_malformed passed:\n  out/test/spec/align/align.42.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load32_s align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:148: assert_malformed passed:\n  out/test/spec/align/align.43.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load32_u align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:154: assert_malformed passed:\n  out/test/spec/align/align.44.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load32_u align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/align.wast:160: assert_malformed passed:\n  out/test/spec/align/align.45.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load align=0 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/align.wast:166: assert_malformed passed:\n  out/test/spec/align/align.46.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load align=7 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/align.wast:172: assert_malformed passed:\n  out/test/spec/align/align.47.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (f32.load align=0 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/align.wast:178: assert_malformed passed:\n  out/test/spec/align/align.48.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (f32.load align=7 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/align.wast:184: assert_malformed passed:\n  out/test/spec/align/align.49.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (f64.load align=0 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/align.wast:190: assert_malformed passed:\n  out/test/spec/align/align.50.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (f64.load align=7 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/align.wast:197: assert_malformed passed:\n  out/test/spec/align/align.51.wat:1:38: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store8 align=0 (i32.const 0) (i32.const 0))))\n                                       ^^^^^^^\nout/test/spec/align.wast:203: assert_malformed passed:\n  out/test/spec/align/align.52.wat:1:38: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store8 align=7 (i32.const 0) (i32.const 0))))\n                                       ^^^^^^^\nout/test/spec/align.wast:209: assert_malformed passed:\n  out/test/spec/align/align.53.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store16 align=0 (i32.const 0) (i32.const 0))))\n                                        ^^^^^^^\nout/test/spec/align.wast:215: assert_malformed passed:\n  out/test/spec/align/align.54.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store16 align=7 (i32.const 0) (i32.const 0))))\n                                        ^^^^^^^\nout/test/spec/align.wast:221: assert_malformed passed:\n  out/test/spec/align/align.55.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store align=0 (i32.const 0) (i32.const 0))))\n                                      ^^^^^^^\nout/test/spec/align.wast:227: assert_malformed passed:\n  out/test/spec/align/align.56.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store align=7 (i32.const 0) (i32.const 0))))\n                                      ^^^^^^^\nout/test/spec/align.wast:233: assert_malformed passed:\n  out/test/spec/align/align.57.wat:1:38: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store8 align=0 (i32.const 0) (i64.const 0))))\n                                       ^^^^^^^\nout/test/spec/align.wast:239: assert_malformed passed:\n  out/test/spec/align/align.58.wat:1:38: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store8 align=7 (i32.const 0) (i64.const 0))))\n                                       ^^^^^^^\nout/test/spec/align.wast:245: assert_malformed passed:\n  out/test/spec/align/align.59.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store16 align=0 (i32.const 0) (i64.const 0))))\n                                        ^^^^^^^\nout/test/spec/align.wast:251: assert_malformed passed:\n  out/test/spec/align/align.60.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store16 align=7 (i32.const 0) (i64.const 0))))\n                                        ^^^^^^^\nout/test/spec/align.wast:257: assert_malformed passed:\n  out/test/spec/align/align.61.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store32 align=0 (i32.const 0) (i64.const 0))))\n                                        ^^^^^^^\nout/test/spec/align.wast:263: assert_malformed passed:\n  out/test/spec/align/align.62.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store32 align=7 (i32.const 0) (i64.const 0))))\n                                        ^^^^^^^\nout/test/spec/align.wast:269: assert_malformed passed:\n  out/test/spec/align/align.63.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store align=0 (i32.const 0) (i64.const 0))))\n                                      ^^^^^^^\nout/test/spec/align.wast:275: assert_malformed passed:\n  out/test/spec/align/align.64.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store align=7 (i32.const 0) (i64.const 0))))\n                                      ^^^^^^^\nout/test/spec/align.wast:281: assert_malformed passed:\n  out/test/spec/align/align.65.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (f32.store align=0 (i32.const 0) (f32.const 0))))\n                                      ^^^^^^^\nout/test/spec/align.wast:287: assert_malformed passed:\n  out/test/spec/align/align.66.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (f32.store align=7 (i32.const 0) (f32.const 0))))\n                                      ^^^^^^^\nout/test/spec/align.wast:293: assert_malformed passed:\n  out/test/spec/align/align.67.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (f64.store align=0 (i32.const 0) (f32.const 0))))\n                                      ^^^^^^^\nout/test/spec/align.wast:299: assert_malformed passed:\n  out/test/spec/align/align.68.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (f64.store align=7 (i32.const 0) (f32.const 0))))\n                                      ^^^^^^^\nout/test/spec/align.wast:306: assert_invalid passed:\n  out/test/spec/align/align.69.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:310: assert_invalid passed:\n  out/test/spec/align/align.70.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:314: assert_invalid passed:\n  out/test/spec/align/align.71.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:318: assert_invalid passed:\n  out/test/spec/align/align.72.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:322: assert_invalid passed:\n  out/test/spec/align/align.73.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:326: assert_invalid passed:\n  out/test/spec/align/align.74.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:330: assert_invalid passed:\n  out/test/spec/align/align.75.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:334: assert_invalid passed:\n  out/test/spec/align/align.76.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:338: assert_invalid passed:\n  out/test/spec/align/align.77.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:342: assert_invalid passed:\n  out/test/spec/align/align.78.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:346: assert_invalid passed:\n  out/test/spec/align/align.79.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:350: assert_invalid passed:\n  out/test/spec/align/align.80.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:354: assert_invalid passed:\n  out/test/spec/align/align.81.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:358: assert_invalid passed:\n  out/test/spec/align/align.82.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:363: assert_invalid passed:\n  out/test/spec/align/align.83.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:367: assert_invalid passed:\n  out/test/spec/align/align.84.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:371: assert_invalid passed:\n  out/test/spec/align/align.85.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:375: assert_invalid passed:\n  out/test/spec/align/align.86.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:379: assert_invalid passed:\n  out/test/spec/align/align.87.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:383: assert_invalid passed:\n  out/test/spec/align/align.88.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:387: assert_invalid passed:\n  out/test/spec/align/align.89.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:391: assert_invalid passed:\n  out/test/spec/align/align.90.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:395: assert_invalid passed:\n  out/test/spec/align/align.91.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:399: assert_invalid passed:\n  out/test/spec/align/align.92.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:403: assert_invalid passed:\n  out/test/spec/align/align.93.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:407: assert_invalid passed:\n  out/test/spec/align/align.94.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:411: assert_invalid passed:\n  out/test/spec/align/align.95.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:415: assert_invalid passed:\n  out/test/spec/align/align.96.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:420: assert_invalid passed:\n  out/test/spec/align/align.97.wasm:0000023: error: alignment must not be larger than natural alignment (1)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/align.wast:424: assert_invalid passed:\n  out/test/spec/align/align.98.wasm:0000023: error: alignment must not be larger than natural alignment (2)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/align.wast:428: assert_invalid passed:\n  out/test/spec/align/align.99.wasm:0000023: error: alignment must not be larger than natural alignment (4)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/align.wast:432: assert_invalid passed:\n  out/test/spec/align/align.100.wasm:0000023: error: alignment must not be larger than natural alignment (1)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/align.wast:436: assert_invalid passed:\n  out/test/spec/align/align.101.wasm:0000023: error: alignment must not be larger than natural alignment (2)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/align.wast:440: assert_invalid passed:\n  out/test/spec/align/align.102.wasm:0000023: error: alignment must not be larger than natural alignment (4)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/align.wast:444: assert_invalid passed:\n  out/test/spec/align/align.103.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/align.wast:448: assert_invalid passed:\n  out/test/spec/align/align.104.wasm:0000026: error: alignment must not be larger than natural alignment (4)\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/align.wast:452: assert_invalid passed:\n  out/test/spec/align/align.105.wasm:000002a: error: alignment must not be larger than natural alignment (8)\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/align.wast:864: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/align.wast:873: assert_invalid passed:\n  out/test/spec/align/align.108.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/align.wast:892: assert_malformed passed:\n  0000020: error: invalid load alignment: 32\nout/test/spec/align.wast:911: assert_malformed passed:\n  0000020: error: invalid load alignment: 33\nout/test/spec/align.wast:930: assert_malformed passed:\n  0000020: error: invalid load alignment: 63\nout/test/spec/align.wast:949: assert_malformed passed:\n  0000020: error: multi_memory not allowed\nout/test/spec/align.wast:968: assert_malformed passed:\n  0000020: error: multi_memory not allowed\n162/162 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/binary-leb128.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/binary-leb128.wast\n(;; STDOUT ;;;\nout/test/spec/binary-leb128.wast:218: assert_malformed passed:\n  000000c: error: unable to read u32 leb128: memory initial page count\nout/test/spec/binary-leb128.wast:226: assert_malformed passed:\n  000000e: error: unable to read u32 leb128: memory max page count\nout/test/spec/binary-leb128.wast:235: assert_malformed passed:\n  0000010: error: unable to read u32 leb128: data segment flags\nout/test/spec/binary-leb128.wast:246: assert_malformed passed:\n  0000011: error: unable to read u32 leb128: elem segment flags\nout/test/spec/binary-leb128.wast:257: assert_malformed passed:\n  0000009: error: unable to read u32 leb128: section size\nout/test/spec/binary-leb128.wast:268: assert_malformed passed:\n  000000a: error: unable to read u32 leb128: string length\nout/test/spec/binary-leb128.wast:279: assert_malformed passed:\n  000000c: error: unable to read u32 leb128: function param count\nout/test/spec/binary-leb128.wast:291: assert_malformed passed:\n  000000f: error: unable to read u32 leb128: function result count\nout/test/spec/binary-leb128.wast:303: assert_malformed passed:\n  0000012: error: unable to read u32 leb128: string length\nout/test/spec/binary-leb128.wast:318: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/binary-leb128.wast:333: assert_malformed passed:\n  0000026: error: unable to read u32 leb128: import signature index\nout/test/spec/binary-leb128.wast:348: assert_malformed passed:\n  0000011: error: unable to read u32 leb128: function signature index\nout/test/spec/binary-leb128.wast:360: assert_malformed passed:\n  0000015: error: unable to read u32 leb128: string length\nout/test/spec/binary-leb128.wast:376: assert_malformed passed:\n  0000019: error: unable to read u32 leb128: export item index\nout/test/spec/binary-leb128.wast:392: assert_malformed passed:\n  0000014: error: unable to read u32 leb128: function body count\nout/test/spec/binary-leb128.wast:405: assert_malformed passed:\n  0000022: error: unable to read u32 leb128: load offset\nout/test/spec/binary-leb128.wast:424: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: load alignment\nout/test/spec/binary-leb128.wast:443: assert_malformed passed:\n  0000023: error: unable to read u32 leb128: store alignment\nout/test/spec/binary-leb128.wast:462: assert_malformed passed:\n  0000024: error: unable to read u32 leb128: store offset\nout/test/spec/binary-leb128.wast:483: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/binary-leb128.wast:493: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/binary-leb128.wast:504: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/binary-leb128.wast:514: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/binary-leb128.wast:526: assert_malformed passed:\n  000000c: error: unable to read u32 leb128: memory initial page count\nout/test/spec/binary-leb128.wast:534: assert_malformed passed:\n  000000c: error: unable to read u32 leb128: memory initial page count\nout/test/spec/binary-leb128.wast:542: assert_malformed passed:\n  000000e: error: unable to read u32 leb128: memory max page count\nout/test/spec/binary-leb128.wast:551: assert_malformed passed:\n  000000e: error: unable to read u32 leb128: memory max page count\nout/test/spec/binary-leb128.wast:560: assert_malformed passed:\n  0000010: error: unable to read u32 leb128: data segment flags\nout/test/spec/binary-leb128.wast:571: assert_malformed passed:\n  0000011: error: unable to read u32 leb128: elem segment flags\nout/test/spec/binary-leb128.wast:582: assert_malformed passed:\n  0000009: error: unable to read u32 leb128: section size\nout/test/spec/binary-leb128.wast:593: assert_malformed passed:\n  000000a: error: unable to read u32 leb128: string length\nout/test/spec/binary-leb128.wast:604: assert_malformed passed:\n  000000c: error: unable to read u32 leb128: function param count\nout/test/spec/binary-leb128.wast:616: assert_malformed passed:\n  000000f: error: unable to read u32 leb128: function result count\nout/test/spec/binary-leb128.wast:628: assert_malformed passed:\n  0000012: error: unable to read u32 leb128: string length\nout/test/spec/binary-leb128.wast:643: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/binary-leb128.wast:658: assert_malformed passed:\n  0000026: error: unable to read u32 leb128: import signature index\nout/test/spec/binary-leb128.wast:673: assert_malformed passed:\n  0000011: error: unable to read u32 leb128: function signature index\nout/test/spec/binary-leb128.wast:686: assert_malformed passed:\n  0000015: error: unable to read u32 leb128: string length\nout/test/spec/binary-leb128.wast:702: assert_malformed passed:\n  0000019: error: unable to read u32 leb128: export item index\nout/test/spec/binary-leb128.wast:718: assert_malformed passed:\n  0000014: error: unable to read u32 leb128: function body count\nout/test/spec/binary-leb128.wast:731: assert_malformed passed:\n  0000022: error: unable to read u32 leb128: load offset\nout/test/spec/binary-leb128.wast:751: assert_malformed passed:\n  0000022: error: unable to read u32 leb128: load offset\nout/test/spec/binary-leb128.wast:771: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: load alignment\nout/test/spec/binary-leb128.wast:789: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: load alignment\nout/test/spec/binary-leb128.wast:808: assert_malformed passed:\n  0000023: error: unable to read u32 leb128: store alignment\nout/test/spec/binary-leb128.wast:827: assert_malformed passed:\n  0000023: error: unable to read u32 leb128: store alignment\nout/test/spec/binary-leb128.wast:846: assert_malformed passed:\n  0000024: error: unable to read u32 leb128: store offset\nout/test/spec/binary-leb128.wast:866: assert_malformed passed:\n  0000024: error: unable to read u32 leb128: store offset\nout/test/spec/binary-leb128.wast:888: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/binary-leb128.wast:898: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/binary-leb128.wast:908: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/binary-leb128.wast:918: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/binary-leb128.wast:929: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/binary-leb128.wast:939: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/binary-leb128.wast:949: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/binary-leb128.wast:959: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/binary-leb128.wast:990: assert_malformed passed:\n  0000019: error: unable to read u32 leb128: opcode\nout/test/spec/binary-leb128.wast:1073: assert_malformed passed:\n  000000c: error: unexpected type form (got 0xe0)\n91/91 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/binary.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/binary.wast\n(;; STDOUT ;;;\nout/test/spec/binary.wast:6: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/binary.wast:7: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/binary.wast:8: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/binary.wast:9: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:10: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:11: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:12: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:13: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:14: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:15: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:16: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:17: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:18: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:21: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:24: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:25: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:28: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:31: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:34: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/binary.wast:37: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/binary.wast:38: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/binary.wast:39: assert_malformed passed:\n  0000006: error: unable to read uint16_t: layer\nout/test/spec/binary.wast:40: assert_malformed passed:\n  0000008: error: bad wasm file version: 0 (expected 0x1)\nout/test/spec/binary.wast:41: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xd (expected 0x1)\nout/test/spec/binary.wast:42: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xe (expected 0x1)\nout/test/spec/binary.wast:43: assert_malformed passed:\n  0000008: error: bad wasm file version: 0x100 (expected 0x1)\nout/test/spec/binary.wast:44: assert_malformed passed:\n  0000008: error: wasm components are not yet supported in this tool\nout/test/spec/binary.wast:45: assert_malformed passed:\n  0000008: error: unsupported wasm layer: 0x100\nout/test/spec/binary.wast:48: assert_malformed passed:\n  000000a: error: invalid section code: 14\nout/test/spec/binary.wast:49: assert_malformed passed:\n  000000a: error: invalid section code: 127\nout/test/spec/binary.wast:50: assert_malformed passed:\n  000000a: error: invalid section code: 128\nout/test/spec/binary.wast:51: assert_malformed passed:\n  000000a: error: invalid section code: 129\nout/test/spec/binary.wast:52: assert_malformed passed:\n  000000a: error: invalid section code: 255\nout/test/spec/binary.wast:56: assert_malformed passed:\n  000001b: error: function body must end with END opcode\nout/test/spec/binary.wast:77: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/binary.wast:93: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/binary.wast:113: assert_malformed passed:\n  0000019: error: init expression must end with END opcode\nout/test/spec/binary.wast:126: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/binary.wast:146: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/binary.wast:166: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/binary.wast:185: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/binary.wast:204: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/binary.wast:224: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/binary.wast:243: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/binary.wast:262: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/binary.wast:280: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/binary.wast:298: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/binary.wast:317: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/binary.wast:334: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/binary.wast:351: assert_malformed passed:\n  000001e: error: local count must be <= 0xffffffff\nout/test/spec/binary.wast:367: assert_malformed passed:\n  0000030: error: local count must be <= 0xffffffff\nout/test/spec/binary.wast:401: assert_malformed passed:\n  0000013: error: function signature count != function body count\nout/test/spec/binary.wast:411: assert_malformed passed:\n  000000b: error: function signature count != function body count\nout/test/spec/binary.wast:420: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/binary.wast:431: assert_malformed passed:\n  0000015: error: function signature count != function body count\nout/test/spec/binary.wast:454: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/binary.wast:466: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/binary.wast:478: assert_malformed passed:\n  0000010: error: Data section missing but DataCount non-zero\nout/test/spec/binary.wast:494: assert_malformed passed:\n  0000024: error: memory.init requires data count section\nout/test/spec/binary.wast:517: assert_malformed passed:\n  000001e: error: data.drop requires data count section\nout/test/spec/binary.wast:537: assert_malformed passed:\n  0000024: error: unexpected opcode: 0xf3\nout/test/spec/binary.wast:565: assert_malformed passed:\n  0000022: error: table elem type must be a reference type\nout/test/spec/binary.wast:650: assert_malformed passed:\n  000000a: error: invalid section size: extends past end\nout/test/spec/binary.wast:661: assert_malformed passed:\n  000000e: error: unfinished section (expected end: 0x11)\nout/test/spec/binary.wast:680: assert_malformed passed:\n  000000e: error: invalid import tag kind: exceptions not allowed\nout/test/spec/binary.wast:690: assert_malformed passed:\n  000000e: error: invalid import tag kind: exceptions not allowed\nout/test/spec/binary.wast:701: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/binary.wast:711: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/binary.wast:722: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/binary.wast:732: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/binary.wast:745: assert_malformed passed:\n  0000027: error: unable to read u32 leb128: string length\nout/test/spec/binary.wast:764: assert_malformed passed:\n  000002b: error: unfinished section (expected end: 0x40)\nout/test/spec/binary.wast:795: assert_malformed passed:\n  000000b: error: invalid table count 1, only 0 bytes left in section\nout/test/spec/binary.wast:805: assert_malformed passed:\n  000000d: error: tables may not be shared\nout/test/spec/binary.wast:814: assert_malformed passed:\n  000000d: error: tables may not be shared\nout/test/spec/binary.wast:824: assert_malformed passed:\n  000000d: error: malformed table limits flag: 129\nout/test/spec/binary.wast:842: assert_malformed passed:\n  000000b: error: invalid memory count 1, only 0 bytes left in section\nout/test/spec/binary.wast:852: assert_malformed passed:\n  000000c: error: memory may not be shared: threads not allowed\nout/test/spec/binary.wast:860: assert_malformed passed:\n  000000c: error: memory may not be shared: threads not allowed\nout/test/spec/binary.wast:869: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/binary.wast:878: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/binary.wast:895: assert_malformed passed:\n  0000010: error: unable to read i32 leb128: global type\nout/test/spec/binary.wast:906: assert_malformed passed:\n  0000010: error: unfinished section (expected end: 0x15)\nout/test/spec/binary.wast:929: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/binary.wast:950: assert_malformed passed:\n  000001b: error: unfinished section (expected end: 0x20)\nout/test/spec/binary.wast:984: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: elem segment flags\nout/test/spec/binary.wast:1000: assert_malformed passed:\n  0000024: error: init expression must end with END opcode\nout/test/spec/binary.wast:1017: assert_malformed passed:\n  0000021: error: unfinished section (expected end: 0x27)\nout/test/spec/binary.wast:1043: assert_malformed passed:\n  0000016: error: unable to read u32 leb128: data segment flags\nout/test/spec/binary.wast:1056: assert_malformed passed:\n  0000016: error: unfinished section (expected end: 0x1c)\nout/test/spec/binary.wast:1069: assert_malformed passed:\n  0000015: error: unable to read data: data segment data\nout/test/spec/binary.wast:1083: assert_malformed passed:\n  000001a: error: unfinished section (expected end: 0x1b)\nout/test/spec/binary.wast:1114: assert_malformed passed:\n  0000048: error: function body must end with END opcode\nout/test/spec/binary.wast:1161: assert_malformed passed:\n  0000017: error: multiple Start sections\nout/test/spec/binary.wast:1178: assert_malformed passed:\n  0000014: error: multiple Function sections\nout/test/spec/binary.wast:1190: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/binary.wast:1202: assert_malformed passed:\n  000000d: error: multiple DataCount sections\nout/test/spec/binary.wast:1212: assert_malformed passed:\n  000000d: error: multiple Data sections\nout/test/spec/binary.wast:1222: assert_malformed passed:\n  000000d: error: multiple Global sections\nout/test/spec/binary.wast:1232: assert_malformed passed:\n  000000d: error: multiple Export sections\nout/test/spec/binary.wast:1242: assert_malformed passed:\n  000000d: error: multiple Table sections\nout/test/spec/binary.wast:1252: assert_malformed passed:\n  000000d: error: multiple Elem sections\nout/test/spec/binary.wast:1262: assert_malformed passed:\n  000000d: error: multiple Import sections\nout/test/spec/binary.wast:1272: assert_malformed passed:\n  000000d: error: multiple Type sections\nout/test/spec/binary.wast:1282: assert_malformed passed:\n  000000d: error: multiple Memory sections\nout/test/spec/binary.wast:1292: assert_malformed passed:\n  000000d: error: section Type out of order\nout/test/spec/binary.wast:1302: assert_malformed passed:\n  000000d: error: section Import out of order\nout/test/spec/binary.wast:1312: assert_malformed passed:\n  000000d: error: section Function out of order\nout/test/spec/binary.wast:1322: assert_malformed passed:\n  000000d: error: section Table out of order\nout/test/spec/binary.wast:1332: assert_malformed passed:\n  000000d: error: section Memory out of order\nout/test/spec/binary.wast:1342: assert_malformed passed:\n  000000d: error: section Global out of order\nout/test/spec/binary.wast:1352: assert_malformed passed:\n  0000011: error: section Export out of order\nout/test/spec/binary.wast:1363: assert_malformed passed:\n  0000011: error: section Start out of order\nout/test/spec/binary.wast:1374: assert_malformed passed:\n  000000d: error: section Elem out of order\nout/test/spec/binary.wast:1384: assert_malformed passed:\n  000000d: error: section DataCount out of order\nout/test/spec/binary.wast:1394: assert_malformed passed:\n  000000d: error: section Code out of order\n136/136 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/block.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/block.wast\n(;; STDOUT ;;;\nout/test/spec/block.wast:422: assert_malformed passed:\n  out/test/spec/block/block.1.wat:1:96: error: unexpected token (, expected ).\n  ...esult i32)))(func (i32.const 0) (block (type $sig) (result i32) (param i32)))\n                                                                     ^\nout/test/spec/block.wast:429: assert_malformed passed:\n  out/test/spec/block/block.2.wat:1:83: error: unexpected token (, expected ).\n  ...esult i32)))(func (i32.const 0) (block (param i32) (type $sig) (result i32)))\n                                                        ^\nout/test/spec/block.wast:436: assert_malformed passed:\n  out/test/spec/block/block.3.wat:1:96: error: unexpected token (, expected ).\n  ...esult i32)))(func (i32.const 0) (block (param i32) (result i32) (type $sig)))\n                                                                     ^\nout/test/spec/block.wast:443: assert_malformed passed:\n  out/test/spec/block/block.4.wat:1:84: error: unexpected token (, expected ).\n  ...esult i32)))(func (i32.const 0) (block (result i32) (type $sig) (param i32)))\n                                                         ^\nout/test/spec/block.wast:450: assert_malformed passed:\n  out/test/spec/block/block.5.wat:1:84: error: unexpected token (, expected ).\n  ...esult i32)))(func (i32.const 0) (block (result i32) (param i32) (type $sig)))\n                                                         ^\nout/test/spec/block.wast:457: assert_malformed passed:\n  out/test/spec/block/block.6.wat:1:41: error: unexpected token (, expected ).\n  (func (i32.const 0) (block (result i32) (param i32)))\n                                          ^\nout/test/spec/block.wast:464: assert_malformed passed:\n  out/test/spec/block/block.7.wat:1:35: error: unexpected token $x, expected ).\n  (func (i32.const 0) (block (param $x i32) (drop)))\n                                    ^^\n  out/test/spec/block/block.7.wat:1:50: error: unexpected token ), expected EOF.\n  (func (i32.const 0) (block (param $x i32) (drop)))\n                                                   ^\nout/test/spec/block.wast:468: assert_malformed passed:\n  out/test/spec/block/block.8.wat:1:25: error: expected 0 results, got 1\n  (type $sig (func))(func (block (type $sig) (result i32) (i32.const 0)) (unrea...\n                          ^\nout/test/spec/block.wast:475: assert_malformed passed:\n  out/test/spec/block/block.9.wat:1:50: error: expected 1 arguments, got 0\n  ...func (param i32) (result i32)))(func (block (type $sig) (result i32) (i32....\n                                          ^\nout/test/spec/block.wast:482: assert_malformed passed:\n  out/test/spec/block/block.10.wat:1:64: error: expected 1 results, got 0\n  ...2) (result i32)))(func (i32.const 0) (block (type $sig) (param i32) (drop)...\n                                          ^\nout/test/spec/block.wast:489: assert_malformed passed:\n  out/test/spec/block/block.11.wat:1:68: error: expected 2 arguments, got 1\n  ...2) (result i32)))(func (i32.const 0) (block (type $sig) (param i32) (resul...\n                                          ^\nout/test/spec/block.wast:497: assert_invalid passed:\n  out/test/spec/block/block.12.wasm:000001c: error: type mismatch at end of block, expected [] but got [i32]\n  000001c: error: OnEndExpr callback failed\nout/test/spec/block.wast:505: assert_invalid passed:\n  out/test/spec/block/block.13.wasm:000001c: error: type mismatch in implicit return, expected [i32] but got []\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/block.wast:509: assert_invalid passed:\n  out/test/spec/block/block.14.wasm:000001c: error: type mismatch in implicit return, expected [i64] but got []\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/block.wast:513: assert_invalid passed:\n  out/test/spec/block/block.15.wasm:000001c: error: type mismatch in implicit return, expected [f32] but got []\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/block.wast:517: assert_invalid passed:\n  out/test/spec/block/block.16.wasm:000001c: error: type mismatch in implicit return, expected [f64] but got []\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/block.wast:522: assert_invalid passed:\n  out/test/spec/block/block.17.wasm:000001c: error: type mismatch at end of block, expected [] but got [i32]\n  000001c: error: OnEndExpr callback failed\nout/test/spec/block.wast:528: assert_invalid passed:\n  out/test/spec/block/block.18.wasm:000001c: error: type mismatch at end of block, expected [] but got [i64]\n  000001c: error: OnEndExpr callback failed\nout/test/spec/block.wast:534: assert_invalid passed:\n  out/test/spec/block/block.19.wasm:000001f: error: type mismatch at end of block, expected [] but got [f32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/block.wast:540: assert_invalid passed:\n  out/test/spec/block/block.20.wasm:0000023: error: type mismatch at end of block, expected [] but got [f64]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/block.wast:546: assert_invalid passed:\n  out/test/spec/block/block.21.wasm:000001e: error: type mismatch at end of block, expected [] but got [i32, i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/block.wast:552: assert_invalid passed:\n  out/test/spec/block/block.22.wasm:000001b: error: type mismatch in block, expected [i32] but got []\n  000001b: error: OnEndExpr callback failed\nout/test/spec/block.wast:558: assert_invalid passed:\n  out/test/spec/block/block.23.wasm:000001b: error: type mismatch in block, expected [i64] but got []\n  000001b: error: OnEndExpr callback failed\nout/test/spec/block.wast:564: assert_invalid passed:\n  out/test/spec/block/block.24.wasm:000001b: error: type mismatch in block, expected [f32] but got []\n  000001b: error: OnEndExpr callback failed\nout/test/spec/block.wast:570: assert_invalid passed:\n  out/test/spec/block/block.25.wasm:000001b: error: type mismatch in block, expected [f64] but got []\n  000001b: error: OnEndExpr callback failed\nout/test/spec/block.wast:576: assert_invalid passed:\n  out/test/spec/block/block.26.wasm:000001c: error: type mismatch in block, expected [i32, i32] but got []\n  000001c: error: OnEndExpr callback failed\nout/test/spec/block.wast:583: assert_invalid passed:\n  out/test/spec/block/block.27.wasm:000001e: error: type mismatch in block, expected [i32] but got []\n  000001e: error: OnEndExpr callback failed\nout/test/spec/block.wast:592: assert_invalid passed:\n  out/test/spec/block/block.28.wasm:000001e: error: type mismatch in block, expected [i32] but got []\n  000001e: error: OnEndExpr callback failed\nout/test/spec/block.wast:601: assert_invalid passed:\n  out/test/spec/block/block.29.wasm:0000020: error: type mismatch in block, expected [i32] but got []\n  0000020: error: OnEndExpr callback failed\nout/test/spec/block.wast:611: assert_invalid passed:\n  out/test/spec/block/block.30.wasm:000001c: error: type mismatch in block, expected [i32] but got []\n  000001c: error: OnEndExpr callback failed\nout/test/spec/block.wast:617: assert_invalid passed:\n  out/test/spec/block/block.31.wasm:000001c: error: type mismatch in block, expected [i64] but got []\n  000001c: error: OnEndExpr callback failed\nout/test/spec/block.wast:623: assert_invalid passed:\n  out/test/spec/block/block.32.wasm:000001c: error: type mismatch in block, expected [f32] but got []\n  000001c: error: OnEndExpr callback failed\nout/test/spec/block.wast:629: assert_invalid passed:\n  out/test/spec/block/block.33.wasm:000001c: error: type mismatch in block, expected [f64] but got []\n  000001c: error: OnEndExpr callback failed\nout/test/spec/block.wast:635: assert_invalid passed:\n  out/test/spec/block/block.34.wasm:000001d: error: type mismatch in block, expected [i32, i32] but got []\n  000001d: error: OnEndExpr callback failed\nout/test/spec/block.wast:641: assert_invalid passed:\n  out/test/spec/block/block.35.wasm:000001d: error: type mismatch in block, expected [i32] but got [i64]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/block.wast:647: assert_invalid passed:\n  out/test/spec/block/block.36.wasm:0000020: error: type mismatch in block, expected [i32] but got [f32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/block.wast:653: assert_invalid passed:\n  out/test/spec/block/block.37.wasm:0000024: error: type mismatch in block, expected [i32] but got [f64]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/block.wast:659: assert_invalid passed:\n  out/test/spec/block/block.38.wasm:000001d: error: type mismatch in block, expected [i64] but got [i32]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/block.wast:665: assert_invalid passed:\n  out/test/spec/block/block.39.wasm:0000020: error: type mismatch in block, expected [i64] but got [f32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/block.wast:671: assert_invalid passed:\n  out/test/spec/block/block.40.wasm:0000024: error: type mismatch in block, expected [i64] but got [f64]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/block.wast:677: assert_invalid passed:\n  out/test/spec/block/block.41.wasm:000001d: error: type mismatch in block, expected [f32] but got [i32]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/block.wast:683: assert_invalid passed:\n  out/test/spec/block/block.42.wasm:000001d: error: type mismatch in block, expected [f32] but got [i64]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/block.wast:689: assert_invalid passed:\n  out/test/spec/block/block.43.wasm:0000024: error: type mismatch in block, expected [f32] but got [f64]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/block.wast:695: assert_invalid passed:\n  out/test/spec/block/block.44.wasm:000001d: error: type mismatch in block, expected [f64] but got [i32]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/block.wast:701: assert_invalid passed:\n  out/test/spec/block/block.45.wasm:000001d: error: type mismatch in block, expected [f64] but got [i64]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/block.wast:707: assert_invalid passed:\n  out/test/spec/block/block.46.wasm:0000020: error: type mismatch in block, expected [f64] but got [f32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/block.wast:713: assert_invalid passed:\n  out/test/spec/block/block.47.wasm:000001e: error: type mismatch in block, expected [i32, i32] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/block.wast:719: assert_invalid passed:\n  out/test/spec/block/block.48.wasm:0000020: error: type mismatch in block, expected [i32, i32] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/block.wast:725: assert_invalid passed:\n  out/test/spec/block/block.49.wasm:000001f: error: type mismatch at end of block, expected [] but got [i32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/block.wast:732: assert_invalid passed:\n  out/test/spec/block/block.50.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:738: assert_invalid passed:\n  out/test/spec/block/block.51.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:744: assert_invalid passed:\n  out/test/spec/block/block.52.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got [f64]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:750: assert_invalid passed:\n  out/test/spec/block/block.53.wasm:0000020: error: type mismatch in implicit return, expected [i64] but got [i32]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:756: assert_invalid passed:\n  out/test/spec/block/block.54.wasm:0000020: error: type mismatch in implicit return, expected [i64] but got [f32]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:762: assert_invalid passed:\n  out/test/spec/block/block.55.wasm:0000020: error: type mismatch in implicit return, expected [i64] but got [f64]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:768: assert_invalid passed:\n  out/test/spec/block/block.56.wasm:0000020: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:774: assert_invalid passed:\n  out/test/spec/block/block.57.wasm:0000020: error: type mismatch in implicit return, expected [f32] but got [i64]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:780: assert_invalid passed:\n  out/test/spec/block/block.58.wasm:0000020: error: type mismatch in implicit return, expected [f32] but got [f64]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:786: assert_invalid passed:\n  out/test/spec/block/block.59.wasm:0000020: error: type mismatch in implicit return, expected [f64] but got [i32]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:792: assert_invalid passed:\n  out/test/spec/block/block.60.wasm:0000020: error: type mismatch in implicit return, expected [f64] but got [i64]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:798: assert_invalid passed:\n  out/test/spec/block/block.61.wasm:0000020: error: type mismatch in implicit return, expected [f64] but got [f32]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/block.wast:805: assert_invalid passed:\n  out/test/spec/block/block.62.wasm:000001c: error: type mismatch in br, expected [i32] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/block.wast:811: assert_invalid passed:\n  out/test/spec/block/block.63.wasm:000001c: error: type mismatch in br, expected [i64] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/block.wast:817: assert_invalid passed:\n  out/test/spec/block/block.64.wasm:000001c: error: type mismatch in br, expected [f32] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/block.wast:823: assert_invalid passed:\n  out/test/spec/block/block.65.wasm:000001c: error: type mismatch in br, expected [f64] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/block.wast:829: assert_invalid passed:\n  out/test/spec/block/block.66.wasm:000001d: error: type mismatch in br, expected [i32, i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:836: assert_invalid passed:\n  out/test/spec/block/block.67.wasm:000001c: error: type mismatch in br, expected [i32] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/block.wast:842: assert_invalid passed:\n  out/test/spec/block/block.68.wasm:000001c: error: type mismatch in br, expected [i64] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/block.wast:848: assert_invalid passed:\n  out/test/spec/block/block.69.wasm:000001c: error: type mismatch in br, expected [f32] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/block.wast:854: assert_invalid passed:\n  out/test/spec/block/block.70.wasm:000001c: error: type mismatch in br, expected [f64] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/block.wast:860: assert_invalid passed:\n  out/test/spec/block/block.71.wasm:000001d: error: type mismatch in br, expected [i32, i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:867: assert_invalid passed:\n  out/test/spec/block/block.72.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:873: assert_invalid passed:\n  out/test/spec/block/block.73.wasm:000001d: error: type mismatch in br, expected [i64] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:879: assert_invalid passed:\n  out/test/spec/block/block.74.wasm:000001d: error: type mismatch in br, expected [f32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:885: assert_invalid passed:\n  out/test/spec/block/block.75.wasm:000001d: error: type mismatch in br, expected [f64] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:892: assert_invalid passed:\n  out/test/spec/block/block.76.wasm:000001e: error: type mismatch in br, expected [i32] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:898: assert_invalid passed:\n  out/test/spec/block/block.77.wasm:0000021: error: type mismatch in br, expected [i32] but got [f32]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/block.wast:904: assert_invalid passed:\n  out/test/spec/block/block.78.wasm:0000025: error: type mismatch in br, expected [i32] but got [f64]\n  0000025: error: OnBrExpr callback failed\nout/test/spec/block.wast:910: assert_invalid passed:\n  out/test/spec/block/block.79.wasm:000001e: error: type mismatch in br, expected [i64] but got [i32]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:916: assert_invalid passed:\n  out/test/spec/block/block.80.wasm:0000021: error: type mismatch in br, expected [i64] but got [f32]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/block.wast:922: assert_invalid passed:\n  out/test/spec/block/block.81.wasm:0000025: error: type mismatch in br, expected [i64] but got [f64]\n  0000025: error: OnBrExpr callback failed\nout/test/spec/block.wast:928: assert_invalid passed:\n  out/test/spec/block/block.82.wasm:000001e: error: type mismatch in br, expected [f32] but got [i32]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:934: assert_invalid passed:\n  out/test/spec/block/block.83.wasm:000001e: error: type mismatch in br, expected [f32] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:940: assert_invalid passed:\n  out/test/spec/block/block.84.wasm:0000025: error: type mismatch in br, expected [f32] but got [f64]\n  0000025: error: OnBrExpr callback failed\nout/test/spec/block.wast:946: assert_invalid passed:\n  out/test/spec/block/block.85.wasm:000001e: error: type mismatch in br, expected [i64] but got [i32]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:952: assert_invalid passed:\n  out/test/spec/block/block.86.wasm:000001e: error: type mismatch in br, expected [f64] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:958: assert_invalid passed:\n  out/test/spec/block/block.87.wasm:0000021: error: type mismatch in br, expected [f64] but got [f32]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/block.wast:964: assert_invalid passed:\n  out/test/spec/block/block.88.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got [i32]\n  000001f: error: OnBrExpr callback failed\nout/test/spec/block.wast:970: assert_invalid passed:\n  out/test/spec/block/block.89.wasm:0000021: error: type mismatch in br, expected [i32, i32] but got [i32]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/block.wast:977: assert_invalid passed:\n  out/test/spec/block/block.90.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:983: assert_invalid passed:\n  out/test/spec/block/block.91.wasm:000001d: error: type mismatch in br, expected [i64] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:989: assert_invalid passed:\n  out/test/spec/block/block.92.wasm:000001d: error: type mismatch in br, expected [f32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:995: assert_invalid passed:\n  out/test/spec/block/block.93.wasm:000001d: error: type mismatch in br, expected [f64] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/block.wast:1001: assert_invalid passed:\n  out/test/spec/block/block.94.wasm:000001e: error: type mismatch in br, expected [i32, i32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1008: assert_invalid passed:\n  out/test/spec/block/block.95.wasm:000001e: error: type mismatch in br, expected [i32] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1014: assert_invalid passed:\n  out/test/spec/block/block.96.wasm:0000021: error: type mismatch in br, expected [i32] but got [f32]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/block.wast:1020: assert_invalid passed:\n  out/test/spec/block/block.97.wasm:0000025: error: type mismatch in br, expected [i32] but got [f64]\n  0000025: error: OnBrExpr callback failed\nout/test/spec/block.wast:1026: assert_invalid passed:\n  out/test/spec/block/block.98.wasm:000001e: error: type mismatch in br, expected [i64] but got [i32]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1032: assert_invalid passed:\n  out/test/spec/block/block.99.wasm:0000021: error: type mismatch in br, expected [i64] but got [f32]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/block.wast:1038: assert_invalid passed:\n  out/test/spec/block/block.100.wasm:0000025: error: type mismatch in br, expected [i64] but got [f64]\n  0000025: error: OnBrExpr callback failed\nout/test/spec/block.wast:1044: assert_invalid passed:\n  out/test/spec/block/block.101.wasm:000001e: error: type mismatch in br, expected [f32] but got [i32]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1050: assert_invalid passed:\n  out/test/spec/block/block.102.wasm:000001e: error: type mismatch in br, expected [f32] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1056: assert_invalid passed:\n  out/test/spec/block/block.103.wasm:0000025: error: type mismatch in br, expected [f32] but got [f64]\n  0000025: error: OnBrExpr callback failed\nout/test/spec/block.wast:1062: assert_invalid passed:\n  out/test/spec/block/block.104.wasm:000001e: error: type mismatch in br, expected [f64] but got [i32]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1068: assert_invalid passed:\n  out/test/spec/block/block.105.wasm:000001e: error: type mismatch in br, expected [f64] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1074: assert_invalid passed:\n  out/test/spec/block/block.106.wasm:0000021: error: type mismatch in br, expected [f64] but got [f32]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/block.wast:1080: assert_invalid passed:\n  out/test/spec/block/block.107.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got [i32]\n  000001f: error: OnBrExpr callback failed\nout/test/spec/block.wast:1087: assert_invalid passed:\n  out/test/spec/block/block.108.wasm:0000024: error: type mismatch at end of function, expected [] but got [i32]\n  0000024: error: EndFunctionBody callback failed\nout/test/spec/block.wast:1093: assert_invalid passed:\n  out/test/spec/block/block.109.wasm:0000024: error: type mismatch at end of function, expected [] but got [i64]\n  0000024: error: EndFunctionBody callback failed\nout/test/spec/block.wast:1099: assert_invalid passed:\n  out/test/spec/block/block.110.wasm:0000027: error: type mismatch at end of function, expected [] but got [f32]\n  0000027: error: EndFunctionBody callback failed\nout/test/spec/block.wast:1105: assert_invalid passed:\n  out/test/spec/block/block.111.wasm:000002b: error: type mismatch at end of function, expected [] but got [f64]\n  000002b: error: EndFunctionBody callback failed\nout/test/spec/block.wast:1111: assert_invalid passed:\n  out/test/spec/block/block.112.wasm:000002b: error: type mismatch at end of function, expected [] but got [i32, i32]\n  000002b: error: EndFunctionBody callback failed\nout/test/spec/block.wast:1118: assert_invalid passed:\n  out/test/spec/block/block.113.wasm:000001e: error: type mismatch in br, expected [i32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1124: assert_invalid passed:\n  out/test/spec/block/block.114.wasm:000001e: error: type mismatch in br, expected [i64] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1130: assert_invalid passed:\n  out/test/spec/block/block.115.wasm:000001e: error: type mismatch in br, expected [f32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1136: assert_invalid passed:\n  out/test/spec/block/block.116.wasm:000001e: error: type mismatch in br, expected [f64] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/block.wast:1142: assert_invalid passed:\n  out/test/spec/block/block.117.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/block.wast:1149: assert_invalid passed:\n  out/test/spec/block/block.118.wasm:000001f: error: type mismatch in br, expected [i32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/block.wast:1155: assert_invalid passed:\n  out/test/spec/block/block.119.wasm:000001f: error: type mismatch in br, expected [i64] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/block.wast:1161: assert_invalid passed:\n  out/test/spec/block/block.120.wasm:000001f: error: type mismatch in br, expected [f32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/block.wast:1167: assert_invalid passed:\n  out/test/spec/block/block.121.wasm:000001f: error: type mismatch in br, expected [f64] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/block.wast:1173: assert_invalid passed:\n  out/test/spec/block/block.122.wasm:0000020: error: type mismatch in br, expected [i32, i32] but got []\n  0000020: error: OnBrExpr callback failed\nout/test/spec/block.wast:1180: assert_invalid passed:\n  out/test/spec/block/block.123.wasm:0000020: error: type mismatch in br, expected [i32] but got [i64]\n  0000020: error: OnBrExpr callback failed\nout/test/spec/block.wast:1188: assert_invalid passed:\n  out/test/spec/block/block.124.wasm:0000023: error: type mismatch in br, expected [i32] but got [f32]\n  0000023: error: OnBrExpr callback failed\nout/test/spec/block.wast:1196: assert_invalid passed:\n  out/test/spec/block/block.125.wasm:0000027: error: type mismatch in br, expected [i32] but got [f64]\n  0000027: error: OnBrExpr callback failed\nout/test/spec/block.wast:1204: assert_invalid passed:\n  out/test/spec/block/block.126.wasm:0000020: error: type mismatch in br, expected [i64] but got [i32]\n  0000020: error: OnBrExpr callback failed\nout/test/spec/block.wast:1212: assert_invalid passed:\n  out/test/spec/block/block.127.wasm:0000023: error: type mismatch in br, expected [i64] but got [f32]\n  0000023: error: OnBrExpr callback failed\nout/test/spec/block.wast:1220: assert_invalid passed:\n  out/test/spec/block/block.128.wasm:0000027: error: type mismatch in br, expected [i64] but got [f64]\n  0000027: error: OnBrExpr callback failed\nout/test/spec/block.wast:1228: assert_invalid passed:\n  out/test/spec/block/block.129.wasm:0000020: error: type mismatch in br, expected [f32] but got [i32]\n  0000020: error: OnBrExpr callback failed\nout/test/spec/block.wast:1236: assert_invalid passed:\n  out/test/spec/block/block.130.wasm:0000020: error: type mismatch in br, expected [f32] but got [i64]\n  0000020: error: OnBrExpr callback failed\nout/test/spec/block.wast:1244: assert_invalid passed:\n  out/test/spec/block/block.131.wasm:0000027: error: type mismatch in br, expected [f32] but got [f64]\n  0000027: error: OnBrExpr callback failed\nout/test/spec/block.wast:1252: assert_invalid passed:\n  out/test/spec/block/block.132.wasm:0000020: error: type mismatch in br, expected [f64] but got [i32]\n  0000020: error: OnBrExpr callback failed\nout/test/spec/block.wast:1260: assert_invalid passed:\n  out/test/spec/block/block.133.wasm:0000020: error: type mismatch in br, expected [f64] but got [i64]\n  0000020: error: OnBrExpr callback failed\nout/test/spec/block.wast:1268: assert_invalid passed:\n  out/test/spec/block/block.134.wasm:0000023: error: type mismatch in br, expected [f64] but got [f32]\n  0000023: error: OnBrExpr callback failed\nout/test/spec/block.wast:1276: assert_invalid passed:\n  out/test/spec/block/block.135.wasm:0000021: error: type mismatch in br, expected [i32, i32] but got [i32]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/block.wast:1285: assert_invalid passed:\n  out/test/spec/block/block.136.wasm:000001e: error: type mismatch in i32.ctz, expected [i32] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1291: assert_invalid passed:\n  out/test/spec/block/block.137.wasm:000001e: error: type mismatch in i64.ctz, expected [i64] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1297: assert_invalid passed:\n  out/test/spec/block/block.138.wasm:000001e: error: type mismatch in f32.floor, expected [f32] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1303: assert_invalid passed:\n  out/test/spec/block/block.139.wasm:000001e: error: type mismatch in f64.floor, expected [f64] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1309: assert_invalid passed:\n  out/test/spec/block/block.140.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/block.wast:1316: assert_invalid passed:\n  out/test/spec/block/block.141.wasm:000001f: error: type mismatch in i32.ctz, expected [i32] but got []\n  000001f: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1322: assert_invalid passed:\n  out/test/spec/block/block.142.wasm:000001f: error: type mismatch in i64.ctz, expected [i64] but got []\n  000001f: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1328: assert_invalid passed:\n  out/test/spec/block/block.143.wasm:000001f: error: type mismatch in f32.floor, expected [f32] but got []\n  000001f: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1334: assert_invalid passed:\n  out/test/spec/block/block.144.wasm:000001f: error: type mismatch in f64.floor, expected [f64] but got []\n  000001f: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1340: assert_invalid passed:\n  out/test/spec/block/block.145.wasm:000001f: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/block.wast:1347: assert_invalid passed:\n  out/test/spec/block/block.146.wasm:0000020: error: type mismatch in i64.ctz, expected [i64] but got []\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1353: assert_invalid passed:\n  out/test/spec/block/block.147.wasm:0000023: error: type mismatch in f32.floor, expected [f32] but got []\n  0000023: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1359: assert_invalid passed:\n  out/test/spec/block/block.148.wasm:0000027: error: type mismatch in f64.floor, expected [f64] but got []\n  0000027: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1365: assert_invalid passed:\n  out/test/spec/block/block.149.wasm:0000020: error: type mismatch in i32.ctz, expected [i32] but got []\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1371: assert_invalid passed:\n  out/test/spec/block/block.150.wasm:0000023: error: type mismatch in f32.floor, expected [f32] but got []\n  0000023: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1377: assert_invalid passed:\n  out/test/spec/block/block.151.wasm:0000027: error: type mismatch in f64.floor, expected [f64] but got []\n  0000027: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1383: assert_invalid passed:\n  out/test/spec/block/block.152.wasm:0000020: error: type mismatch in i32.ctz, expected [i32] but got []\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1389: assert_invalid passed:\n  out/test/spec/block/block.153.wasm:0000020: error: type mismatch in i64.ctz, expected [i64] but got []\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1395: assert_invalid passed:\n  out/test/spec/block/block.154.wasm:0000027: error: type mismatch in f64.floor, expected [f64] but got []\n  0000027: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1401: assert_invalid passed:\n  out/test/spec/block/block.155.wasm:0000020: error: type mismatch in i32.ctz, expected [i32] but got []\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1407: assert_invalid passed:\n  out/test/spec/block/block.156.wasm:0000020: error: type mismatch in i64.ctz, expected [i64] but got []\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1413: assert_invalid passed:\n  out/test/spec/block/block.157.wasm:0000023: error: type mismatch in f32.floor, expected [f32] but got []\n  0000023: error: OnUnaryExpr callback failed\nout/test/spec/block.wast:1419: assert_invalid passed:\n  out/test/spec/block/block.158.wasm:0000022: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/block.wast:1426: assert_invalid passed:\n  out/test/spec/block/block.159.wasm:000001d: error: type mismatch in block, expected [i32] but got []\n  000001d: error: OnBlockExpr callback failed\nout/test/spec/block.wast:1432: assert_invalid passed:\n  out/test/spec/block/block.160.wasm:000001e: error: type mismatch in block, expected [i32, f64] but got []\n  000001e: error: OnBlockExpr callback failed\nout/test/spec/block.wast:1438: assert_invalid passed:\n  out/test/spec/block/block.161.wasm:0000022: error: type mismatch in block, expected [i32] but got [f32]\n  0000022: error: OnBlockExpr callback failed\nout/test/spec/block.wast:1444: assert_invalid passed:\n  out/test/spec/block/block.162.wasm:0000023: error: type mismatch in block, expected [f32, i32] but got [f32]\n  0000023: error: OnBlockExpr callback failed\nout/test/spec/block.wast:1450: assert_invalid passed:\n  out/test/spec/block/block.163.wasm:000001f: error: type mismatch in block, expected [i32] but got []\n  000001f: error: OnBlockExpr callback failed\nout/test/spec/block.wast:1456: assert_invalid passed:\n  out/test/spec/block/block.164.wasm:0000020: error: type mismatch in block, expected [i32, f64] but got []\n  0000020: error: OnBlockExpr callback failed\nout/test/spec/block.wast:1462: assert_invalid passed:\n  out/test/spec/block/block.165.wasm:0000024: error: type mismatch in block, expected [i32] but got [f32]\n  0000024: error: OnBlockExpr callback failed\nout/test/spec/block.wast:1468: assert_invalid passed:\n  out/test/spec/block/block.166.wasm:0000025: error: type mismatch in block, expected [f32, i32] but got [f32]\n  0000025: error: OnBlockExpr callback failed\nout/test/spec/block.wast:1475: assert_malformed passed:\n  out/test/spec/block/block.167.wat:1:45: error: unexpected token $x, expected ).\n  (func (param i32) (result i32) block (param $x i32) end)\n                                              ^^\nout/test/spec/block.wast:1479: assert_malformed passed:\n  out/test/spec/block/block.168.wat:1:46: error: unexpected token $x, expected ).\n  (func (param i32) (result i32) (block (param $x i32)))\n                                               ^^\nout/test/spec/block.wast:1485: assert_malformed passed:\n  out/test/spec/block/block.169.wat:1:17: error: unexpected label \"$l\"\n  (func block end $l)\n                  ^^\nout/test/spec/block.wast:1489: assert_malformed passed:\n  out/test/spec/block/block.170.wat:1:20: error: mismatching label \"$a\" != \"$l\"\n  (func block $a end $l)\n                     ^^\n223/223 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/br.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/br.wast\n(;; STDOUT ;;;\nout/test/spec/br.wast:471: assert_invalid passed:\n  out/test/spec/br/br.1.wasm:000001c: error: type mismatch in br, expected [i32] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/br.wast:478: assert_invalid passed:\n  out/test/spec/br/br.2.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/br.wast:484: assert_invalid passed:\n  out/test/spec/br/br.3.wasm:0000020: error: type mismatch in br, expected [i32] but got []\n  0000020: error: OnBrExpr callback failed\nout/test/spec/br.wast:490: assert_invalid passed:\n  out/test/spec/br/br.4.wasm:000001e: error: type mismatch in br, expected [i32] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/br.wast:497: assert_invalid passed:\n  out/test/spec/br/br.5.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/br.wast:506: assert_invalid passed:\n  out/test/spec/br/br.6.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/br.wast:515: assert_invalid passed:\n  out/test/spec/br/br.7.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/br.wast:524: assert_invalid passed:\n  out/test/spec/br/br.8.wasm:000001b: error: type mismatch in br, expected [i32] but got []\n  000001b: error: OnBrExpr callback failed\nout/test/spec/br.wast:535: assert_invalid passed:\n  out/test/spec/br/br.9.wasm:000001b: error: type mismatch in br, expected [i32] but got []\n  000001b: error: OnBrExpr callback failed\nout/test/spec/br.wast:546: assert_invalid passed:\n  out/test/spec/br/br.10.wasm:0000021: error: type mismatch in br, expected [i32] but got []\n  0000021: error: OnBrExpr callback failed\nout/test/spec/br.wast:558: assert_invalid passed:\n  out/test/spec/br/br.11.wasm:0000036: error: type mismatch in br, expected [i32] but got []\n  0000036: error: OnBrExpr callback failed\nout/test/spec/br.wast:574: assert_invalid passed:\n  out/test/spec/br/br.12.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/br.wast:586: assert_invalid passed:\n  out/test/spec/br/br.13.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/br.wast:598: assert_invalid passed:\n  out/test/spec/br/br.14.wasm:0000023: error: type mismatch in br, expected [i32] but got []\n  0000023: error: OnBrExpr callback failed\nout/test/spec/br.wast:610: assert_invalid passed:\n  out/test/spec/br/br.15.wasm:0000020: error: type mismatch in br, expected [i32] but got []\n  0000020: error: OnBrExpr callback failed\nout/test/spec/br.wast:622: assert_invalid passed:\n  out/test/spec/br/br.16.wasm:0000020: error: type mismatch in br, expected [i32] but got []\n  0000020: error: OnBrExpr callback failed\nout/test/spec/br.wast:634: assert_invalid passed:\n  out/test/spec/br/br.17.wasm:0000020: error: type mismatch in br, expected [i32] but got []\n  0000020: error: OnBrExpr callback failed\nout/test/spec/br.wast:647: assert_invalid passed:\n  out/test/spec/br/br.18.wasm:0000016: error: invalid depth: 1 (max 0)\n  0000019: error: OnBrExpr callback failed\nout/test/spec/br.wast:651: assert_invalid passed:\n  out/test/spec/br/br.19.wasm:000001b: error: invalid depth: 5 (max 2)\n  000001d: error: OnBrExpr callback failed\nout/test/spec/br.wast:655: assert_invalid passed:\n  out/test/spec/br/br.20.wasm:0000016: error: invalid depth: 268435457 (max 0)\n  000001d: error: OnBrExpr callback failed\n97/97 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/br_if.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/br_if.wast\n(;; STDOUT ;;;\nout/test/spec/br_if.wast:481: assert_invalid passed:\n  out/test/spec/br_if/br_if.1.wasm:000001e: error: type mismatch in i32.ctz, expected [i32] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/br_if.wast:485: assert_invalid passed:\n  out/test/spec/br_if/br_if.2.wasm:000001e: error: type mismatch in i64.ctz, expected [i64] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/br_if.wast:489: assert_invalid passed:\n  out/test/spec/br_if/br_if.3.wasm:000001e: error: type mismatch in f32.neg, expected [f32] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/br_if.wast:493: assert_invalid passed:\n  out/test/spec/br_if/br_if.4.wasm:000001e: error: type mismatch in f64.neg, expected [f64] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/br_if.wast:498: assert_invalid passed:\n  out/test/spec/br_if/br_if.5.wasm:000001e: error: type mismatch in i32.ctz, expected [i32] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/br_if.wast:502: assert_invalid passed:\n  out/test/spec/br_if/br_if.6.wasm:000001d: error: type mismatch in br_if, expected [i32] but got [i64]\n  000001d: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:506: assert_invalid passed:\n  out/test/spec/br_if/br_if.7.wasm:0000020: error: type mismatch in br_if, expected [i32] but got [f32]\n  0000020: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:510: assert_invalid passed:\n  out/test/spec/br_if/br_if.8.wasm:000001d: error: type mismatch in br_if, expected [i32] but got [i64]\n  000001d: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:515: assert_invalid passed:\n  out/test/spec/br_if/br_if.9.wasm:000001e: error: type mismatch in br_if, expected [i32] but got []\n  000001e: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:521: assert_invalid passed:\n  out/test/spec/br_if/br_if.10.wasm:000001e: error: type mismatch in br_if, expected [i32] but got []\n  000001e: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:527: assert_invalid passed:\n  out/test/spec/br_if/br_if.11.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/br_if.wast:533: assert_invalid passed:\n  out/test/spec/br_if/br_if.12.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/br_if.wast:540: assert_invalid passed:\n  out/test/spec/br_if/br_if.13.wasm:000001f: error: type mismatch in br_if, expected [i32] but got []\n  000001f: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:546: assert_invalid passed:\n  out/test/spec/br_if/br_if.14.wasm:000001f: error: type mismatch in br_if, expected [i32] but got []\n  000001f: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:552: assert_invalid passed:\n  out/test/spec/br_if/br_if.15.wasm:0000020: error: type mismatch in br_if, expected [i32] but got [i64]\n  0000020: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:560: assert_invalid passed:\n  out/test/spec/br_if/br_if.16.wasm:0000020: error: type mismatch in br_if, expected [i32] but got [i64]\n  0000020: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:569: assert_invalid passed:\n  out/test/spec/br_if/br_if.17.wasm:000001b: error: type mismatch in br_if, expected [i32] but got []\n  000001b: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:575: assert_invalid passed:\n  out/test/spec/br_if/br_if.18.wasm:000001c: error: type mismatch in br_if, expected [i32] but got []\n  000001c: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:581: assert_invalid passed:\n  out/test/spec/br_if/br_if.19.wasm:000001d: error: type mismatch in br_if, expected [i32] but got [i64]\n  000001d: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:587: assert_invalid passed:\n  out/test/spec/br_if/br_if.20.wasm:000001f: error: type mismatch in br_if, expected [i32] but got []\n  000001f: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:593: assert_invalid passed:\n  out/test/spec/br_if/br_if.21.wasm:0000022: error: type mismatch in br_if, expected [i32] but got []\n  0000022: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:599: assert_invalid passed:\n  out/test/spec/br_if/br_if.22.wasm:0000020: error: type mismatch in br_if, expected [i32] but got [... i64]\n  0000020: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:606: assert_invalid passed:\n  out/test/spec/br_if/br_if.23.wasm:0000021: error: type mismatch in br_if, expected [i32] but got []\n  out/test/spec/br_if/br_if.23.wasm:0000021: error: type mismatch in br_if, expected [i32] but got []\n  0000021: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:618: assert_invalid passed:\n  out/test/spec/br_if/br_if.24.wasm:0000023: error: type mismatch in br_if, expected [i32] but got []\n  0000023: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:630: assert_invalid passed:\n  out/test/spec/br_if/br_if.25.wasm:000001b: error: type mismatch in br_if, expected [i32] but got []\n  out/test/spec/br_if/br_if.25.wasm:000001b: error: type mismatch in br_if, expected [i32] but got []\n  000001b: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:641: assert_invalid passed:\n  out/test/spec/br_if/br_if.26.wasm:000001d: error: type mismatch in br_if, expected [i32] but got []\n  000001d: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:654: assert_invalid passed:\n  out/test/spec/br_if/br_if.27.wasm:000001b: error: invalid depth: 1 (max 0)\n  000001b: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:658: assert_invalid passed:\n  out/test/spec/br_if/br_if.28.wasm:000001f: error: invalid depth: 5 (max 2)\n  000001f: error: OnBrIfExpr callback failed\nout/test/spec/br_if.wast:662: assert_invalid passed:\n  out/test/spec/br_if/br_if.29.wasm:000001f: error: invalid depth: 268435457 (max 0)\n  000001f: error: OnBrIfExpr callback failed\n118/118 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/br_table.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/br_table.wast\n(;; STDOUT ;;;\nout/test/spec/br_table.wast:1193: assert_invalid passed:\n  out/test/spec/br_table/br_table.1.wasm:0000022: error: type mismatch at end of block, expected [] but got [i32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/br_table.wast:1200: assert_invalid passed:\n  out/test/spec/br_table/br_table.2.wasm:000001d: error: type mismatch in br_table, expected [i32] but got []\n  000001d: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1207: assert_invalid passed:\n  out/test/spec/br_table/br_table.3.wasm:0000020: error: type mismatch in br_table, expected [i32] but got []\n  0000020: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1213: assert_invalid passed:\n  out/test/spec/br_table/br_table.4.wasm:0000023: error: type mismatch in br_table, expected [i32] but got [i64]\n  0000023: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1221: assert_invalid passed:\n  out/test/spec/br_table/br_table.5.wasm:0000026: error: br_table labels have inconsistent types: expected [f32], got []\n  0000026: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1232: assert_invalid passed:\n  out/test/spec/br_table/br_table.6.wasm:0000023: error: type mismatch in br_table, expected [i64] but got [i32]\n  0000023: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1243: assert_invalid passed:\n  out/test/spec/br_table/br_table.7.wasm:000001f: error: type mismatch in br_table, expected [i32] but got []\n  000001f: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1249: assert_invalid passed:\n  out/test/spec/br_table/br_table.8.wasm:000001e: error: type mismatch in br_table, expected [i32] but got [i64]\n  000001e: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1255: assert_invalid passed:\n  out/test/spec/br_table/br_table.9.wasm:0000021: error: type mismatch in br_table, expected [i32] but got []\n  0000021: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1261: assert_invalid passed:\n  out/test/spec/br_table/br_table.10.wasm:0000023: error: type mismatch in br_table, expected [i32] but got []\n  0000023: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1267: assert_invalid passed:\n  out/test/spec/br_table/br_table.11.wasm:0000022: error: type mismatch in br_table, expected [i32] but got [... i64]\n  0000022: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1276: assert_invalid passed:\n  out/test/spec/br_table/br_table.12.wasm:0000022: error: type mismatch at end of block, expected [] but got [i32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/br_table.wast:1283: assert_invalid passed:\n  out/test/spec/br_table/br_table.13.wasm:0000022: error: type mismatch in br_table, expected [i32] but got []\n  0000022: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1295: assert_invalid passed:\n  out/test/spec/br_table/br_table.14.wasm:0000024: error: type mismatch in br_table, expected [i32] but got []\n  0000024: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1307: assert_invalid passed:\n  out/test/spec/br_table/br_table.15.wasm:000001c: error: type mismatch in br_table, expected [i32] but got []\n  000001c: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1318: assert_invalid passed:\n  out/test/spec/br_table/br_table.16.wasm:000001e: error: type mismatch in br_table, expected [i32] but got []\n  000001e: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1330: assert_invalid passed:\n  out/test/spec/br_table/br_table.17.wasm:0000025: error: br_table labels have inconsistent types: expected [i32], got []\n  0000025: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1342: assert_invalid passed:\n  out/test/spec/br_table/br_table.18.wasm:0000025: error: br_table labels have inconsistent types: expected [], got [i32]\n  0000025: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1356: assert_invalid passed:\n  out/test/spec/br_table/br_table.19.wasm:000001f: error: invalid depth: 2 (max 1)\n  000001f: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1362: assert_invalid passed:\n  out/test/spec/br_table/br_table.20.wasm:0000021: error: invalid depth: 5 (max 2)\n  0000021: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1368: assert_invalid passed:\n  out/test/spec/br_table/br_table.21.wasm:0000024: error: invalid depth: 268435457 (max 1)\n  0000024: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1375: assert_invalid passed:\n  out/test/spec/br_table/br_table.22.wasm:000001f: error: invalid depth: 2 (max 1)\n  000001f: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1381: assert_invalid passed:\n  out/test/spec/br_table/br_table.23.wasm:0000021: error: invalid depth: 5 (max 2)\n  0000021: error: OnBrTableExpr callback failed\nout/test/spec/br_table.wast:1387: assert_invalid passed:\n  out/test/spec/br_table/br_table.24.wasm:0000024: error: invalid depth: 268435457 (max 1)\n  0000024: error: OnBrTableExpr callback failed\n174/174 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/bulk.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/bulk.wast\n(;; STDOUT ;;;\nfill(i32:1, i32:255, i32:3) =>\nfill(i32:0, i32:48042, i32:2) =>\nfill(i32:0, i32:0, i32:65536) =>\nout/test/spec/bulk.wast:43: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nfill(i32:65536, i32:0, i32:0) =>\nout/test/spec/bulk.wast:52: assert_trap passed: out of bounds memory access: memory.fill out of bounds\ncopy(i32:10, i32:0, i32:4) =>\ncopy(i32:8, i32:10, i32:4) =>\ncopy(i32:10, i32:7, i32:6) =>\ncopy(i32:65280, i32:0, i32:256) =>\ncopy(i32:65024, i32:65280, i32:256) =>\ncopy(i32:65536, i32:0, i32:0) =>\ncopy(i32:0, i32:65536, i32:0) =>\nout/test/spec/bulk.wast:108: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/bulk.wast:110: assert_trap passed: out of bounds memory access: memory.copy out of bound\ninit(i32:0, i32:1, i32:2) =>\ninit(i32:65532, i32:0, i32:4) =>\nout/test/spec/bulk.wast:138: assert_trap passed: out of bounds memory access: memory.init out of bounds\ninit(i32:65536, i32:0, i32:0) =>\ninit(i32:0, i32:4, i32:0) =>\nout/test/spec/bulk.wast:148: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/bulk.wast:150: assert_trap passed: out of bounds memory access: memory.init out of bounds\ninit_passive(i32:1) =>\ndrop_passive() =>\ndrop_passive() =>\nout/test/spec/bulk.wast:172: assert_trap passed: out of bounds memory access: memory.init out of bounds\ninit_passive(i32:0) =>\ndrop_active() =>\nout/test/spec/bulk.wast:176: assert_trap passed: out of bounds memory access: memory.init out of bounds\ninit_active(i32:0) =>\nout/test/spec/bulk.wast:219: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/bulk.wast:221: assert_trap passed: uninitialized table element\ninit(i32:0, i32:1, i32:2) =>\nout/test/spec/bulk.wast:227: assert_trap passed: uninitialized table element\ninit(i32:1, i32:2, i32:2) =>\ninit(i32:3, i32:0, i32:0) =>\ninit(i32:0, i32:4, i32:0) =>\nout/test/spec/bulk.wast:237: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/bulk.wast:239: assert_trap passed: out of bounds table access: table.init out of bounds\ninit_passive(i32:1) =>\ndrop_passive() =>\ndrop_passive() =>\nout/test/spec/bulk.wast:265: assert_trap passed: out of bounds table access: table.init out of bounds\ninit_passive(i32:0) =>\ndrop_active() =>\nout/test/spec/bulk.wast:269: assert_trap passed: out of bounds table access: table.init out of bounds\ninit_active(i32:0) =>\ncopy(i32:3, i32:0, i32:3) =>\ncopy(i32:0, i32:1, i32:3) =>\ncopy(i32:2, i32:0, i32:3) =>\ncopy(i32:6, i32:8, i32:2) =>\ncopy(i32:8, i32:6, i32:2) =>\ncopy(i32:10, i32:0, i32:0) =>\ncopy(i32:0, i32:10, i32:0) =>\nout/test/spec/bulk.wast:348: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/bulk.wast:350: assert_trap passed: out of bounds table access: table.copy out of bounds\n117/117 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/call.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/call.wast\n(;; STDOUT ;;;\nout/test/spec/call.wast:354: assert_trap passed: undefined table index\nout/test/spec/call.wast:381: assert_invalid passed:\n  out/test/spec/call/call.1.wasm:000001b: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/call.wast:388: assert_invalid passed:\n  out/test/spec/call/call.2.wasm:000001f: error: type mismatch in i32.eqz, expected [i32] but got [i64]\n  000001f: error: OnConvertExpr callback failed\nout/test/spec/call.wast:396: assert_invalid passed:\n  out/test/spec/call/call.3.wasm:000001e: error: type mismatch in call, expected [i32] but got []\n  000001e: error: OnCallExpr callback failed\nout/test/spec/call.wast:403: assert_invalid passed:\n  out/test/spec/call/call.4.wasm:000001f: error: type mismatch in call, expected [f64, i32] but got []\n  000001f: error: OnCallExpr callback failed\nout/test/spec/call.wast:410: assert_invalid passed:\n  out/test/spec/call/call.5.wasm:000001d: error: type mismatch at end of function, expected [] but got [i32]\n  000001d: error: EndFunctionBody callback failed\nout/test/spec/call.wast:417: assert_invalid passed:\n  out/test/spec/call/call.6.wasm:0000026: error: type mismatch at end of function, expected [] but got [f64, i32]\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/call.wast:425: assert_invalid passed:\n  out/test/spec/call/call.7.wasm:0000022: error: type mismatch in call, expected [i32, i32] but got [i32]\n  0000022: error: OnCallExpr callback failed\nout/test/spec/call.wast:432: assert_invalid passed:\n  out/test/spec/call/call.8.wasm:0000022: error: type mismatch in call, expected [i32, i32] but got [i32]\n  0000022: error: OnCallExpr callback failed\nout/test/spec/call.wast:439: assert_invalid passed:\n  out/test/spec/call/call.9.wasm:000002a: error: type mismatch in call, expected [i32, f64] but got [f64, i32]\n  000002a: error: OnCallExpr callback failed\nout/test/spec/call.wast:446: assert_invalid passed:\n  out/test/spec/call/call.10.wasm:000002a: error: type mismatch in call, expected [f64, i32] but got [i32, f64]\n  000002a: error: OnCallExpr callback failed\nout/test/spec/call.wast:454: assert_invalid passed:\n  out/test/spec/call/call.11.wasm:0000020: error: type mismatch in call, expected [i32] but got []\n  0000020: error: OnCallExpr callback failed\nout/test/spec/call.wast:463: assert_invalid passed:\n  out/test/spec/call/call.12.wasm:0000023: error: type mismatch in call, expected [i32, i32] but got [i32]\n  0000023: error: OnCallExpr callback failed\nout/test/spec/call.wast:472: assert_invalid passed:\n  out/test/spec/call/call.13.wasm:0000020: error: type mismatch in call, expected [i32] but got []\n  0000020: error: OnCallExpr callback failed\nout/test/spec/call.wast:481: assert_invalid passed:\n  out/test/spec/call/call.14.wasm:0000023: error: type mismatch in call, expected [i32, i32] but got [i32]\n  0000023: error: OnCallExpr callback failed\nout/test/spec/call.wast:490: assert_invalid passed:\n  out/test/spec/call/call.15.wasm:0000022: error: type mismatch in call, expected [i32] but got []\n  0000022: error: OnCallExpr callback failed\nout/test/spec/call.wast:499: assert_invalid passed:\n  out/test/spec/call/call.16.wasm:0000025: error: type mismatch in call, expected [i32, i32] but got [i32]\n  0000025: error: OnCallExpr callback failed\nout/test/spec/call.wast:512: assert_invalid passed:\n  out/test/spec/call/call.17.wasm:0000019: error: function variable out of range: 1 (max 1)\n  0000019: error: OnCallExpr callback failed\nout/test/spec/call.wast:516: assert_invalid passed:\n  out/test/spec/call/call.18.wasm:000001d: error: function variable out of range: 1012321300 (max 1)\n  000001d: error: OnCallExpr callback failed\n91/91 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/call_indirect.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/call_indirect.wast\n(;; STDOUT ;;;\nout/test/spec/call_indirect.wast:498: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:499: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:500: assert_trap passed: undefined table index\nout/test/spec/call_indirect.wast:501: assert_trap passed: undefined table index\nout/test/spec/call_indirect.wast:502: assert_trap passed: undefined table index\nout/test/spec/call_indirect.wast:508: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:509: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:515: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:516: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:522: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:523: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:529: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:530: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:652: assert_trap passed: undefined table index\nout/test/spec/call_indirect.wast:657: assert_trap passed: undefined table index\nout/test/spec/call_indirect.wast:661: assert_trap passed: uninitialized table element\nout/test/spec/call_indirect.wast:662: assert_trap passed: indirect call signature mismatch\nout/test/spec/call_indirect.wast:663: assert_trap passed: undefined table index\nout/test/spec/call_indirect.wast:669: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.2.wat:1:122: error: unexpected token \"param\", expected an expr.\n  ...indirect (type $sig) (result i32) (param i32)    (i32.const 0) (i32.const ...\n                                        ^^^^^\n  out/test/spec/call_indirect/call_indirect.2.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (type $sig) (result i32) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/call_indirect.wast:681: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.3.wat:1:109: error: unexpected token \"type\", expected an expr.\n  ... i32)  (call_indirect (param i32) (type $sig) (result i32)    (i32.const 0...\n                                        ^^^^\n  out/test/spec/call_indirect/call_indirect.3.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (param i32) (type $sig) (result i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/call_indirect.wast:693: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.4.wat:1:122: error: unexpected token \"type\", expected an expr.\n  ...indirect (param i32) (result i32) (type $sig)    (i32.const 0) (i32.const ...\n                                        ^^^^\n  out/test/spec/call_indirect/call_indirect.4.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (param i32) (result i32) (type $sig)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/call_indirect.wast:705: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.5.wat:1:110: error: unexpected token \"type\", expected an expr.\n  ...i32)  (call_indirect (result i32) (type $sig) (param i32)    (i32.const 0)...\n                                        ^^^^\n  out/test/spec/call_indirect/call_indirect.5.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (result i32) (type $sig) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/call_indirect.wast:717: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.6.wat:1:110: error: unexpected token \"param\", expected an expr.\n  ...i32)  (call_indirect (result i32) (param i32) (type $sig)    (i32.const 0)...\n                                        ^^^^^\n  out/test/spec/call_indirect/call_indirect.6.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (result i32) (param i32) (type $sig)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/call_indirect.wast:729: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.7.wat:1:67: error: unexpected token \"param\", expected an expr.\n  ...t i32)  (call_indirect (result i32) (param i32) (i32.const 0) (i32.const 0)))\n                                          ^^^^^\n  out/test/spec/call_indirect/call_indirect.7.wat:1:106: error: unexpected token ), expected EOF.\n  ...t i32)  (call_indirect (result i32) (param i32) (i32.const 0) (i32.const 0)))\n                                                                                 ^\nout/test/spec/call_indirect.wast:739: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.8.wat:1:46: error: unexpected token $x, expected ).\n  ...e 0 funcref)(func (call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\n                                             ^^\n  out/test/spec/call_indirect/call_indirect.8.wat:1:82: error: unexpected token ), expected EOF.\n  ...e 0 funcref)(func (call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\n                                                                                 ^\nout/test/spec/call_indirect.wast:746: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.9.wat:1:57: error: expected 0 results, got 1\n  ...0 funcref)(func (result i32)  (call_indirect (type $sig) (result i32) (i32...\n                                    ^^^^^^^^^^^^^\nout/test/spec/call_indirect.wast:756: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.10.wat:1:82: error: expected 1 arguments, got 0\n  ...0 funcref)(func (result i32)  (call_indirect (type $sig) (result i32) (i32...\n                                    ^^^^^^^^^^^^^\nout/test/spec/call_indirect.wast:766: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.11.wat:1:69: error: expected 1 results, got 0\n  ...i32)))(table 0 funcref)(func  (call_indirect (type $sig) (param i32) (i32....\n                                    ^^^^^^^^^^^^^\nout/test/spec/call_indirect.wast:776: assert_malformed passed:\n  out/test/spec/call_indirect/call_indirect.12.wat:1:86: error: expected 2 arguments, got 1\n  ...0 funcref)(func (result i32)  (call_indirect (type $sig) (param i32) (resu...\n                                    ^^^^^^^^^^^^^\nout/test/spec/call_indirect.wast:791: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.13.wasm:000001c: error: table variable out of range: 0 (max 0)\n  out/test/spec/call_indirect/call_indirect.13.wasm:000001c: error: type mismatch: call_indirect must reference table of funcref type\n  000001c: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:799: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.14.wasm:0000023: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000023: error: OnConvertExpr callback failed\nout/test/spec/call_indirect.wast:807: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.15.wasm:0000027: error: type mismatch in i32.eqz, expected [i32] but got [i64]\n  0000027: error: OnConvertExpr callback failed\nout/test/spec/call_indirect.wast:816: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.16.wasm:0000026: error: type mismatch in call_indirect, expected [i32] but got []\n  0000026: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:824: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.17.wasm:0000027: error: type mismatch in call_indirect, expected [f64, i32] but got []\n  0000027: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:832: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.18.wasm:0000025: error: type mismatch at end of function, expected [] but got [i32]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/call_indirect.wast:840: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.19.wasm:000002e: error: type mismatch at end of function, expected [] but got [f64, i32]\n  000002e: error: EndFunctionBody callback failed\nout/test/spec/call_indirect.wast:851: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.20.wasm:0000027: error: type mismatch in call_indirect, expected [i32] but got []\n  0000027: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:859: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.21.wasm:0000028: error: type mismatch in call_indirect, expected [i32] but got [... i64]\n  0000028: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:868: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.22.wasm:000002a: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  000002a: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:878: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.23.wasm:000002a: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  000002a: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:888: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.24.wasm:0000032: error: type mismatch in call_indirect, expected [i32, f64] but got [f64, i32]\n  0000032: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:898: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.25.wasm:0000032: error: type mismatch in call_indirect, expected [f64, i32] but got [i32, f64]\n  0000032: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:909: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.26.wasm:0000036: error: type mismatch in call_indirect, expected [i32] but got []\n  0000036: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:922: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.27.wasm:0000039: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  0000039: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:935: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.28.wasm:0000036: error: type mismatch in call_indirect, expected [i32] but got []\n  0000036: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:948: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.29.wasm:0000039: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  0000039: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:961: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.30.wasm:000003a: error: type mismatch in call_indirect, expected [i32] but got []\n  000003a: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:977: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.31.wasm:000003d: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  000003d: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:995: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.32.wasm:0000022: error: type mismatch: call_indirect must reference table of funcref type\n  0000022: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:1006: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.33.wasm:0000022: error: function type variable out of range: 1 (max 1)\n  0000022: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:1013: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.34.wasm:0000026: error: function type variable out of range: 1012321300 (max 1)\n  0000026: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:1022: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.35.wasm:000002e: error: function type variable out of range: 4294967295 (max 2)\n  000002e: error: OnCallIndirectExpr callback failed\nout/test/spec/call_indirect.wast:1038: assert_invalid passed:\n  out/test/spec/call_indirect/call_indirect.36.wasm:0000018: error: function variable out of range: 0 (max 0)\n  0000018: error: OnRefFuncExpr callback failed\n172/172 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/comments.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/comments.wast\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/const.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/const.wast\n(;; STDOUT ;;;\nout/test/spec/const.wast:8: assert_malformed passed:\n  out/test/spec/const/const.2.wat:1:17: error: unexpected token \")\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (i32.const) drop)\n                  ^\nout/test/spec/const.wast:12: assert_malformed passed:\n  out/test/spec/const/const.3.wat:1:18: error: unexpected token \"0x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (i32.const 0x) drop)\n                   ^^\nout/test/spec/const.wast:16: assert_malformed passed:\n  out/test/spec/const/const.4.wat:1:18: error: unexpected token \"1x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (i32.const 1x) drop)\n                   ^^\nout/test/spec/const.wast:20: assert_malformed passed:\n  out/test/spec/const/const.5.wat:1:18: error: unexpected token \"0xg\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (i32.const 0xg) drop)\n                   ^^^\nout/test/spec/const.wast:27: assert_malformed passed:\n  out/test/spec/const/const.8.wat:1:17: error: unexpected token \")\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (i64.const) drop)\n                  ^\nout/test/spec/const.wast:31: assert_malformed passed:\n  out/test/spec/const/const.9.wat:1:18: error: unexpected token \"0x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (i64.const 0x) drop)\n                   ^^\nout/test/spec/const.wast:35: assert_malformed passed:\n  out/test/spec/const/const.10.wat:1:18: error: unexpected token \"1x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (i64.const 1x) drop)\n                   ^^\nout/test/spec/const.wast:39: assert_malformed passed:\n  out/test/spec/const/const.11.wat:1:18: error: unexpected token \"0xg\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (i64.const 0xg) drop)\n                   ^^^\nout/test/spec/const.wast:68: assert_malformed passed:\n  out/test/spec/const/const.36.wat:1:17: error: unexpected token \")\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const) drop)\n                  ^\nout/test/spec/const.wast:72: assert_malformed passed:\n  out/test/spec/const/const.37.wat:1:18: error: unexpected token \".0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const .0) drop)\n                   ^^\nout/test/spec/const.wast:76: assert_malformed passed:\n  out/test/spec/const/const.38.wat:1:18: error: unexpected token \".0e0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const .0e0) drop)\n                   ^^^^\nout/test/spec/const.wast:80: assert_malformed passed:\n  out/test/spec/const/const.39.wat:1:18: error: unexpected token \"0e\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0e) drop)\n                   ^^\nout/test/spec/const.wast:84: assert_malformed passed:\n  out/test/spec/const/const.40.wat:1:18: error: unexpected token \"0e+\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0e+) drop)\n                   ^^^\nout/test/spec/const.wast:88: assert_malformed passed:\n  out/test/spec/const/const.41.wat:1:18: error: unexpected token \"0.0e\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0.0e) drop)\n                   ^^^^\nout/test/spec/const.wast:92: assert_malformed passed:\n  out/test/spec/const/const.42.wat:1:18: error: unexpected token \"0.0e-\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0.0e-) drop)\n                   ^^^^^\nout/test/spec/const.wast:96: assert_malformed passed:\n  out/test/spec/const/const.43.wat:1:18: error: unexpected token \"0x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x) drop)\n                   ^^\nout/test/spec/const.wast:100: assert_malformed passed:\n  out/test/spec/const/const.44.wat:1:18: error: unexpected token \"1x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 1x) drop)\n                   ^^\nout/test/spec/const.wast:104: assert_malformed passed:\n  out/test/spec/const/const.45.wat:1:18: error: unexpected token \"0xg\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0xg) drop)\n                   ^^^\nout/test/spec/const.wast:108: assert_malformed passed:\n  out/test/spec/const/const.46.wat:1:18: error: unexpected token \"0x.\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x.) drop)\n                   ^^^\nout/test/spec/const.wast:112: assert_malformed passed:\n  out/test/spec/const/const.47.wat:1:18: error: unexpected token \"0x0.g\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x0.g) drop)\n                   ^^^^^\nout/test/spec/const.wast:116: assert_malformed passed:\n  out/test/spec/const/const.48.wat:1:18: error: unexpected token \"0x0p\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x0p) drop)\n                   ^^^^\nout/test/spec/const.wast:120: assert_malformed passed:\n  out/test/spec/const/const.49.wat:1:18: error: unexpected token \"0x0p+\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x0p+) drop)\n                   ^^^^^\nout/test/spec/const.wast:124: assert_malformed passed:\n  out/test/spec/const/const.50.wat:1:18: error: unexpected token \"0x0p-\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x0p-) drop)\n                   ^^^^^\nout/test/spec/const.wast:128: assert_malformed passed:\n  out/test/spec/const/const.51.wat:1:18: error: unexpected token \"0x0.0p\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x0.0p) drop)\n                   ^^^^^^\nout/test/spec/const.wast:132: assert_malformed passed:\n  out/test/spec/const/const.52.wat:1:18: error: unexpected token \"0x0.0p+\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x0.0p+) drop)\n                   ^^^^^^^\nout/test/spec/const.wast:136: assert_malformed passed:\n  out/test/spec/const/const.53.wat:1:18: error: unexpected token \"0x0.0p-\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x0.0p-) drop)\n                   ^^^^^^^\nout/test/spec/const.wast:140: assert_malformed passed:\n  out/test/spec/const/const.54.wat:1:18: error: unexpected token \"0x0pA\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const 0x0pA) drop)\n                   ^^^^^\nout/test/spec/const.wast:185: assert_malformed passed:\n  out/test/spec/const/const.91.wat:1:17: error: unexpected token \")\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const) drop)\n                  ^\nout/test/spec/const.wast:189: assert_malformed passed:\n  out/test/spec/const/const.92.wat:1:18: error: unexpected token \".0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const .0) drop)\n                   ^^\nout/test/spec/const.wast:193: assert_malformed passed:\n  out/test/spec/const/const.93.wat:1:18: error: unexpected token \".0e0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const .0e0) drop)\n                   ^^^^\nout/test/spec/const.wast:197: assert_malformed passed:\n  out/test/spec/const/const.94.wat:1:18: error: unexpected token \"0e\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0e) drop)\n                   ^^\nout/test/spec/const.wast:201: assert_malformed passed:\n  out/test/spec/const/const.95.wat:1:18: error: unexpected token \"0e+\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0e+) drop)\n                   ^^^\nout/test/spec/const.wast:205: assert_malformed passed:\n  out/test/spec/const/const.96.wat:1:18: error: unexpected token \"0.0e\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0.0e) drop)\n                   ^^^^\nout/test/spec/const.wast:209: assert_malformed passed:\n  out/test/spec/const/const.97.wat:1:18: error: unexpected token \"0.0e-\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0.0e-) drop)\n                   ^^^^^\nout/test/spec/const.wast:213: assert_malformed passed:\n  out/test/spec/const/const.98.wat:1:18: error: unexpected token \"0x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x) drop)\n                   ^^\nout/test/spec/const.wast:217: assert_malformed passed:\n  out/test/spec/const/const.99.wat:1:18: error: unexpected token \"1x\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 1x) drop)\n                   ^^\nout/test/spec/const.wast:221: assert_malformed passed:\n  out/test/spec/const/const.100.wat:1:18: error: unexpected token \"0xg\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0xg) drop)\n                   ^^^\nout/test/spec/const.wast:225: assert_malformed passed:\n  out/test/spec/const/const.101.wat:1:18: error: unexpected token \"0x.\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x.) drop)\n                   ^^^\nout/test/spec/const.wast:229: assert_malformed passed:\n  out/test/spec/const/const.102.wat:1:18: error: unexpected token \"0x0.g\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x0.g) drop)\n                   ^^^^^\nout/test/spec/const.wast:233: assert_malformed passed:\n  out/test/spec/const/const.103.wat:1:18: error: unexpected token \"0x0p\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x0p) drop)\n                   ^^^^\nout/test/spec/const.wast:237: assert_malformed passed:\n  out/test/spec/const/const.104.wat:1:18: error: unexpected token \"0x0p+\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x0p+) drop)\n                   ^^^^^\nout/test/spec/const.wast:241: assert_malformed passed:\n  out/test/spec/const/const.105.wat:1:18: error: unexpected token \"0x0p-\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x0p-) drop)\n                   ^^^^^\nout/test/spec/const.wast:245: assert_malformed passed:\n  out/test/spec/const/const.106.wat:1:18: error: unexpected token \"0x0.0p\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x0.0p) drop)\n                   ^^^^^^\nout/test/spec/const.wast:249: assert_malformed passed:\n  out/test/spec/const/const.107.wat:1:18: error: unexpected token \"0x0.0p+\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x0.0p+) drop)\n                   ^^^^^^^\nout/test/spec/const.wast:253: assert_malformed passed:\n  out/test/spec/const/const.108.wat:1:18: error: unexpected token \"0x0.0p-\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x0.0p-) drop)\n                   ^^^^^^^\nout/test/spec/const.wast:257: assert_malformed passed:\n  out/test/spec/const/const.109.wat:1:18: error: unexpected token \"0x0pA\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const 0x0pA) drop)\n                   ^^^^^\nout/test/spec/const.wast:267: assert_malformed passed:\n  out/test/spec/const/const.112.wat:1:18: error: invalid literal \"0x100000000\"\n  (func (i32.const 0x100000000) drop)\n                   ^^^^^^^^^^^\nout/test/spec/const.wast:271: assert_malformed passed:\n  out/test/spec/const/const.113.wat:1:18: error: invalid literal \"-0x80000001\"\n  (func (i32.const -0x80000001) drop)\n                   ^^^^^^^^^^^\nout/test/spec/const.wast:278: assert_malformed passed:\n  out/test/spec/const/const.116.wat:1:18: error: invalid literal \"4294967296\"\n  (func (i32.const 4294967296) drop)\n                   ^^^^^^^^^^\nout/test/spec/const.wast:282: assert_malformed passed:\n  out/test/spec/const/const.117.wat:1:18: error: invalid literal \"-2147483649\"\n  (func (i32.const -2147483649) drop)\n                   ^^^^^^^^^^^\nout/test/spec/const.wast:289: assert_malformed passed:\n  out/test/spec/const/const.120.wat:1:18: error: invalid literal \"0x10000000000000000\"\n  (func (i64.const 0x10000000000000000) drop)\n                   ^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:293: assert_malformed passed:\n  out/test/spec/const/const.121.wat:1:18: error: invalid literal \"-0x8000000000000001\"\n  (func (i64.const -0x8000000000000001) drop)\n                   ^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:300: assert_malformed passed:\n  out/test/spec/const/const.124.wat:1:18: error: invalid literal \"18446744073709551616\"\n  (func (i64.const 18446744073709551616) drop)\n                   ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:304: assert_malformed passed:\n  out/test/spec/const/const.125.wat:1:18: error: invalid literal \"-9223372036854775809\"\n  (func (i64.const -9223372036854775809) drop)\n                   ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:319: assert_malformed passed:\n  out/test/spec/const/const.136.wat:1:18: error: invalid literal \"0x1p128\"\n  (func (f32.const 0x1p128) drop)\n                   ^^^^^^^\nout/test/spec/const.wast:323: assert_malformed passed:\n  out/test/spec/const/const.137.wat:1:18: error: invalid literal \"-0x1p128\"\n  (func (f32.const -0x1p128) drop)\n                   ^^^^^^^^\nout/test/spec/const.wast:327: assert_malformed passed:\n  out/test/spec/const/const.138.wat:1:18: error: invalid literal \"0x1.ffffffp127\"\n  (func (f32.const 0x1.ffffffp127) drop)\n                   ^^^^^^^^^^^^^^\nout/test/spec/const.wast:331: assert_malformed passed:\n  out/test/spec/const/const.139.wat:1:18: error: invalid literal \"-0x1.ffffffp127\"\n  (func (f32.const -0x1.ffffffp127) drop)\n                   ^^^^^^^^^^^^^^^\nout/test/spec/const.wast:338: assert_malformed passed:\n  out/test/spec/const/const.142.wat:1:18: error: invalid literal \"1e39\"\n  (func (f32.const 1e39) drop)\n                   ^^^^\nout/test/spec/const.wast:342: assert_malformed passed:\n  out/test/spec/const/const.143.wat:1:18: error: invalid literal \"-1e39\"\n  (func (f32.const -1e39) drop)\n                   ^^^^^\nout/test/spec/const.wast:349: assert_malformed passed:\n  out/test/spec/const/const.146.wat:1:18: error: invalid literal \"340282356779733661637539395458142568448\"\n  (func (f32.const 340282356779733661637539395458142568448) drop)\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:353: assert_malformed passed:\n  out/test/spec/const/const.147.wat:1:18: error: invalid literal \"-340282356779733661637539395458142568448\"\n  (func (f32.const -340282356779733661637539395458142568448) drop)\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:366: assert_malformed passed:\n  out/test/spec/const/const.156.wat:1:18: error: invalid literal \"0x1p1024\"\n  (func (f64.const 0x1p1024) drop)\n                   ^^^^^^^^\nout/test/spec/const.wast:370: assert_malformed passed:\n  out/test/spec/const/const.157.wat:1:18: error: invalid literal \"-0x1p1024\"\n  (func (f64.const -0x1p1024) drop)\n                   ^^^^^^^^^\nout/test/spec/const.wast:374: assert_malformed passed:\n  out/test/spec/const/const.158.wat:1:18: error: invalid literal \"0x1.fffffffffffff8p1023\"\n  (func (f64.const 0x1.fffffffffffff8p1023) drop)\n                   ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:378: assert_malformed passed:\n  out/test/spec/const/const.159.wat:1:18: error: invalid literal \"-0x1.fffffffffffff8p1023\"\n  (func (f64.const -0x1.fffffffffffff8p1023) drop)\n                   ^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:385: assert_malformed passed:\n  out/test/spec/const/const.162.wat:1:18: error: invalid literal \"1e309\"\n  (func (f64.const 1e309) drop)\n                   ^^^^^\nout/test/spec/const.wast:389: assert_malformed passed:\n  out/test/spec/const/const.163.wat:1:18: error: invalid literal \"-1e309\"\n  (func (f64.const -1e309) drop)\n                   ^^^^^^\nout/test/spec/const.wast:396: assert_malformed passed:\n  out/test/spec/const/const.166.wat:1:18: error: invalid literal \"269653970229347356221791135597556535197105851288767494898376215204735891170042808140884337949150317257310688430271573696351481990334196274152701320055306275479074865864826923114368235135583993416113802762682700913456874855354834422248712838998185022412196739306217084753107265771378949821875606039276187287552\"\n  (func (f64.const 269653970229347356221791135597556535197105851288767494898376...\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:400: assert_malformed passed:\n  out/test/spec/const/const.167.wat:1:18: error: invalid literal \"-269653970229347356221791135597556535197105851288767494898376215204735891170042808140884337949150317257310688430271573696351481990334196274152701320055306275479074865864826923114368235135583993416113802762682700913456874855354834422248712838998185022412196739306217084753107265771378949821875606039276187287552\"\n  (func (f64.const -26965397022934735622179113559755653519710585128876749489837...\n                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/const.wast:410: assert_malformed passed:\n  out/test/spec/const/const.172.wat:1:18: error: unexpected token \"nan:1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f32.const nan:1) drop)\n                   ^^^^^\nout/test/spec/const.wast:414: assert_malformed passed:\n  out/test/spec/const/const.173.wat:1:18: error: unexpected token \"nan:1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (func (f64.const nan:1) drop)\n                   ^^^^^\nout/test/spec/const.wast:419: assert_malformed passed:\n  out/test/spec/const/const.174.wat:1:18: error: invalid literal \"nan:0x0\"\n  (func (f32.const nan:0x0) drop)\n                   ^^^^^^^\nout/test/spec/const.wast:423: assert_malformed passed:\n  out/test/spec/const/const.175.wat:1:18: error: invalid literal \"nan:0x0\"\n  (func (f64.const nan:0x0) drop)\n                   ^^^^^^^\nout/test/spec/const.wast:428: assert_malformed passed:\n  out/test/spec/const/const.176.wat:1:18: error: invalid literal \"nan:0x80_0000\"\n  (func (f32.const nan:0x80_0000) drop)\n                   ^^^^^^^^^^^^^\nout/test/spec/const.wast:432: assert_malformed passed:\n  out/test/spec/const/const.177.wat:1:18: error: invalid literal \"nan:0x10_0000_0000_0000\"\n  (func (f64.const nan:0x10_0000_0000_0000) drop)\n                   ^^^^^^^^^^^^^^^^^^^^^^^\n778/778 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/conversions.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/conversions.wast\n(;; STDOUT ;;;\nout/test/spec/conversions.wast:78: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:79: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:80: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:81: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:82: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:83: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:84: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:85: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:100: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:101: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:102: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:103: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:104: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:105: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:106: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:107: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:125: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:126: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:127: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:128: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:129: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:130: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:131: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:132: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:150: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:151: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:152: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:153: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:154: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:155: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:156: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:157: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:158: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:159: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:160: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:178: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:179: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:180: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:181: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:182: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:183: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:184: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:185: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:198: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:199: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:200: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:201: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:202: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:203: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:204: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:205: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:223: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:224: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:225: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:226: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:227: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:228: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:229: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:230: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:247: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:248: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:249: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:250: assert_trap passed: integer overflow\nout/test/spec/conversions.wast:251: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:252: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:253: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:254: assert_trap passed: invalid conversion to integer\nout/test/spec/conversions.wast:678: assert_invalid passed:\n  out/test/spec/conversions/conversions.1.wasm:000001e: error: type mismatch in i32.wrap_i64, expected [i64] but got [f32]\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:679: assert_invalid passed:\n  out/test/spec/conversions/conversions.2.wasm:000001b: error: type mismatch in i32.trunc_f32_s, expected [f32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:680: assert_invalid passed:\n  out/test/spec/conversions/conversions.3.wasm:000001b: error: type mismatch in i32.trunc_f32_u, expected [f32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:681: assert_invalid passed:\n  out/test/spec/conversions/conversions.4.wasm:000001b: error: type mismatch in i32.trunc_f64_s, expected [f64] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:682: assert_invalid passed:\n  out/test/spec/conversions/conversions.5.wasm:000001b: error: type mismatch in i32.trunc_f64_u, expected [f64] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:683: assert_invalid passed:\n  out/test/spec/conversions/conversions.6.wasm:000001b: error: type mismatch in i32.reinterpret_f32, expected [f32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:684: assert_invalid passed:\n  out/test/spec/conversions/conversions.7.wasm:000001e: error: type mismatch in i64.extend_i32_s, expected [i32] but got [f32]\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:685: assert_invalid passed:\n  out/test/spec/conversions/conversions.8.wasm:000001e: error: type mismatch in i64.extend_i32_u, expected [i32] but got [f32]\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:686: assert_invalid passed:\n  out/test/spec/conversions/conversions.9.wasm:000001b: error: type mismatch in i64.trunc_f32_s, expected [f32] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:687: assert_invalid passed:\n  out/test/spec/conversions/conversions.10.wasm:000001b: error: type mismatch in i64.trunc_f32_u, expected [f32] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:688: assert_invalid passed:\n  out/test/spec/conversions/conversions.11.wasm:000001b: error: type mismatch in i64.trunc_f64_s, expected [f64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:689: assert_invalid passed:\n  out/test/spec/conversions/conversions.12.wasm:000001b: error: type mismatch in i64.trunc_f64_u, expected [f64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:690: assert_invalid passed:\n  out/test/spec/conversions/conversions.13.wasm:000001b: error: type mismatch in i64.reinterpret_f64, expected [f64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:691: assert_invalid passed:\n  out/test/spec/conversions/conversions.14.wasm:000001b: error: type mismatch in f32.convert_i32_s, expected [i32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:692: assert_invalid passed:\n  out/test/spec/conversions/conversions.15.wasm:000001b: error: type mismatch in f32.convert_i32_u, expected [i32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:693: assert_invalid passed:\n  out/test/spec/conversions/conversions.16.wasm:000001b: error: type mismatch in f32.convert_i64_s, expected [i64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:694: assert_invalid passed:\n  out/test/spec/conversions/conversions.17.wasm:000001b: error: type mismatch in f32.convert_i64_u, expected [i64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:695: assert_invalid passed:\n  out/test/spec/conversions/conversions.18.wasm:000001b: error: type mismatch in f32.demote_f64, expected [f64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:696: assert_invalid passed:\n  out/test/spec/conversions/conversions.19.wasm:000001b: error: type mismatch in f32.reinterpret_i32, expected [i32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:697: assert_invalid passed:\n  out/test/spec/conversions/conversions.20.wasm:000001b: error: type mismatch in f64.convert_i32_s, expected [i32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:698: assert_invalid passed:\n  out/test/spec/conversions/conversions.21.wasm:000001b: error: type mismatch in f64.convert_i32_u, expected [i32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:699: assert_invalid passed:\n  out/test/spec/conversions/conversions.22.wasm:000001b: error: type mismatch in f64.convert_i64_s, expected [i64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:700: assert_invalid passed:\n  out/test/spec/conversions/conversions.23.wasm:000001b: error: type mismatch in f64.convert_i64_u, expected [i64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:701: assert_invalid passed:\n  out/test/spec/conversions/conversions.24.wasm:000001b: error: type mismatch in f64.promote_f32, expected [f32] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/conversions.wast:702: assert_invalid passed:\n  out/test/spec/conversions/conversions.25.wasm:000001b: error: type mismatch in f64.reinterpret_i64, expected [i64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\n619/619 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/custom-page-sizes/custom-page-sizes-invalid.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ARGS*: --enable-custom-page-sizes --enable-multi-memory\n;;; STDIN_FILE: third_party/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast\n(;; STDOUT ;;;\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:3: assert_malformed passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.0.wat:1:21: error: malformed custom page size\n  (memory 0 (pagesize 3))\n                      ^\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:8: assert_malformed passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.1.wat:1:21: error: malformed custom page size\n  (memory 0 (pagesize 0))\n                      ^\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:14: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.2.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:18: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.3.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:22: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.4.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:26: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.5.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:30: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.6.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:34: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.7.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:38: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.8.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:42: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.9.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:46: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.10.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:50: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.11.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:54: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.12.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:58: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.13.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:62: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.14.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:66: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.15.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:70: assert_invalid passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes-invalid/custom-page-sizes-invalid.16.wasm:000000e: error: only page sizes of 1 B or 64 KiB are allowed\n  000000e: error: OnMemory callback failed\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:76: assert_invalid passed:\n  000000e: error: malformed memory page size\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:83: assert_malformed passed:\n  000000e: error: malformed memory page size\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:104: assert_unlinkable passed:\n  error: page_size mismatch in imported memory, expected 65536 but got 1.\nout/test/spec/custom-page-sizes/custom-page-sizes-invalid.wast:111: assert_unlinkable passed:\n  error: page_size mismatch in imported memory, expected 1 but got 65536.\n22/22 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/custom-page-sizes/custom-page-sizes.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ARGS*: --enable-custom-page-sizes --enable-multi-memory\n;;; STDIN_FILE: third_party/testsuite/proposals/custom-page-sizes/custom-page-sizes.wast\n(;; STDOUT ;;;\nout/test/spec/custom-page-sizes/custom-page-sizes.wast:27: assert_trap passed: out of bounds memory access: access at 0+1 >= max value 0\nout/test/spec/custom-page-sizes/custom-page-sizes.wast:34: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/custom-page-sizes/custom-page-sizes.wast:41: assert_trap passed: out of bounds memory access: access at 131072+1 >= max value 131072\nout/test/spec/custom-page-sizes/custom-page-sizes.wast:113: assert_malformed passed:\n  out/test/spec/custom-page-sizes/custom-page-sizes/custom-page-sizes.10.wat:1:19: error: malformed custom page size\n  (memory (pagesize 0) (data))\n                    ^\n  out/test/spec/custom-page-sizes/custom-page-sizes/custom-page-sizes.10.wat:1:28: error: unexpected token ), expected EOF.\n  (memory (pagesize 0) (data))\n                             ^\nout/test/spec/custom-page-sizes/custom-page-sizes.wast:129: assert_trap passed: out of bounds memory access: access at 3+1 >= max value 3\n44/44 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/custom-page-sizes/memory_max.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/custom-page-sizes/memory_max.wast\n;;; ARGS*: --enable-custom-page-sizes\n(;; STDOUT ;;;\nout/test/spec/custom-page-sizes/memory_max.wast:13: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/custom-page-sizes/memory_max.wast:20: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/custom-page-sizes/memory_max.wast:32: assert_malformed passed:\n  out/test/spec/custom-page-sizes/memory_max/memory_max.2.wat:1:9: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000 (pagesize 1))\n          ^^^^^^^^^^^^^\nout/test/spec/custom-page-sizes/memory_max.wast:37: assert_invalid passed:\n  out/test/spec/custom-page-sizes/memory_max/memory_max.3.wasm:000000f: error: initial pages (65537) must be <= (65536)\n  000000f: error: OnMemory callback failed\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/custom-page-sizes/memory_max_i64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/custom-page-sizes/memory_max_i64.wast\n;;; ARGS*: --enable-custom-page-sizes --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/custom-page-sizes/memory_max_i64.wast:13: assert_unlinkable passed:\n  error: invalid import \"test.import\"\nout/test/spec/custom-page-sizes/memory_max_i64.wast:20: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/custom-page-sizes/memory_max_i64.wast:32: assert_malformed passed:\n  out/test/spec/custom-page-sizes/memory_max_i64/memory_max_i64.2.wat:1:13: error: invalid int \"0x1_0000_0000_0000_0000\"\n  (memory i64 0x1_0000_0000_0000_0000 (pagesize 1))\n              ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/custom-page-sizes/memory_max_i64.wast:37: assert_invalid passed:\n  out/test/spec/custom-page-sizes/memory_max_i64/memory_max_i64.3.wasm:0000013: error: initial pages (281474976710657) must be <= (281474976710656)\n  0000013: error: OnMemory callback failed\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/custom.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/custom.wast\n(;; STDOUT ;;;\nout/test/spec/custom.wast:61: assert_malformed passed:\n  0000009: error: unable to read u32 leb128: section size\nout/test/spec/custom.wast:69: assert_malformed passed:\n  000000a: error: unable to read u32 leb128: string length\nout/test/spec/custom.wast:77: assert_malformed passed:\n  000000a: error: unable to read u32 leb128: string length\nout/test/spec/custom.wast:85: assert_malformed passed:\n  000000a: error: invalid section size: extends past end\nout/test/spec/custom.wast:93: assert_malformed passed:\n  0000031: error: invalid section code: 36\nout/test/spec/custom.wast:102: assert_malformed passed:\n  000003e: error: function signature count != function body count\nout/test/spec/custom.wast:115: assert_malformed passed:\n  000000a: error: invalid section size: extends past end\nout/test/spec/custom.wast:123: assert_malformed passed:\n  0000013: error: data segment count does not equal count in DataCount section\n11/11 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/data.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/data.wast\n(;; STDOUT ;;;\nout/test/spec/data.wast:85: assert_invalid passed:\n  out/test/spec/data/data.9.wasm:000001b: error: initializer expression can only reference an imported global\n  000001b: error: OnGlobalGetExpr callback failed\nout/test/spec/data.wast:89: assert_invalid passed:\n  out/test/spec/data/data.10.wasm:000001b: error: initializer expression can only reference an imported global\n  000001b: error: OnGlobalGetExpr callback failed\nout/test/spec/data.wast:299: assert_invalid passed:\n  out/test/spec/data/data.41.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/data.wast:307: assert_invalid passed:\n  out/test/spec/data/data.42.wasm:0000012: error: memory variable out of range: 1 (max 1)\n  0000012: error: BeginDataSegment callback failed\nout/test/spec/data.wast:320: assert_invalid passed:\n  out/test/spec/data/data.43.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/data.wast:331: assert_invalid passed:\n  out/test/spec/data/data.44.wasm:000000d: error: memory variable out of range: 1 (max 0)\n  000000d: error: BeginDataSegment callback failed\nout/test/spec/data.wast:343: assert_invalid passed:\n  out/test/spec/data/data.45.wasm:0000012: error: memory variable out of range: 1 (max 1)\n  0000012: error: BeginDataSegment callback failed\nout/test/spec/data.wast:365: assert_invalid passed:\n  out/test/spec/data/data.46.wasm:000000d: error: memory variable out of range: 1 (max 0)\n  000000d: error: BeginDataSegment callback failed\nout/test/spec/data.wast:384: assert_invalid passed:\n  out/test/spec/data/data.47.wasm:0000013: error: type mismatch in initializer expression, expected [i32] but got [i64]\n  0000014: error: EndDataSegmentInitExpr callback failed\nout/test/spec/data.wast:392: assert_invalid passed:\n  out/test/spec/data/data.48.wasm:0000013: error: type mismatch in initializer expression, expected [i32] but got [funcref]\n  0000014: error: EndDataSegmentInitExpr callback failed\nout/test/spec/data.wast:400: assert_invalid passed:\n  out/test/spec/data/data.49.wasm:0000011: error: type mismatch in initializer expression, expected [i32] but got []\n  0000012: error: EndDataSegmentInitExpr callback failed\nout/test/spec/data.wast:408: assert_invalid passed:\n  out/test/spec/data/data.50.wasm:0000015: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000016: error: EndDataSegmentInitExpr callback failed\nout/test/spec/data.wast:416: assert_invalid passed:\n  out/test/spec/data/data.51.wasm:000002b: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002c: error: EndDataSegmentInitExpr callback failed\nout/test/spec/data.wast:425: assert_invalid passed:\n  out/test/spec/data/data.52.wasm:000002b: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002c: error: EndDataSegmentInitExpr callback failed\nout/test/spec/data.wast:434: assert_invalid passed:\n  out/test/spec/data/data.53.wasm:0000014: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000014: error: OnUnaryExpr callback failed\nout/test/spec/data.wast:442: assert_invalid passed:\n  out/test/spec/data/data.54.wasm:0000012: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000012: error: OnNopExpr callback failed\nout/test/spec/data.wast:450: assert_invalid passed:\n  out/test/spec/data/data.55.wasm:0000012: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000012: error: OnNopExpr callback failed\nout/test/spec/data.wast:458: assert_invalid passed:\n  out/test/spec/data/data.56.wasm:0000014: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000014: error: OnNopExpr callback failed\nout/test/spec/data.wast:466: assert_invalid passed:\n  out/test/spec/data/data.57.wasm:0000020: error: initializer expression cannot reference a mutable global\n  0000020: error: OnGlobalGetExpr callback failed\nout/test/spec/data.wast:475: assert_invalid passed:\n  out/test/spec/data/data.58.wasm:0000013: error: global variable out of range: 0 (max 0)\n  0000013: error: OnGlobalGetExpr callback failed\nout/test/spec/data.wast:483: assert_invalid passed:\n  out/test/spec/data/data.59.wasm:0000029: error: global variable out of range: 1 (max 1)\n  0000029: error: OnGlobalGetExpr callback failed\nout/test/spec/data.wast:492: assert_invalid passed:\n  out/test/spec/data/data.60.wasm:000002d: error: initializer expression cannot reference a mutable global\n  000002d: error: OnGlobalGetExpr callback failed\n61/61 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/elem.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/elem.wast\n(;; STDOUT ;;;\nout/test/spec/elem.wast:171: assert_invalid passed:\n  out/test/spec/elem/elem.10.wasm:0000026: error: initializer expression can only reference an imported global\n  0000026: error: OnGlobalGetExpr callback failed\nout/test/spec/elem.wast:175: assert_invalid passed:\n  out/test/spec/elem/elem.11.wasm:0000026: error: initializer expression can only reference an imported global\n  0000026: error: OnGlobalGetExpr callback failed\nout/test/spec/elem.wast:350: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/elem.wast:360: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/elem.wast:365: assert_invalid passed:\n  out/test/spec/elem/elem.36.wasm:0000016: error: table variable out of range: 0 (max 0)\n  0000016: error: BeginElemSegment callback failed\nout/test/spec/elem.wast:375: assert_invalid passed:\n  out/test/spec/elem/elem.37.wasm:0000014: error: type mismatch in initializer expression, expected [i32] but got [i64]\n  0000015: error: EndElemSegmentInitExpr callback failed\nout/test/spec/elem.wast:383: assert_invalid passed:\n  out/test/spec/elem/elem.38.wasm:0000014: error: type mismatch in initializer expression, expected [i32] but got [funcref]\n  0000015: error: EndElemSegmentInitExpr callback failed\nout/test/spec/elem.wast:391: assert_invalid passed:\n  out/test/spec/elem/elem.39.wasm:0000012: error: type mismatch in initializer expression, expected [i32] but got []\n  0000013: error: EndElemSegmentInitExpr callback failed\nout/test/spec/elem.wast:399: assert_invalid passed:\n  out/test/spec/elem/elem.40.wasm:0000016: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000017: error: EndElemSegmentInitExpr callback failed\nout/test/spec/elem.wast:407: assert_invalid passed:\n  out/test/spec/elem/elem.41.wasm:000002c: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002d: error: EndElemSegmentInitExpr callback failed\nout/test/spec/elem.wast:416: assert_invalid passed:\n  out/test/spec/elem/elem.42.wasm:000002c: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002d: error: EndElemSegmentInitExpr callback failed\nout/test/spec/elem.wast:426: assert_invalid passed:\n  out/test/spec/elem/elem.43.wasm:0000015: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000015: error: OnUnaryExpr callback failed\nout/test/spec/elem.wast:434: assert_invalid passed:\n  out/test/spec/elem/elem.44.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000013: error: OnNopExpr callback failed\nout/test/spec/elem.wast:442: assert_invalid passed:\n  out/test/spec/elem/elem.45.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000013: error: OnNopExpr callback failed\nout/test/spec/elem.wast:450: assert_invalid passed:\n  out/test/spec/elem/elem.46.wasm:0000015: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000015: error: OnNopExpr callback failed\nout/test/spec/elem.wast:458: assert_invalid passed:\n  out/test/spec/elem/elem.47.wasm:0000021: error: initializer expression cannot reference a mutable global\n  0000021: error: OnGlobalGetExpr callback failed\nout/test/spec/elem.wast:467: assert_invalid passed:\n  out/test/spec/elem/elem.48.wasm:0000014: error: global variable out of range: 0 (max 0)\n  0000014: error: OnGlobalGetExpr callback failed\nout/test/spec/elem.wast:475: assert_invalid passed:\n  out/test/spec/elem/elem.49.wasm:000002a: error: global variable out of range: 1 (max 1)\n  000002a: error: OnGlobalGetExpr callback failed\nout/test/spec/elem.wast:484: assert_invalid passed:\n  out/test/spec/elem/elem.50.wasm:000002e: error: initializer expression cannot reference a mutable global\n  000002e: error: OnGlobalGetExpr callback failed\nout/test/spec/elem.wast:495: assert_invalid passed:\n  out/test/spec/elem/elem.51.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [externref]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/elem.wast:503: assert_invalid passed:\n  out/test/spec/elem/elem.52.wasm:000001a: error: type mismatch at end of initializer expression, expected [] but got [funcref]\n  000001b: error: EndElemExpr callback failed\nout/test/spec/elem.wast:511: assert_invalid passed:\n  out/test/spec/elem/elem.53.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [i32]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/elem.wast:519: assert_invalid passed:\n  out/test/spec/elem/elem.54.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [i32]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/elem.wast:527: assert_invalid passed:\n  out/test/spec/elem/elem.55.wasm:0000023: error: invalid initializer: instruction not valid in initializer expression: call\n  0000023: error: OnCallExpr callback failed\nout/test/spec/elem.wast:585: assert_trap passed: uninitialized table element\nout/test/spec/elem.wast:618: assert_invalid passed:\n  out/test/spec/elem/elem.61.wasm:000001f: error: type mismatch at elem segment. got funcref, expected externref\n  000001f: error: OnElemSegmentElemType callback failed\nout/test/spec/elem.wast:623: assert_invalid passed:\n  out/test/spec/elem/elem.62.wasm:0000017: error: type mismatch at elem segment. got externref, expected funcref\n  0000017: error: OnElemSegmentElemType callback failed\nout/test/spec/elem.wast:628: assert_invalid passed:\n  out/test/spec/elem/elem.63.wasm:0000032: error: type mismatch at table.init. got funcref, expected externref\n  0000032: error: OnTableInitExpr callback failed\nout/test/spec/elem.wast:637: assert_invalid passed:\n  out/test/spec/elem/elem.64.wasm:0000030: error: type mismatch at table.init. got externref, expected funcref\n  0000030: error: OnTableInitExpr callback failed\n95/95 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/endianness.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/endianness.wast\n(;; STDOUT ;;;\n69/69 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/binary.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/binary.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\nout/test/spec/exception-handling/binary.wast:6: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/exception-handling/binary.wast:7: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/exception-handling/binary.wast:8: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/exception-handling/binary.wast:9: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:10: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:11: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:12: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:13: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:14: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:15: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:16: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:17: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:18: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:21: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:24: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:25: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:28: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:31: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:34: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/exception-handling/binary.wast:37: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/exception-handling/binary.wast:38: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/exception-handling/binary.wast:39: assert_malformed passed:\n  0000006: error: unable to read uint16_t: layer\nout/test/spec/exception-handling/binary.wast:40: assert_malformed passed:\n  0000008: error: bad wasm file version: 0 (expected 0x1)\nout/test/spec/exception-handling/binary.wast:41: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xd (expected 0x1)\nout/test/spec/exception-handling/binary.wast:42: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xe (expected 0x1)\nout/test/spec/exception-handling/binary.wast:43: assert_malformed passed:\n  0000008: error: bad wasm file version: 0x100 (expected 0x1)\nout/test/spec/exception-handling/binary.wast:44: assert_malformed passed:\n  0000008: error: wasm components are not yet supported in this tool\nout/test/spec/exception-handling/binary.wast:45: assert_malformed passed:\n  0000008: error: unsupported wasm layer: 0x100\nout/test/spec/exception-handling/binary.wast:48: assert_malformed passed:\n  000000a: error: invalid section code: 14\nout/test/spec/exception-handling/binary.wast:49: assert_malformed passed:\n  000000a: error: invalid section code: 127\nout/test/spec/exception-handling/binary.wast:50: assert_malformed passed:\n  000000a: error: invalid section code: 128\nout/test/spec/exception-handling/binary.wast:51: assert_malformed passed:\n  000000a: error: invalid section code: 129\nout/test/spec/exception-handling/binary.wast:52: assert_malformed passed:\n  000000a: error: invalid section code: 255\nout/test/spec/exception-handling/binary.wast:56: assert_malformed passed:\n  000001b: error: function body must end with END opcode\nout/test/spec/exception-handling/binary.wast:77: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/exception-handling/binary.wast:93: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/exception-handling/binary.wast:113: assert_malformed passed:\n  0000019: error: init expression must end with END opcode\nout/test/spec/exception-handling/binary.wast:126: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/exception-handling/binary.wast:146: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/exception-handling/binary.wast:166: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/exception-handling/binary.wast:185: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/exception-handling/binary.wast:204: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/exception-handling/binary.wast:224: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/exception-handling/binary.wast:243: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/exception-handling/binary.wast:262: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/exception-handling/binary.wast:280: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/exception-handling/binary.wast:298: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/exception-handling/binary.wast:317: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/exception-handling/binary.wast:334: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/exception-handling/binary.wast:351: assert_malformed passed:\n  000001e: error: local count must be <= 0xffffffff\nout/test/spec/exception-handling/binary.wast:367: assert_malformed passed:\n  0000030: error: local count must be <= 0xffffffff\nout/test/spec/exception-handling/binary.wast:401: assert_malformed passed:\n  0000013: error: function signature count != function body count\nout/test/spec/exception-handling/binary.wast:411: assert_malformed passed:\n  000000b: error: function signature count != function body count\nout/test/spec/exception-handling/binary.wast:420: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/exception-handling/binary.wast:431: assert_malformed passed:\n  0000015: error: function signature count != function body count\nout/test/spec/exception-handling/binary.wast:454: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/exception-handling/binary.wast:466: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/exception-handling/binary.wast:478: assert_malformed passed:\n  0000010: error: Data section missing but DataCount non-zero\nout/test/spec/exception-handling/binary.wast:494: assert_malformed passed:\n  0000024: error: memory.init requires data count section\nout/test/spec/exception-handling/binary.wast:517: assert_malformed passed:\n  000001e: error: data.drop requires data count section\nout/test/spec/exception-handling/binary.wast:537: assert_malformed passed:\n  0000024: error: unexpected opcode: 0xf3\nout/test/spec/exception-handling/binary.wast:565: assert_malformed passed:\n  0000022: error: table elem type must be a reference type\nout/test/spec/exception-handling/binary.wast:650: assert_malformed passed:\n  000000a: error: invalid section size: extends past end\nout/test/spec/exception-handling/binary.wast:661: assert_malformed passed:\n  000000e: error: unfinished section (expected end: 0x11)\nout/test/spec/exception-handling/binary.wast:680: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/exception-handling/binary.wast:690: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/exception-handling/binary.wast:701: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/exception-handling/binary.wast:711: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/exception-handling/binary.wast:722: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/exception-handling/binary.wast:732: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/exception-handling/binary.wast:745: assert_malformed passed:\n  0000027: error: unable to read u32 leb128: string length\nout/test/spec/exception-handling/binary.wast:764: assert_malformed passed:\n  000002b: error: unfinished section (expected end: 0x40)\nout/test/spec/exception-handling/binary.wast:795: assert_malformed passed:\n  000000b: error: invalid table count 1, only 0 bytes left in section\nout/test/spec/exception-handling/binary.wast:805: assert_malformed passed:\n  000000d: error: tables may not be shared\nout/test/spec/exception-handling/binary.wast:814: assert_malformed passed:\n  000000d: error: tables may not be shared\nout/test/spec/exception-handling/binary.wast:824: assert_malformed passed:\n  000000d: error: malformed table limits flag: 129\nout/test/spec/exception-handling/binary.wast:842: assert_malformed passed:\n  000000b: error: invalid memory count 1, only 0 bytes left in section\nout/test/spec/exception-handling/binary.wast:852: assert_malformed passed:\n  000000c: error: memory may not be shared: threads not allowed\nout/test/spec/exception-handling/binary.wast:860: assert_malformed passed:\n  000000c: error: memory may not be shared: threads not allowed\nout/test/spec/exception-handling/binary.wast:869: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/exception-handling/binary.wast:878: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/exception-handling/binary.wast:895: assert_malformed passed:\n  0000010: error: unable to read i32 leb128: global type\nout/test/spec/exception-handling/binary.wast:906: assert_malformed passed:\n  0000010: error: unfinished section (expected end: 0x15)\nout/test/spec/exception-handling/binary.wast:929: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/exception-handling/binary.wast:950: assert_malformed passed:\n  000001b: error: unfinished section (expected end: 0x20)\nout/test/spec/exception-handling/binary.wast:984: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: elem segment flags\nout/test/spec/exception-handling/binary.wast:1000: assert_malformed passed:\n  0000024: error: init expression must end with END opcode\nout/test/spec/exception-handling/binary.wast:1017: assert_malformed passed:\n  0000021: error: unfinished section (expected end: 0x27)\nout/test/spec/exception-handling/binary.wast:1043: assert_malformed passed:\n  0000016: error: unable to read u32 leb128: data segment flags\nout/test/spec/exception-handling/binary.wast:1056: assert_malformed passed:\n  0000016: error: unfinished section (expected end: 0x1c)\nout/test/spec/exception-handling/binary.wast:1069: assert_malformed passed:\n  0000015: error: unable to read data: data segment data\nout/test/spec/exception-handling/binary.wast:1083: assert_malformed passed:\n  000001a: error: unfinished section (expected end: 0x1b)\nout/test/spec/exception-handling/binary.wast:1114: assert_malformed passed:\n  0000048: error: function body must end with END opcode\nout/test/spec/exception-handling/binary.wast:1161: assert_malformed passed:\n  0000017: error: multiple Start sections\nout/test/spec/exception-handling/binary.wast:1178: assert_malformed passed:\n  0000014: error: multiple Function sections\nout/test/spec/exception-handling/binary.wast:1190: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/exception-handling/binary.wast:1202: assert_malformed passed:\n  000000d: error: multiple DataCount sections\nout/test/spec/exception-handling/binary.wast:1212: assert_malformed passed:\n  000000d: error: multiple Data sections\nout/test/spec/exception-handling/binary.wast:1222: assert_malformed passed:\n  000000d: error: multiple Global sections\nout/test/spec/exception-handling/binary.wast:1232: assert_malformed passed:\n  000000d: error: multiple Export sections\nout/test/spec/exception-handling/binary.wast:1242: assert_malformed passed:\n  000000d: error: multiple Table sections\nout/test/spec/exception-handling/binary.wast:1252: assert_malformed passed:\n  000000d: error: multiple Elem sections\nout/test/spec/exception-handling/binary.wast:1262: assert_malformed passed:\n  000000d: error: multiple Import sections\nout/test/spec/exception-handling/binary.wast:1272: assert_malformed passed:\n  000000d: error: multiple Type sections\nout/test/spec/exception-handling/binary.wast:1282: assert_malformed passed:\n  000000d: error: multiple Memory sections\nout/test/spec/exception-handling/binary.wast:1292: assert_malformed passed:\n  000000d: error: section Type out of order\nout/test/spec/exception-handling/binary.wast:1302: assert_malformed passed:\n  000000d: error: section Import out of order\nout/test/spec/exception-handling/binary.wast:1312: assert_malformed passed:\n  000000d: error: section Function out of order\nout/test/spec/exception-handling/binary.wast:1322: assert_malformed passed:\n  000000d: error: section Table out of order\nout/test/spec/exception-handling/binary.wast:1332: assert_malformed passed:\n  000000d: error: section Memory out of order\nout/test/spec/exception-handling/binary.wast:1342: assert_malformed passed:\n  000000d: error: section Global out of order\nout/test/spec/exception-handling/binary.wast:1352: assert_malformed passed:\n  0000011: error: section Export out of order\nout/test/spec/exception-handling/binary.wast:1363: assert_malformed passed:\n  0000011: error: section Start out of order\nout/test/spec/exception-handling/binary.wast:1374: assert_malformed passed:\n  000000d: error: section Elem out of order\nout/test/spec/exception-handling/binary.wast:1384: assert_malformed passed:\n  000000d: error: section DataCount out of order\nout/test/spec/exception-handling/binary.wast:1394: assert_malformed passed:\n  000000d: error: section Code out of order\n136/136 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/exports.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/exports.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\nout/test/spec/exception-handling/exports.wast:39: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.15.wasm:000000f: error: function variable out of range: 0 (max 0)\n  000000f: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:43: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.16.wasm:0000019: error: function variable out of range: 1 (max 1)\n  0000019: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:47: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.17.wasm:000002e: error: function variable out of range: 1 (max 1)\n  000002e: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:51: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.18.wasm:000001d: error: duplicate export \"a\"\n  000001d: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:55: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.19.wasm:000001e: error: duplicate export \"a\"\n  000001e: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:59: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.20.wasm:0000025: error: duplicate export \"a\"\n  0000025: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:63: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.21.wasm:0000023: error: duplicate export \"a\"\n  0000023: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:67: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.22.wasm:0000022: error: duplicate export \"a\"\n  0000022: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:71: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.23.wasm:0000022: error: duplicate export \"t0\"\n  0000022: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:100: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.36.wasm:000000f: error: global variable out of range: 0 (max 0)\n  000000f: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:104: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.37.wasm:0000017: error: global variable out of range: 1 (max 1)\n  0000017: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:108: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.38.wasm:0000029: error: global variable out of range: 1 (max 1)\n  0000029: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:112: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.39.wasm:000001b: error: duplicate export \"a\"\n  000001b: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:116: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.40.wasm:0000020: error: duplicate export \"a\"\n  0000020: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:120: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.41.wasm:0000025: error: duplicate export \"a\"\n  0000025: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:124: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.42.wasm:0000021: error: duplicate export \"a\"\n  0000021: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:128: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.43.wasm:0000020: error: duplicate export \"a\"\n  0000020: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:155: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.59.wasm:000000f: error: table variable out of range: 0 (max 0)\n  000000f: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:159: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.60.wasm:0000015: error: table variable out of range: 1 (max 1)\n  0000015: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:163: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.61.wasm:0000026: error: table variable out of range: 1 (max 1)\n  0000026: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:167: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.62.wasm:0000019: error: duplicate export \"a\"\n  0000019: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:171: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.63.wasm:000001c: error: duplicate export \"a\"\n  000001c: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:175: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.64.wasm:0000023: error: duplicate export \"a\"\n  0000023: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:179: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.65.wasm:0000021: error: duplicate export \"a\"\n  0000021: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:183: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.66.wasm:000001e: error: duplicate export \"a\"\n  000001e: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:211: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.81.wasm:000000f: error: memory variable out of range: 0 (max 0)\n  000000f: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:215: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.82.wasm:0000014: error: memory variable out of range: 1 (max 1)\n  0000014: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:219: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.83.wasm:0000026: error: memory variable out of range: 1 (max 1)\n  0000026: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:223: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.84.wasm:0000018: error: duplicate export \"a\"\n  0000018: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:232: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.85.wasm:0000022: error: duplicate export \"a\"\n  0000022: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:236: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.86.wasm:0000020: error: duplicate export \"a\"\n  0000020: error: OnExport callback failed\nout/test/spec/exception-handling/exports.wast:240: assert_invalid passed:\n  out/test/spec/exception-handling/exports/exports.87.wasm:000001e: error: duplicate export \"a\"\n  000001e: error: OnExport callback failed\n97/97 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/imports.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/imports.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i32_f32(i32:14, f32:42.000000) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_f32(f32:13.000000) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i64(i64:24) =>\ncalled host spectest.print_f64_f64(f64:25.000000, f64:53.000000) =>\ncalled host spectest.print_i64(i64:24) =>\ncalled host spectest.print_f64(f64:24.000000) =>\ncalled host spectest.print_f64(f64:24.000000) =>\ncalled host spectest.print_f64(f64:24.000000) =>\nout/test/spec/exception-handling/imports.wast:96: assert_invalid passed:\n  out/test/spec/exception-handling/imports/imports.2.wasm:000001e: error: function type variable out of range: 1 (max 1)\n  000001e: error: OnImportFunc callback failed\ncalled host spectest.print_i32(i32:13) =>\nout/test/spec/exception-handling/imports.wast:132: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/exception-handling/imports.wast:136: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/exception-handling/imports.wast:141: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:145: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:149: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:153: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:157: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:161: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:165: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:169: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:173: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:177: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:181: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:185: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:189: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:193: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:197: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:201: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/exception-handling/imports.wast:206: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind func, not global\nout/test/spec/exception-handling/imports.wast:210: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind func, not table\nout/test/spec/exception-handling/imports.wast:214: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind func, not memory\nout/test/spec/exception-handling/imports.wast:218: assert_unlinkable passed:\n  error: expected import \"test.tag\" to have kind func, not tag\nout/test/spec/exception-handling/imports.wast:222: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind func, not global\nout/test/spec/exception-handling/imports.wast:226: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind func, not table\nout/test/spec/exception-handling/imports.wast:230: assert_unlinkable passed:\n  error: expected import \"spectest.memory\" to have kind func, not memory\nout/test/spec/exception-handling/imports.wast:235: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/exception-handling/imports.wast:239: assert_unlinkable passed:\n  error: signature mismatch in imported tag\nout/test/spec/exception-handling/imports.wast:243: assert_unlinkable passed:\n  error: signature mismatch in imported tag\nout/test/spec/exception-handling/imports.wast:247: assert_unlinkable passed:\n  error: signature mismatch in imported tag\nout/test/spec/exception-handling/imports.wast:251: assert_unlinkable passed:\n  error: expected import \"test.func-i32\" to have kind tag, not func\nout/test/spec/exception-handling/imports.wast:291: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/exception-handling/imports.wast:295: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/exception-handling/imports.wast:300: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i64 but got i32.\nout/test/spec/exception-handling/imports.wast:304: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f32 but got i32.\nout/test/spec/exception-handling/imports.wast:308: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got i32.\nout/test/spec/exception-handling/imports.wast:312: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/exception-handling/imports.wast:316: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i32 but got f32.\nout/test/spec/exception-handling/imports.wast:320: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i64 but got f32.\nout/test/spec/exception-handling/imports.wast:324: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got f32.\nout/test/spec/exception-handling/imports.wast:328: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/exception-handling/imports.wast:332: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i32 but got i64.\nout/test/spec/exception-handling/imports.wast:336: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f32 but got i64.\nout/test/spec/exception-handling/imports.wast:340: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got i64.\nout/test/spec/exception-handling/imports.wast:344: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected mutable but got immutable.\nout/test/spec/exception-handling/imports.wast:349: assert_unlinkable passed:\n  error: expected import \"test.func\" to have kind global, not func\nout/test/spec/exception-handling/imports.wast:353: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind global, not table\nout/test/spec/exception-handling/imports.wast:357: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind global, not memory\nout/test/spec/exception-handling/imports.wast:361: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind global, not func\nout/test/spec/exception-handling/imports.wast:365: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind global, not table\nout/test/spec/exception-handling/imports.wast:369: assert_unlinkable passed:\n  error: expected import \"spectest.memory\" to have kind global, not memory\nout/test/spec/exception-handling/imports.wast:388: assert_trap passed: uninitialized table element\nout/test/spec/exception-handling/imports.wast:391: assert_trap passed: uninitialized table element\nout/test/spec/exception-handling/imports.wast:392: assert_trap passed: undefined table index\nout/test/spec/exception-handling/imports.wast:407: assert_trap passed: uninitialized table element\nout/test/spec/exception-handling/imports.wast:410: assert_trap passed: uninitialized table element\nout/test/spec/exception-handling/imports.wast:411: assert_trap passed: undefined table index\nout/test/spec/exception-handling/imports.wast:442: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/exception-handling/imports.wast:446: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/exception-handling/imports.wast:451: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/exception-handling/imports.wast:455: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (20)\nout/test/spec/exception-handling/imports.wast:459: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/exception-handling/imports.wast:463: assert_unlinkable passed:\n  error: max size (20) larger than declared (18)\nout/test/spec/exception-handling/imports.wast:467: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/exception-handling/imports.wast:471: assert_unlinkable passed:\n  error: max size (20) larger than declared (15)\nout/test/spec/exception-handling/imports.wast:476: assert_unlinkable passed:\n  error: expected import \"test.func\" to have kind table, not func\nout/test/spec/exception-handling/imports.wast:480: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind table, not global\nout/test/spec/exception-handling/imports.wast:484: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind table, not memory\nout/test/spec/exception-handling/imports.wast:488: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind table, not func\nout/test/spec/exception-handling/imports.wast:506: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/exception-handling/imports.wast:517: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/exception-handling/imports.wast:520: assert_invalid passed:\n  out/test/spec/exception-handling/imports/imports.103.wasm:0000015: error: only one memory block allowed\n  0000015: error: OnImportMemory callback failed\nout/test/spec/exception-handling/imports.wast:524: assert_invalid passed:\n  out/test/spec/exception-handling/imports/imports.104.wasm:0000015: error: only one memory block allowed\n  0000015: error: OnMemory callback failed\nout/test/spec/exception-handling/imports.wast:528: assert_invalid passed:\n  out/test/spec/exception-handling/imports/imports.105.wasm:000000f: error: only one memory block allowed\n  000000f: error: OnMemory callback failed\nout/test/spec/exception-handling/imports.wast:543: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/exception-handling/imports.wast:547: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/exception-handling/imports.wast:552: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/exception-handling/imports.wast:556: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (3)\nout/test/spec/exception-handling/imports.wast:560: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/exception-handling/imports.wast:564: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\nout/test/spec/exception-handling/imports.wast:569: assert_unlinkable passed:\n  error: expected import \"test.func-i32\" to have kind memory, not func\nout/test/spec/exception-handling/imports.wast:573: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind memory, not global\nout/test/spec/exception-handling/imports.wast:577: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind memory, not table\nout/test/spec/exception-handling/imports.wast:581: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind memory, not func\nout/test/spec/exception-handling/imports.wast:585: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind memory, not global\nout/test/spec/exception-handling/imports.wast:589: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind memory, not table\nout/test/spec/exception-handling/imports.wast:594: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/exception-handling/imports.wast:598: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\nout/test/spec/exception-handling/imports.wast:616: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.130.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (func))\n          ^^^^^^\nout/test/spec/exception-handling/imports.wast:620: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.131.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (global i64))\n          ^^^^^^\nout/test/spec/exception-handling/imports.wast:624: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.132.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (table 0 funcref))\n          ^^^^^^\nout/test/spec/exception-handling/imports.wast:628: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.133.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (memory 0))\n          ^^^^^^\nout/test/spec/exception-handling/imports.wast:633: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.134.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (func))\n                              ^^^^^^\nout/test/spec/exception-handling/imports.wast:637: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.135.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (global f32))\n                              ^^^^^^\nout/test/spec/exception-handling/imports.wast:641: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.136.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (table 0 funcref))\n                              ^^^^^^\nout/test/spec/exception-handling/imports.wast:645: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.137.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (memory 0))\n                              ^^^^^^\nout/test/spec/exception-handling/imports.wast:650: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.138.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (func))\n                     ^^^^^^\nout/test/spec/exception-handling/imports.wast:654: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.139.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (global i32))\n                     ^^^^^^\nout/test/spec/exception-handling/imports.wast:658: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.140.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (table 0 funcref))\n                     ^^^^^^\nout/test/spec/exception-handling/imports.wast:662: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.141.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (memory 0))\n                     ^^^^^^\nout/test/spec/exception-handling/imports.wast:667: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.142.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (func))\n              ^^^^^^\nout/test/spec/exception-handling/imports.wast:671: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.143.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (global i32))\n              ^^^^^^\nout/test/spec/exception-handling/imports.wast:675: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.144.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (table 1 3 funcref))\n              ^^^^^^\nout/test/spec/exception-handling/imports.wast:679: assert_malformed passed:\n  out/test/spec/exception-handling/imports/imports.145.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (memory 1 2))\n              ^^^^^^\nout/test/spec/exception-handling/imports.wast:689: assert_unlinkable passed:\n  error: invalid import \"not wasm.overloaded\"\n182/182 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/legacy/rethrow.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/rethrow.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\nout/test/spec/exception-handling/legacy/rethrow.wast:75: assert_exception passed\nout/test/spec/exception-handling/legacy/rethrow.wast:77: assert_exception passed\nout/test/spec/exception-handling/legacy/rethrow.wast:80: assert_exception passed\nout/test/spec/exception-handling/legacy/rethrow.wast:82: assert_exception passed\nout/test/spec/exception-handling/legacy/rethrow.wast:84: assert_exception passed\nout/test/spec/exception-handling/legacy/rethrow.wast:85: assert_exception passed\nout/test/spec/exception-handling/legacy/rethrow.wast:91: assert_exception passed\nout/test/spec/exception-handling/legacy/rethrow.wast:93: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/rethrow/rethrow.1.wasm:0000019: error: rethrow not in try catch block\n  0000019: error: OnRethrowExpr callback failed\nout/test/spec/exception-handling/legacy/rethrow.wast:94: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/rethrow/rethrow.2.wasm:000001b: error: rethrow not in try catch block\n  000001b: error: OnRethrowExpr callback failed\nout/test/spec/exception-handling/legacy/rethrow.wast:95: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/rethrow/rethrow.3.wasm:000001b: error: rethrow not in try catch block\n  000001b: error: OnRethrowExpr callback failed\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/legacy/throw.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/throw.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\nout/test/spec/exception-handling/legacy/throw.wast:38: assert_exception passed\nout/test/spec/exception-handling/legacy/throw.wast:39: assert_exception passed\nout/test/spec/exception-handling/legacy/throw.wast:41: assert_exception passed\nout/test/spec/exception-handling/legacy/throw.wast:42: assert_exception passed\nout/test/spec/exception-handling/legacy/throw.wast:43: assert_exception passed\nout/test/spec/exception-handling/legacy/throw.wast:47: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/throw/throw.1.wasm:0000019: error: tag variable out of range: 0 (max 0)\n  0000019: error: OnThrowExpr callback failed\nout/test/spec/exception-handling/legacy/throw.wast:48: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/throw/throw.2.wasm:0000022: error: type mismatch in throw, expected [i32] but got []\n  0000022: error: OnThrowExpr callback failed\nout/test/spec/exception-handling/legacy/throw.wast:50: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/throw/throw.3.wasm:0000024: error: type mismatch in throw, expected [i32] but got [i64]\n  0000024: error: OnThrowExpr callback failed\n11/11 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/legacy/try_catch.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/try_catch.wast\n;;; ARGS*: --enable-exceptions --enable-tail-call\n(;; STDOUT ;;;\nout/test/spec/exception-handling/legacy/try_catch.wast:185: assert_trap passed: unreachable executed\nout/test/spec/exception-handling/legacy/try_catch.wast:188: assert_trap passed: integer divide by zero\nout/test/spec/exception-handling/legacy/try_catch.wast:192: assert_exception passed\nout/test/spec/exception-handling/legacy/try_catch.wast:196: assert_exception passed\nout/test/spec/exception-handling/legacy/try_catch.wast:219: assert_exception passed\nout/test/spec/exception-handling/legacy/try_catch.wast:220: assert_exception passed\nout/test/spec/exception-handling/legacy/try_catch.wast:248: assert_malformed passed:\n  out/test/spec/exception-handling/legacy/try_catch/try_catch.3.wat:1:16: error: unexpected token \"catch_all\", expected an instr.\n  (module (func (catch_all)))\n                 ^^^^^^^^^\nout/test/spec/exception-handling/legacy/try_catch.wast:253: assert_malformed passed:\n  out/test/spec/exception-handling/legacy/try_catch/try_catch.4.wat:1:25: error: unexpected token \"catch\", expected an instr.\n  (module (tag $e) (func (catch $e)))\n                          ^^^^^\nout/test/spec/exception-handling/legacy/try_catch.wast:258: assert_malformed passed:\n  out/test/spec/exception-handling/legacy/try_catch/try_catch.5.wat:1:38: error: multiple catch_all clauses not allowed\n  (module (func (try (do) (catch_all) (catch_all))))\n                                       ^^^^^^^^^\nout/test/spec/exception-handling/legacy/try_catch.wast:264: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/try_catch/try_catch.6.wasm:000001b: error: type mismatch in try, expected [i32] but got []\n  000001b: error: OnEndExpr callback failed\nout/test/spec/exception-handling/legacy/try_catch.wast:266: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/try_catch/try_catch.7.wasm:000001d: error: type mismatch in try, expected [i32] but got [i64]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/exception-handling/legacy/try_catch.wast:268: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/try_catch/try_catch.8.wasm:0000023: error: type mismatch at end of try catch, expected [] but got [i32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/exception-handling/legacy/try_catch.wast:270: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/try_catch/try_catch.9.wasm:0000028: error: type mismatch in try catch, expected [i32] but got [i64]\n  0000028: error: OnEndExpr callback failed\nout/test/spec/exception-handling/legacy/try_catch.wast:275: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/try_catch/try_catch.10.wasm:000001d: error: type mismatch at end of try catch, expected [] but got [i32]\n  000001d: error: OnEndExpr callback failed\n42/42 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/legacy/try_delegate.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/try_delegate.wast\n;;; ARGS*: --enable-exceptions --enable-tail-call\n(;; STDOUT ;;;\nout/test/spec/exception-handling/legacy/try_delegate.wast:195: assert_exception passed\nout/test/spec/exception-handling/legacy/try_delegate.wast:198: assert_exception passed\nout/test/spec/exception-handling/legacy/try_delegate.wast:200: assert_exception passed\nout/test/spec/exception-handling/legacy/try_delegate.wast:208: assert_exception passed\nout/test/spec/exception-handling/legacy/try_delegate.wast:209: assert_exception passed\nout/test/spec/exception-handling/legacy/try_delegate.wast:213: assert_exception passed\nout/test/spec/exception-handling/legacy/try_delegate.wast:214: assert_exception passed\nout/test/spec/exception-handling/legacy/try_delegate.wast:222: assert_malformed passed:\n  out/test/spec/exception-handling/legacy/try_delegate/try_delegate.1.wat:1:16: error: unexpected token \"delegate\", expected an instr.\n  (module (func (delegate 0)))\n                 ^^^^^^^^\nout/test/spec/exception-handling/legacy/try_delegate.wast:227: assert_malformed passed:\n  out/test/spec/exception-handling/legacy/try_delegate/try_delegate.2.wat:1:46: error: unexpected token delegate, expected ).\n  (module (tag $e) (func (try (do) (catch $e) (delegate 0))))\n                                               ^^^^^^^^\nout/test/spec/exception-handling/legacy/try_delegate.wast:232: assert_malformed passed:\n  out/test/spec/exception-handling/legacy/try_delegate/try_delegate.3.wat:1:38: error: unexpected token delegate, expected ).\n  (module (func (try (do) (catch_all) (delegate 0))))\n                                       ^^^^^^^^\nout/test/spec/exception-handling/legacy/try_delegate.wast:237: assert_malformed passed:\n  out/test/spec/exception-handling/legacy/try_delegate/try_delegate.4.wat:1:34: error: unexpected token \")\", expected a numeric index or a name (e.g. 12 or $foo).\n  (module (func (try (do) (delegate) (delegate 0))))\n                                   ^\nout/test/spec/exception-handling/legacy/try_delegate.wast:242: assert_invalid passed:\n  out/test/spec/exception-handling/legacy/try_delegate/try_delegate.5.wasm:000001b: error: invalid depth: 2 (max 1)\n  000001b: error: OnDelegateExpr callback failed\n26/26 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/ref_null.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/ref_null.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/tag.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/tag.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\nout/test/spec/exception-handling/tag.wast:19: assert_invalid passed:\n  out/test/spec/exception-handling/tag/tag.2.wasm:0000014: error: Tag signature must have 0 results.\n  0000014: error: OnTagType callback failed\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/throw.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/throw.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\nout/test/spec/exception-handling/throw.wast:39: assert_exception passed\nout/test/spec/exception-handling/throw.wast:40: assert_exception passed\nout/test/spec/exception-handling/throw.wast:42: assert_exception passed\nout/test/spec/exception-handling/throw.wast:43: assert_exception passed\nout/test/spec/exception-handling/throw.wast:44: assert_exception passed\nout/test/spec/exception-handling/throw.wast:46: assert_exception passed\nout/test/spec/exception-handling/throw.wast:47: assert_exception passed\nout/test/spec/exception-handling/throw.wast:51: assert_invalid passed:\n  out/test/spec/exception-handling/throw/throw.1.wasm:0000019: error: tag variable out of range: 0 (max 0)\n  0000019: error: OnThrowExpr callback failed\nout/test/spec/exception-handling/throw.wast:52: assert_invalid passed:\n  out/test/spec/exception-handling/throw/throw.2.wasm:0000022: error: type mismatch in throw, expected [i32] but got []\n  0000022: error: OnThrowExpr callback failed\nout/test/spec/exception-handling/throw.wast:54: assert_invalid passed:\n  out/test/spec/exception-handling/throw/throw.3.wasm:0000024: error: type mismatch in throw, expected [i32] but got [i64]\n  0000024: error: OnThrowExpr callback failed\n13/13 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/throw_ref.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/throw_ref.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\nout/test/spec/exception-handling/throw_ref.wast:99: assert_exception passed\nout/test/spec/exception-handling/throw_ref.wast:101: assert_exception passed\nout/test/spec/exception-handling/throw_ref.wast:104: assert_exception passed\nout/test/spec/exception-handling/throw_ref.wast:106: assert_exception passed\nout/test/spec/exception-handling/throw_ref.wast:108: assert_exception passed\nout/test/spec/exception-handling/throw_ref.wast:109: assert_exception passed\nout/test/spec/exception-handling/throw_ref.wast:115: assert_exception passed\nout/test/spec/exception-handling/throw_ref.wast:117: assert_invalid passed:\n  out/test/spec/exception-handling/throw_ref/throw_ref.1.wasm:0000018: error: type mismatch in throw_ref, expected [exnref] but got []\n  0000018: error: OnThrowRefExpr callback failed\nout/test/spec/exception-handling/throw_ref.wast:118: assert_invalid passed:\n  out/test/spec/exception-handling/throw_ref/throw_ref.2.wasm:000001a: error: type mismatch in throw_ref, expected [exnref] but got []\n  000001a: error: OnThrowRefExpr callback failed\n15/15 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exception-handling/try_table.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/try_table.wast\n;;; ARGS*: --enable-exceptions --enable-tail-call\n(;; STDOUT ;;;\nout/test/spec/exception-handling/try_table.wast:261: assert_trap passed: unreachable executed\nout/test/spec/exception-handling/try_table.wast:264: assert_trap passed: integer divide by zero\nout/test/spec/exception-handling/try_table.wast:268: assert_exception passed\nout/test/spec/exception-handling/try_table.wast:272: assert_exception passed\nout/test/spec/exception-handling/try_table.wast:310: assert_exception passed\nout/test/spec/exception-handling/try_table.wast:311: assert_exception passed\nout/test/spec/exception-handling/try_table.wast:340: assert_malformed passed:\n  out/test/spec/exception-handling/try_table/try_table.3.wat:1:16: error: unexpected token \"catch_all\", expected an instr.\n  (module (func (catch_all)))\n                 ^^^^^^^^^\nout/test/spec/exception-handling/try_table.wast:345: assert_malformed passed:\n  out/test/spec/exception-handling/try_table/try_table.4.wat:1:25: error: unexpected token \"catch\", expected an instr.\n  (module (tag $e) (func (catch $e)))\n                          ^^^^^\nout/test/spec/exception-handling/try_table.wast:360: assert_invalid passed:\n  out/test/spec/exception-handling/try_table/try_table.6.wasm:000001c: error: type mismatch in try table, expected [i32] but got []\n  000001c: error: OnEndExpr callback failed\nout/test/spec/exception-handling/try_table.wast:364: assert_invalid passed:\n  out/test/spec/exception-handling/try_table/try_table.7.wasm:000001e: error: type mismatch in try table, expected [i32] but got [i64]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/exception-handling/try_table.wast:369: assert_invalid passed:\n  out/test/spec/exception-handling/try_table/try_table.8.wasm:0000022: error: catch signature doesn't match target: expected [exnref], got []\n  0000022: error: OnTryTableExpr callback failed\nout/test/spec/exception-handling/try_table.wast:373: assert_invalid passed:\n  out/test/spec/exception-handling/try_table/try_table.9.wasm:0000026: error: catch signature doesn't match target: expected [], got [exnref]\n  0000026: error: OnTryTableExpr callback failed\nout/test/spec/exception-handling/try_table.wast:377: assert_invalid passed:\n  out/test/spec/exception-handling/try_table/try_table.10.wasm:000001c: error: catch signature doesn't match target: expected [exnref], got []\n  000001c: error: OnTryTableExpr callback failed\nout/test/spec/exception-handling/try_table.wast:381: assert_invalid passed:\n  out/test/spec/exception-handling/try_table/try_table.11.wasm:000001d: error: catch signature doesn't match target: expected [], got [exnref]\n  000001d: error: OnTryTableExpr callback failed\nout/test/spec/exception-handling/try_table.wast:385: assert_invalid passed:\n  out/test/spec/exception-handling/try_table/try_table.12.wasm:0000028: error: catch signature doesn't match target: expected [i64, exnref], got [i32, exnref]\n  0000028: error: OnTryTableExpr callback failed\n53/53 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/exports.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/exports.wast\n(;; STDOUT ;;;\nout/test/spec/exports.wast:39: assert_invalid passed:\n  out/test/spec/exports/exports.15.wasm:000000f: error: function variable out of range: 0 (max 0)\n  000000f: error: OnExport callback failed\nout/test/spec/exports.wast:43: assert_invalid passed:\n  out/test/spec/exports/exports.16.wasm:0000019: error: function variable out of range: 1 (max 1)\n  0000019: error: OnExport callback failed\nout/test/spec/exports.wast:47: assert_invalid passed:\n  out/test/spec/exports/exports.17.wasm:000002e: error: function variable out of range: 1 (max 1)\n  000002e: error: OnExport callback failed\nout/test/spec/exports.wast:51: assert_invalid passed:\n  out/test/spec/exports/exports.18.wasm:000001d: error: duplicate export \"a\"\n  000001d: error: OnExport callback failed\nout/test/spec/exports.wast:55: assert_invalid passed:\n  out/test/spec/exports/exports.19.wasm:000001e: error: duplicate export \"a\"\n  000001e: error: OnExport callback failed\nout/test/spec/exports.wast:59: assert_invalid passed:\n  out/test/spec/exports/exports.20.wasm:0000025: error: duplicate export \"a\"\n  0000025: error: OnExport callback failed\nout/test/spec/exports.wast:63: assert_invalid passed:\n  out/test/spec/exports/exports.21.wasm:0000023: error: duplicate export \"a\"\n  0000023: error: OnExport callback failed\nout/test/spec/exports.wast:67: assert_invalid passed:\n  out/test/spec/exports/exports.22.wasm:0000022: error: duplicate export \"a\"\n  0000022: error: OnExport callback failed\nout/test/spec/exports.wast:96: assert_invalid passed:\n  out/test/spec/exports/exports.35.wasm:000000f: error: global variable out of range: 0 (max 0)\n  000000f: error: OnExport callback failed\nout/test/spec/exports.wast:100: assert_invalid passed:\n  out/test/spec/exports/exports.36.wasm:0000017: error: global variable out of range: 1 (max 1)\n  0000017: error: OnExport callback failed\nout/test/spec/exports.wast:104: assert_invalid passed:\n  out/test/spec/exports/exports.37.wasm:0000029: error: global variable out of range: 1 (max 1)\n  0000029: error: OnExport callback failed\nout/test/spec/exports.wast:108: assert_invalid passed:\n  out/test/spec/exports/exports.38.wasm:000001b: error: duplicate export \"a\"\n  000001b: error: OnExport callback failed\nout/test/spec/exports.wast:112: assert_invalid passed:\n  out/test/spec/exports/exports.39.wasm:0000020: error: duplicate export \"a\"\n  0000020: error: OnExport callback failed\nout/test/spec/exports.wast:116: assert_invalid passed:\n  out/test/spec/exports/exports.40.wasm:0000025: error: duplicate export \"a\"\n  0000025: error: OnExport callback failed\nout/test/spec/exports.wast:120: assert_invalid passed:\n  out/test/spec/exports/exports.41.wasm:0000021: error: duplicate export \"a\"\n  0000021: error: OnExport callback failed\nout/test/spec/exports.wast:124: assert_invalid passed:\n  out/test/spec/exports/exports.42.wasm:0000020: error: duplicate export \"a\"\n  0000020: error: OnExport callback failed\nout/test/spec/exports.wast:151: assert_invalid passed:\n  out/test/spec/exports/exports.58.wasm:000000f: error: table variable out of range: 0 (max 0)\n  000000f: error: OnExport callback failed\nout/test/spec/exports.wast:155: assert_invalid passed:\n  out/test/spec/exports/exports.59.wasm:0000015: error: table variable out of range: 1 (max 1)\n  0000015: error: OnExport callback failed\nout/test/spec/exports.wast:159: assert_invalid passed:\n  out/test/spec/exports/exports.60.wasm:0000026: error: table variable out of range: 1 (max 1)\n  0000026: error: OnExport callback failed\nout/test/spec/exports.wast:163: assert_invalid passed:\n  out/test/spec/exports/exports.61.wasm:0000019: error: duplicate export \"a\"\n  0000019: error: OnExport callback failed\nout/test/spec/exports.wast:167: assert_invalid passed:\n  out/test/spec/exports/exports.62.wasm:000001c: error: duplicate export \"a\"\n  000001c: error: OnExport callback failed\nout/test/spec/exports.wast:171: assert_invalid passed:\n  out/test/spec/exports/exports.63.wasm:0000023: error: duplicate export \"a\"\n  0000023: error: OnExport callback failed\nout/test/spec/exports.wast:175: assert_invalid passed:\n  out/test/spec/exports/exports.64.wasm:0000021: error: duplicate export \"a\"\n  0000021: error: OnExport callback failed\nout/test/spec/exports.wast:179: assert_invalid passed:\n  out/test/spec/exports/exports.65.wasm:000001e: error: duplicate export \"a\"\n  000001e: error: OnExport callback failed\nout/test/spec/exports.wast:207: assert_invalid passed:\n  out/test/spec/exports/exports.80.wasm:000000f: error: memory variable out of range: 0 (max 0)\n  000000f: error: OnExport callback failed\nout/test/spec/exports.wast:211: assert_invalid passed:\n  out/test/spec/exports/exports.81.wasm:0000014: error: memory variable out of range: 1 (max 1)\n  0000014: error: OnExport callback failed\nout/test/spec/exports.wast:215: assert_invalid passed:\n  out/test/spec/exports/exports.82.wasm:0000026: error: memory variable out of range: 1 (max 1)\n  0000026: error: OnExport callback failed\nout/test/spec/exports.wast:219: assert_invalid passed:\n  out/test/spec/exports/exports.83.wasm:0000018: error: duplicate export \"a\"\n  0000018: error: OnExport callback failed\nout/test/spec/exports.wast:228: assert_invalid passed:\n  out/test/spec/exports/exports.84.wasm:0000022: error: duplicate export \"a\"\n  0000022: error: OnExport callback failed\nout/test/spec/exports.wast:232: assert_invalid passed:\n  out/test/spec/exports/exports.85.wasm:0000020: error: duplicate export \"a\"\n  0000020: error: OnExport callback failed\nout/test/spec/exports.wast:236: assert_invalid passed:\n  out/test/spec/exports/exports.86.wasm:000001e: error: duplicate export \"a\"\n  000001e: error: OnExport callback failed\n96/96 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/extended-const/data.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/extended-const/data.wast\n;;; ARGS*: --enable-extended-const\n(;; STDOUT ;;;\nout/test/spec/extended-const/data.wast:85: assert_invalid passed:\n  out/test/spec/extended-const/data/data.9.wasm:000001b: error: initializer expression can only reference an imported global\n  000001b: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/data.wast:89: assert_invalid passed:\n  out/test/spec/extended-const/data/data.10.wasm:000001b: error: initializer expression can only reference an imported global\n  000001b: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/data.wast:331: assert_invalid passed:\n  out/test/spec/extended-const/data/data.45.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/extended-const/data.wast:339: assert_invalid passed:\n  out/test/spec/extended-const/data/data.46.wasm:0000012: error: memory variable out of range: 1 (max 1)\n  0000012: error: BeginDataSegment callback failed\nout/test/spec/extended-const/data.wast:352: assert_invalid passed:\n  out/test/spec/extended-const/data/data.47.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/extended-const/data.wast:363: assert_invalid passed:\n  out/test/spec/extended-const/data/data.48.wasm:000000d: error: memory variable out of range: 1 (max 0)\n  000000d: error: BeginDataSegment callback failed\nout/test/spec/extended-const/data.wast:375: assert_invalid passed:\n  out/test/spec/extended-const/data/data.49.wasm:0000012: error: memory variable out of range: 1 (max 1)\n  0000012: error: BeginDataSegment callback failed\nout/test/spec/extended-const/data.wast:397: assert_invalid passed:\n  out/test/spec/extended-const/data/data.50.wasm:000000d: error: memory variable out of range: 1 (max 0)\n  000000d: error: BeginDataSegment callback failed\nout/test/spec/extended-const/data.wast:416: assert_invalid passed:\n  out/test/spec/extended-const/data/data.51.wasm:0000013: error: type mismatch in initializer expression, expected [i32] but got [i64]\n  0000014: error: EndDataSegmentInitExpr callback failed\nout/test/spec/extended-const/data.wast:424: assert_invalid passed:\n  out/test/spec/extended-const/data/data.52.wasm:0000013: error: type mismatch in initializer expression, expected [i32] but got [funcref]\n  0000014: error: EndDataSegmentInitExpr callback failed\nout/test/spec/extended-const/data.wast:432: assert_invalid passed:\n  out/test/spec/extended-const/data/data.53.wasm:0000011: error: type mismatch in initializer expression, expected [i32] but got []\n  0000012: error: EndDataSegmentInitExpr callback failed\nout/test/spec/extended-const/data.wast:440: assert_invalid passed:\n  out/test/spec/extended-const/data/data.54.wasm:0000015: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000016: error: EndDataSegmentInitExpr callback failed\nout/test/spec/extended-const/data.wast:448: assert_invalid passed:\n  out/test/spec/extended-const/data/data.55.wasm:000002b: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002c: error: EndDataSegmentInitExpr callback failed\nout/test/spec/extended-const/data.wast:457: assert_invalid passed:\n  out/test/spec/extended-const/data/data.56.wasm:000002b: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002c: error: EndDataSegmentInitExpr callback failed\nout/test/spec/extended-const/data.wast:466: assert_invalid passed:\n  out/test/spec/extended-const/data/data.57.wasm:0000014: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000014: error: OnUnaryExpr callback failed\nout/test/spec/extended-const/data.wast:474: assert_invalid passed:\n  out/test/spec/extended-const/data/data.58.wasm:0000012: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000012: error: OnNopExpr callback failed\nout/test/spec/extended-const/data.wast:482: assert_invalid passed:\n  out/test/spec/extended-const/data/data.59.wasm:0000012: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000012: error: OnNopExpr callback failed\nout/test/spec/extended-const/data.wast:490: assert_invalid passed:\n  out/test/spec/extended-const/data/data.60.wasm:0000014: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000014: error: OnNopExpr callback failed\nout/test/spec/extended-const/data.wast:498: assert_invalid passed:\n  out/test/spec/extended-const/data/data.61.wasm:0000020: error: initializer expression cannot reference a mutable global\n  0000020: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/data.wast:507: assert_invalid passed:\n  out/test/spec/extended-const/data/data.62.wasm:0000013: error: global variable out of range: 0 (max 0)\n  0000013: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/data.wast:515: assert_invalid passed:\n  out/test/spec/extended-const/data/data.63.wasm:0000029: error: global variable out of range: 1 (max 1)\n  0000029: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/data.wast:524: assert_invalid passed:\n  out/test/spec/extended-const/data/data.64.wasm:000002d: error: initializer expression cannot reference a mutable global\n  000002d: error: OnGlobalGetExpr callback failed\n65/65 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/extended-const/elem.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/extended-const/elem.wast\n;;; ARGS*: --enable-extended-const\n(;; STDOUT ;;;\nout/test/spec/extended-const/elem.wast:171: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.10.wasm:0000026: error: initializer expression can only reference an imported global\n  0000026: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/elem.wast:175: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.11.wasm:0000026: error: initializer expression can only reference an imported global\n  0000026: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/elem.wast:350: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/extended-const/elem.wast:360: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/extended-const/elem.wast:365: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.36.wasm:0000016: error: table variable out of range: 0 (max 0)\n  0000016: error: BeginElemSegment callback failed\nout/test/spec/extended-const/elem.wast:375: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.37.wasm:0000014: error: type mismatch in initializer expression, expected [i32] but got [i64]\n  0000015: error: EndElemSegmentInitExpr callback failed\nout/test/spec/extended-const/elem.wast:383: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.38.wasm:0000014: error: type mismatch in initializer expression, expected [i32] but got [funcref]\n  0000015: error: EndElemSegmentInitExpr callback failed\nout/test/spec/extended-const/elem.wast:391: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.39.wasm:0000012: error: type mismatch in initializer expression, expected [i32] but got []\n  0000013: error: EndElemSegmentInitExpr callback failed\nout/test/spec/extended-const/elem.wast:399: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.40.wasm:0000016: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000017: error: EndElemSegmentInitExpr callback failed\nout/test/spec/extended-const/elem.wast:407: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.41.wasm:000002c: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002d: error: EndElemSegmentInitExpr callback failed\nout/test/spec/extended-const/elem.wast:416: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.42.wasm:000002c: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002d: error: EndElemSegmentInitExpr callback failed\nout/test/spec/extended-const/elem.wast:426: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.43.wasm:0000015: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000015: error: OnUnaryExpr callback failed\nout/test/spec/extended-const/elem.wast:434: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.44.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000013: error: OnNopExpr callback failed\nout/test/spec/extended-const/elem.wast:442: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.45.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000013: error: OnNopExpr callback failed\nout/test/spec/extended-const/elem.wast:450: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.46.wasm:0000015: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000015: error: OnNopExpr callback failed\nout/test/spec/extended-const/elem.wast:458: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.47.wasm:0000021: error: initializer expression cannot reference a mutable global\n  0000021: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/elem.wast:467: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.48.wasm:0000014: error: global variable out of range: 0 (max 0)\n  0000014: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/elem.wast:475: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.49.wasm:000002a: error: global variable out of range: 1 (max 1)\n  000002a: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/elem.wast:484: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.50.wasm:000002e: error: initializer expression cannot reference a mutable global\n  000002e: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/elem.wast:495: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.51.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [externref]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/extended-const/elem.wast:503: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.52.wasm:000001a: error: type mismatch at end of initializer expression, expected [] but got [funcref]\n  000001b: error: EndElemExpr callback failed\nout/test/spec/extended-const/elem.wast:511: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.53.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [i32]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/extended-const/elem.wast:519: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.54.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [i32]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/extended-const/elem.wast:527: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.55.wasm:0000023: error: invalid initializer: instruction not valid in initializer expression: call\n  0000023: error: OnCallExpr callback failed\nout/test/spec/extended-const/elem.wast:536: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.56.wasm:0000023: error: invalid initializer: instruction not valid in initializer expression: call\n  0000023: error: OnCallExpr callback failed\nout/test/spec/extended-const/elem.wast:594: assert_trap passed: uninitialized table element\nout/test/spec/extended-const/elem.wast:627: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.62.wasm:000001f: error: type mismatch at elem segment. got funcref, expected externref\n  000001f: error: OnElemSegmentElemType callback failed\nout/test/spec/extended-const/elem.wast:632: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.63.wasm:0000017: error: type mismatch at elem segment. got externref, expected funcref\n  0000017: error: OnElemSegmentElemType callback failed\nout/test/spec/extended-const/elem.wast:637: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.64.wasm:0000032: error: type mismatch at table.init. got funcref, expected externref\n  0000032: error: OnTableInitExpr callback failed\nout/test/spec/extended-const/elem.wast:646: assert_invalid passed:\n  out/test/spec/extended-const/elem/elem.65.wasm:0000030: error: type mismatch at table.init. got externref, expected funcref\n  0000030: error: OnTableInitExpr callback failed\nout/test/spec/extended-const/elem.wast:714: assert_trap passed: uninitialized table element\nout/test/spec/extended-const/elem.wast:725: assert_trap passed: uninitialized table element\nout/test/spec/extended-const/elem.wast:736: assert_trap passed: uninitialized table element\nout/test/spec/extended-const/elem.wast:758: assert_trap passed: uninitialized table element\n108/108 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/extended-const/global.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/extended-const/global.wast\n;;; ARGS*: --enable-extended-const\n(;; STDOUT ;;;\nout/test/spec/extended-const/global.wast:263: assert_trap passed: undefined table index\nout/test/spec/extended-const/global.wast:285: assert_invalid passed:\n  out/test/spec/extended-const/global/global.1.wasm:0000029: error: can't global.set on immutable global at index 0.\n  0000029: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:290: assert_invalid passed:\n  out/test/spec/extended-const/global/global.2.wasm:0000035: error: can't global.set on immutable global at index 0.\n  0000035: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:299: assert_invalid passed:\n  out/test/spec/extended-const/global/global.5.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: f32.neg\n  0000013: error: OnUnaryExpr callback failed\nout/test/spec/extended-const/global.wast:304: assert_invalid passed:\n  out/test/spec/extended-const/global/global.6.wasm:000000f: error: invalid initializer: instruction not valid in initializer expression: local.get\n  000000f: error: OnLocalGetExpr callback failed\nout/test/spec/extended-const/global.wast:309: assert_invalid passed:\n  out/test/spec/extended-const/global/global.7.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: f32.neg\n  0000013: error: OnUnaryExpr callback failed\nout/test/spec/extended-const/global.wast:314: assert_invalid passed:\n  out/test/spec/extended-const/global/global.8.wasm:0000010: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000010: error: OnNopExpr callback failed\nout/test/spec/extended-const/global.wast:319: assert_invalid passed:\n  out/test/spec/extended-const/global/global.9.wasm:0000010: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000010: error: OnUnaryExpr callback failed\nout/test/spec/extended-const/global.wast:324: assert_invalid passed:\n  out/test/spec/extended-const/global/global.10.wasm:000000e: error: invalid initializer: instruction not valid in initializer expression: nop\n  000000e: error: OnNopExpr callback failed\nout/test/spec/extended-const/global.wast:329: assert_invalid passed:\n  out/test/spec/extended-const/global/global.11.wasm:0000012: error: type mismatch in initializer expression, expected [i32] but got [f32]\n  0000013: error: EndGlobalInitExpr callback failed\nout/test/spec/extended-const/global.wast:334: assert_invalid passed:\n  out/test/spec/extended-const/global/global.12.wasm:0000011: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000012: error: EndGlobalInitExpr callback failed\nout/test/spec/extended-const/global.wast:339: assert_invalid passed:\n  out/test/spec/extended-const/global/global.13.wasm:000000d: error: type mismatch in initializer expression, expected [i32] but got []\n  000000e: error: EndGlobalInitExpr callback failed\nout/test/spec/extended-const/global.wast:344: assert_invalid passed:\n  out/test/spec/extended-const/global/global.14.wasm:0000017: error: type mismatch in initializer expression, expected [funcref] but got [externref]\n  0000018: error: EndGlobalInitExpr callback failed\nout/test/spec/extended-const/global.wast:349: assert_invalid passed:\n  out/test/spec/extended-const/global/global.15.wasm:0000027: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000028: error: EndGlobalInitExpr callback failed\nout/test/spec/extended-const/global.wast:354: assert_invalid passed:\n  out/test/spec/extended-const/global/global.16.wasm:0000027: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000028: error: EndGlobalInitExpr callback failed\nout/test/spec/extended-const/global.wast:359: assert_invalid passed:\n  out/test/spec/extended-const/global/global.17.wasm:000000f: error: initializer expression can only reference an imported global\n  000000f: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:364: assert_invalid passed:\n  out/test/spec/extended-const/global/global.18.wasm:0000014: error: initializer expression can only reference an imported global\n  0000014: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:368: assert_invalid passed:\n  out/test/spec/extended-const/global/global.19.wasm:0000014: error: initializer expression can only reference an imported global\n  0000014: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:373: assert_invalid passed:\n  out/test/spec/extended-const/global/global.20.wasm:000000f: error: global variable out of range: 1 (max 1)\n  000000f: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:378: assert_invalid passed:\n  out/test/spec/extended-const/global/global.21.wasm:0000025: error: global variable out of range: 2 (max 2)\n  0000025: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:383: assert_invalid passed:\n  out/test/spec/extended-const/global/global.22.wasm:0000029: error: initializer expression cannot reference a mutable global\n  0000029: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:391: assert_malformed passed:\n  0000026: error: global mutability must be 0 or 1\nout/test/spec/extended-const/global.wast:404: assert_malformed passed:\n  0000026: error: global mutability must be 0 or 1\nout/test/spec/extended-const/global.wast:421: assert_malformed passed:\n  0000011: error: global mutability must be 0 or 1\nout/test/spec/extended-const/global.wast:433: assert_malformed passed:\n  0000011: error: global mutability must be 0 or 1\nout/test/spec/extended-const/global.wast:447: assert_invalid passed:\n  out/test/spec/extended-const/global/global.29.wasm:000001a: error: global variable out of range: 0 (max 0)\n  000001a: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:452: assert_invalid passed:\n  out/test/spec/extended-const/global/global.30.wasm:0000022: error: global variable out of range: 1 (max 1)\n  0000022: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:460: assert_invalid passed:\n  out/test/spec/extended-const/global/global.31.wasm:0000034: error: global variable out of range: 1 (max 1)\n  0000034: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:468: assert_invalid passed:\n  out/test/spec/extended-const/global/global.32.wasm:000003c: error: global variable out of range: 2 (max 2)\n  000003c: error: OnGlobalGetExpr callback failed\nout/test/spec/extended-const/global.wast:478: assert_invalid passed:\n  out/test/spec/extended-const/global/global.33.wasm:000001b: error: global variable out of range: 0 (max 0)\n  000001b: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:483: assert_invalid passed:\n  out/test/spec/extended-const/global/global.34.wasm:0000023: error: global variable out of range: 1 (max 1)\n  0000023: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:491: assert_invalid passed:\n  out/test/spec/extended-const/global/global.35.wasm:0000035: error: global variable out of range: 1 (max 1)\n  0000035: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:499: assert_invalid passed:\n  out/test/spec/extended-const/global/global.36.wasm:000003d: error: global variable out of range: 2 (max 2)\n  000003d: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:509: assert_invalid passed:\n  out/test/spec/extended-const/global/global.37.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:518: assert_invalid passed:\n  out/test/spec/extended-const/global/global.38.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:528: assert_invalid passed:\n  out/test/spec/extended-const/global/global.39.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:538: assert_invalid passed:\n  out/test/spec/extended-const/global/global.40.wasm:0000027: error: type mismatch in global.set, expected [i32] but got []\n  0000027: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:548: assert_invalid passed:\n  out/test/spec/extended-const/global/global.41.wasm:000002a: error: type mismatch in global.set, expected [i32] but got []\n  000002a: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:558: assert_invalid passed:\n  out/test/spec/extended-const/global/global.42.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:568: assert_invalid passed:\n  out/test/spec/extended-const/global/global.43.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:578: assert_invalid passed:\n  out/test/spec/extended-const/global/global.44.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:588: assert_invalid passed:\n  out/test/spec/extended-const/global/global.45.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:597: assert_invalid passed:\n  out/test/spec/extended-const/global/global.46.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:606: assert_invalid passed:\n  out/test/spec/extended-const/global/global.47.wasm:0000027: error: type mismatch in global.set, expected [i32] but got []\n  0000027: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:616: assert_invalid passed:\n  out/test/spec/extended-const/global/global.48.wasm:000003e: error: type mismatch in global.set, expected [i32] but got []\n  000003e: error: OnGlobalSetExpr callback failed\nout/test/spec/extended-const/global.wast:634: assert_malformed passed:\n  out/test/spec/extended-const/global/global.49.wat:1:33: error: redefinition of global \"$foo\"\n  (global $foo i32 (i32.const 0))(global $foo i32 (i32.const 0))\n                                  ^^^^^^\nout/test/spec/extended-const/global.wast:638: assert_malformed passed:\n  out/test/spec/extended-const/global/global.50.wat:1:34: error: redefinition of global \"$foo\"\n  (import \"\" \"\" (global $foo i32))(global $foo i32 (i32.const 0))\n                                   ^^^^^^\nout/test/spec/extended-const/global.wast:642: assert_malformed passed:\n  out/test/spec/extended-const/global/global.51.wat:1:34: error: redefinition of global \"$foo\"\n  (import \"\" \"\" (global $foo i32))(import \"\" \"\" (global $foo i32))\n                                   ^^^^^^\n114/114 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/f32.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/f32.wast\n(;; STDOUT ;;;\nout/test/spec/f32.wast:2523: assert_invalid passed:\n  out/test/spec/f32/f32.1.wasm:0000024: error: type mismatch in f32.add, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnBinaryExpr callback failed\nout/test/spec/f32.wast:2524: assert_invalid passed:\n  out/test/spec/f32/f32.2.wasm:0000024: error: type mismatch in f32.div, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnBinaryExpr callback failed\nout/test/spec/f32.wast:2525: assert_invalid passed:\n  out/test/spec/f32/f32.3.wasm:0000024: error: type mismatch in f32.max, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnBinaryExpr callback failed\nout/test/spec/f32.wast:2526: assert_invalid passed:\n  out/test/spec/f32/f32.4.wasm:0000024: error: type mismatch in f32.min, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnBinaryExpr callback failed\nout/test/spec/f32.wast:2527: assert_invalid passed:\n  out/test/spec/f32/f32.5.wasm:0000024: error: type mismatch in f32.mul, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnBinaryExpr callback failed\nout/test/spec/f32.wast:2528: assert_invalid passed:\n  out/test/spec/f32/f32.6.wasm:0000024: error: type mismatch in f32.sub, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnBinaryExpr callback failed\nout/test/spec/f32.wast:2529: assert_invalid passed:\n  out/test/spec/f32/f32.7.wasm:000001b: error: type mismatch in f32.ceil, expected [f32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f32.wast:2530: assert_invalid passed:\n  out/test/spec/f32/f32.8.wasm:000001b: error: type mismatch in f32.floor, expected [f32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f32.wast:2531: assert_invalid passed:\n  out/test/spec/f32/f32.9.wasm:000001b: error: type mismatch in f32.nearest, expected [f32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f32.wast:2532: assert_invalid passed:\n  out/test/spec/f32/f32.10.wasm:000001b: error: type mismatch in f32.sqrt, expected [f32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f32.wast:2533: assert_invalid passed:\n  out/test/spec/f32/f32.11.wasm:000001b: error: type mismatch in f32.trunc, expected [f32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f32.wast:2537: assert_malformed passed:\n  out/test/spec/f32/f32.12.wat:1:31: error: invalid literal \"nan:arithmetic\"\n  (func (result f32) (f32.const nan:arithmetic))\n                                ^^^^^^^^^^^^^^\nout/test/spec/f32.wast:2541: assert_malformed passed:\n  out/test/spec/f32/f32.13.wat:1:31: error: invalid literal \"nan:canonical\"\n  (func (result f32) (f32.const nan:canonical))\n                                ^^^^^^^^^^^^^\n2514/2514 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/f32_bitwise.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/f32_bitwise.wast\n(;; STDOUT ;;;\nout/test/spec/f32_bitwise.wast:374: assert_invalid passed:\n  out/test/spec/f32_bitwise/f32_bitwise.1.wasm:0000024: error: type mismatch in f32.copysign, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnBinaryExpr callback failed\nout/test/spec/f32_bitwise.wast:375: assert_invalid passed:\n  out/test/spec/f32_bitwise/f32_bitwise.2.wasm:000001b: error: type mismatch in f32.abs, expected [f32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f32_bitwise.wast:376: assert_invalid passed:\n  out/test/spec/f32_bitwise/f32_bitwise.3.wasm:000001b: error: type mismatch in f32.neg, expected [f32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\n364/364 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/f32_cmp.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/f32_cmp.wast\n(;; STDOUT ;;;\nout/test/spec/f32_cmp.wast:2417: assert_invalid passed:\n  out/test/spec/f32_cmp/f32_cmp.1.wasm:0000024: error: type mismatch in f32.eq, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnCompareExpr callback failed\nout/test/spec/f32_cmp.wast:2418: assert_invalid passed:\n  out/test/spec/f32_cmp/f32_cmp.2.wasm:0000024: error: type mismatch in f32.ge, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnCompareExpr callback failed\nout/test/spec/f32_cmp.wast:2419: assert_invalid passed:\n  out/test/spec/f32_cmp/f32_cmp.3.wasm:0000024: error: type mismatch in f32.gt, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnCompareExpr callback failed\nout/test/spec/f32_cmp.wast:2420: assert_invalid passed:\n  out/test/spec/f32_cmp/f32_cmp.4.wasm:0000024: error: type mismatch in f32.le, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnCompareExpr callback failed\nout/test/spec/f32_cmp.wast:2421: assert_invalid passed:\n  out/test/spec/f32_cmp/f32_cmp.5.wasm:0000024: error: type mismatch in f32.lt, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnCompareExpr callback failed\nout/test/spec/f32_cmp.wast:2422: assert_invalid passed:\n  out/test/spec/f32_cmp/f32_cmp.6.wasm:0000024: error: type mismatch in f32.ne, expected [f32, f32] but got [i64, f64]\n  0000024: error: OnCompareExpr callback failed\n2407/2407 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/f64.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/f64.wast\n(;; STDOUT ;;;\nout/test/spec/f64.wast:2523: assert_invalid passed:\n  out/test/spec/f64/f64.1.wasm:0000020: error: type mismatch in f64.add, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/f64.wast:2524: assert_invalid passed:\n  out/test/spec/f64/f64.2.wasm:0000020: error: type mismatch in f64.div, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/f64.wast:2525: assert_invalid passed:\n  out/test/spec/f64/f64.3.wasm:0000020: error: type mismatch in f64.max, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/f64.wast:2526: assert_invalid passed:\n  out/test/spec/f64/f64.4.wasm:0000020: error: type mismatch in f64.min, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/f64.wast:2527: assert_invalid passed:\n  out/test/spec/f64/f64.5.wasm:0000020: error: type mismatch in f64.mul, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/f64.wast:2528: assert_invalid passed:\n  out/test/spec/f64/f64.6.wasm:0000020: error: type mismatch in f64.sub, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/f64.wast:2529: assert_invalid passed:\n  out/test/spec/f64/f64.7.wasm:000001b: error: type mismatch in f64.ceil, expected [f64] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f64.wast:2530: assert_invalid passed:\n  out/test/spec/f64/f64.8.wasm:000001b: error: type mismatch in f64.floor, expected [f64] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f64.wast:2531: assert_invalid passed:\n  out/test/spec/f64/f64.9.wasm:000001b: error: type mismatch in f64.nearest, expected [f64] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f64.wast:2532: assert_invalid passed:\n  out/test/spec/f64/f64.10.wasm:000001b: error: type mismatch in f64.sqrt, expected [f64] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f64.wast:2533: assert_invalid passed:\n  out/test/spec/f64/f64.11.wasm:000001b: error: type mismatch in f64.trunc, expected [f64] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f64.wast:2537: assert_malformed passed:\n  out/test/spec/f64/f64.12.wat:1:31: error: invalid literal \"nan:arithmetic\"\n  (func (result f64) (f64.const nan:arithmetic))\n                                ^^^^^^^^^^^^^^\nout/test/spec/f64.wast:2541: assert_malformed passed:\n  out/test/spec/f64/f64.13.wat:1:31: error: invalid literal \"nan:canonical\"\n  (func (result f64) (f64.const nan:canonical))\n                                ^^^^^^^^^^^^^\n2514/2514 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/f64_bitwise.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/f64_bitwise.wast\n(;; STDOUT ;;;\nout/test/spec/f64_bitwise.wast:374: assert_invalid passed:\n  out/test/spec/f64_bitwise/f64_bitwise.1.wasm:0000020: error: type mismatch in f64.copysign, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/f64_bitwise.wast:375: assert_invalid passed:\n  out/test/spec/f64_bitwise/f64_bitwise.2.wasm:000001b: error: type mismatch in f64.abs, expected [f64] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/f64_bitwise.wast:376: assert_invalid passed:\n  out/test/spec/f64_bitwise/f64_bitwise.3.wasm:000001b: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\n364/364 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/f64_cmp.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/f64_cmp.wast\n(;; STDOUT ;;;\nout/test/spec/f64_cmp.wast:2417: assert_invalid passed:\n  out/test/spec/f64_cmp/f64_cmp.1.wasm:0000020: error: type mismatch in f64.eq, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/f64_cmp.wast:2418: assert_invalid passed:\n  out/test/spec/f64_cmp/f64_cmp.2.wasm:0000020: error: type mismatch in f64.ge, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/f64_cmp.wast:2419: assert_invalid passed:\n  out/test/spec/f64_cmp/f64_cmp.3.wasm:0000020: error: type mismatch in f64.gt, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/f64_cmp.wast:2420: assert_invalid passed:\n  out/test/spec/f64_cmp/f64_cmp.4.wasm:0000020: error: type mismatch in f64.le, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/f64_cmp.wast:2421: assert_invalid passed:\n  out/test/spec/f64_cmp/f64_cmp.5.wasm:0000020: error: type mismatch in f64.lt, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/f64_cmp.wast:2422: assert_invalid passed:\n  out/test/spec/f64_cmp/f64_cmp.6.wasm:0000020: error: type mismatch in f64.ne, expected [f64, f64] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\n2407/2407 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/fac.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/fac.wast\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/float_exprs.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/float_exprs.wast\n(;; STDOUT ;;;\ninit(i32:0, f32:15.100000) =>\ninit(i32:4, f32:15.200000) =>\ninit(i32:8, f32:15.300000) =>\ninit(i32:12, f32:15.400000) =>\nrun(i32:16, f32:3.000000) =>\ninit(i32:0, f64:15.100000) =>\ninit(i32:8, f64:15.200000) =>\ninit(i32:16, f64:15.300000) =>\ninit(i32:24, f64:15.400000) =>\nrun(i32:32, f64:3.000000) =>\n927/927 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/float_literals.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/float_literals.wast\n(;; STDOUT ;;;\nout/test/spec/float_literals.wast:236: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.2.wat:1:24: error: unexpected token \"_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const _100))\n                         ^^^^\nout/test/spec/float_literals.wast:240: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.3.wat:1:24: error: unexpected token \"+_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const +_100))\n                         ^^^^^\nout/test/spec/float_literals.wast:244: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.4.wat:1:24: error: unexpected token \"-_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const -_100))\n                         ^^^^^\nout/test/spec/float_literals.wast:248: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.5.wat:1:24: error: unexpected token \"99_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 99_))\n                         ^^^\nout/test/spec/float_literals.wast:252: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.6.wat:1:24: error: unexpected token \"1__000\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1__000))\n                         ^^^^^^\nout/test/spec/float_literals.wast:256: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.7.wat:1:24: error: unexpected token \"_1.0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const _1.0))\n                         ^^^^\nout/test/spec/float_literals.wast:260: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.8.wat:1:24: error: unexpected token \"1.0_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1.0_))\n                         ^^^^\nout/test/spec/float_literals.wast:264: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.9.wat:1:24: error: unexpected token \"1_.0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1_.0))\n                         ^^^^\nout/test/spec/float_literals.wast:268: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.10.wat:1:24: error: unexpected token \"1._0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1._0))\n                         ^^^^\nout/test/spec/float_literals.wast:272: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.11.wat:1:24: error: unexpected token \"_1e1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const _1e1))\n                         ^^^^\nout/test/spec/float_literals.wast:276: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.12.wat:1:24: error: unexpected token \"1e1_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1e1_))\n                         ^^^^\nout/test/spec/float_literals.wast:280: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.13.wat:1:24: error: unexpected token \"1_e1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1_e1))\n                         ^^^^\nout/test/spec/float_literals.wast:284: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.14.wat:1:24: error: unexpected token \"1e_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1e_1))\n                         ^^^^\nout/test/spec/float_literals.wast:288: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.15.wat:1:24: error: unexpected token \"_1.0e1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const _1.0e1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:292: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.16.wat:1:24: error: unexpected token \"1.0e1_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1.0e1_))\n                         ^^^^^^\nout/test/spec/float_literals.wast:296: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.17.wat:1:24: error: unexpected token \"1.0_e1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1.0_e1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:300: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.18.wat:1:24: error: unexpected token \"1.0e_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1.0e_1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:304: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.19.wat:1:24: error: unexpected token \"1.0e+_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1.0e+_1))\n                         ^^^^^^^\nout/test/spec/float_literals.wast:308: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.20.wat:1:24: error: unexpected token \"1.0e_+1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 1.0e_+1))\n                         ^^^^^^^\nout/test/spec/float_literals.wast:312: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.21.wat:1:24: error: unexpected token \"_0x100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const _0x100))\n                         ^^^^^^\nout/test/spec/float_literals.wast:316: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.22.wat:1:24: error: unexpected token \"0_x100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0_x100))\n                         ^^^^^^\nout/test/spec/float_literals.wast:320: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.23.wat:1:24: error: unexpected token \"0x_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x_100))\n                         ^^^^^^\nout/test/spec/float_literals.wast:324: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.24.wat:1:24: error: unexpected token \"0x00_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x00_))\n                         ^^^^^\nout/test/spec/float_literals.wast:328: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.25.wat:1:24: error: unexpected token \"0xff__ffff\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0xff__ffff))\n                         ^^^^^^^^^^\nout/test/spec/float_literals.wast:332: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.26.wat:1:24: error: unexpected token \"0x_1.0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x_1.0))\n                         ^^^^^^\nout/test/spec/float_literals.wast:336: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.27.wat:1:24: error: unexpected token \"0x1.0_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1.0_))\n                         ^^^^^^\nout/test/spec/float_literals.wast:340: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.28.wat:1:24: error: unexpected token \"0x1_.0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1_.0))\n                         ^^^^^^\nout/test/spec/float_literals.wast:344: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.29.wat:1:24: error: unexpected token \"0x1._0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1._0))\n                         ^^^^^^\nout/test/spec/float_literals.wast:348: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.30.wat:1:24: error: unexpected token \"0x_1p1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x_1p1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:352: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.31.wat:1:24: error: unexpected token \"0x1p1_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1p1_))\n                         ^^^^^^\nout/test/spec/float_literals.wast:356: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.32.wat:1:24: error: unexpected token \"0x1_p1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1_p1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:360: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.33.wat:1:24: error: unexpected token \"0x1p_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1p_1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:364: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.34.wat:1:24: error: unexpected token \"0x_1.0p1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x_1.0p1))\n                         ^^^^^^^^\nout/test/spec/float_literals.wast:368: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.35.wat:1:24: error: unexpected token \"0x1.0p1_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1.0p1_))\n                         ^^^^^^^^\nout/test/spec/float_literals.wast:372: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.36.wat:1:24: error: unexpected token \"0x1.0_p1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1.0_p1))\n                         ^^^^^^^^\nout/test/spec/float_literals.wast:376: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.37.wat:1:24: error: unexpected token \"0x1.0p_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1.0p_1))\n                         ^^^^^^^^\nout/test/spec/float_literals.wast:380: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.38.wat:1:24: error: unexpected token \"0x1.0p+_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1.0p+_1))\n                         ^^^^^^^^^\nout/test/spec/float_literals.wast:384: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.39.wat:1:24: error: unexpected token \"0x1.0p_+1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f32 (f32.const 0x1.0p_+1))\n                         ^^^^^^^^^\nout/test/spec/float_literals.wast:388: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.40.wat:1:24: error: invalid literal \"nan:0x80_0000\"\n  (global f32 (f32.const nan:0x80_0000))\n                         ^^^^^^^^^^^^^\nout/test/spec/float_literals.wast:393: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.41.wat:1:24: error: unexpected token \"_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const _100))\n                         ^^^^\nout/test/spec/float_literals.wast:397: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.42.wat:1:24: error: unexpected token \"+_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const +_100))\n                         ^^^^^\nout/test/spec/float_literals.wast:401: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.43.wat:1:24: error: unexpected token \"-_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const -_100))\n                         ^^^^^\nout/test/spec/float_literals.wast:405: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.44.wat:1:24: error: unexpected token \"99_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 99_))\n                         ^^^\nout/test/spec/float_literals.wast:409: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.45.wat:1:24: error: unexpected token \"1__000\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1__000))\n                         ^^^^^^\nout/test/spec/float_literals.wast:413: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.46.wat:1:24: error: unexpected token \"_1.0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const _1.0))\n                         ^^^^\nout/test/spec/float_literals.wast:417: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.47.wat:1:24: error: unexpected token \"1.0_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1.0_))\n                         ^^^^\nout/test/spec/float_literals.wast:421: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.48.wat:1:24: error: unexpected token \"1_.0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1_.0))\n                         ^^^^\nout/test/spec/float_literals.wast:425: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.49.wat:1:24: error: unexpected token \"1._0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1._0))\n                         ^^^^\nout/test/spec/float_literals.wast:429: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.50.wat:1:24: error: unexpected token \"_1e1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const _1e1))\n                         ^^^^\nout/test/spec/float_literals.wast:433: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.51.wat:1:24: error: unexpected token \"1e1_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1e1_))\n                         ^^^^\nout/test/spec/float_literals.wast:437: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.52.wat:1:24: error: unexpected token \"1_e1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1_e1))\n                         ^^^^\nout/test/spec/float_literals.wast:441: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.53.wat:1:24: error: unexpected token \"1e_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1e_1))\n                         ^^^^\nout/test/spec/float_literals.wast:445: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.54.wat:1:24: error: unexpected token \"_1.0e1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const _1.0e1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:449: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.55.wat:1:24: error: unexpected token \"1.0e1_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1.0e1_))\n                         ^^^^^^\nout/test/spec/float_literals.wast:453: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.56.wat:1:24: error: unexpected token \"1.0_e1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1.0_e1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:457: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.57.wat:1:24: error: unexpected token \"1.0e_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1.0e_1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:461: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.58.wat:1:24: error: unexpected token \"1.0e+_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1.0e+_1))\n                         ^^^^^^^\nout/test/spec/float_literals.wast:465: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.59.wat:1:24: error: unexpected token \"1.0e_+1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 1.0e_+1))\n                         ^^^^^^^\nout/test/spec/float_literals.wast:469: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.60.wat:1:24: error: unexpected token \"_0x100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const _0x100))\n                         ^^^^^^\nout/test/spec/float_literals.wast:473: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.61.wat:1:24: error: unexpected token \"0_x100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0_x100))\n                         ^^^^^^\nout/test/spec/float_literals.wast:477: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.62.wat:1:24: error: unexpected token \"0x_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x_100))\n                         ^^^^^^\nout/test/spec/float_literals.wast:481: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.63.wat:1:24: error: unexpected token \"0x00_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x00_))\n                         ^^^^^\nout/test/spec/float_literals.wast:485: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.64.wat:1:24: error: unexpected token \"0xff__ffff\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0xff__ffff))\n                         ^^^^^^^^^^\nout/test/spec/float_literals.wast:489: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.65.wat:1:24: error: unexpected token \"0x_1.0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x_1.0))\n                         ^^^^^^\nout/test/spec/float_literals.wast:493: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.66.wat:1:24: error: unexpected token \"0x1.0_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1.0_))\n                         ^^^^^^\nout/test/spec/float_literals.wast:497: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.67.wat:1:24: error: unexpected token \"0x1_.0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1_.0))\n                         ^^^^^^\nout/test/spec/float_literals.wast:501: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.68.wat:1:24: error: unexpected token \"0x1._0\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1._0))\n                         ^^^^^^\nout/test/spec/float_literals.wast:505: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.69.wat:1:24: error: unexpected token \"0x_1p1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x_1p1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:509: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.70.wat:1:24: error: unexpected token \"0x1p1_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1p1_))\n                         ^^^^^^\nout/test/spec/float_literals.wast:513: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.71.wat:1:24: error: unexpected token \"0x1_p1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1_p1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:517: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.72.wat:1:24: error: unexpected token \"0x1p_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1p_1))\n                         ^^^^^^\nout/test/spec/float_literals.wast:521: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.73.wat:1:24: error: unexpected token \"0x_1.0p1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x_1.0p1))\n                         ^^^^^^^^\nout/test/spec/float_literals.wast:525: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.74.wat:1:24: error: unexpected token \"0x1.0p1_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1.0p1_))\n                         ^^^^^^^^\nout/test/spec/float_literals.wast:529: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.75.wat:1:24: error: unexpected token \"0x1.0_p1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1.0_p1))\n                         ^^^^^^^^\nout/test/spec/float_literals.wast:533: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.76.wat:1:24: error: unexpected token \"0x1.0p_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1.0p_1))\n                         ^^^^^^^^\nout/test/spec/float_literals.wast:537: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.77.wat:1:24: error: unexpected token \"0x1.0p+_1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1.0p+_1))\n                         ^^^^^^^^^\nout/test/spec/float_literals.wast:541: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.78.wat:1:24: error: unexpected token \"0x1.0p_+1\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global f64 (f64.const 0x1.0p_+1))\n                         ^^^^^^^^^\nout/test/spec/float_literals.wast:545: assert_malformed passed:\n  out/test/spec/float_literals/float_literals.79.wat:1:24: error: invalid literal \"nan:0x10_0000_0000_0000\"\n  (global f64 (f64.const nan:0x10_0000_0000_0000))\n                         ^^^^^^^^^^^^^^^^^^^^^^^\n179/179 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/float_memory.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/float_memory.wast\n(;; STDOUT ;;;\nreset() =>\nf32.store() =>\nreset() =>\ni32.store() =>\nreset() =>\nf64.store() =>\nreset() =>\ni64.store() =>\nreset() =>\nf32.store() =>\nreset() =>\ni32.store() =>\nreset() =>\nf64.store() =>\nreset() =>\ni64.store() =>\nreset() =>\nf32.store() =>\nreset() =>\ni32.store() =>\nreset() =>\nf64.store() =>\nreset() =>\ni64.store() =>\n90/90 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/float_misc.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/float_misc.wast\n(;; STDOUT ;;;\n471/471 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/forward.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/forward.wast\n(;; STDOUT ;;;\n5/5 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/func.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/func.wast\n(;; STDOUT ;;;\nout/test/spec/func.wast:436: assert_invalid passed:\n  out/test/spec/func/func.2.wasm:000001a: error: function type variable out of range: 2 (max 2)\n  000001a: error: OnFunction callback failed\nout/test/spec/func.wast:448: assert_malformed passed:\n  out/test/spec/func/func.3.wat:1:123: error: invalid func type index 2\n  ...lt f64) (f64.const 1))(type $t (func (param i32)))(func (type 2) (param i32))\n                                                        ^^^^\nout/test/spec/func.wast:560: assert_malformed passed:\n  out/test/spec/func/func.6.wat:1:76: error: unexpected token \"param\", expected an instr.\n  ... i32) (result i32)))(func (type $sig) (result i32) (param i32) (i32.const 0))\n                                                         ^^^^^\nout/test/spec/func.wast:567: assert_malformed passed:\n  out/test/spec/func/func.7.wat:1:63: error: unexpected token \"type\", expected an instr.\n  ... i32) (result i32)))(func (param i32) (type $sig) (result i32) (i32.const 0))\n                                            ^^^^\nout/test/spec/func.wast:574: assert_malformed passed:\n  out/test/spec/func/func.8.wat:1:76: error: unexpected token \"type\", expected an instr.\n  ... i32) (result i32)))(func (param i32) (result i32) (type $sig) (i32.const 0))\n                                                         ^^^^\nout/test/spec/func.wast:581: assert_malformed passed:\n  out/test/spec/func/func.9.wat:1:64: error: unexpected token \"type\", expected an instr.\n  ... i32) (result i32)))(func (result i32) (type $sig) (param i32) (i32.const 0))\n                                             ^^^^\nout/test/spec/func.wast:588: assert_malformed passed:\n  out/test/spec/func/func.10.wat:1:64: error: unexpected token \"param\", expected an instr.\n  ... i32) (result i32)))(func (result i32) (param i32) (type $sig) (i32.const 0))\n                                             ^^^^^\n  out/test/spec/func/func.10.wat:1:85: error: unexpected token ), expected (.\n  ... i32) (result i32)))(func (result i32) (param i32) (type $sig) (i32.const 0))\n                                                                  ^\nout/test/spec/func.wast:595: assert_malformed passed:\n  out/test/spec/func/func.11.wat:1:21: error: unexpected token \"param\", expected an instr.\n  (func (result i32) (param i32) (i32.const 0))\n                      ^^^^^\nout/test/spec/func.wast:602: assert_malformed passed:\n  out/test/spec/func/func.12.wat:1:20: error: expected 0 results, got 1\n  (type $sig (func))(func (type $sig) (result i32) (i32.const 0))\n                     ^^^^\nout/test/spec/func.wast:609: assert_malformed passed:\n  out/test/spec/func/func.13.wat:1:45: error: expected 1 arguments, got 0\n  ...g (func (param i32) (result i32)))(func (type $sig) (result i32) (i32.cons...\n                                        ^^^^\nout/test/spec/func.wast:616: assert_malformed passed:\n  out/test/spec/func/func.14.wat:1:45: error: expected 1 results, got 0\n  ...g (func (param i32) (result i32)))(func (type $sig) (param i32) (i32.const...\n                                        ^^^^\nout/test/spec/func.wast:623: assert_malformed passed:\n  out/test/spec/func/func.15.wat:1:49: error: expected 2 arguments, got 1\n  ...unc (param i32 i32) (result i32)))(func (type $sig) (param i32) (result i3...\n                                        ^^^^\nout/test/spec/func.wast:634: assert_invalid passed:\n  out/test/spec/func/func.16.wasm:000001d: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001d: error: EndFunctionBody callback failed\nout/test/spec/func.wast:638: assert_invalid passed:\n  out/test/spec/func/func.17.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/func.wast:642: assert_invalid passed:\n  out/test/spec/func/func.18.wasm:000001e: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/func.wast:650: assert_invalid passed:\n  out/test/spec/func/func.19.wasm:000001c: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/func.wast:654: assert_invalid passed:\n  out/test/spec/func/func.20.wasm:000001b: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/func.wast:658: assert_invalid passed:\n  out/test/spec/func/func.21.wasm:000001c: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/func.wast:666: assert_invalid passed:\n  out/test/spec/func/func.22.wasm:0000019: error: type mismatch in implicit return, expected [i32] but got []\n  0000019: error: EndFunctionBody callback failed\nout/test/spec/func.wast:670: assert_invalid passed:\n  out/test/spec/func/func.23.wasm:0000019: error: type mismatch in implicit return, expected [i64] but got []\n  0000019: error: EndFunctionBody callback failed\nout/test/spec/func.wast:674: assert_invalid passed:\n  out/test/spec/func/func.24.wasm:0000019: error: type mismatch in implicit return, expected [f32] but got []\n  0000019: error: EndFunctionBody callback failed\nout/test/spec/func.wast:678: assert_invalid passed:\n  out/test/spec/func/func.25.wasm:0000019: error: type mismatch in implicit return, expected [f64] but got []\n  0000019: error: EndFunctionBody callback failed\nout/test/spec/func.wast:682: assert_invalid passed:\n  out/test/spec/func/func.26.wasm:000001a: error: type mismatch in implicit return, expected [f64, i32] but got []\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/func.wast:687: assert_invalid passed:\n  out/test/spec/func/func.27.wasm:000001a: error: type mismatch in implicit return, expected [i32] but got []\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/func.wast:693: assert_invalid passed:\n  out/test/spec/func/func.28.wasm:000001b: error: type mismatch in implicit return, expected [i32, i32] but got []\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/func.wast:699: assert_invalid passed:\n  out/test/spec/func/func.29.wasm:000001a: error: type mismatch at end of function, expected [] but got [i32]\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/func.wast:705: assert_invalid passed:\n  out/test/spec/func/func.30.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32, i64]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/func.wast:711: assert_invalid passed:\n  out/test/spec/func/func.31.wasm:000001e: error: type mismatch in implicit return, expected [i32] but got [f32]\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/func.wast:717: assert_invalid passed:\n  out/test/spec/func/func.32.wasm:000001f: error: type mismatch in implicit return, expected [f32, f32] but got [f32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/func.wast:723: assert_invalid passed:\n  out/test/spec/func/func.33.wasm:0000023: error: type mismatch at end of function, expected [] but got [f32]\n  0000023: error: EndFunctionBody callback failed\nout/test/spec/func.wast:730: assert_invalid passed:\n  out/test/spec/func/func.34.wasm:0000019: error: type mismatch in return, expected [i32] but got []\n  0000019: error: OnReturnExpr callback failed\nout/test/spec/func.wast:736: assert_invalid passed:\n  out/test/spec/func/func.35.wasm:000001a: error: type mismatch in return, expected [i32, i32] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/func.wast:742: assert_invalid passed:\n  out/test/spec/func/func.36.wasm:000001a: error: type mismatch in return, expected [i32] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/func.wast:748: assert_invalid passed:\n  out/test/spec/func/func.37.wasm:000001b: error: type mismatch in return, expected [i32, i64] but got []\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/func.wast:754: assert_invalid passed:\n  out/test/spec/func/func.38.wasm:000001b: error: type mismatch in return, expected [i32] but got [i64]\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/func.wast:760: assert_invalid passed:\n  out/test/spec/func/func.39.wasm:000001c: error: type mismatch in return, expected [i64, i64] but got [i64]\n  000001c: error: OnReturnExpr callback failed\nout/test/spec/func.wast:767: assert_invalid passed:\n  out/test/spec/func/func.40.wasm:0000019: error: type mismatch in return, expected [i32] but got []\n  0000019: error: OnReturnExpr callback failed\nout/test/spec/func.wast:773: assert_invalid passed:\n  out/test/spec/func/func.41.wasm:000001a: error: type mismatch in return, expected [i32, i32] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/func.wast:779: assert_invalid passed:\n  out/test/spec/func/func.42.wasm:000001c: error: type mismatch in return, expected [i32, i32] but got [i32]\n  000001c: error: OnReturnExpr callback failed\nout/test/spec/func.wast:785: assert_invalid passed:\n  out/test/spec/func/func.43.wasm:000001a: error: type mismatch in return, expected [i32] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/func.wast:791: assert_invalid passed:\n  out/test/spec/func/func.44.wasm:000001b: error: type mismatch in return, expected [i32, i32] but got []\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/func.wast:797: assert_invalid passed:\n  out/test/spec/func/func.45.wasm:000001b: error: type mismatch in return, expected [i32] but got [i64]\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/func.wast:803: assert_invalid passed:\n  out/test/spec/func/func.46.wasm:000001c: error: type mismatch in return, expected [i32, i32] but got [i64]\n  000001c: error: OnReturnExpr callback failed\nout/test/spec/func.wast:809: assert_invalid passed:\n  out/test/spec/func/func.47.wasm:000001b: error: type mismatch in return, expected [i32] but got [i64]\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/func.wast:815: assert_invalid passed:\n  out/test/spec/func/func.48.wasm:000001c: error: type mismatch in return, expected [i32, i32] but got [i32]\n  000001c: error: OnReturnExpr callback failed\nout/test/spec/func.wast:822: assert_invalid passed:\n  out/test/spec/func/func.49.wasm:000001a: error: type mismatch in br, expected [i32] but got []\n  000001a: error: OnBrExpr callback failed\nout/test/spec/func.wast:828: assert_invalid passed:\n  out/test/spec/func/func.50.wasm:000001b: error: type mismatch in br, expected [i32, i32] but got []\n  000001b: error: OnBrExpr callback failed\nout/test/spec/func.wast:834: assert_invalid passed:\n  out/test/spec/func/func.51.wasm:000001f: error: type mismatch in br, expected [i32] but got [f32]\n  000001f: error: OnBrExpr callback failed\nout/test/spec/func.wast:840: assert_invalid passed:\n  out/test/spec/func/func.52.wasm:000001d: error: type mismatch in br, expected [i32, i32] but got [i32]\n  000001d: error: OnBrExpr callback failed\nout/test/spec/func.wast:846: assert_invalid passed:\n  out/test/spec/func/func.53.wasm:000001a: error: type mismatch in br, expected [i32] but got []\n  000001a: error: OnBrExpr callback failed\nout/test/spec/func.wast:852: assert_invalid passed:\n  out/test/spec/func/func.54.wasm:000001b: error: type mismatch in br, expected [i32, i32] but got []\n  000001b: error: OnBrExpr callback failed\nout/test/spec/func.wast:858: assert_invalid passed:\n  out/test/spec/func/func.55.wasm:000001c: error: type mismatch in br, expected [i32] but got [i64]\n  000001c: error: OnBrExpr callback failed\nout/test/spec/func.wast:864: assert_invalid passed:\n  out/test/spec/func/func.56.wasm:000001d: error: type mismatch in br, expected [i32, i32] but got [i32]\n  000001d: error: OnBrExpr callback failed\nout/test/spec/func.wast:870: assert_invalid passed:\n  out/test/spec/func/func.57.wasm:000001c: error: type mismatch in br, expected [i32] but got [i64]\n  000001c: error: OnBrExpr callback failed\nout/test/spec/func.wast:877: assert_invalid passed:\n  out/test/spec/func/func.58.wasm:000001c: error: type mismatch in br, expected [i32] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/func.wast:883: assert_invalid passed:\n  out/test/spec/func/func.59.wasm:000001d: error: type mismatch in br, expected [i32, i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/func.wast:889: assert_invalid passed:\n  out/test/spec/func/func.60.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/func.wast:895: assert_invalid passed:\n  out/test/spec/func/func.61.wasm:000001e: error: type mismatch in br, expected [i32, i32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/func.wast:901: assert_invalid passed:\n  out/test/spec/func/func.62.wasm:000001e: error: type mismatch in br, expected [i32] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/func.wast:907: assert_invalid passed:\n  out/test/spec/func/func.63.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got [i32]\n  000001f: error: OnBrExpr callback failed\nout/test/spec/func.wast:917: assert_malformed passed:\n  out/test/spec/func/func.64.wat:1:14: error: unexpected token \"local\", expected an instr.\n  (func (nop) (local i32))\n               ^^^^^\nout/test/spec/func.wast:921: assert_malformed passed:\n  out/test/spec/func/func.65.wat:1:14: error: unexpected token \"param\", expected an instr.\n  (func (nop) (param i32))\n               ^^^^^\nout/test/spec/func.wast:925: assert_malformed passed:\n  out/test/spec/func/func.66.wat:1:14: error: unexpected token \"result\", expected an instr.\n  (func (nop) (result i32))\n               ^^^^^^\nout/test/spec/func.wast:929: assert_malformed passed:\n  out/test/spec/func/func.67.wat:1:20: error: unexpected token \"param\", expected an instr.\n  (func (local i32) (param i32))\n                     ^^^^^\nout/test/spec/func.wast:933: assert_malformed passed:\n  out/test/spec/func/func.68.wat:1:20: error: unexpected token \"result\", expected an instr.\n  (func (local i32) (result i32) (local.get 0))\n                     ^^^^^^\nout/test/spec/func.wast:937: assert_malformed passed:\n  out/test/spec/func/func.69.wat:1:21: error: unexpected token \"param\", expected an instr.\n  (func (result i32) (param i32) (local.get 0))\n                      ^^^^^\nout/test/spec/func.wast:943: assert_malformed passed:\n  out/test/spec/func/func.70.wat:1:13: error: redefinition of function \"$foo\"\n  (func $foo)(func $foo)\n              ^^^^\nout/test/spec/func.wast:947: assert_malformed passed:\n  out/test/spec/func/func.71.wat:1:28: error: redefinition of function \"$foo\"\n  (import \"\" \"\" (func $foo))(func $foo)\n                             ^^^^\nout/test/spec/func.wast:951: assert_malformed passed:\n  out/test/spec/func/func.72.wat:1:28: error: redefinition of function \"$foo\"\n  (import \"\" \"\" (func $foo))(import \"\" \"\" (func $foo))\n                             ^^^^^^\nout/test/spec/func.wast:956: assert_malformed passed:\n  out/test/spec/func/func.73.wat:1:31: error: redefinition of parameter \"$foo\"\n  (func (param $foo i32) (param $foo i32))\n                                ^^^^\nout/test/spec/func.wast:958: assert_malformed passed:\n  out/test/spec/func/func.74.wat:1:31: error: redefinition of parameter \"$foo\"\n  (func (param $foo i32) (local $foo i32))\n                                ^^^^\nout/test/spec/func.wast:960: assert_malformed passed:\n  out/test/spec/func/func.75.wat:1:31: error: redefinition of local \"$foo\"\n  (func (local $foo i32) (local $foo i32))\n                                ^^^^\n172/172 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/func_ptrs.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/func_ptrs.wast\n(;; STDOUT ;;;\ncalled host spectest.print_i32(i32:83) =>\nfour(i32:83) =>\nout/test/spec/func_ptrs.wast:32: assert_invalid passed:\n  out/test/spec/func_ptrs/func_ptrs.1.wasm:000000c: error: table variable out of range: 0 (max 0)\n  000000c: error: BeginElemSegment callback failed\nout/test/spec/func_ptrs.wast:33: assert_invalid passed:\n  out/test/spec/func_ptrs/func_ptrs.2.wasm:0000016: error: table variable out of range: 0 (max 0)\n  0000016: error: BeginElemSegment callback failed\nout/test/spec/func_ptrs.wast:36: assert_invalid passed:\n  out/test/spec/func_ptrs/func_ptrs.3.wasm:0000014: error: type mismatch in initializer expression, expected [i32] but got [i64]\n  0000015: error: EndElemSegmentInitExpr callback failed\nout/test/spec/func_ptrs.wast:40: assert_invalid passed:\n  out/test/spec/func_ptrs/func_ptrs.4.wasm:0000015: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000015: error: OnUnaryExpr callback failed\nout/test/spec/func_ptrs.wast:44: assert_invalid passed:\n  out/test/spec/func_ptrs/func_ptrs.5.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000013: error: OnNopExpr callback failed\nout/test/spec/func_ptrs.wast:48: assert_invalid passed:\n  out/test/spec/func_ptrs/func_ptrs.6.wasm:000000c: error: function type variable out of range: 42 (max 0)\n  000000c: error: OnFunction callback failed\nout/test/spec/func_ptrs.wast:49: assert_invalid passed:\n  out/test/spec/func_ptrs/func_ptrs.7.wasm:0000020: error: function type variable out of range: 43 (max 0)\n  0000020: error: OnImportFunc callback failed\nout/test/spec/func_ptrs.wast:78: assert_trap passed: undefined table index\nout/test/spec/func_ptrs.wast:79: assert_trap passed: undefined table index\nout/test/spec/func_ptrs.wast:80: assert_trap passed: undefined table index\nout/test/spec/func_ptrs.wast:89: assert_trap passed: undefined table index\nout/test/spec/func_ptrs.wast:90: assert_trap passed: undefined table index\nout/test/spec/func_ptrs.wast:91: assert_trap passed: undefined table index\n36/36 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/binary.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/binary.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/binary.wast:6: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/function-references/binary.wast:7: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/function-references/binary.wast:8: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/function-references/binary.wast:9: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:10: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:11: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:12: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:13: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:14: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:15: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:16: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:17: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:18: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:21: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:24: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:25: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:28: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:31: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:34: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/function-references/binary.wast:37: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/function-references/binary.wast:38: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/function-references/binary.wast:39: assert_malformed passed:\n  0000006: error: unable to read uint16_t: layer\nout/test/spec/function-references/binary.wast:40: assert_malformed passed:\n  0000008: error: bad wasm file version: 0 (expected 0x1)\nout/test/spec/function-references/binary.wast:41: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xd (expected 0x1)\nout/test/spec/function-references/binary.wast:42: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xe (expected 0x1)\nout/test/spec/function-references/binary.wast:43: assert_malformed passed:\n  0000008: error: bad wasm file version: 0x100 (expected 0x1)\nout/test/spec/function-references/binary.wast:44: assert_malformed passed:\n  0000008: error: wasm components are not yet supported in this tool\nout/test/spec/function-references/binary.wast:45: assert_malformed passed:\n  0000008: error: unsupported wasm layer: 0x100\nout/test/spec/function-references/binary.wast:48: assert_malformed passed:\n  000000a: error: invalid section code: 14\nout/test/spec/function-references/binary.wast:49: assert_malformed passed:\n  000000a: error: invalid section code: 127\nout/test/spec/function-references/binary.wast:50: assert_malformed passed:\n  000000a: error: invalid section code: 128\nout/test/spec/function-references/binary.wast:51: assert_malformed passed:\n  000000a: error: invalid section code: 129\nout/test/spec/function-references/binary.wast:52: assert_malformed passed:\n  000000a: error: invalid section code: 255\nout/test/spec/function-references/binary.wast:56: assert_malformed passed:\n  000001b: error: function body must end with END opcode\nout/test/spec/function-references/binary.wast:77: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/function-references/binary.wast:93: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/function-references/binary.wast:113: assert_malformed passed:\n  0000019: error: init expression must end with END opcode\nout/test/spec/function-references/binary.wast:126: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/function-references/binary.wast:146: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/function-references/binary.wast:166: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/function-references/binary.wast:185: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/function-references/binary.wast:204: assert_malformed passed:\n  0000020: error: memory.grow reserved value must be 0\nout/test/spec/function-references/binary.wast:224: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/function-references/binary.wast:243: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/function-references/binary.wast:262: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/function-references/binary.wast:280: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/function-references/binary.wast:298: assert_malformed passed:\n  000001e: error: memory.size reserved value must be 0\nout/test/spec/function-references/binary.wast:317: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/function-references/binary.wast:334: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/function-references/binary.wast:351: assert_malformed passed:\n  000001e: error: local count must be <= 0xffffffff\nout/test/spec/function-references/binary.wast:367: assert_malformed passed:\n  0000030: error: local count must be <= 0xffffffff\nout/test/spec/function-references/binary.wast:401: assert_malformed passed:\n  0000013: error: function signature count != function body count\nout/test/spec/function-references/binary.wast:411: assert_malformed passed:\n  000000b: error: function signature count != function body count\nout/test/spec/function-references/binary.wast:420: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/function-references/binary.wast:431: assert_malformed passed:\n  0000015: error: function signature count != function body count\nout/test/spec/function-references/binary.wast:454: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/function-references/binary.wast:466: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/function-references/binary.wast:478: assert_malformed passed:\n  0000010: error: Data section missing but DataCount non-zero\nout/test/spec/function-references/binary.wast:494: assert_malformed passed:\n  0000024: error: memory.init requires data count section\nout/test/spec/function-references/binary.wast:517: assert_malformed passed:\n  000001e: error: data.drop requires data count section\nout/test/spec/function-references/binary.wast:537: assert_malformed passed:\n  0000024: error: unexpected opcode: 0xf3\nout/test/spec/function-references/binary.wast:565: assert_malformed passed:\n  0000022: error: table elem type must be a reference type\nout/test/spec/function-references/binary.wast:650: assert_malformed passed:\n  000000a: error: invalid section size: extends past end\nout/test/spec/function-references/binary.wast:661: assert_malformed passed:\n  000000e: error: unfinished section (expected end: 0x11)\nout/test/spec/function-references/binary.wast:680: assert_malformed passed:\n  000000e: error: invalid import tag kind: exceptions not allowed\nout/test/spec/function-references/binary.wast:690: assert_malformed passed:\n  000000e: error: invalid import tag kind: exceptions not allowed\nout/test/spec/function-references/binary.wast:701: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/function-references/binary.wast:711: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/function-references/binary.wast:722: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/function-references/binary.wast:732: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/function-references/binary.wast:745: assert_malformed passed:\n  0000027: error: unable to read u32 leb128: string length\nout/test/spec/function-references/binary.wast:764: assert_malformed passed:\n  000002b: error: unfinished section (expected end: 0x40)\nout/test/spec/function-references/binary.wast:795: assert_malformed passed:\n  000000b: error: invalid table count 1, only 0 bytes left in section\nout/test/spec/function-references/binary.wast:805: assert_malformed passed:\n  000000d: error: tables may not be shared\nout/test/spec/function-references/binary.wast:814: assert_malformed passed:\n  000000d: error: tables may not be shared\nout/test/spec/function-references/binary.wast:824: assert_malformed passed:\n  000000d: error: malformed table limits flag: 129\nout/test/spec/function-references/binary.wast:842: assert_malformed passed:\n  000000b: error: invalid memory count 1, only 0 bytes left in section\nout/test/spec/function-references/binary.wast:852: assert_malformed passed:\n  000000c: error: memory may not be shared: threads not allowed\nout/test/spec/function-references/binary.wast:860: assert_malformed passed:\n  000000c: error: memory may not be shared: threads not allowed\nout/test/spec/function-references/binary.wast:869: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/function-references/binary.wast:878: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/function-references/binary.wast:895: assert_malformed passed:\n  0000010: error: unable to read i32 leb128: global type\nout/test/spec/function-references/binary.wast:906: assert_malformed passed:\n  0000010: error: unfinished section (expected end: 0x15)\nout/test/spec/function-references/binary.wast:929: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/function-references/binary.wast:950: assert_malformed passed:\n  000001b: error: unfinished section (expected end: 0x20)\nout/test/spec/function-references/binary.wast:984: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: elem segment flags\nout/test/spec/function-references/binary.wast:1000: assert_malformed passed:\n  0000024: error: init expression must end with END opcode\nout/test/spec/function-references/binary.wast:1017: assert_malformed passed:\n  0000021: error: unfinished section (expected end: 0x27)\nout/test/spec/function-references/binary.wast:1043: assert_malformed passed:\n  0000016: error: unable to read u32 leb128: data segment flags\nout/test/spec/function-references/binary.wast:1056: assert_malformed passed:\n  0000016: error: unfinished section (expected end: 0x1c)\nout/test/spec/function-references/binary.wast:1069: assert_malformed passed:\n  0000015: error: unable to read data: data segment data\nout/test/spec/function-references/binary.wast:1083: assert_malformed passed:\n  000001a: error: unfinished section (expected end: 0x1b)\nout/test/spec/function-references/binary.wast:1114: assert_malformed passed:\n  0000048: error: function body must end with END opcode\nout/test/spec/function-references/binary.wast:1161: assert_malformed passed:\n  0000017: error: multiple Start sections\nout/test/spec/function-references/binary.wast:1178: assert_malformed passed:\n  0000014: error: multiple Function sections\nout/test/spec/function-references/binary.wast:1190: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/function-references/binary.wast:1202: assert_malformed passed:\n  000000d: error: multiple DataCount sections\nout/test/spec/function-references/binary.wast:1212: assert_malformed passed:\n  000000d: error: multiple Data sections\nout/test/spec/function-references/binary.wast:1222: assert_malformed passed:\n  000000d: error: multiple Global sections\nout/test/spec/function-references/binary.wast:1232: assert_malformed passed:\n  000000d: error: multiple Export sections\nout/test/spec/function-references/binary.wast:1242: assert_malformed passed:\n  000000d: error: multiple Table sections\nout/test/spec/function-references/binary.wast:1252: assert_malformed passed:\n  000000d: error: multiple Elem sections\nout/test/spec/function-references/binary.wast:1262: assert_malformed passed:\n  000000d: error: multiple Import sections\nout/test/spec/function-references/binary.wast:1272: assert_malformed passed:\n  000000d: error: multiple Type sections\nout/test/spec/function-references/binary.wast:1282: assert_malformed passed:\n  000000d: error: multiple Memory sections\nout/test/spec/function-references/binary.wast:1292: assert_malformed passed:\n  000000d: error: section Type out of order\nout/test/spec/function-references/binary.wast:1302: assert_malformed passed:\n  000000d: error: section Import out of order\nout/test/spec/function-references/binary.wast:1312: assert_malformed passed:\n  000000d: error: section Function out of order\nout/test/spec/function-references/binary.wast:1322: assert_malformed passed:\n  000000d: error: section Table out of order\nout/test/spec/function-references/binary.wast:1332: assert_malformed passed:\n  000000d: error: section Memory out of order\nout/test/spec/function-references/binary.wast:1342: assert_malformed passed:\n  000000d: error: section Global out of order\nout/test/spec/function-references/binary.wast:1352: assert_malformed passed:\n  0000011: error: section Export out of order\nout/test/spec/function-references/binary.wast:1363: assert_malformed passed:\n  0000011: error: section Start out of order\nout/test/spec/function-references/binary.wast:1374: assert_malformed passed:\n  000000d: error: section Elem out of order\nout/test/spec/function-references/binary.wast:1384: assert_malformed passed:\n  000000d: error: section DataCount out of order\nout/test/spec/function-references/binary.wast:1394: assert_malformed passed:\n  000000d: error: section Code out of order\n136/136 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/br_on_non_null.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/br_on_non_null.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/br_on_non_null.wast:37: assert_trap passed: unreachable executed\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/br_on_null.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/br_on_null.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/br_on_null.wast:32: assert_trap passed: unreachable executed\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/br_table.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/br_table.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/br_table.wast:1267: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.1.wasm:0000022: error: type mismatch at end of block, expected [] but got [i32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/br_table.wast:1274: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.2.wasm:000001d: error: type mismatch in br_table, expected [i32] but got []\n  000001d: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1281: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.3.wasm:0000020: error: type mismatch in br_table, expected [i32] but got []\n  0000020: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1287: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.4.wasm:0000023: error: type mismatch in br_table, expected [i32] but got [i64]\n  0000023: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1295: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.5.wasm:0000026: error: br_table labels have inconsistent types: expected [f32], got []\n  0000026: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1306: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.6.wasm:0000023: error: type mismatch in br_table, expected [i64] but got [i32]\n  0000023: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1317: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.7.wasm:000001f: error: type mismatch in br_table, expected [i32] but got []\n  000001f: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1323: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.8.wasm:000001e: error: type mismatch in br_table, expected [i32] but got [i64]\n  000001e: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1329: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.9.wasm:0000021: error: type mismatch in br_table, expected [i32] but got []\n  0000021: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1335: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.10.wasm:0000023: error: type mismatch in br_table, expected [i32] but got []\n  0000023: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1341: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.11.wasm:0000022: error: type mismatch in br_table, expected [i32] but got [... i64]\n  0000022: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1350: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.12.wasm:0000022: error: type mismatch at end of block, expected [] but got [i32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/br_table.wast:1357: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.13.wasm:0000022: error: type mismatch in br_table, expected [i32] but got []\n  0000022: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1369: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.14.wasm:0000024: error: type mismatch in br_table, expected [i32] but got []\n  0000024: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1381: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.15.wasm:000001c: error: type mismatch in br_table, expected [i32] but got []\n  000001c: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1392: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.16.wasm:000001e: error: type mismatch in br_table, expected [i32] but got []\n  000001e: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1404: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.17.wasm:0000025: error: br_table labels have inconsistent types: expected [i32], got []\n  0000025: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1416: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.18.wasm:0000025: error: br_table labels have inconsistent types: expected [], got [i32]\n  0000025: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1430: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.19.wasm:000001f: error: invalid depth: 2 (max 1)\n  000001f: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1436: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.20.wasm:0000021: error: invalid depth: 5 (max 2)\n  0000021: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1442: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.21.wasm:0000024: error: invalid depth: 268435457 (max 1)\n  0000024: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1449: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.22.wasm:000001f: error: invalid depth: 2 (max 1)\n  000001f: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1455: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.23.wasm:0000021: error: invalid depth: 5 (max 2)\n  0000021: error: OnBrTableExpr callback failed\nout/test/spec/function-references/br_table.wast:1461: assert_invalid passed:\n  out/test/spec/function-references/br_table/br_table.24.wasm:0000024: error: invalid depth: 268435457 (max 1)\n  0000024: error: OnBrTableExpr callback failed\n186/186 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/call_ref.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/call_ref.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/call_ref.wast:97: assert_trap passed: null function reference\nout/test/spec/function-references/call_ref.wast:136: assert_trap passed: unreachable executed\nout/test/spec/function-references/call_ref.wast:149: assert_trap passed: unreachable executed\nout/test/spec/function-references/call_ref.wast:165: assert_trap passed: unreachable executed\nout/test/spec/function-references/call_ref.wast:168: assert_invalid passed:\n  out/test/spec/function-references/call_ref/call_ref.4.wasm:0000042: error: type mismatch in call_ref, expected [i32] but got [i64]\n  0000042: error: OnCallRefExpr callback failed\nout/test/spec/function-references/call_ref.wast:184: assert_invalid passed:\n  out/test/spec/function-references/call_ref/call_ref.5.wasm:0000044: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000044: error: EndFunctionBody callback failed\nout/test/spec/function-references/call_ref.wast:201: assert_invalid passed:\n  out/test/spec/function-references/call_ref/call_ref.6.wasm:000001f: error: type mismatch in call_ref, expected [(ref null 0)] but got [externref]\n  000001f: error: OnCallRefExpr callback failed\n34/34 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/data.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/data.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/data.wast:290: assert_invalid passed:\n  out/test/spec/function-references/data/data.39.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/function-references/data.wast:298: assert_invalid passed:\n  out/test/spec/function-references/data/data.40.wasm:0000012: error: memory variable out of range: 1 (max 1)\n  0000012: error: BeginDataSegment callback failed\nout/test/spec/function-references/data.wast:311: assert_invalid passed:\n  out/test/spec/function-references/data/data.41.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/function-references/data.wast:322: assert_invalid passed:\n  out/test/spec/function-references/data/data.42.wasm:000000d: error: memory variable out of range: 1 (max 0)\n  000000d: error: BeginDataSegment callback failed\nout/test/spec/function-references/data.wast:334: assert_invalid passed:\n  out/test/spec/function-references/data/data.43.wasm:0000012: error: memory variable out of range: 1 (max 1)\n  0000012: error: BeginDataSegment callback failed\nout/test/spec/function-references/data.wast:356: assert_invalid passed:\n  out/test/spec/function-references/data/data.44.wasm:000000d: error: memory variable out of range: 1 (max 0)\n  000000d: error: BeginDataSegment callback failed\nout/test/spec/function-references/data.wast:375: assert_invalid passed:\n  out/test/spec/function-references/data/data.45.wasm:0000013: error: type mismatch in initializer expression, expected [i32] but got [i64]\n  0000014: error: EndDataSegmentInitExpr callback failed\nout/test/spec/function-references/data.wast:383: assert_invalid passed:\n  out/test/spec/function-references/data/data.46.wasm:0000013: error: type mismatch in initializer expression, expected [i32] but got [funcref]\n  0000014: error: EndDataSegmentInitExpr callback failed\nout/test/spec/function-references/data.wast:391: assert_invalid passed:\n  out/test/spec/function-references/data/data.47.wasm:0000011: error: type mismatch in initializer expression, expected [i32] but got []\n  0000012: error: EndDataSegmentInitExpr callback failed\nout/test/spec/function-references/data.wast:399: assert_invalid passed:\n  out/test/spec/function-references/data/data.48.wasm:0000015: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000016: error: EndDataSegmentInitExpr callback failed\nout/test/spec/function-references/data.wast:407: assert_invalid passed:\n  out/test/spec/function-references/data/data.49.wasm:000002b: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002c: error: EndDataSegmentInitExpr callback failed\nout/test/spec/function-references/data.wast:416: assert_invalid passed:\n  out/test/spec/function-references/data/data.50.wasm:000002b: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002c: error: EndDataSegmentInitExpr callback failed\nout/test/spec/function-references/data.wast:425: assert_invalid passed:\n  out/test/spec/function-references/data/data.51.wasm:0000014: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000014: error: OnUnaryExpr callback failed\nout/test/spec/function-references/data.wast:433: assert_invalid passed:\n  out/test/spec/function-references/data/data.52.wasm:0000012: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000012: error: OnNopExpr callback failed\nout/test/spec/function-references/data.wast:441: assert_invalid passed:\n  out/test/spec/function-references/data/data.53.wasm:0000012: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000012: error: OnNopExpr callback failed\nout/test/spec/function-references/data.wast:449: assert_invalid passed:\n  out/test/spec/function-references/data/data.54.wasm:0000014: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000014: error: OnNopExpr callback failed\nout/test/spec/function-references/data.wast:457: assert_invalid passed:\n  out/test/spec/function-references/data/data.55.wasm:0000020: error: initializer expression cannot reference a mutable global\n  0000020: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/data.wast:466: assert_invalid passed:\n  out/test/spec/function-references/data/data.56.wasm:0000013: error: global variable out of range: 0 (max 0)\n  0000013: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/data.wast:474: assert_invalid passed:\n  out/test/spec/function-references/data/data.57.wasm:0000029: error: global variable out of range: 1 (max 1)\n  0000029: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/data.wast:483: assert_invalid passed:\n  out/test/spec/function-references/data/data.58.wasm:000002d: error: initializer expression cannot reference a mutable global\n  000002d: error: OnGlobalGetExpr callback failed\n59/59 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/elem.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/elem.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/elem.wast:508: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.53.wasm:0000025: error: type mismatch at elem segment. got funcref, expected (ref func)\n  0000025: error: OnElemSegmentElemType callback failed\nout/test/spec/function-references/elem.wast:516: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.54.wasm:0000025: error: type mismatch at elem segment. got funcref, expected (ref func)\n  0000025: error: OnElemSegmentElemType callback failed\nout/test/spec/function-references/elem.wast:697: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/function-references/elem.wast:707: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/function-references/elem.wast:713: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.75.wasm:0000016: error: table variable out of range: 0 (max 0)\n  0000016: error: BeginElemSegment callback failed\nout/test/spec/function-references/elem.wast:724: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.76.wasm:0000014: error: type mismatch in initializer expression, expected [i32] but got [i64]\n  0000015: error: EndElemSegmentInitExpr callback failed\nout/test/spec/function-references/elem.wast:732: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.77.wasm:0000014: error: type mismatch in initializer expression, expected [i32] but got [funcref]\n  0000015: error: EndElemSegmentInitExpr callback failed\nout/test/spec/function-references/elem.wast:740: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.78.wasm:0000012: error: type mismatch in initializer expression, expected [i32] but got []\n  0000013: error: EndElemSegmentInitExpr callback failed\nout/test/spec/function-references/elem.wast:748: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.79.wasm:0000016: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000017: error: EndElemSegmentInitExpr callback failed\nout/test/spec/function-references/elem.wast:756: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.80.wasm:000002c: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002d: error: EndElemSegmentInitExpr callback failed\nout/test/spec/function-references/elem.wast:765: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.81.wasm:000002c: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002d: error: EndElemSegmentInitExpr callback failed\nout/test/spec/function-references/elem.wast:775: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.82.wasm:0000015: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000015: error: OnUnaryExpr callback failed\nout/test/spec/function-references/elem.wast:783: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.83.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000013: error: OnNopExpr callback failed\nout/test/spec/function-references/elem.wast:791: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.84.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000013: error: OnNopExpr callback failed\nout/test/spec/function-references/elem.wast:799: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.85.wasm:0000015: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000015: error: OnNopExpr callback failed\nout/test/spec/function-references/elem.wast:807: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.86.wasm:0000021: error: initializer expression cannot reference a mutable global\n  0000021: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/elem.wast:816: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.87.wasm:0000014: error: global variable out of range: 0 (max 0)\n  0000014: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/elem.wast:824: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.88.wasm:000002a: error: global variable out of range: 1 (max 1)\n  000002a: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/elem.wast:833: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.89.wasm:000002e: error: initializer expression cannot reference a mutable global\n  000002e: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/elem.wast:845: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.90.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [externref]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/function-references/elem.wast:853: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.91.wasm:000001a: error: type mismatch at end of initializer expression, expected [] but got [funcref]\n  000001b: error: EndElemExpr callback failed\nout/test/spec/function-references/elem.wast:861: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.92.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [i32]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/function-references/elem.wast:869: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.93.wasm:0000018: error: type mismatch in initializer expression, expected [funcref] but got [i32]\n  0000019: error: EndElemExpr callback failed\nout/test/spec/function-references/elem.wast:877: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.94.wasm:0000023: error: invalid initializer: instruction not valid in initializer expression: call\n  0000023: error: OnCallExpr callback failed\nout/test/spec/function-references/elem.wast:886: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.95.wasm:000001b: error: invalid initializer: instruction not valid in initializer expression: i32.add\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/function-references/elem.wast:945: assert_trap passed: uninitialized table element\nout/test/spec/function-references/elem.wast:978: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.101.wasm:000001f: error: type mismatch at elem segment. got (ref func), expected externref\n  000001f: error: OnElemSegmentElemType callback failed\nout/test/spec/function-references/elem.wast:983: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.102.wasm:0000017: error: type mismatch at elem segment. got externref, expected funcref\n  0000017: error: OnElemSegmentElemType callback failed\nout/test/spec/function-references/elem.wast:988: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.103.wasm:0000034: error: type mismatch at table.init. got funcref, expected externref\n  0000034: error: OnTableInitExpr callback failed\nout/test/spec/function-references/elem.wast:997: assert_invalid passed:\n  out/test/spec/function-references/elem/elem.104.wasm:0000030: error: type mismatch at table.init. got externref, expected funcref\n  0000030: error: OnTableInitExpr callback failed\n135/135 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/func.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/func.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/func.wast:436: assert_invalid passed:\n  out/test/spec/function-references/func/func.2.wasm:000001a: error: function type variable out of range: 2 (max 2)\n  000001a: error: OnFunction callback failed\nout/test/spec/function-references/func.wast:448: assert_malformed passed:\n  out/test/spec/function-references/func/func.3.wat:1:123: error: invalid func type index 2\n  ...lt f64) (f64.const 1))(type $t (func (param i32)))(func (type 2) (param i32))\n                                                        ^^^^\nout/test/spec/function-references/func.wast:560: assert_malformed passed:\n  out/test/spec/function-references/func/func.6.wat:1:76: error: unexpected token \"param\", expected an instr.\n  ... i32) (result i32)))(func (type $sig) (result i32) (param i32) (i32.const 0))\n                                                         ^^^^^\nout/test/spec/function-references/func.wast:567: assert_malformed passed:\n  out/test/spec/function-references/func/func.7.wat:1:63: error: unexpected token \"type\", expected an instr.\n  ... i32) (result i32)))(func (param i32) (type $sig) (result i32) (i32.const 0))\n                                            ^^^^\nout/test/spec/function-references/func.wast:574: assert_malformed passed:\n  out/test/spec/function-references/func/func.8.wat:1:76: error: unexpected token \"type\", expected an instr.\n  ... i32) (result i32)))(func (param i32) (result i32) (type $sig) (i32.const 0))\n                                                         ^^^^\nout/test/spec/function-references/func.wast:581: assert_malformed passed:\n  out/test/spec/function-references/func/func.9.wat:1:64: error: unexpected token \"type\", expected an instr.\n  ... i32) (result i32)))(func (result i32) (type $sig) (param i32) (i32.const 0))\n                                             ^^^^\nout/test/spec/function-references/func.wast:588: assert_malformed passed:\n  out/test/spec/function-references/func/func.10.wat:1:64: error: unexpected token \"param\", expected an instr.\n  ... i32) (result i32)))(func (result i32) (param i32) (type $sig) (i32.const 0))\n                                             ^^^^^\n  out/test/spec/function-references/func/func.10.wat:1:85: error: unexpected token ), expected (.\n  ... i32) (result i32)))(func (result i32) (param i32) (type $sig) (i32.const 0))\n                                                                  ^\nout/test/spec/function-references/func.wast:595: assert_malformed passed:\n  out/test/spec/function-references/func/func.11.wat:1:21: error: unexpected token \"param\", expected an instr.\n  (func (result i32) (param i32) (i32.const 0))\n                      ^^^^^\nout/test/spec/function-references/func.wast:602: assert_malformed passed:\n  out/test/spec/function-references/func/func.12.wat:1:20: error: expected 0 results, got 1\n  (type $sig (func))(func (type $sig) (result i32) (i32.const 0))\n                     ^^^^\nout/test/spec/function-references/func.wast:609: assert_malformed passed:\n  out/test/spec/function-references/func/func.13.wat:1:45: error: expected 1 arguments, got 0\n  ...g (func (param i32) (result i32)))(func (type $sig) (result i32) (i32.cons...\n                                        ^^^^\nout/test/spec/function-references/func.wast:616: assert_malformed passed:\n  out/test/spec/function-references/func/func.14.wat:1:45: error: expected 1 results, got 0\n  ...g (func (param i32) (result i32)))(func (type $sig) (param i32) (i32.const...\n                                        ^^^^\nout/test/spec/function-references/func.wast:623: assert_malformed passed:\n  out/test/spec/function-references/func/func.15.wat:1:49: error: expected 2 arguments, got 1\n  ...unc (param i32 i32) (result i32)))(func (type $sig) (param i32) (result i3...\n                                        ^^^^\nout/test/spec/function-references/func.wast:631: assert_invalid passed:\n  out/test/spec/function-references/func/func.16.wasm:000000c: error: function type variable out of range: 4 (max 0)\n  000000c: error: OnFunction callback failed\nout/test/spec/function-references/func.wast:635: assert_invalid passed:\n  out/test/spec/function-references/func/func.17.wasm:0000013: error: function type variable out of range: 4 (max 1)\n  0000013: error: OnFunction callback failed\nout/test/spec/function-references/func.wast:647: assert_invalid passed:\n  out/test/spec/function-references/func/func.18.wasm:000001d: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001d: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:651: assert_invalid passed:\n  out/test/spec/function-references/func/func.19.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/function-references/func.wast:655: assert_invalid passed:\n  out/test/spec/function-references/func/func.20.wasm:000001e: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/function-references/func.wast:660: assert_invalid passed:\n  out/test/spec/function-references/func/func.21.wasm:000001c: error: uninitialized local reference\n  000001c: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/func.wast:671: assert_invalid passed:\n  out/test/spec/function-references/func/func.22.wasm:000001c: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:675: assert_invalid passed:\n  out/test/spec/function-references/func/func.23.wasm:000001b: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/function-references/func.wast:679: assert_invalid passed:\n  out/test/spec/function-references/func/func.24.wasm:000001c: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/function-references/func.wast:687: assert_invalid passed:\n  out/test/spec/function-references/func/func.25.wasm:0000019: error: type mismatch in implicit return, expected [i32] but got []\n  0000019: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:691: assert_invalid passed:\n  out/test/spec/function-references/func/func.26.wasm:0000019: error: type mismatch in implicit return, expected [i64] but got []\n  0000019: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:695: assert_invalid passed:\n  out/test/spec/function-references/func/func.27.wasm:0000019: error: type mismatch in implicit return, expected [f32] but got []\n  0000019: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:699: assert_invalid passed:\n  out/test/spec/function-references/func/func.28.wasm:0000019: error: type mismatch in implicit return, expected [f64] but got []\n  0000019: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:703: assert_invalid passed:\n  out/test/spec/function-references/func/func.29.wasm:000001a: error: type mismatch in implicit return, expected [f64, i32] but got []\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:708: assert_invalid passed:\n  out/test/spec/function-references/func/func.30.wasm:000001a: error: type mismatch in implicit return, expected [i32] but got []\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:714: assert_invalid passed:\n  out/test/spec/function-references/func/func.31.wasm:000001b: error: type mismatch in implicit return, expected [i32, i32] but got []\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:720: assert_invalid passed:\n  out/test/spec/function-references/func/func.32.wasm:000001a: error: type mismatch at end of function, expected [] but got [i32]\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:726: assert_invalid passed:\n  out/test/spec/function-references/func/func.33.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32, i64]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:732: assert_invalid passed:\n  out/test/spec/function-references/func/func.34.wasm:000001e: error: type mismatch in implicit return, expected [i32] but got [f32]\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:738: assert_invalid passed:\n  out/test/spec/function-references/func/func.35.wasm:000001f: error: type mismatch in implicit return, expected [f32, f32] but got [f32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:744: assert_invalid passed:\n  out/test/spec/function-references/func/func.36.wasm:0000023: error: type mismatch at end of function, expected [] but got [f32]\n  0000023: error: EndFunctionBody callback failed\nout/test/spec/function-references/func.wast:751: assert_invalid passed:\n  out/test/spec/function-references/func/func.37.wasm:0000019: error: type mismatch in return, expected [i32] but got []\n  0000019: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:757: assert_invalid passed:\n  out/test/spec/function-references/func/func.38.wasm:000001a: error: type mismatch in return, expected [i32, i32] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:763: assert_invalid passed:\n  out/test/spec/function-references/func/func.39.wasm:000001a: error: type mismatch in return, expected [i32] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:769: assert_invalid passed:\n  out/test/spec/function-references/func/func.40.wasm:000001b: error: type mismatch in return, expected [i32, i64] but got []\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:775: assert_invalid passed:\n  out/test/spec/function-references/func/func.41.wasm:000001b: error: type mismatch in return, expected [i32] but got [i64]\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:781: assert_invalid passed:\n  out/test/spec/function-references/func/func.42.wasm:000001c: error: type mismatch in return, expected [i64, i64] but got [i64]\n  000001c: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:788: assert_invalid passed:\n  out/test/spec/function-references/func/func.43.wasm:0000019: error: type mismatch in return, expected [i32] but got []\n  0000019: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:794: assert_invalid passed:\n  out/test/spec/function-references/func/func.44.wasm:000001a: error: type mismatch in return, expected [i32, i32] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:800: assert_invalid passed:\n  out/test/spec/function-references/func/func.45.wasm:000001c: error: type mismatch in return, expected [i32, i32] but got [i32]\n  000001c: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:806: assert_invalid passed:\n  out/test/spec/function-references/func/func.46.wasm:000001a: error: type mismatch in return, expected [i32] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:812: assert_invalid passed:\n  out/test/spec/function-references/func/func.47.wasm:000001b: error: type mismatch in return, expected [i32, i32] but got []\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:818: assert_invalid passed:\n  out/test/spec/function-references/func/func.48.wasm:000001b: error: type mismatch in return, expected [i32] but got [i64]\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:824: assert_invalid passed:\n  out/test/spec/function-references/func/func.49.wasm:000001c: error: type mismatch in return, expected [i32, i32] but got [i64]\n  000001c: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:830: assert_invalid passed:\n  out/test/spec/function-references/func/func.50.wasm:000001b: error: type mismatch in return, expected [i32] but got [i64]\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:836: assert_invalid passed:\n  out/test/spec/function-references/func/func.51.wasm:000001c: error: type mismatch in return, expected [i32, i32] but got [i32]\n  000001c: error: OnReturnExpr callback failed\nout/test/spec/function-references/func.wast:843: assert_invalid passed:\n  out/test/spec/function-references/func/func.52.wasm:000001a: error: type mismatch in br, expected [i32] but got []\n  000001a: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:849: assert_invalid passed:\n  out/test/spec/function-references/func/func.53.wasm:000001b: error: type mismatch in br, expected [i32, i32] but got []\n  000001b: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:855: assert_invalid passed:\n  out/test/spec/function-references/func/func.54.wasm:000001f: error: type mismatch in br, expected [i32] but got [f32]\n  000001f: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:861: assert_invalid passed:\n  out/test/spec/function-references/func/func.55.wasm:000001d: error: type mismatch in br, expected [i32, i32] but got [i32]\n  000001d: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:867: assert_invalid passed:\n  out/test/spec/function-references/func/func.56.wasm:000001a: error: type mismatch in br, expected [i32] but got []\n  000001a: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:873: assert_invalid passed:\n  out/test/spec/function-references/func/func.57.wasm:000001b: error: type mismatch in br, expected [i32, i32] but got []\n  000001b: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:879: assert_invalid passed:\n  out/test/spec/function-references/func/func.58.wasm:000001c: error: type mismatch in br, expected [i32] but got [i64]\n  000001c: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:885: assert_invalid passed:\n  out/test/spec/function-references/func/func.59.wasm:000001d: error: type mismatch in br, expected [i32, i32] but got [i32]\n  000001d: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:891: assert_invalid passed:\n  out/test/spec/function-references/func/func.60.wasm:000001c: error: type mismatch in br, expected [i32] but got [i64]\n  000001c: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:898: assert_invalid passed:\n  out/test/spec/function-references/func/func.61.wasm:000001c: error: type mismatch in br, expected [i32] but got []\n  000001c: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:904: assert_invalid passed:\n  out/test/spec/function-references/func/func.62.wasm:000001d: error: type mismatch in br, expected [i32, i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:910: assert_invalid passed:\n  out/test/spec/function-references/func/func.63.wasm:000001d: error: type mismatch in br, expected [i32] but got []\n  000001d: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:916: assert_invalid passed:\n  out/test/spec/function-references/func/func.64.wasm:000001e: error: type mismatch in br, expected [i32, i32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:922: assert_invalid passed:\n  out/test/spec/function-references/func/func.65.wasm:000001e: error: type mismatch in br, expected [i32] but got [i64]\n  000001e: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:928: assert_invalid passed:\n  out/test/spec/function-references/func/func.66.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got [i32]\n  000001f: error: OnBrExpr callback failed\nout/test/spec/function-references/func.wast:938: assert_malformed passed:\n  out/test/spec/function-references/func/func.67.wat:1:14: error: unexpected token \"local\", expected an instr.\n  (func (nop) (local i32))\n               ^^^^^\nout/test/spec/function-references/func.wast:942: assert_malformed passed:\n  out/test/spec/function-references/func/func.68.wat:1:14: error: unexpected token \"param\", expected an instr.\n  (func (nop) (param i32))\n               ^^^^^\nout/test/spec/function-references/func.wast:946: assert_malformed passed:\n  out/test/spec/function-references/func/func.69.wat:1:14: error: unexpected token \"result\", expected an instr.\n  (func (nop) (result i32))\n               ^^^^^^\nout/test/spec/function-references/func.wast:950: assert_malformed passed:\n  out/test/spec/function-references/func/func.70.wat:1:20: error: unexpected token \"param\", expected an instr.\n  (func (local i32) (param i32))\n                     ^^^^^\nout/test/spec/function-references/func.wast:954: assert_malformed passed:\n  out/test/spec/function-references/func/func.71.wat:1:20: error: unexpected token \"result\", expected an instr.\n  (func (local i32) (result i32) (local.get 0))\n                     ^^^^^^\nout/test/spec/function-references/func.wast:958: assert_malformed passed:\n  out/test/spec/function-references/func/func.72.wat:1:21: error: unexpected token \"param\", expected an instr.\n  (func (result i32) (param i32) (local.get 0))\n                      ^^^^^\nout/test/spec/function-references/func.wast:965: assert_malformed passed:\n  out/test/spec/function-references/func/func.73.wat:1:13: error: redefinition of function \"$foo\"\n  (func $foo)(func $foo)\n              ^^^^\nout/test/spec/function-references/func.wast:969: assert_malformed passed:\n  out/test/spec/function-references/func/func.74.wat:1:28: error: redefinition of function \"$foo\"\n  (import \"\" \"\" (func $foo))(func $foo)\n                             ^^^^\nout/test/spec/function-references/func.wast:973: assert_malformed passed:\n  out/test/spec/function-references/func/func.75.wat:1:28: error: redefinition of function \"$foo\"\n  (import \"\" \"\" (func $foo))(import \"\" \"\" (func $foo))\n                             ^^^^^^\nout/test/spec/function-references/func.wast:978: assert_malformed passed:\n  out/test/spec/function-references/func/func.76.wat:1:31: error: redefinition of parameter \"$foo\"\n  (func (param $foo i32) (param $foo i32))\n                                ^^^^\nout/test/spec/function-references/func.wast:982: assert_malformed passed:\n  out/test/spec/function-references/func/func.77.wat:1:31: error: redefinition of parameter \"$foo\"\n  (func (param $foo i32) (local $foo i32))\n                                ^^^^\nout/test/spec/function-references/func.wast:986: assert_malformed passed:\n  out/test/spec/function-references/func/func.78.wat:1:31: error: redefinition of local \"$foo\"\n  (func (local $foo i32) (local $foo i32))\n                                ^^^^\n175/175 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/global.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/global.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/global.wast:251: assert_trap passed: undefined table index\nout/test/spec/function-references/global.wast:273: assert_invalid passed:\n  out/test/spec/function-references/global/global.1.wasm:0000029: error: can't global.set on immutable global at index 0.\n  0000029: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:278: assert_invalid passed:\n  out/test/spec/function-references/global/global.2.wasm:0000035: error: can't global.set on immutable global at index 0.\n  0000035: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:287: assert_invalid passed:\n  out/test/spec/function-references/global/global.5.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: f32.neg\n  0000013: error: OnUnaryExpr callback failed\nout/test/spec/function-references/global.wast:292: assert_invalid passed:\n  out/test/spec/function-references/global/global.6.wasm:000000f: error: invalid initializer: instruction not valid in initializer expression: local.get\n  000000f: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/global.wast:297: assert_invalid passed:\n  out/test/spec/function-references/global/global.7.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: f32.neg\n  0000013: error: OnUnaryExpr callback failed\nout/test/spec/function-references/global.wast:302: assert_invalid passed:\n  out/test/spec/function-references/global/global.8.wasm:0000010: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000010: error: OnNopExpr callback failed\nout/test/spec/function-references/global.wast:307: assert_invalid passed:\n  out/test/spec/function-references/global/global.9.wasm:0000010: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000010: error: OnUnaryExpr callback failed\nout/test/spec/function-references/global.wast:312: assert_invalid passed:\n  out/test/spec/function-references/global/global.10.wasm:000000e: error: invalid initializer: instruction not valid in initializer expression: nop\n  000000e: error: OnNopExpr callback failed\nout/test/spec/function-references/global.wast:317: assert_invalid passed:\n  out/test/spec/function-references/global/global.11.wasm:0000012: error: type mismatch in initializer expression, expected [i32] but got [f32]\n  0000013: error: EndGlobalInitExpr callback failed\nout/test/spec/function-references/global.wast:322: assert_invalid passed:\n  out/test/spec/function-references/global/global.12.wasm:0000011: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000012: error: EndGlobalInitExpr callback failed\nout/test/spec/function-references/global.wast:327: assert_invalid passed:\n  out/test/spec/function-references/global/global.13.wasm:000000d: error: type mismatch in initializer expression, expected [i32] but got []\n  000000e: error: EndGlobalInitExpr callback failed\nout/test/spec/function-references/global.wast:332: assert_invalid passed:\n  out/test/spec/function-references/global/global.14.wasm:0000017: error: type mismatch in initializer expression, expected [funcref] but got [externref]\n  0000018: error: EndGlobalInitExpr callback failed\nout/test/spec/function-references/global.wast:337: assert_invalid passed:\n  out/test/spec/function-references/global/global.15.wasm:0000027: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000028: error: EndGlobalInitExpr callback failed\nout/test/spec/function-references/global.wast:342: assert_invalid passed:\n  out/test/spec/function-references/global/global.16.wasm:0000027: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000028: error: EndGlobalInitExpr callback failed\nout/test/spec/function-references/global.wast:347: assert_invalid passed:\n  out/test/spec/function-references/global/global.17.wasm:000000f: error: initializer expression can only reference an imported global\n  000000f: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/global.wast:352: assert_invalid passed:\n  out/test/spec/function-references/global/global.18.wasm:000000f: error: global variable out of range: 1 (max 1)\n  000000f: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/global.wast:357: assert_invalid passed:\n  out/test/spec/function-references/global/global.19.wasm:0000025: error: global variable out of range: 2 (max 2)\n  0000025: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/global.wast:362: assert_invalid passed:\n  out/test/spec/function-references/global/global.20.wasm:0000029: error: initializer expression cannot reference a mutable global\n  0000029: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/global.wast:370: assert_malformed passed:\n  0000026: error: global mutability must be 0 or 1\nout/test/spec/function-references/global.wast:383: assert_malformed passed:\n  0000026: error: global mutability must be 0 or 1\nout/test/spec/function-references/global.wast:400: assert_malformed passed:\n  0000011: error: global mutability must be 0 or 1\nout/test/spec/function-references/global.wast:412: assert_malformed passed:\n  0000011: error: global mutability must be 0 or 1\nout/test/spec/function-references/global.wast:426: assert_invalid passed:\n  out/test/spec/function-references/global/global.27.wasm:000001a: error: global variable out of range: 0 (max 0)\n  000001a: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/global.wast:431: assert_invalid passed:\n  out/test/spec/function-references/global/global.28.wasm:0000022: error: global variable out of range: 1 (max 1)\n  0000022: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/global.wast:439: assert_invalid passed:\n  out/test/spec/function-references/global/global.29.wasm:0000034: error: global variable out of range: 1 (max 1)\n  0000034: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/global.wast:447: assert_invalid passed:\n  out/test/spec/function-references/global/global.30.wasm:000003c: error: global variable out of range: 2 (max 2)\n  000003c: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/global.wast:457: assert_invalid passed:\n  out/test/spec/function-references/global/global.31.wasm:000001b: error: global variable out of range: 0 (max 0)\n  000001b: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:462: assert_invalid passed:\n  out/test/spec/function-references/global/global.32.wasm:0000023: error: global variable out of range: 1 (max 1)\n  0000023: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:470: assert_invalid passed:\n  out/test/spec/function-references/global/global.33.wasm:0000035: error: global variable out of range: 1 (max 1)\n  0000035: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:478: assert_invalid passed:\n  out/test/spec/function-references/global/global.34.wasm:000003d: error: global variable out of range: 2 (max 2)\n  000003d: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:488: assert_invalid passed:\n  out/test/spec/function-references/global/global.35.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:497: assert_invalid passed:\n  out/test/spec/function-references/global/global.36.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:507: assert_invalid passed:\n  out/test/spec/function-references/global/global.37.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:517: assert_invalid passed:\n  out/test/spec/function-references/global/global.38.wasm:0000027: error: type mismatch in global.set, expected [i32] but got []\n  0000027: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:527: assert_invalid passed:\n  out/test/spec/function-references/global/global.39.wasm:000002a: error: type mismatch in global.set, expected [i32] but got []\n  000002a: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:537: assert_invalid passed:\n  out/test/spec/function-references/global/global.40.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:547: assert_invalid passed:\n  out/test/spec/function-references/global/global.41.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:557: assert_invalid passed:\n  out/test/spec/function-references/global/global.42.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:567: assert_invalid passed:\n  out/test/spec/function-references/global/global.43.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:576: assert_invalid passed:\n  out/test/spec/function-references/global/global.44.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:585: assert_invalid passed:\n  out/test/spec/function-references/global/global.45.wasm:0000027: error: type mismatch in global.set, expected [i32] but got []\n  0000027: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:595: assert_invalid passed:\n  out/test/spec/function-references/global/global.46.wasm:0000040: error: type mismatch in global.set, expected [i32] but got []\n  0000040: error: OnGlobalSetExpr callback failed\nout/test/spec/function-references/global.wast:613: assert_malformed passed:\n  out/test/spec/function-references/global/global.47.wat:1:33: error: redefinition of global \"$foo\"\n  (global $foo i32 (i32.const 0))(global $foo i32 (i32.const 0))\n                                  ^^^^^^\nout/test/spec/function-references/global.wast:617: assert_malformed passed:\n  out/test/spec/function-references/global/global.48.wat:1:34: error: redefinition of global \"$foo\"\n  (import \"\" \"\" (global $foo i32))(global $foo i32 (i32.const 0))\n                                   ^^^^^^\nout/test/spec/function-references/global.wast:621: assert_malformed passed:\n  out/test/spec/function-references/global/global.49.wat:1:34: error: redefinition of global \"$foo\"\n  (import \"\" \"\" (global $foo i32))(import \"\" \"\" (global $foo i32))\n                                   ^^^^^^\n108/108 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/if.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/if.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/if.wast:593: assert_trap passed: undefined table index\nout/test/spec/function-references/if.wast:736: assert_malformed passed:\n  out/test/spec/function-references/if/if.1.wat:1:95: error: unexpected token \"param\", expected then block (e.g. (then ...)).\n  ...i32.const 0)  (if (type $sig) (result i32) (param i32) (i32.const 1) (then)))\n                                                 ^^^^^\n  out/test/spec/function-references/if/if.1.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (type $sig) (result i32) (param i32) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/function-references/if.wast:745: assert_malformed passed:\n  out/test/spec/function-references/if/if.2.wat:1:82: error: unexpected token \"type\", expected then block (e.g. (then ...)).\n  ...nc (i32.const 0)  (if (param i32) (type $sig) (result i32) (i32.const 1) (...\n                                        ^^^^\n  out/test/spec/function-references/if/if.2.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (param i32) (type $sig) (result i32) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/function-references/if.wast:754: assert_malformed passed:\n  out/test/spec/function-references/if/if.3.wat:1:95: error: unexpected token \"type\", expected then block (e.g. (then ...)).\n  ...i32.const 0)  (if (param i32) (result i32) (type $sig) (i32.const 1) (then)))\n                                                 ^^^^\n  out/test/spec/function-references/if/if.3.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (param i32) (result i32) (type $sig) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/function-references/if.wast:763: assert_malformed passed:\n  out/test/spec/function-references/if/if.4.wat:1:83: error: unexpected token \"type\", expected then block (e.g. (then ...)).\n  ...c (i32.const 0)  (if (result i32) (type $sig) (param i32) (i32.const 1) (t...\n                                        ^^^^\n  out/test/spec/function-references/if/if.4.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (result i32) (type $sig) (param i32) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/function-references/if.wast:772: assert_malformed passed:\n  out/test/spec/function-references/if/if.5.wat:1:83: error: unexpected token \"param\", expected then block (e.g. (then ...)).\n  ...c (i32.const 0)  (if (result i32) (param i32) (type $sig) (i32.const 1) (t...\n                                        ^^^^^\n  out/test/spec/function-references/if/if.5.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (result i32) (param i32) (type $sig) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/function-references/if.wast:781: assert_malformed passed:\n  out/test/spec/function-references/if/if.6.wat:1:39: error: unexpected token \"param\", expected then block (e.g. (then ...)).\n  (func (i32.const 0) (if (result i32) (param i32) (i32.const 1) (then)))\n                                        ^^^^^\n  out/test/spec/function-references/if/if.6.wat:1:65: error: unexpected token \"then\", expected an instr.\n  (func (i32.const 0) (if (result i32) (param i32) (i32.const 1) (then)))\n                                                                  ^^^^\nout/test/spec/function-references/if.wast:788: assert_malformed passed:\n  out/test/spec/function-references/if/if.7.wat:1:47: error: unexpected token $x, expected ).\n  ...(i32.const 0) (i32.const 1)  (if (param $x i32) (then (drop)) (else (drop))))\n                                             ^^\n  out/test/spec/function-references/if/if.7.wat:1:69: error: unexpected token (, expected EOF.\n  ...(i32.const 0) (i32.const 1)  (if (param $x i32) (then (drop)) (else (drop))))\n                                                                   ^\nout/test/spec/function-references/if.wast:796: assert_malformed passed:\n  out/test/spec/function-references/if/if.8.wat:1:40: error: expected 0 results, got 1\n  (type $sig (func))(func (i32.const 1)  (if (type $sig) (result i32) (then (i3...\n                                         ^\nout/test/spec/function-references/if.wast:806: assert_malformed passed:\n  out/test/spec/function-references/if/if.9.wat:1:65: error: expected 1 arguments, got 0\n  ...) (result i32)))(func (i32.const 1)  (if (type $sig) (result i32) (then (i...\n                                          ^\nout/test/spec/function-references/if.wast:816: assert_malformed passed:\n  out/test/spec/function-references/if/if.10.wat:1:79: error: expected 1 results, got 0\n  ...))(func (i32.const 0) (i32.const 1)  (if (type $sig) (param i32) (then (dr...\n                                          ^\nout/test/spec/function-references/if.wast:826: assert_malformed passed:\n  out/test/spec/function-references/if/if.11.wat:1:83: error: expected 2 arguments, got 1\n  ...))(func (i32.const 0) (i32.const 1)  (if (type $sig) (param i32) (result i...\n                                          ^\nout/test/spec/function-references/if.wast:836: assert_invalid passed:\n  out/test/spec/function-references/if/if.12.wasm:000001f: error: type mismatch at end of function, expected [] but got [i32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:844: assert_invalid passed:\n  out/test/spec/function-references/if/if.13.wasm:000001e: error: type mismatch in implicit return, expected [i32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:848: assert_invalid passed:\n  out/test/spec/function-references/if/if.14.wasm:000001e: error: type mismatch in implicit return, expected [i64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:852: assert_invalid passed:\n  out/test/spec/function-references/if/if.15.wasm:000001e: error: type mismatch in implicit return, expected [f32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:856: assert_invalid passed:\n  out/test/spec/function-references/if/if.16.wasm:000001e: error: type mismatch in implicit return, expected [f64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:861: assert_invalid passed:\n  out/test/spec/function-references/if/if.17.wasm:000001e: error: type mismatch in implicit return, expected [i32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:865: assert_invalid passed:\n  out/test/spec/function-references/if/if.18.wasm:000001e: error: type mismatch in implicit return, expected [i64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:869: assert_invalid passed:\n  out/test/spec/function-references/if/if.19.wasm:000001e: error: type mismatch in implicit return, expected [f32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:873: assert_invalid passed:\n  out/test/spec/function-references/if/if.20.wasm:000001e: error: type mismatch in implicit return, expected [f64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:878: assert_invalid passed:\n  out/test/spec/function-references/if/if.21.wasm:000001e: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:884: assert_invalid passed:\n  out/test/spec/function-references/if/if.22.wasm:000001e: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:890: assert_invalid passed:\n  out/test/spec/function-references/if/if.23.wasm:000001f: error: type mismatch at end of `if false` branch, expected [] but got [i32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:896: assert_invalid passed:\n  out/test/spec/function-references/if/if.24.wasm:000001d: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  000001e: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:903: assert_invalid passed:\n  out/test/spec/function-references/if/if.25.wasm:0000020: error: type mismatch at end of `if true` branch, expected [] but got [i32, i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:909: assert_invalid passed:\n  out/test/spec/function-references/if/if.26.wasm:0000020: error: type mismatch at end of `if true` branch, expected [] but got [i32, i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:915: assert_invalid passed:\n  out/test/spec/function-references/if/if.27.wasm:0000021: error: type mismatch at end of `if false` branch, expected [] but got [i32, i32]\n  0000021: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:921: assert_invalid passed:\n  out/test/spec/function-references/if/if.28.wasm:000001f: error: type mismatch at end of `if true` branch, expected [] but got [i32, i32]\n  0000020: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:928: assert_invalid passed:\n  out/test/spec/function-references/if/if.29.wasm:000001c: error: type mismatch in `if true` branch, expected [i32] but got []\n  000001d: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:934: assert_invalid passed:\n  out/test/spec/function-references/if/if.30.wasm:000001f: error: type mismatch in `if false` branch, expected [i32] but got []\n  000001f: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:940: assert_invalid passed:\n  out/test/spec/function-references/if/if.31.wasm:000001d: error: type mismatch in `if true` branch, expected [i32] but got []\n  000001d: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:947: assert_invalid passed:\n  out/test/spec/function-references/if/if.32.wasm:000001d: error: type mismatch in `if true` branch, expected [i32, i32] but got []\n  000001e: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:953: assert_invalid passed:\n  out/test/spec/function-references/if/if.33.wasm:0000022: error: type mismatch in `if false` branch, expected [i32, i32] but got []\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:959: assert_invalid passed:\n  out/test/spec/function-references/if/if.34.wasm:000001e: error: type mismatch in `if true` branch, expected [i32, i32] but got []\n  000001e: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:966: assert_invalid passed:\n  out/test/spec/function-references/if/if.35.wasm:000001f: error: type mismatch in `if false` branch, expected [i32] but got []\n  000001f: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:972: assert_invalid passed:\n  out/test/spec/function-references/if/if.36.wasm:0000022: error: type mismatch in `if false` branch, expected [i32, i32] but got []\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:979: assert_invalid passed:\n  out/test/spec/function-references/if/if.37.wasm:000001d: error: type mismatch in `if true` branch, expected [i32] but got []\n  000001e: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:985: assert_invalid passed:\n  out/test/spec/function-references/if/if.38.wasm:0000021: error: type mismatch in `if false` branch, expected [i32] but got []\n  0000021: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:991: assert_invalid passed:\n  out/test/spec/function-references/if/if.39.wasm:000001d: error: type mismatch in `if true` branch, expected [i32] but got []\n  000001e: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:998: assert_invalid passed:\n  out/test/spec/function-references/if/if.40.wasm:000001e: error: type mismatch in `if true` branch, expected [i32, i32] but got []\n  000001f: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1004: assert_invalid passed:\n  out/test/spec/function-references/if/if.41.wasm:0000024: error: type mismatch in `if false` branch, expected [i32, i32] but got []\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:1010: assert_invalid passed:\n  out/test/spec/function-references/if/if.42.wasm:000001e: error: type mismatch in `if true` branch, expected [i32, i32] but got []\n  000001f: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1017: assert_invalid passed:\n  out/test/spec/function-references/if/if.43.wasm:000001e: error: type mismatch in `if true` branch, expected [i32] but got [i64]\n  000001f: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1023: assert_invalid passed:\n  out/test/spec/function-references/if/if.44.wasm:0000022: error: type mismatch in `if false` branch, expected [i32] but got [i64]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:1029: assert_invalid passed:\n  out/test/spec/function-references/if/if.45.wasm:000001e: error: type mismatch in `if true` branch, expected [i32] but got [i64]\n  000001f: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1036: assert_invalid passed:\n  out/test/spec/function-references/if/if.46.wasm:000001f: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000020: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1042: assert_invalid passed:\n  out/test/spec/function-references/if/if.47.wasm:0000025: error: type mismatch in `if false` branch, expected [i32, i32] but got [i32]\n  0000025: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:1048: assert_invalid passed:\n  out/test/spec/function-references/if/if.48.wasm:000001f: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000020: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1055: assert_invalid passed:\n  out/test/spec/function-references/if/if.49.wasm:0000021: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000022: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1062: assert_invalid passed:\n  out/test/spec/function-references/if/if.50.wasm:0000027: error: type mismatch in `if false` branch, expected [i32, i32] but got [i32]\n  0000027: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:1069: assert_invalid passed:\n  out/test/spec/function-references/if/if.51.wasm:0000021: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000022: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1077: assert_invalid passed:\n  out/test/spec/function-references/if/if.52.wasm:0000020: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  0000021: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1083: assert_invalid passed:\n  out/test/spec/function-references/if/if.53.wasm:0000024: error: type mismatch at end of `if false` branch, expected [] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/if.wast:1089: assert_invalid passed:\n  out/test/spec/function-references/if/if.54.wasm:0000020: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  0000021: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1096: assert_invalid passed:\n  out/test/spec/function-references/if/if.55.wasm:000001e: error: type mismatch in `if true` branch, expected [i32] but got [i64]\n  000001f: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1102: assert_invalid passed:\n  out/test/spec/function-references/if/if.56.wasm:0000023: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  0000024: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1109: assert_invalid passed:\n  out/test/spec/function-references/if/if.57.wasm:0000025: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:1119: assert_invalid passed:\n  out/test/spec/function-references/if/if.58.wasm:0000025: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:1129: assert_invalid passed:\n  out/test/spec/function-references/if/if.59.wasm:0000027: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000027: error: EndFunctionBody callback failed\nout/test/spec/function-references/if.wast:1140: assert_invalid passed:\n  out/test/spec/function-references/if/if.60.wasm:000001e: error: type mismatch in br, expected [i32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1146: assert_invalid passed:\n  out/test/spec/function-references/if/if.61.wasm:0000021: error: type mismatch in br, expected [i32] but got []\n  0000021: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1152: assert_invalid passed:\n  out/test/spec/function-references/if/if.62.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1158: assert_invalid passed:\n  out/test/spec/function-references/if/if.63.wasm:0000024: error: type mismatch in br, expected [i32, i32] but got []\n  0000024: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1165: assert_invalid passed:\n  out/test/spec/function-references/if/if.64.wasm:000001e: error: type mismatch in br, expected [i32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1174: assert_invalid passed:\n  out/test/spec/function-references/if/if.65.wasm:0000021: error: type mismatch in br, expected [i32] but got []\n  0000021: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1183: assert_invalid passed:\n  out/test/spec/function-references/if/if.66.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1192: assert_invalid passed:\n  out/test/spec/function-references/if/if.67.wasm:0000024: error: type mismatch in br, expected [i32, i32] but got []\n  0000024: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1202: assert_invalid passed:\n  out/test/spec/function-references/if/if.68.wasm:000001f: error: type mismatch in br, expected [i32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1211: assert_invalid passed:\n  out/test/spec/function-references/if/if.69.wasm:0000022: error: type mismatch in br, expected [i32] but got []\n  0000022: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1220: assert_invalid passed:\n  out/test/spec/function-references/if/if.70.wasm:0000020: error: type mismatch in br, expected [i32, i32] but got []\n  0000020: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1229: assert_invalid passed:\n  out/test/spec/function-references/if/if.71.wasm:0000025: error: type mismatch in br, expected [i32, i32] but got []\n  0000025: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1239: assert_invalid passed:\n  out/test/spec/function-references/if/if.72.wasm:0000020: error: type mismatch in br, expected [i32] but got [i64]\n  0000020: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1248: assert_invalid passed:\n  out/test/spec/function-references/if/if.73.wasm:0000023: error: type mismatch in br, expected [i32] but got [i64]\n  0000023: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1257: assert_invalid passed:\n  out/test/spec/function-references/if/if.74.wasm:0000021: error: type mismatch in br, expected [i32, i32] but got [i64]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1266: assert_invalid passed:\n  out/test/spec/function-references/if/if.75.wasm:0000026: error: type mismatch in br, expected [i32, i32] but got [i64]\n  0000026: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1275: assert_invalid passed:\n  out/test/spec/function-references/if/if.76.wasm:0000023: error: type mismatch in br, expected [i32, i32] but got [i64]\n  0000023: error: OnBrExpr callback failed\nout/test/spec/function-references/if.wast:1285: assert_invalid passed:\n  out/test/spec/function-references/if/if.77.wasm:0000021: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000022: error: OnElseExpr callback failed\nout/test/spec/function-references/if.wast:1296: assert_invalid passed:\n  out/test/spec/function-references/if/if.78.wasm:0000019: error: type mismatch in if, expected [i32] but got []\n  0000019: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1304: assert_invalid passed:\n  out/test/spec/function-references/if/if.79.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1313: assert_invalid passed:\n  out/test/spec/function-references/if/if.80.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1322: assert_invalid passed:\n  out/test/spec/function-references/if/if.81.wasm:000001f: error: type mismatch in if, expected [i32] but got []\n  000001f: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1331: assert_invalid passed:\n  out/test/spec/function-references/if/if.82.wasm:0000022: error: type mismatch in if, expected [i32] but got []\n  0000022: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1341: assert_invalid passed:\n  out/test/spec/function-references/if/if.83.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1350: assert_invalid passed:\n  out/test/spec/function-references/if/if.84.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1359: assert_invalid passed:\n  out/test/spec/function-references/if/if.85.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1368: assert_invalid passed:\n  out/test/spec/function-references/if/if.86.wasm:0000019: error: type mismatch in if, expected [i32] but got []\n  0000019: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1376: assert_invalid passed:\n  out/test/spec/function-references/if/if.87.wasm:0000019: error: type mismatch in if, expected [i32] but got []\n  0000019: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1384: assert_invalid passed:\n  out/test/spec/function-references/if/if.88.wasm:000001f: error: type mismatch in if, expected [i32] but got []\n  000001f: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1393: assert_invalid passed:\n  out/test/spec/function-references/if/if.89.wasm:0000038: error: type mismatch in if, expected [i32] but got []\n  0000038: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1409: assert_invalid passed:\n  out/test/spec/function-references/if/if.90.wasm:000001b: error: type mismatch in if, expected [i32] but got []\n  000001b: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1418: assert_invalid passed:\n  out/test/spec/function-references/if/if.91.wasm:000001b: error: type mismatch in if, expected [i32] but got []\n  000001b: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1427: assert_invalid passed:\n  out/test/spec/function-references/if/if.92.wasm:0000021: error: type mismatch in if, expected [i32] but got []\n  0000021: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1436: assert_invalid passed:\n  out/test/spec/function-references/if/if.93.wasm:000001e: error: type mismatch in if, expected [i32] but got []\n  000001e: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1445: assert_invalid passed:\n  out/test/spec/function-references/if/if.94.wasm:000001e: error: type mismatch in if, expected [i32] but got []\n  000001e: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1454: assert_invalid passed:\n  out/test/spec/function-references/if/if.95.wasm:000001e: error: type mismatch in if, expected [i32] but got []\n  000001e: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1464: assert_invalid passed:\n  out/test/spec/function-references/if/if.96.wasm:000001f: error: type mismatch in if, expected [i32] but got []\n  000001f: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1470: assert_invalid passed:\n  out/test/spec/function-references/if/if.97.wasm:0000020: error: type mismatch in if, expected [i32, f64] but got []\n  0000020: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1476: assert_invalid passed:\n  out/test/spec/function-references/if/if.98.wasm:0000024: error: type mismatch in if, expected [i32] but got [f32]\n  0000024: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1482: assert_invalid passed:\n  out/test/spec/function-references/if/if.99.wasm:0000025: error: type mismatch in if, expected [f32, i32] but got [f32]\n  0000025: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1488: assert_invalid passed:\n  out/test/spec/function-references/if/if.100.wasm:0000021: error: type mismatch in if, expected [i32] but got []\n  0000021: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1494: assert_invalid passed:\n  out/test/spec/function-references/if/if.101.wasm:0000022: error: type mismatch in if, expected [i32, f64] but got []\n  0000022: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1500: assert_invalid passed:\n  out/test/spec/function-references/if/if.102.wasm:0000026: error: type mismatch in if, expected [i32] but got [f32]\n  0000026: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1506: assert_invalid passed:\n  out/test/spec/function-references/if/if.103.wasm:0000027: error: type mismatch in if, expected [f32, i32] but got [f32]\n  0000027: error: OnIfExpr callback failed\nout/test/spec/function-references/if.wast:1513: assert_malformed passed:\n  out/test/spec/function-references/if/if.104.wat:1:42: error: unexpected token $x, expected ).\n  (func (param i32) (result i32) if (param $x i32) end)\n                                           ^^\nout/test/spec/function-references/if.wast:1517: assert_malformed passed:\n  out/test/spec/function-references/if/if.105.wat:1:43: error: unexpected token $x, expected ).\n  (func (param i32) (result i32) (if (param $x i32) (then)))\n                                            ^^\nout/test/spec/function-references/if.wast:1522: assert_malformed passed:\n  out/test/spec/function-references/if/if.106.wat:1:26: error: unexpected label \"$l\"\n  (func i32.const 0 if end $l)\n                           ^^\nout/test/spec/function-references/if.wast:1526: assert_malformed passed:\n  out/test/spec/function-references/if/if.107.wat:1:29: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a end $l)\n                              ^^\nout/test/spec/function-references/if.wast:1530: assert_malformed passed:\n  out/test/spec/function-references/if/if.108.wat:1:27: error: unexpected label \"$l\"\n  (func i32.const 0 if else $l end)\n                            ^^\nout/test/spec/function-references/if.wast:1534: assert_malformed passed:\n  out/test/spec/function-references/if/if.109.wat:1:30: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else $l end)\n                               ^^\nout/test/spec/function-references/if.wast:1538: assert_malformed passed:\n  out/test/spec/function-references/if/if.110.wat:1:31: error: unexpected label \"$l\"\n  (func i32.const 0 if else end $l)\n                                ^^\nout/test/spec/function-references/if.wast:1542: assert_malformed passed:\n  out/test/spec/function-references/if/if.111.wat:1:27: error: unexpected label \"$l\"\n  (func i32.const 0 if else $l end $l)\n                            ^^\n  out/test/spec/function-references/if/if.111.wat:1:34: error: unexpected label \"$l\"\n  (func i32.const 0 if else $l end $l)\n                                   ^^\nout/test/spec/function-references/if.wast:1546: assert_malformed passed:\n  out/test/spec/function-references/if/if.112.wat:1:27: error: unexpected label \"$l1\"\n  (func i32.const 0 if else $l1 end $l2)\n                            ^^^\n  out/test/spec/function-references/if/if.112.wat:1:35: error: unexpected label \"$l2\"\n  (func i32.const 0 if else $l1 end $l2)\n                                    ^^^\nout/test/spec/function-references/if.wast:1550: assert_malformed passed:\n  out/test/spec/function-references/if/if.113.wat:1:34: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else end $l)\n                                   ^^\nout/test/spec/function-references/if.wast:1554: assert_malformed passed:\n  out/test/spec/function-references/if/if.114.wat:1:37: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else $a end $l)\n                                      ^^\nout/test/spec/function-references/if.wast:1558: assert_malformed passed:\n  out/test/spec/function-references/if/if.115.wat:1:30: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else $l end $l)\n                               ^^\n  out/test/spec/function-references/if/if.115.wat:1:37: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else $l end $l)\n                                      ^^\nout/test/spec/function-references/if.wast:1562: assert_malformed passed:\n  out/test/spec/function-references/if/if.116.wat:1:11: error: unexpected token i32.const, expected (.\n  (func (if i32.const 0 (then) (else)))\n            ^^^^^^^^^\n241/241 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/linking.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/linking.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/linking.wast:28: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/function-references/linking.wast:32: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/function-references/linking.wast:87: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected mutable but got immutable.\nout/test/spec/function-references/linking.wast:91: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/function-references/linking.wast:133: assert_unlinkable passed:\n  error: type mismatch in imported global, expected funcref but got externref.\nout/test/spec/function-references/linking.wast:138: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref func) but got funcref.\nout/test/spec/function-references/linking.wast:142: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref func) but got (ref null 0).\nout/test/spec/function-references/linking.wast:146: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref func) but got externref.\nout/test/spec/function-references/linking.wast:151: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref null 0) but got funcref.\nout/test/spec/function-references/linking.wast:155: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref null 0) but got (ref func).\nout/test/spec/function-references/linking.wast:159: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref null 0) but got externref.\nout/test/spec/function-references/linking.wast:164: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref 0) but got funcref.\nout/test/spec/function-references/linking.wast:168: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref 0) but got (ref func).\nout/test/spec/function-references/linking.wast:172: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref 0) but got (ref null 0).\nout/test/spec/function-references/linking.wast:176: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref 0) but got externref.\nout/test/spec/function-references/linking.wast:181: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got funcref.\nout/test/spec/function-references/linking.wast:185: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got (ref func).\nout/test/spec/function-references/linking.wast:189: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got (ref null 0).\nout/test/spec/function-references/linking.wast:193: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got (ref 0).\nout/test/spec/function-references/linking.wast:199: assert_unlinkable passed:\n  error: type mismatch in imported global, expected funcref but got (ref func).\nout/test/spec/function-references/linking.wast:203: assert_unlinkable passed:\n  error: type mismatch in imported global, expected funcref but got (ref null 0).\nout/test/spec/function-references/linking.wast:207: assert_unlinkable passed:\n  error: type mismatch in imported global, expected funcref but got (ref 0).\nout/test/spec/function-references/linking.wast:211: assert_unlinkable passed:\n  error: type mismatch in imported global, expected funcref but got externref.\nout/test/spec/function-references/linking.wast:216: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref func) but got funcref.\nout/test/spec/function-references/linking.wast:220: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref func) but got (ref null 0).\nout/test/spec/function-references/linking.wast:224: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref func) but got (ref 0).\nout/test/spec/function-references/linking.wast:228: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref func) but got externref.\nout/test/spec/function-references/linking.wast:233: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref null 0) but got funcref.\nout/test/spec/function-references/linking.wast:237: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref null 0) but got (ref func).\nout/test/spec/function-references/linking.wast:241: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref null 0) but got (ref 0).\nout/test/spec/function-references/linking.wast:245: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref null 0) but got externref.\nout/test/spec/function-references/linking.wast:250: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref 0) but got funcref.\nout/test/spec/function-references/linking.wast:254: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref 0) but got (ref func).\nout/test/spec/function-references/linking.wast:258: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref 0) but got (ref null 0).\nout/test/spec/function-references/linking.wast:262: assert_unlinkable passed:\n  error: type mismatch in imported global, expected (ref 0) but got externref.\nout/test/spec/function-references/linking.wast:267: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got funcref.\nout/test/spec/function-references/linking.wast:271: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got (ref func).\nout/test/spec/function-references/linking.wast:275: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got (ref null 0).\nout/test/spec/function-references/linking.wast:279: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got (ref 0).\nout/test/spec/function-references/linking.wast:325: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:326: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:328: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:330: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:331: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:333: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:335: assert_trap passed: undefined table index\nout/test/spec/function-references/linking.wast:336: assert_trap passed: undefined table index\nout/test/spec/function-references/linking.wast:337: assert_trap passed: undefined table index\nout/test/spec/function-references/linking.wast:338: assert_trap passed: undefined table index\nout/test/spec/function-references/linking.wast:341: assert_trap passed: indirect call signature mismatch\nout/test/spec/function-references/linking.wast:373: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:374: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:376: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:377: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:379: assert_trap passed: undefined table index\nout/test/spec/function-references/linking.wast:405: assert_unlinkable passed:\n  error: invalid import \"Mt.mem\"\nout/test/spec/function-references/linking.wast:414: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:428: assert_trap passed: uninitialized table element\nout/test/spec/function-references/linking.wast:459: assert_unlinkable passed:\n  error: type mismatch in imported table, expected funcref but got (ref null 0).\nout/test/spec/function-references/linking.wast:463: assert_unlinkable passed:\n  error: type mismatch in imported table, expected funcref but got externref.\nout/test/spec/function-references/linking.wast:468: assert_unlinkable passed:\n  error: type mismatch in imported table, expected (ref null 0) but got funcref.\nout/test/spec/function-references/linking.wast:472: assert_unlinkable passed:\n  error: type mismatch in imported table, expected (ref null 0) but got externref.\nout/test/spec/function-references/linking.wast:477: assert_unlinkable passed:\n  error: type mismatch in imported table, expected externref but got funcref.\nout/test/spec/function-references/linking.wast:481: assert_unlinkable passed:\n  error: type mismatch in imported table, expected externref but got (ref null 0).\nout/test/spec/function-references/linking.wast:559: assert_unlinkable passed:\n  error: invalid import \"Mm.tab\"\n158/158 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/local_get.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/local_get.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/local_get.wast:149: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.1.wasm:000001d: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001d: error: EndFunctionBody callback failed\nout/test/spec/function-references/local_get.wast:153: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.2.wasm:000001d: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/function-references/local_get.wast:157: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.3.wasm:000001f: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001f: error: OnUnaryExpr callback failed\nout/test/spec/function-references/local_get.wast:165: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.4.wasm:000001c: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/local_get.wast:169: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.5.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/function-references/local_get.wast:173: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.6.wasm:000001d: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/function-references/local_get.wast:181: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.7.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/local_get.wast:185: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.8.wasm:000001c: error: type mismatch at end of function, expected [] but got [i64]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/local_get.wast:189: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.9.wasm:000001c: error: type mismatch at end of function, expected [] but got [f32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/local_get.wast:193: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.10.wasm:000001c: error: type mismatch at end of function, expected [] but got [f64]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/local_get.wast:201: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.11.wasm:000001d: error: local variable out of range (max 2)\n  000001d: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/local_get.wast:205: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.12.wasm:0000020: error: local variable out of range (max 2)\n  0000020: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/local_get.wast:210: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.13.wasm:000001b: error: local variable out of range (max 2)\n  000001b: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/local_get.wast:214: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.14.wasm:000001f: error: local variable out of range (max 2)\n  000001f: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/local_get.wast:219: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.15.wasm:000001e: error: local variable out of range (max 3)\n  000001e: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/local_get.wast:223: assert_invalid passed:\n  out/test/spec/function-references/local_get/local_get.16.wasm:0000021: error: local variable out of range (max 3)\n  0000021: error: OnLocalGetExpr callback failed\n36/36 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/local_init.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/local_init.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/local_init.wast:26: assert_invalid passed:\n  out/test/spec/function-references/local_init/local_init.1.wasm:000001c: error: uninitialized local reference\n  000001c: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/local_init.wast:30: assert_invalid passed:\n  out/test/spec/function-references/local_init/local_init.2.wasm:000002a: error: uninitialized local reference\n  000002a: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/local_init.wast:40: assert_invalid passed:\n  out/test/spec/function-references/local_init/local_init.3.wasm:0000027: error: uninitialized local reference\n  0000027: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/local_init.wast:53: assert_invalid passed:\n  out/test/spec/function-references/local_init/local_init.4.wasm:000002c: error: uninitialized local reference\n  000002c: error: OnLocalGetExpr callback failed\n10/10 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/ref.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/ref.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/ref.wast:28: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.1.wasm:0000010: error: reference 1 is out of range (max: 0) in params\n  0000010: error: OnFuncType callback failed\nout/test/spec/function-references/ref.wast:32: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.2.wasm:0000010: error: reference 1 is out of range (max: 0) in results\n  0000010: error: OnFuncType callback failed\nout/test/spec/function-references/ref.wast:37: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.3.wasm:000000e: error: reference 1 is out of range (max: 0) in globals\n  000000e: error: BeginGlobal callback failed\nout/test/spec/function-references/ref.wast:42: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.4.wasm:000000f: error: reference 1 is out of range (max: 0) in tables\n  000000f: error: BeginTable callback failed\nout/test/spec/function-references/ref.wast:47: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.5.wasm:000000e: error: reference 1 is out of range\n  000000e: error: OnElemSegmentElemType callback failed\nout/test/spec/function-references/ref.wast:52: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.6.wasm:0000010: error: reference 1 is out of range (max: 0) in params\n  0000010: error: OnFuncType callback failed\nout/test/spec/function-references/ref.wast:56: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.7.wasm:0000010: error: reference 1 is out of range (max: 0) in results\n  0000010: error: OnFuncType callback failed\nout/test/spec/function-references/ref.wast:60: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.8.wasm:000001a: error: reference 1 is out of range (max: 1) in locals\n  000001a: error: OnLocalDecl callback failed\nout/test/spec/function-references/ref.wast:65: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.9.wasm:000001a: error: reference 1 is out of range\n  000001a: error: OnBlockExpr callback failed\nout/test/spec/function-references/ref.wast:69: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.10.wasm:000001a: error: reference 1 is out of range\n  000001a: error: OnLoopExpr callback failed\nout/test/spec/function-references/ref.wast:73: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.11.wasm:000001a: error: reference 1 is out of range\n  out/test/spec/function-references/ref/ref.11.wasm:000001a: error: type mismatch in if, expected [i32] but got []\n  000001a: error: OnIfExpr callback failed\nout/test/spec/function-references/ref.wast:78: assert_invalid passed:\n  out/test/spec/function-references/ref/ref.12.wasm:000001c: error: reference 1 is out of range\n  000001c: error: OnSelectExpr callback failed\n13/13 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/ref_as_non_null.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/ref_as_non_null.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/ref_as_non_null.wast:25: assert_trap passed: unreachable executed\nout/test/spec/function-references/ref_as_non_null.wast:27: assert_trap passed: null reference\nout/test/spec/function-references/ref_as_non_null.wast:32: assert_invalid passed:\n  out/test/spec/function-references/ref_as_non_null/ref_as_non_null.1.wasm:000002c: error: type mismatch in call, expected [(ref 0)] but got [(ref null 0)]\n  000002c: error: OnCallExpr callback failed\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/ref_is_null.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/ref_is_null.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\ninit(externref:1) =>\ndeinit() =>\nout/test/spec/function-references/ref_is_null.wast:79: assert_invalid passed:\n  out/test/spec/function-references/ref_is_null/ref_is_null.2.wasm:000001b: error: type mismatch in ref.is_null, expected [reference] but got [i32]\n  000001b: error: OnRefIsNullExpr callback failed\nout/test/spec/function-references/ref_is_null.wast:83: assert_invalid passed:\n  out/test/spec/function-references/ref_is_null/ref_is_null.3.wasm:0000018: error: type mismatch in ref.is_null, expected [reference] but got []\n  0000018: error: OnRefIsNullExpr callback failed\n22/22 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/ref_null.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/ref_null.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/return_call.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/return_call.wast\n;;; ARGS*: --enable-function-references --enable-tail-call\n(;; STDOUT ;;;\nout/test/spec/function-references/return_call.wast:124: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.1.wasm:000001e: error: return signatures have inconsistent types: expected [i32], got []\n  000001e: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:131: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.2.wasm:000001f: error: return signatures have inconsistent types: expected [i32], got [i64]\n  000001f: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:139: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.3.wasm:000001e: error: type mismatch in return_call, expected [i32] but got []\n  000001e: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:146: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.4.wasm:000001f: error: type mismatch in return_call, expected [f64, i32] but got []\n  000001f: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:164: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.7.wasm:0000022: error: type mismatch in return_call, expected [i32, i32] but got [i32]\n  0000022: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:171: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.8.wasm:0000022: error: type mismatch in return_call, expected [i32, i32] but got [i32]\n  0000022: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:178: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.9.wasm:000002a: error: type mismatch in return_call, expected [i32, f64] but got [f64, i32]\n  000002a: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:185: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.10.wasm:000002a: error: type mismatch in return_call, expected [f64, i32] but got [i32, f64]\n  000002a: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:192: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.11.wasm:0000024: error: return signatures have inconsistent types: expected [i32], got [i32, i32]\n  0000024: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:204: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.12.wasm:0000019: error: function variable out of range: 1 (max 1)\n  0000019: error: OnReturnCallExpr callback failed\nout/test/spec/function-references/return_call.wast:208: assert_invalid passed:\n  out/test/spec/function-references/return_call/return_call.13.wasm:000001d: error: function variable out of range: 1012321300 (max 1)\n  000001d: error: OnReturnCallExpr callback failed\n45/45 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/return_call_indirect.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/return_call_indirect.wast\n;;; ARGS*: --enable-function-references --enable-tail-call\n(;; STDOUT ;;;\nout/test/spec/function-references/return_call_indirect.wast:234: assert_trap passed: indirect call signature mismatch\nout/test/spec/function-references/return_call_indirect.wast:235: assert_trap passed: indirect call signature mismatch\nout/test/spec/function-references/return_call_indirect.wast:236: assert_trap passed: undefined table index\nout/test/spec/function-references/return_call_indirect.wast:237: assert_trap passed: undefined table index\nout/test/spec/function-references/return_call_indirect.wast:238: assert_trap passed: undefined table index\nout/test/spec/function-references/return_call_indirect.wast:244: assert_trap passed: indirect call signature mismatch\nout/test/spec/function-references/return_call_indirect.wast:245: assert_trap passed: indirect call signature mismatch\nout/test/spec/function-references/return_call_indirect.wast:273: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.1.wat:1:129: error: unexpected token \"param\", expected an expr.\n  ...indirect (type $sig) (result i32) (param i32)    (i32.const 0) (i32.const ...\n                                        ^^^^^\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.1.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (type $sig) (result i32) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/function-references/return_call_indirect.wast:285: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.2.wat:1:116: error: unexpected token \"type\", expected an expr.\n  ...(return_call_indirect (param i32) (type $sig) (result i32)    (i32.const 0...\n                                        ^^^^\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.2.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (param i32) (type $sig) (result i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/function-references/return_call_indirect.wast:297: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.3.wat:1:129: error: unexpected token \"type\", expected an expr.\n  ...indirect (param i32) (result i32) (type $sig)    (i32.const 0) (i32.const ...\n                                        ^^^^\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.3.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (param i32) (result i32) (type $sig)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/function-references/return_call_indirect.wast:309: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.4.wat:1:117: error: unexpected token \"type\", expected an expr.\n  ...return_call_indirect (result i32) (type $sig) (param i32)    (i32.const 0)...\n                                        ^^^^\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.4.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (result i32) (type $sig) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/function-references/return_call_indirect.wast:321: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.5.wat:1:117: error: unexpected token \"param\", expected an expr.\n  ...return_call_indirect (result i32) (param i32) (type $sig)    (i32.const 0)...\n                                        ^^^^^\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.5.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (result i32) (param i32) (type $sig)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/function-references/return_call_indirect.wast:333: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.6.wat:1:74: error: unexpected token \"param\", expected an expr.\n  ...return_call_indirect (result i32) (param i32)    (i32.const 0) (i32.const ...\n                                        ^^^^^\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.6.wat:1:118: error: unexpected token ), expected EOF.\n  ...urn_call_indirect (result i32) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/function-references/return_call_indirect.wast:345: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.7.wat:1:53: error: unexpected token $x, expected ).\n  ...cref)(func (return_call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\n                                             ^^\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.7.wat:1:89: error: unexpected token ), expected EOF.\n  ...cref)(func (return_call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\n                                                                                 ^\nout/test/spec/function-references/return_call_indirect.wast:352: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.8.wat:1:57: error: expected 0 results, got 1\n  ...ncref)(func (result i32)  (return_call_indirect (type $sig) (result i32) (...\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/function-references/return_call_indirect.wast:362: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.9.wat:1:82: error: expected 1 arguments, got 0\n  ...ncref)(func (result i32)  (return_call_indirect (type $sig) (result i32) (...\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/function-references/return_call_indirect.wast:372: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.10.wat:1:69: error: expected 1 results, got 0\n  ...))(table 0 funcref)(func  (return_call_indirect (type $sig) (param i32)   ...\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/function-references/return_call_indirect.wast:384: assert_malformed passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.11.wat:1:86: error: expected 2 arguments, got 1\n  ...ncref)(func (result i32)  (return_call_indirect (type $sig) (param i32) (r...\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/function-references/return_call_indirect.wast:399: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.12.wasm:000001c: error: table variable out of range: 0 (max 0)\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.12.wasm:000001c: error: type mismatch: return_call_indirect must reference table of funcref type\n  000001c: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:407: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.13.wasm:0000024: error: type mismatch at end of function, expected [] but got [i32]\n  0000024: error: EndFunctionBody callback failed\nout/test/spec/function-references/return_call_indirect.wast:415: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.14.wasm:0000026: error: return signatures have inconsistent types: expected [], got [i64]\n  0000026: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:424: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.15.wasm:0000026: error: type mismatch in return_call_indirect, expected [i32] but got []\n  0000026: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:432: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.16.wasm:0000027: error: type mismatch in return_call_indirect, expected [f64, i32] but got []\n  0000027: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:455: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.19.wasm:0000027: error: type mismatch in return_call_indirect, expected [i32] but got []\n  0000027: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:463: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.20.wasm:0000028: error: type mismatch in return_call_indirect, expected [i32] but got [... i64]\n  0000028: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:472: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.21.wasm:000002a: error: type mismatch in return_call_indirect, expected [i32, i32] but got [i32]\n  000002a: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:482: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.22.wasm:000002a: error: type mismatch in return_call_indirect, expected [i32, i32] but got [i32]\n  000002a: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:492: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.23.wasm:0000032: error: type mismatch in return_call_indirect, expected [i32, f64] but got [f64, i32]\n  0000032: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:502: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.24.wasm:0000032: error: type mismatch in return_call_indirect, expected [f64, i32] but got [i32, f64]\n  0000032: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:512: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.25.wasm:0000034: error: return signatures have inconsistent types: expected [i32], got [i32, i32]\n  0000034: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:526: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.26.wasm:0000022: error: function type variable out of range: 1 (max 1)\n  0000022: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:533: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.27.wasm:0000026: error: function type variable out of range: 1012321300 (max 1)\n  0000026: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/function-references/return_call_indirect.wast:544: assert_invalid passed:\n  out/test/spec/function-references/return_call_indirect/return_call_indirect.28.wasm:0000019: error: function variable out of range: 0 (max 0)\n  0000019: error: OnRefFuncExpr callback failed\n76/76 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/return_call_ref.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/return_call_ref.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/return_call_ref.wast:183: assert_trap passed: null function reference\nout/test/spec/function-references/return_call_ref.wast:232: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.2.wasm:000002d: error: return signatures have inconsistent types: expected [(ref 0)], got [(ref null 0)]\n  000002d: error: OnReturnCallRefExpr callback failed\nout/test/spec/function-references/return_call_ref.wast:243: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.3.wasm:000002d: error: return signatures have inconsistent types: expected [(ref 0)], got [(ref func)]\n  000002d: error: OnReturnCallRefExpr callback failed\nout/test/spec/function-references/return_call_ref.wast:254: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.4.wasm:000002c: error: return signatures have inconsistent types: expected [(ref 0)], got [funcref]\n  000002c: error: OnReturnCallRefExpr callback failed\nout/test/spec/function-references/return_call_ref.wast:265: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.5.wasm:000002d: error: return signatures have inconsistent types: expected [(ref null 0)], got [(ref func)]\n  000002d: error: OnReturnCallRefExpr callback failed\nout/test/spec/function-references/return_call_ref.wast:276: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.6.wasm:000002c: error: return signatures have inconsistent types: expected [(ref null 0)], got [funcref]\n  000002c: error: OnReturnCallRefExpr callback failed\nout/test/spec/function-references/return_call_ref.wast:287: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.7.wasm:0000029: error: return signatures have inconsistent types: expected [(ref func)], got [funcref]\n  0000029: error: OnReturnCallRefExpr callback failed\nout/test/spec/function-references/return_call_ref.wast:306: assert_trap passed: unreachable executed\nout/test/spec/function-references/return_call_ref.wast:319: assert_trap passed: unreachable executed\nout/test/spec/function-references/return_call_ref.wast:334: assert_trap passed: unreachable executed\nout/test/spec/function-references/return_call_ref.wast:337: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.11.wasm:0000042: error: type mismatch in return_call_ref, expected [i32] but got [i64]\n  0000042: error: OnReturnCallRefExpr callback failed\nout/test/spec/function-references/return_call_ref.wast:353: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.12.wasm:0000043: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000043: error: EndFunctionBody callback failed\nout/test/spec/function-references/return_call_ref.wast:369: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.13.wasm:000001f: error: type mismatch in return_call_ref, expected [(ref null 0)] but got [externref]\n  000001f: error: OnReturnCallRefExpr callback failed\nout/test/spec/function-references/return_call_ref.wast:379: assert_invalid passed:\n  out/test/spec/function-references/return_call_ref/return_call_ref.14.wasm:0000022: error: type mismatch in return_call_ref, expected [(ref null 0)] but got [funcref]\n  out/test/spec/function-references/return_call_ref/return_call_ref.14.wasm:0000022: error: return signatures have inconsistent types: expected [i32], got [i32, i32]\n  0000022: error: OnReturnCallRefExpr callback failed\n50/50 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/select.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/select.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/select.wast:282: assert_trap passed: unreachable executed\nout/test/spec/function-references/select.wast:283: assert_trap passed: unreachable executed\nout/test/spec/function-references/select.wast:284: assert_trap passed: unreachable executed\nout/test/spec/function-references/select.wast:285: assert_trap passed: unreachable executed\nout/test/spec/function-references/select.wast:322: assert_trap passed: undefined table index\nout/test/spec/function-references/select.wast:323: assert_trap passed: undefined table index\nout/test/spec/function-references/select.wast:364: assert_invalid passed:\n  out/test/spec/function-references/select/select.1.wasm:000001c: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  000001c: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:368: assert_invalid passed:\n  out/test/spec/function-references/select/select.2.wasm:000001c: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  000001c: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:372: assert_invalid passed:\n  out/test/spec/function-references/select/select.3.wasm:0000027: error: invalid arity in select instruction: 2.\n  0000027: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:384: assert_invalid passed:\n  out/test/spec/function-references/select/select.4.wasm:0000023: error: type mismatch in select, expected [any, any, i32] but got [(ref 0), (ref 0), i32]\n  0000023: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:392: assert_invalid passed:\n  out/test/spec/function-references/select/select.5.wasm:000001f: error: type mismatch in select, expected [any, any, i32] but got [funcref, funcref, i32]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:398: assert_invalid passed:\n  out/test/spec/function-references/select/select.6.wasm:000001f: error: type mismatch in select, expected [any, any, i32] but got [externref, externref, i32]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:408: assert_invalid passed:\n  out/test/spec/function-references/select/select.8.wasm:000001e: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, i32]\n  000001e: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:414: assert_invalid passed:\n  out/test/spec/function-references/select/select.9.wasm:0000021: error: type mismatch in select, expected [f32, f32, i32] but got [i32, f32, i32]\n  0000021: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:420: assert_invalid passed:\n  out/test/spec/function-references/select/select.10.wasm:0000025: error: type mismatch in select, expected [f64, f64, i32] but got [i32, f64, i32]\n  0000025: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:427: assert_invalid passed:\n  out/test/spec/function-references/select/select.11.wasm:000001e: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, i32]\n  000001e: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:431: assert_invalid passed:\n  out/test/spec/function-references/select/select.12.wasm:0000021: error: type mismatch in select, expected [f32, f32, i32] but got [i32, f32, i32]\n  0000021: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:435: assert_invalid passed:\n  out/test/spec/function-references/select/select.13.wasm:000001e: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, i32]\n  000001e: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:439: assert_invalid passed:\n  out/test/spec/function-references/select/select.14.wasm:0000021: error: type mismatch in select, expected [f32, f32, i32] but got [i32, f32, i32]\n  0000021: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:443: assert_invalid passed:\n  out/test/spec/function-references/select/select.15.wasm:0000025: error: type mismatch in select, expected [f64, f64, i32] but got [i32, f64, i32]\n  0000025: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:449: assert_invalid passed:\n  out/test/spec/function-references/select/select.16.wasm:0000018: error: type mismatch in select, expected [any, any, i32] but got []\n  0000018: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:457: assert_invalid passed:\n  out/test/spec/function-references/select/select.17.wasm:000001a: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  000001a: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:465: assert_invalid passed:\n  out/test/spec/function-references/select/select.18.wasm:000001c: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32]\n  000001c: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:473: assert_invalid passed:\n  out/test/spec/function-references/select/select.19.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got []\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:482: assert_invalid passed:\n  out/test/spec/function-references/select/select.20.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:491: assert_invalid passed:\n  out/test/spec/function-references/select/select.21.wasm:0000020: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:500: assert_invalid passed:\n  out/test/spec/function-references/select/select.22.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got []\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:509: assert_invalid passed:\n  out/test/spec/function-references/select/select.23.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:518: assert_invalid passed:\n  out/test/spec/function-references/select/select.24.wasm:0000020: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:527: assert_invalid passed:\n  out/test/spec/function-references/select/select.25.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got []\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:536: assert_invalid passed:\n  out/test/spec/function-references/select/select.26.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:545: assert_invalid passed:\n  out/test/spec/function-references/select/select.27.wasm:0000020: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:557: assert_invalid passed:\n  out/test/spec/function-references/select/select.28.wasm:000001e: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32, i64]\n  000001e: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:561: assert_invalid passed:\n  out/test/spec/function-references/select/select.29.wasm:0000021: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000021: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:565: assert_invalid passed:\n  out/test/spec/function-references/select/select.30.wasm:0000025: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32, f64]\n  0000025: error: OnSelectExpr callback failed\nout/test/spec/function-references/select.wast:572: assert_invalid passed:\n  out/test/spec/function-references/select/select.31.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000020: error: EndFunctionBody callback failed\n157/157 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/table-sub.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/table-sub.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/table-sub.wast:13: assert_invalid passed:\n  out/test/spec/function-references/table-sub/table-sub.1.wasm:000002a: error: type mismatch at table.copy. got externref, expected funcref\n  000002a: error: OnTableCopyExpr callback failed\nout/test/spec/function-references/table-sub.wast:24: assert_invalid passed:\n  out/test/spec/function-references/table-sub/table-sub.2.wasm:000002d: error: type mismatch at table.init. got externref, expected funcref\n  000002d: error: OnTableInitExpr callback failed\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/table.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/table.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/table.wast:22: assert_invalid passed:\n  out/test/spec/function-references/table/table.15.wasm:000000c: error: table variable out of range: 0 (max 0)\n  000000c: error: BeginElemSegment callback failed\nout/test/spec/function-references/table.wast:23: assert_invalid passed:\n  out/test/spec/function-references/table/table.16.wasm:0000016: error: table variable out of range: 0 (max 0)\n  0000016: error: BeginElemSegment callback failed\nout/test/spec/function-references/table.wast:27: assert_invalid passed:\n  out/test/spec/function-references/table/table.17.wasm:000000f: error: max elems (0) must be >= initial elems (1)\n  000000f: error: BeginTable callback failed\nout/test/spec/function-references/table.wast:31: assert_invalid passed:\n  out/test/spec/function-references/table/table.18.wasm:0000013: error: max elems (0) must be >= initial elems (4294967295)\n  0000013: error: BeginTable callback failed\nout/test/spec/function-references/table.wast:36: assert_malformed passed:\n  out/test/spec/function-references/table/table.19.wat:1:8: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 funcref)\n         ^^^^^^^^^^^^^\nout/test/spec/function-references/table.wast:40: assert_malformed passed:\n  out/test/spec/function-references/table/table.20.wat:1:8: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 0x1_0000_0000 funcref)\n         ^^^^^^^^^^^^^\n  out/test/spec/function-references/table/table.20.wat:1:22: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 0x1_0000_0000 funcref)\n                       ^^^^^^^^^^^^^\nout/test/spec/function-references/table.wast:44: assert_malformed passed:\n  out/test/spec/function-references/table/table.21.wat:1:10: error: invalid int \"0x1_0000_0000\"\n  (table 0 0x1_0000_0000 funcref)\n           ^^^^^^^^^^^^^\nout/test/spec/function-references/table.wast:49: assert_invalid passed:\n  out/test/spec/function-references/table/table.22.wasm:0000012: error: type mismatch in initializer expression, expected [funcref] but got [i32]\n  0000013: error: EndTableInitExpr callback failed\nout/test/spec/function-references/table.wast:53: assert_invalid passed:\n  out/test/spec/function-references/table/table.23.wasm:0000013: error: type mismatch in initializer expression, expected [(ref func)] but got [externref]\n  0000014: error: EndTableInitExpr callback failed\nout/test/spec/function-references/table.wast:57: assert_invalid passed:\n  out/test/spec/function-references/table/table.24.wasm:0000019: error: type mismatch in initializer expression, expected [(ref 0)] but got [funcref]\n  000001a: error: EndTableInitExpr callback failed\nout/test/spec/function-references/table.wast:61: assert_invalid passed:\n  out/test/spec/function-references/table/table.25.wasm:0000013: error: type mismatch in initializer expression, expected [(ref func)] but got [funcref]\n  0000014: error: EndTableInitExpr callback failed\nout/test/spec/function-references/table.wast:65: assert_invalid passed:\n  out/test/spec/function-references/table/table.26.wasm:000000f: error: missing table initializer\n  000000f: error: BeginTable callback failed\nout/test/spec/function-references/table.wast:69: assert_invalid passed:\n  out/test/spec/function-references/table/table.27.wasm:000000f: error: missing table initializer\n  000000f: error: BeginTable callback failed\nout/test/spec/function-references/table.wast:73: assert_invalid passed:\n  out/test/spec/function-references/table/table.28.wasm:0000015: error: missing table initializer\n  0000015: error: BeginTable callback failed\nout/test/spec/function-references/table.wast:114: assert_invalid passed:\n  out/test/spec/function-references/table/table.31.wasm:0000015: error: missing table initializer\n  0000015: error: BeginTable callback failed\nout/test/spec/function-references/table.wast:122: assert_invalid passed:\n  out/test/spec/function-references/table/table.32.wasm:0000015: error: missing table initializer\n  0000015: error: BeginTable callback failed\nout/test/spec/function-references/table.wast:130: assert_invalid passed:\n  out/test/spec/function-references/table/table.33.wasm:0000016: error: missing table initializer\n  0000016: error: BeginTable callback failed\nout/test/spec/function-references/table.wast:141: assert_malformed passed:\n  out/test/spec/function-references/table/table.34.wat:1:24: error: redefinition of table \"$foo\"\n  (table $foo 1 funcref)(table $foo 1 funcref)\n                         ^^^^^\nout/test/spec/function-references/table.wast:148: assert_malformed passed:\n  out/test/spec/function-references/table/table.35.wat:1:39: error: redefinition of table \"$foo\"\n  (import \"\" \"\" (table $foo 1 funcref))(table $foo 1 funcref)\n                                        ^^^^^\nout/test/spec/function-references/table.wast:155: assert_malformed passed:\n  out/test/spec/function-references/table/table.36.wat:1:39: error: redefinition of table \"$foo\"\n  (import \"\" \"\" (table $foo 1 funcref))(import \"\" \"\" (table $foo 1 funcref))\n                                        ^^^^^^\n42/42 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/type-equivalence.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/type-equivalence.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/type-equivalence.wast:31: assert_invalid passed:\n  out/test/spec/function-references/type-equivalence/type-equivalence.2.wasm:0000010: error: reference 0 is out of range (max: 0) in results\n  0000010: error: OnFuncType callback failed\nout/test/spec/function-references/type-equivalence.wast:38: assert_invalid passed:\n  out/test/spec/function-references/type-equivalence/type-equivalence.3.wasm:0000010: error: reference 1 is out of range (max: 0) in params\n  0000010: error: OnFuncType callback failed\n12/12 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/unreached-invalid.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/unreached-invalid.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/unreached-invalid.wast:4: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.0.wasm:000001a: error: local variable out of range (max 0)\n  000001a: error: OnLocalGetExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:8: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.1.wasm:000001a: error: global variable out of range: 0 (max 0)\n  000001a: error: OnGlobalGetExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:12: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.2.wasm:000001a: error: function variable out of range: 1 (max 1)\n  000001a: error: OnCallExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:16: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.3.wasm:0000018: error: invalid depth: 1 (max 0)\n  000001a: error: OnBrExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:21: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.4.wasm:000001b: error: type mismatch in i64.eqz, expected [i64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:27: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.5.wasm:000001f: error: type mismatch in implicit return, expected [i32] but got [i64]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:33: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.6.wasm:0000023: error: type mismatch in select, expected [i32, i32, i32] but got [i64, i32, i32]\n  0000023: error: OnSelectExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:42: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.7.wasm:000001b: error: type mismatch at end of function, expected [] but got [i32]\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:46: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.8.wasm:000001a: error: type mismatch at end of function, expected [] but got [i32]\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:50: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.9.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:56: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.10.wasm:000001a: error: type mismatch at end of function, expected [] but got [any]\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:60: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.11.wasm:000001c: error: type mismatch at end of function, expected [] but got [any]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:64: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.12.wasm:000001e: error: type mismatch at end of function, expected [] but got [i32]\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:71: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.13.wasm:000001f: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001f: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:77: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.14.wasm:0000021: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000021: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:83: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.15.wasm:0000020: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:89: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.16.wasm:0000023: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000023: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:95: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.17.wasm:000001e: error: type mismatch at end of block, expected [] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:101: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.18.wasm:0000024: error: type mismatch in block, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:107: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.19.wasm:0000020: error: type mismatch at end of loop, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:113: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.20.wasm:0000024: error: type mismatch in loop, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:119: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.21.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:125: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.22.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:132: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.23.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:138: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.24.wasm:000001e: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:144: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.25.wasm:000001d: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  000001d: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:150: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.26.wasm:0000020: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:156: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.27.wasm:000001d: error: type mismatch at end of block, expected [] but got [i32]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:162: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.28.wasm:0000025: error: type mismatch in block, expected [i32] but got [f32]\n  0000025: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:168: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.29.wasm:000001f: error: type mismatch at end of loop, expected [] but got [i32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:174: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.30.wasm:0000023: error: type mismatch in loop, expected [i32] but got [f32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:180: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.31.wasm:000001b: error: type mismatch at end of function, expected [] but got [i32]\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:186: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.32.wasm:0000021: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:193: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.33.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:199: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.34.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:205: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.35.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:211: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.36.wasm:000001e: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:217: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.37.wasm:000001d: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  000001d: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:223: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.38.wasm:0000020: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:229: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.39.wasm:000001d: error: type mismatch at end of block, expected [] but got [i32]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:235: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.40.wasm:0000023: error: type mismatch in block, expected [i32] but got [f32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:241: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.41.wasm:000001f: error: type mismatch at end of loop, expected [] but got [i32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:247: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.42.wasm:0000021: error: type mismatch in loop, expected [i32] but got [f32]\n  0000021: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:253: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.43.wasm:000001b: error: type mismatch at end of function, expected [] but got [i32]\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:259: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.44.wasm:000001f: error: type mismatch in implicit return, expected [i32] but got [f32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:265: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.45.wasm:000001e: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:271: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.46.wasm:0000020: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000020: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:277: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.47.wasm:000001f: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001f: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:284: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.48.wasm:000001f: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001f: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:290: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.49.wasm:0000021: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000021: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:296: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.50.wasm:0000020: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:302: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.51.wasm:0000023: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000023: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:308: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.52.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:314: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.53.wasm:0000026: error: type mismatch in block, expected [i32] but got [... f32]\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.53.wasm:0000026: error: type mismatch at end of block, expected [] but got [i32]\n  0000026: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:321: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.54.wasm:0000022: error: type mismatch at end of loop, expected [] but got [i32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:327: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.55.wasm:0000024: error: type mismatch in loop, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:334: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.56.wasm:000001e: error: type mismatch at end of function, expected [] but got [i32]\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:340: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.57.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:348: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.58.wasm:0000020: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000020: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:354: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.59.wasm:0000022: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000022: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:360: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.60.wasm:0000021: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:366: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.61.wasm:0000024: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000024: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:372: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.62.wasm:0000021: error: type mismatch at end of block, expected [] but got [i32]\n  0000021: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:378: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.63.wasm:0000027: error: type mismatch in block, expected [i32] but got [... f32]\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.63.wasm:0000027: error: type mismatch at end of block, expected [] but got [i32]\n  0000027: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:384: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.64.wasm:0000023: error: type mismatch at end of loop, expected [] but got [i32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:390: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.65.wasm:0000025: error: type mismatch in loop, expected [i32] but got [f32]\n  0000025: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:396: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.66.wasm:000001f: error: type mismatch at end of function, expected [] but got [i32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:402: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.67.wasm:0000023: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000023: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:409: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.68.wasm:000001d: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:415: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.69.wasm:0000021: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000021: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:421: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.70.wasm:000001e: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  000001e: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:427: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.71.wasm:0000023: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000023: error: OnCompareExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:433: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.72.wasm:000001e: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:439: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.73.wasm:0000022: error: type mismatch in `if true` branch, expected [i32] but got [f32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:445: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.74.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:451: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.75.wasm:0000024: error: type mismatch in block, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:457: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.76.wasm:0000020: error: type mismatch at end of loop, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:463: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.77.wasm:0000024: error: type mismatch in loop, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:470: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.78.wasm:0000025: error: type mismatch in return, expected [i32] but got [f64]\n  0000025: error: OnReturnExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:477: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.79.wasm:0000029: error: type mismatch in br, expected [i32] but got [f64]\n  0000029: error: OnBrExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:484: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.80.wasm:0000021: error: type mismatch in br_if, expected [i32] but got [f32]\n  0000021: error: OnBrIfExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:490: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.81.wasm:0000024: error: type mismatch at end of block, expected [] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:498: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.82.wasm:0000024: error: type mismatch in block, expected [f32] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:507: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.83.wasm:0000024: error: type mismatch at end of block, expected [] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:515: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.84.wasm:0000022: error: type mismatch in br_table, expected [i32] but got [f32]\n  0000022: error: OnBrTableExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:521: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.85.wasm:0000025: error: type mismatch in br_table, expected [i32] but got [f32]\n  0000025: error: OnBrTableExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:527: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.86.wasm:0000023: error: br_table labels have inconsistent types: expected [f32], got []\n  0000023: error: OnBrTableExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:540: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.87.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:546: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.88.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got []\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:552: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.89.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:558: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.90.wasm:0000023: error: type mismatch at end of block, expected [] but got [i32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:565: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.91.wasm:0000021: error: type mismatch at end of block, expected [] but got [i32]\n  0000021: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:571: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.92.wasm:0000022: error: type mismatch in block, expected [i32] but got []\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:577: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.93.wasm:0000024: error: type mismatch in block, expected [i32] but got [i64]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:584: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.94.wasm:0000023: error: type mismatch at end of block, expected [] but got [i32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:590: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.95.wasm:0000025: error: type mismatch in block, expected [i32] but got []\n  0000025: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:596: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.96.wasm:0000027: error: type mismatch in block, expected [i32] but got [i64]\n  0000027: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:604: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.97.wasm:0000024: error: type mismatch at end of block, expected [] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:611: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.98.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:617: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.99.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got []\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:623: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.100.wasm:0000024: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000024: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:629: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.101.wasm:0000025: error: type mismatch at end of block, expected [] but got [i32]\n  0000025: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:637: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.102.wasm:0000020: error: type mismatch at end of loop, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:643: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.103.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got []\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:649: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.104.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:656: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.105.wasm:000001f: error: type mismatch in implicit return, expected [i32] but got []\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:662: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.106.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got []\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:669: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.107.wasm:000001d: error: type mismatch at end of function, expected [] but got [i32]\n  000001d: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:676: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.108.wasm:0000022: error: type mismatch at end of block, expected [] but got [i32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:687: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.109.wasm:000001c: error: type mismatch in i64.extend_i32_u, expected [i32] but got [i64]\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:698: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.110.wasm:000001b: error: type mismatch at end of function, expected [] but got [f32]\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:710: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.111.wasm:000001f: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, i32]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:715: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.112.wasm:000001f: error: type mismatch in select, expected [i32, i32, i32] but got [i64, i32, i32]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:721: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.113.wasm:000001f: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32, i64]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:726: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.114.wasm:000001d: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i64]\n  000001d: error: OnSelectExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:731: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.115.wasm:000001b: error: type mismatch in select, expected [any, any, i32] but got [i64]\n  000001b: error: OnSelectExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:737: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.116.wasm:000001f: error: type mismatch in implicit return, expected [i32] but got [i64]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:744: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.117.wasm:000001a: error: type mismatch at end of function, expected [] but got [any]\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:749: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.118.wasm:0000026: error: type mismatch in br_table, expected [i32] but got [externref]\n  0000026: error: OnBrTableExpr callback failed\nout/test/spec/function-references/unreached-invalid.wast:764: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.119.wasm:0000021: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/function-references/unreached-invalid.wast:774: assert_invalid passed:\n  out/test/spec/function-references/unreached-invalid/unreached-invalid.120.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\n121/121 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/function-references/unreached-valid.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/function-references/unreached-valid.wast\n;;; ARGS*: --enable-function-references\n(;; STDOUT ;;;\nout/test/spec/function-references/unreached-valid.wast:48: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:49: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:50: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:51: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:53: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:54: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:55: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:56: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:58: assert_trap passed: unreachable executed\nout/test/spec/function-references/unreached-valid.wast:77: assert_trap passed: unreachable executed\n12/12 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/global.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/global.wast\n(;; STDOUT ;;;\nout/test/spec/global.wast:251: assert_trap passed: undefined table index\nout/test/spec/global.wast:273: assert_invalid passed:\n  out/test/spec/global/global.1.wasm:0000029: error: can't global.set on immutable global at index 0.\n  0000029: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:278: assert_invalid passed:\n  out/test/spec/global/global.2.wasm:0000035: error: can't global.set on immutable global at index 0.\n  0000035: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:287: assert_invalid passed:\n  out/test/spec/global/global.5.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: f32.neg\n  0000013: error: OnUnaryExpr callback failed\nout/test/spec/global.wast:292: assert_invalid passed:\n  out/test/spec/global/global.6.wasm:000000f: error: invalid initializer: instruction not valid in initializer expression: local.get\n  000000f: error: OnLocalGetExpr callback failed\nout/test/spec/global.wast:297: assert_invalid passed:\n  out/test/spec/global/global.7.wasm:0000013: error: invalid initializer: instruction not valid in initializer expression: f32.neg\n  0000013: error: OnUnaryExpr callback failed\nout/test/spec/global.wast:302: assert_invalid passed:\n  out/test/spec/global/global.8.wasm:0000010: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000010: error: OnNopExpr callback failed\nout/test/spec/global.wast:307: assert_invalid passed:\n  out/test/spec/global/global.9.wasm:0000010: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000010: error: OnUnaryExpr callback failed\nout/test/spec/global.wast:312: assert_invalid passed:\n  out/test/spec/global/global.10.wasm:000000e: error: invalid initializer: instruction not valid in initializer expression: nop\n  000000e: error: OnNopExpr callback failed\nout/test/spec/global.wast:317: assert_invalid passed:\n  out/test/spec/global/global.11.wasm:0000012: error: type mismatch in initializer expression, expected [i32] but got [f32]\n  0000013: error: EndGlobalInitExpr callback failed\nout/test/spec/global.wast:322: assert_invalid passed:\n  out/test/spec/global/global.12.wasm:0000011: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000012: error: EndGlobalInitExpr callback failed\nout/test/spec/global.wast:327: assert_invalid passed:\n  out/test/spec/global/global.13.wasm:000000d: error: type mismatch in initializer expression, expected [i32] but got []\n  000000e: error: EndGlobalInitExpr callback failed\nout/test/spec/global.wast:332: assert_invalid passed:\n  out/test/spec/global/global.14.wasm:0000017: error: type mismatch in initializer expression, expected [funcref] but got [externref]\n  0000018: error: EndGlobalInitExpr callback failed\nout/test/spec/global.wast:337: assert_invalid passed:\n  out/test/spec/global/global.15.wasm:0000027: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000028: error: EndGlobalInitExpr callback failed\nout/test/spec/global.wast:342: assert_invalid passed:\n  out/test/spec/global/global.16.wasm:0000027: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000028: error: EndGlobalInitExpr callback failed\nout/test/spec/global.wast:347: assert_invalid passed:\n  out/test/spec/global/global.17.wasm:000000f: error: initializer expression can only reference an imported global\n  000000f: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:352: assert_invalid passed:\n  out/test/spec/global/global.18.wasm:0000014: error: initializer expression can only reference an imported global\n  0000014: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:356: assert_invalid passed:\n  out/test/spec/global/global.19.wasm:0000014: error: initializer expression can only reference an imported global\n  0000014: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:361: assert_invalid passed:\n  out/test/spec/global/global.20.wasm:000000f: error: global variable out of range: 1 (max 1)\n  000000f: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:366: assert_invalid passed:\n  out/test/spec/global/global.21.wasm:0000025: error: global variable out of range: 2 (max 2)\n  0000025: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:371: assert_invalid passed:\n  out/test/spec/global/global.22.wasm:0000029: error: initializer expression cannot reference a mutable global\n  0000029: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:379: assert_malformed passed:\n  0000026: error: global mutability must be 0 or 1\nout/test/spec/global.wast:392: assert_malformed passed:\n  0000026: error: global mutability must be 0 or 1\nout/test/spec/global.wast:409: assert_malformed passed:\n  0000011: error: global mutability must be 0 or 1\nout/test/spec/global.wast:421: assert_malformed passed:\n  0000011: error: global mutability must be 0 or 1\nout/test/spec/global.wast:435: assert_invalid passed:\n  out/test/spec/global/global.29.wasm:000001a: error: global variable out of range: 0 (max 0)\n  000001a: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:440: assert_invalid passed:\n  out/test/spec/global/global.30.wasm:0000022: error: global variable out of range: 1 (max 1)\n  0000022: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:448: assert_invalid passed:\n  out/test/spec/global/global.31.wasm:0000034: error: global variable out of range: 1 (max 1)\n  0000034: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:456: assert_invalid passed:\n  out/test/spec/global/global.32.wasm:000003c: error: global variable out of range: 2 (max 2)\n  000003c: error: OnGlobalGetExpr callback failed\nout/test/spec/global.wast:466: assert_invalid passed:\n  out/test/spec/global/global.33.wasm:000001b: error: global variable out of range: 0 (max 0)\n  000001b: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:471: assert_invalid passed:\n  out/test/spec/global/global.34.wasm:0000023: error: global variable out of range: 1 (max 1)\n  0000023: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:479: assert_invalid passed:\n  out/test/spec/global/global.35.wasm:0000035: error: global variable out of range: 1 (max 1)\n  0000035: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:487: assert_invalid passed:\n  out/test/spec/global/global.36.wasm:000003d: error: global variable out of range: 2 (max 2)\n  000003d: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:497: assert_invalid passed:\n  out/test/spec/global/global.37.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:506: assert_invalid passed:\n  out/test/spec/global/global.38.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:516: assert_invalid passed:\n  out/test/spec/global/global.39.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:526: assert_invalid passed:\n  out/test/spec/global/global.40.wasm:0000027: error: type mismatch in global.set, expected [i32] but got []\n  0000027: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:536: assert_invalid passed:\n  out/test/spec/global/global.41.wasm:000002a: error: type mismatch in global.set, expected [i32] but got []\n  000002a: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:546: assert_invalid passed:\n  out/test/spec/global/global.42.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:556: assert_invalid passed:\n  out/test/spec/global/global.43.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:566: assert_invalid passed:\n  out/test/spec/global/global.44.wasm:0000025: error: type mismatch in global.set, expected [i32] but got []\n  0000025: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:576: assert_invalid passed:\n  out/test/spec/global/global.45.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:585: assert_invalid passed:\n  out/test/spec/global/global.46.wasm:0000021: error: type mismatch in global.set, expected [i32] but got []\n  0000021: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:594: assert_invalid passed:\n  out/test/spec/global/global.47.wasm:0000027: error: type mismatch in global.set, expected [i32] but got []\n  0000027: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:604: assert_invalid passed:\n  out/test/spec/global/global.48.wasm:000003e: error: type mismatch in global.set, expected [i32] but got []\n  000003e: error: OnGlobalSetExpr callback failed\nout/test/spec/global.wast:622: assert_malformed passed:\n  out/test/spec/global/global.49.wat:1:33: error: redefinition of global \"$foo\"\n  (global $foo i32 (i32.const 0))(global $foo i32 (i32.const 0))\n                                  ^^^^^^\nout/test/spec/global.wast:626: assert_malformed passed:\n  out/test/spec/global/global.50.wat:1:34: error: redefinition of global \"$foo\"\n  (import \"\" \"\" (global $foo i32))(global $foo i32 (i32.const 0))\n                                   ^^^^^^\nout/test/spec/global.wast:630: assert_malformed passed:\n  out/test/spec/global/global.51.wat:1:34: error: redefinition of global \"$foo\"\n  (import \"\" \"\" (global $foo i32))(import \"\" \"\" (global $foo i32))\n                                   ^^^^^^\n110/110 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/i32.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/i32.wast\n(;; STDOUT ;;;\nout/test/spec/i32.wast:64: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:65: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:66: assert_trap passed: integer overflow\nout/test/spec/i32.wast:67: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:85: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:86: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:102: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:103: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:123: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:124: assert_trap passed: integer divide by zero\nout/test/spec/i32.wast:444: assert_invalid passed:\n  out/test/spec/i32/i32.1.wasm:0000018: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000018: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:452: assert_invalid passed:\n  out/test/spec/i32/i32.2.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:461: assert_invalid passed:\n  out/test/spec/i32/i32.3.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:470: assert_invalid passed:\n  out/test/spec/i32/i32.4.wasm:000001e: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:479: assert_invalid passed:\n  out/test/spec/i32/i32.5.wasm:0000021: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000021: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:488: assert_invalid passed:\n  out/test/spec/i32/i32.6.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:497: assert_invalid passed:\n  out/test/spec/i32/i32.7.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:506: assert_invalid passed:\n  out/test/spec/i32/i32.8.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:515: assert_invalid passed:\n  out/test/spec/i32/i32.9.wasm:0000018: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000018: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:523: assert_invalid passed:\n  out/test/spec/i32/i32.10.wasm:0000018: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000018: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:531: assert_invalid passed:\n  out/test/spec/i32/i32.11.wasm:000001e: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:540: assert_invalid passed:\n  out/test/spec/i32/i32.12.wasm:0000035: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000035: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:556: assert_invalid passed:\n  out/test/spec/i32/i32.13.wasm:000001a: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001a: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:565: assert_invalid passed:\n  out/test/spec/i32/i32.14.wasm:000001a: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001a: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:574: assert_invalid passed:\n  out/test/spec/i32/i32.15.wasm:0000020: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000020: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:583: assert_invalid passed:\n  out/test/spec/i32/i32.16.wasm:000001d: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:592: assert_invalid passed:\n  out/test/spec/i32/i32.17.wasm:000001d: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:601: assert_invalid passed:\n  out/test/spec/i32/i32.18.wasm:000001d: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:611: assert_invalid passed:\n  out/test/spec/i32/i32.19.wasm:0000018: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000018: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:619: assert_invalid passed:\n  out/test/spec/i32/i32.20.wasm:000001a: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:627: assert_invalid passed:\n  out/test/spec/i32/i32.21.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:636: assert_invalid passed:\n  out/test/spec/i32/i32.22.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:645: assert_invalid passed:\n  out/test/spec/i32/i32.23.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:654: assert_invalid passed:\n  out/test/spec/i32/i32.24.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:663: assert_invalid passed:\n  out/test/spec/i32/i32.25.wasm:0000021: error: type mismatch in drop, expected [any] but got []\n  0000021: error: OnDropExpr callback failed\nout/test/spec/i32.wast:672: assert_invalid passed:\n  out/test/spec/i32/i32.26.wasm:0000020: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:681: assert_invalid passed:\n  out/test/spec/i32/i32.27.wasm:0000023: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000023: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:691: assert_invalid passed:\n  out/test/spec/i32/i32.28.wasm:0000021: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:701: assert_invalid passed:\n  out/test/spec/i32/i32.29.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:710: assert_invalid passed:\n  out/test/spec/i32/i32.30.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:719: assert_invalid passed:\n  out/test/spec/i32/i32.31.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:728: assert_invalid passed:\n  out/test/spec/i32/i32.32.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:737: assert_invalid passed:\n  out/test/spec/i32/i32.33.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:746: assert_invalid passed:\n  out/test/spec/i32/i32.34.wasm:000001e: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:755: assert_invalid passed:\n  out/test/spec/i32/i32.35.wasm:0000018: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000018: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:763: assert_invalid passed:\n  out/test/spec/i32/i32.36.wasm:000001a: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:771: assert_invalid passed:\n  out/test/spec/i32/i32.37.wasm:0000018: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000018: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:779: assert_invalid passed:\n  out/test/spec/i32/i32.38.wasm:000001a: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:787: assert_invalid passed:\n  out/test/spec/i32/i32.39.wasm:000001f: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:796: assert_invalid passed:\n  out/test/spec/i32/i32.40.wasm:0000021: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:805: assert_invalid passed:\n  out/test/spec/i32/i32.41.wasm:0000035: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000035: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:821: assert_invalid passed:\n  out/test/spec/i32/i32.42.wasm:0000037: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  0000037: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:837: assert_invalid passed:\n  out/test/spec/i32/i32.43.wasm:000001a: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:846: assert_invalid passed:\n  out/test/spec/i32/i32.44.wasm:000001c: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001c: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:855: assert_invalid passed:\n  out/test/spec/i32/i32.45.wasm:000001a: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:864: assert_invalid passed:\n  out/test/spec/i32/i32.46.wasm:000001c: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001c: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:873: assert_invalid passed:\n  out/test/spec/i32/i32.47.wasm:0000020: error: type mismatch in i32.add, expected [i32, i32] but got []\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:882: assert_invalid passed:\n  out/test/spec/i32/i32.48.wasm:0000022: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:891: assert_invalid passed:\n  out/test/spec/i32/i32.49.wasm:000001d: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001d: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:900: assert_invalid passed:\n  out/test/spec/i32/i32.50.wasm:000001f: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:909: assert_invalid passed:\n  out/test/spec/i32/i32.51.wasm:000001d: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001d: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:918: assert_invalid passed:\n  out/test/spec/i32/i32.52.wasm:000001f: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:927: assert_invalid passed:\n  out/test/spec/i32/i32.53.wasm:000001d: error: type mismatch in i32.add, expected [i32, i32] but got []\n  000001d: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:936: assert_invalid passed:\n  out/test/spec/i32/i32.54.wasm:000001f: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:948: assert_invalid passed:\n  out/test/spec/i32/i32.55.wasm:0000020: error: type mismatch in i32.add, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:949: assert_invalid passed:\n  out/test/spec/i32/i32.56.wasm:0000020: error: type mismatch in i32.and, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:950: assert_invalid passed:\n  out/test/spec/i32/i32.57.wasm:0000020: error: type mismatch in i32.div_s, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:951: assert_invalid passed:\n  out/test/spec/i32/i32.58.wasm:0000020: error: type mismatch in i32.div_u, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:952: assert_invalid passed:\n  out/test/spec/i32/i32.59.wasm:0000020: error: type mismatch in i32.mul, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:953: assert_invalid passed:\n  out/test/spec/i32/i32.60.wasm:0000020: error: type mismatch in i32.or, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:954: assert_invalid passed:\n  out/test/spec/i32/i32.61.wasm:0000020: error: type mismatch in i32.rem_s, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:955: assert_invalid passed:\n  out/test/spec/i32/i32.62.wasm:0000020: error: type mismatch in i32.rem_u, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:956: assert_invalid passed:\n  out/test/spec/i32/i32.63.wasm:0000020: error: type mismatch in i32.rotl, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:957: assert_invalid passed:\n  out/test/spec/i32/i32.64.wasm:0000020: error: type mismatch in i32.rotr, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:958: assert_invalid passed:\n  out/test/spec/i32/i32.65.wasm:0000020: error: type mismatch in i32.shl, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:959: assert_invalid passed:\n  out/test/spec/i32/i32.66.wasm:0000020: error: type mismatch in i32.shr_s, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:960: assert_invalid passed:\n  out/test/spec/i32/i32.67.wasm:0000020: error: type mismatch in i32.shr_u, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:961: assert_invalid passed:\n  out/test/spec/i32/i32.68.wasm:0000020: error: type mismatch in i32.sub, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:962: assert_invalid passed:\n  out/test/spec/i32/i32.69.wasm:0000020: error: type mismatch in i32.xor, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i32.wast:963: assert_invalid passed:\n  out/test/spec/i32/i32.70.wasm:000001b: error: type mismatch in i32.eqz, expected [i32] but got [i64]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/i32.wast:964: assert_invalid passed:\n  out/test/spec/i32/i32.71.wasm:000001b: error: type mismatch in i32.clz, expected [i32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/i32.wast:965: assert_invalid passed:\n  out/test/spec/i32/i32.72.wasm:000001b: error: type mismatch in i32.ctz, expected [i32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/i32.wast:966: assert_invalid passed:\n  out/test/spec/i32/i32.73.wasm:000001b: error: type mismatch in i32.popcnt, expected [i32] but got [i64]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/i32.wast:967: assert_invalid passed:\n  out/test/spec/i32/i32.74.wasm:0000020: error: type mismatch in i32.eq, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:968: assert_invalid passed:\n  out/test/spec/i32/i32.75.wasm:0000020: error: type mismatch in i32.ge_s, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:969: assert_invalid passed:\n  out/test/spec/i32/i32.76.wasm:0000020: error: type mismatch in i32.ge_u, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:970: assert_invalid passed:\n  out/test/spec/i32/i32.77.wasm:0000020: error: type mismatch in i32.gt_s, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:971: assert_invalid passed:\n  out/test/spec/i32/i32.78.wasm:0000020: error: type mismatch in i32.gt_u, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:972: assert_invalid passed:\n  out/test/spec/i32/i32.79.wasm:0000020: error: type mismatch in i32.le_s, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:973: assert_invalid passed:\n  out/test/spec/i32/i32.80.wasm:0000020: error: type mismatch in i32.le_u, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:974: assert_invalid passed:\n  out/test/spec/i32/i32.81.wasm:0000020: error: type mismatch in i32.lt_s, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:975: assert_invalid passed:\n  out/test/spec/i32/i32.82.wasm:0000020: error: type mismatch in i32.lt_u, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:976: assert_invalid passed:\n  out/test/spec/i32/i32.83.wasm:0000020: error: type mismatch in i32.ne, expected [i32, i32] but got [i64, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i32.wast:979: assert_malformed passed:\n  out/test/spec/i32/i32.84.wat:1:31: error: invalid literal \"nan:arithmetic\"\n  (func (result i32) (i32.const nan:arithmetic))\n                                ^^^^^^^^^^^^^^\nout/test/spec/i32.wast:983: assert_malformed passed:\n  out/test/spec/i32/i32.85.wat:1:31: error: invalid literal \"nan:canonical\"\n  (func (result i32) (i32.const nan:canonical))\n                                ^^^^^^^^^^^^^\n460/460 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/i64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/i64.wast\n(;; STDOUT ;;;\nout/test/spec/i64.wast:65: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:66: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:67: assert_trap passed: integer overflow\nout/test/spec/i64.wast:68: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:86: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:87: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:103: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:104: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:124: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:125: assert_trap passed: integer divide by zero\nout/test/spec/i64.wast:457: assert_invalid passed:\n  out/test/spec/i64/i64.1.wasm:0000020: error: type mismatch in i64.add, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:458: assert_invalid passed:\n  out/test/spec/i64/i64.2.wasm:0000020: error: type mismatch in i64.and, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:459: assert_invalid passed:\n  out/test/spec/i64/i64.3.wasm:0000020: error: type mismatch in i64.div_s, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:460: assert_invalid passed:\n  out/test/spec/i64/i64.4.wasm:0000020: error: type mismatch in i64.div_u, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:461: assert_invalid passed:\n  out/test/spec/i64/i64.5.wasm:0000020: error: type mismatch in i64.mul, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:462: assert_invalid passed:\n  out/test/spec/i64/i64.6.wasm:0000020: error: type mismatch in i64.or, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:463: assert_invalid passed:\n  out/test/spec/i64/i64.7.wasm:0000020: error: type mismatch in i64.rem_s, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:464: assert_invalid passed:\n  out/test/spec/i64/i64.8.wasm:0000020: error: type mismatch in i64.rem_u, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:465: assert_invalid passed:\n  out/test/spec/i64/i64.9.wasm:0000020: error: type mismatch in i64.rotl, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:466: assert_invalid passed:\n  out/test/spec/i64/i64.10.wasm:0000020: error: type mismatch in i64.rotr, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:467: assert_invalid passed:\n  out/test/spec/i64/i64.11.wasm:0000020: error: type mismatch in i64.shl, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:468: assert_invalid passed:\n  out/test/spec/i64/i64.12.wasm:0000020: error: type mismatch in i64.shr_s, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:469: assert_invalid passed:\n  out/test/spec/i64/i64.13.wasm:0000020: error: type mismatch in i64.shr_u, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:470: assert_invalid passed:\n  out/test/spec/i64/i64.14.wasm:0000020: error: type mismatch in i64.sub, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:471: assert_invalid passed:\n  out/test/spec/i64/i64.15.wasm:0000020: error: type mismatch in i64.xor, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnBinaryExpr callback failed\nout/test/spec/i64.wast:472: assert_invalid passed:\n  out/test/spec/i64/i64.16.wasm:000001b: error: type mismatch in i64.eqz, expected [i64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/i64.wast:473: assert_invalid passed:\n  out/test/spec/i64/i64.17.wasm:000001b: error: type mismatch in i64.clz, expected [i64] but got [i32]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/i64.wast:474: assert_invalid passed:\n  out/test/spec/i64/i64.18.wasm:000001b: error: type mismatch in i64.ctz, expected [i64] but got [i32]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/i64.wast:475: assert_invalid passed:\n  out/test/spec/i64/i64.19.wasm:000001b: error: type mismatch in i64.popcnt, expected [i64] but got [i32]\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/i64.wast:476: assert_invalid passed:\n  out/test/spec/i64/i64.20.wasm:0000020: error: type mismatch in i64.eq, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:477: assert_invalid passed:\n  out/test/spec/i64/i64.21.wasm:0000020: error: type mismatch in i64.ge_s, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:478: assert_invalid passed:\n  out/test/spec/i64/i64.22.wasm:0000020: error: type mismatch in i64.ge_u, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:479: assert_invalid passed:\n  out/test/spec/i64/i64.23.wasm:0000020: error: type mismatch in i64.gt_s, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:480: assert_invalid passed:\n  out/test/spec/i64/i64.24.wasm:0000020: error: type mismatch in i64.gt_u, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:481: assert_invalid passed:\n  out/test/spec/i64/i64.25.wasm:0000020: error: type mismatch in i64.le_s, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:482: assert_invalid passed:\n  out/test/spec/i64/i64.26.wasm:0000020: error: type mismatch in i64.le_u, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:483: assert_invalid passed:\n  out/test/spec/i64/i64.27.wasm:0000020: error: type mismatch in i64.lt_s, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:484: assert_invalid passed:\n  out/test/spec/i64/i64.28.wasm:0000020: error: type mismatch in i64.lt_u, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:485: assert_invalid passed:\n  out/test/spec/i64/i64.29.wasm:0000020: error: type mismatch in i64.ne, expected [i64, i64] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/i64.wast:488: assert_malformed passed:\n  out/test/spec/i64/i64.30.wat:1:31: error: invalid literal \"nan:arithmetic\"\n  (func (result i64) (i64.const nan:arithmetic))\n                                ^^^^^^^^^^^^^^\nout/test/spec/i64.wast:492: assert_malformed passed:\n  out/test/spec/i64/i64.31.wat:1:31: error: invalid literal \"nan:canonical\"\n  (func (result i64) (i64.const nan:canonical))\n                                ^^^^^^^^^^^^^\n416/416 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/if.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/if.wast\n(;; STDOUT ;;;\nout/test/spec/if.wast:593: assert_trap passed: undefined table index\nout/test/spec/if.wast:736: assert_malformed passed:\n  out/test/spec/if/if.1.wat:1:95: error: unexpected token \"param\", expected then block (e.g. (then ...)).\n  ...i32.const 0)  (if (type $sig) (result i32) (param i32) (i32.const 1) (then)))\n                                                 ^^^^^\n  out/test/spec/if/if.1.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (type $sig) (result i32) (param i32) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/if.wast:745: assert_malformed passed:\n  out/test/spec/if/if.2.wat:1:82: error: unexpected token \"type\", expected then block (e.g. (then ...)).\n  ...nc (i32.const 0)  (if (param i32) (type $sig) (result i32) (i32.const 1) (...\n                                        ^^^^\n  out/test/spec/if/if.2.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (param i32) (type $sig) (result i32) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/if.wast:754: assert_malformed passed:\n  out/test/spec/if/if.3.wat:1:95: error: unexpected token \"type\", expected then block (e.g. (then ...)).\n  ...i32.const 0)  (if (param i32) (result i32) (type $sig) (i32.const 1) (then)))\n                                                 ^^^^\n  out/test/spec/if/if.3.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (param i32) (result i32) (type $sig) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/if.wast:763: assert_malformed passed:\n  out/test/spec/if/if.4.wat:1:83: error: unexpected token \"type\", expected then block (e.g. (then ...)).\n  ...c (i32.const 0)  (if (result i32) (type $sig) (param i32) (i32.const 1) (t...\n                                        ^^^^\n  out/test/spec/if/if.4.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (result i32) (type $sig) (param i32) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/if.wast:772: assert_malformed passed:\n  out/test/spec/if/if.5.wat:1:83: error: unexpected token \"param\", expected then block (e.g. (then ...)).\n  ...c (i32.const 0)  (if (result i32) (param i32) (type $sig) (i32.const 1) (t...\n                                        ^^^^^\n  out/test/spec/if/if.5.wat:1:121: error: unexpected token \"then\", expected an instr.\n  ...i32.const 0)  (if (result i32) (param i32) (type $sig) (i32.const 1) (then)))\n                                                                           ^^^^\nout/test/spec/if.wast:781: assert_malformed passed:\n  out/test/spec/if/if.6.wat:1:39: error: unexpected token \"param\", expected then block (e.g. (then ...)).\n  (func (i32.const 0) (if (result i32) (param i32) (i32.const 1) (then)))\n                                        ^^^^^\n  out/test/spec/if/if.6.wat:1:65: error: unexpected token \"then\", expected an instr.\n  (func (i32.const 0) (if (result i32) (param i32) (i32.const 1) (then)))\n                                                                  ^^^^\nout/test/spec/if.wast:788: assert_malformed passed:\n  out/test/spec/if/if.7.wat:1:47: error: unexpected token $x, expected ).\n  ...(i32.const 0) (i32.const 1)  (if (param $x i32) (then (drop)) (else (drop))))\n                                             ^^\n  out/test/spec/if/if.7.wat:1:69: error: unexpected token (, expected EOF.\n  ...(i32.const 0) (i32.const 1)  (if (param $x i32) (then (drop)) (else (drop))))\n                                                                   ^\nout/test/spec/if.wast:796: assert_malformed passed:\n  out/test/spec/if/if.8.wat:1:40: error: expected 0 results, got 1\n  (type $sig (func))(func (i32.const 1)  (if (type $sig) (result i32) (then (i3...\n                                         ^\nout/test/spec/if.wast:806: assert_malformed passed:\n  out/test/spec/if/if.9.wat:1:65: error: expected 1 arguments, got 0\n  ...) (result i32)))(func (i32.const 1)  (if (type $sig) (result i32) (then (i...\n                                          ^\nout/test/spec/if.wast:816: assert_malformed passed:\n  out/test/spec/if/if.10.wat:1:79: error: expected 1 results, got 0\n  ...))(func (i32.const 0) (i32.const 1)  (if (type $sig) (param i32) (then (dr...\n                                          ^\nout/test/spec/if.wast:826: assert_malformed passed:\n  out/test/spec/if/if.11.wat:1:83: error: expected 2 arguments, got 1\n  ...))(func (i32.const 0) (i32.const 1)  (if (type $sig) (param i32) (result i...\n                                          ^\nout/test/spec/if.wast:836: assert_invalid passed:\n  out/test/spec/if/if.12.wasm:000001f: error: type mismatch at end of function, expected [] but got [i32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/if.wast:844: assert_invalid passed:\n  out/test/spec/if/if.13.wasm:000001e: error: type mismatch in implicit return, expected [i32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/if.wast:848: assert_invalid passed:\n  out/test/spec/if/if.14.wasm:000001e: error: type mismatch in implicit return, expected [i64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/if.wast:852: assert_invalid passed:\n  out/test/spec/if/if.15.wasm:000001e: error: type mismatch in implicit return, expected [f32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/if.wast:856: assert_invalid passed:\n  out/test/spec/if/if.16.wasm:000001e: error: type mismatch in implicit return, expected [f64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/if.wast:861: assert_invalid passed:\n  out/test/spec/if/if.17.wasm:000001e: error: type mismatch in implicit return, expected [i32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/if.wast:865: assert_invalid passed:\n  out/test/spec/if/if.18.wasm:000001e: error: type mismatch in implicit return, expected [i64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/if.wast:869: assert_invalid passed:\n  out/test/spec/if/if.19.wasm:000001e: error: type mismatch in implicit return, expected [f32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/if.wast:873: assert_invalid passed:\n  out/test/spec/if/if.20.wasm:000001e: error: type mismatch in implicit return, expected [f64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/if.wast:878: assert_invalid passed:\n  out/test/spec/if/if.21.wasm:000001e: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/if.wast:884: assert_invalid passed:\n  out/test/spec/if/if.22.wasm:000001e: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/if.wast:890: assert_invalid passed:\n  out/test/spec/if/if.23.wasm:000001f: error: type mismatch at end of `if false` branch, expected [] but got [i32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/if.wast:896: assert_invalid passed:\n  out/test/spec/if/if.24.wasm:000001d: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  000001e: error: OnElseExpr callback failed\nout/test/spec/if.wast:903: assert_invalid passed:\n  out/test/spec/if/if.25.wasm:0000020: error: type mismatch at end of `if true` branch, expected [] but got [i32, i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/if.wast:909: assert_invalid passed:\n  out/test/spec/if/if.26.wasm:0000020: error: type mismatch at end of `if true` branch, expected [] but got [i32, i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/if.wast:915: assert_invalid passed:\n  out/test/spec/if/if.27.wasm:0000021: error: type mismatch at end of `if false` branch, expected [] but got [i32, i32]\n  0000021: error: OnEndExpr callback failed\nout/test/spec/if.wast:921: assert_invalid passed:\n  out/test/spec/if/if.28.wasm:000001f: error: type mismatch at end of `if true` branch, expected [] but got [i32, i32]\n  0000020: error: OnElseExpr callback failed\nout/test/spec/if.wast:928: assert_invalid passed:\n  out/test/spec/if/if.29.wasm:000001c: error: type mismatch in `if true` branch, expected [i32] but got []\n  000001d: error: OnElseExpr callback failed\nout/test/spec/if.wast:934: assert_invalid passed:\n  out/test/spec/if/if.30.wasm:000001f: error: type mismatch in `if false` branch, expected [i32] but got []\n  000001f: error: OnEndExpr callback failed\nout/test/spec/if.wast:940: assert_invalid passed:\n  out/test/spec/if/if.31.wasm:000001d: error: type mismatch in `if true` branch, expected [i32] but got []\n  000001d: error: OnEndExpr callback failed\nout/test/spec/if.wast:947: assert_invalid passed:\n  out/test/spec/if/if.32.wasm:000001d: error: type mismatch in `if true` branch, expected [i32, i32] but got []\n  000001e: error: OnElseExpr callback failed\nout/test/spec/if.wast:953: assert_invalid passed:\n  out/test/spec/if/if.33.wasm:0000022: error: type mismatch in `if false` branch, expected [i32, i32] but got []\n  0000022: error: OnEndExpr callback failed\nout/test/spec/if.wast:959: assert_invalid passed:\n  out/test/spec/if/if.34.wasm:000001e: error: type mismatch in `if true` branch, expected [i32, i32] but got []\n  000001e: error: OnEndExpr callback failed\nout/test/spec/if.wast:966: assert_invalid passed:\n  out/test/spec/if/if.35.wasm:000001f: error: type mismatch in `if false` branch, expected [i32] but got []\n  000001f: error: OnEndExpr callback failed\nout/test/spec/if.wast:972: assert_invalid passed:\n  out/test/spec/if/if.36.wasm:0000022: error: type mismatch in `if false` branch, expected [i32, i32] but got []\n  0000022: error: OnEndExpr callback failed\nout/test/spec/if.wast:979: assert_invalid passed:\n  out/test/spec/if/if.37.wasm:000001d: error: type mismatch in `if true` branch, expected [i32] but got []\n  000001e: error: OnElseExpr callback failed\nout/test/spec/if.wast:985: assert_invalid passed:\n  out/test/spec/if/if.38.wasm:0000021: error: type mismatch in `if false` branch, expected [i32] but got []\n  0000021: error: OnEndExpr callback failed\nout/test/spec/if.wast:991: assert_invalid passed:\n  out/test/spec/if/if.39.wasm:000001d: error: type mismatch in `if true` branch, expected [i32] but got []\n  000001e: error: OnElseExpr callback failed\nout/test/spec/if.wast:998: assert_invalid passed:\n  out/test/spec/if/if.40.wasm:000001e: error: type mismatch in `if true` branch, expected [i32, i32] but got []\n  000001f: error: OnElseExpr callback failed\nout/test/spec/if.wast:1004: assert_invalid passed:\n  out/test/spec/if/if.41.wasm:0000024: error: type mismatch in `if false` branch, expected [i32, i32] but got []\n  0000024: error: OnEndExpr callback failed\nout/test/spec/if.wast:1010: assert_invalid passed:\n  out/test/spec/if/if.42.wasm:000001e: error: type mismatch in `if true` branch, expected [i32, i32] but got []\n  000001f: error: OnElseExpr callback failed\nout/test/spec/if.wast:1017: assert_invalid passed:\n  out/test/spec/if/if.43.wasm:000001e: error: type mismatch in `if true` branch, expected [i32] but got [i64]\n  000001f: error: OnElseExpr callback failed\nout/test/spec/if.wast:1023: assert_invalid passed:\n  out/test/spec/if/if.44.wasm:0000022: error: type mismatch in `if false` branch, expected [i32] but got [i64]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/if.wast:1029: assert_invalid passed:\n  out/test/spec/if/if.45.wasm:000001e: error: type mismatch in `if true` branch, expected [i32] but got [i64]\n  000001f: error: OnElseExpr callback failed\nout/test/spec/if.wast:1036: assert_invalid passed:\n  out/test/spec/if/if.46.wasm:000001f: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000020: error: OnElseExpr callback failed\nout/test/spec/if.wast:1042: assert_invalid passed:\n  out/test/spec/if/if.47.wasm:0000025: error: type mismatch in `if false` branch, expected [i32, i32] but got [i32]\n  0000025: error: OnEndExpr callback failed\nout/test/spec/if.wast:1048: assert_invalid passed:\n  out/test/spec/if/if.48.wasm:000001f: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000020: error: OnElseExpr callback failed\nout/test/spec/if.wast:1055: assert_invalid passed:\n  out/test/spec/if/if.49.wasm:0000021: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000022: error: OnElseExpr callback failed\nout/test/spec/if.wast:1062: assert_invalid passed:\n  out/test/spec/if/if.50.wasm:0000027: error: type mismatch in `if false` branch, expected [i32, i32] but got [i32]\n  0000027: error: OnEndExpr callback failed\nout/test/spec/if.wast:1069: assert_invalid passed:\n  out/test/spec/if/if.51.wasm:0000021: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000022: error: OnElseExpr callback failed\nout/test/spec/if.wast:1077: assert_invalid passed:\n  out/test/spec/if/if.52.wasm:0000020: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  0000021: error: OnElseExpr callback failed\nout/test/spec/if.wast:1083: assert_invalid passed:\n  out/test/spec/if/if.53.wasm:0000024: error: type mismatch at end of `if false` branch, expected [] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/if.wast:1089: assert_invalid passed:\n  out/test/spec/if/if.54.wasm:0000020: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  0000021: error: OnElseExpr callback failed\nout/test/spec/if.wast:1096: assert_invalid passed:\n  out/test/spec/if/if.55.wasm:000001e: error: type mismatch in `if true` branch, expected [i32] but got [i64]\n  000001f: error: OnElseExpr callback failed\nout/test/spec/if.wast:1102: assert_invalid passed:\n  out/test/spec/if/if.56.wasm:0000023: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  0000024: error: OnElseExpr callback failed\nout/test/spec/if.wast:1109: assert_invalid passed:\n  out/test/spec/if/if.57.wasm:0000025: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/if.wast:1119: assert_invalid passed:\n  out/test/spec/if/if.58.wasm:0000025: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/if.wast:1129: assert_invalid passed:\n  out/test/spec/if/if.59.wasm:0000027: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000027: error: EndFunctionBody callback failed\nout/test/spec/if.wast:1140: assert_invalid passed:\n  out/test/spec/if/if.60.wasm:000001e: error: type mismatch in br, expected [i32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/if.wast:1146: assert_invalid passed:\n  out/test/spec/if/if.61.wasm:0000021: error: type mismatch in br, expected [i32] but got []\n  0000021: error: OnBrExpr callback failed\nout/test/spec/if.wast:1152: assert_invalid passed:\n  out/test/spec/if/if.62.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/if.wast:1158: assert_invalid passed:\n  out/test/spec/if/if.63.wasm:0000024: error: type mismatch in br, expected [i32, i32] but got []\n  0000024: error: OnBrExpr callback failed\nout/test/spec/if.wast:1165: assert_invalid passed:\n  out/test/spec/if/if.64.wasm:000001e: error: type mismatch in br, expected [i32] but got []\n  000001e: error: OnBrExpr callback failed\nout/test/spec/if.wast:1174: assert_invalid passed:\n  out/test/spec/if/if.65.wasm:0000021: error: type mismatch in br, expected [i32] but got []\n  0000021: error: OnBrExpr callback failed\nout/test/spec/if.wast:1183: assert_invalid passed:\n  out/test/spec/if/if.66.wasm:000001f: error: type mismatch in br, expected [i32, i32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/if.wast:1192: assert_invalid passed:\n  out/test/spec/if/if.67.wasm:0000024: error: type mismatch in br, expected [i32, i32] but got []\n  0000024: error: OnBrExpr callback failed\nout/test/spec/if.wast:1202: assert_invalid passed:\n  out/test/spec/if/if.68.wasm:000001f: error: type mismatch in br, expected [i32] but got []\n  000001f: error: OnBrExpr callback failed\nout/test/spec/if.wast:1211: assert_invalid passed:\n  out/test/spec/if/if.69.wasm:0000022: error: type mismatch in br, expected [i32] but got []\n  0000022: error: OnBrExpr callback failed\nout/test/spec/if.wast:1220: assert_invalid passed:\n  out/test/spec/if/if.70.wasm:0000020: error: type mismatch in br, expected [i32, i32] but got []\n  0000020: error: OnBrExpr callback failed\nout/test/spec/if.wast:1229: assert_invalid passed:\n  out/test/spec/if/if.71.wasm:0000025: error: type mismatch in br, expected [i32, i32] but got []\n  0000025: error: OnBrExpr callback failed\nout/test/spec/if.wast:1239: assert_invalid passed:\n  out/test/spec/if/if.72.wasm:0000020: error: type mismatch in br, expected [i32] but got [i64]\n  0000020: error: OnBrExpr callback failed\nout/test/spec/if.wast:1248: assert_invalid passed:\n  out/test/spec/if/if.73.wasm:0000023: error: type mismatch in br, expected [i32] but got [i64]\n  0000023: error: OnBrExpr callback failed\nout/test/spec/if.wast:1257: assert_invalid passed:\n  out/test/spec/if/if.74.wasm:0000021: error: type mismatch in br, expected [i32, i32] but got [i64]\n  0000021: error: OnBrExpr callback failed\nout/test/spec/if.wast:1266: assert_invalid passed:\n  out/test/spec/if/if.75.wasm:0000026: error: type mismatch in br, expected [i32, i32] but got [i64]\n  0000026: error: OnBrExpr callback failed\nout/test/spec/if.wast:1275: assert_invalid passed:\n  out/test/spec/if/if.76.wasm:0000023: error: type mismatch in br, expected [i32, i32] but got [i64]\n  0000023: error: OnBrExpr callback failed\nout/test/spec/if.wast:1285: assert_invalid passed:\n  out/test/spec/if/if.77.wasm:0000021: error: type mismatch in `if true` branch, expected [i32, i32] but got [i32]\n  0000022: error: OnElseExpr callback failed\nout/test/spec/if.wast:1296: assert_invalid passed:\n  out/test/spec/if/if.78.wasm:0000019: error: type mismatch in if, expected [i32] but got []\n  0000019: error: OnIfExpr callback failed\nout/test/spec/if.wast:1304: assert_invalid passed:\n  out/test/spec/if/if.79.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/if.wast:1313: assert_invalid passed:\n  out/test/spec/if/if.80.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/if.wast:1322: assert_invalid passed:\n  out/test/spec/if/if.81.wasm:000001f: error: type mismatch in if, expected [i32] but got []\n  000001f: error: OnIfExpr callback failed\nout/test/spec/if.wast:1331: assert_invalid passed:\n  out/test/spec/if/if.82.wasm:0000022: error: type mismatch in if, expected [i32] but got []\n  0000022: error: OnIfExpr callback failed\nout/test/spec/if.wast:1341: assert_invalid passed:\n  out/test/spec/if/if.83.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/if.wast:1350: assert_invalid passed:\n  out/test/spec/if/if.84.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/if.wast:1359: assert_invalid passed:\n  out/test/spec/if/if.85.wasm:000001d: error: type mismatch in if, expected [i32] but got []\n  000001d: error: OnIfExpr callback failed\nout/test/spec/if.wast:1368: assert_invalid passed:\n  out/test/spec/if/if.86.wasm:0000019: error: type mismatch in if, expected [i32] but got []\n  0000019: error: OnIfExpr callback failed\nout/test/spec/if.wast:1376: assert_invalid passed:\n  out/test/spec/if/if.87.wasm:0000019: error: type mismatch in if, expected [i32] but got []\n  0000019: error: OnIfExpr callback failed\nout/test/spec/if.wast:1384: assert_invalid passed:\n  out/test/spec/if/if.88.wasm:000001f: error: type mismatch in if, expected [i32] but got []\n  000001f: error: OnIfExpr callback failed\nout/test/spec/if.wast:1393: assert_invalid passed:\n  out/test/spec/if/if.89.wasm:0000036: error: type mismatch in if, expected [i32] but got []\n  0000036: error: OnIfExpr callback failed\nout/test/spec/if.wast:1409: assert_invalid passed:\n  out/test/spec/if/if.90.wasm:000001b: error: type mismatch in if, expected [i32] but got []\n  000001b: error: OnIfExpr callback failed\nout/test/spec/if.wast:1418: assert_invalid passed:\n  out/test/spec/if/if.91.wasm:000001b: error: type mismatch in if, expected [i32] but got []\n  000001b: error: OnIfExpr callback failed\nout/test/spec/if.wast:1427: assert_invalid passed:\n  out/test/spec/if/if.92.wasm:0000021: error: type mismatch in if, expected [i32] but got []\n  0000021: error: OnIfExpr callback failed\nout/test/spec/if.wast:1436: assert_invalid passed:\n  out/test/spec/if/if.93.wasm:000001e: error: type mismatch in if, expected [i32] but got []\n  000001e: error: OnIfExpr callback failed\nout/test/spec/if.wast:1445: assert_invalid passed:\n  out/test/spec/if/if.94.wasm:000001e: error: type mismatch in if, expected [i32] but got []\n  000001e: error: OnIfExpr callback failed\nout/test/spec/if.wast:1454: assert_invalid passed:\n  out/test/spec/if/if.95.wasm:000001e: error: type mismatch in if, expected [i32] but got []\n  000001e: error: OnIfExpr callback failed\nout/test/spec/if.wast:1464: assert_invalid passed:\n  out/test/spec/if/if.96.wasm:000001f: error: type mismatch in if, expected [i32] but got []\n  000001f: error: OnIfExpr callback failed\nout/test/spec/if.wast:1470: assert_invalid passed:\n  out/test/spec/if/if.97.wasm:0000020: error: type mismatch in if, expected [i32, f64] but got []\n  0000020: error: OnIfExpr callback failed\nout/test/spec/if.wast:1476: assert_invalid passed:\n  out/test/spec/if/if.98.wasm:0000024: error: type mismatch in if, expected [i32] but got [f32]\n  0000024: error: OnIfExpr callback failed\nout/test/spec/if.wast:1482: assert_invalid passed:\n  out/test/spec/if/if.99.wasm:0000025: error: type mismatch in if, expected [f32, i32] but got [f32]\n  0000025: error: OnIfExpr callback failed\nout/test/spec/if.wast:1488: assert_invalid passed:\n  out/test/spec/if/if.100.wasm:0000021: error: type mismatch in if, expected [i32] but got []\n  0000021: error: OnIfExpr callback failed\nout/test/spec/if.wast:1494: assert_invalid passed:\n  out/test/spec/if/if.101.wasm:0000022: error: type mismatch in if, expected [i32, f64] but got []\n  0000022: error: OnIfExpr callback failed\nout/test/spec/if.wast:1500: assert_invalid passed:\n  out/test/spec/if/if.102.wasm:0000026: error: type mismatch in if, expected [i32] but got [f32]\n  0000026: error: OnIfExpr callback failed\nout/test/spec/if.wast:1506: assert_invalid passed:\n  out/test/spec/if/if.103.wasm:0000027: error: type mismatch in if, expected [f32, i32] but got [f32]\n  0000027: error: OnIfExpr callback failed\nout/test/spec/if.wast:1513: assert_malformed passed:\n  out/test/spec/if/if.104.wat:1:42: error: unexpected token $x, expected ).\n  (func (param i32) (result i32) if (param $x i32) end)\n                                           ^^\nout/test/spec/if.wast:1517: assert_malformed passed:\n  out/test/spec/if/if.105.wat:1:43: error: unexpected token $x, expected ).\n  (func (param i32) (result i32) (if (param $x i32) (then)))\n                                            ^^\nout/test/spec/if.wast:1522: assert_malformed passed:\n  out/test/spec/if/if.106.wat:1:26: error: unexpected label \"$l\"\n  (func i32.const 0 if end $l)\n                           ^^\nout/test/spec/if.wast:1526: assert_malformed passed:\n  out/test/spec/if/if.107.wat:1:29: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a end $l)\n                              ^^\nout/test/spec/if.wast:1530: assert_malformed passed:\n  out/test/spec/if/if.108.wat:1:27: error: unexpected label \"$l\"\n  (func i32.const 0 if else $l end)\n                            ^^\nout/test/spec/if.wast:1534: assert_malformed passed:\n  out/test/spec/if/if.109.wat:1:30: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else $l end)\n                               ^^\nout/test/spec/if.wast:1538: assert_malformed passed:\n  out/test/spec/if/if.110.wat:1:31: error: unexpected label \"$l\"\n  (func i32.const 0 if else end $l)\n                                ^^\nout/test/spec/if.wast:1542: assert_malformed passed:\n  out/test/spec/if/if.111.wat:1:27: error: unexpected label \"$l\"\n  (func i32.const 0 if else $l end $l)\n                            ^^\n  out/test/spec/if/if.111.wat:1:34: error: unexpected label \"$l\"\n  (func i32.const 0 if else $l end $l)\n                                   ^^\nout/test/spec/if.wast:1546: assert_malformed passed:\n  out/test/spec/if/if.112.wat:1:27: error: unexpected label \"$l1\"\n  (func i32.const 0 if else $l1 end $l2)\n                            ^^^\n  out/test/spec/if/if.112.wat:1:35: error: unexpected label \"$l2\"\n  (func i32.const 0 if else $l1 end $l2)\n                                    ^^^\nout/test/spec/if.wast:1550: assert_malformed passed:\n  out/test/spec/if/if.113.wat:1:34: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else end $l)\n                                   ^^\nout/test/spec/if.wast:1554: assert_malformed passed:\n  out/test/spec/if/if.114.wat:1:37: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else $a end $l)\n                                      ^^\nout/test/spec/if.wast:1558: assert_malformed passed:\n  out/test/spec/if/if.115.wat:1:30: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else $l end $l)\n                               ^^\n  out/test/spec/if/if.115.wat:1:37: error: mismatching label \"$a\" != \"$l\"\n  (func i32.const 0 if $a else $l end $l)\n                                      ^^\nout/test/spec/if.wast:1562: assert_malformed passed:\n  out/test/spec/if/if.116.wat:1:11: error: unexpected token i32.const, expected (.\n  (func (if i32.const 0 (then) (else)))\n            ^^^^^^^^^\n241/241 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/imports.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/imports.wast\n(;; STDOUT ;;;\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i32_f32(i32:14, f32:42.000000) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_f32(f32:13.000000) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i64(i64:24) =>\ncalled host spectest.print_f64_f64(f64:25.000000, f64:53.000000) =>\ncalled host spectest.print_i64(i64:24) =>\ncalled host spectest.print_f64(f64:24.000000) =>\ncalled host spectest.print_f64(f64:24.000000) =>\ncalled host spectest.print_f64(f64:24.000000) =>\nout/test/spec/imports.wast:89: assert_invalid passed:\n  out/test/spec/imports/imports.2.wasm:000001e: error: function type variable out of range: 1 (max 1)\n  000001e: error: OnImportFunc callback failed\ncalled host spectest.print_i32(i32:13) =>\nout/test/spec/imports.wast:125: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/imports.wast:129: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/imports.wast:134: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:138: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:142: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:146: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:150: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:154: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:158: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:162: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:166: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:170: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:174: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:178: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:182: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:186: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:190: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:194: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/imports.wast:199: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind func, not global\nout/test/spec/imports.wast:203: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind func, not table\nout/test/spec/imports.wast:207: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind func, not memory\nout/test/spec/imports.wast:211: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind func, not global\nout/test/spec/imports.wast:215: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind func, not table\nout/test/spec/imports.wast:219: assert_unlinkable passed:\n  error: expected import \"spectest.memory\" to have kind func, not memory\nout/test/spec/imports.wast:259: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/imports.wast:263: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/imports.wast:268: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i64 but got i32.\nout/test/spec/imports.wast:272: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f32 but got i32.\nout/test/spec/imports.wast:276: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got i32.\nout/test/spec/imports.wast:280: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/imports.wast:284: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i32 but got f32.\nout/test/spec/imports.wast:288: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i64 but got f32.\nout/test/spec/imports.wast:292: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got f32.\nout/test/spec/imports.wast:296: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/imports.wast:300: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i32 but got i64.\nout/test/spec/imports.wast:304: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f32 but got i64.\nout/test/spec/imports.wast:308: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got i64.\nout/test/spec/imports.wast:312: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected mutable but got immutable.\nout/test/spec/imports.wast:317: assert_unlinkable passed:\n  error: expected import \"test.func\" to have kind global, not func\nout/test/spec/imports.wast:321: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind global, not table\nout/test/spec/imports.wast:325: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind global, not memory\nout/test/spec/imports.wast:329: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind global, not func\nout/test/spec/imports.wast:333: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind global, not table\nout/test/spec/imports.wast:337: assert_unlinkable passed:\n  error: expected import \"spectest.memory\" to have kind global, not memory\nout/test/spec/imports.wast:356: assert_trap passed: uninitialized table element\nout/test/spec/imports.wast:359: assert_trap passed: uninitialized table element\nout/test/spec/imports.wast:360: assert_trap passed: undefined table index\nout/test/spec/imports.wast:375: assert_trap passed: uninitialized table element\nout/test/spec/imports.wast:378: assert_trap passed: uninitialized table element\nout/test/spec/imports.wast:379: assert_trap passed: undefined table index\nout/test/spec/imports.wast:410: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/imports.wast:414: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/imports.wast:419: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/imports.wast:423: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (20)\nout/test/spec/imports.wast:427: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/imports.wast:431: assert_unlinkable passed:\n  error: max size (20) larger than declared (18)\nout/test/spec/imports.wast:435: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/imports.wast:439: assert_unlinkable passed:\n  error: max size (20) larger than declared (15)\nout/test/spec/imports.wast:444: assert_unlinkable passed:\n  error: expected import \"test.func\" to have kind table, not func\nout/test/spec/imports.wast:448: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind table, not global\nout/test/spec/imports.wast:452: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind table, not memory\nout/test/spec/imports.wast:456: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind table, not func\nout/test/spec/imports.wast:474: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/imports.wast:485: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/imports.wast:488: assert_invalid passed:\n  out/test/spec/imports/imports.97.wasm:0000015: error: only one memory block allowed\n  0000015: error: OnImportMemory callback failed\nout/test/spec/imports.wast:492: assert_invalid passed:\n  out/test/spec/imports/imports.98.wasm:0000015: error: only one memory block allowed\n  0000015: error: OnMemory callback failed\nout/test/spec/imports.wast:496: assert_invalid passed:\n  out/test/spec/imports/imports.99.wasm:000000f: error: only one memory block allowed\n  000000f: error: OnMemory callback failed\nout/test/spec/imports.wast:511: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/imports.wast:515: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/imports.wast:520: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/imports.wast:524: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (3)\nout/test/spec/imports.wast:528: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/imports.wast:532: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\nout/test/spec/imports.wast:537: assert_unlinkable passed:\n  error: expected import \"test.func-i32\" to have kind memory, not func\nout/test/spec/imports.wast:541: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind memory, not global\nout/test/spec/imports.wast:545: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind memory, not table\nout/test/spec/imports.wast:549: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind memory, not func\nout/test/spec/imports.wast:553: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind memory, not global\nout/test/spec/imports.wast:557: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind memory, not table\nout/test/spec/imports.wast:562: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/imports.wast:566: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\nout/test/spec/imports.wast:584: assert_malformed passed:\n  out/test/spec/imports/imports.124.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (func))\n          ^^^^^^\nout/test/spec/imports.wast:588: assert_malformed passed:\n  out/test/spec/imports/imports.125.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (global i64))\n          ^^^^^^\nout/test/spec/imports.wast:592: assert_malformed passed:\n  out/test/spec/imports/imports.126.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (table 0 funcref))\n          ^^^^^^\nout/test/spec/imports.wast:596: assert_malformed passed:\n  out/test/spec/imports/imports.127.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (memory 0))\n          ^^^^^^\nout/test/spec/imports.wast:601: assert_malformed passed:\n  out/test/spec/imports/imports.128.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (func))\n                              ^^^^^^\nout/test/spec/imports.wast:605: assert_malformed passed:\n  out/test/spec/imports/imports.129.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (global f32))\n                              ^^^^^^\nout/test/spec/imports.wast:609: assert_malformed passed:\n  out/test/spec/imports/imports.130.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (table 0 funcref))\n                              ^^^^^^\nout/test/spec/imports.wast:613: assert_malformed passed:\n  out/test/spec/imports/imports.131.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (memory 0))\n                              ^^^^^^\nout/test/spec/imports.wast:618: assert_malformed passed:\n  out/test/spec/imports/imports.132.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (func))\n                     ^^^^^^\nout/test/spec/imports.wast:622: assert_malformed passed:\n  out/test/spec/imports/imports.133.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (global i32))\n                     ^^^^^^\nout/test/spec/imports.wast:626: assert_malformed passed:\n  out/test/spec/imports/imports.134.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (table 0 funcref))\n                     ^^^^^^\nout/test/spec/imports.wast:630: assert_malformed passed:\n  out/test/spec/imports/imports.135.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (memory 0))\n                     ^^^^^^\nout/test/spec/imports.wast:635: assert_malformed passed:\n  out/test/spec/imports/imports.136.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (func))\n              ^^^^^^\nout/test/spec/imports.wast:639: assert_malformed passed:\n  out/test/spec/imports/imports.137.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (global i32))\n              ^^^^^^\nout/test/spec/imports.wast:643: assert_malformed passed:\n  out/test/spec/imports/imports.138.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (table 1 3 funcref))\n              ^^^^^^\nout/test/spec/imports.wast:647: assert_malformed passed:\n  out/test/spec/imports/imports.139.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (memory 1 2))\n              ^^^^^^\nout/test/spec/imports.wast:657: assert_unlinkable passed:\n  error: invalid import \"not wasm.overloaded\"\n176/176 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/inline-module.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/inline-module.wast\n(;; STDOUT ;;;\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/int_exprs.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/int_exprs.wast\n(;; STDOUT ;;;\nout/test/spec/int_exprs.wast:113: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:114: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:115: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:116: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:132: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:133: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:134: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:135: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:196: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:197: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:198: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:199: assert_trap passed: integer divide by zero\nout/test/spec/int_exprs.wast:349: assert_trap passed: integer overflow\nout/test/spec/int_exprs.wast:350: assert_trap passed: integer overflow\n108/108 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/int_literals.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/int_literals.wast\n(;; STDOUT ;;;\nout/test/spec/int_literals.wast:72: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.1.wat:1:24: error: unexpected token \"_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const _100))\n                         ^^^^\nout/test/spec/int_literals.wast:76: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.2.wat:1:24: error: unexpected token \"+_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const +_100))\n                         ^^^^^\nout/test/spec/int_literals.wast:80: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.3.wat:1:24: error: unexpected token \"-_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const -_100))\n                         ^^^^^\nout/test/spec/int_literals.wast:84: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.4.wat:1:24: error: unexpected token \"99_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const 99_))\n                         ^^^\nout/test/spec/int_literals.wast:88: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.5.wat:1:24: error: unexpected token \"1__000\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const 1__000))\n                         ^^^^^^\nout/test/spec/int_literals.wast:92: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.6.wat:1:24: error: unexpected token \"_0x100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const _0x100))\n                         ^^^^^^\nout/test/spec/int_literals.wast:96: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.7.wat:1:24: error: unexpected token \"0_x100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const 0_x100))\n                         ^^^^^^\nout/test/spec/int_literals.wast:100: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.8.wat:1:24: error: unexpected token \"0x_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const 0x_100))\n                         ^^^^^^\nout/test/spec/int_literals.wast:104: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.9.wat:1:24: error: unexpected token \"0x00_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const 0x00_))\n                         ^^^^^\nout/test/spec/int_literals.wast:108: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.10.wat:1:24: error: unexpected token \"0xff__ffff\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i32 (i32.const 0xff__ffff))\n                         ^^^^^^^^^^\nout/test/spec/int_literals.wast:113: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.11.wat:1:24: error: unexpected token \"_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const _100))\n                         ^^^^\nout/test/spec/int_literals.wast:117: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.12.wat:1:24: error: unexpected token \"+_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const +_100))\n                         ^^^^^\nout/test/spec/int_literals.wast:121: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.13.wat:1:24: error: unexpected token \"-_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const -_100))\n                         ^^^^^\nout/test/spec/int_literals.wast:125: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.14.wat:1:24: error: unexpected token \"99_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const 99_))\n                         ^^^\nout/test/spec/int_literals.wast:129: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.15.wat:1:24: error: unexpected token \"1__000\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const 1__000))\n                         ^^^^^^\nout/test/spec/int_literals.wast:133: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.16.wat:1:24: error: unexpected token \"_0x100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const _0x100))\n                         ^^^^^^\nout/test/spec/int_literals.wast:137: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.17.wat:1:24: error: unexpected token \"0_x100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const 0_x100))\n                         ^^^^^^\nout/test/spec/int_literals.wast:141: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.18.wat:1:24: error: unexpected token \"0x_100\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const 0x_100))\n                         ^^^^^^\nout/test/spec/int_literals.wast:145: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.19.wat:1:24: error: unexpected token \"0x00_\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const 0x00_))\n                         ^^^^^\nout/test/spec/int_literals.wast:149: assert_malformed passed:\n  out/test/spec/int_literals/int_literals.20.wat:1:24: error: unexpected token \"0xff__ffff\", expected a numeric literal (e.g. 123, -45, 6.7e8).\n  (global i64 (i64.const 0xff__ffff))\n                         ^^^^^^^^^^\n51/51 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/labels.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/labels.wast\n(;; STDOUT ;;;\nout/test/spec/labels.wast:318: assert_invalid passed:\n  out/test/spec/labels/labels.1.wasm:000001e: error: type mismatch in f32.neg, expected [f32] but got []\n  000001e: error: OnUnaryExpr callback failed\nout/test/spec/labels.wast:322: assert_invalid passed:\n  out/test/spec/labels/labels.2.wasm:0000023: error: type mismatch at end of block, expected [] but got [f32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/labels.wast:326: assert_invalid passed:\n  out/test/spec/labels/labels.3.wasm:0000023: error: type mismatch at end of block, expected [] but got [f32]\n  0000023: error: OnEndExpr callback failed\n29/29 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/left-to-right.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/left-to-right.wast\n(;; STDOUT ;;;\n96/96 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/linking.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/linking.wast\n(;; STDOUT ;;;\nout/test/spec/linking.wast:28: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/linking.wast:32: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/linking.wast:87: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected mutable but got immutable.\nout/test/spec/linking.wast:91: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/linking.wast:113: assert_unlinkable passed:\n  error: type mismatch in imported global, expected funcref but got externref.\nout/test/spec/linking.wast:117: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got funcref.\nout/test/spec/linking.wast:123: assert_unlinkable passed:\n  error: type mismatch in imported global, expected externref but got funcref.\nout/test/spec/linking.wast:127: assert_unlinkable passed:\n  error: type mismatch in imported global, expected funcref but got externref.\nout/test/spec/linking.wast:173: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:174: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:176: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:178: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:179: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:181: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:183: assert_trap passed: undefined table index\nout/test/spec/linking.wast:184: assert_trap passed: undefined table index\nout/test/spec/linking.wast:185: assert_trap passed: undefined table index\nout/test/spec/linking.wast:186: assert_trap passed: undefined table index\nout/test/spec/linking.wast:189: assert_trap passed: indirect call signature mismatch\nout/test/spec/linking.wast:221: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:222: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:224: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:225: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:227: assert_trap passed: undefined table index\nout/test/spec/linking.wast:253: assert_unlinkable passed:\n  error: invalid import \"Mt.mem\"\nout/test/spec/linking.wast:262: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:276: assert_trap passed: uninitialized table element\nout/test/spec/linking.wast:303: assert_unlinkable passed:\n  error: type mismatch in imported table, expected externref but got funcref.\nout/test/spec/linking.wast:307: assert_unlinkable passed:\n  error: type mismatch in imported table, expected funcref but got externref.\nout/test/spec/linking.wast:385: assert_unlinkable passed:\n  error: invalid import \"Mm.tab\"\n123/123 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/load.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/load.wast\n(;; STDOUT ;;;\nout/test/spec/load.wast:214: assert_malformed passed:\n  out/test/spec/load/load.1.wat:1:43: error: unexpected token \"i32.load32\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load32 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/load.wast:221: assert_malformed passed:\n  out/test/spec/load/load.2.wat:1:43: error: unexpected token \"i32.load32_u\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load32_u (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/load.wast:228: assert_malformed passed:\n  out/test/spec/load/load.3.wat:1:43: error: unexpected token \"i32.load32_s\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load32_s (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/load.wast:235: assert_malformed passed:\n  out/test/spec/load/load.4.wat:1:43: error: unexpected token \"i32.load64\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load64 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/load.wast:242: assert_malformed passed:\n  out/test/spec/load/load.5.wat:1:43: error: unexpected token \"i32.load64_u\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load64_u (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/load.wast:249: assert_malformed passed:\n  out/test/spec/load/load.6.wat:1:43: error: unexpected token \"i32.load64_s\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load64_s (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/load.wast:257: assert_malformed passed:\n  out/test/spec/load/load.7.wat:1:43: error: unexpected token \"i64.load64\", expected an instr.\n  (memory 1)(func (param i32) (result i64) (i64.load64 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/load.wast:264: assert_malformed passed:\n  out/test/spec/load/load.8.wat:1:43: error: unexpected token \"i64.load64_u\", expected an instr.\n  (memory 1)(func (param i32) (result i64) (i64.load64_u (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/load.wast:271: assert_malformed passed:\n  out/test/spec/load/load.9.wat:1:43: error: unexpected token \"i64.load64_s\", expected an instr.\n  (memory 1)(func (param i32) (result i64) (i64.load64_s (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/load.wast:279: assert_malformed passed:\n  out/test/spec/load/load.10.wat:1:43: error: unexpected token \"f32.load32\", expected an instr.\n  (memory 1)(func (param i32) (result f32) (f32.load32 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/load.wast:286: assert_malformed passed:\n  out/test/spec/load/load.11.wat:1:43: error: unexpected token \"f32.load64\", expected an instr.\n  (memory 1)(func (param i32) (result f32) (f32.load64 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/load.wast:294: assert_malformed passed:\n  out/test/spec/load/load.12.wat:1:43: error: unexpected token \"f64.load32\", expected an instr.\n  (memory 1)(func (param i32) (result f64) (f64.load32 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/load.wast:301: assert_malformed passed:\n  out/test/spec/load/load.13.wat:1:43: error: unexpected token \"f64.load64\", expected an instr.\n  (memory 1)(func (param i32) (result f64) (f64.load64 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/load.wast:312: assert_invalid passed:\n  out/test/spec/load/load.14.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:316: assert_invalid passed:\n  out/test/spec/load/load.15.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:320: assert_invalid passed:\n  out/test/spec/load/load.16.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:324: assert_invalid passed:\n  out/test/spec/load/load.17.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:328: assert_invalid passed:\n  out/test/spec/load/load.18.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:332: assert_invalid passed:\n  out/test/spec/load/load.19.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:336: assert_invalid passed:\n  out/test/spec/load/load.20.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:340: assert_invalid passed:\n  out/test/spec/load/load.21.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:344: assert_invalid passed:\n  out/test/spec/load/load.22.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:348: assert_invalid passed:\n  out/test/spec/load/load.23.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:352: assert_invalid passed:\n  out/test/spec/load/load.24.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:356: assert_invalid passed:\n  out/test/spec/load/load.25.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:360: assert_invalid passed:\n  out/test/spec/load/load.26.wasm:0000022: error: type mismatch at end of function, expected [] but got [f32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:364: assert_invalid passed:\n  out/test/spec/load/load.27.wasm:0000022: error: type mismatch at end of function, expected [] but got [f64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/load.wast:371: assert_invalid passed:\n  out/test/spec/load/load.28.wasm:0000025: error: type mismatch in i32.load, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:372: assert_invalid passed:\n  out/test/spec/load/load.29.wasm:0000025: error: type mismatch in i32.load8_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:373: assert_invalid passed:\n  out/test/spec/load/load.30.wasm:0000025: error: type mismatch in i32.load8_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:374: assert_invalid passed:\n  out/test/spec/load/load.31.wasm:0000025: error: type mismatch in i32.load16_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:375: assert_invalid passed:\n  out/test/spec/load/load.32.wasm:0000025: error: type mismatch in i32.load16_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:376: assert_invalid passed:\n  out/test/spec/load/load.33.wasm:0000025: error: type mismatch in i64.load, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:377: assert_invalid passed:\n  out/test/spec/load/load.34.wasm:0000025: error: type mismatch in i64.load8_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:378: assert_invalid passed:\n  out/test/spec/load/load.35.wasm:0000025: error: type mismatch in i64.load8_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:379: assert_invalid passed:\n  out/test/spec/load/load.36.wasm:0000025: error: type mismatch in i64.load16_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:380: assert_invalid passed:\n  out/test/spec/load/load.37.wasm:0000025: error: type mismatch in i64.load16_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:381: assert_invalid passed:\n  out/test/spec/load/load.38.wasm:0000025: error: type mismatch in i64.load32_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:382: assert_invalid passed:\n  out/test/spec/load/load.39.wasm:0000025: error: type mismatch in i64.load32_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:383: assert_invalid passed:\n  out/test/spec/load/load.40.wasm:0000025: error: type mismatch in f32.load, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:384: assert_invalid passed:\n  out/test/spec/load/load.41.wasm:0000025: error: type mismatch in f64.load, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:388: assert_invalid passed:\n  out/test/spec/load/load.42.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/load.wast:397: assert_invalid passed:\n  out/test/spec/load/load.43.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/load.wast:407: assert_invalid passed:\n  out/test/spec/load/load.44.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/load.wast:417: assert_invalid passed:\n  out/test/spec/load/load.45.wasm:0000025: error: type mismatch in i32.load, expected [i32] but got []\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:427: assert_invalid passed:\n  out/test/spec/load/load.46.wasm:0000028: error: type mismatch in i32.load, expected [i32] but got []\n  0000028: error: OnLoadExpr callback failed\nout/test/spec/load.wast:437: assert_invalid passed:\n  out/test/spec/load/load.47.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/load.wast:447: assert_invalid passed:\n  out/test/spec/load/load.48.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/load.wast:457: assert_invalid passed:\n  out/test/spec/load/load.49.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/load.wast:467: assert_invalid passed:\n  out/test/spec/load/load.50.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/load.wast:476: assert_invalid passed:\n  out/test/spec/load/load.51.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/load.wast:485: assert_invalid passed:\n  out/test/spec/load/load.52.wasm:0000025: error: type mismatch in i32.load, expected [i32] but got []\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/load.wast:495: assert_invalid passed:\n  out/test/spec/load/load.53.wasm:000003c: error: type mismatch in i32.load, expected [i32] but got []\n  000003c: error: OnLoadExpr callback failed\nout/test/spec/load.wast:512: assert_invalid passed:\n  out/test/spec/load/load.54.wasm:0000021: error: type mismatch in i32.load, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/load.wast:522: assert_invalid passed:\n  out/test/spec/load/load.55.wasm:0000021: error: type mismatch in i32.load, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/load.wast:532: assert_invalid passed:\n  out/test/spec/load/load.56.wasm:0000027: error: type mismatch in i32.load, expected [i32] but got []\n  0000027: error: OnLoadExpr callback failed\nout/test/spec/load.wast:542: assert_invalid passed:\n  out/test/spec/load/load.57.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/load.wast:551: assert_invalid passed:\n  out/test/spec/load/load.58.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/load.wast:560: assert_invalid passed:\n  out/test/spec/load/load.59.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\n97/97 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/local_get.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/local_get.wast\n(;; STDOUT ;;;\nout/test/spec/local_get.wast:149: assert_invalid passed:\n  out/test/spec/local_get/local_get.1.wasm:000001d: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001d: error: EndFunctionBody callback failed\nout/test/spec/local_get.wast:153: assert_invalid passed:\n  out/test/spec/local_get/local_get.2.wasm:000001d: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/local_get.wast:157: assert_invalid passed:\n  out/test/spec/local_get/local_get.3.wasm:000001f: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001f: error: OnUnaryExpr callback failed\nout/test/spec/local_get.wast:165: assert_invalid passed:\n  out/test/spec/local_get/local_get.4.wasm:000001c: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/local_get.wast:169: assert_invalid passed:\n  out/test/spec/local_get/local_get.5.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/local_get.wast:173: assert_invalid passed:\n  out/test/spec/local_get/local_get.6.wasm:000001d: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/local_get.wast:181: assert_invalid passed:\n  out/test/spec/local_get/local_get.7.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/local_get.wast:185: assert_invalid passed:\n  out/test/spec/local_get/local_get.8.wasm:000001c: error: type mismatch at end of function, expected [] but got [i64]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/local_get.wast:189: assert_invalid passed:\n  out/test/spec/local_get/local_get.9.wasm:000001c: error: type mismatch at end of function, expected [] but got [f32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/local_get.wast:193: assert_invalid passed:\n  out/test/spec/local_get/local_get.10.wasm:000001c: error: type mismatch at end of function, expected [] but got [f64]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/local_get.wast:201: assert_invalid passed:\n  out/test/spec/local_get/local_get.11.wasm:000001d: error: local variable out of range (max 2)\n  000001d: error: OnLocalGetExpr callback failed\nout/test/spec/local_get.wast:205: assert_invalid passed:\n  out/test/spec/local_get/local_get.12.wasm:0000020: error: local variable out of range (max 2)\n  0000020: error: OnLocalGetExpr callback failed\nout/test/spec/local_get.wast:210: assert_invalid passed:\n  out/test/spec/local_get/local_get.13.wasm:000001b: error: local variable out of range (max 2)\n  000001b: error: OnLocalGetExpr callback failed\nout/test/spec/local_get.wast:214: assert_invalid passed:\n  out/test/spec/local_get/local_get.14.wasm:000001f: error: local variable out of range (max 2)\n  000001f: error: OnLocalGetExpr callback failed\nout/test/spec/local_get.wast:219: assert_invalid passed:\n  out/test/spec/local_get/local_get.15.wasm:000001e: error: local variable out of range (max 3)\n  000001e: error: OnLocalGetExpr callback failed\nout/test/spec/local_get.wast:223: assert_invalid passed:\n  out/test/spec/local_get/local_get.16.wasm:0000021: error: local variable out of range (max 3)\n  0000021: error: OnLocalGetExpr callback failed\n36/36 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/local_set.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/local_set.wast\n(;; STDOUT ;;;\nout/test/spec/local_set.wast:148: assert_invalid passed:\n  out/test/spec/local_set/local_set.1.wasm:000001c: error: type mismatch in local.set, expected [i32] but got []\n  000001c: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:152: assert_invalid passed:\n  out/test/spec/local_set/local_set.2.wasm:0000020: error: type mismatch in local.set, expected [i32] but got [f32]\n  0000020: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:156: assert_invalid passed:\n  out/test/spec/local_set/local_set.3.wasm:0000024: error: type mismatch in local.set, expected [f32] but got [f64]\n  0000024: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:160: assert_invalid passed:\n  out/test/spec/local_set/local_set.4.wasm:0000026: error: type mismatch in local.set, expected [i64] but got [f64]\n  0000026: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:169: assert_invalid passed:\n  out/test/spec/local_set/local_set.5.wasm:000001b: error: type mismatch in local.set, expected [i32] but got []\n  000001b: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:173: assert_invalid passed:\n  out/test/spec/local_set/local_set.6.wasm:000001f: error: type mismatch in local.set, expected [i32] but got [f32]\n  000001f: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:177: assert_invalid passed:\n  out/test/spec/local_set/local_set.7.wasm:0000023: error: type mismatch in local.set, expected [f32] but got [f64]\n  0000023: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:181: assert_invalid passed:\n  out/test/spec/local_set/local_set.8.wasm:0000024: error: type mismatch in local.set, expected [i64] but got [f64]\n  0000024: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:186: assert_invalid passed:\n  out/test/spec/local_set/local_set.9.wasm:000001a: error: type mismatch in local.set, expected [i32] but got []\n  000001a: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:194: assert_invalid passed:\n  out/test/spec/local_set/local_set.10.wasm:000001e: error: type mismatch in local.set, expected [i32] but got []\n  000001e: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:203: assert_invalid passed:\n  out/test/spec/local_set/local_set.11.wasm:000001e: error: type mismatch in local.set, expected [i32] but got []\n  000001e: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:212: assert_invalid passed:\n  out/test/spec/local_set/local_set.12.wasm:0000020: error: type mismatch in local.set, expected [i32] but got []\n  0000020: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:221: assert_invalid passed:\n  out/test/spec/local_set/local_set.13.wasm:0000023: error: type mismatch in local.set, expected [i32] but got []\n  0000023: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:230: assert_invalid passed:\n  out/test/spec/local_set/local_set.14.wasm:000001e: error: type mismatch in local.set, expected [i32] but got []\n  000001e: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:239: assert_invalid passed:\n  out/test/spec/local_set/local_set.15.wasm:000001e: error: type mismatch in local.set, expected [i32] but got []\n  000001e: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:248: assert_invalid passed:\n  out/test/spec/local_set/local_set.16.wasm:000001e: error: type mismatch in local.set, expected [i32] but got []\n  000001e: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:257: assert_invalid passed:\n  out/test/spec/local_set/local_set.17.wasm:000001a: error: type mismatch in local.set, expected [i32] but got []\n  000001a: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:265: assert_invalid passed:\n  out/test/spec/local_set/local_set.18.wasm:000001a: error: type mismatch in local.set, expected [i32] but got []\n  000001a: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:273: assert_invalid passed:\n  out/test/spec/local_set/local_set.19.wasm:0000020: error: type mismatch in local.set, expected [i32] but got []\n  0000020: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:282: assert_invalid passed:\n  out/test/spec/local_set/local_set.20.wasm:0000037: error: type mismatch in local.set, expected [i32] but got []\n  0000037: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:301: assert_invalid passed:\n  out/test/spec/local_set/local_set.21.wasm:0000021: error: type mismatch in local.set, expected [i32] but got [f32]\n  0000021: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:305: assert_invalid passed:\n  out/test/spec/local_set/local_set.22.wasm:0000022: error: type mismatch in local.set, expected [i32] but got [f32]\n  0000022: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:309: assert_invalid passed:\n  out/test/spec/local_set/local_set.23.wasm:0000020: error: type mismatch in local.set, expected [f64] but got [i64]\n  0000020: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:317: assert_invalid passed:\n  out/test/spec/local_set/local_set.24.wasm:000001e: error: type mismatch in implicit return, expected [i32] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/local_set.wast:321: assert_invalid passed:\n  out/test/spec/local_set/local_set.25.wasm:000001e: error: type mismatch in implicit return, expected [i64] but got []\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/local_set.wast:325: assert_invalid passed:\n  out/test/spec/local_set/local_set.26.wasm:0000021: error: type mismatch in implicit return, expected [f32] but got []\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/local_set.wast:329: assert_invalid passed:\n  out/test/spec/local_set/local_set.27.wasm:0000025: error: type mismatch in implicit return, expected [f64] but got []\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/local_set.wast:337: assert_invalid passed:\n  out/test/spec/local_set/local_set.28.wasm:000001f: error: local variable out of range (max 2)\n  000001f: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:341: assert_invalid passed:\n  out/test/spec/local_set/local_set.29.wasm:0000022: error: local variable out of range (max 2)\n  0000022: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:346: assert_invalid passed:\n  out/test/spec/local_set/local_set.30.wasm:000001d: error: local variable out of range (max 2)\n  000001d: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:350: assert_invalid passed:\n  out/test/spec/local_set/local_set.31.wasm:0000021: error: local variable out of range (max 2)\n  0000021: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:355: assert_invalid passed:\n  out/test/spec/local_set/local_set.32.wasm:0000020: error: local variable out of range (max 3)\n  0000020: error: OnLocalSetExpr callback failed\nout/test/spec/local_set.wast:359: assert_invalid passed:\n  out/test/spec/local_set/local_set.33.wasm:0000023: error: local variable out of range (max 3)\n  0000023: error: OnLocalSetExpr callback failed\n53/53 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/local_tee.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/local_tee.wast\n(;; STDOUT ;;;\nout/test/spec/local_tee.wast:371: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.1.wasm:000001f: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/local_tee.wast:375: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.2.wasm:0000021: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000021: error: OnConvertExpr callback failed\nout/test/spec/local_tee.wast:379: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.3.wasm:0000020: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/local_tee.wast:384: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.4.wasm:000001c: error: type mismatch in local.tee, expected [i32] but got []\n  000001c: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:388: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.5.wasm:0000020: error: type mismatch in local.tee, expected [i32] but got [f32]\n  0000020: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:392: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.6.wasm:0000024: error: type mismatch in local.tee, expected [f32] but got [f64]\n  0000024: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:396: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.7.wasm:0000026: error: type mismatch in local.tee, expected [i64] but got [f64]\n  0000026: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:404: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.8.wasm:000001c: error: type mismatch in implicit return, expected [i64] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/local_tee.wast:408: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.9.wasm:000001b: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/local_tee.wast:412: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.10.wasm:000001c: error: type mismatch in f64.neg, expected [f64] but got [i64]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/local_tee.wast:417: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.11.wasm:000001b: error: type mismatch in local.tee, expected [i32] but got []\n  000001b: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:421: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.12.wasm:000001f: error: type mismatch in local.tee, expected [i32] but got [f32]\n  000001f: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:425: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.13.wasm:0000023: error: type mismatch in local.tee, expected [f32] but got [f64]\n  0000023: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:429: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.14.wasm:0000024: error: type mismatch in local.tee, expected [i64] but got [f64]\n  0000024: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:434: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.15.wasm:000001a: error: type mismatch in local.tee, expected [i32] but got []\n  000001a: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:442: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.16.wasm:000001e: error: type mismatch in local.tee, expected [i32] but got []\n  000001e: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:451: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.17.wasm:000001e: error: type mismatch in local.tee, expected [i32] but got []\n  000001e: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:460: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.18.wasm:0000020: error: type mismatch in local.tee, expected [i32] but got []\n  0000020: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:469: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.19.wasm:0000023: error: type mismatch in local.tee, expected [i32] but got []\n  0000023: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:478: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.20.wasm:000001e: error: type mismatch in local.tee, expected [i32] but got []\n  000001e: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:487: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.21.wasm:000001e: error: type mismatch in local.tee, expected [i32] but got []\n  000001e: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:496: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.22.wasm:000001e: error: type mismatch in local.tee, expected [i32] but got []\n  000001e: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:505: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.23.wasm:000001a: error: type mismatch in local.tee, expected [i32] but got []\n  000001a: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:513: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.24.wasm:000001a: error: type mismatch in local.tee, expected [i32] but got []\n  000001a: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:521: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.25.wasm:0000020: error: type mismatch in local.tee, expected [i32] but got []\n  0000020: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:530: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.26.wasm:0000037: error: type mismatch in local.tee, expected [i32] but got []\n  0000037: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:546: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.27.wasm:000001a: error: type mismatch in local.tee, expected [i32] but got []\n  000001a: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:554: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.28.wasm:000001a: error: type mismatch in local.tee, expected [i32] but got []\n  000001a: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:562: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.29.wasm:0000022: error: type mismatch in local.tee, expected [i32] but got []\n  0000022: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:571: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.30.wasm:000001f: error: type mismatch in local.tee, expected [i32] but got []\n  000001f: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:580: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.31.wasm:000001f: error: type mismatch in local.tee, expected [i32] but got []\n  000001f: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:589: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.32.wasm:000001f: error: type mismatch in local.tee, expected [i32] but got []\n  000001f: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:599: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.33.wasm:0000021: error: type mismatch in local.tee, expected [i32] but got [f32]\n  0000021: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:603: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.34.wasm:0000022: error: type mismatch in local.tee, expected [i32] but got [f32]\n  0000022: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:607: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.35.wasm:0000020: error: type mismatch in local.tee, expected [f64] but got [i64]\n  0000020: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:615: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.36.wasm:000001f: error: local variable out of range (max 2)\n  000001f: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:619: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.37.wasm:0000022: error: local variable out of range (max 2)\n  0000022: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:624: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.38.wasm:000001d: error: local variable out of range (max 2)\n  000001d: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:628: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.39.wasm:0000021: error: local variable out of range (max 2)\n  0000021: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:633: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.40.wasm:0000020: error: local variable out of range (max 3)\n  0000020: error: OnLocalTeeExpr callback failed\nout/test/spec/local_tee.wast:637: assert_invalid passed:\n  out/test/spec/local_tee/local_tee.41.wasm:0000023: error: local variable out of range (max 3)\n  0000023: error: OnLocalTeeExpr callback failed\n97/97 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/loop.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/loop.wast\n(;; STDOUT ;;;\nout/test/spec/loop.wast:526: assert_malformed passed:\n  out/test/spec/loop/loop.1.wat:1:95: error: unexpected token (, expected ).\n  ...result i32)))(func (i32.const 0) (loop (type $sig) (result i32) (param i32)))\n                                                                     ^\nout/test/spec/loop.wast:533: assert_malformed passed:\n  out/test/spec/loop/loop.2.wat:1:82: error: unexpected token (, expected ).\n  ...result i32)))(func (i32.const 0) (loop (param i32) (type $sig) (result i32)))\n                                                        ^\nout/test/spec/loop.wast:540: assert_malformed passed:\n  out/test/spec/loop/loop.3.wat:1:95: error: unexpected token (, expected ).\n  ...result i32)))(func (i32.const 0) (loop (param i32) (result i32) (type $sig)))\n                                                                     ^\nout/test/spec/loop.wast:547: assert_malformed passed:\n  out/test/spec/loop/loop.4.wat:1:83: error: unexpected token (, expected ).\n  ...result i32)))(func (i32.const 0) (loop (result i32) (type $sig) (param i32)))\n                                                         ^\nout/test/spec/loop.wast:554: assert_malformed passed:\n  out/test/spec/loop/loop.5.wat:1:83: error: unexpected token (, expected ).\n  ...result i32)))(func (i32.const 0) (loop (result i32) (param i32) (type $sig)))\n                                                         ^\nout/test/spec/loop.wast:561: assert_malformed passed:\n  out/test/spec/loop/loop.6.wat:1:40: error: unexpected token (, expected ).\n  (func (i32.const 0) (loop (result i32) (param i32)))\n                                         ^\nout/test/spec/loop.wast:568: assert_malformed passed:\n  out/test/spec/loop/loop.7.wat:1:34: error: unexpected token $x, expected ).\n  (func (i32.const 0) (loop (param $x i32) (drop)))\n                                   ^^\n  out/test/spec/loop/loop.7.wat:1:49: error: unexpected token ), expected EOF.\n  (func (i32.const 0) (loop (param $x i32) (drop)))\n                                                  ^\nout/test/spec/loop.wast:572: assert_malformed passed:\n  out/test/spec/loop/loop.8.wat:1:25: error: expected 0 results, got 1\n  (type $sig (func))(func (loop (type $sig) (result i32) (i32.const 0)) (unreac...\n                          ^\nout/test/spec/loop.wast:579: assert_malformed passed:\n  out/test/spec/loop/loop.9.wat:1:50: error: expected 1 arguments, got 0\n  ...func (param i32) (result i32)))(func (loop (type $sig) (result i32) (i32.c...\n                                          ^\nout/test/spec/loop.wast:586: assert_malformed passed:\n  out/test/spec/loop/loop.10.wat:1:64: error: expected 1 results, got 0\n  ...2) (result i32)))(func (i32.const 0) (loop (type $sig) (param i32) (drop))...\n                                          ^\nout/test/spec/loop.wast:593: assert_malformed passed:\n  out/test/spec/loop/loop.11.wat:1:68: error: expected 2 arguments, got 1\n  ...2) (result i32)))(func (i32.const 0) (loop (type $sig) (param i32) (result...\n                                          ^\nout/test/spec/loop.wast:601: assert_invalid passed:\n  out/test/spec/loop/loop.12.wasm:000001c: error: type mismatch at end of loop, expected [] but got [i32]\n  000001c: error: OnEndExpr callback failed\nout/test/spec/loop.wast:609: assert_invalid passed:\n  out/test/spec/loop/loop.13.wasm:000001c: error: type mismatch in implicit return, expected [i32] but got []\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/loop.wast:613: assert_invalid passed:\n  out/test/spec/loop/loop.14.wasm:000001c: error: type mismatch in implicit return, expected [i64] but got []\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/loop.wast:617: assert_invalid passed:\n  out/test/spec/loop/loop.15.wasm:000001c: error: type mismatch in implicit return, expected [f32] but got []\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/loop.wast:621: assert_invalid passed:\n  out/test/spec/loop/loop.16.wasm:000001c: error: type mismatch in implicit return, expected [f64] but got []\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/loop.wast:626: assert_invalid passed:\n  out/test/spec/loop/loop.17.wasm:000001c: error: type mismatch at end of loop, expected [] but got [i32]\n  000001c: error: OnEndExpr callback failed\nout/test/spec/loop.wast:632: assert_invalid passed:\n  out/test/spec/loop/loop.18.wasm:000001e: error: type mismatch at end of loop, expected [] but got [i32, i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/loop.wast:638: assert_invalid passed:\n  out/test/spec/loop/loop.19.wasm:000001b: error: type mismatch in loop, expected [i32] but got []\n  000001b: error: OnEndExpr callback failed\nout/test/spec/loop.wast:644: assert_invalid passed:\n  out/test/spec/loop/loop.20.wasm:000001c: error: type mismatch in loop, expected [i32, i32] but got []\n  000001c: error: OnEndExpr callback failed\nout/test/spec/loop.wast:650: assert_invalid passed:\n  out/test/spec/loop/loop.21.wasm:000001c: error: type mismatch in loop, expected [i32] but got []\n  000001c: error: OnEndExpr callback failed\nout/test/spec/loop.wast:656: assert_invalid passed:\n  out/test/spec/loop/loop.22.wasm:000001d: error: type mismatch in loop, expected [i32, i32] but got []\n  000001d: error: OnEndExpr callback failed\nout/test/spec/loop.wast:662: assert_invalid passed:\n  out/test/spec/loop/loop.23.wasm:0000020: error: type mismatch in loop, expected [i32] but got [f32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/loop.wast:668: assert_invalid passed:\n  out/test/spec/loop/loop.24.wasm:000001e: error: type mismatch in loop, expected [i32, i32] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/loop.wast:674: assert_invalid passed:\n  out/test/spec/loop/loop.25.wasm:0000020: error: type mismatch in loop, expected [i32, i32] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/loop.wast:680: assert_invalid passed:\n  out/test/spec/loop/loop.26.wasm:000001f: error: type mismatch at end of loop, expected [] but got [i32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/loop.wast:686: assert_invalid passed:\n  out/test/spec/loop/loop.27.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/loop.wast:693: assert_invalid passed:\n  out/test/spec/loop/loop.28.wasm:000001e: error: type mismatch in loop, expected [i32] but got []\n  000001e: error: OnEndExpr callback failed\nout/test/spec/loop.wast:702: assert_invalid passed:\n  out/test/spec/loop/loop.29.wasm:000001e: error: type mismatch in loop, expected [i32] but got []\n  000001e: error: OnEndExpr callback failed\nout/test/spec/loop.wast:711: assert_invalid passed:\n  out/test/spec/loop/loop.30.wasm:0000020: error: type mismatch in loop, expected [i32] but got []\n  0000020: error: OnEndExpr callback failed\nout/test/spec/loop.wast:721: assert_invalid passed:\n  out/test/spec/loop/loop.31.wasm:000001d: error: type mismatch in loop, expected [i32] but got []\n  000001d: error: OnLoopExpr callback failed\nout/test/spec/loop.wast:727: assert_invalid passed:\n  out/test/spec/loop/loop.32.wasm:000001e: error: type mismatch in loop, expected [i32, f64] but got []\n  000001e: error: OnLoopExpr callback failed\nout/test/spec/loop.wast:733: assert_invalid passed:\n  out/test/spec/loop/loop.33.wasm:0000022: error: type mismatch in loop, expected [i32] but got [f32]\n  0000022: error: OnLoopExpr callback failed\nout/test/spec/loop.wast:739: assert_invalid passed:\n  out/test/spec/loop/loop.34.wasm:0000023: error: type mismatch in loop, expected [f32, i32] but got [f32]\n  0000023: error: OnLoopExpr callback failed\nout/test/spec/loop.wast:745: assert_invalid passed:\n  out/test/spec/loop/loop.35.wasm:000001f: error: type mismatch in loop, expected [i32] but got []\n  000001f: error: OnLoopExpr callback failed\nout/test/spec/loop.wast:751: assert_invalid passed:\n  out/test/spec/loop/loop.36.wasm:0000020: error: type mismatch in loop, expected [i32, f64] but got []\n  0000020: error: OnLoopExpr callback failed\nout/test/spec/loop.wast:757: assert_invalid passed:\n  out/test/spec/loop/loop.37.wasm:0000024: error: type mismatch in loop, expected [i32] but got [f32]\n  0000024: error: OnLoopExpr callback failed\nout/test/spec/loop.wast:763: assert_invalid passed:\n  out/test/spec/loop/loop.38.wasm:0000025: error: type mismatch in loop, expected [f32, i32] but got [f32]\n  0000025: error: OnLoopExpr callback failed\nout/test/spec/loop.wast:770: assert_malformed passed:\n  out/test/spec/loop/loop.39.wat:1:44: error: unexpected token $x, expected ).\n  (func (param i32) (result i32) loop (param $x i32) end)\n                                             ^^\nout/test/spec/loop.wast:774: assert_malformed passed:\n  out/test/spec/loop/loop.40.wat:1:45: error: unexpected token $x, expected ).\n  (func (param i32) (result i32) (loop (param $x i32)))\n                                              ^^\nout/test/spec/loop.wast:779: assert_malformed passed:\n  out/test/spec/loop/loop.41.wat:1:16: error: unexpected label \"$l\"\n  (func loop end $l)\n                 ^^\nout/test/spec/loop.wast:783: assert_malformed passed:\n  out/test/spec/loop/loop.42.wat:1:19: error: mismatching label \"$a\" != \"$l\"\n  (func loop $a end $l)\n                    ^^\n120/120 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/memory.wast\n(;; STDOUT ;;;\nout/test/spec/memory.wast:10: assert_invalid passed:\n  out/test/spec/memory/memory.6.wasm:000000f: error: only one memory block allowed\n  000000f: error: OnMemory callback failed\nout/test/spec/memory.wast:11: assert_invalid passed:\n  out/test/spec/memory/memory.7.wasm:0000023: error: only one memory block allowed\n  0000023: error: OnMemory callback failed\nout/test/spec/memory.wast:20: assert_invalid passed:\n  out/test/spec/memory/memory.11.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory.wast:21: assert_invalid passed:\n  out/test/spec/memory/memory.12.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory.wast:22: assert_invalid passed:\n  out/test/spec/memory/memory.13.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory.wast:25: assert_invalid passed:\n  out/test/spec/memory/memory.14.wasm:000001c: error: memory variable out of range: 0 (max 0)\n  000001c: error: OnLoadExpr callback failed\nout/test/spec/memory.wast:29: assert_invalid passed:\n  out/test/spec/memory/memory.15.wasm:0000021: error: memory variable out of range: 0 (max 0)\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/memory.wast:33: assert_invalid passed:\n  out/test/spec/memory/memory.16.wasm:000001c: error: memory variable out of range: 0 (max 0)\n  000001c: error: OnLoadExpr callback failed\nout/test/spec/memory.wast:37: assert_invalid passed:\n  out/test/spec/memory/memory.17.wasm:000001e: error: memory variable out of range: 0 (max 0)\n  000001e: error: OnStoreExpr callback failed\nout/test/spec/memory.wast:41: assert_invalid passed:\n  out/test/spec/memory/memory.18.wasm:0000019: error: memory variable out of range: 0 (max 0)\n  0000019: error: OnMemorySizeExpr callback failed\nout/test/spec/memory.wast:45: assert_invalid passed:\n  out/test/spec/memory/memory.19.wasm:000001b: error: memory variable out of range: 0 (max 0)\n  000001b: error: OnMemoryGrowExpr callback failed\nout/test/spec/memory.wast:51: assert_invalid passed:\n  out/test/spec/memory/memory.20.wasm:000000e: error: max pages (0) must be >= initial pages (1)\n  000000e: error: OnMemory callback failed\nout/test/spec/memory.wast:55: assert_invalid passed:\n  out/test/spec/memory/memory.21.wasm:000000f: error: initial pages (65537) must be <= (65536)\n  000000f: error: OnMemory callback failed\nout/test/spec/memory.wast:59: assert_invalid passed:\n  out/test/spec/memory/memory.22.wasm:0000011: error: initial pages (2147483648) must be <= (65536)\n  0000011: error: OnMemory callback failed\nout/test/spec/memory.wast:63: assert_invalid passed:\n  out/test/spec/memory/memory.23.wasm:0000011: error: initial pages (4294967295) must be <= (65536)\n  0000011: error: OnMemory callback failed\nout/test/spec/memory.wast:67: assert_invalid passed:\n  out/test/spec/memory/memory.24.wasm:0000010: error: max pages (65537) must be <= (65536)\n  0000010: error: OnMemory callback failed\nout/test/spec/memory.wast:71: assert_invalid passed:\n  out/test/spec/memory/memory.25.wasm:0000012: error: max pages (2147483648) must be <= (65536)\n  0000012: error: OnMemory callback failed\nout/test/spec/memory.wast:75: assert_invalid passed:\n  out/test/spec/memory/memory.26.wasm:0000012: error: max pages (4294967295) must be <= (65536)\n  0000012: error: OnMemory callback failed\nout/test/spec/memory.wast:80: assert_malformed passed:\n  out/test/spec/memory/memory.27.wat:1:9: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000)\n          ^^^^^^^^^^^^^\nout/test/spec/memory.wast:84: assert_malformed passed:\n  out/test/spec/memory/memory.28.wat:1:9: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000 0x1_0000_0000)\n          ^^^^^^^^^^^^^\n  out/test/spec/memory/memory.28.wat:1:23: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000 0x1_0000_0000)\n                        ^^^^^^^^^^^^^\nout/test/spec/memory.wast:88: assert_malformed passed:\n  out/test/spec/memory/memory.29.wat:1:11: error: invalid int \"0x1_0000_0000\"\n  (memory 0 0x1_0000_0000)\n            ^^^^^^^^^^^^^\nout/test/spec/memory.wast:231: assert_malformed passed:\n  out/test/spec/memory/memory.31.wat:1:17: error: redefinition of memory \"$foo\"\n  (memory $foo 1)(memory $foo 1)\n                  ^^^^^^\nout/test/spec/memory.wast:235: assert_malformed passed:\n  out/test/spec/memory/memory.32.wat:1:32: error: redefinition of memory \"$foo\"\n  (import \"\" \"\" (memory $foo 1))(memory $foo 1)\n                                 ^^^^^^\nout/test/spec/memory.wast:239: assert_malformed passed:\n  out/test/spec/memory/memory.33.wat:1:32: error: redefinition of memory \"$foo\"\n  (import \"\" \"\" (memory $foo 1))(import \"\" \"\" (memory $foo 1))\n                                 ^^^^^^\n88/88 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/address.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/address.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/address.wast:192: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/address.wast:194: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address.wast:195: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address.wast:196: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address.wast:197: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address.wast:198: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address.wast:199: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address.wast:201: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory64/address.wast:202: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory64/address.wast:203: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory64/address.wast:204: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory64/address.wast:205: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address.wast:207: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address.wast:208: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address.wast:209: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address.wast:210: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address.wast:211: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address.wast:214: assert_invalid passed:\n  out/test/spec/memory64/address/address.1.wat:1:24: error: offset must be less than or equal to 0xffffffff\n  (memory 1)(func (drop (i32.load offset=4294967296 (i32.const 0))))\n                         ^^^^^^^^\nout/test/spec/memory64/address.wast:486: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory64/address.wast:488: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address.wast:489: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address.wast:490: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address.wast:491: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address.wast:492: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address.wast:493: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address.wast:494: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/memory64/address.wast:496: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory64/address.wast:497: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory64/address.wast:498: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory64/address.wast:499: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory64/address.wast:500: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address.wast:501: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address.wast:502: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/memory64/address.wast:504: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address.wast:505: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address.wast:506: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address.wast:507: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address.wast:508: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address.wast:509: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address.wast:510: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/memory64/address.wast:554: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/address.wast:556: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address.wast:557: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address.wast:559: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address.wast:560: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address.wast:604: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory64/address.wast:606: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/memory64/address.wast:607: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/memory64/address.wast:609: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/memory64/address.wast:610: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\n260/260 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/address64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/address64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/address64.wast:192: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/address64.wast:194: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory64/address64.wast:195: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory64/address64.wast:196: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory64/address64.wast:197: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory64/address64.wast:198: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address64.wast:200: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address64.wast:201: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address64.wast:202: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address64.wast:203: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address64.wast:204: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address64.wast:472: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory64/address64.wast:474: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory64/address64.wast:475: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory64/address64.wast:476: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory64/address64.wast:477: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory64/address64.wast:478: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address64.wast:479: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address64.wast:480: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/memory64/address64.wast:482: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address64.wast:483: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/memory64/address64.wast:484: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address64.wast:485: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/memory64/address64.wast:486: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address64.wast:487: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address64.wast:488: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/memory64/address64.wast:532: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/address64.wast:534: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory64/address64.wast:535: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/memory64/address64.wast:579: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory64/address64.wast:581: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/memory64/address64.wast:582: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\n242/242 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/align64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/align64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/align64.wast:28: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.23.wat:1:49: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load8_s align=0 (i64.const 0)))))\n                                                  ^^^^^^^\nout/test/spec/memory64/align64.wast:34: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.24.wat:1:49: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load8_s align=7 (i64.const 0)))))\n                                                  ^^^^^^^\nout/test/spec/memory64/align64.wast:40: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.25.wat:1:49: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load8_u align=0 (i64.const 0)))))\n                                                  ^^^^^^^\nout/test/spec/memory64/align64.wast:46: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.26.wat:1:49: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load8_u align=7 (i64.const 0)))))\n                                                  ^^^^^^^\nout/test/spec/memory64/align64.wast:52: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.27.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load16_s align=0 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:58: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.28.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load16_s align=7 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:64: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.29.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load16_u align=0 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:70: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.30.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load16_u align=7 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:76: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.31.wat:1:46: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load align=0 (i64.const 0)))))\n                                               ^^^^^^^\nout/test/spec/memory64/align64.wast:82: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.32.wat:1:46: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i32.load align=7 (i64.const 0)))))\n                                               ^^^^^^^\nout/test/spec/memory64/align64.wast:88: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.33.wat:1:49: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load8_s align=0 (i64.const 0)))))\n                                                  ^^^^^^^\nout/test/spec/memory64/align64.wast:94: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.34.wat:1:49: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load8_s align=7 (i64.const 0)))))\n                                                  ^^^^^^^\nout/test/spec/memory64/align64.wast:100: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.35.wat:1:49: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load8_u align=0 (i64.const 0)))))\n                                                  ^^^^^^^\nout/test/spec/memory64/align64.wast:106: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.36.wat:1:49: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load8_u align=7 (i64.const 0)))))\n                                                  ^^^^^^^\nout/test/spec/memory64/align64.wast:112: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.37.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load16_s align=0 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:118: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.38.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load16_s align=7 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:124: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.39.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load16_u align=0 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:130: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.40.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load16_u align=7 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:136: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.41.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load32_s align=0 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:142: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.42.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load32_s align=7 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:148: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.43.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load32_u align=0 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:154: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.44.wat:1:50: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load32_u align=7 (i64.const 0)))))\n                                                   ^^^^^^^\nout/test/spec/memory64/align64.wast:160: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.45.wat:1:46: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load align=0 (i64.const 0)))))\n                                               ^^^^^^^\nout/test/spec/memory64/align64.wast:166: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.46.wat:1:46: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (i64.load align=7 (i64.const 0)))))\n                                               ^^^^^^^\nout/test/spec/memory64/align64.wast:172: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.47.wat:1:46: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (f32.load align=0 (i64.const 0)))))\n                                               ^^^^^^^\nout/test/spec/memory64/align64.wast:178: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.48.wat:1:46: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (f32.load align=7 (i64.const 0)))))\n                                               ^^^^^^^\nout/test/spec/memory64/align64.wast:184: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.49.wat:1:46: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (f64.load align=0 (i64.const 0)))))\n                                               ^^^^^^^\nout/test/spec/memory64/align64.wast:190: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.50.wat:1:46: error: alignment must be power-of-two\n  (module (memory i64 0) (func (drop (f64.load align=7 (i64.const 0)))))\n                                               ^^^^^^^\nout/test/spec/memory64/align64.wast:197: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.51.wat:1:42: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i32.store8 align=0 (i64.const 0) (i32.const 0))))\n                                           ^^^^^^^\nout/test/spec/memory64/align64.wast:203: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.52.wat:1:42: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i32.store8 align=7 (i64.const 0) (i32.const 0))))\n                                           ^^^^^^^\nout/test/spec/memory64/align64.wast:209: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.53.wat:1:43: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i32.store16 align=0 (i64.const 0) (i32.const 0))))\n                                            ^^^^^^^\nout/test/spec/memory64/align64.wast:215: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.54.wat:1:43: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i32.store16 align=7 (i64.const 0) (i32.const 0))))\n                                            ^^^^^^^\nout/test/spec/memory64/align64.wast:221: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.55.wat:1:41: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i32.store align=0 (i64.const 0) (i32.const 0))))\n                                          ^^^^^^^\nout/test/spec/memory64/align64.wast:227: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.56.wat:1:41: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i32.store align=7 (i64.const 0) (i32.const 0))))\n                                          ^^^^^^^\nout/test/spec/memory64/align64.wast:233: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.57.wat:1:42: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i64.store8 align=0 (i64.const 0) (i64.const 0))))\n                                           ^^^^^^^\nout/test/spec/memory64/align64.wast:239: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.58.wat:1:42: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i64.store8 align=7 (i64.const 0) (i64.const 0))))\n                                           ^^^^^^^\nout/test/spec/memory64/align64.wast:245: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.59.wat:1:43: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i64.store16 align=0 (i64.const 0) (i64.const 0))))\n                                            ^^^^^^^\nout/test/spec/memory64/align64.wast:251: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.60.wat:1:43: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i64.store16 align=7 (i64.const 0) (i64.const 0))))\n                                            ^^^^^^^\nout/test/spec/memory64/align64.wast:257: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.61.wat:1:43: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i64.store32 align=0 (i64.const 0) (i64.const 0))))\n                                            ^^^^^^^\nout/test/spec/memory64/align64.wast:263: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.62.wat:1:43: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i64.store32 align=7 (i64.const 0) (i64.const 0))))\n                                            ^^^^^^^\nout/test/spec/memory64/align64.wast:269: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.63.wat:1:41: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i64.store align=0 (i64.const 0) (i64.const 0))))\n                                          ^^^^^^^\nout/test/spec/memory64/align64.wast:275: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.64.wat:1:41: error: alignment must be power-of-two\n  (module (memory i64 0) (func (i64.store align=7 (i64.const 0) (i64.const 0))))\n                                          ^^^^^^^\nout/test/spec/memory64/align64.wast:281: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.65.wat:1:41: error: alignment must be power-of-two\n  (module (memory i64 0) (func (f32.store align=0 (i64.const 0) (f32.const 0))))\n                                          ^^^^^^^\nout/test/spec/memory64/align64.wast:287: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.66.wat:1:41: error: alignment must be power-of-two\n  (module (memory i64 0) (func (f32.store align=7 (i64.const 0) (f32.const 0))))\n                                          ^^^^^^^\nout/test/spec/memory64/align64.wast:293: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.67.wat:1:41: error: alignment must be power-of-two\n  (module (memory i64 0) (func (f64.store align=0 (i64.const 0) (f32.const 0))))\n                                          ^^^^^^^\nout/test/spec/memory64/align64.wast:299: assert_malformed passed:\n  out/test/spec/memory64/align64/align64.68.wat:1:41: error: alignment must be power-of-two\n  (module (memory i64 0) (func (f64.store align=7 (i64.const 0) (f32.const 0))))\n                                          ^^^^^^^\nout/test/spec/memory64/align64.wast:306: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.69.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:310: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.70.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:314: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.71.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:318: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.72.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:322: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.73.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:326: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.74.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:330: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.75.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:334: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.76.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:338: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.77.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:342: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.78.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:346: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.79.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:350: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.80.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:354: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.81.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:358: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.82.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:363: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.83.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:367: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.84.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:371: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.85.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:375: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.86.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:379: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.87.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:383: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.88.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:387: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.89.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:391: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.90.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:395: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.91.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:399: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.92.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:403: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.93.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:407: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.94.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:411: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.95.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:415: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.96.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/align64.wast:420: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.97.wasm:0000023: error: alignment must not be larger than natural alignment (1)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:424: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.98.wasm:0000023: error: alignment must not be larger than natural alignment (2)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:428: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.99.wasm:0000023: error: alignment must not be larger than natural alignment (4)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:432: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.100.wasm:0000023: error: alignment must not be larger than natural alignment (1)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:436: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.101.wasm:0000023: error: alignment must not be larger than natural alignment (2)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:440: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.102.wasm:0000023: error: alignment must not be larger than natural alignment (4)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:444: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.103.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:448: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.104.wasm:0000026: error: alignment must not be larger than natural alignment (4)\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:452: assert_invalid passed:\n  out/test/spec/memory64/align64/align64.105.wasm:000002a: error: alignment must not be larger than natural alignment (8)\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/memory64/align64.wast:864: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\n156/156 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/binary-leb128.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/binary-leb128.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/binary-leb128.wast:218: assert_malformed passed:\n  000000c: error: unable to read u64 leb128: memory initial page count\nout/test/spec/memory64/binary-leb128.wast:226: assert_malformed passed:\n  000000e: error: unable to read u64 leb128: memory max page count\nout/test/spec/memory64/binary-leb128.wast:235: assert_malformed passed:\n  0000010: error: unable to read u32 leb128: data segment flags\nout/test/spec/memory64/binary-leb128.wast:246: assert_malformed passed:\n  0000011: error: unable to read u32 leb128: elem segment flags\nout/test/spec/memory64/binary-leb128.wast:257: assert_malformed passed:\n  0000009: error: unable to read u32 leb128: section size\nout/test/spec/memory64/binary-leb128.wast:268: assert_malformed passed:\n  000000a: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary-leb128.wast:279: assert_malformed passed:\n  000000c: error: unable to read u32 leb128: function param count\nout/test/spec/memory64/binary-leb128.wast:291: assert_malformed passed:\n  000000f: error: unable to read u32 leb128: function result count\nout/test/spec/memory64/binary-leb128.wast:303: assert_malformed passed:\n  0000012: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary-leb128.wast:318: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary-leb128.wast:333: assert_malformed passed:\n  0000026: error: unable to read u32 leb128: import signature index\nout/test/spec/memory64/binary-leb128.wast:348: assert_malformed passed:\n  0000011: error: unable to read u32 leb128: function signature index\nout/test/spec/memory64/binary-leb128.wast:360: assert_malformed passed:\n  0000015: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary-leb128.wast:376: assert_malformed passed:\n  0000019: error: unable to read u32 leb128: export item index\nout/test/spec/memory64/binary-leb128.wast:392: assert_malformed passed:\n  0000014: error: unable to read u32 leb128: function body count\nout/test/spec/memory64/binary-leb128.wast:405: assert_malformed passed:\n  0000022: error: unable to read u64 leb128: load offset\nout/test/spec/memory64/binary-leb128.wast:424: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: load alignment\nout/test/spec/memory64/binary-leb128.wast:443: assert_malformed passed:\n  0000023: error: unable to read u32 leb128: store alignment\nout/test/spec/memory64/binary-leb128.wast:462: assert_malformed passed:\n  0000024: error: unable to read u64 leb128: store offset\nout/test/spec/memory64/binary-leb128.wast:483: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/memory64/binary-leb128.wast:493: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/memory64/binary-leb128.wast:504: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/memory64/binary-leb128.wast:514: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/memory64/binary-leb128.wast:526: assert_malformed passed:\n  000000c: error: unable to read u64 leb128: memory initial page count\nout/test/spec/memory64/binary-leb128.wast:534: assert_malformed passed:\n  000000c: error: unable to read u64 leb128: memory initial page count\nout/test/spec/memory64/binary-leb128.wast:542: assert_malformed passed:\n  000000e: error: unable to read u64 leb128: memory max page count\nout/test/spec/memory64/binary-leb128.wast:551: assert_malformed passed:\n  000000e: error: unable to read u64 leb128: memory max page count\nout/test/spec/memory64/binary-leb128.wast:560: assert_malformed passed:\n  0000010: error: unable to read u32 leb128: data segment flags\nout/test/spec/memory64/binary-leb128.wast:571: assert_malformed passed:\n  0000011: error: unable to read u32 leb128: elem segment flags\nout/test/spec/memory64/binary-leb128.wast:582: assert_malformed passed:\n  0000009: error: unable to read u32 leb128: section size\nout/test/spec/memory64/binary-leb128.wast:593: assert_malformed passed:\n  000000a: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary-leb128.wast:604: assert_malformed passed:\n  000000c: error: unable to read u32 leb128: function param count\nout/test/spec/memory64/binary-leb128.wast:616: assert_malformed passed:\n  000000f: error: unable to read u32 leb128: function result count\nout/test/spec/memory64/binary-leb128.wast:628: assert_malformed passed:\n  0000012: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary-leb128.wast:643: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary-leb128.wast:658: assert_malformed passed:\n  0000026: error: unable to read u32 leb128: import signature index\nout/test/spec/memory64/binary-leb128.wast:673: assert_malformed passed:\n  0000011: error: unable to read u32 leb128: function signature index\nout/test/spec/memory64/binary-leb128.wast:686: assert_malformed passed:\n  0000015: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary-leb128.wast:702: assert_malformed passed:\n  0000019: error: unable to read u32 leb128: export item index\nout/test/spec/memory64/binary-leb128.wast:718: assert_malformed passed:\n  0000014: error: unable to read u32 leb128: function body count\nout/test/spec/memory64/binary-leb128.wast:731: assert_malformed passed:\n  0000022: error: unable to read u64 leb128: load offset\nout/test/spec/memory64/binary-leb128.wast:750: assert_malformed passed:\n  0000022: error: unable to read u64 leb128: load offset\nout/test/spec/memory64/binary-leb128.wast:769: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: load alignment\nout/test/spec/memory64/binary-leb128.wast:787: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: load alignment\nout/test/spec/memory64/binary-leb128.wast:806: assert_malformed passed:\n  0000023: error: unable to read u32 leb128: store alignment\nout/test/spec/memory64/binary-leb128.wast:825: assert_malformed passed:\n  0000023: error: unable to read u32 leb128: store alignment\nout/test/spec/memory64/binary-leb128.wast:844: assert_malformed passed:\n  0000024: error: unable to read u64 leb128: store offset\nout/test/spec/memory64/binary-leb128.wast:863: assert_malformed passed:\n  0000024: error: unable to read u64 leb128: store offset\nout/test/spec/memory64/binary-leb128.wast:897: assert_malformed passed:\n  0000020: error: unable to read u64 leb128: load offset\nout/test/spec/memory64/binary-leb128.wast:917: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/memory64/binary-leb128.wast:927: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/memory64/binary-leb128.wast:937: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/memory64/binary-leb128.wast:947: assert_malformed passed:\n  000000e: error: unable to read i32 leb128: i32.const value\nout/test/spec/memory64/binary-leb128.wast:958: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/memory64/binary-leb128.wast:968: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/memory64/binary-leb128.wast:978: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/memory64/binary-leb128.wast:988: assert_malformed passed:\n  000000e: error: unable to read i64 leb128: i64.const value\nout/test/spec/memory64/binary-leb128.wast:1019: assert_malformed passed:\n  0000019: error: unable to read u32 leb128: opcode\nout/test/spec/memory64/binary-leb128.wast:1102: assert_malformed passed:\n  000000c: error: unexpected type form (got 0xe0)\n93/93 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/binary.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/binary.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/binary.wast:6: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/memory64/binary.wast:7: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/memory64/binary.wast:8: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/memory64/binary.wast:9: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:10: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:11: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:12: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:13: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:14: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:15: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:16: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:17: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:18: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:21: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:24: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:25: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:28: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:31: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:34: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/memory64/binary.wast:37: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/memory64/binary.wast:38: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/memory64/binary.wast:39: assert_malformed passed:\n  0000006: error: unable to read uint16_t: layer\nout/test/spec/memory64/binary.wast:40: assert_malformed passed:\n  0000008: error: bad wasm file version: 0 (expected 0x1)\nout/test/spec/memory64/binary.wast:41: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xd (expected 0x1)\nout/test/spec/memory64/binary.wast:42: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xe (expected 0x1)\nout/test/spec/memory64/binary.wast:43: assert_malformed passed:\n  0000008: error: bad wasm file version: 0x100 (expected 0x1)\nout/test/spec/memory64/binary.wast:44: assert_malformed passed:\n  0000008: error: wasm components are not yet supported in this tool\nout/test/spec/memory64/binary.wast:45: assert_malformed passed:\n  0000008: error: unsupported wasm layer: 0x100\nout/test/spec/memory64/binary.wast:48: assert_malformed passed:\n  000000a: error: invalid section code: 14\nout/test/spec/memory64/binary.wast:49: assert_malformed passed:\n  000000a: error: invalid section code: 127\nout/test/spec/memory64/binary.wast:50: assert_malformed passed:\n  000000a: error: invalid section code: 128\nout/test/spec/memory64/binary.wast:51: assert_malformed passed:\n  000000a: error: invalid section code: 129\nout/test/spec/memory64/binary.wast:52: assert_malformed passed:\n  000000a: error: invalid section code: 255\nout/test/spec/memory64/binary.wast:56: assert_malformed passed:\n  000001b: error: function body must end with END opcode\nout/test/spec/memory64/binary.wast:77: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/memory64/binary.wast:93: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/memory64/binary.wast:113: assert_malformed passed:\n  0000019: error: init expression must end with END opcode\nout/test/spec/memory64/binary.wast:126: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/memory64/binary.wast:143: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/memory64/binary.wast:160: assert_malformed passed:\n  000001e: error: local count must be <= 0xffffffff\nout/test/spec/memory64/binary.wast:176: assert_malformed passed:\n  0000030: error: local count must be <= 0xffffffff\nout/test/spec/memory64/binary.wast:210: assert_malformed passed:\n  0000013: error: function signature count != function body count\nout/test/spec/memory64/binary.wast:220: assert_malformed passed:\n  000000b: error: function signature count != function body count\nout/test/spec/memory64/binary.wast:229: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/memory64/binary.wast:240: assert_malformed passed:\n  0000015: error: function signature count != function body count\nout/test/spec/memory64/binary.wast:263: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/memory64/binary.wast:275: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/memory64/binary.wast:287: assert_malformed passed:\n  0000010: error: Data section missing but DataCount non-zero\nout/test/spec/memory64/binary.wast:303: assert_malformed passed:\n  0000024: error: memory.init requires data count section\nout/test/spec/memory64/binary.wast:326: assert_malformed passed:\n  000001e: error: data.drop requires data count section\nout/test/spec/memory64/binary.wast:346: assert_malformed passed:\n  0000024: error: unexpected opcode: 0xf3\nout/test/spec/memory64/binary.wast:374: assert_malformed passed:\n  0000022: error: table elem type must be a reference type\nout/test/spec/memory64/binary.wast:459: assert_malformed passed:\n  000000a: error: invalid section size: extends past end\nout/test/spec/memory64/binary.wast:470: assert_malformed passed:\n  000000e: error: unfinished section (expected end: 0x11)\nout/test/spec/memory64/binary.wast:489: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/memory64/binary.wast:499: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/memory64/binary.wast:510: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/memory64/binary.wast:520: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/memory64/binary.wast:531: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/memory64/binary.wast:541: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/memory64/binary.wast:554: assert_malformed passed:\n  0000027: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary.wast:573: assert_malformed passed:\n  000002b: error: unfinished section (expected end: 0x40)\nout/test/spec/memory64/binary.wast:604: assert_malformed passed:\n  000000b: error: invalid table count 1, only 0 bytes left in section\nout/test/spec/memory64/binary.wast:614: assert_malformed passed:\n  000000d: error: malformed table limits flag: 8\nout/test/spec/memory64/binary.wast:623: assert_malformed passed:\n  000000d: error: malformed table limits flag: 8\nout/test/spec/memory64/binary.wast:633: assert_malformed passed:\n  000000d: error: malformed table limits flag: 129\nout/test/spec/memory64/binary.wast:651: assert_malformed passed:\n  000000b: error: invalid memory count 1, only 0 bytes left in section\nout/test/spec/memory64/binary.wast:661: assert_malformed passed:\n  000000c: error: custom page sizes not allowed\nout/test/spec/memory64/binary.wast:669: assert_malformed passed:\n  000000c: error: custom page sizes not allowed\nout/test/spec/memory64/binary.wast:678: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/memory64/binary.wast:687: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/memory64/binary.wast:704: assert_malformed passed:\n  0000010: error: unable to read i32 leb128: global type\nout/test/spec/memory64/binary.wast:715: assert_malformed passed:\n  0000010: error: unfinished section (expected end: 0x15)\nout/test/spec/memory64/binary.wast:738: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/memory64/binary.wast:759: assert_malformed passed:\n  000001b: error: unfinished section (expected end: 0x20)\nout/test/spec/memory64/binary.wast:793: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: elem segment flags\nout/test/spec/memory64/binary.wast:809: assert_malformed passed:\n  0000024: error: init expression must end with END opcode\nout/test/spec/memory64/binary.wast:826: assert_malformed passed:\n  0000021: error: unfinished section (expected end: 0x27)\nout/test/spec/memory64/binary.wast:852: assert_malformed passed:\n  0000016: error: unable to read u32 leb128: data segment flags\nout/test/spec/memory64/binary.wast:865: assert_malformed passed:\n  0000016: error: unfinished section (expected end: 0x1c)\nout/test/spec/memory64/binary.wast:878: assert_malformed passed:\n  0000015: error: unable to read data: data segment data\nout/test/spec/memory64/binary.wast:892: assert_malformed passed:\n  000001a: error: unfinished section (expected end: 0x1b)\nout/test/spec/memory64/binary.wast:923: assert_malformed passed:\n  0000048: error: function body must end with END opcode\nout/test/spec/memory64/binary.wast:970: assert_malformed passed:\n  0000017: error: multiple Start sections\nout/test/spec/memory64/binary.wast:987: assert_malformed passed:\n  0000014: error: multiple Function sections\nout/test/spec/memory64/binary.wast:999: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/memory64/binary.wast:1011: assert_malformed passed:\n  000000d: error: multiple DataCount sections\nout/test/spec/memory64/binary.wast:1021: assert_malformed passed:\n  000000d: error: multiple Data sections\nout/test/spec/memory64/binary.wast:1031: assert_malformed passed:\n  000000d: error: multiple Global sections\nout/test/spec/memory64/binary.wast:1041: assert_malformed passed:\n  000000d: error: multiple Export sections\nout/test/spec/memory64/binary.wast:1051: assert_malformed passed:\n  000000d: error: multiple Table sections\nout/test/spec/memory64/binary.wast:1061: assert_malformed passed:\n  000000d: error: multiple Elem sections\nout/test/spec/memory64/binary.wast:1071: assert_malformed passed:\n  000000d: error: multiple Import sections\nout/test/spec/memory64/binary.wast:1081: assert_malformed passed:\n  000000d: error: multiple Type sections\nout/test/spec/memory64/binary.wast:1091: assert_malformed passed:\n  000000d: error: multiple Memory sections\nout/test/spec/memory64/binary.wast:1101: assert_malformed passed:\n  000000d: error: section Type out of order\nout/test/spec/memory64/binary.wast:1111: assert_malformed passed:\n  000000d: error: section Import out of order\nout/test/spec/memory64/binary.wast:1121: assert_malformed passed:\n  000000d: error: section Function out of order\nout/test/spec/memory64/binary.wast:1131: assert_malformed passed:\n  000000d: error: section Table out of order\nout/test/spec/memory64/binary.wast:1141: assert_malformed passed:\n  000000d: error: section Memory out of order\nout/test/spec/memory64/binary.wast:1151: assert_malformed passed:\n  000000d: error: section Global out of order\nout/test/spec/memory64/binary.wast:1161: assert_malformed passed:\n  0000011: error: section Export out of order\nout/test/spec/memory64/binary.wast:1172: assert_malformed passed:\n  0000011: error: section Start out of order\nout/test/spec/memory64/binary.wast:1183: assert_malformed passed:\n  000000d: error: section Elem out of order\nout/test/spec/memory64/binary.wast:1193: assert_malformed passed:\n  000000d: error: section DataCount out of order\nout/test/spec/memory64/binary.wast:1203: assert_malformed passed:\n  000000d: error: section Code out of order\n126/126 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/binary0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/binary0.wast\n;;; ARGS*: --enable-memory64 --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/memory64/binary0.wast:48: assert_malformed passed:\n  000000e: error: unable to read u64 leb128: memory initial page count\nout/test/spec/memory64/binary0.wast:59: assert_malformed passed:\n  000000d: error: unable to read uint8_t: memory flags\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/call_indirect.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/call_indirect.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/call_indirect.wast:508: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:509: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:510: assert_trap passed: undefined table index\nout/test/spec/memory64/call_indirect.wast:511: assert_trap passed: undefined table index\nout/test/spec/memory64/call_indirect.wast:512: assert_trap passed: undefined table index\nout/test/spec/memory64/call_indirect.wast:518: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:519: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:525: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:526: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:532: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:533: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:539: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:540: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:662: assert_trap passed: undefined table index\nout/test/spec/memory64/call_indirect.wast:667: assert_trap passed: undefined table index\nout/test/spec/memory64/call_indirect.wast:671: assert_trap passed: uninitialized table element\nout/test/spec/memory64/call_indirect.wast:672: assert_trap passed: indirect call signature mismatch\nout/test/spec/memory64/call_indirect.wast:673: assert_trap passed: undefined table index\nout/test/spec/memory64/call_indirect.wast:679: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.2.wat:1:122: error: unexpected token \"param\", expected an expr.\n  ...indirect (type $sig) (result i32) (param i32)    (i32.const 0) (i32.const ...\n                                        ^^^^^\n  out/test/spec/memory64/call_indirect/call_indirect.2.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (type $sig) (result i32) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/memory64/call_indirect.wast:691: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.3.wat:1:109: error: unexpected token \"type\", expected an expr.\n  ... i32)  (call_indirect (param i32) (type $sig) (result i32)    (i32.const 0...\n                                        ^^^^\n  out/test/spec/memory64/call_indirect/call_indirect.3.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (param i32) (type $sig) (result i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/memory64/call_indirect.wast:703: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.4.wat:1:122: error: unexpected token \"type\", expected an expr.\n  ...indirect (param i32) (result i32) (type $sig)    (i32.const 0) (i32.const ...\n                                        ^^^^\n  out/test/spec/memory64/call_indirect/call_indirect.4.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (param i32) (result i32) (type $sig)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/memory64/call_indirect.wast:715: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.5.wat:1:110: error: unexpected token \"type\", expected an expr.\n  ...i32)  (call_indirect (result i32) (type $sig) (param i32)    (i32.const 0)...\n                                        ^^^^\n  out/test/spec/memory64/call_indirect/call_indirect.5.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (result i32) (type $sig) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/memory64/call_indirect.wast:727: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.6.wat:1:110: error: unexpected token \"param\", expected an expr.\n  ...i32)  (call_indirect (result i32) (param i32) (type $sig)    (i32.const 0)...\n                                        ^^^^^\n  out/test/spec/memory64/call_indirect/call_indirect.6.wat:1:166: error: unexpected token ), expected EOF.\n  ...irect (result i32) (param i32) (type $sig)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/memory64/call_indirect.wast:739: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.7.wat:1:67: error: unexpected token \"param\", expected an expr.\n  ...t i32)  (call_indirect (result i32) (param i32) (i32.const 0) (i32.const 0)))\n                                          ^^^^^\n  out/test/spec/memory64/call_indirect/call_indirect.7.wat:1:106: error: unexpected token ), expected EOF.\n  ...t i32)  (call_indirect (result i32) (param i32) (i32.const 0) (i32.const 0)))\n                                                                                 ^\nout/test/spec/memory64/call_indirect.wast:749: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.8.wat:1:46: error: unexpected token $x, expected ).\n  ...e 0 funcref)(func (call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\n                                             ^^\n  out/test/spec/memory64/call_indirect/call_indirect.8.wat:1:82: error: unexpected token ), expected EOF.\n  ...e 0 funcref)(func (call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\n                                                                                 ^\nout/test/spec/memory64/call_indirect.wast:756: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.9.wat:1:57: error: expected 0 results, got 1\n  ...0 funcref)(func (result i32)  (call_indirect (type $sig) (result i32) (i32...\n                                    ^^^^^^^^^^^^^\nout/test/spec/memory64/call_indirect.wast:766: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.10.wat:1:82: error: expected 1 arguments, got 0\n  ...0 funcref)(func (result i32)  (call_indirect (type $sig) (result i32) (i32...\n                                    ^^^^^^^^^^^^^\nout/test/spec/memory64/call_indirect.wast:776: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.11.wat:1:69: error: expected 1 results, got 0\n  ...i32)))(table 0 funcref)(func  (call_indirect (type $sig) (param i32) (i32....\n                                    ^^^^^^^^^^^^^\nout/test/spec/memory64/call_indirect.wast:786: assert_malformed passed:\n  out/test/spec/memory64/call_indirect/call_indirect.12.wat:1:86: error: expected 2 arguments, got 1\n  ...0 funcref)(func (result i32)  (call_indirect (type $sig) (param i32) (resu...\n                                    ^^^^^^^^^^^^^\nout/test/spec/memory64/call_indirect.wast:801: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.13.wasm:000001c: error: table variable out of range: 0 (max 0)\n  out/test/spec/memory64/call_indirect/call_indirect.13.wasm:000001c: error: type mismatch: call_indirect must reference table of funcref type\n  000001c: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:809: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.14.wasm:0000023: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000023: error: OnConvertExpr callback failed\nout/test/spec/memory64/call_indirect.wast:817: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.15.wasm:0000027: error: type mismatch in i32.eqz, expected [i32] but got [i64]\n  0000027: error: OnConvertExpr callback failed\nout/test/spec/memory64/call_indirect.wast:826: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.16.wasm:0000026: error: type mismatch in call_indirect, expected [i32] but got []\n  0000026: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:834: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.17.wasm:0000027: error: type mismatch in call_indirect, expected [f64, i32] but got []\n  0000027: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:842: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.18.wasm:0000025: error: type mismatch at end of function, expected [] but got [i32]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/memory64/call_indirect.wast:850: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.19.wasm:000002e: error: type mismatch at end of function, expected [] but got [f64, i32]\n  000002e: error: EndFunctionBody callback failed\nout/test/spec/memory64/call_indirect.wast:861: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.20.wasm:0000027: error: type mismatch in call_indirect, expected [i32] but got []\n  0000027: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:869: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.21.wasm:0000028: error: type mismatch in call_indirect, expected [i32] but got [... i64]\n  0000028: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:878: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.22.wasm:000002a: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  000002a: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:888: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.23.wasm:000002a: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  000002a: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:898: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.24.wasm:0000032: error: type mismatch in call_indirect, expected [i32, f64] but got [f64, i32]\n  0000032: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:908: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.25.wasm:0000032: error: type mismatch in call_indirect, expected [f64, i32] but got [i32, f64]\n  0000032: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:919: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.26.wasm:0000036: error: type mismatch in call_indirect, expected [i32] but got []\n  0000036: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:932: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.27.wasm:0000039: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  0000039: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:945: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.28.wasm:0000036: error: type mismatch in call_indirect, expected [i32] but got []\n  0000036: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:958: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.29.wasm:0000039: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  0000039: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:971: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.30.wasm:000003a: error: type mismatch in call_indirect, expected [i32] but got []\n  000003a: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:987: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.31.wasm:000003d: error: type mismatch in call_indirect, expected [i32, i32] but got [i32]\n  000003d: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:1007: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.32.wasm:0000022: error: function type variable out of range: 1 (max 1)\n  0000022: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:1014: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.33.wasm:0000026: error: function type variable out of range: 1012321300 (max 1)\n  0000026: error: OnCallIndirectExpr callback failed\nout/test/spec/memory64/call_indirect.wast:1025: assert_invalid passed:\n  out/test/spec/memory64/call_indirect/call_indirect.34.wasm:0000018: error: function variable out of range: 0 (max 0)\n  0000018: error: OnRefFuncExpr callback failed\n171/171 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/endianness64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/endianness64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n69/69 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/float_memory64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/float_memory64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nreset() =>\nf32.store() =>\nreset() =>\ni32.store() =>\nreset() =>\nf64.store() =>\nreset() =>\ni64.store() =>\nreset() =>\nf32.store() =>\nreset() =>\ni32.store() =>\nreset() =>\nf64.store() =>\nreset() =>\ni64.store() =>\nreset() =>\nf32.store() =>\nreset() =>\ni32.store() =>\nreset() =>\nf64.store() =>\nreset() =>\ni64.store() =>\n90/90 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/imports.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/imports.wast\n;;; ARGS*: --enable-memory64 --enable-exceptions --enable-multi-memory\n(;; STDOUT ;;;\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i32_f32(i32:14, f32:42.000000) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_f32(f32:13.000000) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i64(i64:24) =>\ncalled host spectest.print_f64_f64(f64:25.000000, f64:53.000000) =>\ncalled host spectest.print_i64(i64:24) =>\ncalled host spectest.print_f64(f64:24.000000) =>\ncalled host spectest.print_f64(f64:24.000000) =>\ncalled host spectest.print_f64(f64:24.000000) =>\nout/test/spec/memory64/imports.wast:99: assert_invalid passed:\n  out/test/spec/memory64/imports/imports.2.wasm:000001e: error: function type variable out of range: 1 (max 1)\n  000001e: error: OnImportFunc callback failed\ncalled host spectest.print_i32(i32:13) =>\nout/test/spec/memory64/imports.wast:135: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/memory64/imports.wast:139: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/memory64/imports.wast:144: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:148: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:152: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:156: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:160: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:164: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:168: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:172: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:176: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:180: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:184: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:188: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:192: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:196: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:200: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:204: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/memory64/imports.wast:209: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind func, not global\nout/test/spec/memory64/imports.wast:213: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind func, not table\nout/test/spec/memory64/imports.wast:217: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind func, not memory\nout/test/spec/memory64/imports.wast:221: assert_unlinkable passed:\n  error: expected import \"test.tag\" to have kind func, not tag\nout/test/spec/memory64/imports.wast:225: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind func, not global\nout/test/spec/memory64/imports.wast:229: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind func, not table\nout/test/spec/memory64/imports.wast:233: assert_unlinkable passed:\n  error: expected import \"spectest.memory\" to have kind func, not memory\nout/test/spec/memory64/imports.wast:238: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/memory64/imports.wast:242: assert_unlinkable passed:\n  error: signature mismatch in imported tag\nout/test/spec/memory64/imports.wast:246: assert_unlinkable passed:\n  error: signature mismatch in imported tag\nout/test/spec/memory64/imports.wast:250: assert_unlinkable passed:\n  error: signature mismatch in imported tag\nout/test/spec/memory64/imports.wast:254: assert_unlinkable passed:\n  error: expected import \"test.func-i32\" to have kind tag, not func\nout/test/spec/memory64/imports.wast:294: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/memory64/imports.wast:298: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/memory64/imports.wast:303: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i64 but got i32.\nout/test/spec/memory64/imports.wast:307: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f32 but got i32.\nout/test/spec/memory64/imports.wast:311: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got i32.\nout/test/spec/memory64/imports.wast:315: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/memory64/imports.wast:319: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i32 but got f32.\nout/test/spec/memory64/imports.wast:323: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i64 but got f32.\nout/test/spec/memory64/imports.wast:327: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got f32.\nout/test/spec/memory64/imports.wast:331: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/memory64/imports.wast:335: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i32 but got i64.\nout/test/spec/memory64/imports.wast:339: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f32 but got i64.\nout/test/spec/memory64/imports.wast:343: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got i64.\nout/test/spec/memory64/imports.wast:347: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected mutable but got immutable.\nout/test/spec/memory64/imports.wast:352: assert_unlinkable passed:\n  error: expected import \"test.func\" to have kind global, not func\nout/test/spec/memory64/imports.wast:356: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind global, not table\nout/test/spec/memory64/imports.wast:360: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind global, not memory\nout/test/spec/memory64/imports.wast:364: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind global, not func\nout/test/spec/memory64/imports.wast:368: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind global, not table\nout/test/spec/memory64/imports.wast:372: assert_unlinkable passed:\n  error: expected import \"spectest.memory\" to have kind global, not memory\nout/test/spec/memory64/imports.wast:392: assert_trap passed: uninitialized table element\nout/test/spec/memory64/imports.wast:395: assert_trap passed: uninitialized table element\nout/test/spec/memory64/imports.wast:396: assert_trap passed: undefined table index\nout/test/spec/memory64/imports.wast:412: assert_trap passed: uninitialized table element\nout/test/spec/memory64/imports.wast:415: assert_trap passed: uninitialized table element\nout/test/spec/memory64/imports.wast:416: assert_trap passed: undefined table index\nout/test/spec/memory64/imports.wast:463: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/memory64/imports.wast:467: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/memory64/imports.wast:472: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/memory64/imports.wast:476: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (20)\nout/test/spec/memory64/imports.wast:480: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/memory64/imports.wast:484: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (20)\nout/test/spec/memory64/imports.wast:488: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/memory64/imports.wast:492: assert_unlinkable passed:\n  error: max size (20) larger than declared (18)\nout/test/spec/memory64/imports.wast:496: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/memory64/imports.wast:500: assert_unlinkable passed:\n  error: max size (20) larger than declared (18)\nout/test/spec/memory64/imports.wast:504: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/memory64/imports.wast:508: assert_unlinkable passed:\n  error: max size (20) larger than declared (15)\nout/test/spec/memory64/imports.wast:513: assert_unlinkable passed:\n  error: expected import \"test.func\" to have kind table, not func\nout/test/spec/memory64/imports.wast:517: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind table, not global\nout/test/spec/memory64/imports.wast:521: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind table, not memory\nout/test/spec/memory64/imports.wast:525: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind table, not func\nout/test/spec/memory64/imports.wast:530: assert_unlinkable passed:\n  error: expected i64 memory, but i32 memory provided\nout/test/spec/memory64/imports.wast:534: assert_unlinkable passed:\n  error: expected i32 memory, but i64 memory provided\nout/test/spec/memory64/imports.wast:538: assert_unlinkable passed:\n  error: expected i64 memory, but i32 memory provided\nout/test/spec/memory64/imports.wast:542: assert_unlinkable passed:\n  error: expected i32 memory, but i64 memory provided\nout/test/spec/memory64/imports.wast:561: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/memory64/imports.wast:574: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/memory64/imports.wast:607: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/memory64/imports.wast:611: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/memory64/imports.wast:616: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (1)\nout/test/spec/memory64/imports.wast:620: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (2)\nout/test/spec/memory64/imports.wast:624: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (3)\nout/test/spec/memory64/imports.wast:628: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (3)\nout/test/spec/memory64/imports.wast:632: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:636: assert_unlinkable passed:\n  error: max size (4) larger than declared (1)\nout/test/spec/memory64/imports.wast:640: assert_unlinkable passed:\n  error: max size (4) larger than declared (2)\nout/test/spec/memory64/imports.wast:644: assert_unlinkable passed:\n  error: max size (4) larger than declared (3)\nout/test/spec/memory64/imports.wast:648: assert_unlinkable passed:\n  error: max size (4) larger than declared (2)\nout/test/spec/memory64/imports.wast:652: assert_unlinkable passed:\n  error: max size (4) larger than declared (3)\nout/test/spec/memory64/imports.wast:656: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:660: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:664: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:668: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (4)\nout/test/spec/memory64/imports.wast:672: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (4)\nout/test/spec/memory64/imports.wast:676: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:680: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (4)\nout/test/spec/memory64/imports.wast:684: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (5)\nout/test/spec/memory64/imports.wast:688: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (1)\nout/test/spec/memory64/imports.wast:692: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (2)\nout/test/spec/memory64/imports.wast:696: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (3)\nout/test/spec/memory64/imports.wast:700: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (3)\nout/test/spec/memory64/imports.wast:704: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:708: assert_unlinkable passed:\n  error: max size (4) larger than declared (1)\nout/test/spec/memory64/imports.wast:712: assert_unlinkable passed:\n  error: max size (4) larger than declared (2)\nout/test/spec/memory64/imports.wast:716: assert_unlinkable passed:\n  error: max size (4) larger than declared (3)\nout/test/spec/memory64/imports.wast:720: assert_unlinkable passed:\n  error: max size (4) larger than declared (2)\nout/test/spec/memory64/imports.wast:724: assert_unlinkable passed:\n  error: max size (4) larger than declared (3)\nout/test/spec/memory64/imports.wast:728: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:732: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:736: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:740: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (4)\nout/test/spec/memory64/imports.wast:744: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (4)\nout/test/spec/memory64/imports.wast:748: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/memory64/imports.wast:752: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (4)\nout/test/spec/memory64/imports.wast:756: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (5)\nout/test/spec/memory64/imports.wast:760: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/memory64/imports.wast:764: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\nout/test/spec/memory64/imports.wast:769: assert_unlinkable passed:\n  error: expected i64 memory, but i32 memory provided\nout/test/spec/memory64/imports.wast:773: assert_unlinkable passed:\n  error: expected i32 memory, but i64 memory provided\nout/test/spec/memory64/imports.wast:777: assert_unlinkable passed:\n  error: expected i64 memory, but i32 memory provided\nout/test/spec/memory64/imports.wast:781: assert_unlinkable passed:\n  error: expected i32 memory, but i64 memory provided\nout/test/spec/memory64/imports.wast:786: assert_unlinkable passed:\n  error: expected import \"test.func-i32\" to have kind memory, not func\nout/test/spec/memory64/imports.wast:790: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind memory, not global\nout/test/spec/memory64/imports.wast:794: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind memory, not table\nout/test/spec/memory64/imports.wast:798: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind memory, not func\nout/test/spec/memory64/imports.wast:802: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind memory, not global\nout/test/spec/memory64/imports.wast:806: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind memory, not table\nout/test/spec/memory64/imports.wast:811: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/memory64/imports.wast:815: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\nout/test/spec/memory64/imports.wast:833: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.205.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (func))\n          ^^^^^^\nout/test/spec/memory64/imports.wast:837: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.206.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (global i64))\n          ^^^^^^\nout/test/spec/memory64/imports.wast:841: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.207.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (table 0 funcref))\n          ^^^^^^\nout/test/spec/memory64/imports.wast:845: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.208.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (memory 0))\n          ^^^^^^\nout/test/spec/memory64/imports.wast:850: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.209.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (func))\n                              ^^^^^^\nout/test/spec/memory64/imports.wast:854: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.210.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (global f32))\n                              ^^^^^^\nout/test/spec/memory64/imports.wast:858: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.211.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (table 0 funcref))\n                              ^^^^^^\nout/test/spec/memory64/imports.wast:862: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.212.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (memory 0))\n                              ^^^^^^\nout/test/spec/memory64/imports.wast:867: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.213.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (func))\n                     ^^^^^^\nout/test/spec/memory64/imports.wast:871: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.214.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (global i32))\n                     ^^^^^^\nout/test/spec/memory64/imports.wast:875: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.215.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (table 0 funcref))\n                     ^^^^^^\nout/test/spec/memory64/imports.wast:879: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.216.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (memory 0))\n                     ^^^^^^\nout/test/spec/memory64/imports.wast:884: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.217.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (func))\n              ^^^^^^\nout/test/spec/memory64/imports.wast:888: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.218.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (global i32))\n              ^^^^^^\nout/test/spec/memory64/imports.wast:892: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.219.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (table 1 3 funcref))\n              ^^^^^^\nout/test/spec/memory64/imports.wast:896: assert_malformed passed:\n  out/test/spec/memory64/imports/imports.220.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (memory 1 2))\n              ^^^^^^\nout/test/spec/memory64/imports.wast:906: assert_unlinkable passed:\n  error: invalid import \"not wasm.overloaded\"\n257/257 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/load64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/load64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/load64.wast:214: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.1.wat:1:47: error: unexpected token \"i32.load32\", expected an instr.\n  (memory i64 1)(func (param i64) (result i32) (i32.load32 (local.get 0)))\n                                                ^^^^^^^^^^\nout/test/spec/memory64/load64.wast:221: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.2.wat:1:47: error: unexpected token \"i32.load32_u\", expected an instr.\n  (memory i64 1)(func (param i64) (result i32) (i32.load32_u (local.get 0)))\n                                                ^^^^^^^^^^^^\nout/test/spec/memory64/load64.wast:228: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.3.wat:1:47: error: unexpected token \"i32.load32_s\", expected an instr.\n  (memory i64 1)(func (param i64) (result i32) (i32.load32_s (local.get 0)))\n                                                ^^^^^^^^^^^^\nout/test/spec/memory64/load64.wast:235: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.4.wat:1:47: error: unexpected token \"i32.load64\", expected an instr.\n  (memory i64 1)(func (param i64) (result i32) (i32.load64 (local.get 0)))\n                                                ^^^^^^^^^^\nout/test/spec/memory64/load64.wast:242: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.5.wat:1:47: error: unexpected token \"i32.load64_u\", expected an instr.\n  (memory i64 1)(func (param i64) (result i32) (i32.load64_u (local.get 0)))\n                                                ^^^^^^^^^^^^\nout/test/spec/memory64/load64.wast:249: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.6.wat:1:47: error: unexpected token \"i32.load64_s\", expected an instr.\n  (memory i64 1)(func (param i64) (result i32) (i32.load64_s (local.get 0)))\n                                                ^^^^^^^^^^^^\nout/test/spec/memory64/load64.wast:257: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.7.wat:1:47: error: unexpected token \"i64.load64\", expected an instr.\n  (memory i64 1)(func (param i64) (result i64) (i64.load64 (local.get 0)))\n                                                ^^^^^^^^^^\nout/test/spec/memory64/load64.wast:264: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.8.wat:1:47: error: unexpected token \"i64.load64_u\", expected an instr.\n  (memory i64 1)(func (param i64) (result i64) (i64.load64_u (local.get 0)))\n                                                ^^^^^^^^^^^^\nout/test/spec/memory64/load64.wast:271: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.9.wat:1:47: error: unexpected token \"i64.load64_s\", expected an instr.\n  (memory i64 1)(func (param i64) (result i64) (i64.load64_s (local.get 0)))\n                                                ^^^^^^^^^^^^\nout/test/spec/memory64/load64.wast:279: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.10.wat:1:47: error: unexpected token \"f32.load32\", expected an instr.\n  (memory i64 1)(func (param i64) (result f32) (f32.load32 (local.get 0)))\n                                                ^^^^^^^^^^\nout/test/spec/memory64/load64.wast:286: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.11.wat:1:47: error: unexpected token \"f32.load64\", expected an instr.\n  (memory i64 1)(func (param i64) (result f32) (f32.load64 (local.get 0)))\n                                                ^^^^^^^^^^\nout/test/spec/memory64/load64.wast:294: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.12.wat:1:47: error: unexpected token \"f64.load32\", expected an instr.\n  (memory i64 1)(func (param i64) (result f64) (f64.load32 (local.get 0)))\n                                                ^^^^^^^^^^\nout/test/spec/memory64/load64.wast:301: assert_malformed passed:\n  out/test/spec/memory64/load64/load64.13.wat:1:47: error: unexpected token \"f64.load64\", expected an instr.\n  (memory i64 1)(func (param i64) (result f64) (f64.load64 (local.get 0)))\n                                                ^^^^^^^^^^\nout/test/spec/memory64/load64.wast:312: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.14.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:316: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.15.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:320: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.16.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:324: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.17.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:328: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.18.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:332: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.19.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:336: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.20.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:340: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.21.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:344: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.22.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:348: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.23.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:352: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.24.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:356: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.25.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:360: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.26.wasm:0000022: error: type mismatch at end of function, expected [] but got [f32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:364: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.27.wasm:0000022: error: type mismatch at end of function, expected [] but got [f64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/load64.wast:371: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.28.wasm:0000025: error: type mismatch in i32.load, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:372: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.29.wasm:0000025: error: type mismatch in i32.load8_s, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:373: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.30.wasm:0000025: error: type mismatch in i32.load8_u, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:374: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.31.wasm:0000025: error: type mismatch in i32.load16_s, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:375: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.32.wasm:0000025: error: type mismatch in i32.load16_u, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:376: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.33.wasm:0000025: error: type mismatch in i64.load, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:377: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.34.wasm:0000025: error: type mismatch in i64.load8_s, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:378: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.35.wasm:0000025: error: type mismatch in i64.load8_u, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:379: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.36.wasm:0000025: error: type mismatch in i64.load16_s, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:380: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.37.wasm:0000025: error: type mismatch in i64.load16_u, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:381: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.38.wasm:0000025: error: type mismatch in i64.load32_s, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:382: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.39.wasm:0000025: error: type mismatch in i64.load32_u, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:383: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.40.wasm:0000025: error: type mismatch in f32.load, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:384: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.41.wasm:0000025: error: type mismatch in f64.load, expected [i64] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:388: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.42.wasm:000001f: error: type mismatch in i32.load, expected [i64] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:397: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.43.wasm:0000023: error: type mismatch in i32.load, expected [i64] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:407: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.44.wasm:0000023: error: type mismatch in i32.load, expected [i64] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:417: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.45.wasm:0000025: error: type mismatch in i32.load, expected [i64] but got []\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:427: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.46.wasm:0000028: error: type mismatch in i32.load, expected [i64] but got []\n  0000028: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:437: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.47.wasm:0000023: error: type mismatch in i32.load, expected [i64] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:447: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.48.wasm:0000023: error: type mismatch in i32.load, expected [i64] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:457: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.49.wasm:0000023: error: type mismatch in i32.load, expected [i64] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:467: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.50.wasm:000001f: error: type mismatch in i32.load, expected [i64] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:476: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.51.wasm:000001f: error: type mismatch in i32.load, expected [i64] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:485: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.52.wasm:0000025: error: type mismatch in i32.load, expected [i64] but got []\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:495: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.53.wasm:000003c: error: type mismatch in i32.load, expected [i64] but got []\n  000003c: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:512: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.54.wasm:0000021: error: type mismatch in i32.load, expected [i64] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:522: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.55.wasm:0000021: error: type mismatch in i32.load, expected [i64] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:532: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.56.wasm:0000027: error: type mismatch in i32.load, expected [i64] but got []\n  0000027: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:542: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.57.wasm:000001f: error: type mismatch in i64.load, expected [i64] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:551: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.58.wasm:000001f: error: type mismatch in i32.load, expected [i64] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/memory64/load64.wast:560: assert_invalid passed:\n  out/test/spec/memory64/load64/load64.59.wasm:000001f: error: type mismatch in i32.load, expected [i64] but got []\n  000001f: error: OnLoadExpr callback failed\n97/97 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/memory.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/memory.wast:17: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.9.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory64/memory.wast:18: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.10.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory64/memory.wast:19: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.11.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory64/memory.wast:22: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.12.wasm:000001c: error: memory variable out of range: 0 (max 0)\n  000001c: error: OnLoadExpr callback failed\nout/test/spec/memory64/memory.wast:26: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.13.wasm:0000021: error: memory variable out of range: 0 (max 0)\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/memory64/memory.wast:30: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.14.wasm:000001c: error: memory variable out of range: 0 (max 0)\n  000001c: error: OnLoadExpr callback failed\nout/test/spec/memory64/memory.wast:34: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.15.wasm:000001e: error: memory variable out of range: 0 (max 0)\n  000001e: error: OnStoreExpr callback failed\nout/test/spec/memory64/memory.wast:38: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.16.wasm:0000019: error: memory variable out of range: 0 (max 0)\n  0000019: error: OnMemorySizeExpr callback failed\nout/test/spec/memory64/memory.wast:42: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.17.wasm:000001b: error: memory variable out of range: 0 (max 0)\n  000001b: error: OnMemoryGrowExpr callback failed\nout/test/spec/memory64/memory.wast:48: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.18.wasm:000000e: error: max pages (0) must be >= initial pages (1)\n  000000e: error: OnMemory callback failed\nout/test/spec/memory64/memory.wast:52: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.19.wasm:000000f: error: initial pages (65537) must be <= (65536)\n  000000f: error: OnMemory callback failed\nout/test/spec/memory64/memory.wast:56: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.20.wasm:0000011: error: initial pages (2147483648) must be <= (65536)\n  0000011: error: OnMemory callback failed\nout/test/spec/memory64/memory.wast:60: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.21.wasm:0000011: error: initial pages (4294967295) must be <= (65536)\n  0000011: error: OnMemory callback failed\nout/test/spec/memory64/memory.wast:64: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.22.wasm:0000010: error: max pages (65537) must be <= (65536)\n  0000010: error: OnMemory callback failed\nout/test/spec/memory64/memory.wast:68: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.23.wasm:0000012: error: max pages (2147483648) must be <= (65536)\n  0000012: error: OnMemory callback failed\nout/test/spec/memory64/memory.wast:72: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.24.wasm:0000012: error: max pages (4294967295) must be <= (65536)\n  0000012: error: OnMemory callback failed\nout/test/spec/memory64/memory.wast:77: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.25.wat:1:9: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000)\n          ^^^^^^^^^^^^^\nout/test/spec/memory64/memory.wast:81: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.26.wat:1:9: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000 0x1_0000_0000)\n          ^^^^^^^^^^^^^\n  out/test/spec/memory64/memory/memory.26.wat:1:23: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000 0x1_0000_0000)\n                        ^^^^^^^^^^^^^\nout/test/spec/memory64/memory.wast:85: assert_invalid passed:\n  out/test/spec/memory64/memory/memory.27.wat:1:11: error: invalid int \"0x1_0000_0000\"\n  (memory 0 0x1_0000_0000)\n            ^^^^^^^^^^^^^\nout/test/spec/memory64/memory.wast:228: assert_malformed passed:\n  out/test/spec/memory64/memory/memory.29.wat:1:17: error: redefinition of memory \"$foo\"\n  (memory $foo 1)(memory $foo 1)\n                  ^^^^^^\nout/test/spec/memory64/memory.wast:232: assert_malformed passed:\n  out/test/spec/memory64/memory/memory.30.wat:1:32: error: redefinition of memory \"$foo\"\n  (import \"\" \"\" (memory $foo 1))(memory $foo 1)\n                                 ^^^^^^\nout/test/spec/memory64/memory.wast:236: assert_malformed passed:\n  out/test/spec/memory64/memory/memory.31.wat:1:32: error: redefinition of memory \"$foo\"\n  (import \"\" \"\" (memory $foo 1))(import \"\" \"\" (memory $foo 1))\n                                 ^^^^^^\n86/86 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/memory64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/memory64.wast:16: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.7.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory64/memory64.wast:17: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.8.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory64/memory64.wast:18: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.9.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/memory64/memory64.wast:21: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.10.wasm:000001c: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory64/memory64.10.wasm:000001c: error: type mismatch in f32.load, expected [i32] but got [i64]\n  000001c: error: OnLoadExpr callback failed\nout/test/spec/memory64/memory64.wast:25: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.11.wasm:0000021: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory64/memory64.11.wasm:0000021: error: type mismatch in f32.store, expected [i32, f32] but got [i64, f32]\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/memory64/memory64.wast:29: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.12.wasm:000001c: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory64/memory64.12.wasm:000001c: error: type mismatch in i32.load8_s, expected [i32] but got [i64]\n  000001c: error: OnLoadExpr callback failed\nout/test/spec/memory64/memory64.wast:33: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.13.wasm:000001e: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory64/memory64.13.wasm:000001e: error: type mismatch in i32.store8, expected [i32, i32] but got [i64, i32]\n  000001e: error: OnStoreExpr callback failed\nout/test/spec/memory64/memory64.wast:37: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.14.wasm:0000019: error: memory variable out of range: 0 (max 0)\n  0000019: error: OnMemorySizeExpr callback failed\nout/test/spec/memory64/memory64.wast:41: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.15.wasm:000001b: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory64/memory64.15.wasm:000001b: error: type mismatch in memory.grow, expected [i32] but got [i64]\n  000001b: error: OnMemoryGrowExpr callback failed\nout/test/spec/memory64/memory64.wast:47: assert_invalid passed:\n  out/test/spec/memory64/memory64/memory64.16.wasm:000000e: error: max pages (0) must be >= initial pages (1)\n  000000e: error: OnMemory callback failed\n63/63 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/memory_copy.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_copy.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_copy.wast:350: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:711: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:1073: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:1434: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:1796: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:2157: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:2518: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:2879: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:3240: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:3601: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:3962: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:4316: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.19.wasm:000002d: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory_copy/memory_copy.19.wasm:000002d: error: memory variable out of range: 0 (max 0)\n  000002d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4322: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.20.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4329: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.21.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i32, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4336: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.22.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i32, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4343: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.23.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4350: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.24.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4357: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.25.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4364: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.26.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4371: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.27.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4378: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.28.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4385: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.29.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4392: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.30.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4399: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.31.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4406: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.32.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4413: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.33.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4420: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.34.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4427: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.35.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4434: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.36.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4441: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.37.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4448: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.38.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4455: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.39.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f32, i32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4462: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.40.wasm:000003c: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f32, f32]\n  000003c: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4469: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.41.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f32, i64]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4476: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.42.wasm:0000040: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f32, f64]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4483: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.43.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i64, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4490: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.44.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i64, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4497: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.45.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i64, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4504: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.46.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i64, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4511: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.47.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f64, i32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4518: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.48.wasm:0000040: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f64, f32]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4525: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.49.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f64, i64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4532: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.50.wasm:0000044: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f64, f64]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4539: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.51.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4546: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.52.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4553: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.53.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4560: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.54.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4567: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.55.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4574: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.56.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4581: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.57.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4588: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.58.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4595: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.59.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4602: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.60.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4609: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.61.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4616: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.62.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4623: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.63.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4630: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.64.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4637: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.65.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4644: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.66.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4651: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.67.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i32, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4658: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.68.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i32, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4665: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.69.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i32, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4672: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.70.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i32, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4679: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.71.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f32, i32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4686: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.72.wasm:0000040: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f32, f32]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4693: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.73.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f32, i64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4700: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.74.wasm:0000044: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f32, f64]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4707: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.75.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4714: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.76.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4721: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.77.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4728: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.78.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4735: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.79.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f64, i32]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4742: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.80.wasm:0000044: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f64, f32]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4749: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.81.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f64, i64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:4756: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.82.wasm:0000048: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f64, f64]\n  0000048: error: OnMemoryCopyExpr callback failed\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_copy.wast:4819: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:4825: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:4831: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:4837: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_copy.wast:4873: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\nout/test/spec/memory64/memory_copy.wast:4885: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\nout/test/spec/memory64/memory_copy.wast:4897: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_copy.wast:5924: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:6285: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:6647: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:7008: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:7370: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:7731: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:8092: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:8453: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:8814: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:9175: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:9536: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:9890: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.116.wasm:000002d: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory_copy/memory_copy.116.wasm:000002d: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory_copy/memory_copy.116.wasm:000002d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, i64]\n  000002d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9896: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.117.wasm:0000033: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i32, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9903: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.118.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i32, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9910: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.119.wasm:0000033: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i32, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9917: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.120.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i32, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9924: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.121.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, f32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9931: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.122.wasm:0000039: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, f32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9938: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.123.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, f32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9945: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.124.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, f32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9952: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.125.wasm:0000033: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i64, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9959: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.126.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i64, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9966: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.127.wasm:0000033: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i64, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9973: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.128.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, i64, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9980: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.129.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, f64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9987: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.130.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, f64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:9994: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.131.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, f64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10001: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.132.wasm:0000041: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i32, f64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10008: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.133.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, i32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10015: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.134.wasm:0000039: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, i32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10022: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.135.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, i32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10029: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.136.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, i32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10036: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.137.wasm:0000039: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, f32, i32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10043: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.138.wasm:000003c: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, f32, f32]\n  000003c: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10050: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.139.wasm:0000039: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, f32, i64]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10057: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.140.wasm:0000040: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, f32, f64]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10064: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.141.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, i64, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10071: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.142.wasm:0000039: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, i64, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10078: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.143.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, i64, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10085: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.144.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, i64, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10092: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.145.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, f64, i32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10099: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.146.wasm:0000040: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, f64, f32]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10106: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.147.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, f64, i64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10113: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.148.wasm:0000044: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f32, f64, f64]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10120: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.149.wasm:0000033: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i32, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10127: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.150.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i32, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10134: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.151.wasm:0000033: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i32, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10141: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.152.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i32, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10148: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.153.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, f32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10155: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.154.wasm:0000039: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, f32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10162: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.155.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, f32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10169: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.156.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, f32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10176: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.157.wasm:0000033: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i64, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10183: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.158.wasm:0000036: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i64, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10190: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.159.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, i64, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10197: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.160.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, f64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10204: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.161.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, f64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10211: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.162.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, f64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10218: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.163.wasm:0000041: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [i64, f64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10225: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.164.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, i32, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10232: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.165.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, i32, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10239: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.166.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, i32, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10246: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.167.wasm:0000041: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, i32, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10253: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.168.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, f32, i32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10260: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.169.wasm:0000040: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, f32, f32]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10267: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.170.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, f32, i64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10274: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.171.wasm:0000044: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, f32, f64]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10281: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.172.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, i64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10288: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.173.wasm:000003d: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, i64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10295: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.174.wasm:000003a: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, i64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10302: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.175.wasm:0000041: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, i64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10309: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.176.wasm:0000041: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, f64, i32]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10316: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.177.wasm:0000044: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, f64, f32]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10323: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.178.wasm:0000041: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, f64, i64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory64/memory_copy.wast:10330: assert_invalid passed:\n  out/test/spec/memory64/memory_copy/memory_copy.179.wasm:0000048: error: type mismatch in memory.copy, expected [i64, i64, i64] but got [f64, f64, f64]\n  0000048: error: OnMemoryCopyExpr callback failed\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_copy.wast:10393: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:10399: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:10405: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory64/memory_copy.wast:10411: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_copy.wast:10447: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\nout/test/spec/memory64/memory_copy.wast:10459: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\nout/test/spec/memory64/memory_copy.wast:10471: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\n8900/8900 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/memory_fill.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_fill.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\ntest() =>\nout/test/spec/memory64/memory_fill.wast:44: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory64/memory_fill.wast:62: assert_trap passed: out of bounds memory access: memory.fill out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_fill.wast:118: assert_trap passed: out of bounds memory access: memory.fill out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_fill.wast:175: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.8.wasm:000002c: error: memory variable out of range: 0 (max 0)\n  000002c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:181: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.9.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:188: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.10.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i32, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:195: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.11.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i32, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:202: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.12.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:209: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.13.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:216: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.14.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:223: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.15.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:230: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.16.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i64, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:237: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.17.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i64, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:244: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.18.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i64, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:251: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.19.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i64, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:258: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.20.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:265: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.21.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:272: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.22.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:279: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.23.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:286: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.24.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:293: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.25.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:300: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.26.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:307: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.27.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:314: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.28.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f32, i32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:321: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.29.wasm:000003b: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f32, f32]\n  000003b: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:328: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.30.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f32, i64]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:335: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.31.wasm:000003f: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f32, f64]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:342: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.32.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i64, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:349: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.33.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i64, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:356: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.34.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i64, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:363: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.35.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i64, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:370: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.36.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f64, i32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:377: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.37.wasm:000003f: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f64, f32]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:384: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.38.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f64, i64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:391: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.39.wasm:0000043: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f64, f64]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:398: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.40.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:405: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.41.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:412: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.42.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:419: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.43.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:426: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.44.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:433: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.45.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:440: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.46.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:447: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.47.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:454: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.48.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i64, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:461: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.49.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i64, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:468: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.50.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i64, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:475: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.51.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i64, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:482: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.52.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:489: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.53.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:496: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.54.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:503: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.55.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:510: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.56.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i32, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:517: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.57.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i32, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:524: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.58.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i32, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:531: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.59.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i32, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:538: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.60.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f32, i32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:545: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.61.wasm:000003f: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f32, f32]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:552: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.62.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f32, i64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:559: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.63.wasm:0000043: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f32, f64]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:566: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.64.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:573: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.65.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:580: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.66.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:587: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.67.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:594: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.68.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f64, i32]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:601: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.69.wasm:0000043: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f64, f32]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:608: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.70.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f64, i64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:615: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.71.wasm:0000047: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f64, f64]\n  0000047: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:638: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory64/memory_fill.wast:660: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory64/memory_fill.wast:682: assert_trap passed: out of bounds memory access: memory.fill out of bounds\ntest() =>\nout/test/spec/memory64/memory_fill.wast:726: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory64/memory_fill.wast:744: assert_trap passed: out of bounds memory access: memory.fill out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_fill.wast:800: assert_trap passed: out of bounds memory access: memory.fill out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_fill.wast:857: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.83.wasm:000002c: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory64/memory_fill/memory_fill.83.wasm:000002c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, i64]\n  000002c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:863: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.84.wasm:0000032: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, i32, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:870: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.85.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, i32, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:877: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.86.wasm:0000032: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, i32, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:884: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.87.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, i32, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:891: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.88.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, f32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:898: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.89.wasm:0000038: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, f32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:905: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.90.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, f32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:912: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.91.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, f32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:919: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.92.wasm:0000032: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, i64, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:926: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.93.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, i64, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:933: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.94.wasm:0000032: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, i64, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:940: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.95.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, i64, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:947: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.96.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, f64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:954: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.97.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, f64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:961: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.98.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, f64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:968: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.99.wasm:0000040: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i32, f64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:975: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.100.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, i32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:982: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.101.wasm:0000038: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, i32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:989: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.102.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, i32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:996: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.103.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, i32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1003: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.104.wasm:0000038: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, f32, i32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1010: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.105.wasm:000003b: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, f32, f32]\n  000003b: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1017: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.106.wasm:0000038: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, f32, i64]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1024: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.107.wasm:000003f: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, f32, f64]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1031: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.108.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, i64, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1038: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.109.wasm:0000038: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, i64, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1045: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.110.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, i64, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1052: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.111.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, i64, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1059: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.112.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, f64, i32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1066: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.113.wasm:000003f: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, f64, f32]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1073: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.114.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, f64, i64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1080: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.115.wasm:0000043: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f32, f64, f64]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1087: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.116.wasm:0000032: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, i32, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1094: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.117.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, i32, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1101: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.118.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, i32, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1108: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.119.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, f32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1115: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.120.wasm:0000038: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, f32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1122: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.121.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, f32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1129: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.122.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, f32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1136: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.123.wasm:0000032: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, i64, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1143: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.124.wasm:0000035: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, i64, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1150: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.125.wasm:0000032: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, i64, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1157: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.126.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, i64, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1164: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.127.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, f64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1171: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.128.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, f64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1178: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.129.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, f64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1185: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.130.wasm:0000040: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [i64, f64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1192: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.131.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, i32, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1199: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.132.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, i32, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1206: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.133.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, i32, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1213: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.134.wasm:0000040: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, i32, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1220: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.135.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, f32, i32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1227: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.136.wasm:000003f: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, f32, f32]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1234: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.137.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, f32, i64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1241: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.138.wasm:0000043: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, f32, f64]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1248: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.139.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, i64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1255: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.140.wasm:000003c: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, i64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1262: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.141.wasm:0000039: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, i64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1269: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.142.wasm:0000040: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, i64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1276: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.143.wasm:0000040: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, f64, i32]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1283: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.144.wasm:0000043: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, f64, f32]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1290: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.145.wasm:0000040: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, f64, i64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1297: assert_invalid passed:\n  out/test/spec/memory64/memory_fill/memory_fill.146.wasm:0000047: error: type mismatch in memory.fill, expected [i64, i32, i64] but got [f64, f64, f64]\n  0000047: error: OnMemoryFillExpr callback failed\nout/test/spec/memory64/memory_fill.wast:1320: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory64/memory_fill.wast:1342: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory64/memory_fill.wast:1364: assert_trap passed: out of bounds memory access: memory.fill out of bounds\n200/200 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/memory_grow64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_grow64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/memory_grow64.wast:15: assert_trap passed: out of bounds memory access: access at 0+4 >= max value 0\nout/test/spec/memory64/memory_grow64.wast:16: assert_trap passed: out of bounds memory access: access at 0+4 >= max value 0\nout/test/spec/memory64/memory_grow64.wast:17: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 0\nout/test/spec/memory64/memory_grow64.wast:18: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 0\nout/test/spec/memory64/memory_grow64.wast:24: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_grow64.wast:25: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\n49/49 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/memory_init.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_init.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\ntest() =>\ntest() =>\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_init.wast:190: assert_invalid passed:\n  0000023: error: data.drop requires data count section\nout/test/spec/memory64/memory_init.wast:196: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.5.wasm:000002c: error: data_segment variable out of range: 4 (max 1)\n  000002c: error: OnDataDropExpr callback failed\ntest() =>\nout/test/spec/memory64/memory_init.wast:217: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:224: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:227: assert_invalid passed:\n  000002a: error: memory.init requires data count section\nout/test/spec/memory64/memory_init.wast:233: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.10.wasm:0000034: error: data_segment variable out of range: 1 (max 1)\n  0000034: error: OnMemoryInitExpr callback failed\ntest() =>\nout/test/spec/memory64/memory_init.wast:253: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:260: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:267: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:274: assert_trap passed: out of bounds memory access: memory.init out of bounds\ntest() =>\nout/test/spec/memory64/memory_init.wast:288: assert_trap passed: out of bounds memory access: memory.init out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_init.wast:309: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:312: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.21.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:320: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.22.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i32, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:328: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.23.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i32, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:336: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.24.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:344: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.25.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:352: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.26.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:360: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.27.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:368: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.28.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i64, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:376: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.29.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i64, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:384: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.30.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i64, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:392: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.31.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i64, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:400: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.32.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:408: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.33.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:416: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.34.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:424: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.35.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:432: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.36.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:440: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.37.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:448: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.38.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:456: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.39.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:464: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.40.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f32, i32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:472: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.41.wasm:000003c: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f32, f32]\n  000003c: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:480: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.42.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f32, i64]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:488: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.43.wasm:0000040: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f32, f64]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:496: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.44.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i64, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:504: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.45.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i64, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:512: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.46.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i64, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:520: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.47.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i64, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:528: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.48.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f64, i32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:536: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.49.wasm:0000040: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f64, f32]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:544: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.50.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f64, i64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:552: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.51.wasm:0000044: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f64, f64]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:560: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.52.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i32, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:568: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.53.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i32, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:576: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.54.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i32, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:584: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.55.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i32, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:592: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.56.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:600: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.57.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:608: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.58.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:616: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.59.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:624: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.60.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i64, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:632: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.61.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i64, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:640: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.62.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i64, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:648: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.63.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i64, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:656: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.64.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:664: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.65.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:672: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.66.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:680: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.67.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:688: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.68.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i32, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:696: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.69.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i32, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:704: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.70.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i32, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:712: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.71.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i32, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:720: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.72.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f32, i32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:728: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.73.wasm:0000040: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f32, f32]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:736: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.74.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f32, i64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:744: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.75.wasm:0000044: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f32, f64]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:752: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.76.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:760: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.77.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:768: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.78.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:776: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.79.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:784: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.80.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f64, i32]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:792: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.81.wasm:0000044: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f64, f32]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:800: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.82.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f64, i64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:808: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.83.wasm:0000048: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f64, f64]\n  0000048: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:833: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:856: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:879: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:902: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:925: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:948: assert_trap passed: out of bounds memory access: memory.init out of bounds\ntest() =>\ntest() =>\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_init.wast:1153: assert_invalid passed:\n  0000023: error: data.drop requires data count section\nout/test/spec/memory64/memory_init.wast:1159: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.96.wasm:000002c: error: data_segment variable out of range: 4 (max 1)\n  000002c: error: OnDataDropExpr callback failed\ntest() =>\nout/test/spec/memory64/memory_init.wast:1180: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1187: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1190: assert_invalid passed:\n  000002a: error: memory.init requires data count section\nout/test/spec/memory64/memory_init.wast:1196: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.101.wasm:0000034: error: data_segment variable out of range: 1 (max 1)\n  0000034: error: OnMemoryInitExpr callback failed\ntest() =>\nout/test/spec/memory64/memory_init.wast:1216: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1223: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1230: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1237: assert_trap passed: out of bounds memory access: memory.init out of bounds\ntest() =>\nout/test/spec/memory64/memory_init.wast:1251: assert_trap passed: out of bounds memory access: memory.init out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/memory_init.wast:1272: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1275: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.112.wasm:0000033: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, i32, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1283: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.113.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, i32, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1291: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.114.wasm:0000033: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, i32, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1299: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.115.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, i32, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1307: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.116.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, f32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1315: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.117.wasm:0000039: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, f32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1323: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.118.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, f32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1331: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.119.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, f32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1339: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.120.wasm:0000033: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, i64, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1347: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.121.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, i64, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1355: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.122.wasm:0000033: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, i64, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1363: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.123.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, i64, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1371: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.124.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, f64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1379: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.125.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, f64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1387: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.126.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, f64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1395: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.127.wasm:0000041: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i32, f64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1403: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.128.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, i32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1411: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.129.wasm:0000039: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, i32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1419: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.130.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, i32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1427: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.131.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, i32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1435: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.132.wasm:0000039: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, f32, i32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1443: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.133.wasm:000003c: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, f32, f32]\n  000003c: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1451: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.134.wasm:0000039: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, f32, i64]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1459: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.135.wasm:0000040: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, f32, f64]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1467: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.136.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, i64, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1475: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.137.wasm:0000039: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, i64, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1483: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.138.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, i64, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1491: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.139.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, i64, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1499: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.140.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, f64, i32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1507: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.141.wasm:0000040: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, f64, f32]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1515: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.142.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, f64, i64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1523: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.143.wasm:0000044: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f32, f64, f64]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1531: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.144.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, i32, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1539: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.145.wasm:0000033: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, i32, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1547: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.146.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, i32, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1555: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.147.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, f32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1563: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.148.wasm:0000039: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, f32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1571: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.149.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, f32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1579: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.150.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, f32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1587: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.151.wasm:0000033: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, i64, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1595: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.152.wasm:0000036: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, i64, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1603: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.153.wasm:0000033: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, i64, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1611: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.154.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, i64, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1619: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.155.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, f64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1627: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.156.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, f64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1635: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.157.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, f64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1643: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.158.wasm:0000041: error: type mismatch in memory.init, expected [i64, i32, i32] but got [i64, f64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1651: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.159.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, i32, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1659: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.160.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, i32, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1667: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.161.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, i32, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1675: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.162.wasm:0000041: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, i32, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1683: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.163.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, f32, i32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1691: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.164.wasm:0000040: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, f32, f32]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1699: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.165.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, f32, i64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1707: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.166.wasm:0000044: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, f32, f64]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1715: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.167.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, i64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1723: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.168.wasm:000003d: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, i64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1731: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.169.wasm:000003a: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, i64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1739: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.170.wasm:0000041: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, i64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1747: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.171.wasm:0000041: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, f64, i32]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1755: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.172.wasm:0000044: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, f64, f32]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1763: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.173.wasm:0000041: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, f64, i64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1771: assert_invalid passed:\n  out/test/spec/memory64/memory_init/memory_init.174.wasm:0000048: error: type mismatch in memory.init, expected [i64, i32, i32] but got [f64, f64, f64]\n  0000048: error: OnMemoryInitExpr callback failed\nout/test/spec/memory64/memory_init.wast:1796: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1819: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1842: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1865: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1888: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory64/memory_init.wast:1911: assert_trap passed: out of bounds memory access: memory.init out of bounds\n480/480 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/memory_redundancy64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_redundancy64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nzero_everything() =>\nzero_everything() =>\nzero_everything() =>\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/memory_trap64.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_trap64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/memory_trap64.wast:23: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:24: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:25: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:26: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:27: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:28: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:29: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:30: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:31: assert_trap passed: out of bounds memory access: access at 2147549184+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:32: assert_trap passed: out of bounds memory access: access at 2147549184+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:110: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:111: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:112: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:113: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:114: assert_trap passed: out of bounds memory access: access at 18446744073709551615+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:115: assert_trap passed: out of bounds memory access: access at 18446744073709551614+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:116: assert_trap passed: out of bounds memory access: access at 18446744073709551613+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:117: assert_trap passed: out of bounds memory access: access at 18446744073709551612+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:118: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:119: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:120: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:121: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:122: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:123: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:124: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:125: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:126: assert_trap passed: out of bounds memory access: access at 18446744073709551615+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:127: assert_trap passed: out of bounds memory access: access at 18446744073709551614+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:128: assert_trap passed: out of bounds memory access: access at 18446744073709551613+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:129: assert_trap passed: out of bounds memory access: access at 18446744073709551612+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:130: assert_trap passed: out of bounds memory access: access at 18446744073709551611+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:131: assert_trap passed: out of bounds memory access: access at 18446744073709551610+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:132: assert_trap passed: out of bounds memory access: access at 18446744073709551609+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:133: assert_trap passed: out of bounds memory access: access at 18446744073709551608+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:134: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:135: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:136: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:137: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:138: assert_trap passed: out of bounds memory access: access at 18446744073709551615+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:139: assert_trap passed: out of bounds memory access: access at 18446744073709551614+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:140: assert_trap passed: out of bounds memory access: access at 18446744073709551613+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:141: assert_trap passed: out of bounds memory access: access at 18446744073709551612+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:142: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:143: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:144: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:145: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:146: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:147: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:148: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:149: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:150: assert_trap passed: out of bounds memory access: access at 18446744073709551615+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:151: assert_trap passed: out of bounds memory access: access at 18446744073709551614+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:152: assert_trap passed: out of bounds memory access: access at 18446744073709551613+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:153: assert_trap passed: out of bounds memory access: access at 18446744073709551612+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:154: assert_trap passed: out of bounds memory access: access at 18446744073709551611+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:155: assert_trap passed: out of bounds memory access: access at 18446744073709551610+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:156: assert_trap passed: out of bounds memory access: access at 18446744073709551609+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:157: assert_trap passed: out of bounds memory access: access at 18446744073709551608+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:158: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:159: assert_trap passed: out of bounds memory access: access at 18446744073709551615+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:160: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:161: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:162: assert_trap passed: out of bounds memory access: access at 18446744073709551615+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:163: assert_trap passed: out of bounds memory access: access at 18446744073709551614+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:164: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:165: assert_trap passed: out of bounds memory access: access at 18446744073709551615+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:166: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:167: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:168: assert_trap passed: out of bounds memory access: access at 18446744073709551615+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:169: assert_trap passed: out of bounds memory access: access at 18446744073709551614+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:170: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:171: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:172: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:173: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:174: assert_trap passed: out of bounds memory access: access at 18446744073709551615+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:175: assert_trap passed: out of bounds memory access: access at 18446744073709551614+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:176: assert_trap passed: out of bounds memory access: access at 18446744073709551613+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:177: assert_trap passed: out of bounds memory access: access at 18446744073709551612+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:178: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:179: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:180: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:181: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:182: assert_trap passed: out of bounds memory access: access at 18446744073709551615+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:183: assert_trap passed: out of bounds memory access: access at 18446744073709551614+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:184: assert_trap passed: out of bounds memory access: access at 18446744073709551613+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:185: assert_trap passed: out of bounds memory access: access at 18446744073709551612+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:186: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:187: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:188: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:189: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:190: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:191: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:192: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:193: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:194: assert_trap passed: out of bounds memory access: access at 18446744073709551615+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:195: assert_trap passed: out of bounds memory access: access at 18446744073709551614+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:196: assert_trap passed: out of bounds memory access: access at 18446744073709551613+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:197: assert_trap passed: out of bounds memory access: access at 18446744073709551612+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:198: assert_trap passed: out of bounds memory access: access at 18446744073709551611+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:199: assert_trap passed: out of bounds memory access: access at 18446744073709551610+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:200: assert_trap passed: out of bounds memory access: access at 18446744073709551609+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:201: assert_trap passed: out of bounds memory access: access at 18446744073709551608+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:202: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:203: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:204: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:205: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:206: assert_trap passed: out of bounds memory access: access at 18446744073709551615+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:207: assert_trap passed: out of bounds memory access: access at 18446744073709551614+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:208: assert_trap passed: out of bounds memory access: access at 18446744073709551613+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:209: assert_trap passed: out of bounds memory access: access at 18446744073709551612+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:210: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:211: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:212: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:213: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:214: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:215: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:216: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:217: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:218: assert_trap passed: out of bounds memory access: access at 18446744073709551615+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:219: assert_trap passed: out of bounds memory access: access at 18446744073709551614+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:220: assert_trap passed: out of bounds memory access: access at 18446744073709551613+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:221: assert_trap passed: out of bounds memory access: access at 18446744073709551612+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:222: assert_trap passed: out of bounds memory access: access at 18446744073709551611+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:223: assert_trap passed: out of bounds memory access: access at 18446744073709551610+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:224: assert_trap passed: out of bounds memory access: access at 18446744073709551609+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:225: assert_trap passed: out of bounds memory access: access at 18446744073709551608+8 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:226: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:227: assert_trap passed: out of bounds memory access: access at 18446744073709551615+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:228: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:229: assert_trap passed: out of bounds memory access: access at 18446744073709551615+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:230: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:231: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:232: assert_trap passed: out of bounds memory access: access at 18446744073709551615+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:233: assert_trap passed: out of bounds memory access: access at 18446744073709551614+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:234: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:235: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:236: assert_trap passed: out of bounds memory access: access at 18446744073709551615+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:237: assert_trap passed: out of bounds memory access: access at 18446744073709551614+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:238: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:239: assert_trap passed: out of bounds memory access: access at 18446744073709551615+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:240: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:241: assert_trap passed: out of bounds memory access: access at 18446744073709551615+1 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:242: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:243: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:244: assert_trap passed: out of bounds memory access: access at 18446744073709551615+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:245: assert_trap passed: out of bounds memory access: access at 18446744073709551614+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:246: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:247: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:248: assert_trap passed: out of bounds memory access: access at 18446744073709551615+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:249: assert_trap passed: out of bounds memory access: access at 18446744073709551614+2 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:250: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:251: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:252: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:253: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:254: assert_trap passed: out of bounds memory access: access at 18446744073709551615+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:255: assert_trap passed: out of bounds memory access: access at 18446744073709551614+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:256: assert_trap passed: out of bounds memory access: access at 18446744073709551613+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:257: assert_trap passed: out of bounds memory access: access at 18446744073709551612+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:258: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:259: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:260: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:261: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:262: assert_trap passed: out of bounds memory access: access at 18446744073709551615+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:263: assert_trap passed: out of bounds memory access: access at 18446744073709551614+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:264: assert_trap passed: out of bounds memory access: access at 18446744073709551613+4 >= max value 65536\nout/test/spec/memory64/memory_trap64.wast:265: assert_trap passed: out of bounds memory access: access at 18446744073709551612+4 >= max value 65536\n172/172 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/simd_address.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/simd_address.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/simd_address.wast:89: assert_trap passed: out of bounds memory access: access at 4294967296+16 >= max value 65536\nout/test/spec/memory64/simd_address.wast:90: assert_trap passed: out of bounds memory access: access at 65521+16 >= max value 65536\nout/test/spec/memory64/simd_address.wast:99: assert_trap passed: out of bounds memory access: access at 4294967296+16 >= max value 65536\nout/test/spec/memory64/simd_address.wast:100: assert_trap passed: out of bounds memory access: access at 65536+16 >= max value 65536\nout/test/spec/memory64/simd_address.wast:110: assert_trap passed: out of bounds memory access: access at 65521+16 >= max value 65536\nout/test/spec/memory64/simd_address.wast:113: assert_malformed passed:\n  out/test/spec/memory64/simd_address/simd_address.2.wat:1:35: error: unexpected token offset=-1, expected ).\n  (memory 1)(func  (drop (v128.load offset=-1 (i32.const 0))))\n                                    ^^^^^^^^^\n  out/test/spec/memory64/simd_address/simd_address.2.wat:1:60: error: unexpected token ), expected EOF.\n  (memory 1)(func  (drop (v128.load offset=-1 (i32.const 0))))\n                                                             ^\nout/test/spec/memory64/simd_address.wast:128: assert_trap passed: out of bounds memory access: access at 65521+16 >= max value 65536\nout/test/spec/memory64/simd_address.wast:131: assert_malformed passed:\n  out/test/spec/memory64/simd_address/simd_address.4.wat:1:30: error: unexpected token offset=-1, expected ).\n  (memory 1)(func  (v128.store offset=-1 (i32.const 0) (v128.const i32x4 0 0 0 ...\n                               ^^^^^^^^^\n  out/test/spec/memory64/simd_address/simd_address.4.wat:1:81: error: unexpected token ), expected EOF.\n  ...ory 1)(func  (v128.store offset=-1 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                                                                                 ^\nout/test/spec/memory64/simd_address.wast:144: assert_invalid passed:\n  out/test/spec/memory64/simd_address/simd_address.5.wat:1:24: error: offset must be less than or equal to 0xffffffff\n  (memory 1)(func (drop (v128.load offset=4294967296 (i32.const 0))))\n                         ^^^^^^^^^\nout/test/spec/memory64/simd_address.wast:152: assert_invalid passed:\n  out/test/spec/memory64/simd_address/simd_address.6.wat:1:18: error: offset must be less than or equal to 0xffffffff\n  (memory 1)(func (v128.store offset=4294967296 (i32.const 0) (v128.const i32x4...\n                   ^^^^^^^^^^\n49/49 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ARGS*: --enable-memory64\n;; memory64 table.wast from last commit before wasm-3.0 merge\n\n(module (table 0 funcref))\n(module (table 1 funcref))\n(module (table 0 0 funcref))\n(module (table 0 1 funcref))\n(module (table 1 256 funcref))\n(module (table 0 65536 funcref))\n(module (table 0 0xffff_ffff funcref))\n\n(module (table 0 funcref) (table 0 funcref))\n(module (table (import \"spectest\" \"table\") 0 funcref) (table 0 funcref))\n\n(assert_invalid\n  (module (table 1 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n(assert_invalid\n  (module (table 0xffff_ffff 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n\n(assert_invalid\n  (module quote \"(table 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n(assert_invalid\n  (module quote \"(table 0x1_0000_0000 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n(assert_invalid\n  (module quote \"(table 0 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n\n;; Same as above but with i64 index types\n\n(module (table i64 0 funcref))\n(module (table i64 1 funcref))\n(module (table i64 0 0 funcref))\n(module (table i64 0 1 funcref))\n(module (table i64 1 256 funcref))\n(module (table i64 0 65536 funcref))\n(module (table i64 0 0xffff_ffff funcref))\n\n(module (table i64 0 funcref) (table i64 0 funcref))\n(module (table (import \"spectest\" \"table64\") i64 0 funcref) (table i64 0 funcref))\n\n(assert_invalid\n  (module (table i64 1 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n(assert_invalid\n  (module (table i64 0xffff_ffff 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n\n;; Elem segments with no table\n\n(assert_invalid (module (elem (i32.const 0))) \"unknown table\")\n(assert_invalid (module (elem (i32.const 0) $f) (func $f)) \"unknown table\")\n\n;; Duplicate table identifiers\n\n(assert_malformed (module quote\n  \"(table $foo 1 funcref)\"\n  \"(table $foo 1 funcref)\")\n  \"duplicate table\")\n(assert_malformed (module quote\n  \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\"\n  \"(table $foo 1 funcref)\")\n  \"duplicate table\")\n(assert_malformed (module quote\n  \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\"\n  \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\")\n  \"duplicate table\")\n(;; STDOUT ;;;\nout/test/spec/memory64/table.txt:17: assert_invalid passed:\n  out/test/spec/memory64/table/table.9.wasm:000000f: error: max elems (0) must be >= initial elems (1)\n  000000f: error: BeginTable callback failed\nout/test/spec/memory64/table.txt:21: assert_invalid passed:\n  out/test/spec/memory64/table/table.10.wasm:0000013: error: max elems (0) must be >= initial elems (4294967295)\n  0000013: error: BeginTable callback failed\nout/test/spec/memory64/table.txt:26: assert_invalid passed:\n  out/test/spec/memory64/table/table.11.wat:1:8: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 funcref)\n         ^^^^^^^^^^^^^\nout/test/spec/memory64/table.txt:30: assert_invalid passed:\n  out/test/spec/memory64/table/table.12.wat:1:8: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 0x1_0000_0000 funcref)\n         ^^^^^^^^^^^^^\n  out/test/spec/memory64/table/table.12.wat:1:22: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 0x1_0000_0000 funcref)\n                       ^^^^^^^^^^^^^\nout/test/spec/memory64/table.txt:34: assert_invalid passed:\n  out/test/spec/memory64/table/table.13.wat:1:10: error: invalid int \"0x1_0000_0000\"\n  (table 0 0x1_0000_0000 funcref)\n           ^^^^^^^^^^^^^\nout/test/spec/memory64/table.txt:52: assert_invalid passed:\n  out/test/spec/memory64/table/table.23.wasm:000000f: error: max elems (0) must be >= initial elems (1)\n  000000f: error: BeginTable callback failed\nout/test/spec/memory64/table.txt:56: assert_invalid passed:\n  out/test/spec/memory64/table/table.24.wasm:0000013: error: max elems (0) must be >= initial elems (4294967295)\n  0000013: error: BeginTable callback failed\nout/test/spec/memory64/table.txt:62: assert_invalid passed:\n  out/test/spec/memory64/table/table.25.wasm:000000c: error: table variable out of range: 0 (max 0)\n  000000c: error: BeginElemSegment callback failed\nout/test/spec/memory64/table.txt:63: assert_invalid passed:\n  out/test/spec/memory64/table/table.26.wasm:0000016: error: table variable out of range: 0 (max 0)\n  0000016: error: BeginElemSegment callback failed\nout/test/spec/memory64/table.txt:67: assert_malformed passed:\n  out/test/spec/memory64/table/table.27.wat:1:24: error: redefinition of table \"$foo\"\n  (table $foo 1 funcref)(table $foo 1 funcref)\n                         ^^^^^\nout/test/spec/memory64/table.txt:71: assert_malformed passed:\n  out/test/spec/memory64/table/table.28.wat:1:39: error: redefinition of table \"$foo\"\n  (import \"\" \"\" (table $foo 1 funcref))(table $foo 1 funcref)\n                                        ^^^^^\nout/test/spec/memory64/table.txt:75: assert_malformed passed:\n  out/test/spec/memory64/table/table.29.wat:1:39: error: redefinition of table \"$foo\"\n  (import \"\" \"\" (table $foo 1 funcref))(import \"\" \"\" (table $foo 1 funcref))\n                                        ^^^^^^\n30/30 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table_copy.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_copy.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\ntest() =>\nout/test/spec/memory64/table_copy.wast:46: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:47: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:52: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:53: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:54: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:55: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:56: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:57: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:63: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:64: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:65: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:66: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:67: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:68: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:69: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:70: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:71: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:72: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:73: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:74: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:75: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:76: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:77: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:78: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:83: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:84: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:85: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:86: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:92: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:93: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:94: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:95: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:96: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:97: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:98: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:99: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:100: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:101: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:102: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:103: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:104: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:105: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:138: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:139: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:144: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:145: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:146: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:147: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:148: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:149: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:155: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:156: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:157: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:158: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:159: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:160: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:161: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:162: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:163: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:164: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:165: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:166: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:167: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:168: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:169: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:170: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:175: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:176: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:177: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:178: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:184: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:185: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:186: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:187: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:188: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:189: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:190: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:191: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:192: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:193: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:194: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:195: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:196: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:197: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:230: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:231: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:236: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:237: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:238: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:239: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:240: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:241: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:247: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:248: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:249: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:250: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:251: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:252: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:253: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:254: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:257: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:258: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:259: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:260: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:261: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:262: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:267: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:268: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:269: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:270: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:276: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:277: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:278: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:279: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:280: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:281: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:282: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:283: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:284: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:285: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:286: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:287: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:288: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:289: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:322: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:323: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:328: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:329: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:330: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:331: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:332: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:333: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:335: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:336: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:337: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:339: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:340: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:341: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:342: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:343: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:344: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:345: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:346: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:347: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:348: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:349: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:350: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:351: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:352: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:353: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:354: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:359: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:360: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:361: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:362: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:368: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:369: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:370: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:371: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:372: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:373: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:374: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:375: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:376: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:377: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:378: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:379: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:380: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:381: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:414: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:415: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:420: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:421: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:422: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:423: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:424: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:425: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:431: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:432: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:433: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:434: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:435: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:436: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:437: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:438: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:439: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:440: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:441: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:442: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:443: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:444: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:445: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:446: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:451: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:452: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:453: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:454: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:460: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:461: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:462: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:463: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:464: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:465: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:466: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:467: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:468: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:469: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:470: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:471: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:472: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:473: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:506: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:507: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:512: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:513: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:514: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:515: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:516: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:517: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:523: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:524: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:525: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:526: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:527: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:528: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:529: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:530: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:531: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:534: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:535: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:536: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:537: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:538: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:543: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:544: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:545: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:546: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:552: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:553: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:554: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:555: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:556: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:557: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:558: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:559: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:560: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:561: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:562: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:563: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:564: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:565: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:598: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:599: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:604: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:605: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:606: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:607: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:613: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:614: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:615: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:616: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:617: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:618: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:619: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:620: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:621: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:622: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:623: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:624: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:625: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:626: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:627: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:628: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:629: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:630: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:635: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:636: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:637: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:638: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:644: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:645: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:646: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:647: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:648: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:649: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:650: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:651: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:652: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:653: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:654: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:655: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:656: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:657: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:690: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:691: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:696: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:697: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:698: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:699: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:700: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:701: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:702: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:703: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:709: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:710: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:711: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:712: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:713: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:714: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:715: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:716: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:717: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:718: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:719: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:720: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:721: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:722: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:727: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:728: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:729: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:730: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:736: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:737: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:738: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:739: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:740: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:741: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:742: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:743: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:744: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:745: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:746: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:747: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:748: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:749: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:782: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:783: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:788: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:789: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:790: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:791: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:792: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:793: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:799: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:800: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:801: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:802: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:803: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:804: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:805: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:806: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:807: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:808: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:809: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:810: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:811: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:812: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:813: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:814: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:819: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:820: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:821: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:822: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:823: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:828: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:829: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:830: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:831: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:832: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:833: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:839: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:840: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:841: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:874: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:875: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:880: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:881: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:882: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:883: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:884: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:885: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:891: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:892: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:893: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:894: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:895: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:896: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:897: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:898: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:899: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:900: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:901: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:902: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:903: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:904: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:905: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:906: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:911: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:912: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:913: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:914: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:920: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:921: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:922: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:923: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:924: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:925: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:926: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:927: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:928: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:929: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:930: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:931: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:932: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:933: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:966: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:967: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:972: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:973: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:974: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:975: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:976: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:977: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:983: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:984: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:985: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:986: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:987: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:988: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:989: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:990: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:991: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:992: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:993: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:994: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:995: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:996: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:997: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:998: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1003: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1004: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1005: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1006: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1012: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1013: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1014: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1015: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1016: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1017: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1018: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1019: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1020: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1021: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1022: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1023: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1024: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1025: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:1058: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1059: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1064: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1065: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1066: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1067: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1068: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1069: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1075: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1076: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1077: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1078: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1079: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1080: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1081: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1082: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1085: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1086: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1087: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1088: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1089: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1090: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1095: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1096: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1097: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1098: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1104: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1105: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1106: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1107: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1108: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1109: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1110: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1111: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1112: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1113: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1114: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1115: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1116: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1117: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:1150: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1151: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1156: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1157: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1158: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1159: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1160: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1161: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1163: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1164: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1165: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1167: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1168: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1169: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1170: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1171: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1172: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1173: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1174: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1175: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1176: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1177: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1178: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1179: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1180: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1181: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1182: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1187: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1188: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1189: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1190: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1196: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1197: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1198: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1199: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1200: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1201: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1202: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1203: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1204: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1205: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1206: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1207: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1208: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1209: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:1242: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1243: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1248: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1249: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1250: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1251: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1252: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1253: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1259: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1260: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1261: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1262: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1263: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1264: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1265: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1266: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1267: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1268: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1269: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1270: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1271: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1272: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1273: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1274: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1279: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1280: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1281: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1282: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1288: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1289: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1290: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1291: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1292: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1293: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1294: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1295: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1296: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1297: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1298: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1299: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1300: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1301: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:1334: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1335: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1340: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1341: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1342: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1343: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1344: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1345: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1351: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1352: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1353: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1354: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1355: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1356: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1357: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1358: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1359: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1362: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1363: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1364: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1365: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1366: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1371: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1372: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1373: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1374: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1380: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1381: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1382: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1383: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1384: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1385: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1386: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1387: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1388: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1389: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1390: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1391: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1392: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1393: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:1426: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1427: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1432: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1433: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1434: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1435: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1441: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1442: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1443: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1444: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1445: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1446: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1447: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1448: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1449: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1450: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1451: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1452: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1453: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1454: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1455: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1456: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1457: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1458: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1463: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1464: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1465: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1466: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1472: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1473: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1474: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1475: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1476: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1477: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1478: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1479: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1480: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1481: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1482: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1483: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1484: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1485: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:1518: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1519: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1524: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1525: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1526: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1527: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1528: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1529: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1530: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1531: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1537: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1538: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1539: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1540: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1541: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1542: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1543: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1544: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1545: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1546: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1547: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1548: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1549: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1550: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1555: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1556: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1557: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1558: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1564: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1565: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1566: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1567: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1568: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1569: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1570: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1571: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1572: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1573: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1574: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1575: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1576: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1577: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_copy.wast:1610: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1611: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1616: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1617: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1618: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1619: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1620: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1621: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1627: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1628: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1629: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1630: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1631: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1632: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1633: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1634: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1635: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1636: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1637: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1638: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1639: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1640: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1641: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1642: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1647: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1648: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1649: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1650: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1651: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1656: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1657: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1658: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1659: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1660: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1661: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1667: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1668: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1669: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:1694: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:1719: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:1744: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:1769: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/table_copy.wast:1844: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/memory64/table_copy.wast:1894: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/memory64/table_copy.wast:1944: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:1969: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:1994: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2019: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2044: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/table_copy.wast:2119: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/memory64/table_copy.wast:2169: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/memory64/table_copy.wast:2219: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2244: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2269: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2294: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2319: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/table_copy.wast:2394: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/memory64/table_copy.wast:2444: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/memory64/table_copy.wast:2494: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2519: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2544: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2569: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2594: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/table_copy.wast:2669: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/memory64/table_copy.wast:2719: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/memory64/table_copy.wast:2769: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2797: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2807: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2808: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2809: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2810: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2811: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2812: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2813: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2814: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2815: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2816: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2817: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2818: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2819: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2820: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2821: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2822: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2823: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2824: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2825: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2826: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2827: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2828: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2829: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2830: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2858: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2869: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2870: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2871: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2872: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2873: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2874: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2875: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2876: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2877: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2878: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2879: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2880: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2881: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2882: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2883: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2884: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2885: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2886: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2887: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2888: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2889: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2890: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2891: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2919: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2921: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2922: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2923: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2924: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2925: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2926: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2927: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2928: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2929: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2930: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2931: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2932: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2933: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2934: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2935: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2936: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2937: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2938: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2939: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2940: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2941: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2942: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2943: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2944: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2980: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:2982: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2983: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2984: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2985: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2986: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2987: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2988: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2989: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2990: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2991: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2992: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2993: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2994: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2995: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2996: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2997: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2998: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:2999: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3000: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3001: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3002: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3003: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3004: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3041: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:3043: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3044: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3045: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3046: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3047: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3048: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3049: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3050: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3051: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3052: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3053: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3062: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3063: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3064: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3065: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3066: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3067: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3068: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3069: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3070: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3071: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3072: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3073: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3074: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3102: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:3104: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3105: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3106: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3107: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3108: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3109: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3110: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3111: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3112: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3113: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3114: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3115: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3116: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3117: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3118: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3119: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3120: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3121: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3122: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3123: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3124: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3125: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3126: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3127: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3163: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:3165: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3166: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3167: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3168: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3169: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3170: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3171: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3172: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3173: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3174: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3175: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3176: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3177: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3178: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3179: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3180: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3181: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3182: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3183: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3184: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3185: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3194: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3195: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3196: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3224: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:3226: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3227: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3228: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3229: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3230: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3231: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3232: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3233: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3234: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3235: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3236: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3237: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3238: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3239: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3240: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3241: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3242: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3243: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3244: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3245: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3246: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3247: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3248: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3249: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3285: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:3287: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3288: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3289: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3290: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3291: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3292: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3293: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3294: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3295: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3296: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3297: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3298: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3299: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3300: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3301: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3302: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3303: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3304: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3305: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3306: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3307: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3346: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:3348: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3349: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3350: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3351: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3352: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3353: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3354: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3355: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3356: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3357: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3358: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3359: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3360: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3361: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3362: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3363: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3364: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3365: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3366: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3367: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3368: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3369: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3370: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3371: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3372: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3373: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3374: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3375: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3376: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3377: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3378: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3379: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3380: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3381: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3382: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3383: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3384: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3385: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3386: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3387: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3388: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3389: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3390: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3391: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3392: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3393: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3394: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3395: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3396: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3397: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3398: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3399: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3400: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3401: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3402: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3403: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3404: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3405: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3406: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3407: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3408: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3409: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3410: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3411: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3412: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3413: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3414: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3415: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3416: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3417: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3418: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3419: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3420: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3421: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3422: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3423: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3424: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3425: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3426: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3427: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3428: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3429: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3430: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3431: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3432: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3433: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3434: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3435: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3436: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3437: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3438: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3439: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3440: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3441: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3442: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3443: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3444: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3445: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3446: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3447: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3448: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3449: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3450: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3451: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3452: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3453: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3454: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3455: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3456: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3457: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3458: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3459: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3503: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/memory64/table_copy.wast:3521: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3522: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3523: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3524: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3525: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3526: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3527: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3528: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3529: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3530: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3531: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3532: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3533: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3534: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3535: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3536: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3537: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3538: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3539: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3540: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3541: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3542: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3543: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3544: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3545: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3546: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3547: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3548: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3549: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3550: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3551: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3552: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3553: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3554: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3555: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3556: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3557: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3558: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3559: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3560: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3561: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3562: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3563: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3564: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3565: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3566: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3567: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3568: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3569: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3570: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3571: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3572: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3573: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3574: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3575: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3576: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3577: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3578: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3579: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3580: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3581: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3582: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3583: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3584: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3585: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3586: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3587: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3588: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3589: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3590: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3591: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3592: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3593: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3594: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3595: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3596: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3597: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3598: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3599: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3600: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3601: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3602: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3603: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3604: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3605: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3606: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3607: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3608: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3609: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3610: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3611: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3612: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3613: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3614: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3615: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3616: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3617: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3618: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3619: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3620: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3621: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3622: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3623: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3624: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3625: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3626: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3627: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3628: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3629: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3630: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3631: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_copy.wast:3632: assert_trap passed: uninitialized table element\n1771/1771 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table_copy_mixed.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_copy_mixed.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/table_copy_mixed.wast:20: assert_invalid passed:\n  out/test/spec/memory64/table_copy_mixed/table_copy_mixed.1.wasm:000003e: error: type mismatch in table.copy, expected [i32, i64, i32] but got [i32, i64, i64]\n  000003e: error: OnTableCopyExpr callback failed\nout/test/spec/memory64/table_copy_mixed.wast:30: assert_invalid passed:\n  out/test/spec/memory64/table_copy_mixed/table_copy_mixed.2.wasm:000003d: error: type mismatch in table.copy, expected [i32, i64, i32] but got [i32, i32, i32]\n  000003d: error: OnTableCopyExpr callback failed\nout/test/spec/memory64/table_copy_mixed.wast:40: assert_invalid passed:\n  out/test/spec/memory64/table_copy_mixed/table_copy_mixed.3.wasm:000003d: error: type mismatch in table.copy, expected [i32, i64, i32] but got [i64, i64, i32]\n  000003d: error: OnTableCopyExpr callback failed\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table_fill.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_fill.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/table_fill.wast:64: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/memory64/table_fill.wast:72: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/memory64/table_fill.wast:77: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/memory64/table_fill.wast:120: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/memory64/table_fill.wast:128: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/memory64/table_fill.wast:133: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/memory64/table_fill.wast:140: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.1.wasm:0000020: error: type mismatch in table.fill, expected [i32, externref, i32] but got []\n  0000020: error: OnTableFillExpr callback failed\nout/test/spec/memory64/table_fill.wast:149: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.2.wasm:0000024: error: type mismatch in table.fill, expected [i32, externref, i32] but got [externref, i32]\n  0000024: error: OnTableFillExpr callback failed\nout/test/spec/memory64/table_fill.wast:158: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.3.wasm:0000024: error: type mismatch in table.fill, expected [i32, externref, i32] but got [i32, i32]\n  0000024: error: OnTableFillExpr callback failed\nout/test/spec/memory64/table_fill.wast:167: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.4.wasm:0000024: error: type mismatch in table.fill, expected [i32, externref, i32] but got [i32, externref]\n  0000024: error: OnTableFillExpr callback failed\nout/test/spec/memory64/table_fill.wast:176: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.5.wasm:0000029: error: type mismatch in table.fill, expected [i32, externref, i32] but got [f32, externref, i32]\n  0000029: error: OnTableFillExpr callback failed\nout/test/spec/memory64/table_fill.wast:185: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.6.wasm:0000027: error: type mismatch in table.fill, expected [i32, funcref, i32] but got [i32, externref, i32]\n  0000027: error: OnTableFillExpr callback failed\nout/test/spec/memory64/table_fill.wast:194: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.7.wasm:0000029: error: type mismatch in table.fill, expected [i32, externref, i32] but got [i32, externref, f32]\n  0000029: error: OnTableFillExpr callback failed\nout/test/spec/memory64/table_fill.wast:204: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.8.wasm:000002a: error: type mismatch in table.fill, expected [i32, funcref, i32] but got [i32, externref, i32]\n  000002a: error: OnTableFillExpr callback failed\nout/test/spec/memory64/table_fill.wast:215: assert_invalid passed:\n  out/test/spec/memory64/table_fill/table_fill.9.wasm:0000028: error: type mismatch in implicit return, expected [i32] but got []\n  0000028: error: EndFunctionBody callback failed\n80/80 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table_get.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_get.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\ninit(externref:2) =>\nout/test/spec/memory64/table_get.wast:38: assert_trap passed: out of bounds table access: table.get at 2 >= max value 2\nout/test/spec/memory64/table_get.wast:39: assert_trap passed: out of bounds table access: table.get at 3 >= max value 3\nout/test/spec/memory64/table_get.wast:40: assert_trap passed: out of bounds table access: table.get at 4294967295 >= max value 2\nout/test/spec/memory64/table_get.wast:41: assert_trap passed: out of bounds table access: table.get at 4294967295 >= max value 3\nout/test/spec/memory64/table_get.wast:47: assert_invalid passed:\n  out/test/spec/memory64/table_get/table_get.1.wasm:0000020: error: type mismatch in table.get, expected [i32] but got []\n  0000020: error: OnTableGetExpr callback failed\nout/test/spec/memory64/table_get.wast:56: assert_invalid passed:\n  out/test/spec/memory64/table_get/table_get.2.wasm:0000025: error: type mismatch in table.get, expected [i32] but got [f32]\n  0000025: error: OnTableGetExpr callback failed\nout/test/spec/memory64/table_get.wast:66: assert_invalid passed:\n  out/test/spec/memory64/table_get/table_get.3.wasm:0000022: error: type mismatch at end of function, expected [] but got [externref]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/memory64/table_get.wast:75: assert_invalid passed:\n  out/test/spec/memory64/table_get/table_get.4.wasm:0000023: error: type mismatch in implicit return, expected [funcref] but got [externref]\n  0000023: error: EndFunctionBody callback failed\nout/test/spec/memory64/table_get.wast:85: assert_invalid passed:\n  out/test/spec/memory64/table_get/table_get.5.wasm:0000026: error: type mismatch in implicit return, expected [funcref] but got [externref]\n  0000026: error: EndFunctionBody callback failed\n17/17 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table_grow.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_grow.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/table_grow.wast:26: assert_trap passed: out of bounds table access: table.set at 0 >= max value 0\nout/test/spec/memory64/table_grow.wast:27: assert_trap passed: out of bounds table access: table.get at 0 >= max value 0\nout/test/spec/memory64/table_grow.wast:34: assert_trap passed: out of bounds table access: table.set at 1 >= max value 1\nout/test/spec/memory64/table_grow.wast:35: assert_trap passed: out of bounds table access: table.get at 1 >= max value 1\nout/test/spec/memory64/table_grow.wast:46: assert_trap passed: out of bounds table access: table.set at 5 >= max value 5\nout/test/spec/memory64/table_grow.wast:47: assert_trap passed: out of bounds table access: table.get at 5 >= max value 5\nout/test/spec/memory64/table_grow.wast:51: assert_trap passed: out of bounds table access: table.set at 0 >= max value 0\nout/test/spec/memory64/table_grow.wast:52: assert_trap passed: out of bounds table access: table.get at 0 >= max value 0\nout/test/spec/memory64/table_grow.wast:59: assert_trap passed: out of bounds table access: table.set at 1 >= max value 1\nout/test/spec/memory64/table_grow.wast:60: assert_trap passed: out of bounds table access: table.get at 1 >= max value 1\nout/test/spec/memory64/table_grow.wast:71: assert_trap passed: out of bounds table access: table.set at 5 >= max value 5\nout/test/spec/memory64/table_grow.wast:72: assert_trap passed: out of bounds table access: table.get at 5 >= max value 5\nout/test/spec/memory64/table_grow.wast:168: assert_invalid passed:\n  out/test/spec/memory64/table_grow/table_grow.8.wasm:0000021: error: type mismatch in table.grow, expected [externref, i32] but got []\n  0000021: error: OnTableGrowExpr callback failed\nout/test/spec/memory64/table_grow.wast:177: assert_invalid passed:\n  out/test/spec/memory64/table_grow/table_grow.9.wasm:0000023: error: type mismatch in table.grow, expected [externref, i32] but got [externref]\n  0000023: error: OnTableGrowExpr callback failed\nout/test/spec/memory64/table_grow.wast:186: assert_invalid passed:\n  out/test/spec/memory64/table_grow/table_grow.10.wasm:0000023: error: type mismatch in table.grow, expected [externref, i32] but got [i32]\n  0000023: error: OnTableGrowExpr callback failed\nout/test/spec/memory64/table_grow.wast:195: assert_invalid passed:\n  out/test/spec/memory64/table_grow/table_grow.11.wasm:0000028: error: type mismatch in table.grow, expected [externref, i32] but got [externref, f32]\n  0000028: error: OnTableGrowExpr callback failed\nout/test/spec/memory64/table_grow.wast:204: assert_invalid passed:\n  out/test/spec/memory64/table_grow/table_grow.12.wasm:0000026: error: type mismatch in table.grow, expected [funcref, i32] but got [externref, i32]\n  0000026: error: OnTableGrowExpr callback failed\nout/test/spec/memory64/table_grow.wast:214: assert_invalid passed:\n  out/test/spec/memory64/table_grow/table_grow.13.wasm:0000025: error: type mismatch at end of function, expected [] but got [i32]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/memory64/table_grow.wast:223: assert_invalid passed:\n  out/test/spec/memory64/table_grow/table_grow.14.wasm:0000026: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000026: error: EndFunctionBody callback failed\n77/77 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table_init.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_init.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\ntest() =>\nout/test/spec/memory64/table_init.wast:43: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:44: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:49: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:54: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:60: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:61: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:62: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:63: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:64: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:65: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:66: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:67: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:68: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:69: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:70: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:71: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:72: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_init.wast:102: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:103: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:108: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:109: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:110: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:111: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:112: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:113: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:120: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:121: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:122: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:123: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:124: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:125: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:126: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:127: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:128: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:129: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:130: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:131: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_init.wast:169: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:170: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:175: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:180: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:182: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:187: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:189: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:191: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:194: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:195: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:196: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:197: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:198: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_init.wast:228: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:229: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:234: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:239: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:245: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:246: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:247: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:248: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:249: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:250: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:251: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:252: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:253: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:254: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:255: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:256: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:257: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_init.wast:287: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:288: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:293: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:294: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:295: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:296: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:297: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:298: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:305: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:306: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:307: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:308: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:309: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:310: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:311: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:312: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:313: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:314: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:315: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:316: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_init.wast:354: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:355: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:360: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:365: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:367: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:372: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:374: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:376: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:379: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:380: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:381: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:382: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:383: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_init.wast:413: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:414: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:419: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:424: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:430: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:431: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:432: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:433: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:434: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:435: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:436: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:437: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:438: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:439: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:440: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:441: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:442: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_init.wast:472: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:473: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:478: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:479: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:480: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:481: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:482: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:483: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:490: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:491: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:492: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:493: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:494: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:495: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:496: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:497: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:498: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:499: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:500: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:501: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/memory64/table_init.wast:539: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:540: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:545: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:550: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:552: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:557: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:559: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:561: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:564: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:565: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:566: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:567: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:568: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:570: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.10.wasm:0000024: error: elem_segment variable out of range: 0 (max 0)\n  0000024: error: OnElemDropExpr callback failed\nout/test/spec/memory64/table_init.wast:576: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.11.wasm:000002b: error: table variable out of range: 0 (max 0)\n  out/test/spec/memory64/table_init/table_init.11.wasm:000002b: error: elem_segment variable out of range: 0 (max 0)\n  000002b: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:582: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.12.wasm:0000035: error: elem_segment variable out of range: 4 (max 1)\n  0000035: error: OnElemDropExpr callback failed\nout/test/spec/memory64/table_init.wast:590: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.13.wasm:000003c: error: table variable out of range: 0 (max 0)\n  out/test/spec/memory64/table_init/table_init.13.wasm:000003c: error: elem_segment variable out of range: 4 (max 1)\n  000003c: error: OnTableInitExpr callback failed\ntest() =>\nout/test/spec/memory64/table_init.wast:644: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory64/table_init.wast:716: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:740: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:764: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:788: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/memory64/table_init.wast:836: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/memory64/table_init.wast:884: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/memory64/table_init.wast:932: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:956: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/memory64/table_init.wast:1004: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/memory64/table_init.wast:1052: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/memory64/table_init.wast:1100: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:1103: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.35.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1112: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.36.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i32, i64]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1121: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.37.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i32, f64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1130: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.38.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f32, i32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1139: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.39.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f32, f32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1148: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.40.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f32, i64]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1157: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.41.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f32, f64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1166: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.42.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i64, i32]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1175: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.43.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i64, f32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1184: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.44.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i64, i64]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1193: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.45.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i64, f64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1202: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.46.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f64, i32]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1211: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.47.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f64, f32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1220: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.48.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f64, i64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1229: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.49.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f64, f64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1238: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.50.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i32, i32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1247: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.51.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i32, f32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1256: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.52.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i32, i64]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1265: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.53.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i32, f64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1274: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.54.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f32, i32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1283: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.55.wasm:0000047: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f32, f32]\n  0000047: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1292: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.56.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f32, i64]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1301: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.57.wasm:000004b: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f32, f64]\n  000004b: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1310: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.58.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i64, i32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1319: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.59.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i64, f32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1328: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.60.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i64, i64]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1337: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.61.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i64, f64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1346: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.62.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f64, i32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1355: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.63.wasm:000004b: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f64, f32]\n  000004b: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1364: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.64.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f64, i64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1373: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.65.wasm:000004f: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f64, f64]\n  000004f: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1382: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.66.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i32, i32]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1391: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.67.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i32, f32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1400: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.68.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i32, i64]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1409: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.69.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i32, f64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1418: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.70.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f32, i32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1427: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.71.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f32, f32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1436: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.72.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f32, i64]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1445: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.73.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f32, f64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1454: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.74.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i64, i32]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1463: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.75.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i64, f32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1472: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.76.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i64, i64]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1481: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.77.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i64, f64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1490: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.78.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f64, i32]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1499: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.79.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f64, f32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1508: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.80.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f64, i64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1517: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.81.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f64, f64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1526: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.82.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i32, i32]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1535: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.83.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i32, f32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1544: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.84.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i32, i64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1553: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.85.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i32, f64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1562: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.86.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f32, i32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1571: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.87.wasm:000004b: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f32, f32]\n  000004b: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1580: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.88.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f32, i64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1589: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.89.wasm:000004f: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f32, f64]\n  000004f: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1598: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.90.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i64, i32]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1607: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.91.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i64, f32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1616: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.92.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i64, i64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1625: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.93.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i64, f64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1634: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.94.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f64, i32]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1643: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.95.wasm:000004f: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f64, f32]\n  000004f: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1652: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.96.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f64, i64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1661: assert_invalid passed:\n  out/test/spec/memory64/table_init/table_init.97.wasm:0000053: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f64, f64]\n  0000053: error: OnTableInitExpr callback failed\nout/test/spec/memory64/table_init.wast:1697: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:1698: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1699: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1700: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1701: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1702: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1703: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1704: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1705: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1706: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1707: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1708: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1709: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1710: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1711: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1712: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1713: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1714: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1715: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1716: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1717: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1718: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1719: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1720: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1721: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1722: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1723: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1724: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1725: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1726: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1727: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1728: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1729: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1759: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:1760: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1761: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1762: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1763: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1764: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1765: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1766: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1767: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1768: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1769: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1770: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1771: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1772: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1773: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1774: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1775: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1776: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1777: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1778: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1779: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1780: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1781: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1782: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1783: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1784: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1785: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1786: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1787: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1788: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1789: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1790: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1791: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1821: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:1822: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1823: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1824: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1825: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1826: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1827: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1828: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1829: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1830: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1831: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1832: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1833: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1834: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1835: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1836: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1837: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1838: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1839: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1840: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1841: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1842: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1843: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1844: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1845: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1846: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1847: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1848: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1849: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1850: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1851: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1852: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1853: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1854: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1855: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1856: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1857: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1858: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1859: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1860: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1861: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1862: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1863: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1864: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1865: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1866: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1867: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1868: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1869: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1870: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1871: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1872: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1873: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1874: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1875: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1876: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1877: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1878: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1879: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1880: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1881: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1882: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1883: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1884: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1885: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1886: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1887: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1888: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1889: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1890: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1891: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1892: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1893: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1894: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1895: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1896: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1897: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1898: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1899: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1900: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1901: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1902: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1903: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1904: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1905: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1906: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1907: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1908: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1909: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1910: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1911: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1912: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1913: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1914: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1915: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1916: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1917: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1918: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1919: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1920: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1921: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1922: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1923: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1924: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1925: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1926: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1927: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1928: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1929: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1930: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1931: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1932: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1933: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1934: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1935: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1936: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1937: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1938: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1939: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1940: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1941: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1942: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1943: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1944: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1945: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1946: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1947: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1948: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1949: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1950: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1951: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1952: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1953: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1954: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1955: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1956: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1957: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1958: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1959: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1960: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1961: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1962: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1963: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1964: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1965: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1966: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1967: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1968: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1969: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1970: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1971: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1972: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1973: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1974: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1975: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1976: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1977: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1978: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1979: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1980: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:1981: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2011: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:2012: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2013: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2014: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2015: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2016: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2017: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2018: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2019: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2020: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2021: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2022: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2023: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2024: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2025: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2026: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2027: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2028: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2029: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2030: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2031: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2032: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2033: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2034: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2035: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2036: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2037: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2038: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2039: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2040: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2041: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2042: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2043: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2044: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2045: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2046: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2047: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2048: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2049: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2050: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2051: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2052: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2053: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2054: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2055: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2056: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2057: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2058: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2059: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2060: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2061: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2062: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2063: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2064: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2065: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2066: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2067: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2068: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2069: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2070: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2071: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2072: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2073: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2074: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2075: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2076: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2077: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2078: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2079: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2080: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2081: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2082: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2083: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2084: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2085: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2086: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2087: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2088: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2089: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2090: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2091: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2092: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2093: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2094: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2095: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2096: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2097: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2098: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2099: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2100: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2101: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2102: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2103: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2104: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2105: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2106: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2107: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2108: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2109: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2110: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2111: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2112: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2113: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2114: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2115: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2116: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2117: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2118: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2119: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2120: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2121: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2122: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2123: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2124: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2125: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2126: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2127: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2128: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2129: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2130: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2131: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2132: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2133: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2134: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2135: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2136: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2137: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2138: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2139: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2140: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2141: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2142: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2143: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2144: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2145: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2146: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2147: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2148: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2149: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2150: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2151: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2152: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2153: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2154: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2155: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2156: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2157: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2158: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2159: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2160: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2161: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2162: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2163: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2164: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2165: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2166: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2167: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2168: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2169: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2170: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2171: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2201: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:2202: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2203: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2204: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2205: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2206: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2207: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2208: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2209: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2210: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2211: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2212: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2213: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2214: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2215: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2216: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2217: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2218: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2219: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2220: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2221: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2222: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2223: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2224: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2225: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2226: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2227: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2228: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2229: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2230: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2231: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2232: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2233: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2234: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2235: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2236: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2237: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2238: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2239: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2240: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2241: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2242: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2243: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2244: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2245: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2246: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2247: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2248: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2249: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2250: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2251: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2252: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2253: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2254: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2255: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2256: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2257: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2258: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2259: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2260: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2261: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2262: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2263: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2264: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2265: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2295: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/memory64/table_init.wast:2296: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2297: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2298: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2299: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2300: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2301: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2302: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2303: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2304: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2305: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2306: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2307: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2308: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2309: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2310: assert_trap passed: uninitialized table element\nout/test/spec/memory64/table_init.wast:2311: assert_trap passed: uninitialized table element\n875/875 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table_set.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_set.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/table_set.wast:51: assert_trap passed: out of bounds table access: table.set at 2 >= max value 1\nout/test/spec/memory64/table_set.wast:52: assert_trap passed: out of bounds table access: table.set at 3 >= max value 2\nout/test/spec/memory64/table_set.wast:53: assert_trap passed: out of bounds table access: table.set at 4294967295 >= max value 1\nout/test/spec/memory64/table_set.wast:54: assert_trap passed: out of bounds table access: table.set at 4294967295 >= max value 2\nout/test/spec/memory64/table_set.wast:56: assert_trap passed: out of bounds table access: table.set at 2 >= max value 1\nout/test/spec/memory64/table_set.wast:57: assert_trap passed: out of bounds table access: table.set at 3 >= max value 2\nout/test/spec/memory64/table_set.wast:58: assert_trap passed: out of bounds table access: table.set at 4294967295 >= max value 1\nout/test/spec/memory64/table_set.wast:59: assert_trap passed: out of bounds table access: table.set at 4294967295 >= max value 2\nout/test/spec/memory64/table_set.wast:65: assert_invalid passed:\n  out/test/spec/memory64/table_set/table_set.1.wasm:000001f: error: type mismatch in table.set, expected [i32, externref] but got []\n  000001f: error: OnTableSetExpr callback failed\nout/test/spec/memory64/table_set.wast:74: assert_invalid passed:\n  out/test/spec/memory64/table_set/table_set.2.wasm:0000021: error: type mismatch in table.set, expected [i32, externref] but got [externref]\n  0000021: error: OnTableSetExpr callback failed\nout/test/spec/memory64/table_set.wast:83: assert_invalid passed:\n  out/test/spec/memory64/table_set/table_set.3.wasm:0000021: error: type mismatch in table.set, expected [i32, externref] but got [i32]\n  0000021: error: OnTableSetExpr callback failed\nout/test/spec/memory64/table_set.wast:92: assert_invalid passed:\n  out/test/spec/memory64/table_set/table_set.4.wasm:0000026: error: type mismatch in table.set, expected [i32, externref] but got [f32, externref]\n  0000026: error: OnTableSetExpr callback failed\nout/test/spec/memory64/table_set.wast:101: assert_invalid passed:\n  out/test/spec/memory64/table_set/table_set.5.wasm:0000024: error: type mismatch in table.set, expected [i32, funcref] but got [i32, externref]\n  0000024: error: OnTableSetExpr callback failed\nout/test/spec/memory64/table_set.wast:111: assert_invalid passed:\n  out/test/spec/memory64/table_set/table_set.6.wasm:0000027: error: type mismatch in table.set, expected [i32, funcref] but got [i32, externref]\n  0000027: error: OnTableSetExpr callback failed\nout/test/spec/memory64/table_set.wast:122: assert_invalid passed:\n  out/test/spec/memory64/table_set/table_set.7.wasm:0000025: error: type mismatch in implicit return, expected [i32] but got []\n  0000025: error: EndFunctionBody callback failed\n28/28 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory64/table_size.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_size.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\nout/test/spec/memory64/table_size.wast:73: assert_invalid passed:\n  out/test/spec/memory64/table_size/table_size.1.wasm:0000021: error: type mismatch at end of function, expected [] but got [i32]\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/memory64/table_size.wast:82: assert_invalid passed:\n  out/test/spec/memory64/table_size/table_size.2.wasm:0000022: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000022: error: EndFunctionBody callback failed\n40/40 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory_copy.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/memory_copy.wast\n(;; STDOUT ;;;\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\ntest() =>\nout/test/spec/memory_copy.wast:350: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:711: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:1073: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:1434: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:1796: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:2157: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:2518: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:2879: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:3240: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:3601: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:3962: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:4316: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.19.wasm:000002d: error: memory variable out of range: 0 (max 0)\n  out/test/spec/memory_copy/memory_copy.19.wasm:000002d: error: memory variable out of range: 0 (max 0)\n  000002d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4322: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.20.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4329: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.21.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i32, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4336: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.22.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i32, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4343: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.23.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4350: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.24.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4357: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.25.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4364: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.26.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4371: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.27.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4378: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.28.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4385: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.29.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4392: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.30.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, i64, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4399: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.31.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4406: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.32.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4413: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.33.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4420: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.34.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i32, f64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4427: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.35.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4434: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.36.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4441: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.37.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4448: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.38.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4455: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.39.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f32, i32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4462: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.40.wasm:000003c: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f32, f32]\n  000003c: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4469: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.41.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f32, i64]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4476: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.42.wasm:0000040: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f32, f64]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4483: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.43.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i64, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4490: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.44.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i64, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4497: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.45.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i64, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4504: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.46.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, i64, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4511: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.47.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f64, i32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4518: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.48.wasm:0000040: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f64, f32]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4525: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.49.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f64, i64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4532: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.50.wasm:0000044: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f32, f64, f64]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4539: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.51.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4546: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.52.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4553: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.53.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4560: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.54.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i32, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4567: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.55.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f32, i32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4574: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.56.wasm:0000039: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f32, f32]\n  0000039: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4581: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.57.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f32, i64]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4588: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.58.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f32, f64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4595: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.59.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, i32]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4602: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.60.wasm:0000036: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, f32]\n  0000036: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4609: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.61.wasm:0000033: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, i64]\n  0000033: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4616: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.62.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, i64, f64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4623: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.63.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4630: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.64.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4637: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.65.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4644: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.66.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [i64, f64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4651: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.67.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i32, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4658: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.68.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i32, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4665: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.69.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i32, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4672: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.70.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i32, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4679: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.71.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f32, i32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4686: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.72.wasm:0000040: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f32, f32]\n  0000040: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4693: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.73.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f32, i64]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4700: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.74.wasm:0000044: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f32, f64]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4707: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.75.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i64, i32]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4714: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.76.wasm:000003d: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i64, f32]\n  000003d: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4721: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.77.wasm:000003a: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i64, i64]\n  000003a: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4728: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.78.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, i64, f64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4735: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.79.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f64, i32]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4742: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.80.wasm:0000044: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f64, f32]\n  0000044: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4749: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.81.wasm:0000041: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f64, i64]\n  0000041: error: OnMemoryCopyExpr callback failed\nout/test/spec/memory_copy.wast:4756: assert_invalid passed:\n  out/test/spec/memory_copy/memory_copy.82.wasm:0000048: error: type mismatch in memory.copy, expected [i32, i32, i32] but got [f64, f64, f64]\n  0000048: error: OnMemoryCopyExpr callback failed\ntest() =>\ntest() =>\nout/test/spec/memory_copy.wast:4819: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:4825: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:4831: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/memory_copy.wast:4837: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\ntest() =>\nout/test/spec/memory_copy.wast:4873: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\nout/test/spec/memory_copy.wast:4885: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\nout/test/spec/memory_copy.wast:4897: assert_trap passed: out of bounds memory access: memory.copy out of bound\ntest() =>\n4450/4450 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory_fill.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/memory_fill.wast\n(;; STDOUT ;;;\ntest() =>\nout/test/spec/memory_fill.wast:44: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory_fill.wast:62: assert_trap passed: out of bounds memory access: memory.fill out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory_fill.wast:118: assert_trap passed: out of bounds memory access: memory.fill out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory_fill.wast:175: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.8.wasm:000002c: error: memory variable out of range: 0 (max 0)\n  000002c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:181: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.9.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:188: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.10.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i32, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:195: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.11.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i32, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:202: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.12.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:209: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.13.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:216: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.14.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:223: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.15.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:230: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.16.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i64, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:237: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.17.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i64, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:244: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.18.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i64, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:251: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.19.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, i64, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:258: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.20.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:265: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.21.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:272: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.22.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:279: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.23.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i32, f64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:286: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.24.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:293: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.25.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:300: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.26.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:307: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.27.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:314: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.28.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f32, i32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:321: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.29.wasm:000003b: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f32, f32]\n  000003b: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:328: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.30.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f32, i64]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:335: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.31.wasm:000003f: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f32, f64]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:342: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.32.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i64, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:349: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.33.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i64, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:356: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.34.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i64, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:363: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.35.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, i64, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:370: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.36.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f64, i32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:377: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.37.wasm:000003f: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f64, f32]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:384: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.38.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f64, i64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:391: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.39.wasm:0000043: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f32, f64, f64]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:398: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.40.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:405: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.41.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:412: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.42.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:419: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.43.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i32, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:426: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.44.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f32, i32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:433: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.45.wasm:0000038: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f32, f32]\n  0000038: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:440: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.46.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f32, i64]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:447: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.47.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f32, f64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:454: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.48.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i64, i32]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:461: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.49.wasm:0000035: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i64, f32]\n  0000035: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:468: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.50.wasm:0000032: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i64, i64]\n  0000032: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:475: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.51.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, i64, f64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:482: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.52.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:489: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.53.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:496: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.54.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:503: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.55.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [i64, f64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:510: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.56.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i32, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:517: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.57.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i32, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:524: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.58.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i32, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:531: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.59.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i32, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:538: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.60.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f32, i32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:545: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.61.wasm:000003f: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f32, f32]\n  000003f: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:552: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.62.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f32, i64]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:559: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.63.wasm:0000043: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f32, f64]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:566: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.64.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i64, i32]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:573: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.65.wasm:000003c: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i64, f32]\n  000003c: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:580: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.66.wasm:0000039: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i64, i64]\n  0000039: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:587: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.67.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, i64, f64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:594: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.68.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f64, i32]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:601: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.69.wasm:0000043: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f64, f32]\n  0000043: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:608: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.70.wasm:0000040: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f64, i64]\n  0000040: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:615: assert_invalid passed:\n  out/test/spec/memory_fill/memory_fill.71.wasm:0000047: error: type mismatch in memory.fill, expected [i32, i32, i32] but got [f64, f64, f64]\n  0000047: error: OnMemoryFillExpr callback failed\nout/test/spec/memory_fill.wast:638: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory_fill.wast:660: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nout/test/spec/memory_fill.wast:682: assert_trap passed: out of bounds memory access: memory.fill out of bounds\n100/100 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory_grow.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/memory_grow.wast\n(;; STDOUT ;;;\nout/test/spec/memory_grow.wast:15: assert_trap passed: out of bounds memory access: access at 0+4 >= max value 0\nout/test/spec/memory_grow.wast:16: assert_trap passed: out of bounds memory access: access at 0+4 >= max value 0\nout/test/spec/memory_grow.wast:17: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 0\nout/test/spec/memory_grow.wast:18: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 0\nout/test/spec/memory_grow.wast:24: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_grow.wast:25: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_grow.wast:286: assert_trap passed: undefined table index\nout/test/spec/memory_grow.wast:334: assert_invalid passed:\n  out/test/spec/memory_grow/memory_grow.8.wasm:000001f: error: type mismatch in memory.grow, expected [i32] but got []\n  000001f: error: OnMemoryGrowExpr callback failed\nout/test/spec/memory_grow.wast:343: assert_invalid passed:\n  out/test/spec/memory_grow/memory_grow.9.wasm:0000023: error: type mismatch in memory.grow, expected [i32] but got []\n  0000023: error: OnMemoryGrowExpr callback failed\nout/test/spec/memory_grow.wast:353: assert_invalid passed:\n  out/test/spec/memory_grow/memory_grow.10.wasm:0000023: error: type mismatch in memory.grow, expected [i32] but got []\n  0000023: error: OnMemoryGrowExpr callback failed\nout/test/spec/memory_grow.wast:363: assert_invalid passed:\n  out/test/spec/memory_grow/memory_grow.11.wasm:0000025: error: type mismatch in memory.grow, expected [i32] but got []\n  0000025: error: OnMemoryGrowExpr callback failed\nout/test/spec/memory_grow.wast:374: assert_invalid passed:\n  out/test/spec/memory_grow/memory_grow.12.wasm:0000024: error: type mismatch in memory.grow, expected [i32] but got [f32]\n  0000024: error: OnMemoryGrowExpr callback failed\nout/test/spec/memory_grow.wast:384: assert_invalid passed:\n  out/test/spec/memory_grow/memory_grow.13.wasm:0000021: error: type mismatch at end of function, expected [] but got [i32]\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/memory_grow.wast:393: assert_invalid passed:\n  out/test/spec/memory_grow/memory_grow.14.wasm:0000022: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000022: error: EndFunctionBody callback failed\n102/102 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory_init.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/memory_init.wast\n(;; STDOUT ;;;\ntest() =>\ntest() =>\ntest() =>\ntest() =>\nout/test/spec/memory_init.wast:190: assert_invalid passed:\n  0000023: error: data.drop requires data count section\nout/test/spec/memory_init.wast:196: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.5.wasm:000002c: error: data_segment variable out of range: 4 (max 1)\n  000002c: error: OnDataDropExpr callback failed\ntest() =>\nout/test/spec/memory_init.wast:217: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:224: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:227: assert_invalid passed:\n  000002a: error: memory.init requires data count section\nout/test/spec/memory_init.wast:233: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.10.wasm:0000034: error: data_segment variable out of range: 1 (max 1)\n  0000034: error: OnMemoryInitExpr callback failed\ntest() =>\nout/test/spec/memory_init.wast:253: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:260: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:267: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:274: assert_trap passed: out of bounds memory access: memory.init out of bounds\ntest() =>\nout/test/spec/memory_init.wast:288: assert_trap passed: out of bounds memory access: memory.init out of bounds\ntest() =>\ntest() =>\nout/test/spec/memory_init.wast:309: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:312: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.21.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:320: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.22.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i32, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:328: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.23.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i32, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:336: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.24.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:344: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.25.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:352: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.26.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:360: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.27.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:368: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.28.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i64, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:376: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.29.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i64, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:384: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.30.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i64, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:392: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.31.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, i64, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:400: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.32.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:408: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.33.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:416: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.34.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:424: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.35.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i32, f64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:432: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.36.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:440: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.37.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:448: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.38.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:456: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.39.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:464: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.40.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f32, i32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:472: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.41.wasm:000003c: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f32, f32]\n  000003c: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:480: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.42.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f32, i64]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:488: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.43.wasm:0000040: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f32, f64]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:496: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.44.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i64, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:504: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.45.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i64, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:512: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.46.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i64, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:520: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.47.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, i64, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:528: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.48.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f64, i32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:536: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.49.wasm:0000040: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f64, f32]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:544: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.50.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f64, i64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:552: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.51.wasm:0000044: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f32, f64, f64]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:560: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.52.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i32, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:568: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.53.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i32, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:576: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.54.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i32, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:584: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.55.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i32, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:592: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.56.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f32, i32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:600: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.57.wasm:0000039: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f32, f32]\n  0000039: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:608: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.58.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f32, i64]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:616: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.59.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f32, f64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:624: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.60.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i64, i32]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:632: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.61.wasm:0000036: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i64, f32]\n  0000036: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:640: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.62.wasm:0000033: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i64, i64]\n  0000033: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:648: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.63.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, i64, f64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:656: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.64.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:664: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.65.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:672: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.66.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:680: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.67.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [i64, f64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:688: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.68.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i32, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:696: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.69.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i32, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:704: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.70.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i32, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:712: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.71.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i32, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:720: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.72.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f32, i32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:728: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.73.wasm:0000040: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f32, f32]\n  0000040: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:736: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.74.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f32, i64]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:744: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.75.wasm:0000044: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f32, f64]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:752: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.76.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i64, i32]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:760: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.77.wasm:000003d: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i64, f32]\n  000003d: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:768: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.78.wasm:000003a: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i64, i64]\n  000003a: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:776: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.79.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, i64, f64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:784: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.80.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f64, i32]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:792: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.81.wasm:0000044: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f64, f32]\n  0000044: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:800: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.82.wasm:0000041: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f64, i64]\n  0000041: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:808: assert_invalid passed:\n  out/test/spec/memory_init/memory_init.83.wasm:0000048: error: type mismatch in memory.init, expected [i32, i32, i32] but got [f64, f64, f64]\n  0000048: error: OnMemoryInitExpr callback failed\nout/test/spec/memory_init.wast:833: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:856: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:879: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:902: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:925: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/memory_init.wast:948: assert_trap passed: out of bounds memory access: memory.init out of bounds\n240/240 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory_redundancy.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/memory_redundancy.wast\n(;; STDOUT ;;;\nzero_everything() =>\nzero_everything() =>\nzero_everything() =>\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory_size.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/memory_size.wast\n(;; STDOUT ;;;\nout/test/spec/memory_size.wast:69: assert_invalid passed:\n  out/test/spec/memory_size/memory_size.4.wasm:000001f: error: type mismatch at end of function, expected [] but got [i32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/memory_size.wast:78: assert_invalid passed:\n  out/test/spec/memory_size/memory_size.5.wasm:0000020: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000020: error: EndFunctionBody callback failed\n42/42 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/memory_trap.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/memory_trap.wast\n(;; STDOUT ;;;\nout/test/spec/memory_trap.wast:23: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:24: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:25: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:26: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:27: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:28: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:29: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:30: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:31: assert_trap passed: out of bounds memory access: access at 2147549184+4 >= max value 65536\nout/test/spec/memory_trap.wast:32: assert_trap passed: out of bounds memory access: access at 2147549184+4 >= max value 65536\nout/test/spec/memory_trap.wast:111: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:112: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:113: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:114: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:115: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory_trap.wast:116: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/memory_trap.wast:117: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/memory_trap.wast:118: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/memory_trap.wast:119: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/memory_trap.wast:120: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/memory_trap.wast:121: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/memory_trap.wast:122: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/memory_trap.wast:123: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/memory_trap.wast:124: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/memory_trap.wast:125: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/memory_trap.wast:126: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory_trap.wast:127: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/memory_trap.wast:128: assert_trap passed: out of bounds memory access: access at 4294967294+8 >= max value 65536\nout/test/spec/memory_trap.wast:129: assert_trap passed: out of bounds memory access: access at 4294967293+8 >= max value 65536\nout/test/spec/memory_trap.wast:130: assert_trap passed: out of bounds memory access: access at 4294967292+8 >= max value 65536\nout/test/spec/memory_trap.wast:131: assert_trap passed: out of bounds memory access: access at 4294967291+8 >= max value 65536\nout/test/spec/memory_trap.wast:132: assert_trap passed: out of bounds memory access: access at 4294967290+8 >= max value 65536\nout/test/spec/memory_trap.wast:133: assert_trap passed: out of bounds memory access: access at 4294967289+8 >= max value 65536\nout/test/spec/memory_trap.wast:134: assert_trap passed: out of bounds memory access: access at 4294967288+8 >= max value 65536\nout/test/spec/memory_trap.wast:135: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:136: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:137: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:138: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:139: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory_trap.wast:140: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/memory_trap.wast:141: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/memory_trap.wast:142: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/memory_trap.wast:143: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/memory_trap.wast:144: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/memory_trap.wast:145: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/memory_trap.wast:146: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/memory_trap.wast:147: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/memory_trap.wast:148: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/memory_trap.wast:149: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/memory_trap.wast:150: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory_trap.wast:151: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/memory_trap.wast:152: assert_trap passed: out of bounds memory access: access at 4294967294+8 >= max value 65536\nout/test/spec/memory_trap.wast:153: assert_trap passed: out of bounds memory access: access at 4294967293+8 >= max value 65536\nout/test/spec/memory_trap.wast:154: assert_trap passed: out of bounds memory access: access at 4294967292+8 >= max value 65536\nout/test/spec/memory_trap.wast:155: assert_trap passed: out of bounds memory access: access at 4294967291+8 >= max value 65536\nout/test/spec/memory_trap.wast:156: assert_trap passed: out of bounds memory access: access at 4294967290+8 >= max value 65536\nout/test/spec/memory_trap.wast:157: assert_trap passed: out of bounds memory access: access at 4294967289+8 >= max value 65536\nout/test/spec/memory_trap.wast:158: assert_trap passed: out of bounds memory access: access at 4294967288+8 >= max value 65536\nout/test/spec/memory_trap.wast:159: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory_trap.wast:160: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory_trap.wast:161: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory_trap.wast:162: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory_trap.wast:163: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory_trap.wast:164: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/memory_trap.wast:165: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory_trap.wast:166: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory_trap.wast:167: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory_trap.wast:168: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory_trap.wast:169: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory_trap.wast:170: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/memory_trap.wast:171: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:172: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:173: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:174: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:175: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory_trap.wast:176: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/memory_trap.wast:177: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/memory_trap.wast:178: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/memory_trap.wast:179: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:180: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:181: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:182: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:183: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory_trap.wast:184: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/memory_trap.wast:185: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/memory_trap.wast:186: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/memory_trap.wast:187: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/memory_trap.wast:188: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/memory_trap.wast:189: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/memory_trap.wast:190: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/memory_trap.wast:191: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/memory_trap.wast:192: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/memory_trap.wast:193: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/memory_trap.wast:194: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory_trap.wast:195: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/memory_trap.wast:196: assert_trap passed: out of bounds memory access: access at 4294967294+8 >= max value 65536\nout/test/spec/memory_trap.wast:197: assert_trap passed: out of bounds memory access: access at 4294967293+8 >= max value 65536\nout/test/spec/memory_trap.wast:198: assert_trap passed: out of bounds memory access: access at 4294967292+8 >= max value 65536\nout/test/spec/memory_trap.wast:199: assert_trap passed: out of bounds memory access: access at 4294967291+8 >= max value 65536\nout/test/spec/memory_trap.wast:200: assert_trap passed: out of bounds memory access: access at 4294967290+8 >= max value 65536\nout/test/spec/memory_trap.wast:201: assert_trap passed: out of bounds memory access: access at 4294967289+8 >= max value 65536\nout/test/spec/memory_trap.wast:202: assert_trap passed: out of bounds memory access: access at 4294967288+8 >= max value 65536\nout/test/spec/memory_trap.wast:203: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:204: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:205: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:206: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:207: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory_trap.wast:208: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/memory_trap.wast:209: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/memory_trap.wast:210: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/memory_trap.wast:211: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/memory_trap.wast:212: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/memory_trap.wast:213: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/memory_trap.wast:214: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/memory_trap.wast:215: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/memory_trap.wast:216: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/memory_trap.wast:217: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/memory_trap.wast:218: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory_trap.wast:219: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/memory_trap.wast:220: assert_trap passed: out of bounds memory access: access at 4294967294+8 >= max value 65536\nout/test/spec/memory_trap.wast:221: assert_trap passed: out of bounds memory access: access at 4294967293+8 >= max value 65536\nout/test/spec/memory_trap.wast:222: assert_trap passed: out of bounds memory access: access at 4294967292+8 >= max value 65536\nout/test/spec/memory_trap.wast:223: assert_trap passed: out of bounds memory access: access at 4294967291+8 >= max value 65536\nout/test/spec/memory_trap.wast:224: assert_trap passed: out of bounds memory access: access at 4294967290+8 >= max value 65536\nout/test/spec/memory_trap.wast:225: assert_trap passed: out of bounds memory access: access at 4294967289+8 >= max value 65536\nout/test/spec/memory_trap.wast:226: assert_trap passed: out of bounds memory access: access at 4294967288+8 >= max value 65536\nout/test/spec/memory_trap.wast:227: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory_trap.wast:228: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory_trap.wast:229: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory_trap.wast:230: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory_trap.wast:231: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory_trap.wast:232: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory_trap.wast:233: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory_trap.wast:234: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/memory_trap.wast:235: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory_trap.wast:236: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory_trap.wast:237: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory_trap.wast:238: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/memory_trap.wast:239: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory_trap.wast:240: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory_trap.wast:241: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/memory_trap.wast:242: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/memory_trap.wast:243: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory_trap.wast:244: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory_trap.wast:245: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory_trap.wast:246: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/memory_trap.wast:247: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/memory_trap.wast:248: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/memory_trap.wast:249: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/memory_trap.wast:250: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/memory_trap.wast:251: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:252: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:253: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:254: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:255: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory_trap.wast:256: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/memory_trap.wast:257: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/memory_trap.wast:258: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/memory_trap.wast:259: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/memory_trap.wast:260: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/memory_trap.wast:261: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/memory_trap.wast:262: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:263: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/memory_trap.wast:264: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/memory_trap.wast:265: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/memory_trap.wast:266: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/memory_trap.wast:275: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:277: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/memory_trap.wast:279: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/memory_trap.wast:281: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\n182/182 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/address0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/address0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/address0.wast:193: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/address0.wast:195: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/multi-memory/address0.wast:196: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/multi-memory/address0.wast:197: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/multi-memory/address0.wast:198: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/multi-memory/address0.wast:199: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/multi-memory/address0.wast:200: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/multi-memory/address0.wast:202: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/address0.wast:203: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/address0.wast:204: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/address0.wast:205: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/address0.wast:206: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/address0.wast:208: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/multi-memory/address0.wast:209: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/multi-memory/address0.wast:210: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/multi-memory/address0.wast:211: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/multi-memory/address0.wast:212: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\n92/92 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/address1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/address1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/address1.wast:270: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/multi-memory/address1.wast:272: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/multi-memory/address1.wast:273: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/multi-memory/address1.wast:274: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/multi-memory/address1.wast:275: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/multi-memory/address1.wast:276: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/multi-memory/address1.wast:277: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/multi-memory/address1.wast:278: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/multi-memory/address1.wast:280: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/address1.wast:281: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/address1.wast:282: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/address1.wast:283: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/address1.wast:284: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/address1.wast:285: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/address1.wast:286: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/multi-memory/address1.wast:288: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/multi-memory/address1.wast:289: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/multi-memory/address1.wast:290: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/multi-memory/address1.wast:291: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/multi-memory/address1.wast:292: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/address1.wast:293: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/address1.wast:294: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\n127/127 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/align.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/align.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/align.wast:28: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.23.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load8_s align=0 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/multi-memory/align.wast:34: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.24.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load8_s align=7 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/multi-memory/align.wast:40: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.25.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load8_u align=0 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/multi-memory/align.wast:46: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.26.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load8_u align=7 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/multi-memory/align.wast:52: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.27.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load16_s align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:58: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.28.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load16_s align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:64: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.29.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load16_u align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:70: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.30.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load16_u align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:76: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.31.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load align=0 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/multi-memory/align.wast:82: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.32.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i32.load align=7 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/multi-memory/align.wast:88: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.33.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load8_s align=0 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/multi-memory/align.wast:94: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.34.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load8_s align=7 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/multi-memory/align.wast:100: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.35.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load8_u align=0 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/multi-memory/align.wast:106: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.36.wat:1:45: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load8_u align=7 (i32.const 0)))))\n                                              ^^^^^^^\nout/test/spec/multi-memory/align.wast:112: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.37.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load16_s align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:118: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.38.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load16_s align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:124: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.39.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load16_u align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:130: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.40.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load16_u align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:136: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.41.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load32_s align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:142: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.42.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load32_s align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:148: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.43.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load32_u align=0 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:154: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.44.wat:1:46: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load32_u align=7 (i32.const 0)))))\n                                               ^^^^^^^\nout/test/spec/multi-memory/align.wast:160: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.45.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load align=0 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/multi-memory/align.wast:166: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.46.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (i64.load align=7 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/multi-memory/align.wast:172: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.47.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (f32.load align=0 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/multi-memory/align.wast:178: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.48.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (f32.load align=7 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/multi-memory/align.wast:184: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.49.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (f64.load align=0 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/multi-memory/align.wast:190: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.50.wat:1:42: error: alignment must be power-of-two\n  (module (memory 0) (func (drop (f64.load align=7 (i32.const 0)))))\n                                           ^^^^^^^\nout/test/spec/multi-memory/align.wast:197: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.51.wat:1:38: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store8 align=0 (i32.const 0) (i32.const 0))))\n                                       ^^^^^^^\nout/test/spec/multi-memory/align.wast:203: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.52.wat:1:38: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store8 align=7 (i32.const 0) (i32.const 0))))\n                                       ^^^^^^^\nout/test/spec/multi-memory/align.wast:209: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.53.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store16 align=0 (i32.const 0) (i32.const 0))))\n                                        ^^^^^^^\nout/test/spec/multi-memory/align.wast:215: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.54.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store16 align=7 (i32.const 0) (i32.const 0))))\n                                        ^^^^^^^\nout/test/spec/multi-memory/align.wast:221: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.55.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store align=0 (i32.const 0) (i32.const 0))))\n                                      ^^^^^^^\nout/test/spec/multi-memory/align.wast:227: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.56.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (i32.store align=7 (i32.const 0) (i32.const 0))))\n                                      ^^^^^^^\nout/test/spec/multi-memory/align.wast:233: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.57.wat:1:38: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store8 align=0 (i32.const 0) (i64.const 0))))\n                                       ^^^^^^^\nout/test/spec/multi-memory/align.wast:239: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.58.wat:1:38: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store8 align=7 (i32.const 0) (i64.const 0))))\n                                       ^^^^^^^\nout/test/spec/multi-memory/align.wast:245: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.59.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store16 align=0 (i32.const 0) (i64.const 0))))\n                                        ^^^^^^^\nout/test/spec/multi-memory/align.wast:251: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.60.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store16 align=7 (i32.const 0) (i64.const 0))))\n                                        ^^^^^^^\nout/test/spec/multi-memory/align.wast:257: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.61.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store32 align=0 (i32.const 0) (i64.const 0))))\n                                        ^^^^^^^\nout/test/spec/multi-memory/align.wast:263: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.62.wat:1:39: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store32 align=7 (i32.const 0) (i64.const 0))))\n                                        ^^^^^^^\nout/test/spec/multi-memory/align.wast:269: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.63.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store align=0 (i32.const 0) (i64.const 0))))\n                                      ^^^^^^^\nout/test/spec/multi-memory/align.wast:275: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.64.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (i64.store align=7 (i32.const 0) (i64.const 0))))\n                                      ^^^^^^^\nout/test/spec/multi-memory/align.wast:281: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.65.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (f32.store align=0 (i32.const 0) (f32.const 0))))\n                                      ^^^^^^^\nout/test/spec/multi-memory/align.wast:287: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.66.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (f32.store align=7 (i32.const 0) (f32.const 0))))\n                                      ^^^^^^^\nout/test/spec/multi-memory/align.wast:293: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.67.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (f64.store align=0 (i32.const 0) (f32.const 0))))\n                                      ^^^^^^^\nout/test/spec/multi-memory/align.wast:299: assert_malformed passed:\n  out/test/spec/multi-memory/align/align.68.wat:1:37: error: alignment must be power-of-two\n  (module (memory 0) (func (f64.store align=7 (i32.const 0) (f32.const 0))))\n                                      ^^^^^^^\nout/test/spec/multi-memory/align.wast:306: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.69.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:310: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.70.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:314: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.71.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:318: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.72.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:322: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.73.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:326: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.74.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:330: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.75.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:334: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.76.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:338: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.77.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:342: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.78.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:346: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.79.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:350: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.80.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:354: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.81.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:358: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.82.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:363: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.83.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:367: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.84.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:371: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.85.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:375: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.86.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:379: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.87.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:383: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.88.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:387: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.89.wasm:0000021: error: alignment must not be larger than natural alignment (1)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:391: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.90.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:395: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.91.wasm:0000021: error: alignment must not be larger than natural alignment (2)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:399: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.92.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:403: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.93.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:407: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.94.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:411: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.95.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:415: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.96.wasm:0000021: error: alignment must not be larger than natural alignment (8)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:420: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.97.wasm:0000023: error: alignment must not be larger than natural alignment (1)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:424: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.98.wasm:0000023: error: alignment must not be larger than natural alignment (2)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:428: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.99.wasm:0000023: error: alignment must not be larger than natural alignment (4)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:432: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.100.wasm:0000023: error: alignment must not be larger than natural alignment (1)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:436: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.101.wasm:0000023: error: alignment must not be larger than natural alignment (2)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:440: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.102.wasm:0000023: error: alignment must not be larger than natural alignment (4)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:444: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.103.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:448: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.104.wasm:0000026: error: alignment must not be larger than natural alignment (4)\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:452: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.105.wasm:000002a: error: alignment must not be larger than natural alignment (8)\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/align.wast:864: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/multi-memory/align.wast:873: assert_invalid passed:\n  out/test/spec/multi-memory/align/align.108.wasm:0000021: error: alignment must not be larger than natural alignment (4)\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/align.wast:892: assert_invalid passed:\n  0000020: error: invalid load alignment: 32\nout/test/spec/multi-memory/align.wast:911: assert_invalid passed:\n  0000020: error: invalid load alignment: 33\nout/test/spec/multi-memory/align.wast:930: assert_invalid passed:\n  0000020: error: invalid load alignment: 63\n160/160 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/align0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/align0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n5/5 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/binary.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/binary.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/binary.wast:6: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/multi-memory/binary.wast:7: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/multi-memory/binary.wast:8: assert_malformed passed:\n  0000000: error: unable to read uint32_t: magic\nout/test/spec/multi-memory/binary.wast:9: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:10: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:11: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:12: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:13: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:14: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:15: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:16: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:17: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:18: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:21: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:24: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:25: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:28: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:31: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:34: assert_malformed passed:\n  0000004: error: bad magic value\nout/test/spec/multi-memory/binary.wast:37: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/multi-memory/binary.wast:38: assert_malformed passed:\n  0000004: error: unable to read uint16_t: version\nout/test/spec/multi-memory/binary.wast:39: assert_malformed passed:\n  0000006: error: unable to read uint16_t: layer\nout/test/spec/multi-memory/binary.wast:40: assert_malformed passed:\n  0000008: error: bad wasm file version: 0 (expected 0x1)\nout/test/spec/multi-memory/binary.wast:41: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xd (expected 0x1)\nout/test/spec/multi-memory/binary.wast:42: assert_malformed passed:\n  0000008: error: bad wasm file version: 0xe (expected 0x1)\nout/test/spec/multi-memory/binary.wast:43: assert_malformed passed:\n  0000008: error: bad wasm file version: 0x100 (expected 0x1)\nout/test/spec/multi-memory/binary.wast:44: assert_malformed passed:\n  0000008: error: wasm components are not yet supported in this tool\nout/test/spec/multi-memory/binary.wast:45: assert_malformed passed:\n  0000008: error: unsupported wasm layer: 0x100\nout/test/spec/multi-memory/binary.wast:48: assert_malformed passed:\n  000000a: error: invalid section code: 14\nout/test/spec/multi-memory/binary.wast:49: assert_malformed passed:\n  000000a: error: invalid section code: 127\nout/test/spec/multi-memory/binary.wast:50: assert_malformed passed:\n  000000a: error: invalid section code: 128\nout/test/spec/multi-memory/binary.wast:51: assert_malformed passed:\n  000000a: error: invalid section code: 129\nout/test/spec/multi-memory/binary.wast:52: assert_malformed passed:\n  000000a: error: invalid section code: 255\nout/test/spec/multi-memory/binary.wast:56: assert_malformed passed:\n  000001b: error: function body must end with END opcode\nout/test/spec/multi-memory/binary.wast:77: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/multi-memory/binary.wast:93: assert_malformed passed:\n  000001a: error: function body must end with END opcode\nout/test/spec/multi-memory/binary.wast:113: assert_malformed passed:\n  0000019: error: init expression must end with END opcode\nout/test/spec/multi-memory/binary.wast:126: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/multi-memory/binary.wast:143: assert_malformed passed:\n  0000017: error: unable to read u32 leb128: local type count\nout/test/spec/multi-memory/binary.wast:160: assert_malformed passed:\n  000001e: error: local count must be <= 0xffffffff\nout/test/spec/multi-memory/binary.wast:176: assert_malformed passed:\n  0000030: error: local count must be <= 0xffffffff\nout/test/spec/multi-memory/binary.wast:210: assert_malformed passed:\n  0000013: error: function signature count != function body count\nout/test/spec/multi-memory/binary.wast:220: assert_malformed passed:\n  000000b: error: function signature count != function body count\nout/test/spec/multi-memory/binary.wast:229: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/multi-memory/binary.wast:240: assert_malformed passed:\n  0000015: error: function signature count != function body count\nout/test/spec/multi-memory/binary.wast:263: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/multi-memory/binary.wast:275: assert_malformed passed:\n  000000e: error: data segment count does not equal count in DataCount section\nout/test/spec/multi-memory/binary.wast:287: assert_malformed passed:\n  0000010: error: Data section missing but DataCount non-zero\nout/test/spec/multi-memory/binary.wast:303: assert_malformed passed:\n  0000024: error: memory.init requires data count section\nout/test/spec/multi-memory/binary.wast:326: assert_malformed passed:\n  000001e: error: data.drop requires data count section\nout/test/spec/multi-memory/binary.wast:346: assert_malformed passed:\n  0000024: error: unexpected opcode: 0xf3\nout/test/spec/multi-memory/binary.wast:374: assert_malformed passed:\n  0000022: error: table elem type must be a reference type\nout/test/spec/multi-memory/binary.wast:459: assert_malformed passed:\n  000000a: error: invalid section size: extends past end\nout/test/spec/multi-memory/binary.wast:470: assert_malformed passed:\n  000000e: error: unfinished section (expected end: 0x11)\nout/test/spec/multi-memory/binary.wast:489: assert_malformed passed:\n  000000e: error: invalid import tag kind: exceptions not allowed\nout/test/spec/multi-memory/binary.wast:499: assert_malformed passed:\n  000000e: error: invalid import tag kind: exceptions not allowed\nout/test/spec/multi-memory/binary.wast:510: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/multi-memory/binary.wast:520: assert_malformed passed:\n  000000e: error: invalid import external kind: 5\nout/test/spec/multi-memory/binary.wast:531: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/multi-memory/binary.wast:541: assert_malformed passed:\n  000000e: error: invalid import external kind: 128\nout/test/spec/multi-memory/binary.wast:554: assert_malformed passed:\n  0000027: error: unable to read u32 leb128: string length\nout/test/spec/multi-memory/binary.wast:573: assert_malformed passed:\n  000002b: error: unfinished section (expected end: 0x40)\nout/test/spec/multi-memory/binary.wast:604: assert_malformed passed:\n  000000b: error: invalid table count 1, only 0 bytes left in section\nout/test/spec/multi-memory/binary.wast:614: assert_malformed passed:\n  000000d: error: tables may not be shared\nout/test/spec/multi-memory/binary.wast:623: assert_malformed passed:\n  000000d: error: tables may not be shared\nout/test/spec/multi-memory/binary.wast:633: assert_malformed passed:\n  000000d: error: malformed table limits flag: 129\nout/test/spec/multi-memory/binary.wast:651: assert_malformed passed:\n  000000b: error: invalid memory count 1, only 0 bytes left in section\nout/test/spec/multi-memory/binary.wast:661: assert_malformed passed:\n  000000c: error: memory may not be shared: threads not allowed\nout/test/spec/multi-memory/binary.wast:669: assert_malformed passed:\n  000000c: error: memory may not be shared: threads not allowed\nout/test/spec/multi-memory/binary.wast:678: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/multi-memory/binary.wast:687: assert_malformed passed:\n  000000c: error: malformed memory limits flag: 129\nout/test/spec/multi-memory/binary.wast:704: assert_malformed passed:\n  0000010: error: unable to read i32 leb128: global type\nout/test/spec/multi-memory/binary.wast:715: assert_malformed passed:\n  0000010: error: unfinished section (expected end: 0x15)\nout/test/spec/multi-memory/binary.wast:738: assert_malformed passed:\n  000001b: error: unable to read u32 leb128: string length\nout/test/spec/multi-memory/binary.wast:759: assert_malformed passed:\n  000001b: error: unfinished section (expected end: 0x20)\nout/test/spec/multi-memory/binary.wast:793: assert_malformed passed:\n  0000021: error: unable to read u32 leb128: elem segment flags\nout/test/spec/multi-memory/binary.wast:809: assert_malformed passed:\n  0000024: error: init expression must end with END opcode\nout/test/spec/multi-memory/binary.wast:826: assert_malformed passed:\n  0000021: error: unfinished section (expected end: 0x27)\nout/test/spec/multi-memory/binary.wast:852: assert_malformed passed:\n  0000016: error: unable to read u32 leb128: data segment flags\nout/test/spec/multi-memory/binary.wast:865: assert_malformed passed:\n  0000016: error: unfinished section (expected end: 0x1c)\nout/test/spec/multi-memory/binary.wast:878: assert_malformed passed:\n  0000015: error: unable to read data: data segment data\nout/test/spec/multi-memory/binary.wast:892: assert_malformed passed:\n  000001a: error: unfinished section (expected end: 0x1b)\nout/test/spec/multi-memory/binary.wast:923: assert_malformed passed:\n  0000048: error: function body must end with END opcode\nout/test/spec/multi-memory/binary.wast:970: assert_malformed passed:\n  0000017: error: multiple Start sections\nout/test/spec/multi-memory/binary.wast:987: assert_malformed passed:\n  0000014: error: multiple Function sections\nout/test/spec/multi-memory/binary.wast:999: assert_malformed passed:\n  0000016: error: function signature count != function body count\nout/test/spec/multi-memory/binary.wast:1011: assert_malformed passed:\n  000000d: error: multiple DataCount sections\nout/test/spec/multi-memory/binary.wast:1021: assert_malformed passed:\n  000000d: error: multiple Data sections\nout/test/spec/multi-memory/binary.wast:1031: assert_malformed passed:\n  000000d: error: multiple Global sections\nout/test/spec/multi-memory/binary.wast:1041: assert_malformed passed:\n  000000d: error: multiple Export sections\nout/test/spec/multi-memory/binary.wast:1051: assert_malformed passed:\n  000000d: error: multiple Table sections\nout/test/spec/multi-memory/binary.wast:1061: assert_malformed passed:\n  000000d: error: multiple Elem sections\nout/test/spec/multi-memory/binary.wast:1071: assert_malformed passed:\n  000000d: error: multiple Import sections\nout/test/spec/multi-memory/binary.wast:1081: assert_malformed passed:\n  000000d: error: multiple Type sections\nout/test/spec/multi-memory/binary.wast:1091: assert_malformed passed:\n  000000d: error: multiple Memory sections\nout/test/spec/multi-memory/binary.wast:1101: assert_malformed passed:\n  000000d: error: section Type out of order\nout/test/spec/multi-memory/binary.wast:1111: assert_malformed passed:\n  000000d: error: section Import out of order\nout/test/spec/multi-memory/binary.wast:1121: assert_malformed passed:\n  000000d: error: section Function out of order\nout/test/spec/multi-memory/binary.wast:1131: assert_malformed passed:\n  000000d: error: section Table out of order\nout/test/spec/multi-memory/binary.wast:1141: assert_malformed passed:\n  000000d: error: section Memory out of order\nout/test/spec/multi-memory/binary.wast:1151: assert_malformed passed:\n  000000d: error: section Global out of order\nout/test/spec/multi-memory/binary.wast:1161: assert_malformed passed:\n  0000011: error: section Export out of order\nout/test/spec/multi-memory/binary.wast:1172: assert_malformed passed:\n  0000011: error: section Start out of order\nout/test/spec/multi-memory/binary.wast:1183: assert_malformed passed:\n  000000d: error: section Elem out of order\nout/test/spec/multi-memory/binary.wast:1193: assert_malformed passed:\n  000000d: error: section DataCount out of order\nout/test/spec/multi-memory/binary.wast:1203: assert_malformed passed:\n  000000d: error: section Code out of order\n126/126 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/binary0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/binary0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/binary0.wast:48: assert_malformed passed:\n  000000e: error: unable to read u32 leb128: memory initial page count\nout/test/spec/multi-memory/binary0.wast:59: assert_malformed passed:\n  000000d: error: unable to read uint8_t: memory flags\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/data.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/data.wast:86: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.9.wasm:000001b: error: initializer expression can only reference an imported global\n  000001b: error: OnGlobalGetExpr callback failed\nout/test/spec/multi-memory/data.wast:90: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.10.wasm:000001b: error: initializer expression can only reference an imported global\n  000001b: error: OnGlobalGetExpr callback failed\nout/test/spec/multi-memory/data.wast:300: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.41.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/data.wast:308: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.42.wasm:0000012: error: memory variable out of range: 1 (max 1)\n  0000012: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/data.wast:321: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.43.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/data.wast:332: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.44.wasm:000000d: error: memory variable out of range: 1 (max 0)\n  000000d: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/data.wast:344: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.45.wasm:0000012: error: memory variable out of range: 1 (max 1)\n  0000012: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/data.wast:366: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.46.wasm:000000d: error: memory variable out of range: 1 (max 0)\n  000000d: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/data.wast:385: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.47.wasm:0000013: error: type mismatch in initializer expression, expected [i32] but got [i64]\n  0000014: error: EndDataSegmentInitExpr callback failed\nout/test/spec/multi-memory/data.wast:393: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.48.wasm:0000013: error: type mismatch in initializer expression, expected [i32] but got [funcref]\n  0000014: error: EndDataSegmentInitExpr callback failed\nout/test/spec/multi-memory/data.wast:401: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.49.wasm:0000011: error: type mismatch in initializer expression, expected [i32] but got []\n  0000012: error: EndDataSegmentInitExpr callback failed\nout/test/spec/multi-memory/data.wast:409: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.50.wasm:0000015: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  0000016: error: EndDataSegmentInitExpr callback failed\nout/test/spec/multi-memory/data.wast:417: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.51.wasm:000002b: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002c: error: EndDataSegmentInitExpr callback failed\nout/test/spec/multi-memory/data.wast:426: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.52.wasm:000002b: error: type mismatch at end of initializer expression, expected [] but got [i32]\n  000002c: error: EndDataSegmentInitExpr callback failed\nout/test/spec/multi-memory/data.wast:435: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.53.wasm:0000014: error: invalid initializer: instruction not valid in initializer expression: i32.ctz\n  0000014: error: OnUnaryExpr callback failed\nout/test/spec/multi-memory/data.wast:443: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.54.wasm:0000012: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000012: error: OnNopExpr callback failed\nout/test/spec/multi-memory/data.wast:451: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.55.wasm:0000012: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000012: error: OnNopExpr callback failed\nout/test/spec/multi-memory/data.wast:459: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.56.wasm:0000014: error: invalid initializer: instruction not valid in initializer expression: nop\n  0000014: error: OnNopExpr callback failed\nout/test/spec/multi-memory/data.wast:467: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.57.wasm:0000020: error: initializer expression cannot reference a mutable global\n  0000020: error: OnGlobalGetExpr callback failed\nout/test/spec/multi-memory/data.wast:476: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.58.wasm:0000013: error: global variable out of range: 0 (max 0)\n  0000013: error: OnGlobalGetExpr callback failed\nout/test/spec/multi-memory/data.wast:484: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.59.wasm:0000029: error: global variable out of range: 1 (max 1)\n  0000029: error: OnGlobalGetExpr callback failed\nout/test/spec/multi-memory/data.wast:493: assert_invalid passed:\n  out/test/spec/multi-memory/data/data.60.wasm:000002d: error: initializer expression cannot reference a mutable global\n  000002d: error: OnGlobalGetExpr callback failed\n61/61 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/data0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/data1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/data_drop0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data_drop0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\ninit_passive(i32:1) =>\ndrop_passive() =>\ndrop_passive() =>\nout/test/spec/multi-memory/data_drop0.wast:22: assert_trap passed: out of bounds memory access: memory.init out of bounds\ninit_passive(i32:0) =>\ndrop_active() =>\nout/test/spec/multi-memory/data_drop0.wast:26: assert_trap passed: out of bounds memory access: memory.init out of bounds\ninit_active(i32:0) =>\n11/11 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/exports0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/exports0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/float_exprs0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/float_exprs0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\ninit(i32:0, f64:15.100000) =>\ninit(i32:8, f64:15.200000) =>\ninit(i32:16, f64:15.300000) =>\ninit(i32:24, f64:15.400000) =>\nrun(i32:32, f64:3.000000) =>\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/float_exprs1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/float_exprs1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/float_memory0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/float_memory0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nreset() =>\nf32.store() =>\nreset() =>\ni32.store() =>\nreset() =>\nf64.store() =>\nreset() =>\ni64.store() =>\n30/30 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/imports.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i32_f32(i32:14, f32:42.000000) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_f32(f32:13.000000) =>\ncalled host spectest.print_i32(i32:13) =>\ncalled host spectest.print_i64(i64:24) =>\ncalled host spectest.print_f64_f64(f64:25.000000, f64:53.000000) =>\ncalled host spectest.print_i64(i64:24) =>\ncalled host spectest.print_f64(f64:24.000000) =>\ncalled host spectest.print_f64(f64:24.000000) =>\ncalled host spectest.print_f64(f64:24.000000) =>\nout/test/spec/multi-memory/imports.wast:89: assert_invalid passed:\n  out/test/spec/multi-memory/imports/imports.2.wasm:000001e: error: function type variable out of range: 1 (max 1)\n  000001e: error: OnImportFunc callback failed\ncalled host spectest.print_i32(i32:13) =>\nout/test/spec/multi-memory/imports.wast:125: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/multi-memory/imports.wast:129: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/multi-memory/imports.wast:134: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:138: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:142: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:146: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:150: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:154: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:158: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:162: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:166: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:170: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:174: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:178: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:182: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:186: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:190: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:194: assert_unlinkable passed:\n  error: import signature mismatch\nout/test/spec/multi-memory/imports.wast:199: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind func, not global\nout/test/spec/multi-memory/imports.wast:203: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind func, not table\nout/test/spec/multi-memory/imports.wast:207: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind func, not memory\nout/test/spec/multi-memory/imports.wast:211: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind func, not global\nout/test/spec/multi-memory/imports.wast:215: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind func, not table\nout/test/spec/multi-memory/imports.wast:219: assert_unlinkable passed:\n  error: expected import \"spectest.memory\" to have kind func, not memory\nout/test/spec/multi-memory/imports.wast:259: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/multi-memory/imports.wast:263: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/multi-memory/imports.wast:268: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i64 but got i32.\nout/test/spec/multi-memory/imports.wast:272: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f32 but got i32.\nout/test/spec/multi-memory/imports.wast:276: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got i32.\nout/test/spec/multi-memory/imports.wast:280: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/multi-memory/imports.wast:284: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i32 but got f32.\nout/test/spec/multi-memory/imports.wast:288: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i64 but got f32.\nout/test/spec/multi-memory/imports.wast:292: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got f32.\nout/test/spec/multi-memory/imports.wast:296: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected immutable but got mutable.\nout/test/spec/multi-memory/imports.wast:300: assert_unlinkable passed:\n  error: type mismatch in imported global, expected i32 but got i64.\nout/test/spec/multi-memory/imports.wast:304: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f32 but got i64.\nout/test/spec/multi-memory/imports.wast:308: assert_unlinkable passed:\n  error: type mismatch in imported global, expected f64 but got i64.\nout/test/spec/multi-memory/imports.wast:312: assert_unlinkable passed:\n  error: mutability mismatch in imported global, expected mutable but got immutable.\nout/test/spec/multi-memory/imports.wast:317: assert_unlinkable passed:\n  error: expected import \"test.func\" to have kind global, not func\nout/test/spec/multi-memory/imports.wast:321: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind global, not table\nout/test/spec/multi-memory/imports.wast:325: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind global, not memory\nout/test/spec/multi-memory/imports.wast:329: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind global, not func\nout/test/spec/multi-memory/imports.wast:333: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind global, not table\nout/test/spec/multi-memory/imports.wast:337: assert_unlinkable passed:\n  error: expected import \"spectest.memory\" to have kind global, not memory\nout/test/spec/multi-memory/imports.wast:356: assert_trap passed: uninitialized table element\nout/test/spec/multi-memory/imports.wast:359: assert_trap passed: uninitialized table element\nout/test/spec/multi-memory/imports.wast:360: assert_trap passed: undefined table index\nout/test/spec/multi-memory/imports.wast:375: assert_trap passed: uninitialized table element\nout/test/spec/multi-memory/imports.wast:378: assert_trap passed: uninitialized table element\nout/test/spec/multi-memory/imports.wast:379: assert_trap passed: undefined table index\nout/test/spec/multi-memory/imports.wast:410: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/multi-memory/imports.wast:414: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/multi-memory/imports.wast:419: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/multi-memory/imports.wast:423: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (20)\nout/test/spec/multi-memory/imports.wast:427: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/multi-memory/imports.wast:431: assert_unlinkable passed:\n  error: max size (20) larger than declared (18)\nout/test/spec/multi-memory/imports.wast:435: assert_unlinkable passed:\n  error: actual size (10) smaller than declared (12)\nout/test/spec/multi-memory/imports.wast:439: assert_unlinkable passed:\n  error: max size (20) larger than declared (15)\nout/test/spec/multi-memory/imports.wast:444: assert_unlinkable passed:\n  error: expected import \"test.func\" to have kind table, not func\nout/test/spec/multi-memory/imports.wast:448: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind table, not global\nout/test/spec/multi-memory/imports.wast:452: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind table, not memory\nout/test/spec/multi-memory/imports.wast:456: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind table, not func\nout/test/spec/multi-memory/imports.wast:474: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/multi-memory/imports.wast:485: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/multi-memory/imports.wast:498: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/multi-memory/imports.wast:502: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/multi-memory/imports.wast:507: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/multi-memory/imports.wast:511: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (3)\nout/test/spec/multi-memory/imports.wast:515: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/multi-memory/imports.wast:519: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\nout/test/spec/multi-memory/imports.wast:524: assert_unlinkable passed:\n  error: expected import \"test.func-i32\" to have kind memory, not func\nout/test/spec/multi-memory/imports.wast:528: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind memory, not global\nout/test/spec/multi-memory/imports.wast:532: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind memory, not table\nout/test/spec/multi-memory/imports.wast:536: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind memory, not func\nout/test/spec/multi-memory/imports.wast:540: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind memory, not global\nout/test/spec/multi-memory/imports.wast:544: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind memory, not table\nout/test/spec/multi-memory/imports.wast:549: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/multi-memory/imports.wast:553: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\nout/test/spec/multi-memory/imports.wast:571: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.121.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (func))\n          ^^^^^^\nout/test/spec/multi-memory/imports.wast:575: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.122.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (global i64))\n          ^^^^^^\nout/test/spec/multi-memory/imports.wast:579: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.123.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (table 0 funcref))\n          ^^^^^^\nout/test/spec/multi-memory/imports.wast:583: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.124.wat:1:9: error: imports must occur before all non-import definitions\n  (func) (import \"\" \"\" (memory 0))\n          ^^^^^^\nout/test/spec/multi-memory/imports.wast:588: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.125.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (func))\n                              ^^^^^^\nout/test/spec/multi-memory/imports.wast:592: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.126.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (global f32))\n                              ^^^^^^\nout/test/spec/multi-memory/imports.wast:596: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.127.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (table 0 funcref))\n                              ^^^^^^\nout/test/spec/multi-memory/imports.wast:600: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.128.wat:1:29: error: imports must occur before all non-import definitions\n  (global i64 (i64.const 0)) (import \"\" \"\" (memory 0))\n                              ^^^^^^\nout/test/spec/multi-memory/imports.wast:605: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.129.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (func))\n                     ^^^^^^\nout/test/spec/multi-memory/imports.wast:609: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.130.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (global i32))\n                     ^^^^^^\nout/test/spec/multi-memory/imports.wast:613: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.131.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (table 0 funcref))\n                     ^^^^^^\nout/test/spec/multi-memory/imports.wast:617: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.132.wat:1:20: error: imports must occur before all non-import definitions\n  (table 0 funcref) (import \"\" \"\" (memory 0))\n                     ^^^^^^\nout/test/spec/multi-memory/imports.wast:622: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.133.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (func))\n              ^^^^^^\nout/test/spec/multi-memory/imports.wast:626: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.134.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (global i32))\n              ^^^^^^\nout/test/spec/multi-memory/imports.wast:630: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.135.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (table 1 3 funcref))\n              ^^^^^^\nout/test/spec/multi-memory/imports.wast:634: assert_malformed passed:\n  out/test/spec/multi-memory/imports/imports.136.wat:1:13: error: imports must occur before all non-import definitions\n  (memory 0) (import \"\" \"\" (memory 1 2))\n              ^^^^^^\nout/test/spec/multi-memory/imports.wast:644: assert_unlinkable passed:\n  error: invalid import \"not wasm.overloaded\"\n173/173 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/imports0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/imports0.wast:21: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind func, not memory\nout/test/spec/multi-memory/imports0.wast:25: assert_unlinkable passed:\n  error: expected import \"test.memory-2-4\" to have kind func, not memory\nout/test/spec/multi-memory/imports0.wast:30: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind global, not memory\nout/test/spec/multi-memory/imports0.wast:34: assert_unlinkable passed:\n  error: expected import \"test.memory-2-4\" to have kind global, not memory\nout/test/spec/multi-memory/imports0.wast:39: assert_unlinkable passed:\n  error: expected import \"test.memory-2-inf\" to have kind table, not memory\nout/test/spec/multi-memory/imports0.wast:43: assert_unlinkable passed:\n  error: expected import \"test.memory-2-4\" to have kind table, not memory\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/imports1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/imports1.wast:15: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\n5/5 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/imports2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports2.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/imports2.wast:20: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/multi-memory/imports2.wast:31: assert_trap passed: out of bounds memory access: access at 1000000+4 >= max value 65536\nout/test/spec/multi-memory/imports2.wast:49: assert_unlinkable passed:\n  error: invalid import \"test.unknown\"\nout/test/spec/multi-memory/imports2.wast:53: assert_unlinkable passed:\n  error: invalid import \"spectest.unknown\"\nout/test/spec/multi-memory/imports2.wast:58: assert_unlinkable passed:\n  error: actual size (2) smaller than declared (3)\nout/test/spec/multi-memory/imports2.wast:62: assert_unlinkable passed:\n  error: max size (unspecified) larger than declared (3)\nout/test/spec/multi-memory/imports2.wast:66: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/multi-memory/imports2.wast:70: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\n19/19 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/imports3.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports3.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/imports3.wast:20: assert_unlinkable passed:\n  error: expected import \"test.func-i32\" to have kind memory, not func\nout/test/spec/multi-memory/imports3.wast:27: assert_unlinkable passed:\n  error: expected import \"test.global-i32\" to have kind memory, not global\nout/test/spec/multi-memory/imports3.wast:34: assert_unlinkable passed:\n  error: expected import \"test.table-10-inf\" to have kind memory, not table\nout/test/spec/multi-memory/imports3.wast:41: assert_unlinkable passed:\n  error: expected import \"spectest.print_i32\" to have kind memory, not func\nout/test/spec/multi-memory/imports3.wast:48: assert_unlinkable passed:\n  error: expected import \"spectest.global_i32\" to have kind memory, not global\nout/test/spec/multi-memory/imports3.wast:55: assert_unlinkable passed:\n  error: expected import \"spectest.table\" to have kind memory, not table\nout/test/spec/multi-memory/imports3.wast:63: assert_unlinkable passed:\n  error: actual size (1) smaller than declared (2)\nout/test/spec/multi-memory/imports3.wast:70: assert_unlinkable passed:\n  error: max size (2) larger than declared (1)\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/imports4.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports4.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n13/13 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/linking0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/linking0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/linking0.wast:17: assert_unlinkable passed:\n  error: invalid import \"Mt.mem\"\nout/test/spec/multi-memory/linking0.wast:27: assert_trap passed: uninitialized table element\n5/5 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/linking1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/linking1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n13/13 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/linking2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/linking2.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n10/10 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/linking3.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/linking3.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/linking3.wast:15: assert_unlinkable passed:\n  error: invalid import \"Mm.tab\"\n12/12 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/load.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/load.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/load.wast:278: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.4.wat:1:43: error: unexpected token \"i32.load32\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load32 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:285: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.5.wat:1:43: error: unexpected token \"i32.load32_u\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load32_u (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:292: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.6.wat:1:43: error: unexpected token \"i32.load32_s\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load32_s (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:299: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.7.wat:1:43: error: unexpected token \"i32.load64\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load64 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:306: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.8.wat:1:43: error: unexpected token \"i32.load64_u\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load64_u (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:313: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.9.wat:1:43: error: unexpected token \"i32.load64_s\", expected an instr.\n  (memory 1)(func (param i32) (result i32) (i32.load64_s (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:321: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.10.wat:1:43: error: unexpected token \"i64.load64\", expected an instr.\n  (memory 1)(func (param i32) (result i64) (i64.load64 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:328: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.11.wat:1:43: error: unexpected token \"i64.load64_u\", expected an instr.\n  (memory 1)(func (param i32) (result i64) (i64.load64_u (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:335: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.12.wat:1:43: error: unexpected token \"i64.load64_s\", expected an instr.\n  (memory 1)(func (param i32) (result i64) (i64.load64_s (local.get 0)))\n                                            ^^^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:343: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.13.wat:1:43: error: unexpected token \"f32.load32\", expected an instr.\n  (memory 1)(func (param i32) (result f32) (f32.load32 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:350: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.14.wat:1:43: error: unexpected token \"f32.load64\", expected an instr.\n  (memory 1)(func (param i32) (result f32) (f32.load64 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:358: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.15.wat:1:43: error: unexpected token \"f64.load32\", expected an instr.\n  (memory 1)(func (param i32) (result f64) (f64.load32 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:365: assert_malformed passed:\n  out/test/spec/multi-memory/load/load.16.wat:1:43: error: unexpected token \"f64.load64\", expected an instr.\n  (memory 1)(func (param i32) (result f64) (f64.load64 (local.get 0)))\n                                            ^^^^^^^^^^\nout/test/spec/multi-memory/load.wast:376: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.17.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:380: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.18.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:384: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.19.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:388: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.20.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:392: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.21.wasm:0000022: error: type mismatch at end of function, expected [] but got [i32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:396: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.22.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:400: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.23.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:404: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.24.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:408: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.25.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:412: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.26.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:416: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.27.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:420: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.28.wasm:0000022: error: type mismatch at end of function, expected [] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:424: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.29.wasm:0000022: error: type mismatch at end of function, expected [] but got [f32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:428: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.30.wasm:0000022: error: type mismatch at end of function, expected [] but got [f64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/load.wast:435: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.31.wasm:0000025: error: type mismatch in i32.load, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:436: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.32.wasm:0000025: error: type mismatch in i32.load8_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:437: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.33.wasm:0000025: error: type mismatch in i32.load8_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:438: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.34.wasm:0000025: error: type mismatch in i32.load16_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:439: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.35.wasm:0000025: error: type mismatch in i32.load16_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:440: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.36.wasm:0000025: error: type mismatch in i64.load, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:441: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.37.wasm:0000025: error: type mismatch in i64.load8_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:442: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.38.wasm:0000025: error: type mismatch in i64.load8_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:443: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.39.wasm:0000025: error: type mismatch in i64.load16_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:444: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.40.wasm:0000025: error: type mismatch in i64.load16_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:445: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.41.wasm:0000025: error: type mismatch in i64.load32_s, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:446: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.42.wasm:0000025: error: type mismatch in i64.load32_u, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:447: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.43.wasm:0000025: error: type mismatch in f32.load, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:448: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.44.wasm:0000025: error: type mismatch in f64.load, expected [i32] but got [f32]\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:452: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.45.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:461: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.46.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:471: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.47.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:481: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.48.wasm:0000025: error: type mismatch in i32.load, expected [i32] but got []\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:491: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.49.wasm:0000028: error: type mismatch in i32.load, expected [i32] but got []\n  0000028: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:501: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.50.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:511: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.51.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:521: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.52.wasm:0000023: error: type mismatch in i32.load, expected [i32] but got []\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:531: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.53.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:540: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.54.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:549: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.55.wasm:0000025: error: type mismatch in i32.load, expected [i32] but got []\n  0000025: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:559: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.56.wasm:000003c: error: type mismatch in i32.load, expected [i32] but got []\n  000003c: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:576: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.57.wasm:0000021: error: type mismatch in i32.load, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:586: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.58.wasm:0000021: error: type mismatch in i32.load, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:596: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.59.wasm:0000027: error: type mismatch in i32.load, expected [i32] but got []\n  0000027: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:606: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.60.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:615: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.61.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/load.wast:624: assert_invalid passed:\n  out/test/spec/multi-memory/load/load.62.wasm:000001f: error: type mismatch in i32.load, expected [i32] but got []\n  000001f: error: OnLoadExpr callback failed\n117/117 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/load0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/load0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/load1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/load1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n17/17 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/load2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/load2.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n38/38 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory-multi.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory-multi.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n6/6 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/memory.wast:17: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.9.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/memory.wast:18: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.10.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/memory.wast:19: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.11.wasm:000000c: error: memory variable out of range: 0 (max 0)\n  000000c: error: BeginDataSegment callback failed\nout/test/spec/multi-memory/memory.wast:22: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.12.wasm:000001c: error: memory variable out of range: 0 (max 0)\n  000001c: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/memory.wast:26: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.13.wasm:0000021: error: memory variable out of range: 0 (max 0)\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/memory.wast:30: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.14.wasm:000001c: error: memory variable out of range: 0 (max 0)\n  000001c: error: OnLoadExpr callback failed\nout/test/spec/multi-memory/memory.wast:34: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.15.wasm:000001e: error: memory variable out of range: 0 (max 0)\n  000001e: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/memory.wast:38: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.16.wasm:0000019: error: memory variable out of range: 0 (max 0)\n  0000019: error: OnMemorySizeExpr callback failed\nout/test/spec/multi-memory/memory.wast:42: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.17.wasm:000001b: error: memory variable out of range: 0 (max 0)\n  000001b: error: OnMemoryGrowExpr callback failed\nout/test/spec/multi-memory/memory.wast:48: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.18.wasm:000000e: error: max pages (0) must be >= initial pages (1)\n  000000e: error: OnMemory callback failed\nout/test/spec/multi-memory/memory.wast:52: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.19.wasm:000000f: error: initial pages (65537) must be <= (65536)\n  000000f: error: OnMemory callback failed\nout/test/spec/multi-memory/memory.wast:56: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.20.wasm:0000011: error: initial pages (2147483648) must be <= (65536)\n  0000011: error: OnMemory callback failed\nout/test/spec/multi-memory/memory.wast:60: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.21.wasm:0000011: error: initial pages (4294967295) must be <= (65536)\n  0000011: error: OnMemory callback failed\nout/test/spec/multi-memory/memory.wast:64: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.22.wasm:0000010: error: max pages (65537) must be <= (65536)\n  0000010: error: OnMemory callback failed\nout/test/spec/multi-memory/memory.wast:68: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.23.wasm:0000012: error: max pages (2147483648) must be <= (65536)\n  0000012: error: OnMemory callback failed\nout/test/spec/multi-memory/memory.wast:72: assert_invalid passed:\n  out/test/spec/multi-memory/memory/memory.24.wasm:0000012: error: max pages (4294967295) must be <= (65536)\n  0000012: error: OnMemory callback failed\nout/test/spec/multi-memory/memory.wast:77: assert_malformed passed:\n  out/test/spec/multi-memory/memory/memory.25.wat:1:9: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000)\n          ^^^^^^^^^^^^^\nout/test/spec/multi-memory/memory.wast:81: assert_malformed passed:\n  out/test/spec/multi-memory/memory/memory.26.wat:1:9: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000 0x1_0000_0000)\n          ^^^^^^^^^^^^^\n  out/test/spec/multi-memory/memory/memory.26.wat:1:23: error: invalid int \"0x1_0000_0000\"\n  (memory 0x1_0000_0000 0x1_0000_0000)\n                        ^^^^^^^^^^^^^\nout/test/spec/multi-memory/memory.wast:85: assert_malformed passed:\n  out/test/spec/multi-memory/memory/memory.27.wat:1:11: error: invalid int \"0x1_0000_0000\"\n  (memory 0 0x1_0000_0000)\n            ^^^^^^^^^^^^^\nout/test/spec/multi-memory/memory.wast:228: assert_malformed passed:\n  out/test/spec/multi-memory/memory/memory.29.wat:1:17: error: redefinition of memory \"$foo\"\n  (memory $foo 1)(memory $foo 1)\n                  ^^^^^^\nout/test/spec/multi-memory/memory.wast:232: assert_malformed passed:\n  out/test/spec/multi-memory/memory/memory.30.wat:1:32: error: redefinition of memory \"$foo\"\n  (import \"\" \"\" (memory $foo 1))(memory $foo 1)\n                                 ^^^^^^\nout/test/spec/multi-memory/memory.wast:236: assert_malformed passed:\n  out/test/spec/multi-memory/memory/memory.31.wat:1:32: error: redefinition of memory \"$foo\"\n  (import \"\" \"\" (memory $foo 1))(import \"\" \"\" (memory $foo 1))\n                                 ^^^^^^\n86/86 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_copy0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_copy0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\ncopy(i32:10, i32:0, i32:4) =>\ncopy(i32:8, i32:10, i32:4) =>\ncopy(i32:10, i32:7, i32:6) =>\ncopy(i32:65280, i32:0, i32:256) =>\ncopy(i32:65024, i32:65280, i32:256) =>\ncopy(i32:65536, i32:0, i32:0) =>\ncopy(i32:0, i32:65536, i32:0) =>\nout/test/spec/multi-memory/memory_copy0.wast:56: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/multi-memory/memory_copy0.wast:58: assert_trap passed: out of bounds memory access: memory.copy out of bound\n29/29 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_copy1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_copy1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\ncopy(i32:10, i32:0, i32:4) =>\ncopy(i32:65280, i32:0, i32:256) =>\ncopy(i32:65024, i32:65280, i32:256) =>\ncopy(i32:65536, i32:0, i32:0) =>\ncopy(i32:0, i32:65536, i32:0) =>\nout/test/spec/multi-memory/memory_copy1.wast:37: assert_trap passed: out of bounds memory access: memory.copy out of bound\nout/test/spec/multi-memory/memory_copy1.wast:39: assert_trap passed: out of bounds memory access: memory.copy out of bound\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_fill0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_fill0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nfill(i32:1, i32:255, i32:3) =>\nfill(i32:0, i32:48042, i32:2) =>\nfill(i32:0, i32:0, i32:65536) =>\nout/test/spec/multi-memory/memory_fill0.wast:34: assert_trap passed: out of bounds memory access: memory.fill out of bounds\nfill(i32:65536, i32:0, i32:0) =>\nout/test/spec/multi-memory/memory_fill0.wast:43: assert_trap passed: out of bounds memory access: memory.fill out of bounds\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_grow.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_grow.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/memory_grow.wast:86: assert_trap passed: out of bounds memory access: access at 0+4 >= max value 0\nout/test/spec/multi-memory/memory_grow.wast:87: assert_trap passed: out of bounds memory access: access at 0+4 >= max value 0\nout/test/spec/multi-memory/memory_grow.wast:88: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 0\nout/test/spec/multi-memory/memory_grow.wast:89: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 0\nout/test/spec/multi-memory/memory_grow.wast:95: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_grow.wast:96: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_grow.wast:376: assert_trap passed: undefined table index\nout/test/spec/multi-memory/memory_grow.wast:451: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.11.wasm:0000024: error: type mismatch in memory.grow, expected [i32] but got [f32]\n  0000024: error: OnMemoryGrowExpr callback failed\nout/test/spec/multi-memory/memory_grow.wast:460: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.12.wasm:000001f: error: type mismatch in memory.grow, expected [i32] but got []\n  000001f: error: OnMemoryGrowExpr callback failed\nout/test/spec/multi-memory/memory_grow.wast:469: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.13.wasm:0000023: error: type mismatch in memory.grow, expected [i32] but got []\n  0000023: error: OnMemoryGrowExpr callback failed\nout/test/spec/multi-memory/memory_grow.wast:479: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.14.wasm:0000023: error: type mismatch in memory.grow, expected [i32] but got []\n  0000023: error: OnMemoryGrowExpr callback failed\nout/test/spec/multi-memory/memory_grow.wast:489: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.15.wasm:0000025: error: type mismatch in memory.grow, expected [i32] but got []\n  0000025: error: OnMemoryGrowExpr callback failed\nout/test/spec/multi-memory/memory_grow.wast:500: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.16.wasm:0000021: error: type mismatch at end of function, expected [] but got [i32]\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/memory_grow.wast:509: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.17.wasm:0000024: error: type mismatch in memory.grow, expected [i32] but got [f32]\n  0000024: error: OnMemoryGrowExpr callback failed\nout/test/spec/multi-memory/memory_grow.wast:519: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.18.wasm:0000021: error: type mismatch at end of function, expected [] but got [i32]\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/memory_grow.wast:528: assert_invalid passed:\n  out/test/spec/multi-memory/memory_grow/memory_grow.19.wasm:0000022: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000022: error: EndFunctionBody callback failed\n154/154 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_init0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_init0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\ninit(i32:0, i32:1, i32:2) =>\ninit(i32:65532, i32:0, i32:4) =>\nout/test/spec/multi-memory/memory_init0.wast:28: assert_trap passed: out of bounds memory access: memory.init out of bounds\ninit(i32:65536, i32:0, i32:0) =>\ninit(i32:0, i32:4, i32:0) =>\nout/test/spec/multi-memory/memory_init0.wast:38: assert_trap passed: out of bounds memory access: memory.init out of bounds\nout/test/spec/multi-memory/memory_init0.wast:40: assert_trap passed: out of bounds memory access: memory.init out of bounds\n13/13 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_size.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/memory_size.wast:95: assert_invalid passed:\n  out/test/spec/multi-memory/memory_size/memory_size.6.wasm:000001f: error: type mismatch at end of function, expected [] but got [i32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/memory_size.wast:104: assert_invalid passed:\n  out/test/spec/multi-memory/memory_size/memory_size.7.wasm:0000020: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000020: error: EndFunctionBody callback failed\n48/48 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_size0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_size1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n15/15 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_size2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size2.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n21/21 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_size3.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size3.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/memory_size3.wast:4: assert_invalid passed:\n  out/test/spec/multi-memory/memory_size3/memory_size3.0.wasm:0000023: error: type mismatch at end of function, expected [] but got [i32]\n  0000023: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/memory_size3.wast:15: assert_invalid passed:\n  out/test/spec/multi-memory/memory_size3/memory_size3.1.wasm:0000026: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000026: error: EndFunctionBody callback failed\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_trap0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_trap0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/memory_trap0.wast:25: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:26: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:27: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:28: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:29: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:30: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:31: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:32: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:33: assert_trap passed: out of bounds memory access: access at 2147549184+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap0.wast:34: assert_trap passed: out of bounds memory access: access at 2147549184+4 >= max value 65536\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/memory_trap1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_trap1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/memory_trap1.wast:79: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:80: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:81: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:82: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:83: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:84: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:85: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:86: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:87: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:88: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:89: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:90: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:91: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:92: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:93: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:94: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:95: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:96: assert_trap passed: out of bounds memory access: access at 4294967294+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:97: assert_trap passed: out of bounds memory access: access at 4294967293+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:98: assert_trap passed: out of bounds memory access: access at 4294967292+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:99: assert_trap passed: out of bounds memory access: access at 4294967291+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:100: assert_trap passed: out of bounds memory access: access at 4294967290+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:101: assert_trap passed: out of bounds memory access: access at 4294967289+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:102: assert_trap passed: out of bounds memory access: access at 4294967288+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:103: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:104: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:105: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:106: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:107: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:108: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:109: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:110: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:111: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:112: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:113: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:114: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:115: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:116: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:117: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:118: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:119: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:120: assert_trap passed: out of bounds memory access: access at 4294967294+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:121: assert_trap passed: out of bounds memory access: access at 4294967293+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:122: assert_trap passed: out of bounds memory access: access at 4294967292+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:123: assert_trap passed: out of bounds memory access: access at 4294967291+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:124: assert_trap passed: out of bounds memory access: access at 4294967290+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:125: assert_trap passed: out of bounds memory access: access at 4294967289+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:126: assert_trap passed: out of bounds memory access: access at 4294967288+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:127: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:128: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:129: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:130: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:131: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:132: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:133: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:134: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:135: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:136: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:137: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:138: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:139: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:140: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:141: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:142: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:143: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:144: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:145: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:146: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:147: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:148: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:149: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:150: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:151: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:152: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:153: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:154: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:155: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:156: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:157: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:158: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:159: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:160: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:161: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:162: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:163: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:164: assert_trap passed: out of bounds memory access: access at 4294967294+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:165: assert_trap passed: out of bounds memory access: access at 4294967293+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:166: assert_trap passed: out of bounds memory access: access at 4294967292+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:167: assert_trap passed: out of bounds memory access: access at 4294967291+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:168: assert_trap passed: out of bounds memory access: access at 4294967290+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:169: assert_trap passed: out of bounds memory access: access at 4294967289+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:170: assert_trap passed: out of bounds memory access: access at 4294967288+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:171: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:172: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:173: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:174: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:175: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:176: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:177: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:178: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:179: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:180: assert_trap passed: out of bounds memory access: access at 65535+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:181: assert_trap passed: out of bounds memory access: access at 65534+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:182: assert_trap passed: out of bounds memory access: access at 65533+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:183: assert_trap passed: out of bounds memory access: access at 65532+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:184: assert_trap passed: out of bounds memory access: access at 65531+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:185: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:186: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:187: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:188: assert_trap passed: out of bounds memory access: access at 4294967294+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:189: assert_trap passed: out of bounds memory access: access at 4294967293+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:190: assert_trap passed: out of bounds memory access: access at 4294967292+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:191: assert_trap passed: out of bounds memory access: access at 4294967291+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:192: assert_trap passed: out of bounds memory access: access at 4294967290+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:193: assert_trap passed: out of bounds memory access: access at 4294967289+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:194: assert_trap passed: out of bounds memory access: access at 4294967288+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:195: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:196: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:197: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:198: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:199: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:200: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:201: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:202: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:203: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:204: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:205: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:206: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:207: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:208: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:209: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:210: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:211: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:212: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:213: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:214: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:215: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:216: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:217: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:218: assert_trap passed: out of bounds memory access: access at 4294967294+2 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:219: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:220: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:221: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:222: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:223: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:224: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:225: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:226: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:227: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:228: assert_trap passed: out of bounds memory access: access at 65535+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:229: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:230: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:231: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:232: assert_trap passed: out of bounds memory access: access at 4294967294+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:233: assert_trap passed: out of bounds memory access: access at 4294967293+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:234: assert_trap passed: out of bounds memory access: access at 4294967292+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:243: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:245: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:247: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/multi-memory/memory_trap1.wast:249: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\n168/168 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/simd_memory-multi.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/simd_memory-multi.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/start0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/start0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\ninc() =>\ninc() =>\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/store.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/store.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nstore1(i32:0, i64:1) =>\nstore2(i32:0, i64:2) =>\nstore(i32:0, i64:1) =>\nstore(i32:0, i64:2) =>\nstore1(i32:0, i64:1) =>\nstore2(i32:0, i64:2) =>\ncopy-1-to-2() =>\ncopy-2-to-1() =>\nout/test/spec/multi-memory/store.wast:206: assert_malformed passed:\n  out/test/spec/multi-memory/store/store.7.wat:1:30: error: unexpected token \"i32.store32\", expected an instr.\n  (memory 1)(func (param i32) (i32.store32 (local.get 0) (i32.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/multi-memory/store.wast:213: assert_malformed passed:\n  out/test/spec/multi-memory/store/store.8.wat:1:30: error: unexpected token \"i32.store64\", expected an instr.\n  (memory 1)(func (param i32) (i32.store64 (local.get 0) (i64.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/multi-memory/store.wast:221: assert_malformed passed:\n  out/test/spec/multi-memory/store/store.9.wat:1:30: error: unexpected token \"i64.store64\", expected an instr.\n  (memory 1)(func (param i32) (i64.store64 (local.get 0) (i64.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/multi-memory/store.wast:229: assert_malformed passed:\n  out/test/spec/multi-memory/store/store.10.wat:1:30: error: unexpected token \"f32.store32\", expected an instr.\n  (memory 1)(func (param i32) (f32.store32 (local.get 0) (f32.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/multi-memory/store.wast:236: assert_malformed passed:\n  out/test/spec/multi-memory/store/store.11.wat:1:30: error: unexpected token \"f32.store64\", expected an instr.\n  (memory 1)(func (param i32) (f32.store64 (local.get 0) (f64.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/multi-memory/store.wast:244: assert_malformed passed:\n  out/test/spec/multi-memory/store/store.12.wat:1:30: error: unexpected token \"f64.store32\", expected an instr.\n  (memory 1)(func (param i32) (f64.store32 (local.get 0) (f32.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/multi-memory/store.wast:251: assert_malformed passed:\n  out/test/spec/multi-memory/store/store.13.wat:1:30: error: unexpected token \"f64.store64\", expected an instr.\n  (memory 1)(func (param i32) (f64.store64 (local.get 0) (f64.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/multi-memory/store.wast:260: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.14.wasm:0000026: error: type mismatch in implicit return, expected [i32] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:264: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.15.wasm:0000026: error: type mismatch in implicit return, expected [i64] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:268: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.16.wasm:0000029: error: type mismatch in implicit return, expected [f32] but got []\n  0000029: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:272: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.17.wasm:000002d: error: type mismatch in implicit return, expected [f64] but got []\n  000002d: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:276: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.18.wasm:0000026: error: type mismatch in implicit return, expected [i32] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:280: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.19.wasm:0000026: error: type mismatch in implicit return, expected [i32] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:284: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.20.wasm:0000026: error: type mismatch in implicit return, expected [i64] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:288: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.21.wasm:0000026: error: type mismatch in implicit return, expected [i64] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:292: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.22.wasm:0000026: error: type mismatch in implicit return, expected [i64] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/multi-memory/store.wast:298: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.23.wasm:000001f: error: type mismatch in i32.store, expected [i32, i32] but got []\n  000001f: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:307: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.24.wasm:0000021: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:316: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.25.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:326: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.26.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:336: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.27.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:346: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.28.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:356: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.29.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:366: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.30.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:376: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.31.wasm:0000028: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000028: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:386: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.32.wasm:0000028: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000028: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:396: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.33.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:406: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.34.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:416: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.35.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:426: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.36.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:436: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.37.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:446: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.38.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:456: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.39.wasm:000001f: error: type mismatch in i32.store, expected [i32, i32] but got []\n  000001f: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:465: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.40.wasm:0000021: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:474: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.41.wasm:000001f: error: type mismatch in i32.store, expected [i32, i32] but got []\n  000001f: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:483: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.42.wasm:0000021: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:492: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.43.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:502: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.44.wasm:0000027: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000027: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:512: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.45.wasm:000003c: error: type mismatch in i32.store, expected [i32, i32] but got []\n  000003c: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:528: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.46.wasm:000003e: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  000003e: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:547: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.47.wasm:0000026: error: type mismatch in i32.store, expected [i32, i32] but got [f32, i32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:548: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.48.wasm:0000026: error: type mismatch in i32.store8, expected [i32, i32] but got [f32, i32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:549: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.49.wasm:0000026: error: type mismatch in i32.store16, expected [i32, i32] but got [f32, i32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:550: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.50.wasm:0000026: error: type mismatch in i64.store, expected [i32, i64] but got [f32, i32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:551: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.51.wasm:0000026: error: type mismatch in i64.store8, expected [i32, i64] but got [f32, i64]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:552: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.52.wasm:0000026: error: type mismatch in i64.store16, expected [i32, i64] but got [f32, i64]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:553: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.53.wasm:0000026: error: type mismatch in i64.store32, expected [i32, i64] but got [f32, i64]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:554: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.54.wasm:0000029: error: type mismatch in f32.store, expected [i32, f32] but got [f32, f32]\n  0000029: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:555: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.55.wasm:000002d: error: type mismatch in f64.store, expected [i32, f64] but got [f32, f64]\n  000002d: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:557: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.56.wasm:0000026: error: type mismatch in i32.store, expected [i32, i32] but got [i32, f32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:558: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.57.wasm:0000026: error: type mismatch in i32.store8, expected [i32, i32] but got [i32, f32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:559: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.58.wasm:0000026: error: type mismatch in i32.store16, expected [i32, i32] but got [i32, f32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:560: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.59.wasm:0000026: error: type mismatch in i64.store, expected [i32, i64] but got [i32, f32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:561: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.60.wasm:000002a: error: type mismatch in i64.store8, expected [i32, i64] but got [i32, f64]\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:562: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.61.wasm:000002a: error: type mismatch in i64.store16, expected [i32, i64] but got [i32, f64]\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:563: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.62.wasm:000002a: error: type mismatch in i64.store32, expected [i32, i64] but got [i32, f64]\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:564: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.63.wasm:0000023: error: type mismatch in f32.store, expected [i32, f32] but got [i32, i32]\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/multi-memory/store.wast:565: assert_invalid passed:\n  out/test/spec/multi-memory/store/store.64.wasm:0000023: error: type mismatch in f64.store, expected [i32, f64] but got [i32, i64]\n  0000023: error: OnStoreExpr callback failed\n108/108 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/store0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/store0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nstore1(i32:0, i64:1) =>\nstore2(i32:0, i64:2) =>\n5/5 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/store1.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/store1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nstore(i32:0, i64:1) =>\nstore(i32:0, i64:2) =>\nstore1(i32:0, i64:1) =>\nstore2(i32:0, i64:2) =>\n11/11 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/multi-memory/traps0.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/traps0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\nout/test/spec/multi-memory/traps0.wast:22: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:23: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:24: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:25: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:26: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:27: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:28: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:29: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:30: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:31: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:32: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:33: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:34: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/multi-memory/traps0.wast:35: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\n15/15 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/names.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/names.wast\n(;; STDOUT ;;;\ncalled host spectest.print_i32(i32:42) =>\ncalled host spectest.print_i32(i32:123) =>\n486/486 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/nop.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/nop.wast\n(;; STDOUT ;;;\nout/test/spec/nop.wast:412: assert_invalid passed:\n  out/test/spec/nop/nop.1.wasm:000001a: error: type mismatch in implicit return, expected [i32] but got []\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/nop.wast:416: assert_invalid passed:\n  out/test/spec/nop/nop.2.wasm:000001a: error: type mismatch in implicit return, expected [i64] but got []\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/nop.wast:420: assert_invalid passed:\n  out/test/spec/nop/nop.3.wasm:000001a: error: type mismatch in implicit return, expected [f32] but got []\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/nop.wast:424: assert_invalid passed:\n  out/test/spec/nop/nop.4.wasm:000001a: error: type mismatch in implicit return, expected [f64] but got []\n  000001a: error: EndFunctionBody callback failed\n88/88 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/obsolete-keywords.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/obsolete-keywords.wast\n(;; STDOUT ;;;\nout/test/spec/obsolete-keywords.wast:3: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.0.wat:1:24: error: unexpected token \"current_memory\", expected an expr.\n  (memory 1)(func (drop (current_memory)))\n                         ^^^^^^^^^^^^^^\nout/test/spec/obsolete-keywords.wast:11: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.1.wat:1:24: error: unexpected token \"grow_memory\", expected an expr.\n  (memory 1)(func (drop (grow_memory (i32.const 0))))\n                         ^^^^^^^^^^^\n  out/test/spec/obsolete-keywords/obsolete-keywords.1.wat:1:50: error: unexpected token ), expected EOF.\n  (memory 1)(func (drop (grow_memory (i32.const 0))))\n                                                   ^\nout/test/spec/obsolete-keywords.wast:20: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.2.wat:1:29: error: unexpected token \"get_local\", expected an expr.\n  (func (local $i i32) (drop (get_local $i)))\n                              ^^^^^^^^^\nout/test/spec/obsolete-keywords.wast:27: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.3.wat:1:23: error: unexpected token \"set_local\", expected an instr.\n  (func (local $i i32) (set_local $i (i32.const 0)))\n                        ^^^^^^^^^\nout/test/spec/obsolete-keywords.wast:34: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.4.wat:1:29: error: unexpected token \"tee_local\", expected an expr.\n  (func (local $i i32) (drop (tee_local $i (i32.const 0))))\n                              ^^^^^^^^^\n  out/test/spec/obsolete-keywords/obsolete-keywords.4.wat:1:56: error: unexpected token ), expected EOF.\n  (func (local $i i32) (drop (tee_local $i (i32.const 0))))\n                                                         ^\nout/test/spec/obsolete-keywords.wast:41: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.5.wat:1:12: error: unexpected token \"anyfunc\", expected i32, i64, f32, f64, v128, externref, exnref or funcref.\n  (global $g anyfunc (ref.null func))\n             ^^^^^^^\nout/test/spec/obsolete-keywords.wast:48: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.6.wat:1:43: error: unexpected token \"get_global\", expected an expr.\n  (global $g i32 (i32.const 0))(func (drop (get_global $g)))\n                                            ^^^^^^^^^^\nout/test/spec/obsolete-keywords.wast:56: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.7.wat:1:43: error: unexpected token \"set_global\", expected an instr.\n  (global $g (mut i32) (i32.const 0))(func (set_global $g (i32.const 0)))\n                                            ^^^^^^^^^^\nout/test/spec/obsolete-keywords.wast:64: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.8.wat:1:14: error: unexpected token \"i32.wrap/i64\", expected an expr.\n  (func (drop (i32.wrap/i64 (i64.const 0))))\n               ^^^^^^^^^^^^\n  out/test/spec/obsolete-keywords/obsolete-keywords.8.wat:1:41: error: unexpected token ), expected EOF.\n  (func (drop (i32.wrap/i64 (i64.const 0))))\n                                          ^\nout/test/spec/obsolete-keywords.wast:71: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.9.wat:1:14: error: unexpected token \"i32.trunc_s:sat/f32\", expected an expr.\n  (func (drop (i32.trunc_s:sat/f32 (f32.const 0))))\n               ^^^^^^^^^^^^^^^^^^^\n  out/test/spec/obsolete-keywords/obsolete-keywords.9.wat:1:48: error: unexpected token ), expected EOF.\n  (func (drop (i32.trunc_s:sat/f32 (f32.const 0))))\n                                                 ^\nout/test/spec/obsolete-keywords.wast:78: assert_malformed passed:\n  out/test/spec/obsolete-keywords/obsolete-keywords.10.wat:1:14: error: unexpected token \"f32x4.convert_s/i32x4\", expected an expr.\n  (func (drop (f32x4.convert_s/i32x4 (v128.const i64x2 0 0))))\n               ^^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/obsolete-keywords/obsolete-keywords.10.wat:1:59: error: unexpected token ), expected EOF.\n  (func (drop (f32x4.convert_s/i32x4 (v128.const i64x2 0 0))))\n                                                            ^\n11/11 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/ref_func.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/ref_func.wast\n(;; STDOUT ;;;\nset-g() =>\nset-f() =>\nout/test/spec/ref_func.wast:69: assert_invalid passed:\n  out/test/spec/ref_func/ref_func.2.wasm:0000026: error: function variable out of range: 7 (max 2)\n  0000026: error: OnRefFuncExpr callback failed\nout/test/spec/ref_func.wast:109: assert_invalid passed:\n  out/test/spec/ref_func/ref_func.4.wasm:0000019: error: function 0 is not declared in any elem sections\n  000001b: error: EndModule callback failed\nout/test/spec/ref_func.wast:113: assert_invalid passed:\n  out/test/spec/ref_func/ref_func.5.wasm:000001c: error: function 0 is not declared in any elem sections\n  000001e: error: EndModule callback failed\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/ref_is_null.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/ref_is_null.wast\n(;; STDOUT ;;;\ninit(externref:1) =>\ndeinit() =>\nout/test/spec/ref_is_null.wast:52: assert_invalid passed:\n  out/test/spec/ref_is_null/ref_is_null.1.wasm:000001b: error: type mismatch in ref.is_null, expected [reference] but got [i32]\n  000001b: error: OnRefIsNullExpr callback failed\nout/test/spec/ref_is_null.wast:56: assert_invalid passed:\n  out/test/spec/ref_is_null/ref_is_null.2.wasm:0000018: error: type mismatch in ref.is_null, expected [reference] but got []\n  0000018: error: OnRefIsNullExpr callback failed\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/ref_null.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/ref_null.wast\n(;; STDOUT ;;;\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/relaxed-simd/i16x8_relaxed_q15mulr_s.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/relaxed-simd/i16x8_relaxed_q15mulr_s.wast\n;;; ARGS*: --enable-relaxed-simd\n(;; STDOUT ;;;\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/relaxed-simd/i32x4_relaxed_trunc.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/relaxed-simd/i32x4_relaxed_trunc.wast\n;;; ARGS*: --enable-relaxed-simd\n(;; STDOUT ;;;\n17/17 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/relaxed-simd/i8x16_relaxed_swizzle.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/relaxed-simd/i8x16_relaxed_swizzle.wast\n;;; ARGS*: --enable-relaxed-simd\n(;; STDOUT ;;;\n6/6 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/relaxed-simd/relaxed_dot_product.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/relaxed-simd/relaxed_dot_product.wast\n;;; ARGS*: --enable-relaxed-simd\n"
  },
  {
    "path": "test/spec/relaxed-simd/relaxed_laneselect.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/relaxed-simd/relaxed_laneselect.wast\n;;; ARGS*: --enable-relaxed-simd\n(;; STDOUT ;;;\n12/12 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/relaxed-simd/relaxed_madd_nmadd.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/relaxed-simd/relaxed_madd_nmadd.wast\n;;; ARGS*: --enable-relaxed-simd\n(;; STDOUT ;;;\n19/19 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/relaxed-simd/relaxed_min_max.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/relaxed-simd/relaxed_min_max.wast\n;;; ARGS*: --enable-relaxed-simd\n(;; STDOUT ;;;\n25/25 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/return.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/return.wast\n(;; STDOUT ;;;\nout/test/spec/return.wast:311: assert_invalid passed:\n  out/test/spec/return/return.1.wasm:0000019: error: type mismatch in return, expected [i32] but got []\n  0000019: error: OnReturnExpr callback failed\nout/test/spec/return.wast:315: assert_invalid passed:\n  out/test/spec/return/return.2.wasm:000001d: error: type mismatch in return, expected [i32] but got []\n  000001d: error: OnReturnExpr callback failed\nout/test/spec/return.wast:324: assert_invalid passed:\n  out/test/spec/return/return.3.wasm:000001d: error: type mismatch in return, expected [i32] but got []\n  000001d: error: OnReturnExpr callback failed\nout/test/spec/return.wast:333: assert_invalid passed:\n  out/test/spec/return/return.4.wasm:000001f: error: type mismatch in return, expected [i32] but got []\n  000001f: error: OnReturnExpr callback failed\nout/test/spec/return.wast:342: assert_invalid passed:\n  out/test/spec/return/return.5.wasm:0000022: error: type mismatch in return, expected [i32] but got []\n  0000022: error: OnReturnExpr callback failed\nout/test/spec/return.wast:351: assert_invalid passed:\n  out/test/spec/return/return.6.wasm:000001d: error: type mismatch in return, expected [i32] but got []\n  000001d: error: OnReturnExpr callback failed\nout/test/spec/return.wast:360: assert_invalid passed:\n  out/test/spec/return/return.7.wasm:000001d: error: type mismatch in return, expected [i32] but got []\n  000001d: error: OnReturnExpr callback failed\nout/test/spec/return.wast:369: assert_invalid passed:\n  out/test/spec/return/return.8.wasm:000001d: error: type mismatch in return, expected [i32] but got []\n  000001d: error: OnReturnExpr callback failed\nout/test/spec/return.wast:378: assert_invalid passed:\n  out/test/spec/return/return.9.wasm:0000019: error: type mismatch in return, expected [i32] but got []\n  0000019: error: OnReturnExpr callback failed\nout/test/spec/return.wast:386: assert_invalid passed:\n  out/test/spec/return/return.10.wasm:0000019: error: type mismatch in return, expected [i32] but got []\n  0000019: error: OnReturnExpr callback failed\nout/test/spec/return.wast:394: assert_invalid passed:\n  out/test/spec/return/return.11.wasm:000001f: error: type mismatch in return, expected [i32] but got []\n  000001f: error: OnReturnExpr callback failed\nout/test/spec/return.wast:403: assert_invalid passed:\n  out/test/spec/return/return.12.wasm:0000036: error: type mismatch in return, expected [i32] but got []\n  0000036: error: OnReturnExpr callback failed\nout/test/spec/return.wast:418: assert_invalid passed:\n  out/test/spec/return/return.13.wasm:000001b: error: type mismatch in return, expected [i32] but got []\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/return.wast:427: assert_invalid passed:\n  out/test/spec/return/return.14.wasm:000001b: error: type mismatch in return, expected [i32] but got []\n  000001b: error: OnReturnExpr callback failed\nout/test/spec/return.wast:436: assert_invalid passed:\n  out/test/spec/return/return.15.wasm:0000021: error: type mismatch in return, expected [i32] but got []\n  0000021: error: OnReturnExpr callback failed\nout/test/spec/return.wast:445: assert_invalid passed:\n  out/test/spec/return/return.16.wasm:000001e: error: type mismatch in return, expected [i32] but got []\n  000001e: error: OnReturnExpr callback failed\nout/test/spec/return.wast:454: assert_invalid passed:\n  out/test/spec/return/return.17.wasm:000001e: error: type mismatch in return, expected [i32] but got []\n  000001e: error: OnReturnExpr callback failed\nout/test/spec/return.wast:463: assert_invalid passed:\n  out/test/spec/return/return.18.wasm:000001e: error: type mismatch in return, expected [i32] but got []\n  000001e: error: OnReturnExpr callback failed\nout/test/spec/return.wast:472: assert_invalid passed:\n  out/test/spec/return/return.19.wasm:000001a: error: type mismatch in return, expected [f64] but got []\n  000001a: error: OnReturnExpr callback failed\nout/test/spec/return.wast:476: assert_invalid passed:\n  out/test/spec/return/return.20.wasm:000001b: error: type mismatch in return, expected [f64] but got [i64]\n  000001b: error: OnReturnExpr callback failed\n84/84 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/select.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/select.wast\n(;; STDOUT ;;;\nout/test/spec/select.wast:278: assert_trap passed: undefined table index\nout/test/spec/select.wast:279: assert_trap passed: undefined table index\nout/test/spec/select.wast:320: assert_invalid passed:\n  out/test/spec/select/select.1.wasm:000001c: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  000001c: error: OnSelectExpr callback failed\nout/test/spec/select.wast:324: assert_invalid passed:\n  out/test/spec/select/select.2.wasm:000001c: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  000001c: error: OnSelectExpr callback failed\nout/test/spec/select.wast:328: assert_invalid passed:\n  out/test/spec/select/select.3.wasm:0000027: error: invalid arity in select instruction: 2.\n  0000027: error: OnSelectExpr callback failed\nout/test/spec/select.wast:340: assert_invalid passed:\n  out/test/spec/select/select.4.wasm:000001f: error: type mismatch in select, expected [any, any, i32] but got [externref, externref, i32]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/select.wast:347: assert_invalid passed:\n  out/test/spec/select/select.5.wasm:000001e: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, i32]\n  000001e: error: OnSelectExpr callback failed\nout/test/spec/select.wast:353: assert_invalid passed:\n  out/test/spec/select/select.6.wasm:0000021: error: type mismatch in select, expected [f32, f32, i32] but got [i32, f32, i32]\n  0000021: error: OnSelectExpr callback failed\nout/test/spec/select.wast:359: assert_invalid passed:\n  out/test/spec/select/select.7.wasm:0000025: error: type mismatch in select, expected [f64, f64, i32] but got [i32, f64, i32]\n  0000025: error: OnSelectExpr callback failed\nout/test/spec/select.wast:366: assert_invalid passed:\n  out/test/spec/select/select.8.wasm:000001e: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, i32]\n  000001e: error: OnSelectExpr callback failed\nout/test/spec/select.wast:370: assert_invalid passed:\n  out/test/spec/select/select.9.wasm:0000021: error: type mismatch in select, expected [f32, f32, i32] but got [i32, f32, i32]\n  0000021: error: OnSelectExpr callback failed\nout/test/spec/select.wast:374: assert_invalid passed:\n  out/test/spec/select/select.10.wasm:000001e: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, i32]\n  000001e: error: OnSelectExpr callback failed\nout/test/spec/select.wast:378: assert_invalid passed:\n  out/test/spec/select/select.11.wasm:0000021: error: type mismatch in select, expected [f32, f32, i32] but got [i32, f32, i32]\n  0000021: error: OnSelectExpr callback failed\nout/test/spec/select.wast:382: assert_invalid passed:\n  out/test/spec/select/select.12.wasm:0000025: error: type mismatch in select, expected [f64, f64, i32] but got [i32, f64, i32]\n  0000025: error: OnSelectExpr callback failed\nout/test/spec/select.wast:388: assert_invalid passed:\n  out/test/spec/select/select.13.wasm:0000018: error: type mismatch in select, expected [any, any, i32] but got []\n  0000018: error: OnSelectExpr callback failed\nout/test/spec/select.wast:396: assert_invalid passed:\n  out/test/spec/select/select.14.wasm:000001a: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  000001a: error: OnSelectExpr callback failed\nout/test/spec/select.wast:404: assert_invalid passed:\n  out/test/spec/select/select.15.wasm:000001c: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32]\n  000001c: error: OnSelectExpr callback failed\nout/test/spec/select.wast:412: assert_invalid passed:\n  out/test/spec/select/select.16.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got []\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:421: assert_invalid passed:\n  out/test/spec/select/select.17.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:430: assert_invalid passed:\n  out/test/spec/select/select.18.wasm:0000020: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:439: assert_invalid passed:\n  out/test/spec/select/select.19.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got []\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:448: assert_invalid passed:\n  out/test/spec/select/select.20.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:457: assert_invalid passed:\n  out/test/spec/select/select.21.wasm:0000020: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:466: assert_invalid passed:\n  out/test/spec/select/select.22.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got []\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:475: assert_invalid passed:\n  out/test/spec/select/select.23.wasm:0000020: error: type mismatch in select, expected [any, any, i32] but got [i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:484: assert_invalid passed:\n  out/test/spec/select/select.24.wasm:0000020: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32]\n  0000020: error: OnSelectExpr callback failed\nout/test/spec/select.wast:496: assert_invalid passed:\n  out/test/spec/select/select.25.wasm:000001e: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32, i64]\n  000001e: error: OnSelectExpr callback failed\nout/test/spec/select.wast:500: assert_invalid passed:\n  out/test/spec/select/select.26.wasm:0000021: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000021: error: OnSelectExpr callback failed\nout/test/spec/select.wast:504: assert_invalid passed:\n  out/test/spec/select/select.27.wasm:0000025: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32, f64]\n  0000025: error: OnSelectExpr callback failed\nout/test/spec/select.wast:511: assert_invalid passed:\n  out/test/spec/select/select.28.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000020: error: EndFunctionBody callback failed\n148/148 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_address.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_address.wast\n(;; STDOUT ;;;\nout/test/spec/simd_address.wast:89: assert_trap passed: out of bounds memory access: access at 4294967296+16 >= max value 65536\nout/test/spec/simd_address.wast:90: assert_trap passed: out of bounds memory access: access at 65521+16 >= max value 65536\nout/test/spec/simd_address.wast:99: assert_trap passed: out of bounds memory access: access at 4294967296+16 >= max value 65536\nout/test/spec/simd_address.wast:100: assert_trap passed: out of bounds memory access: access at 65536+16 >= max value 65536\nout/test/spec/simd_address.wast:110: assert_trap passed: out of bounds memory access: access at 65521+16 >= max value 65536\nout/test/spec/simd_address.wast:113: assert_malformed passed:\n  out/test/spec/simd_address/simd_address.2.wat:1:35: error: unexpected token offset=-1, expected ).\n  (memory 1)(func  (drop (v128.load offset=-1 (i32.const 0))))\n                                    ^^^^^^^^^\n  out/test/spec/simd_address/simd_address.2.wat:1:60: error: unexpected token ), expected EOF.\n  (memory 1)(func  (drop (v128.load offset=-1 (i32.const 0))))\n                                                             ^\nout/test/spec/simd_address.wast:128: assert_trap passed: out of bounds memory access: access at 65521+16 >= max value 65536\nout/test/spec/simd_address.wast:131: assert_malformed passed:\n  out/test/spec/simd_address/simd_address.4.wat:1:30: error: unexpected token offset=-1, expected ).\n  (memory 1)(func  (v128.store offset=-1 (i32.const 0) (v128.const i32x4 0 0 0 ...\n                               ^^^^^^^^^\n  out/test/spec/simd_address/simd_address.4.wat:1:81: error: unexpected token ), expected EOF.\n  ...ory 1)(func  (v128.store offset=-1 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_address.wast:144: assert_malformed passed:\n  out/test/spec/simd_address/simd_address.5.wat:1:34: error: offset must be less than or equal to 0xffffffff\n  (memory 1)(func (drop (v128.load offset=4294967296 (i32.const 0))))\n                                   ^^^^^^^^^^^^^^^^^\nout/test/spec/simd_address.wast:152: assert_malformed passed:\n  out/test/spec/simd_address/simd_address.6.wat:1:29: error: offset must be less than or equal to 0xffffffff\n  (memory 1)(func (v128.store offset=4294967296 (i32.const 0) (v128.const i32x4...\n                              ^^^^^^^^^^^^^^^^^\n49/49 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_align.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_align.wast\n(;; STDOUT ;;;\nout/test/spec/simd_align.wast:54: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.44.wasm:0000022: error: alignment must not be larger than natural alignment (16)\n  0000022: error: OnLoadExpr callback failed\nout/test/spec/simd_align.wast:58: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.45.wasm:0000034: error: alignment must not be larger than natural alignment (16)\n  0000034: error: OnStoreExpr callback failed\nout/test/spec/simd_align.wast:62: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.46.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/simd_align.wast:66: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.47.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/simd_align.wast:70: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.48.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/simd_align.wast:74: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.49.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/simd_align.wast:78: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.50.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/simd_align.wast:82: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.51.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnLoadExpr callback failed\nout/test/spec/simd_align.wast:86: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.52.wasm:0000023: error: alignment must not be larger than natural alignment (1)\n  0000023: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_align.wast:90: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.53.wasm:0000023: error: alignment must not be larger than natural alignment (2)\n  0000023: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_align.wast:94: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.54.wasm:0000023: error: alignment must not be larger than natural alignment (4)\n  0000023: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_align.wast:98: assert_invalid passed:\n  out/test/spec/simd_align/simd_align.55.wasm:0000023: error: alignment must not be larger than natural alignment (8)\n  0000023: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_align.wast:105: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.56.wat:1:35: error: unexpected token align=-1, expected ).\n  (memory 1) (func (drop (v128.load align=-1 (i32.const 0))))\n                                    ^^^^^^^^\n  out/test/spec/simd_align/simd_align.56.wat:1:59: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (v128.load align=-1 (i32.const 0))))\n                                                            ^\nout/test/spec/simd_align.wast:111: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.57.wat:1:35: error: alignment must be power-of-two\n  (memory 1) (func (drop (v128.load align=0 (i32.const 0))))\n                                    ^^^^^^^\nout/test/spec/simd_align.wast:117: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.58.wat:1:35: error: alignment must be power-of-two\n  (memory 1) (func (drop (v128.load align=7 (i32.const 0))))\n                                    ^^^^^^^\nout/test/spec/simd_align.wast:123: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.59.wat:1:30: error: unexpected token align=-1, expected ).\n  (memory 1) (func (v128.store align=-1 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                               ^^^^^^^^\n  out/test/spec/simd_align/simd_align.59.wat:1:80: error: unexpected token ), expected EOF.\n  (memory 1) (func (v128.store align=-1 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_align.wast:129: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.60.wat:1:30: error: alignment must be power-of-two\n  (memory 0) (func (v128.store align=0 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                               ^^^^^^^\nout/test/spec/simd_align.wast:135: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.61.wat:1:30: error: alignment must be power-of-two\n  (memory 0) (func (v128.store align=7 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                               ^^^^^^^\nout/test/spec/simd_align.wast:141: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.62.wat:1:48: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load8x8_s align=-1 (i32.const 0)))\n                                                 ^^^^^^^^\n  out/test/spec/simd_align/simd_align.62.wat:1:71: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load8x8_s align=-1 (i32.const 0)))\n                                                                        ^\nout/test/spec/simd_align.wast:147: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.63.wat:1:48: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load8x8_s align=0 (i32.const 0)))\n                                                 ^^^^^^^\nout/test/spec/simd_align.wast:153: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.64.wat:1:48: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load8x8_s align=7 (i32.const 0)))\n                                                 ^^^^^^^\nout/test/spec/simd_align.wast:159: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.65.wat:1:48: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load8x8_u align=-1 (i32.const 0)))\n                                                 ^^^^^^^^\n  out/test/spec/simd_align/simd_align.65.wat:1:71: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load8x8_u align=-1 (i32.const 0)))\n                                                                        ^\nout/test/spec/simd_align.wast:165: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.66.wat:1:48: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load8x8_u align=0 (i32.const 0)))\n                                                 ^^^^^^^\nout/test/spec/simd_align.wast:171: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.67.wat:1:48: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load8x8_u align=7 (i32.const 0)))\n                                                 ^^^^^^^\nout/test/spec/simd_align.wast:177: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.68.wat:1:49: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load16x4_s align=-1 (i32.const 0)))\n                                                  ^^^^^^^^\n  out/test/spec/simd_align/simd_align.68.wat:1:72: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load16x4_s align=-1 (i32.const 0)))\n                                                                         ^\nout/test/spec/simd_align.wast:183: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.69.wat:1:49: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load16x4_s align=0 (i32.const 0)))\n                                                  ^^^^^^^\nout/test/spec/simd_align.wast:189: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.70.wat:1:49: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load16x4_s align=7 (i32.const 0)))\n                                                  ^^^^^^^\nout/test/spec/simd_align.wast:195: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.71.wat:1:49: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load16x4_u align=-1 (i32.const 0)))\n                                                  ^^^^^^^^\n  out/test/spec/simd_align/simd_align.71.wat:1:72: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load16x4_u align=-1 (i32.const 0)))\n                                                                         ^\nout/test/spec/simd_align.wast:201: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.72.wat:1:49: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load16x4_u align=0 (i32.const 0)))\n                                                  ^^^^^^^\nout/test/spec/simd_align.wast:207: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.73.wat:1:49: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load16x4_u align=7 (i32.const 0)))\n                                                  ^^^^^^^\nout/test/spec/simd_align.wast:213: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.74.wat:1:49: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load32x2_s align=-1 (i32.const 0)))\n                                                  ^^^^^^^^\n  out/test/spec/simd_align/simd_align.74.wat:1:72: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load32x2_s align=-1 (i32.const 0)))\n                                                                         ^\nout/test/spec/simd_align.wast:219: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.75.wat:1:49: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load32x2_s align=0 (i32.const 0)))\n                                                  ^^^^^^^\nout/test/spec/simd_align.wast:225: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.76.wat:1:49: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load32x2_s align=7 (i32.const 0)))\n                                                  ^^^^^^^\nout/test/spec/simd_align.wast:231: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.77.wat:1:49: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load32x2_u align=-1 (i32.const 0)))\n                                                  ^^^^^^^^\n  out/test/spec/simd_align/simd_align.77.wat:1:72: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load32x2_u align=-1 (i32.const 0)))\n                                                                         ^\nout/test/spec/simd_align.wast:237: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.78.wat:1:49: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load32x2_u align=0 (i32.const 0)))\n                                                  ^^^^^^^\nout/test/spec/simd_align.wast:243: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.79.wat:1:49: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load32x2_u align=7 (i32.const 0)))\n                                                  ^^^^^^^\nout/test/spec/simd_align.wast:249: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.80.wat:1:50: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load8_splat align=-1 (i32.const 0)))\n                                                   ^^^^^^^^\n  out/test/spec/simd_align/simd_align.80.wat:1:73: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load8_splat align=-1 (i32.const 0)))\n                                                                          ^\nout/test/spec/simd_align.wast:255: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.81.wat:1:50: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load8_splat align=0 (i32.const 0)))\n                                                   ^^^^^^^\nout/test/spec/simd_align.wast:261: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.82.wat:1:51: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load16_splat align=-1 (i32.const 0)))\n                                                    ^^^^^^^^\n  out/test/spec/simd_align/simd_align.82.wat:1:74: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load16_splat align=-1 (i32.const 0)))\n                                                                           ^\nout/test/spec/simd_align.wast:267: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.83.wat:1:51: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load16_splat align=0 (i32.const 0)))\n                                                    ^^^^^^^\nout/test/spec/simd_align.wast:273: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.84.wat:1:51: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load32_splat align=-1 (i32.const 0)))\n                                                    ^^^^^^^^\n  out/test/spec/simd_align/simd_align.84.wat:1:74: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load32_splat align=-1 (i32.const 0)))\n                                                                           ^\nout/test/spec/simd_align.wast:279: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.85.wat:1:51: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load32_splat align=0 (i32.const 0)))\n                                                    ^^^^^^^\nout/test/spec/simd_align.wast:285: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.86.wat:1:51: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load32_splat align=3 (i32.const 0)))\n                                                    ^^^^^^^\nout/test/spec/simd_align.wast:291: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.87.wat:1:51: error: unexpected token align=-1, expected ).\n  (memory 1) (func (result v128) (v128.load64_splat align=-1 (i32.const 0)))\n                                                    ^^^^^^^^\n  out/test/spec/simd_align/simd_align.87.wat:1:74: error: unexpected token ), expected EOF.\n  (memory 1) (func (result v128) (v128.load64_splat align=-1 (i32.const 0)))\n                                                                           ^\nout/test/spec/simd_align.wast:297: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.88.wat:1:51: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load64_splat align=0 (i32.const 0)))\n                                                    ^^^^^^^\nout/test/spec/simd_align.wast:303: assert_malformed passed:\n  out/test/spec/simd_align/simd_align.89.wat:1:51: error: alignment must be power-of-two\n  (memory 1) (func (result v128) (v128.load64_splat align=7 (i32.const 0)))\n                                                    ^^^^^^^\n100/100 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_bit_shift.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_bit_shift.wast\n(;; STDOUT ;;;\nout/test/spec/simd_bit_shift.wast:976: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.2.wasm:000001e: error: type mismatch in i8x16.shl, expected [v128, i32] but got [i32, i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:977: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.3.wasm:000001e: error: type mismatch in i8x16.shr_s, expected [v128, i32] but got [i32, i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:978: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.4.wasm:000001e: error: type mismatch in i8x16.shr_u, expected [v128, i32] but got [i32, i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:979: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.5.wasm:000001f: error: type mismatch in i16x8.shl, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:980: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.6.wasm:000001f: error: type mismatch in i16x8.shr_s, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:981: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.7.wasm:000001f: error: type mismatch in i16x8.shr_u, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:982: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.8.wasm:000001f: error: type mismatch in i32x4.shl, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:983: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.9.wasm:000001f: error: type mismatch in i32x4.shr_s, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:984: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.10.wasm:000001f: error: type mismatch in i32x4.shr_u, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:985: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.11.wasm:000001f: error: type mismatch in i64x2.shl, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:986: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.12.wasm:000001f: error: type mismatch in i64x2.shr_s, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:987: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.13.wasm:000001f: error: type mismatch in i64x2.shr_u, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:991: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.14.wat:1:33: error: unexpected token \"i8x16.shl_s\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.shl_s (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:992: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.15.wat:1:33: error: unexpected token \"i8x16.shl_r\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.shl_r (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:993: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.16.wat:1:33: error: unexpected token \"i8x16.shr\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.shr   (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:994: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.17.wat:1:33: error: unexpected token \"i16x8.shl_s\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.shl_s (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:995: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.18.wat:1:33: error: unexpected token \"i16x8.shl_r\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.shl_r (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:996: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.19.wat:1:33: error: unexpected token \"i16x8.shr\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.shr   (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:997: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.20.wat:1:33: error: unexpected token \"i32x4.shl_s\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.shl_s (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:998: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.21.wat:1:33: error: unexpected token \"i32x4.shl_r\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.shl_r (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:999: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.22.wat:1:33: error: unexpected token \"i32x4.shr\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.shr   (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:1000: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.23.wat:1:33: error: unexpected token \"i64x2.shl_s\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.shl_s (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:1001: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.24.wat:1:33: error: unexpected token \"i64x2.shl_r\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.shl_r (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:1002: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.25.wat:1:33: error: unexpected token \"i64x2.shr\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.shr   (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:1003: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.26.wat:1:33: error: unexpected token \"f32x4.shl\", expected an instr.\n  (memory 1) (func (result v128) (f32x4.shl   (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:1004: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.27.wat:1:33: error: unexpected token \"f32x4.shr_s\", expected an instr.\n  (memory 1) (func (result v128) (f32x4.shr_s (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:1005: assert_malformed passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.28.wat:1:33: error: unexpected token \"f32x4.shr_u\", expected an instr.\n  (memory 1) (func (result v128) (f32x4.shr_u (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_bit_shift.wast:1010: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.29.wasm:000001c: error: type mismatch in i8x16.shl, expected [v128, i32] but got [i32]\n  000001c: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1018: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.30.wasm:000002c: error: type mismatch in i8x16.shl, expected [v128, i32] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1026: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.31.wasm:000001a: error: type mismatch in i8x16.shl, expected [v128, i32] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1034: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.32.wasm:000001d: error: type mismatch in i16x8.shr_u, expected [v128, i32] but got [i32]\n  000001d: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1042: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.33.wasm:000002d: error: type mismatch in i16x8.shr_u, expected [v128, i32] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1050: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.34.wasm:000001b: error: type mismatch in i16x8.shr_u, expected [v128, i32] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1058: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.35.wasm:000001d: error: type mismatch in i32x4.shr_s, expected [v128, i32] but got [i32]\n  000001d: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1066: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.36.wasm:000002d: error: type mismatch in i32x4.shr_s, expected [v128, i32] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1074: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.37.wasm:000001b: error: type mismatch in i32x4.shr_s, expected [v128, i32] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1082: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.38.wasm:000001d: error: type mismatch in i64x2.shl, expected [v128, i32] but got [i32]\n  000001d: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1090: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.39.wasm:000002d: error: type mismatch in i64x2.shr_u, expected [v128, i32] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_bit_shift.wast:1098: assert_invalid passed:\n  out/test/spec/simd_bit_shift/simd_bit_shift.40.wasm:000001b: error: type mismatch in i64x2.shr_s, expected [v128, i32] but got []\n  000001b: error: OnBinaryExpr callback failed\n252/252 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_bitwise.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_bitwise.wast\n(;; STDOUT ;;;\nout/test/spec/simd_bitwise.wast:405: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.1.wasm:000001c: error: type mismatch in v128.not, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_bitwise.wast:407: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.2.wasm:000002e: error: type mismatch in v128.and, expected [v128, v128] but got [i32, v128]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:408: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.3.wasm:000002e: error: type mismatch in v128.and, expected [v128, v128] but got [v128, i32]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:409: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.4.wasm:000001e: error: type mismatch in v128.and, expected [v128, v128] but got [i32, i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:411: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.5.wasm:000002e: error: type mismatch in v128.or, expected [v128, v128] but got [i32, v128]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:412: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.6.wasm:000002e: error: type mismatch in v128.or, expected [v128, v128] but got [v128, i32]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:413: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.7.wasm:000001e: error: type mismatch in v128.or, expected [v128, v128] but got [i32, i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:415: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.8.wasm:000002e: error: type mismatch in v128.xor, expected [v128, v128] but got [i32, v128]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:416: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.9.wasm:000002e: error: type mismatch in v128.xor, expected [v128, v128] but got [v128, i32]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:417: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.10.wasm:000001e: error: type mismatch in v128.xor, expected [v128, v128] but got [i32, i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:419: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.11.wasm:0000040: error: type mismatch in v128.bitselect, expected [v128, v128, v128] but got [i32, v128, v128]\n  0000040: error: OnTernaryExpr callback failed\nout/test/spec/simd_bitwise.wast:420: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.12.wasm:0000040: error: type mismatch in v128.bitselect, expected [v128, v128, v128] but got [v128, v128, i32]\n  0000040: error: OnTernaryExpr callback failed\nout/test/spec/simd_bitwise.wast:421: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.13.wasm:0000020: error: type mismatch in v128.bitselect, expected [v128, v128, v128] but got [i32, i32, i32]\n  0000020: error: OnTernaryExpr callback failed\nout/test/spec/simd_bitwise.wast:423: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.14.wasm:000002e: error: type mismatch in v128.andnot, expected [v128, v128] but got [i32, v128]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:424: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.15.wasm:000002e: error: type mismatch in v128.andnot, expected [v128, v128] but got [v128, i32]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:425: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.16.wasm:000001e: error: type mismatch in v128.andnot, expected [v128, v128] but got [i32, i32]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:718: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.18.wasm:000001a: error: type mismatch in v128.not, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_bitwise.wast:726: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.19.wasm:000002c: error: type mismatch in v128.and, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:734: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.20.wasm:000001a: error: type mismatch in v128.and, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:742: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.21.wasm:000002c: error: type mismatch in v128.or, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:750: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.22.wasm:000001a: error: type mismatch in v128.or, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:758: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.23.wasm:000002c: error: type mismatch in v128.xor, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:766: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.24.wasm:000001a: error: type mismatch in v128.xor, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:774: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.25.wasm:000002c: error: type mismatch in v128.andnot, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:782: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.26.wasm:000001a: error: type mismatch in v128.andnot, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_bitwise.wast:790: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.27.wasm:000003e: error: type mismatch in v128.bitselect, expected [v128, v128, v128] but got [v128, v128]\n  000003e: error: OnTernaryExpr callback failed\nout/test/spec/simd_bitwise.wast:798: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.28.wasm:000002c: error: type mismatch in v128.bitselect, expected [v128, v128, v128] but got [v128]\n  000002c: error: OnTernaryExpr callback failed\nout/test/spec/simd_bitwise.wast:806: assert_invalid passed:\n  out/test/spec/simd_bitwise/simd_bitwise.29.wasm:000001a: error: type mismatch in v128.bitselect, expected [v128, v128, v128] but got []\n  000001a: error: OnTernaryExpr callback failed\n169/169 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_boolean.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_boolean.wast\n(;; STDOUT ;;;\nout/test/spec/simd_boolean.wast:995: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.2.wasm:000001c: error: type mismatch in v128.any_true, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:996: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.3.wasm:000001c: error: type mismatch in i8x16.all_true, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:997: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.4.wasm:000001c: error: type mismatch in v128.any_true, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:998: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.5.wasm:000001d: error: type mismatch in i16x8.all_true, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:999: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.6.wasm:000001c: error: type mismatch in v128.any_true, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:1000: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.7.wasm:000001d: error: type mismatch in i32x4.all_true, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:1004: assert_malformed passed:\n  out/test/spec/simd_boolean/simd_boolean.8.wat:1:32: error: unexpected token \"f32x4.any_true\", expected an instr.\n  (memory 1) (func (result i32) (f32x4.any_true (v128.const i32x4 0 0 0 0)))\n                                 ^^^^^^^^^^^^^^\nout/test/spec/simd_boolean.wast:1005: assert_malformed passed:\n  out/test/spec/simd_boolean/simd_boolean.9.wat:1:32: error: unexpected token \"f32x4.all_true\", expected an instr.\n  (memory 1) (func (result i32) (f32x4.all_true (v128.const i32x4 0 0 0 0)))\n                                 ^^^^^^^^^^^^^^\nout/test/spec/simd_boolean.wast:1006: assert_malformed passed:\n  out/test/spec/simd_boolean/simd_boolean.10.wat:1:32: error: unexpected token \"f64x2.any_true\", expected an instr.\n  (memory 1) (func (result i32) (f64x2.any_true (v128.const i32x4 0 0 0 0)))\n                                 ^^^^^^^^^^^^^^\nout/test/spec/simd_boolean.wast:1007: assert_malformed passed:\n  out/test/spec/simd_boolean/simd_boolean.11.wat:1:32: error: unexpected token \"f64x2.all_true\", expected an instr.\n  (memory 1) (func (result i32) (f64x2.all_true (v128.const i32x4 0 0 0 0)))\n                                 ^^^^^^^^^^^^^^\nout/test/spec/simd_boolean.wast:1012: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.12.wasm:000001a: error: type mismatch in v128.any_true, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:1020: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.13.wasm:000001a: error: type mismatch in i8x16.all_true, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:1028: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.14.wasm:000001a: error: type mismatch in v128.any_true, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:1036: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.15.wasm:000001b: error: type mismatch in i16x8.all_true, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:1044: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.16.wasm:000001a: error: type mismatch in v128.any_true, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_boolean.wast:1052: assert_invalid passed:\n  out/test/spec/simd_boolean/simd_boolean.17.wasm:000001b: error: type mismatch in i32x4.all_true, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\n277/277 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_const.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_const.wast\n(;; STDOUT ;;;\nout/test/spec/simd_const.wast:130: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.113.wat:1:25: error: invalid literal \"0x100\"\n  (func (v128.const i8x16 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100 0x100...\n                          ^^^^^\nout/test/spec/simd_const.wast:134: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.114.wat:1:25: error: invalid literal \"-0x81\"\n  (func (v128.const i8x16 -0x81 -0x81 -0x81 -0x81 -0x81 -0x81 -0x81 -0x81 -0x81...\n                          ^^^^^\nout/test/spec/simd_const.wast:138: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.115.wat:1:25: error: invalid literal \"256\"\n  (func (v128.const i8x16 256 256 256 256 256 256 256 256 256 256 256 256 256 2...\n                          ^^^\nout/test/spec/simd_const.wast:142: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.116.wat:1:25: error: invalid literal \"-129\"\n  (func (v128.const i8x16 -129 -129 -129 -129 -129 -129 -129 -129 -129 -129 -12...\n                          ^^^^\nout/test/spec/simd_const.wast:146: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.117.wat:1:25: error: invalid literal \"0x10000\"\n  (func (v128.const i16x8 0x10000 0x10000 0x10000 0x10000 0x10000 0x10000 0x100...\n                          ^^^^^^^\nout/test/spec/simd_const.wast:150: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.118.wat:1:25: error: invalid literal \"-0x8001\"\n  (func (v128.const i16x8 -0x8001 -0x8001 -0x8001 -0x8001 -0x8001 -0x8001 -0x80...\n                          ^^^^^^^\nout/test/spec/simd_const.wast:154: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.119.wat:1:25: error: invalid literal \"65536\"\n  (func (v128.const i16x8 65536 65536 65536 65536 65536 65536 65536 65536) drop)\n                          ^^^^^\nout/test/spec/simd_const.wast:158: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.120.wat:1:25: error: invalid literal \"-32769\"\n  (func (v128.const i16x8 -32769 -32769 -32769 -32769 -32769 -32769 -32769 -327...\n                          ^^^^^^\nout/test/spec/simd_const.wast:162: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.121.wat:1:26: error: invalid literal \"0x100000000\"\n  (func (v128.const i32x4  0x100000000  0x100000000  0x100000000  0x100000000) ...\n                           ^^^^^^^^^^^\nout/test/spec/simd_const.wast:166: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.122.wat:1:25: error: invalid literal \"-0x80000001\"\n  (func (v128.const i32x4 -0x80000001 -0x80000001 -0x80000001 -0x80000001) drop)\n                          ^^^^^^^^^^^\nout/test/spec/simd_const.wast:170: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.123.wat:1:26: error: invalid literal \"4294967296\"\n  (func (v128.const i32x4  4294967296  4294967296  4294967296  4294967296) drop)\n                           ^^^^^^^^^^\nout/test/spec/simd_const.wast:174: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.124.wat:1:25: error: invalid literal \"-2147483649\"\n  (func (v128.const i32x4 -2147483649 -2147483649 -2147483649 -2147483649) drop)\n                          ^^^^^^^^^^^\nout/test/spec/simd_const.wast:178: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.125.wat:1:26: error: invalid literal \"0x1p128\"\n  (func (v128.const f32x4  0x1p128  0x1p128  0x1p128  0x1p128) drop)\n                           ^^^^^^^\nout/test/spec/simd_const.wast:182: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.126.wat:1:25: error: invalid literal \"-0x1p128\"\n  (func (v128.const f32x4 -0x1p128 -0x1p128 -0x1p128 -0x1p128) drop)\n                          ^^^^^^^^\nout/test/spec/simd_const.wast:186: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.127.wat:1:26: error: invalid literal \"1e39\"\n  (func (v128.const f32x4  1e39  1e39  1e39  1e39) drop)\n                           ^^^^\nout/test/spec/simd_const.wast:190: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.128.wat:1:25: error: invalid literal \"-1e39\"\n  (func (v128.const f32x4 -1e39 -1e39 -1e39 -1e39) drop)\n                          ^^^^^\nout/test/spec/simd_const.wast:194: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.129.wat:1:26: error: invalid literal \"340282356779733661637539395458142568448\"\n  ...v128.const f32x4  340282356779733661637539395458142568448 3402823567797336...\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_const.wast:199: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.130.wat:1:25: error: invalid literal \"-340282356779733661637539395458142568448\"\n  ...v128.const f32x4 -340282356779733661637539395458142568448 -340282356779733...\n                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_const.wast:205: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.131.wat:1:25: error: invalid literal \"nan:0x80_0000\"\n  (func (v128.const f32x4 nan:0x80_0000 nan:0x80_0000 nan:0x80_0000 nan:0x80_00...\n                          ^^^^^^^^^^^^^\nout/test/spec/simd_const.wast:210: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.132.wat:1:26: error: invalid literal \"269653970229347356221791135597556535197105851288767494898376215204735891170042808140884337949150317257310688430271573696351481990334196274152701320055306275479074865864826923114368235135583993416113802762682700913456874855354834422248712838998185022412196739306217084753107265771378949821875606039276187287552\"\n  (func (v128.const f64x2  2696539702293473562217911355975565351971058512887674...\n                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_const.wast:215: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.133.wat:1:25: error: invalid literal \"-269653970229347356221791135597556535197105851288767494898376215204735891170042808140884337949150317257310688430271573696351481990334196274152701320055306275479074865864826923114368235135583993416113802762682700913456874855354834422248712838998185022412196739306217084753107265771378949821875606039276187287552\"\n  (func (v128.const f64x2 -2696539702293473562217911355975565351971058512887674...\n                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_const.wast:221: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.134.wat:1:25: error: invalid literal \"nan:0x10_0000_0000_0000\"\n  (func (v128.const f64x2 nan:0x10_0000_0000_0000 nan:0x10_0000_0000_0000) drop)\n                          ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_const.wast:227: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.135.wat:1:18: error: Unexpected type at start of simd constant. Expected one of: i8x16, i16x8, i32x4, i64x2, f32x4, f64x2. Found \")\".\n  (func (v128.const) drop)\n                   ^\nout/test/spec/simd_const.wast:232: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.136.wat:1:19: error: Unexpected type at start of simd constant. Expected one of: i8x16, i16x8, i32x4, i64x2, f32x4, f64x2. Found \"NAT\".\n  (func (v128.const 0 0 0 0) drop)\n                    ^\nout/test/spec/simd_const.wast:236: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.137.wat:1:24: error: unexpected token \")\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i8x16) drop)\n                         ^\nout/test/spec/simd_const.wast:240: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.138.wat:1:25: error: unexpected token \"0x\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:28: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:31: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:34: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                   ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:37: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                      ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:40: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                         ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:43: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                            ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:46: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                               ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:49: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                                  ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:52: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                                     ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:55: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                                        ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:58: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                                           ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:61: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                                              ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:64: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                                                 ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:67: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                                                    ^^\n  out/test/spec/simd_const/simd_const.138.wat:1:70: error: unexpected token 0x.\n  (func (v128.const i8x16 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                                                       ^^\nout/test/spec/simd_const.wast:244: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.139.wat:1:25: error: unexpected token \"1x\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:28: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:31: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:34: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                   ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:37: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                      ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:40: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                         ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:43: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                            ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:46: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                               ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:49: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                                  ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:52: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                                     ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:55: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                                        ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:58: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                                           ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:61: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                                              ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:64: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                                                 ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:67: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                                                    ^^\n  out/test/spec/simd_const/simd_const.139.wat:1:70: error: unexpected token 1x.\n  (func (v128.const i8x16 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                                                       ^^\nout/test/spec/simd_const.wast:248: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.140.wat:1:25: error: unexpected token \"0xg\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0...\n                          ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:29: error: unexpected token 0xg.\n  (func (v128.const i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0...\n                              ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:33: error: unexpected token 0xg.\n  (func (v128.const i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0...\n                                  ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:37: error: unexpected token 0xg.\n  (func (v128.const i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0...\n                                      ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:41: error: unexpected token 0xg.\n  ...c (v128.const i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0x...\n                                         ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:45: error: unexpected token 0xg.\n  ...128.const i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0x...\n                                         ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:49: error: unexpected token 0xg.\n  ...const i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0x...\n                                         ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:53: error: unexpected token 0xg.\n  ...t i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) d...\n                                         ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:57: error: unexpected token 0xg.\n  ... i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                            ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:61: error: unexpected token 0xg.\n  ... i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:65: error: unexpected token 0xg.\n  ... i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                    ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:69: error: unexpected token 0xg.\n  ... i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                        ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:73: error: unexpected token 0xg.\n  ... i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                            ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:77: error: unexpected token 0xg.\n  ... i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                                ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:81: error: unexpected token 0xg.\n  ... i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                                    ^^^\n  out/test/spec/simd_const/simd_const.140.wat:1:85: error: unexpected token 0xg.\n  ... i8x16 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                                        ^^^\nout/test/spec/simd_const.wast:253: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.141.wat:1:24: error: unexpected token \")\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i16x8) drop)\n                         ^\nout/test/spec/simd_const.wast:257: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.142.wat:1:25: error: unexpected token \"0x\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i16x8 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.142.wat:1:28: error: unexpected token 0x.\n  (func (v128.const i16x8 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.142.wat:1:31: error: unexpected token 0x.\n  (func (v128.const i16x8 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.142.wat:1:34: error: unexpected token 0x.\n  (func (v128.const i16x8 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                   ^^\n  out/test/spec/simd_const/simd_const.142.wat:1:37: error: unexpected token 0x.\n  (func (v128.const i16x8 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                      ^^\n  out/test/spec/simd_const/simd_const.142.wat:1:40: error: unexpected token 0x.\n  (func (v128.const i16x8 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                         ^^\n  out/test/spec/simd_const/simd_const.142.wat:1:43: error: unexpected token 0x.\n  (func (v128.const i16x8 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                            ^^\n  out/test/spec/simd_const/simd_const.142.wat:1:46: error: unexpected token 0x.\n  (func (v128.const i16x8 0x 0x 0x 0x 0x 0x 0x 0x) drop)\n                                               ^^\nout/test/spec/simd_const.wast:261: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.143.wat:1:25: error: unexpected token \"1x\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i16x8 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.143.wat:1:28: error: unexpected token 1x.\n  (func (v128.const i16x8 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.143.wat:1:31: error: unexpected token 1x.\n  (func (v128.const i16x8 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.143.wat:1:34: error: unexpected token 1x.\n  (func (v128.const i16x8 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                   ^^\n  out/test/spec/simd_const/simd_const.143.wat:1:37: error: unexpected token 1x.\n  (func (v128.const i16x8 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                      ^^\n  out/test/spec/simd_const/simd_const.143.wat:1:40: error: unexpected token 1x.\n  (func (v128.const i16x8 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                         ^^\n  out/test/spec/simd_const/simd_const.143.wat:1:43: error: unexpected token 1x.\n  (func (v128.const i16x8 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                            ^^\n  out/test/spec/simd_const/simd_const.143.wat:1:46: error: unexpected token 1x.\n  (func (v128.const i16x8 1x 1x 1x 1x 1x 1x 1x 1x) drop)\n                                               ^^\nout/test/spec/simd_const.wast:265: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.144.wat:1:25: error: unexpected token \"0xg\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i16x8 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.144.wat:1:29: error: unexpected token 0xg.\n  (func (v128.const i16x8 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                              ^^^\n  out/test/spec/simd_const/simd_const.144.wat:1:33: error: unexpected token 0xg.\n  (func (v128.const i16x8 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                  ^^^\n  out/test/spec/simd_const/simd_const.144.wat:1:37: error: unexpected token 0xg.\n  (func (v128.const i16x8 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                      ^^^\n  out/test/spec/simd_const/simd_const.144.wat:1:41: error: unexpected token 0xg.\n  (func (v128.const i16x8 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                          ^^^\n  out/test/spec/simd_const/simd_const.144.wat:1:45: error: unexpected token 0xg.\n  (func (v128.const i16x8 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                              ^^^\n  out/test/spec/simd_const/simd_const.144.wat:1:49: error: unexpected token 0xg.\n  (func (v128.const i16x8 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                  ^^^\n  out/test/spec/simd_const/simd_const.144.wat:1:53: error: unexpected token 0xg.\n  (func (v128.const i16x8 0xg 0xg 0xg 0xg 0xg 0xg 0xg 0xg) drop)\n                                                      ^^^\nout/test/spec/simd_const.wast:270: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.145.wat:1:24: error: unexpected token \")\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i32x4) drop)\n                         ^\nout/test/spec/simd_const.wast:274: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.146.wat:1:25: error: unexpected token \"0x\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i32x4 0x 0x 0x 0x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.146.wat:1:28: error: unexpected token 0x.\n  (func (v128.const i32x4 0x 0x 0x 0x) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.146.wat:1:31: error: unexpected token 0x.\n  (func (v128.const i32x4 0x 0x 0x 0x) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.146.wat:1:34: error: unexpected token 0x.\n  (func (v128.const i32x4 0x 0x 0x 0x) drop)\n                                   ^^\nout/test/spec/simd_const.wast:278: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.147.wat:1:25: error: unexpected token \"1x\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i32x4 1x 1x 1x 1x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.147.wat:1:28: error: unexpected token 1x.\n  (func (v128.const i32x4 1x 1x 1x 1x) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.147.wat:1:31: error: unexpected token 1x.\n  (func (v128.const i32x4 1x 1x 1x 1x) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.147.wat:1:34: error: unexpected token 1x.\n  (func (v128.const i32x4 1x 1x 1x 1x) drop)\n                                   ^^\nout/test/spec/simd_const.wast:282: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.148.wat:1:25: error: unexpected token \"0xg\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i32x4 0xg 0xg 0xg 0xg) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.148.wat:1:29: error: unexpected token 0xg.\n  (func (v128.const i32x4 0xg 0xg 0xg 0xg) drop)\n                              ^^^\n  out/test/spec/simd_const/simd_const.148.wat:1:33: error: unexpected token 0xg.\n  (func (v128.const i32x4 0xg 0xg 0xg 0xg) drop)\n                                  ^^^\n  out/test/spec/simd_const/simd_const.148.wat:1:37: error: unexpected token 0xg.\n  (func (v128.const i32x4 0xg 0xg 0xg 0xg) drop)\n                                      ^^^\nout/test/spec/simd_const.wast:287: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.149.wat:1:24: error: unexpected token \")\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i64x2) drop)\n                         ^\nout/test/spec/simd_const.wast:291: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.150.wat:1:25: error: unexpected token \"0x\", expected a Nat or Integer literal (e.g. 123).\n  (func (v128.const i64x2 0x 0x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.150.wat:1:28: error: unexpected token 0x.\n  (func (v128.const i64x2 0x 0x) drop)\n                             ^^\nout/test/spec/simd_const.wast:295: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.151.wat:1:25: error: unexpected token \"1x\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 1x 1x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.151.wat:1:28: error: unexpected token 1x.\n  (func (v128.const f64x2 1x 1x) drop)\n                             ^^\nout/test/spec/simd_const.wast:299: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.152.wat:1:25: error: unexpected token \"0xg\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0xg 0xg) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.152.wat:1:29: error: unexpected token 0xg.\n  (func (v128.const f64x2 0xg 0xg) drop)\n                              ^^^\nout/test/spec/simd_const.wast:304: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.153.wat:1:24: error: unexpected token \")\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4) drop)\n                         ^\nout/test/spec/simd_const.wast:308: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.154.wat:1:25: error: unexpected token \".0\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 .0 .0 .0 .0) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.154.wat:1:28: error: unexpected token .0.\n  (func (v128.const f32x4 .0 .0 .0 .0) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.154.wat:1:31: error: unexpected token .0.\n  (func (v128.const f32x4 .0 .0 .0 .0) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.154.wat:1:34: error: unexpected token .0.\n  (func (v128.const f32x4 .0 .0 .0 .0) drop)\n                                   ^^\nout/test/spec/simd_const.wast:312: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.155.wat:1:25: error: unexpected token \".0e0\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 .0e0 .0e0 .0e0 .0e0) drop)\n                          ^^^^\n  out/test/spec/simd_const/simd_const.155.wat:1:30: error: unexpected token .0e0.\n  (func (v128.const f32x4 .0e0 .0e0 .0e0 .0e0) drop)\n                               ^^^^\n  out/test/spec/simd_const/simd_const.155.wat:1:35: error: unexpected token .0e0.\n  (func (v128.const f32x4 .0e0 .0e0 .0e0 .0e0) drop)\n                                    ^^^^\n  out/test/spec/simd_const/simd_const.155.wat:1:40: error: unexpected token .0e0.\n  (func (v128.const f32x4 .0e0 .0e0 .0e0 .0e0) drop)\n                                         ^^^^\nout/test/spec/simd_const.wast:316: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.156.wat:1:25: error: unexpected token \"0e\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0e 0e 0e 0e) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.156.wat:1:28: error: unexpected token 0e.\n  (func (v128.const f32x4 0e 0e 0e 0e) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.156.wat:1:31: error: unexpected token 0e.\n  (func (v128.const f32x4 0e 0e 0e 0e) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.156.wat:1:34: error: unexpected token 0e.\n  (func (v128.const f32x4 0e 0e 0e 0e) drop)\n                                   ^^\nout/test/spec/simd_const.wast:320: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.157.wat:1:25: error: unexpected token \"0e+\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0e+ 0e+ 0e+ 0e+) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.157.wat:1:29: error: unexpected token 0e+.\n  (func (v128.const f32x4 0e+ 0e+ 0e+ 0e+) drop)\n                              ^^^\n  out/test/spec/simd_const/simd_const.157.wat:1:33: error: unexpected token 0e+.\n  (func (v128.const f32x4 0e+ 0e+ 0e+ 0e+) drop)\n                                  ^^^\n  out/test/spec/simd_const/simd_const.157.wat:1:37: error: unexpected token 0e+.\n  (func (v128.const f32x4 0e+ 0e+ 0e+ 0e+) drop)\n                                      ^^^\nout/test/spec/simd_const.wast:324: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.158.wat:1:25: error: unexpected token \"0.0e\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0.0e 0.0e 0.0e 0.0e) drop)\n                          ^^^^\n  out/test/spec/simd_const/simd_const.158.wat:1:30: error: unexpected token 0.0e.\n  (func (v128.const f32x4 0.0e 0.0e 0.0e 0.0e) drop)\n                               ^^^^\n  out/test/spec/simd_const/simd_const.158.wat:1:35: error: unexpected token 0.0e.\n  (func (v128.const f32x4 0.0e 0.0e 0.0e 0.0e) drop)\n                                    ^^^^\n  out/test/spec/simd_const/simd_const.158.wat:1:40: error: unexpected token 0.0e.\n  (func (v128.const f32x4 0.0e 0.0e 0.0e 0.0e) drop)\n                                         ^^^^\nout/test/spec/simd_const.wast:328: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.159.wat:1:25: error: unexpected token \"0.0e-\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0.0e- 0.0e- 0.0e- 0.0e-) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.159.wat:1:31: error: unexpected token 0.0e-.\n  (func (v128.const f32x4 0.0e- 0.0e- 0.0e- 0.0e-) drop)\n                                ^^^^^\n  out/test/spec/simd_const/simd_const.159.wat:1:37: error: unexpected token 0.0e-.\n  (func (v128.const f32x4 0.0e- 0.0e- 0.0e- 0.0e-) drop)\n                                      ^^^^^\n  out/test/spec/simd_const/simd_const.159.wat:1:43: error: unexpected token 0.0e-.\n  (func (v128.const f32x4 0.0e- 0.0e- 0.0e- 0.0e-) drop)\n                                            ^^^^^\nout/test/spec/simd_const.wast:332: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.160.wat:1:25: error: unexpected token \"0x\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x 0x 0x 0x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.160.wat:1:28: error: unexpected token 0x.\n  (func (v128.const f32x4 0x 0x 0x 0x) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.160.wat:1:31: error: unexpected token 0x.\n  (func (v128.const f32x4 0x 0x 0x 0x) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.160.wat:1:34: error: unexpected token 0x.\n  (func (v128.const f32x4 0x 0x 0x 0x) drop)\n                                   ^^\nout/test/spec/simd_const.wast:336: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.161.wat:1:25: error: unexpected token \"1x\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 1x 1x 1x 1x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.161.wat:1:28: error: unexpected token 1x.\n  (func (v128.const f32x4 1x 1x 1x 1x) drop)\n                             ^^\n  out/test/spec/simd_const/simd_const.161.wat:1:31: error: unexpected token 1x.\n  (func (v128.const f32x4 1x 1x 1x 1x) drop)\n                                ^^\n  out/test/spec/simd_const/simd_const.161.wat:1:34: error: unexpected token 1x.\n  (func (v128.const f32x4 1x 1x 1x 1x) drop)\n                                   ^^\nout/test/spec/simd_const.wast:340: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.162.wat:1:25: error: unexpected token \"0xg\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0xg 0xg 0xg 0xg) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.162.wat:1:29: error: unexpected token 0xg.\n  (func (v128.const f32x4 0xg 0xg 0xg 0xg) drop)\n                              ^^^\n  out/test/spec/simd_const/simd_const.162.wat:1:33: error: unexpected token 0xg.\n  (func (v128.const f32x4 0xg 0xg 0xg 0xg) drop)\n                                  ^^^\n  out/test/spec/simd_const/simd_const.162.wat:1:37: error: unexpected token 0xg.\n  (func (v128.const f32x4 0xg 0xg 0xg 0xg) drop)\n                                      ^^^\nout/test/spec/simd_const.wast:344: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.163.wat:1:25: error: unexpected token \"0x.\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x. 0x. 0x. 0x.) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.163.wat:1:29: error: unexpected token 0x..\n  (func (v128.const f32x4 0x. 0x. 0x. 0x.) drop)\n                              ^^^\n  out/test/spec/simd_const/simd_const.163.wat:1:33: error: unexpected token 0x..\n  (func (v128.const f32x4 0x. 0x. 0x. 0x.) drop)\n                                  ^^^\n  out/test/spec/simd_const/simd_const.163.wat:1:37: error: unexpected token 0x..\n  (func (v128.const f32x4 0x. 0x. 0x. 0x.) drop)\n                                      ^^^\nout/test/spec/simd_const.wast:348: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.164.wat:1:25: error: unexpected token \"0x0.g\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x0.g 0x0.g 0x0.g 0x0.g) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.164.wat:1:31: error: unexpected token 0x0.g.\n  (func (v128.const f32x4 0x0.g 0x0.g 0x0.g 0x0.g) drop)\n                                ^^^^^\n  out/test/spec/simd_const/simd_const.164.wat:1:37: error: unexpected token 0x0.g.\n  (func (v128.const f32x4 0x0.g 0x0.g 0x0.g 0x0.g) drop)\n                                      ^^^^^\n  out/test/spec/simd_const/simd_const.164.wat:1:43: error: unexpected token 0x0.g.\n  (func (v128.const f32x4 0x0.g 0x0.g 0x0.g 0x0.g) drop)\n                                            ^^^^^\nout/test/spec/simd_const.wast:352: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.165.wat:1:25: error: unexpected token \"0x0p\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x0p 0x0p 0x0p 0x0p) drop)\n                          ^^^^\n  out/test/spec/simd_const/simd_const.165.wat:1:30: error: unexpected token 0x0p.\n  (func (v128.const f32x4 0x0p 0x0p 0x0p 0x0p) drop)\n                               ^^^^\n  out/test/spec/simd_const/simd_const.165.wat:1:35: error: unexpected token 0x0p.\n  (func (v128.const f32x4 0x0p 0x0p 0x0p 0x0p) drop)\n                                    ^^^^\n  out/test/spec/simd_const/simd_const.165.wat:1:40: error: unexpected token 0x0p.\n  (func (v128.const f32x4 0x0p 0x0p 0x0p 0x0p) drop)\n                                         ^^^^\nout/test/spec/simd_const.wast:356: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.166.wat:1:25: error: unexpected token \"0x0p+\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x0p+ 0x0p+ 0x0p+ 0x0p+) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.166.wat:1:31: error: unexpected token 0x0p+.\n  (func (v128.const f32x4 0x0p+ 0x0p+ 0x0p+ 0x0p+) drop)\n                                ^^^^^\n  out/test/spec/simd_const/simd_const.166.wat:1:37: error: unexpected token 0x0p+.\n  (func (v128.const f32x4 0x0p+ 0x0p+ 0x0p+ 0x0p+) drop)\n                                      ^^^^^\n  out/test/spec/simd_const/simd_const.166.wat:1:43: error: unexpected token 0x0p+.\n  (func (v128.const f32x4 0x0p+ 0x0p+ 0x0p+ 0x0p+) drop)\n                                            ^^^^^\nout/test/spec/simd_const.wast:360: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.167.wat:1:25: error: unexpected token \"0x0p-\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x0p- 0x0p- 0x0p- 0x0p-) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.167.wat:1:31: error: unexpected token 0x0p-.\n  (func (v128.const f32x4 0x0p- 0x0p- 0x0p- 0x0p-) drop)\n                                ^^^^^\n  out/test/spec/simd_const/simd_const.167.wat:1:37: error: unexpected token 0x0p-.\n  (func (v128.const f32x4 0x0p- 0x0p- 0x0p- 0x0p-) drop)\n                                      ^^^^^\n  out/test/spec/simd_const/simd_const.167.wat:1:43: error: unexpected token 0x0p-.\n  (func (v128.const f32x4 0x0p- 0x0p- 0x0p- 0x0p-) drop)\n                                            ^^^^^\nout/test/spec/simd_const.wast:364: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.168.wat:1:25: error: unexpected token \"0x0.0p\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x0.0p 0x0.0p 0x0.0p 0x0.0p) drop)\n                          ^^^^^^\n  out/test/spec/simd_const/simd_const.168.wat:1:32: error: unexpected token 0x0.0p.\n  (func (v128.const f32x4 0x0.0p 0x0.0p 0x0.0p 0x0.0p) drop)\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.168.wat:1:39: error: unexpected token 0x0.0p.\n  (func (v128.const f32x4 0x0.0p 0x0.0p 0x0.0p 0x0.0p) drop)\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.168.wat:1:46: error: unexpected token 0x0.0p.\n  (func (v128.const f32x4 0x0.0p 0x0.0p 0x0.0p 0x0.0p) drop)\n                                               ^^^^^^\nout/test/spec/simd_const.wast:368: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.169.wat:1:25: error: unexpected token \"0x0.0p+\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x0.0p+ 0x0.0p+ 0x0.0p+ 0x0.0p+) drop)\n                          ^^^^^^^\n  out/test/spec/simd_const/simd_const.169.wat:1:33: error: unexpected token 0x0.0p+.\n  (func (v128.const f32x4 0x0.0p+ 0x0.0p+ 0x0.0p+ 0x0.0p+) drop)\n                                  ^^^^^^^\n  out/test/spec/simd_const/simd_const.169.wat:1:41: error: unexpected token 0x0.0p+.\n  (func (v128.const f32x4 0x0.0p+ 0x0.0p+ 0x0.0p+ 0x0.0p+) drop)\n                                          ^^^^^^^\n  out/test/spec/simd_const/simd_const.169.wat:1:49: error: unexpected token 0x0.0p+.\n  (func (v128.const f32x4 0x0.0p+ 0x0.0p+ 0x0.0p+ 0x0.0p+) drop)\n                                                  ^^^^^^^\nout/test/spec/simd_const.wast:372: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.170.wat:1:25: error: unexpected token \"0x0.0p-\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x0.0p- 0x0.0p- 0x0.0p- 0x0.0p-) drop)\n                          ^^^^^^^\n  out/test/spec/simd_const/simd_const.170.wat:1:33: error: unexpected token 0x0.0p-.\n  (func (v128.const f32x4 0x0.0p- 0x0.0p- 0x0.0p- 0x0.0p-) drop)\n                                  ^^^^^^^\n  out/test/spec/simd_const/simd_const.170.wat:1:41: error: unexpected token 0x0.0p-.\n  (func (v128.const f32x4 0x0.0p- 0x0.0p- 0x0.0p- 0x0.0p-) drop)\n                                          ^^^^^^^\n  out/test/spec/simd_const/simd_const.170.wat:1:49: error: unexpected token 0x0.0p-.\n  (func (v128.const f32x4 0x0.0p- 0x0.0p- 0x0.0p- 0x0.0p-) drop)\n                                                  ^^^^^^^\nout/test/spec/simd_const.wast:376: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.171.wat:1:25: error: unexpected token \"0x0pA\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 0x0pA 0x0pA 0x0pA 0x0pA) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.171.wat:1:31: error: unexpected token 0x0pA.\n  (func (v128.const f32x4 0x0pA 0x0pA 0x0pA 0x0pA) drop)\n                                ^^^^^\n  out/test/spec/simd_const/simd_const.171.wat:1:37: error: unexpected token 0x0pA.\n  (func (v128.const f32x4 0x0pA 0x0pA 0x0pA 0x0pA) drop)\n                                      ^^^^^\n  out/test/spec/simd_const/simd_const.171.wat:1:43: error: unexpected token 0x0pA.\n  (func (v128.const f32x4 0x0pA 0x0pA 0x0pA 0x0pA) drop)\n                                            ^^^^^\nout/test/spec/simd_const.wast:380: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.172.wat:1:25: error: unexpected token \"nan:1\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f32x4 nan:1 nan:1 nan:1 nan:1) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.172.wat:1:31: error: unexpected token nan:1.\n  (func (v128.const f32x4 nan:1 nan:1 nan:1 nan:1) drop)\n                                ^^^^^\n  out/test/spec/simd_const/simd_const.172.wat:1:37: error: unexpected token nan:1.\n  (func (v128.const f32x4 nan:1 nan:1 nan:1 nan:1) drop)\n                                      ^^^^^\n  out/test/spec/simd_const/simd_const.172.wat:1:43: error: unexpected token nan:1.\n  (func (v128.const f32x4 nan:1 nan:1 nan:1 nan:1) drop)\n                                            ^^^^^\nout/test/spec/simd_const.wast:384: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.173.wat:1:25: error: invalid literal \"nan:0x0\"\n  (func (v128.const f32x4 nan:0x0 nan:0x0 nan:0x0 nan:0x0) drop)\n                          ^^^^^^^\nout/test/spec/simd_const.wast:389: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.174.wat:1:24: error: unexpected token \")\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2) drop)\n                         ^\nout/test/spec/simd_const.wast:393: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.175.wat:1:25: error: unexpected token \".0\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 .0 .0) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.175.wat:1:28: error: unexpected token .0.\n  (func (v128.const f64x2 .0 .0) drop)\n                             ^^\nout/test/spec/simd_const.wast:397: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.176.wat:1:25: error: unexpected token \".0e0\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 .0e0 .0e0) drop)\n                          ^^^^\n  out/test/spec/simd_const/simd_const.176.wat:1:30: error: unexpected token .0e0.\n  (func (v128.const f64x2 .0e0 .0e0) drop)\n                               ^^^^\nout/test/spec/simd_const.wast:401: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.177.wat:1:25: error: unexpected token \"0e\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0e 0e) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.177.wat:1:28: error: unexpected token 0e.\n  (func (v128.const f64x2 0e 0e) drop)\n                             ^^\nout/test/spec/simd_const.wast:405: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.178.wat:1:25: error: unexpected token \"0e+\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0e+ 0e+) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.178.wat:1:29: error: unexpected token 0e+.\n  (func (v128.const f64x2 0e+ 0e+) drop)\n                              ^^^\nout/test/spec/simd_const.wast:409: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.179.wat:1:25: error: unexpected token \"0.0e+\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0.0e+ 0.0e+) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.179.wat:1:31: error: unexpected token 0.0e+.\n  (func (v128.const f64x2 0.0e+ 0.0e+) drop)\n                                ^^^^^\nout/test/spec/simd_const.wast:413: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.180.wat:1:25: error: unexpected token \"0.0e-\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0.0e- 0.0e-) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.180.wat:1:31: error: unexpected token 0.0e-.\n  (func (v128.const f64x2 0.0e- 0.0e-) drop)\n                                ^^^^^\nout/test/spec/simd_const.wast:417: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.181.wat:1:25: error: unexpected token \"0x\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x 0x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.181.wat:1:28: error: unexpected token 0x.\n  (func (v128.const f64x2 0x 0x) drop)\n                             ^^\nout/test/spec/simd_const.wast:421: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.182.wat:1:25: error: unexpected token \"1x\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 1x 1x) drop)\n                          ^^\n  out/test/spec/simd_const/simd_const.182.wat:1:28: error: unexpected token 1x.\n  (func (v128.const f64x2 1x 1x) drop)\n                             ^^\nout/test/spec/simd_const.wast:425: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.183.wat:1:25: error: unexpected token \"0xg\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0xg 0xg) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.183.wat:1:29: error: unexpected token 0xg.\n  (func (v128.const f64x2 0xg 0xg) drop)\n                              ^^^\nout/test/spec/simd_const.wast:429: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.184.wat:1:25: error: unexpected token \"0x.\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x. 0x.) drop)\n                          ^^^\n  out/test/spec/simd_const/simd_const.184.wat:1:29: error: unexpected token 0x..\n  (func (v128.const f64x2 0x. 0x.) drop)\n                              ^^^\nout/test/spec/simd_const.wast:433: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.185.wat:1:25: error: unexpected token \"0x0.g\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x0.g 0x0.g) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.185.wat:1:31: error: unexpected token 0x0.g.\n  (func (v128.const f64x2 0x0.g 0x0.g) drop)\n                                ^^^^^\nout/test/spec/simd_const.wast:437: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.186.wat:1:25: error: unexpected token \"0x0p\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x0p 0x0p) drop)\n                          ^^^^\n  out/test/spec/simd_const/simd_const.186.wat:1:30: error: unexpected token 0x0p.\n  (func (v128.const f64x2 0x0p 0x0p) drop)\n                               ^^^^\nout/test/spec/simd_const.wast:441: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.187.wat:1:25: error: unexpected token \"0x0p+\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x0p+ 0x0p+) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.187.wat:1:31: error: unexpected token 0x0p+.\n  (func (v128.const f64x2 0x0p+ 0x0p+) drop)\n                                ^^^^^\nout/test/spec/simd_const.wast:445: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.188.wat:1:25: error: unexpected token \"0x0p-\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x0p- 0x0p-) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.188.wat:1:31: error: unexpected token 0x0p-.\n  (func (v128.const f64x2 0x0p- 0x0p-) drop)\n                                ^^^^^\nout/test/spec/simd_const.wast:449: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.189.wat:1:25: error: unexpected token \"0x0.0p\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x0.0p 0x0.0p) drop)\n                          ^^^^^^\n  out/test/spec/simd_const/simd_const.189.wat:1:32: error: unexpected token 0x0.0p.\n  (func (v128.const f64x2 0x0.0p 0x0.0p) drop)\n                                 ^^^^^^\nout/test/spec/simd_const.wast:453: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.190.wat:1:25: error: unexpected token \"0x0.0p+\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x0.0p+ 0x0.0p+) drop)\n                          ^^^^^^^\n  out/test/spec/simd_const/simd_const.190.wat:1:33: error: unexpected token 0x0.0p+.\n  (func (v128.const f64x2 0x0.0p+ 0x0.0p+) drop)\n                                  ^^^^^^^\nout/test/spec/simd_const.wast:457: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.191.wat:1:25: error: unexpected token \"0x0.0p-\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x0.0p- 0x0.0p-) drop)\n                          ^^^^^^^\n  out/test/spec/simd_const/simd_const.191.wat:1:33: error: unexpected token 0x0.0p-.\n  (func (v128.const f64x2 0x0.0p- 0x0.0p-) drop)\n                                  ^^^^^^^\nout/test/spec/simd_const.wast:461: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.192.wat:1:25: error: unexpected token \"0x0pA\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 0x0pA 0x0pA) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.192.wat:1:31: error: unexpected token 0x0pA.\n  (func (v128.const f64x2 0x0pA 0x0pA) drop)\n                                ^^^^^\nout/test/spec/simd_const.wast:465: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.193.wat:1:25: error: unexpected token \"nan:1\", expected a Float literal (e.g. 42.0).\n  (func (v128.const f64x2 nan:1 nan:1) drop)\n                          ^^^^^\n  out/test/spec/simd_const/simd_const.193.wat:1:31: error: unexpected token nan:1.\n  (func (v128.const f64x2 nan:1 nan:1) drop)\n                                ^^^^^\nout/test/spec/simd_const.wast:469: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.194.wat:1:25: error: invalid literal \"nan:0x0\"\n  (func (v128.const f64x2 nan:0x0 nan:0x0) drop)\n                          ^^^^^^^\nout/test/spec/simd_const.wast:476: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.195.wat:1:25: error: invalid literal \"0x10000000000000000\"\n  (func (v128.const i32x4 0x10000000000000000 0x10000000000000000) drop)\n                          ^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_const.wast:482: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.196.wat:1:41: error: unexpected token 0x1, expected ).\n  (func (v128.const i32x4 0x1 0x1 0x1 0x1 0x1) drop)\n                                          ^^^\nout/test/spec/simd_const.wast:1131: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.389.wat:1:32: error: unexpected token \"_100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 _100 _100 _100 _100))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.389.wat:1:37: error: unexpected token _100.\n  (global v128 (v128.const i32x4 _100 _100 _100 _100))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.389.wat:1:42: error: unexpected token _100.\n  (global v128 (v128.const i32x4 _100 _100 _100 _100))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.389.wat:1:47: error: unexpected token _100.\n  (global v128 (v128.const i32x4 _100 _100 _100 _100))\n                                                ^^^^\nout/test/spec/simd_const.wast:1135: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.390.wat:1:32: error: unexpected token \"+_100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 +_100 +_100 +_100 +_100))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.390.wat:1:38: error: unexpected token +_100.\n  (global v128 (v128.const i32x4 +_100 +_100 +_100 +_100))\n                                       ^^^^^\n  out/test/spec/simd_const/simd_const.390.wat:1:44: error: unexpected token +_100.\n  (global v128 (v128.const i32x4 +_100 +_100 +_100 +_100))\n                                             ^^^^^\n  out/test/spec/simd_const/simd_const.390.wat:1:50: error: unexpected token +_100.\n  (global v128 (v128.const i32x4 +_100 +_100 +_100 +_100))\n                                                   ^^^^^\nout/test/spec/simd_const.wast:1139: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.391.wat:1:32: error: unexpected token \"-_100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 -_100 -_100 -_100 -_100))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.391.wat:1:38: error: unexpected token -_100.\n  (global v128 (v128.const i32x4 -_100 -_100 -_100 -_100))\n                                       ^^^^^\n  out/test/spec/simd_const/simd_const.391.wat:1:44: error: unexpected token -_100.\n  (global v128 (v128.const i32x4 -_100 -_100 -_100 -_100))\n                                             ^^^^^\n  out/test/spec/simd_const/simd_const.391.wat:1:50: error: unexpected token -_100.\n  (global v128 (v128.const i32x4 -_100 -_100 -_100 -_100))\n                                                   ^^^^^\nout/test/spec/simd_const.wast:1143: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.392.wat:1:32: error: unexpected token \"99_\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 99_ 99_ 99_ 99_))\n                                 ^^^\n  out/test/spec/simd_const/simd_const.392.wat:1:36: error: unexpected token 99_.\n  (global v128 (v128.const i32x4 99_ 99_ 99_ 99_))\n                                     ^^^\n  out/test/spec/simd_const/simd_const.392.wat:1:40: error: unexpected token 99_.\n  (global v128 (v128.const i32x4 99_ 99_ 99_ 99_))\n                                         ^^^\n  out/test/spec/simd_const/simd_const.392.wat:1:44: error: unexpected token 99_.\n  (global v128 (v128.const i32x4 99_ 99_ 99_ 99_))\n                                             ^^^\nout/test/spec/simd_const.wast:1147: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.393.wat:1:32: error: unexpected token \"1__000\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 1__000 1__000 1__000 1__000))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.393.wat:1:39: error: unexpected token 1__000.\n  (global v128 (v128.const i32x4 1__000 1__000 1__000 1__000))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.393.wat:1:46: error: unexpected token 1__000.\n  (global v128 (v128.const i32x4 1__000 1__000 1__000 1__000))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.393.wat:1:53: error: unexpected token 1__000.\n  (global v128 (v128.const i32x4 1__000 1__000 1__000 1__000))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1151: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.394.wat:1:32: error: unexpected token \"_0x100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 _0x100 _0x100 _0x100 _0x100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.394.wat:1:39: error: unexpected token _0x100.\n  (global v128 (v128.const i32x4 _0x100 _0x100 _0x100 _0x100))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.394.wat:1:46: error: unexpected token _0x100.\n  (global v128 (v128.const i32x4 _0x100 _0x100 _0x100 _0x100))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.394.wat:1:53: error: unexpected token _0x100.\n  (global v128 (v128.const i32x4 _0x100 _0x100 _0x100 _0x100))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1155: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.395.wat:1:32: error: unexpected token \"0_x100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 0_x100 0_x100 0_x100 0_x100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.395.wat:1:39: error: unexpected token 0_x100.\n  (global v128 (v128.const i32x4 0_x100 0_x100 0_x100 0_x100))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.395.wat:1:46: error: unexpected token 0_x100.\n  (global v128 (v128.const i32x4 0_x100 0_x100 0_x100 0_x100))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.395.wat:1:53: error: unexpected token 0_x100.\n  (global v128 (v128.const i32x4 0_x100 0_x100 0_x100 0_x100))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1159: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.396.wat:1:32: error: unexpected token \"0x_100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 0x_100 0x_100 0x_100 0x_100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.396.wat:1:39: error: unexpected token 0x_100.\n  (global v128 (v128.const i32x4 0x_100 0x_100 0x_100 0x_100))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.396.wat:1:46: error: unexpected token 0x_100.\n  (global v128 (v128.const i32x4 0x_100 0x_100 0x_100 0x_100))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.396.wat:1:53: error: unexpected token 0x_100.\n  (global v128 (v128.const i32x4 0x_100 0x_100 0x_100 0x_100))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1163: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.397.wat:1:32: error: unexpected token \"0x00_\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 0x00_ 0x00_ 0x00_ 0x00_))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.397.wat:1:38: error: unexpected token 0x00_.\n  (global v128 (v128.const i32x4 0x00_ 0x00_ 0x00_ 0x00_))\n                                       ^^^^^\n  out/test/spec/simd_const/simd_const.397.wat:1:44: error: unexpected token 0x00_.\n  (global v128 (v128.const i32x4 0x00_ 0x00_ 0x00_ 0x00_))\n                                             ^^^^^\n  out/test/spec/simd_const/simd_const.397.wat:1:50: error: unexpected token 0x00_.\n  (global v128 (v128.const i32x4 0x00_ 0x00_ 0x00_ 0x00_))\n                                                   ^^^^^\nout/test/spec/simd_const.wast:1167: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.398.wat:1:32: error: unexpected token \"0xff__ffff\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i32x4 0xff__ffff 0xff__ffff 0xff__ffff 0xff__ffff))\n                                 ^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.398.wat:1:43: error: unexpected token 0xff__ffff.\n  (global v128 (v128.const i32x4 0xff__ffff 0xff__ffff 0xff__ffff 0xff__ffff))\n                                            ^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.398.wat:1:54: error: unexpected token 0xff__ffff.\n  (global v128 (v128.const i32x4 0xff__ffff 0xff__ffff 0xff__ffff 0xff__ffff))\n                                                       ^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.398.wat:1:65: error: unexpected token 0xff__ffff.\n  (global v128 (v128.const i32x4 0xff__ffff 0xff__ffff 0xff__ffff 0xff__ffff))\n                                                                  ^^^^^^^^^^\nout/test/spec/simd_const.wast:1172: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.399.wat:1:32: error: unexpected token \"_100_100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 _100_100 _100_100))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.399.wat:1:41: error: unexpected token _100_100.\n  (global v128 (v128.const i64x2 _100_100 _100_100))\n                                          ^^^^^^^^\nout/test/spec/simd_const.wast:1176: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.400.wat:1:32: error: unexpected token \"+_100_100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 +_100_100 +_100_100))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.400.wat:1:42: error: unexpected token +_100_100.\n  (global v128 (v128.const i64x2 +_100_100 +_100_100))\n                                           ^^^^^^^^^\nout/test/spec/simd_const.wast:1180: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.401.wat:1:32: error: unexpected token \"-_100_100\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 -_100_100 -_100_100))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.401.wat:1:42: error: unexpected token -_100_100.\n  (global v128 (v128.const i64x2 -_100_100 -_100_100))\n                                           ^^^^^^^^^\nout/test/spec/simd_const.wast:1184: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.402.wat:1:32: error: unexpected token \"99_99_\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 99_99_ 99_99_))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.402.wat:1:39: error: unexpected token 99_99_.\n  (global v128 (v128.const i64x2 99_99_ 99_99_))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1188: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.403.wat:1:32: error: unexpected token \"1__000_000\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 1__000_000 1__000_000))\n                                 ^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.403.wat:1:43: error: unexpected token 1__000_000.\n  (global v128 (v128.const i64x2 1__000_000 1__000_000))\n                                            ^^^^^^^^^^\nout/test/spec/simd_const.wast:1192: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.404.wat:1:32: error: unexpected token \"_0x100000\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 _0x100000 _0x100000))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.404.wat:1:42: error: unexpected token _0x100000.\n  (global v128 (v128.const i64x2 _0x100000 _0x100000))\n                                           ^^^^^^^^^\nout/test/spec/simd_const.wast:1196: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.405.wat:1:32: error: unexpected token \"0_x100000\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 0_x100000 0_x100000))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.405.wat:1:42: error: unexpected token 0_x100000.\n  (global v128 (v128.const i64x2 0_x100000 0_x100000))\n                                           ^^^^^^^^^\nout/test/spec/simd_const.wast:1200: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.406.wat:1:32: error: unexpected token \"0x_100000\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 0x_100000 0x_100000))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.406.wat:1:42: error: unexpected token 0x_100000.\n  (global v128 (v128.const i64x2 0x_100000 0x_100000))\n                                           ^^^^^^^^^\nout/test/spec/simd_const.wast:1204: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.407.wat:1:32: error: unexpected token \"0x00_\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 0x00_ 0x00_))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.407.wat:1:38: error: unexpected token 0x00_.\n  (global v128 (v128.const i64x2 0x00_ 0x00_))\n                                       ^^^^^\nout/test/spec/simd_const.wast:1208: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.408.wat:1:32: error: unexpected token \"0xff__ffff_ffff_ffff\", expected a Nat or Integer literal (e.g. 123).\n  (global v128 (v128.const i64x2 0xff__ffff_ffff_ffff 0xff__ffff_ffff_ffff))\n                                 ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.408.wat:1:53: error: unexpected token 0xff__ffff_ffff_ffff.\n  (global v128 (v128.const i64x2 0xff__ffff_ffff_ffff 0xff__ffff_ffff_ffff))\n                                                      ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_const.wast:1259: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.410.wat:1:32: error: unexpected token \"_100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 _100 _100 _100 _100))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.410.wat:1:37: error: unexpected token _100.\n  (global v128 (v128.const f32x4 _100 _100 _100 _100))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.410.wat:1:42: error: unexpected token _100.\n  (global v128 (v128.const f32x4 _100 _100 _100 _100))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.410.wat:1:47: error: unexpected token _100.\n  (global v128 (v128.const f32x4 _100 _100 _100 _100))\n                                                ^^^^\nout/test/spec/simd_const.wast:1263: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.411.wat:1:32: error: unexpected token \"+_100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 +_100 +_100 +_100 +_100))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.411.wat:1:38: error: unexpected token +_100.\n  (global v128 (v128.const f32x4 +_100 +_100 +_100 +_100))\n                                       ^^^^^\n  out/test/spec/simd_const/simd_const.411.wat:1:44: error: unexpected token +_100.\n  (global v128 (v128.const f32x4 +_100 +_100 +_100 +_100))\n                                             ^^^^^\n  out/test/spec/simd_const/simd_const.411.wat:1:50: error: unexpected token +_100.\n  (global v128 (v128.const f32x4 +_100 +_100 +_100 +_100))\n                                                   ^^^^^\nout/test/spec/simd_const.wast:1267: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.412.wat:1:32: error: unexpected token \"-_100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 -_100 -_100 -_100 -_100))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.412.wat:1:38: error: unexpected token -_100.\n  (global v128 (v128.const f32x4 -_100 -_100 -_100 -_100))\n                                       ^^^^^\n  out/test/spec/simd_const/simd_const.412.wat:1:44: error: unexpected token -_100.\n  (global v128 (v128.const f32x4 -_100 -_100 -_100 -_100))\n                                             ^^^^^\n  out/test/spec/simd_const/simd_const.412.wat:1:50: error: unexpected token -_100.\n  (global v128 (v128.const f32x4 -_100 -_100 -_100 -_100))\n                                                   ^^^^^\nout/test/spec/simd_const.wast:1271: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.413.wat:1:32: error: unexpected token \"99_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 99_ 99_ 99_ 99_))\n                                 ^^^\n  out/test/spec/simd_const/simd_const.413.wat:1:36: error: unexpected token 99_.\n  (global v128 (v128.const f32x4 99_ 99_ 99_ 99_))\n                                     ^^^\n  out/test/spec/simd_const/simd_const.413.wat:1:40: error: unexpected token 99_.\n  (global v128 (v128.const f32x4 99_ 99_ 99_ 99_))\n                                         ^^^\n  out/test/spec/simd_const/simd_const.413.wat:1:44: error: unexpected token 99_.\n  (global v128 (v128.const f32x4 99_ 99_ 99_ 99_))\n                                             ^^^\nout/test/spec/simd_const.wast:1275: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.414.wat:1:32: error: unexpected token \"1__000\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1__000 1__000 1__000 1__000))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.414.wat:1:39: error: unexpected token 1__000.\n  (global v128 (v128.const f32x4 1__000 1__000 1__000 1__000))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.414.wat:1:46: error: unexpected token 1__000.\n  (global v128 (v128.const f32x4 1__000 1__000 1__000 1__000))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.414.wat:1:53: error: unexpected token 1__000.\n  (global v128 (v128.const f32x4 1__000 1__000 1__000 1__000))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1279: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.415.wat:1:32: error: unexpected token \"_1.0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 _1.0 _1.0 _1.0 _1.0))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.415.wat:1:37: error: unexpected token _1.0.\n  (global v128 (v128.const f32x4 _1.0 _1.0 _1.0 _1.0))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.415.wat:1:42: error: unexpected token _1.0.\n  (global v128 (v128.const f32x4 _1.0 _1.0 _1.0 _1.0))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.415.wat:1:47: error: unexpected token _1.0.\n  (global v128 (v128.const f32x4 _1.0 _1.0 _1.0 _1.0))\n                                                ^^^^\nout/test/spec/simd_const.wast:1283: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.416.wat:1:32: error: unexpected token \"1.0_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1.0_ 1.0_ 1.0_ 1.0_))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.416.wat:1:37: error: unexpected token 1.0_.\n  (global v128 (v128.const f32x4 1.0_ 1.0_ 1.0_ 1.0_))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.416.wat:1:42: error: unexpected token 1.0_.\n  (global v128 (v128.const f32x4 1.0_ 1.0_ 1.0_ 1.0_))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.416.wat:1:47: error: unexpected token 1.0_.\n  (global v128 (v128.const f32x4 1.0_ 1.0_ 1.0_ 1.0_))\n                                                ^^^^\nout/test/spec/simd_const.wast:1287: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.417.wat:1:32: error: unexpected token \"1_.0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1_.0 1_.0 1_.0 1_.0))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.417.wat:1:37: error: unexpected token 1_.0.\n  (global v128 (v128.const f32x4 1_.0 1_.0 1_.0 1_.0))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.417.wat:1:42: error: unexpected token 1_.0.\n  (global v128 (v128.const f32x4 1_.0 1_.0 1_.0 1_.0))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.417.wat:1:47: error: unexpected token 1_.0.\n  (global v128 (v128.const f32x4 1_.0 1_.0 1_.0 1_.0))\n                                                ^^^^\nout/test/spec/simd_const.wast:1291: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.418.wat:1:32: error: unexpected token \"1._0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1._0 1._0 1._0 1._0))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.418.wat:1:37: error: unexpected token 1._0.\n  (global v128 (v128.const f32x4 1._0 1._0 1._0 1._0))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.418.wat:1:42: error: unexpected token 1._0.\n  (global v128 (v128.const f32x4 1._0 1._0 1._0 1._0))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.418.wat:1:47: error: unexpected token 1._0.\n  (global v128 (v128.const f32x4 1._0 1._0 1._0 1._0))\n                                                ^^^^\nout/test/spec/simd_const.wast:1295: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.419.wat:1:32: error: unexpected token \"_1e1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 _1e1 _1e1 _1e1 _1e1))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.419.wat:1:37: error: unexpected token _1e1.\n  (global v128 (v128.const f32x4 _1e1 _1e1 _1e1 _1e1))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.419.wat:1:42: error: unexpected token _1e1.\n  (global v128 (v128.const f32x4 _1e1 _1e1 _1e1 _1e1))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.419.wat:1:47: error: unexpected token _1e1.\n  (global v128 (v128.const f32x4 _1e1 _1e1 _1e1 _1e1))\n                                                ^^^^\nout/test/spec/simd_const.wast:1299: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.420.wat:1:32: error: unexpected token \"1e1_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1e1_ 1e1_ 1e1_ 1e1_))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.420.wat:1:37: error: unexpected token 1e1_.\n  (global v128 (v128.const f32x4 1e1_ 1e1_ 1e1_ 1e1_))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.420.wat:1:42: error: unexpected token 1e1_.\n  (global v128 (v128.const f32x4 1e1_ 1e1_ 1e1_ 1e1_))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.420.wat:1:47: error: unexpected token 1e1_.\n  (global v128 (v128.const f32x4 1e1_ 1e1_ 1e1_ 1e1_))\n                                                ^^^^\nout/test/spec/simd_const.wast:1303: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.421.wat:1:32: error: unexpected token \"1_e1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1_e1 1_e1 1_e1 1_e1))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.421.wat:1:37: error: unexpected token 1_e1.\n  (global v128 (v128.const f32x4 1_e1 1_e1 1_e1 1_e1))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.421.wat:1:42: error: unexpected token 1_e1.\n  (global v128 (v128.const f32x4 1_e1 1_e1 1_e1 1_e1))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.421.wat:1:47: error: unexpected token 1_e1.\n  (global v128 (v128.const f32x4 1_e1 1_e1 1_e1 1_e1))\n                                                ^^^^\nout/test/spec/simd_const.wast:1307: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.422.wat:1:32: error: unexpected token \"1e_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1e_1 1e_1 1e_1 1e_1))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.422.wat:1:37: error: unexpected token 1e_1.\n  (global v128 (v128.const f32x4 1e_1 1e_1 1e_1 1e_1))\n                                      ^^^^\n  out/test/spec/simd_const/simd_const.422.wat:1:42: error: unexpected token 1e_1.\n  (global v128 (v128.const f32x4 1e_1 1e_1 1e_1 1e_1))\n                                           ^^^^\n  out/test/spec/simd_const/simd_const.422.wat:1:47: error: unexpected token 1e_1.\n  (global v128 (v128.const f32x4 1e_1 1e_1 1e_1 1e_1))\n                                                ^^^^\nout/test/spec/simd_const.wast:1311: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.423.wat:1:32: error: unexpected token \"_1.0e1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 _1.0e1 _1.0e1 _1.0e1 _1.0e1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.423.wat:1:39: error: unexpected token _1.0e1.\n  (global v128 (v128.const f32x4 _1.0e1 _1.0e1 _1.0e1 _1.0e1))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.423.wat:1:46: error: unexpected token _1.0e1.\n  (global v128 (v128.const f32x4 _1.0e1 _1.0e1 _1.0e1 _1.0e1))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.423.wat:1:53: error: unexpected token _1.0e1.\n  (global v128 (v128.const f32x4 _1.0e1 _1.0e1 _1.0e1 _1.0e1))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1315: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.424.wat:1:32: error: unexpected token \"1.0e1_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1.0e1_ 1.0e1_ 1.0e1_ 1.0e1_))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.424.wat:1:39: error: unexpected token 1.0e1_.\n  (global v128 (v128.const f32x4 1.0e1_ 1.0e1_ 1.0e1_ 1.0e1_))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.424.wat:1:46: error: unexpected token 1.0e1_.\n  (global v128 (v128.const f32x4 1.0e1_ 1.0e1_ 1.0e1_ 1.0e1_))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.424.wat:1:53: error: unexpected token 1.0e1_.\n  (global v128 (v128.const f32x4 1.0e1_ 1.0e1_ 1.0e1_ 1.0e1_))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1319: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.425.wat:1:32: error: unexpected token \"1.0_e1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1.0_e1 1.0_e1 1.0_e1 1.0_e1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.425.wat:1:39: error: unexpected token 1.0_e1.\n  (global v128 (v128.const f32x4 1.0_e1 1.0_e1 1.0_e1 1.0_e1))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.425.wat:1:46: error: unexpected token 1.0_e1.\n  (global v128 (v128.const f32x4 1.0_e1 1.0_e1 1.0_e1 1.0_e1))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.425.wat:1:53: error: unexpected token 1.0_e1.\n  (global v128 (v128.const f32x4 1.0_e1 1.0_e1 1.0_e1 1.0_e1))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1323: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.426.wat:1:32: error: unexpected token \"1.0e_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1.0e_1 1.0e_1 1.0e_1 1.0e_1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.426.wat:1:39: error: unexpected token 1.0e_1.\n  (global v128 (v128.const f32x4 1.0e_1 1.0e_1 1.0e_1 1.0e_1))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.426.wat:1:46: error: unexpected token 1.0e_1.\n  (global v128 (v128.const f32x4 1.0e_1 1.0e_1 1.0e_1 1.0e_1))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.426.wat:1:53: error: unexpected token 1.0e_1.\n  (global v128 (v128.const f32x4 1.0e_1 1.0e_1 1.0e_1 1.0e_1))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1327: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.427.wat:1:32: error: unexpected token \"1.0e+_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1.0e+_1 1.0e+_1 1.0e+_1 1.0e+_1))\n                                 ^^^^^^^\n  out/test/spec/simd_const/simd_const.427.wat:1:40: error: unexpected token 1.0e+_1.\n  (global v128 (v128.const f32x4 1.0e+_1 1.0e+_1 1.0e+_1 1.0e+_1))\n                                         ^^^^^^^\n  out/test/spec/simd_const/simd_const.427.wat:1:48: error: unexpected token 1.0e+_1.\n  (global v128 (v128.const f32x4 1.0e+_1 1.0e+_1 1.0e+_1 1.0e+_1))\n                                                 ^^^^^^^\n  out/test/spec/simd_const/simd_const.427.wat:1:56: error: unexpected token 1.0e+_1.\n  (global v128 (v128.const f32x4 1.0e+_1 1.0e+_1 1.0e+_1 1.0e+_1))\n                                                         ^^^^^^^\nout/test/spec/simd_const.wast:1331: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.428.wat:1:32: error: unexpected token \"1.0e_+1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 1.0e_+1 1.0e_+1 1.0e_+1 1.0e_+1))\n                                 ^^^^^^^\n  out/test/spec/simd_const/simd_const.428.wat:1:40: error: unexpected token 1.0e_+1.\n  (global v128 (v128.const f32x4 1.0e_+1 1.0e_+1 1.0e_+1 1.0e_+1))\n                                         ^^^^^^^\n  out/test/spec/simd_const/simd_const.428.wat:1:48: error: unexpected token 1.0e_+1.\n  (global v128 (v128.const f32x4 1.0e_+1 1.0e_+1 1.0e_+1 1.0e_+1))\n                                                 ^^^^^^^\n  out/test/spec/simd_const/simd_const.428.wat:1:56: error: unexpected token 1.0e_+1.\n  (global v128 (v128.const f32x4 1.0e_+1 1.0e_+1 1.0e_+1 1.0e_+1))\n                                                         ^^^^^^^\nout/test/spec/simd_const.wast:1335: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.429.wat:1:32: error: unexpected token \"_0x100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 _0x100 _0x100 _0x100 _0x100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.429.wat:1:39: error: unexpected token _0x100.\n  (global v128 (v128.const f32x4 _0x100 _0x100 _0x100 _0x100))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.429.wat:1:46: error: unexpected token _0x100.\n  (global v128 (v128.const f32x4 _0x100 _0x100 _0x100 _0x100))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.429.wat:1:53: error: unexpected token _0x100.\n  (global v128 (v128.const f32x4 _0x100 _0x100 _0x100 _0x100))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1339: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.430.wat:1:32: error: unexpected token \"0_x100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0_x100 0_x100 0_x100 0_x100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.430.wat:1:39: error: unexpected token 0_x100.\n  (global v128 (v128.const f32x4 0_x100 0_x100 0_x100 0_x100))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.430.wat:1:46: error: unexpected token 0_x100.\n  (global v128 (v128.const f32x4 0_x100 0_x100 0_x100 0_x100))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.430.wat:1:53: error: unexpected token 0_x100.\n  (global v128 (v128.const f32x4 0_x100 0_x100 0_x100 0_x100))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1343: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.431.wat:1:32: error: unexpected token \"0x_100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x_100 0x_100 0x_100 0x_100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.431.wat:1:39: error: unexpected token 0x_100.\n  (global v128 (v128.const f32x4 0x_100 0x_100 0x_100 0x_100))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.431.wat:1:46: error: unexpected token 0x_100.\n  (global v128 (v128.const f32x4 0x_100 0x_100 0x_100 0x_100))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.431.wat:1:53: error: unexpected token 0x_100.\n  (global v128 (v128.const f32x4 0x_100 0x_100 0x_100 0x_100))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1347: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.432.wat:1:32: error: unexpected token \"0x00_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x00_ 0x00_ 0x00_ 0x00_))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.432.wat:1:38: error: unexpected token 0x00_.\n  (global v128 (v128.const f32x4 0x00_ 0x00_ 0x00_ 0x00_))\n                                       ^^^^^\n  out/test/spec/simd_const/simd_const.432.wat:1:44: error: unexpected token 0x00_.\n  (global v128 (v128.const f32x4 0x00_ 0x00_ 0x00_ 0x00_))\n                                             ^^^^^\n  out/test/spec/simd_const/simd_const.432.wat:1:50: error: unexpected token 0x00_.\n  (global v128 (v128.const f32x4 0x00_ 0x00_ 0x00_ 0x00_))\n                                                   ^^^^^\nout/test/spec/simd_const.wast:1351: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.433.wat:1:32: error: unexpected token \"0xff__ffff\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0xff__ffff 0xff__ffff 0xff__ffff 0xff__ffff))\n                                 ^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.433.wat:1:43: error: unexpected token 0xff__ffff.\n  (global v128 (v128.const f32x4 0xff__ffff 0xff__ffff 0xff__ffff 0xff__ffff))\n                                            ^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.433.wat:1:54: error: unexpected token 0xff__ffff.\n  (global v128 (v128.const f32x4 0xff__ffff 0xff__ffff 0xff__ffff 0xff__ffff))\n                                                       ^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.433.wat:1:65: error: unexpected token 0xff__ffff.\n  (global v128 (v128.const f32x4 0xff__ffff 0xff__ffff 0xff__ffff 0xff__ffff))\n                                                                  ^^^^^^^^^^\nout/test/spec/simd_const.wast:1355: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.434.wat:1:32: error: unexpected token \"0x_1.0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x_1.0 0x_1.0 0x_1.0 0x_1.0))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.434.wat:1:39: error: unexpected token 0x_1.0.\n  (global v128 (v128.const f32x4 0x_1.0 0x_1.0 0x_1.0 0x_1.0))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.434.wat:1:46: error: unexpected token 0x_1.0.\n  (global v128 (v128.const f32x4 0x_1.0 0x_1.0 0x_1.0 0x_1.0))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.434.wat:1:53: error: unexpected token 0x_1.0.\n  (global v128 (v128.const f32x4 0x_1.0 0x_1.0 0x_1.0 0x_1.0))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1359: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.435.wat:1:32: error: unexpected token \"0x1.0_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1.0_ 0x1.0_ 0x1.0_ 0x1.0_))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.435.wat:1:39: error: unexpected token 0x1.0_.\n  (global v128 (v128.const f32x4 0x1.0_ 0x1.0_ 0x1.0_ 0x1.0_))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.435.wat:1:46: error: unexpected token 0x1.0_.\n  (global v128 (v128.const f32x4 0x1.0_ 0x1.0_ 0x1.0_ 0x1.0_))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.435.wat:1:53: error: unexpected token 0x1.0_.\n  (global v128 (v128.const f32x4 0x1.0_ 0x1.0_ 0x1.0_ 0x1.0_))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1363: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.436.wat:1:32: error: unexpected token \"0x1_.0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1_.0 0x1_.0 0x1_.0 0x1_.0))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.436.wat:1:39: error: unexpected token 0x1_.0.\n  (global v128 (v128.const f32x4 0x1_.0 0x1_.0 0x1_.0 0x1_.0))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.436.wat:1:46: error: unexpected token 0x1_.0.\n  (global v128 (v128.const f32x4 0x1_.0 0x1_.0 0x1_.0 0x1_.0))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.436.wat:1:53: error: unexpected token 0x1_.0.\n  (global v128 (v128.const f32x4 0x1_.0 0x1_.0 0x1_.0 0x1_.0))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1367: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.437.wat:1:32: error: unexpected token \"0x1._0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1._0 0x1._0 0x1._0 0x1._0))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.437.wat:1:39: error: unexpected token 0x1._0.\n  (global v128 (v128.const f32x4 0x1._0 0x1._0 0x1._0 0x1._0))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.437.wat:1:46: error: unexpected token 0x1._0.\n  (global v128 (v128.const f32x4 0x1._0 0x1._0 0x1._0 0x1._0))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.437.wat:1:53: error: unexpected token 0x1._0.\n  (global v128 (v128.const f32x4 0x1._0 0x1._0 0x1._0 0x1._0))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1371: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.438.wat:1:32: error: unexpected token \"0x_1p1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x_1p1 0x_1p1 0x_1p1 0x_1p1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.438.wat:1:39: error: unexpected token 0x_1p1.\n  (global v128 (v128.const f32x4 0x_1p1 0x_1p1 0x_1p1 0x_1p1))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.438.wat:1:46: error: unexpected token 0x_1p1.\n  (global v128 (v128.const f32x4 0x_1p1 0x_1p1 0x_1p1 0x_1p1))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.438.wat:1:53: error: unexpected token 0x_1p1.\n  (global v128 (v128.const f32x4 0x_1p1 0x_1p1 0x_1p1 0x_1p1))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1375: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.439.wat:1:32: error: unexpected token \"0x1p1_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1p1_ 0x1p1_ 0x1p1_ 0x1p1_))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.439.wat:1:39: error: unexpected token 0x1p1_.\n  (global v128 (v128.const f32x4 0x1p1_ 0x1p1_ 0x1p1_ 0x1p1_))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.439.wat:1:46: error: unexpected token 0x1p1_.\n  (global v128 (v128.const f32x4 0x1p1_ 0x1p1_ 0x1p1_ 0x1p1_))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.439.wat:1:53: error: unexpected token 0x1p1_.\n  (global v128 (v128.const f32x4 0x1p1_ 0x1p1_ 0x1p1_ 0x1p1_))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1379: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.440.wat:1:32: error: unexpected token \"0x1_p1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1_p1 0x1_p1 0x1_p1 0x1_p1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.440.wat:1:39: error: unexpected token 0x1_p1.\n  (global v128 (v128.const f32x4 0x1_p1 0x1_p1 0x1_p1 0x1_p1))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.440.wat:1:46: error: unexpected token 0x1_p1.\n  (global v128 (v128.const f32x4 0x1_p1 0x1_p1 0x1_p1 0x1_p1))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.440.wat:1:53: error: unexpected token 0x1_p1.\n  (global v128 (v128.const f32x4 0x1_p1 0x1_p1 0x1_p1 0x1_p1))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1383: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.441.wat:1:32: error: unexpected token \"0x1p_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1p_1 0x1p_1 0x1p_1 0x1p_1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.441.wat:1:39: error: unexpected token 0x1p_1.\n  (global v128 (v128.const f32x4 0x1p_1 0x1p_1 0x1p_1 0x1p_1))\n                                        ^^^^^^\n  out/test/spec/simd_const/simd_const.441.wat:1:46: error: unexpected token 0x1p_1.\n  (global v128 (v128.const f32x4 0x1p_1 0x1p_1 0x1p_1 0x1p_1))\n                                               ^^^^^^\n  out/test/spec/simd_const/simd_const.441.wat:1:53: error: unexpected token 0x1p_1.\n  (global v128 (v128.const f32x4 0x1p_1 0x1p_1 0x1p_1 0x1p_1))\n                                                      ^^^^^^\nout/test/spec/simd_const.wast:1387: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.442.wat:1:32: error: unexpected token \"0x_1.0p1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x_1.0p1 0x_1.0p1 0x_1.0p1 0x_1.0p1))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.442.wat:1:41: error: unexpected token 0x_1.0p1.\n  (global v128 (v128.const f32x4 0x_1.0p1 0x_1.0p1 0x_1.0p1 0x_1.0p1))\n                                          ^^^^^^^^\n  out/test/spec/simd_const/simd_const.442.wat:1:50: error: unexpected token 0x_1.0p1.\n  (global v128 (v128.const f32x4 0x_1.0p1 0x_1.0p1 0x_1.0p1 0x_1.0p1))\n                                                   ^^^^^^^^\n  out/test/spec/simd_const/simd_const.442.wat:1:59: error: unexpected token 0x_1.0p1.\n  (global v128 (v128.const f32x4 0x_1.0p1 0x_1.0p1 0x_1.0p1 0x_1.0p1))\n                                                            ^^^^^^^^\nout/test/spec/simd_const.wast:1391: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.443.wat:1:32: error: unexpected token \"0x1.0p1_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1.0p1_ 0x1.0p1_ 0x1.0p1_ 0x1.0p1_))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.443.wat:1:41: error: unexpected token 0x1.0p1_.\n  (global v128 (v128.const f32x4 0x1.0p1_ 0x1.0p1_ 0x1.0p1_ 0x1.0p1_))\n                                          ^^^^^^^^\n  out/test/spec/simd_const/simd_const.443.wat:1:50: error: unexpected token 0x1.0p1_.\n  (global v128 (v128.const f32x4 0x1.0p1_ 0x1.0p1_ 0x1.0p1_ 0x1.0p1_))\n                                                   ^^^^^^^^\n  out/test/spec/simd_const/simd_const.443.wat:1:59: error: unexpected token 0x1.0p1_.\n  (global v128 (v128.const f32x4 0x1.0p1_ 0x1.0p1_ 0x1.0p1_ 0x1.0p1_))\n                                                            ^^^^^^^^\nout/test/spec/simd_const.wast:1395: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.444.wat:1:32: error: unexpected token \"0x1.0_p1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1.0_p1 0x1.0_p1 0x1.0_p1 0x1.0_p1))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.444.wat:1:41: error: unexpected token 0x1.0_p1.\n  (global v128 (v128.const f32x4 0x1.0_p1 0x1.0_p1 0x1.0_p1 0x1.0_p1))\n                                          ^^^^^^^^\n  out/test/spec/simd_const/simd_const.444.wat:1:50: error: unexpected token 0x1.0_p1.\n  (global v128 (v128.const f32x4 0x1.0_p1 0x1.0_p1 0x1.0_p1 0x1.0_p1))\n                                                   ^^^^^^^^\n  out/test/spec/simd_const/simd_const.444.wat:1:59: error: unexpected token 0x1.0_p1.\n  (global v128 (v128.const f32x4 0x1.0_p1 0x1.0_p1 0x1.0_p1 0x1.0_p1))\n                                                            ^^^^^^^^\nout/test/spec/simd_const.wast:1399: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.445.wat:1:32: error: unexpected token \"0x1.0p_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1.0p_1 0x1.0p_1 0x1.0p_1 0x1.0p_1))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.445.wat:1:41: error: unexpected token 0x1.0p_1.\n  (global v128 (v128.const f32x4 0x1.0p_1 0x1.0p_1 0x1.0p_1 0x1.0p_1))\n                                          ^^^^^^^^\n  out/test/spec/simd_const/simd_const.445.wat:1:50: error: unexpected token 0x1.0p_1.\n  (global v128 (v128.const f32x4 0x1.0p_1 0x1.0p_1 0x1.0p_1 0x1.0p_1))\n                                                   ^^^^^^^^\n  out/test/spec/simd_const/simd_const.445.wat:1:59: error: unexpected token 0x1.0p_1.\n  (global v128 (v128.const f32x4 0x1.0p_1 0x1.0p_1 0x1.0p_1 0x1.0p_1))\n                                                            ^^^^^^^^\nout/test/spec/simd_const.wast:1403: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.446.wat:1:32: error: unexpected token \"0x1.0p+_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1.0p+_1 0x1.0p+_1 0x1.0p+_1 0x1.0p+_1))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.446.wat:1:42: error: unexpected token 0x1.0p+_1.\n  (global v128 (v128.const f32x4 0x1.0p+_1 0x1.0p+_1 0x1.0p+_1 0x1.0p+_1))\n                                           ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.446.wat:1:52: error: unexpected token 0x1.0p+_1.\n  (global v128 (v128.const f32x4 0x1.0p+_1 0x1.0p+_1 0x1.0p+_1 0x1.0p+_1))\n                                                     ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.446.wat:1:62: error: unexpected token 0x1.0p+_1.\n  (global v128 (v128.const f32x4 0x1.0p+_1 0x1.0p+_1 0x1.0p+_1 0x1.0p+_1))\n                                                               ^^^^^^^^^\nout/test/spec/simd_const.wast:1407: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.447.wat:1:32: error: unexpected token \"0x1.0p_+1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f32x4 0x1.0p_+1 0x1.0p_+1 0x1.0p_+1 0x1.0p_+1))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.447.wat:1:42: error: unexpected token 0x1.0p_+1.\n  (global v128 (v128.const f32x4 0x1.0p_+1 0x1.0p_+1 0x1.0p_+1 0x1.0p_+1))\n                                           ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.447.wat:1:52: error: unexpected token 0x1.0p_+1.\n  (global v128 (v128.const f32x4 0x1.0p_+1 0x1.0p_+1 0x1.0p_+1 0x1.0p_+1))\n                                                     ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.447.wat:1:62: error: unexpected token 0x1.0p_+1.\n  (global v128 (v128.const f32x4 0x1.0p_+1 0x1.0p_+1 0x1.0p_+1 0x1.0p_+1))\n                                                               ^^^^^^^^^\nout/test/spec/simd_const.wast:1412: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.448.wat:1:32: error: unexpected token \"_100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 _100 _100))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.448.wat:1:37: error: unexpected token _100.\n  (global v128 (v128.const f64x2 _100 _100))\n                                      ^^^^\nout/test/spec/simd_const.wast:1416: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.449.wat:1:32: error: unexpected token \"+_100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 +_100 +_100))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.449.wat:1:38: error: unexpected token +_100.\n  (global v128 (v128.const f64x2 +_100 +_100))\n                                       ^^^^^\nout/test/spec/simd_const.wast:1420: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.450.wat:1:32: error: unexpected token \"-_100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 -_100 -_100))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.450.wat:1:38: error: unexpected token -_100.\n  (global v128 (v128.const f64x2 -_100 -_100))\n                                       ^^^^^\nout/test/spec/simd_const.wast:1424: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.451.wat:1:32: error: unexpected token \"99_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 99_ 99_))\n                                 ^^^\n  out/test/spec/simd_const/simd_const.451.wat:1:36: error: unexpected token 99_.\n  (global v128 (v128.const f64x2 99_ 99_))\n                                     ^^^\nout/test/spec/simd_const.wast:1428: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.452.wat:1:32: error: unexpected token \"1__000\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1__000 1__000))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.452.wat:1:39: error: unexpected token 1__000.\n  (global v128 (v128.const f64x2 1__000 1__000))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1432: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.453.wat:1:32: error: unexpected token \"_1.0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 _1.0 _1.0))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.453.wat:1:37: error: unexpected token _1.0.\n  (global v128 (v128.const f64x2 _1.0 _1.0))\n                                      ^^^^\nout/test/spec/simd_const.wast:1436: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.454.wat:1:32: error: unexpected token \"1.0_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1.0_ 1.0_))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.454.wat:1:37: error: unexpected token 1.0_.\n  (global v128 (v128.const f64x2 1.0_ 1.0_))\n                                      ^^^^\nout/test/spec/simd_const.wast:1440: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.455.wat:1:32: error: unexpected token \"1_.0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1_.0 1_.0))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.455.wat:1:37: error: unexpected token 1_.0.\n  (global v128 (v128.const f64x2 1_.0 1_.0))\n                                      ^^^^\nout/test/spec/simd_const.wast:1444: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.456.wat:1:32: error: unexpected token \"1._0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1._0 1._0))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.456.wat:1:37: error: unexpected token 1._0.\n  (global v128 (v128.const f64x2 1._0 1._0))\n                                      ^^^^\nout/test/spec/simd_const.wast:1448: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.457.wat:1:32: error: unexpected token \"_1e1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 _1e1 _1e1))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.457.wat:1:37: error: unexpected token _1e1.\n  (global v128 (v128.const f64x2 _1e1 _1e1))\n                                      ^^^^\nout/test/spec/simd_const.wast:1452: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.458.wat:1:32: error: unexpected token \"1e1_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1e1_ 1e1_))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.458.wat:1:37: error: unexpected token 1e1_.\n  (global v128 (v128.const f64x2 1e1_ 1e1_))\n                                      ^^^^\nout/test/spec/simd_const.wast:1456: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.459.wat:1:32: error: unexpected token \"1_e1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1_e1 1_e1))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.459.wat:1:37: error: unexpected token 1_e1.\n  (global v128 (v128.const f64x2 1_e1 1_e1))\n                                      ^^^^\nout/test/spec/simd_const.wast:1460: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.460.wat:1:32: error: unexpected token \"1e_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1e_1 1e_1))\n                                 ^^^^\n  out/test/spec/simd_const/simd_const.460.wat:1:37: error: unexpected token 1e_1.\n  (global v128 (v128.const f64x2 1e_1 1e_1))\n                                      ^^^^\nout/test/spec/simd_const.wast:1464: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.461.wat:1:32: error: unexpected token \"_1.0e1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 _1.0e1 _1.0e1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.461.wat:1:39: error: unexpected token _1.0e1.\n  (global v128 (v128.const f64x2 _1.0e1 _1.0e1))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1468: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.462.wat:1:32: error: unexpected token \"1.0e1_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1.0e1_ 1.0e1_))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.462.wat:1:39: error: unexpected token 1.0e1_.\n  (global v128 (v128.const f64x2 1.0e1_ 1.0e1_))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1472: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.463.wat:1:32: error: unexpected token \"1.0_e1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1.0_e1 1.0_e1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.463.wat:1:39: error: unexpected token 1.0_e1.\n  (global v128 (v128.const f64x2 1.0_e1 1.0_e1))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1476: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.464.wat:1:32: error: unexpected token \"1.0e_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1.0e_1 1.0e_1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.464.wat:1:39: error: unexpected token 1.0e_1.\n  (global v128 (v128.const f64x2 1.0e_1 1.0e_1))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1480: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.465.wat:1:32: error: unexpected token \"1.0e+_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1.0e+_1 1.0e+_1))\n                                 ^^^^^^^\n  out/test/spec/simd_const/simd_const.465.wat:1:40: error: unexpected token 1.0e+_1.\n  (global v128 (v128.const f64x2 1.0e+_1 1.0e+_1))\n                                         ^^^^^^^\nout/test/spec/simd_const.wast:1484: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.466.wat:1:32: error: unexpected token \"1.0e_+1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 1.0e_+1 1.0e_+1))\n                                 ^^^^^^^\n  out/test/spec/simd_const/simd_const.466.wat:1:40: error: unexpected token 1.0e_+1.\n  (global v128 (v128.const f64x2 1.0e_+1 1.0e_+1))\n                                         ^^^^^^^\nout/test/spec/simd_const.wast:1488: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.467.wat:1:32: error: unexpected token \"_0x100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 _0x100 _0x100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.467.wat:1:39: error: unexpected token _0x100.\n  (global v128 (v128.const f64x2 _0x100 _0x100))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1492: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.468.wat:1:32: error: unexpected token \"0_x100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0_x100 0_x100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.468.wat:1:39: error: unexpected token 0_x100.\n  (global v128 (v128.const f64x2 0_x100 0_x100))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1496: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.469.wat:1:32: error: unexpected token \"0x_100\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x_100 0x_100))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.469.wat:1:39: error: unexpected token 0x_100.\n  (global v128 (v128.const f64x2 0x_100 0x_100))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1500: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.470.wat:1:32: error: unexpected token \"0x00_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x00_ 0x00_))\n                                 ^^^^^\n  out/test/spec/simd_const/simd_const.470.wat:1:38: error: unexpected token 0x00_.\n  (global v128 (v128.const f64x2 0x00_ 0x00_))\n                                       ^^^^^\nout/test/spec/simd_const.wast:1504: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.471.wat:1:32: error: unexpected token \"0xff__ffff\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0xff__ffff 0xff__ffff))\n                                 ^^^^^^^^^^\n  out/test/spec/simd_const/simd_const.471.wat:1:43: error: unexpected token 0xff__ffff.\n  (global v128 (v128.const f64x2 0xff__ffff 0xff__ffff))\n                                            ^^^^^^^^^^\nout/test/spec/simd_const.wast:1508: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.472.wat:1:32: error: unexpected token \"0x_1.0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x_1.0 0x_1.0))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.472.wat:1:39: error: unexpected token 0x_1.0.\n  (global v128 (v128.const f64x2 0x_1.0 0x_1.0))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1512: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.473.wat:1:32: error: unexpected token \"0x1.0_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1.0_ 0x1.0_))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.473.wat:1:39: error: unexpected token 0x1.0_.\n  (global v128 (v128.const f64x2 0x1.0_ 0x1.0_))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1516: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.474.wat:1:32: error: unexpected token \"0x1_.0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1_.0 0x1_.0))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.474.wat:1:39: error: unexpected token 0x1_.0.\n  (global v128 (v128.const f64x2 0x1_.0 0x1_.0))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1520: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.475.wat:1:32: error: unexpected token \"0x1._0\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1._0 0x1._0))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.475.wat:1:39: error: unexpected token 0x1._0.\n  (global v128 (v128.const f64x2 0x1._0 0x1._0))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1524: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.476.wat:1:32: error: unexpected token \"0x_1p1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x_1p1 0x_1p1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.476.wat:1:39: error: unexpected token 0x_1p1.\n  (global v128 (v128.const f64x2 0x_1p1 0x_1p1))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1528: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.477.wat:1:32: error: unexpected token \"0x1p1_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1p1_ 0x1p1_))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.477.wat:1:39: error: unexpected token 0x1p1_.\n  (global v128 (v128.const f64x2 0x1p1_ 0x1p1_))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1532: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.478.wat:1:32: error: unexpected token \"0x1_p1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1_p1 0x1_p1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.478.wat:1:39: error: unexpected token 0x1_p1.\n  (global v128 (v128.const f64x2 0x1_p1 0x1_p1))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1536: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.479.wat:1:32: error: unexpected token \"0x1p_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1p_1 0x1p_1))\n                                 ^^^^^^\n  out/test/spec/simd_const/simd_const.479.wat:1:39: error: unexpected token 0x1p_1.\n  (global v128 (v128.const f64x2 0x1p_1 0x1p_1))\n                                        ^^^^^^\nout/test/spec/simd_const.wast:1540: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.480.wat:1:32: error: unexpected token \"0x_1.0p1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x_1.0p1 0x_1.0p1))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.480.wat:1:41: error: unexpected token 0x_1.0p1.\n  (global v128 (v128.const f64x2 0x_1.0p1 0x_1.0p1))\n                                          ^^^^^^^^\nout/test/spec/simd_const.wast:1544: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.481.wat:1:32: error: unexpected token \"0x1.0p1_\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1.0p1_ 0x1.0p1_))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.481.wat:1:41: error: unexpected token 0x1.0p1_.\n  (global v128 (v128.const f64x2 0x1.0p1_ 0x1.0p1_))\n                                          ^^^^^^^^\nout/test/spec/simd_const.wast:1548: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.482.wat:1:32: error: unexpected token \"0x1.0_p1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1.0_p1 0x1.0_p1))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.482.wat:1:41: error: unexpected token 0x1.0_p1.\n  (global v128 (v128.const f64x2 0x1.0_p1 0x1.0_p1))\n                                          ^^^^^^^^\nout/test/spec/simd_const.wast:1552: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.483.wat:1:32: error: unexpected token \"0x1.0p_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1.0p_1 0x1.0p_1))\n                                 ^^^^^^^^\n  out/test/spec/simd_const/simd_const.483.wat:1:41: error: unexpected token 0x1.0p_1.\n  (global v128 (v128.const f64x2 0x1.0p_1 0x1.0p_1))\n                                          ^^^^^^^^\nout/test/spec/simd_const.wast:1556: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.484.wat:1:32: error: unexpected token \"0x1.0p+_1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1.0p+_1 0x1.0p+_1))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.484.wat:1:42: error: unexpected token 0x1.0p+_1.\n  (global v128 (v128.const f64x2 0x1.0p+_1 0x1.0p+_1))\n                                           ^^^^^^^^^\nout/test/spec/simd_const.wast:1560: assert_malformed passed:\n  out/test/spec/simd_const/simd_const.485.wat:1:32: error: unexpected token \"0x1.0p_+1\", expected a Float literal (e.g. 42.0).\n  (global v128 (v128.const f64x2 0x1.0p_+1 0x1.0p_+1))\n                                 ^^^^^^^^^\n  out/test/spec/simd_const/simd_const.485.wat:1:42: error: unexpected token 0x1.0p_+1.\n  (global v128 (v128.const f64x2 0x1.0p_+1 0x1.0p_+1))\n                                           ^^^^^^^^^\n757/757 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_conversions.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_conversions.wast\n(;; STDOUT ;;;\nout/test/spec/simd_conversions.wast:605: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.1.wat:1:22: error: unexpected token \"i32x4.trunc_sat_f32x4\", expected an instr.\n  (func (result v128) (i32x4.trunc_sat_f32x4 (v128.const f32x4 0.0 0.0 0.0 0.0)))\n                       ^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:608: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.2.wat:1:22: error: unexpected token \"i32x4.trunc_s_sat_f32x4\", expected an instr.\n  (func (result v128) (i32x4.trunc_s_sat_f32x4 (v128.const f32x4 -2.0 -1.0 1.0 ...\n                       ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:611: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.3.wat:1:22: error: unexpected token \"i32x4.trunc_u_sat_f32x4\", expected an instr.\n  (func (result v128) (i32x4.trunc_u_sat_f32x4 (v128.const f32x4 -2.0 -1.0 1.0 ...\n                       ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:614: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.4.wat:1:22: error: unexpected token \"i32x4.convert_f32x4\", expected an instr.\n  (func (result v128) (i32x4.convert_f32x4 (v128.const f32x4 -1 0 1 2)))\n                       ^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:617: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.5.wat:1:22: error: unexpected token \"i32x4.convert_s_f32x4\", expected an instr.\n  (func (result v128) (i32x4.convert_s_f32x4 (v128.const f32x4 -1 0 1 2)))\n                       ^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:620: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.6.wat:1:22: error: unexpected token \"i32x4.convert_u_f32x4\", expected an instr.\n  (func (result v128) (i32x4.convert_u_f32x4 (v128.const f32x4 -1 0 1 2)))\n                       ^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:624: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.7.wat:1:22: error: unexpected token \"i64x2.trunc_sat_f64x2_s\", expected an instr.\n  (func (result v128) (i64x2.trunc_sat_f64x2_s (v128.const f64x2 0.0 0.0)))\n                       ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:627: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.8.wat:1:22: error: unexpected token \"i64x2.trunc_sat_f64x2_u\", expected an instr.\n  (func (result v128) (i64x2.trunc_sat_f64x2_u (v128.const f64x2 -2.0 -1.0)))\n                       ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:630: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.9.wat:1:22: error: unexpected token \"f64x2.convert_i64x2_s\", expected an instr.\n  (func (result v128) (f64x2.convert_i64x2_s (v128.const i64x2 1 2)))\n                       ^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:633: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.10.wat:1:22: error: unexpected token \"f64x2.convert_i64x2_u\", expected an instr.\n  (func (result v128) (f64x2.convert_i64x2_u (v128.const i64x2 1 2)))\n                       ^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:637: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.11.wat:1:22: error: unexpected token \"i8x16.narrow_i16x8\", expected an instr.\n  (func (result v128) (i8x16.narrow_i16x8 (v128.const i16x8 0 0 0 0 0 0 0 0) (v...\n                       ^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:640: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.12.wat:1:22: error: unexpected token \"i16x8.narrow_i8x16\", expected an instr.\n  (func (result v128) (i16x8.narrow_i8x16 (v128.const i16x8 0 0 0 0 0 0 0 0) (v...\n                       ^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:643: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.13.wat:1:22: error: unexpected token \"i16x8.narrow_i8x16_s\", expected an instr.\n  (func (result v128) (i16x8.narrow_i8x16_s (v128.const i8x16 0 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:646: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.14.wat:1:22: error: unexpected token \"i16x8.narrow_i8x16_u\", expected an instr.\n  (func (result v128) (i16x8.narrow_i8x16_u (v128.const i8x16 0 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:649: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.15.wat:1:22: error: unexpected token \"i16x8.narrow_i32x4\", expected an instr.\n  (func (result v128) (i16x8.narrow_i32x4 (v128.const i16x8 0 0 0 0 0 0 0 0) (v...\n                       ^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:652: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.16.wat:1:22: error: unexpected token \"i32x4.narrow_i16x8\", expected an instr.\n  (func (result v128) (i32x4.narrow_i16x8 (v128.const i16x8 0 0 0 0 0 0 0 0) (v...\n                       ^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:655: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.17.wat:1:22: error: unexpected token \"i32x4.narrow_i16x8_s\", expected an instr.\n  (func (result v128) (i32x4.narrow_i16x8_s (v128.const i8x16 0 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:658: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.18.wat:1:22: error: unexpected token \"i32x4.narrow_i16x8_u\", expected an instr.\n  (func (result v128) (i32x4.narrow_i16x8_u (v128.const i8x16 0 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:662: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.19.wat:1:22: error: unexpected token \"i16x8.extend_low_i8x16\", expected an instr.\n  (func (result v128) (i16x8.extend_low_i8x16 (v128.const i8x16 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:665: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.20.wat:1:22: error: unexpected token \"i8x16.extend_low_i16x8_s\", expected an instr.\n  (func (result v128) (i8x16.extend_low_i16x8_s (v128.const i16x8 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:668: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.21.wat:1:22: error: unexpected token \"i8x16.extend_low_i16x8_u\", expected an instr.\n  (func (result v128) (i8x16.extend_low_i16x8_u (v128.const i16x8 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:671: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.22.wat:1:22: error: unexpected token \"i16x8.extend_high_i8x16\", expected an instr.\n  (func (result v128) (i16x8.extend_high_i8x16 (v128.const i8x16 0 0 0 0 0 0 0 ...\n                       ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:674: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.23.wat:1:22: error: unexpected token \"i8x16.extend_high_i16x8_s\", expected an instr.\n  (func (result v128) (i8x16.extend_high_i16x8_s (v128.const i16x8 0 0 0 0 0 0 ...\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:677: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.24.wat:1:22: error: unexpected token \"i8x16.extend_high_i16x8_u\", expected an instr.\n  (func (result v128) (i8x16.extend_high_i16x8_u (v128.const i16x8 0 0 0 0 0 0 ...\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:680: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.25.wat:1:22: error: unexpected token \"i32x4.extend_low_i16x8\", expected an instr.\n  (func (result v128) (i32x4.extend_low_i16x8 (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                       ^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:683: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.26.wat:1:22: error: unexpected token \"i16x8.extend_low_i32x4_s\", expected an instr.\n  (func (result v128) (i16x8.extend_low_i32x4_s (v128.const i32x4 0 0 0 0)))\n                       ^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:686: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.27.wat:1:22: error: unexpected token \"i16x8.extend_low_i32x4_u\", expected an instr.\n  (func (result v128) (i16x8.extend_low_i32x4_u (v128.const i32x4 0 0 0 0)))\n                       ^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:689: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.28.wat:1:22: error: unexpected token \"i32x4.extend_high_i16x8\", expected an instr.\n  (func (result v128) (i32x4.extend_high_i16x8 (v128.const i16x8 0 0 0 0 0 0 0 ...\n                       ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:692: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.29.wat:1:22: error: unexpected token \"i16x8.extend_high_i32x4_s\", expected an instr.\n  (func (result v128) (i16x8.extend_high_i32x4_s (v128.const i32x4 0 0 0 0)))\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:695: assert_malformed passed:\n  out/test/spec/simd_conversions/simd_conversions.30.wat:1:22: error: unexpected token \"i16x8.extend_high_i32x4_u\", expected an instr.\n  (func (result v128) (i16x8.extend_high_i32x4_u (v128.const i32x4 0 0 0 0)))\n                       ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_conversions.wast:702: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.31.wasm:000001d: error: type mismatch in f32x4.convert_i32x4_s, expected [v128] but got [i32]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/simd_conversions.wast:703: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.32.wasm:000001d: error: type mismatch in f32x4.convert_i32x4_s, expected [v128] but got [i64]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/simd_conversions.wast:704: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.33.wasm:000001d: error: type mismatch in f32x4.convert_i32x4_u, expected [v128] but got [i32]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/simd_conversions.wast:705: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.34.wasm:000001d: error: type mismatch in f32x4.convert_i32x4_u, expected [v128] but got [i64]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/simd_conversions.wast:707: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.35.wasm:000001e: error: type mismatch in i8x16.narrow_i16x8_s, expected [v128, v128] but got [i32, i64]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:708: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.36.wasm:000001e: error: type mismatch in i8x16.narrow_i16x8_u, expected [v128, v128] but got [i32, i64]\n  000001e: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:709: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.37.wasm:0000029: error: type mismatch in i16x8.narrow_i32x4_s, expected [v128, v128] but got [f32, f64]\n  0000029: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:710: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.38.wasm:0000029: error: type mismatch in i16x8.narrow_i32x4_s, expected [v128, v128] but got [f32, f64]\n  0000029: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:821: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.40.wasm:000001b: error: type mismatch in f32x4.convert_i32x4_s, expected [v128] but got []\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/simd_conversions.wast:829: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.41.wasm:000001b: error: type mismatch in f32x4.convert_i32x4_u, expected [v128] but got []\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/simd_conversions.wast:837: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.42.wasm:000002c: error: type mismatch in i8x16.narrow_i16x8_s, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:845: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.43.wasm:000001a: error: type mismatch in i8x16.narrow_i16x8_s, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:853: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.44.wasm:000002c: error: type mismatch in i8x16.narrow_i16x8_u, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:861: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.45.wasm:000001a: error: type mismatch in i8x16.narrow_i16x8_u, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:869: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.46.wasm:000002d: error: type mismatch in i16x8.narrow_i32x4_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:877: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.47.wasm:000001b: error: type mismatch in i16x8.narrow_i32x4_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:885: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.48.wasm:000002d: error: type mismatch in i16x8.narrow_i32x4_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_conversions.wast:893: assert_invalid passed:\n  out/test/spec/simd_conversions/simd_conversions.49.wasm:000001b: error: type mismatch in i16x8.narrow_i32x4_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n282/282 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f32x4.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f32x4.wast:2325: assert_malformed passed:\n  out/test/spec/simd_f32x4/simd_f32x4.1.wat:1:33: error: unexpected token \"i8x16.min\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.min (v128.const i32x4 0 0 0 0) (v128.co...\n                                  ^^^^^^^^^\nout/test/spec/simd_f32x4.wast:2326: assert_malformed passed:\n  out/test/spec/simd_f32x4/simd_f32x4.2.wat:1:33: error: unexpected token \"i8x16.max\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.max (v128.const i32x4 0 0 0 0) (v128.co...\n                                  ^^^^^^^^^\nout/test/spec/simd_f32x4.wast:2327: assert_malformed passed:\n  out/test/spec/simd_f32x4/simd_f32x4.3.wat:1:33: error: unexpected token \"i16x8.min\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.min (v128.const i32x4 0 0 0 0) (v128.co...\n                                  ^^^^^^^^^\nout/test/spec/simd_f32x4.wast:2328: assert_malformed passed:\n  out/test/spec/simd_f32x4/simd_f32x4.4.wat:1:33: error: unexpected token \"i16x8.max\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.max (v128.const i32x4 0 0 0 0) (v128.co...\n                                  ^^^^^^^^^\nout/test/spec/simd_f32x4.wast:2329: assert_malformed passed:\n  out/test/spec/simd_f32x4/simd_f32x4.5.wat:1:33: error: unexpected token \"i32x4.min\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.min (v128.const i32x4 0 0 0 0) (v128.co...\n                                  ^^^^^^^^^\nout/test/spec/simd_f32x4.wast:2330: assert_malformed passed:\n  out/test/spec/simd_f32x4/simd_f32x4.6.wat:1:33: error: unexpected token \"i32x4.max\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.max (v128.const i32x4 0 0 0 0) (v128.co...\n                                  ^^^^^^^^^\nout/test/spec/simd_f32x4.wast:2331: assert_malformed passed:\n  out/test/spec/simd_f32x4/simd_f32x4.7.wat:1:33: error: unexpected token \"i64x2.min\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.min (v128.const i32x4 0 0 0 0) (v128.co...\n                                  ^^^^^^^^^\nout/test/spec/simd_f32x4.wast:2332: assert_malformed passed:\n  out/test/spec/simd_f32x4/simd_f32x4.8.wat:1:33: error: unexpected token \"i64x2.max\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.max (v128.const i32x4 0 0 0 0) (v128.co...\n                                  ^^^^^^^^^\nout/test/spec/simd_f32x4.wast:2335: assert_invalid passed:\n  out/test/spec/simd_f32x4/simd_f32x4.9.wasm:000001d: error: type mismatch in f32x4.abs, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4.wast:2336: assert_invalid passed:\n  out/test/spec/simd_f32x4/simd_f32x4.10.wasm:0000022: error: type mismatch in f32x4.min, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4.wast:2337: assert_invalid passed:\n  out/test/spec/simd_f32x4/simd_f32x4.11.wasm:0000022: error: type mismatch in f32x4.max, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4.wast:2342: assert_invalid passed:\n  out/test/spec/simd_f32x4/simd_f32x4.12.wasm:000001b: error: type mismatch in f32x4.abs, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4.wast:2350: assert_invalid passed:\n  out/test/spec/simd_f32x4/simd_f32x4.13.wasm:000002d: error: type mismatch in f32x4.min, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4.wast:2358: assert_invalid passed:\n  out/test/spec/simd_f32x4/simd_f32x4.14.wasm:000001b: error: type mismatch in f32x4.min, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4.wast:2366: assert_invalid passed:\n  out/test/spec/simd_f32x4/simd_f32x4.15.wasm:000002d: error: type mismatch in f32x4.max, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4.wast:2374: assert_invalid passed:\n  out/test/spec/simd_f32x4/simd_f32x4.16.wasm:000001b: error: type mismatch in f32x4.max, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n790/790 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f32x4_arith.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4_arith.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f32x4_arith.wast:5295: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.2.wasm:000001d: error: type mismatch in f32x4.neg, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5296: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.3.wasm:000001d: error: type mismatch in f32x4.sqrt, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5297: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.4.wasm:0000022: error: type mismatch in f32x4.add, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5298: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.5.wasm:0000022: error: type mismatch in f32x4.sub, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5299: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.6.wasm:0000022: error: type mismatch in f32x4.mul, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5300: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.7.wasm:0000022: error: type mismatch in f32x4.div, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5305: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.8.wasm:000001b: error: type mismatch in f32x4.neg, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5313: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.9.wasm:000001b: error: type mismatch in f32x4.sqrt, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5321: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.10.wasm:000002d: error: type mismatch in f32x4.add, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5329: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.11.wasm:000001b: error: type mismatch in f32x4.add, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5337: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.12.wasm:000002d: error: type mismatch in f32x4.sub, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5345: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.13.wasm:000001b: error: type mismatch in f32x4.sub, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5353: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.14.wasm:000002d: error: type mismatch in f32x4.mul, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5361: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.15.wasm:000001b: error: type mismatch in f32x4.mul, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5369: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.16.wasm:000002d: error: type mismatch in f32x4.div, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_arith.wast:5377: assert_invalid passed:\n  out/test/spec/simd_f32x4_arith/simd_f32x4_arith.17.wasm:000001b: error: type mismatch in f32x4.div, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n1822/1822 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f32x4_cmp.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4_cmp.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f32x4_cmp.wast:7779: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.1.wasm:0000025: error: type mismatch in f32x4.eq, expected [v128, v128] but got [i64, f64]\n  0000025: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:7780: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.2.wasm:0000025: error: type mismatch in f32x4.ge, expected [v128, v128] but got [i64, f64]\n  0000025: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:7781: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.3.wasm:0000025: error: type mismatch in f32x4.gt, expected [v128, v128] but got [i64, f64]\n  0000025: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:7782: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.4.wasm:0000025: error: type mismatch in f32x4.le, expected [v128, v128] but got [i64, f64]\n  0000025: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:7783: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.5.wasm:0000025: error: type mismatch in f32x4.lt, expected [v128, v128] but got [i64, f64]\n  0000025: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:7784: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.6.wasm:0000025: error: type mismatch in f32x4.ne, expected [v128, v128] but got [i64, f64]\n  0000025: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:7789: assert_malformed passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.7.wat:1:65: error: unexpected token \"f4x32.eq\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f4x32.eq (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f32x4_cmp.wast:7790: assert_malformed passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.8.wat:1:65: error: unexpected token \"f4x32.ge\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f4x32.ge (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f32x4_cmp.wast:7791: assert_malformed passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.9.wat:1:65: error: unexpected token \"f4x32.gt\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f4x32.gt (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f32x4_cmp.wast:7792: assert_malformed passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.10.wat:1:65: error: unexpected token \"f4x32.le\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f4x32.le (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f32x4_cmp.wast:7793: assert_malformed passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.11.wat:1:65: error: unexpected token \"f4x32.lt\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f4x32.lt (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f32x4_cmp.wast:7794: assert_malformed passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.12.wat:1:65: error: unexpected token \"f4x32.ne\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f4x32.ne (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f32x4_cmp.wast:8073: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.14.wasm:000002c: error: type mismatch in f32x4.eq, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8081: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.15.wasm:000001a: error: type mismatch in f32x4.eq, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8089: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.16.wasm:000002c: error: type mismatch in f32x4.ne, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8097: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.17.wasm:000001a: error: type mismatch in f32x4.ne, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8105: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.18.wasm:000002c: error: type mismatch in f32x4.lt, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8113: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.19.wasm:000001a: error: type mismatch in f32x4.lt, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8121: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.20.wasm:000002c: error: type mismatch in f32x4.le, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8129: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.21.wasm:000001a: error: type mismatch in f32x4.le, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8137: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.22.wasm:000002c: error: type mismatch in f32x4.gt, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8145: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.23.wasm:000001a: error: type mismatch in f32x4.gt, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8153: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.24.wasm:000002c: error: type mismatch in f32x4.ge, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f32x4_cmp.wast:8161: assert_invalid passed:\n  out/test/spec/simd_f32x4_cmp/simd_f32x4_cmp.25.wasm:000001a: error: type mismatch in f32x4.ge, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\n2607/2607 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f32x4_pmin_pmax.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4_pmin_pmax.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f32x4_pmin_pmax.wast:11629: assert_malformed passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.1.wat:1:33: error: unexpected token \"i8x16.pmin\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.pmin (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_pmin_pmax.wast:11630: assert_malformed passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.2.wat:1:33: error: unexpected token \"i8x16.pmax\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.pmax (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_pmin_pmax.wast:11631: assert_malformed passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.3.wat:1:33: error: unexpected token \"i16x8.pmin\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.pmin (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_pmin_pmax.wast:11632: assert_malformed passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.4.wat:1:33: error: unexpected token \"i16x8.pmax\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.pmax (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_pmin_pmax.wast:11633: assert_malformed passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.5.wat:1:33: error: unexpected token \"i32x4.pmin\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.pmin (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_pmin_pmax.wast:11634: assert_malformed passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.6.wat:1:33: error: unexpected token \"i32x4.pmax\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.pmax (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_pmin_pmax.wast:11635: assert_malformed passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.7.wat:1:33: error: unexpected token \"i64x2.pmin\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.pmin (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_pmin_pmax.wast:11636: assert_malformed passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.8.wat:1:33: error: unexpected token \"i64x2.pmax\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.pmax (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_pmin_pmax.wast:11639: assert_invalid passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.9.wasm:0000022: error: type mismatch in f32x4.pmin, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_pmin_pmax.wast:11640: assert_invalid passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.10.wasm:0000022: error: type mismatch in f32x4.pmax, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_pmin_pmax.wast:11645: assert_invalid passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.11.wasm:000002d: error: type mismatch in f32x4.pmin, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_pmin_pmax.wast:11653: assert_invalid passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.12.wasm:000001b: error: type mismatch in f32x4.pmin, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_pmin_pmax.wast:11661: assert_invalid passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.13.wasm:000002d: error: type mismatch in f32x4.pmax, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f32x4_pmin_pmax.wast:11669: assert_invalid passed:\n  out/test/spec/simd_f32x4_pmin_pmax/simd_f32x4_pmin_pmax.14.wasm:000001b: error: type mismatch in f32x4.pmax, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n3887/3887 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f32x4_rounding.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4_rounding.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f32x4_rounding.wast:367: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.1.wat:1:33: error: unexpected token \"i8x16.ceil\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.ceil (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:368: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.2.wat:1:33: error: unexpected token \"i8x16.floor\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.floor (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:369: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.3.wat:1:33: error: unexpected token \"i8x16.trunc\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.trunc (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:370: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.4.wat:1:33: error: unexpected token \"i8x16.nearest\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.nearest (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:371: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.5.wat:1:33: error: unexpected token \"i16x8.ceil\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.ceil (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:372: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.6.wat:1:33: error: unexpected token \"i16x8.floor\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.floor (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:373: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.7.wat:1:33: error: unexpected token \"i16x8.trunc\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.trunc (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:374: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.8.wat:1:33: error: unexpected token \"i16x8.nearest\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.nearest (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:375: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.9.wat:1:33: error: unexpected token \"i32x4.ceil\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.ceil (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:376: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.10.wat:1:33: error: unexpected token \"i32x4.floor\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.floor (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:377: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.11.wat:1:33: error: unexpected token \"i32x4.trunc\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.trunc (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:378: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.12.wat:1:33: error: unexpected token \"i32x4.nearest\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.nearest (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:379: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.13.wat:1:33: error: unexpected token \"i64x2.ceil\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.ceil (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:380: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.14.wat:1:33: error: unexpected token \"i64x2.floor\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.floor (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:381: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.15.wat:1:33: error: unexpected token \"i64x2.trunc\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.trunc (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:382: assert_malformed passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.16.wat:1:33: error: unexpected token \"i64x2.nearest\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.nearest (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^^^\nout/test/spec/simd_f32x4_rounding.wast:385: assert_invalid passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.17.wasm:000001c: error: type mismatch in f32x4.ceil, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_rounding.wast:386: assert_invalid passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.18.wasm:000001c: error: type mismatch in f32x4.floor, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_rounding.wast:387: assert_invalid passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.19.wasm:000001c: error: type mismatch in f32x4.trunc, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_rounding.wast:388: assert_invalid passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.20.wasm:000001c: error: type mismatch in f32x4.nearest, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_rounding.wast:393: assert_invalid passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.21.wasm:000001a: error: type mismatch in f32x4.ceil, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_rounding.wast:401: assert_invalid passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.22.wasm:000001a: error: type mismatch in f32x4.floor, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_rounding.wast:409: assert_invalid passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.23.wasm:000001a: error: type mismatch in f32x4.trunc, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_f32x4_rounding.wast:417: assert_invalid passed:\n  out/test/spec/simd_f32x4_rounding/simd_f32x4_rounding.24.wasm:000001a: error: type mismatch in f32x4.nearest, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\n201/201 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f64x2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f64x2.wast:2387: assert_invalid passed:\n  out/test/spec/simd_f64x2/simd_f64x2.1.wasm:000001d: error: type mismatch in f64x2.abs, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2.wast:2388: assert_invalid passed:\n  out/test/spec/simd_f64x2/simd_f64x2.2.wasm:0000022: error: type mismatch in f64x2.min, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2.wast:2389: assert_invalid passed:\n  out/test/spec/simd_f64x2/simd_f64x2.3.wasm:0000022: error: type mismatch in f64x2.max, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2.wast:2394: assert_invalid passed:\n  out/test/spec/simd_f64x2/simd_f64x2.4.wasm:000001b: error: type mismatch in f64x2.abs, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2.wast:2402: assert_invalid passed:\n  out/test/spec/simd_f64x2/simd_f64x2.5.wasm:000002d: error: type mismatch in f64x2.min, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2.wast:2410: assert_invalid passed:\n  out/test/spec/simd_f64x2/simd_f64x2.6.wasm:000001b: error: type mismatch in f64x2.min, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2.wast:2418: assert_invalid passed:\n  out/test/spec/simd_f64x2/simd_f64x2.7.wasm:000002d: error: type mismatch in f64x2.max, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2.wast:2426: assert_invalid passed:\n  out/test/spec/simd_f64x2/simd_f64x2.8.wasm:000001b: error: type mismatch in f64x2.max, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n803/803 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f64x2_arith.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2_arith.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f64x2_arith.wast:5302: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.2.wasm:000001d: error: type mismatch in f64x2.neg, expected [v128] but got [i64]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5303: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.3.wasm:000001d: error: type mismatch in f64x2.sqrt, expected [v128] but got [i64]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5304: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.4.wasm:0000026: error: type mismatch in f64x2.add, expected [v128, v128] but got [i64, f64]\n  0000026: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5305: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.5.wasm:0000026: error: type mismatch in f64x2.sub, expected [v128, v128] but got [i64, f64]\n  0000026: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5306: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.6.wasm:0000026: error: type mismatch in f64x2.mul, expected [v128, v128] but got [i64, f64]\n  0000026: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5307: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.7.wasm:0000026: error: type mismatch in f64x2.div, expected [v128, v128] but got [i64, f64]\n  0000026: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5312: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.8.wasm:000001b: error: type mismatch in f64x2.neg, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5320: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.9.wasm:000001b: error: type mismatch in f64x2.sqrt, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5328: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.10.wasm:000002d: error: type mismatch in f64x2.add, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5336: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.11.wasm:000001b: error: type mismatch in f64x2.add, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5344: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.12.wasm:000002d: error: type mismatch in f64x2.sub, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5352: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.13.wasm:000001b: error: type mismatch in f64x2.sub, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5360: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.14.wasm:000002d: error: type mismatch in f64x2.mul, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5368: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.15.wasm:000001b: error: type mismatch in f64x2.mul, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5376: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.16.wasm:000002d: error: type mismatch in f64x2.div, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_arith.wast:5384: assert_invalid passed:\n  out/test/spec/simd_f64x2_arith/simd_f64x2_arith.17.wasm:000001b: error: type mismatch in f64x2.div, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n1825/1825 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f64x2_cmp.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2_cmp.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f64x2_cmp.wast:7954: assert_malformed passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.1.wat:1:66: error: unexpected token \"f2x64.eq\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f2x64.eq (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f64x2_cmp.wast:7955: assert_malformed passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.2.wat:1:66: error: unexpected token \"f2x64.ne\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f2x64.ne (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f64x2_cmp.wast:7956: assert_malformed passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.3.wat:1:66: error: unexpected token \"f2x64.lt\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f2x64.lt (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f64x2_cmp.wast:7957: assert_malformed passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.4.wat:1:66: error: unexpected token \"f2x64.le\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f2x64.le (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f64x2_cmp.wast:7958: assert_malformed passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.5.wat:1:66: error: unexpected token \"f2x64.gt\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f2x64.gt (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f64x2_cmp.wast:7959: assert_malformed passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.6.wat:1:66: error: unexpected token \"f2x64.ge\", expected an instr.\n  ...v128) (param $y v128) (result v128) (f2x64.ge (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_f64x2_cmp.wast:7962: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.7.wasm:0000021: error: type mismatch in f64x2.eq, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7963: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.8.wasm:0000021: error: type mismatch in f64x2.ne, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7964: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.9.wasm:0000021: error: type mismatch in f64x2.lt, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7965: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.10.wasm:0000021: error: type mismatch in f64x2.le, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7966: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.11.wasm:0000021: error: type mismatch in f64x2.gt, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7967: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.12.wasm:0000021: error: type mismatch in f64x2.ge, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7972: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.13.wasm:000002c: error: type mismatch in f64x2.eq, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7980: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.14.wasm:000001a: error: type mismatch in f64x2.eq, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7988: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.15.wasm:000002c: error: type mismatch in f64x2.ne, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:7996: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.16.wasm:000001a: error: type mismatch in f64x2.ne, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:8004: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.17.wasm:000002c: error: type mismatch in f64x2.lt, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:8012: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.18.wasm:000001a: error: type mismatch in f64x2.lt, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:8020: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.19.wasm:000002c: error: type mismatch in f64x2.le, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:8028: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.20.wasm:000001a: error: type mismatch in f64x2.le, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:8036: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.21.wasm:000002c: error: type mismatch in f64x2.gt, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:8044: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.22.wasm:000001a: error: type mismatch in f64x2.gt, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:8052: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.23.wasm:000002c: error: type mismatch in f64x2.ge, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_f64x2_cmp.wast:8060: assert_invalid passed:\n  out/test/spec/simd_f64x2_cmp/simd_f64x2_cmp.24.wasm:000001a: error: type mismatch in f64x2.ge, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\n2685/2685 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f64x2_pmin_pmax.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2_pmin_pmax.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f64x2_pmin_pmax.wast:11629: assert_malformed passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.1.wat:1:33: error: unexpected token \"i8x16.pmin\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.pmin (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_pmin_pmax.wast:11630: assert_malformed passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.2.wat:1:33: error: unexpected token \"i8x16.pmax\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.pmax (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_pmin_pmax.wast:11631: assert_malformed passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.3.wat:1:33: error: unexpected token \"i16x8.pmin\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.pmin (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_pmin_pmax.wast:11632: assert_malformed passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.4.wat:1:33: error: unexpected token \"i16x8.pmax\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.pmax (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_pmin_pmax.wast:11633: assert_malformed passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.5.wat:1:33: error: unexpected token \"i32x4.pmin\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.pmin (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_pmin_pmax.wast:11634: assert_malformed passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.6.wat:1:33: error: unexpected token \"i32x4.pmax\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.pmax (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_pmin_pmax.wast:11635: assert_malformed passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.7.wat:1:33: error: unexpected token \"i64x2.pmin\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.pmin (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_pmin_pmax.wast:11636: assert_malformed passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.8.wat:1:33: error: unexpected token \"i64x2.pmax\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.pmax (v128.const i32x4 0 0 0 0) (v128.c...\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_pmin_pmax.wast:11639: assert_invalid passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.9.wasm:0000022: error: type mismatch in f64x2.pmin, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_pmin_pmax.wast:11640: assert_invalid passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.10.wasm:0000022: error: type mismatch in f64x2.pmax, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_pmin_pmax.wast:11645: assert_invalid passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.11.wasm:000002d: error: type mismatch in f64x2.pmin, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_pmin_pmax.wast:11653: assert_invalid passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.12.wasm:000001b: error: type mismatch in f64x2.pmin, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_pmin_pmax.wast:11661: assert_invalid passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.13.wasm:000002d: error: type mismatch in f64x2.pmax, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_f64x2_pmin_pmax.wast:11669: assert_invalid passed:\n  out/test/spec/simd_f64x2_pmin_pmax/simd_f64x2_pmin_pmax.14.wasm:000001b: error: type mismatch in f64x2.pmax, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n3887/3887 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_f64x2_rounding.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2_rounding.wast\n(;; STDOUT ;;;\nout/test/spec/simd_f64x2_rounding.wast:367: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.1.wat:1:33: error: unexpected token \"i8x16.ceil\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.ceil (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:368: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.2.wat:1:33: error: unexpected token \"i8x16.floor\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.floor (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:369: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.3.wat:1:33: error: unexpected token \"i8x16.trunc\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.trunc (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:370: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.4.wat:1:33: error: unexpected token \"i8x16.nearest\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.nearest (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:371: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.5.wat:1:33: error: unexpected token \"i16x8.ceil\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.ceil (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:372: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.6.wat:1:33: error: unexpected token \"i16x8.floor\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.floor (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:373: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.7.wat:1:33: error: unexpected token \"i16x8.trunc\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.trunc (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:374: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.8.wat:1:33: error: unexpected token \"i16x8.nearest\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.nearest (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:375: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.9.wat:1:33: error: unexpected token \"i32x4.ceil\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.ceil (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:376: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.10.wat:1:33: error: unexpected token \"i32x4.floor\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.floor (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:377: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.11.wat:1:33: error: unexpected token \"i32x4.trunc\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.trunc (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:378: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.12.wat:1:33: error: unexpected token \"i32x4.nearest\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.nearest (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:379: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.13.wat:1:33: error: unexpected token \"i64x2.ceil\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.ceil (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:380: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.14.wat:1:33: error: unexpected token \"i64x2.floor\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.floor (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:381: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.15.wat:1:33: error: unexpected token \"i64x2.trunc\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.trunc (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:382: assert_malformed passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.16.wat:1:33: error: unexpected token \"i64x2.nearest\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.nearest (v128.const i32x4 0 0 0 0)))\n                                  ^^^^^^^^^^^^^\nout/test/spec/simd_f64x2_rounding.wast:385: assert_invalid passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.17.wasm:000001c: error: type mismatch in f64x2.ceil, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_rounding.wast:386: assert_invalid passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.18.wasm:000001c: error: type mismatch in f64x2.floor, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_rounding.wast:387: assert_invalid passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.19.wasm:000001c: error: type mismatch in f64x2.trunc, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_rounding.wast:388: assert_invalid passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.20.wasm:000001d: error: type mismatch in f64x2.nearest, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_rounding.wast:393: assert_invalid passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.21.wasm:000001a: error: type mismatch in f64x2.ceil, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_rounding.wast:401: assert_invalid passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.22.wasm:000001a: error: type mismatch in f64x2.floor, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_rounding.wast:409: assert_invalid passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.23.wasm:000001a: error: type mismatch in f64x2.trunc, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_f64x2_rounding.wast:417: assert_invalid passed:\n  out/test/spec/simd_f64x2_rounding/simd_f64x2_rounding.24.wasm:000001b: error: type mismatch in f64x2.nearest, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\n201/201 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i16x8_arith.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_arith.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i16x8_arith.wast:528: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.1.wasm:000001d: error: type mismatch in i16x8.neg, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:529: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.2.wasm:0000022: error: type mismatch in i16x8.add, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:530: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.3.wasm:0000022: error: type mismatch in i16x8.sub, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:531: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.4.wasm:0000022: error: type mismatch in i16x8.mul, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:536: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.5.wasm:000001b: error: type mismatch in i16x8.neg, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:544: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.6.wasm:000002d: error: type mismatch in i16x8.add, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:552: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.7.wasm:000001b: error: type mismatch in i16x8.add, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:560: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.8.wasm:000002d: error: type mismatch in i16x8.sub, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:568: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.9.wasm:000001b: error: type mismatch in i16x8.sub, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:576: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.10.wasm:000002d: error: type mismatch in i16x8.mul, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith.wast:584: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith/simd_i16x8_arith.11.wasm:000001b: error: type mismatch in i16x8.mul, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n194/194 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i16x8_arith2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_arith2.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i16x8_arith2.wast:337: assert_malformed passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.1.wat:1:33: error: unexpected token \"i16x8.avgr\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.avgr (v128.const i16x8 0 0 0 0 0 0 0 0)...\n                                  ^^^^^^^^^^\nout/test/spec/simd_i16x8_arith2.wast:338: assert_malformed passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.2.wat:1:33: error: unexpected token \"i16x8.avgr_s\", expected an instr.\n  (memory 1) (func (result v128) (i16x8.avgr_s (v128.const i16x8 0 0 0 0 0 0 0 ...\n                                  ^^^^^^^^^^^^\nout/test/spec/simd_i16x8_arith2.wast:341: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.3.wasm:0000022: error: type mismatch in i16x8.min_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:342: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.4.wasm:0000022: error: type mismatch in i16x8.min_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:343: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.5.wasm:0000022: error: type mismatch in i16x8.max_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:344: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.6.wasm:0000022: error: type mismatch in i16x8.max_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:345: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.7.wasm:0000022: error: type mismatch in i16x8.avgr_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:346: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.8.wasm:0000020: error: type mismatch in i16x8.abs, expected [v128] but got [f32]\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:351: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.9.wasm:000002d: error: type mismatch in i16x8.min_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:359: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.10.wasm:000001b: error: type mismatch in i16x8.min_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:367: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.11.wasm:000002d: error: type mismatch in i16x8.min_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:375: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.12.wasm:000001b: error: type mismatch in i16x8.min_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:383: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.13.wasm:000002d: error: type mismatch in i16x8.max_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:391: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.14.wasm:000001b: error: type mismatch in i16x8.max_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:399: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.15.wasm:000002d: error: type mismatch in i16x8.max_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:407: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.16.wasm:000001b: error: type mismatch in i16x8.max_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:415: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.17.wasm:000002d: error: type mismatch in i16x8.avgr_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:423: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.18.wasm:000001b: error: type mismatch in i16x8.avgr_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_arith2.wast:431: assert_invalid passed:\n  out/test/spec/simd_i16x8_arith2/simd_i16x8_arith2.19.wasm:000001b: error: type mismatch in i16x8.abs, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\n172/172 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i16x8_cmp.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_cmp.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i16x8_cmp.wast:1455: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.1.wasm:0000021: error: type mismatch in i16x8.eq, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1456: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.2.wasm:0000021: error: type mismatch in i16x8.ge_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1457: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.3.wasm:0000021: error: type mismatch in i16x8.ge_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1458: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.4.wasm:0000021: error: type mismatch in i16x8.gt_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1459: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.5.wasm:0000021: error: type mismatch in i16x8.gt_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1460: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.6.wasm:0000021: error: type mismatch in i16x8.le_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1461: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.7.wasm:0000021: error: type mismatch in i16x8.le_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1462: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.8.wasm:0000021: error: type mismatch in i16x8.lt_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1463: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.9.wasm:0000021: error: type mismatch in i16x8.lt_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1464: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.10.wasm:0000021: error: type mismatch in i16x8.ne, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1743: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.12.wasm:000002c: error: type mismatch in i16x8.eq, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1751: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.13.wasm:000001a: error: type mismatch in i16x8.eq, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1759: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.14.wasm:000002c: error: type mismatch in i16x8.ne, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1767: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.15.wasm:000001a: error: type mismatch in i16x8.ne, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1775: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.16.wasm:000002c: error: type mismatch in i16x8.lt_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1783: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.17.wasm:000001a: error: type mismatch in i16x8.lt_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1791: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.18.wasm:000002c: error: type mismatch in i16x8.lt_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1799: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.19.wasm:000001a: error: type mismatch in i16x8.lt_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1807: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.20.wasm:000002c: error: type mismatch in i16x8.le_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1815: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.21.wasm:000001a: error: type mismatch in i16x8.le_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1823: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.22.wasm:000002c: error: type mismatch in i16x8.le_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1831: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.23.wasm:000001a: error: type mismatch in i16x8.le_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1839: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.24.wasm:000002c: error: type mismatch in i16x8.gt_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1847: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.25.wasm:000001a: error: type mismatch in i16x8.gt_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1855: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.26.wasm:000002c: error: type mismatch in i16x8.gt_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1863: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.27.wasm:000001a: error: type mismatch in i16x8.gt_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1871: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.28.wasm:000002c: error: type mismatch in i16x8.ge_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1879: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.29.wasm:000001a: error: type mismatch in i16x8.ge_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1887: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.30.wasm:000002c: error: type mismatch in i16x8.ge_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i16x8_cmp.wast:1895: assert_invalid passed:\n  out/test/spec/simd_i16x8_cmp/simd_i16x8_cmp.31.wasm:000001a: error: type mismatch in i16x8.ge_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\n465/465 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i16x8_extadd_pairwise_i8x16.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_extadd_pairwise_i8x16.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i16x8_extadd_pairwise_i8x16.wast:47: assert_invalid passed:\n  out/test/spec/simd_i16x8_extadd_pairwise_i8x16/simd_i16x8_extadd_pairwise_i8x16.1.wasm:000001c: error: type mismatch in i16x8.extadd_pairwise_i8x16_s, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_i16x8_extadd_pairwise_i8x16.wast:48: assert_invalid passed:\n  out/test/spec/simd_i16x8_extadd_pairwise_i8x16/simd_i16x8_extadd_pairwise_i8x16.2.wasm:000001c: error: type mismatch in i16x8.extadd_pairwise_i8x16_u, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_i16x8_extadd_pairwise_i8x16.wast:53: assert_invalid passed:\n  out/test/spec/simd_i16x8_extadd_pairwise_i8x16/simd_i16x8_extadd_pairwise_i8x16.3.wasm:000001a: error: type mismatch in i16x8.extadd_pairwise_i8x16_s, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_i16x8_extadd_pairwise_i8x16.wast:61: assert_invalid passed:\n  out/test/spec/simd_i16x8_extadd_pairwise_i8x16/simd_i16x8_extadd_pairwise_i8x16.4.wasm:000001a: error: type mismatch in i16x8.extadd_pairwise_i8x16_u, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\n21/21 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i16x8_extmul_i8x16.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_extmul_i8x16.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i16x8_extmul_i8x16.wast:333: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.1.wasm:0000022: error: type mismatch in i16x8.extmul_low_i8x16_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:334: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.2.wasm:0000022: error: type mismatch in i16x8.extmul_high_i8x16_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:335: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.3.wasm:0000022: error: type mismatch in i16x8.extmul_low_i8x16_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:336: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.4.wasm:0000022: error: type mismatch in i16x8.extmul_high_i8x16_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:341: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.5.wasm:000002d: error: type mismatch in i16x8.extmul_low_i8x16_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:349: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.6.wasm:000001b: error: type mismatch in i16x8.extmul_low_i8x16_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:357: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.7.wasm:000002d: error: type mismatch in i16x8.extmul_high_i8x16_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:365: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.8.wasm:000001b: error: type mismatch in i16x8.extmul_high_i8x16_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:373: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.9.wasm:000002d: error: type mismatch in i16x8.extmul_low_i8x16_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:381: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.10.wasm:000001b: error: type mismatch in i16x8.extmul_low_i8x16_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:389: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.11.wasm:000002d: error: type mismatch in i16x8.extmul_high_i8x16_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_extmul_i8x16.wast:397: assert_invalid passed:\n  out/test/spec/simd_i16x8_extmul_i8x16/simd_i16x8_extmul_i8x16.12.wasm:000001b: error: type mismatch in i16x8.extmul_high_i8x16_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n117/117 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i16x8_q15mulr_sat_s.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_q15mulr_sat_s.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i16x8_q15mulr_sat_s.wast:90: assert_invalid passed:\n  out/test/spec/simd_i16x8_q15mulr_sat_s/simd_i16x8_q15mulr_sat_s.1.wasm:0000022: error: type mismatch in i16x8.q15mulr_sat_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_q15mulr_sat_s.wast:95: assert_invalid passed:\n  out/test/spec/simd_i16x8_q15mulr_sat_s/simd_i16x8_q15mulr_sat_s.2.wasm:000002d: error: type mismatch in i16x8.q15mulr_sat_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_q15mulr_sat_s.wast:103: assert_invalid passed:\n  out/test/spec/simd_i16x8_q15mulr_sat_s/simd_i16x8_q15mulr_sat_s.3.wasm:000001b: error: type mismatch in i16x8.q15mulr_sat_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n30/30 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i16x8_sat_arith.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_sat_arith.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i16x8_sat_arith.wast:609: assert_malformed passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.1.wat:1:22: error: unexpected token \"i16x8.add_sat\", expected an instr.\n  (func (result v128) (i16x8.add_sat (v128.const i16x8 1 1 1 1 1 1 1 1) (v128.c...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_i16x8_sat_arith.wast:612: assert_malformed passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.2.wat:1:22: error: unexpected token \"i16x8.sub_sat\", expected an instr.\n  (func (result v128) (i16x8.sub_sat (v128.const i16x8 1 1 1 1 1 1 1 1) (v128.c...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_i16x8_sat_arith.wast:615: assert_malformed passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.3.wat:1:22: error: unexpected token \"i16x8.mul_sat\", expected an instr.\n  (func (result v128) (i16x8.mul_sat (v128.const i16x8 1 1 1 1 1 1 1 1) (v128.c...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_i16x8_sat_arith.wast:618: assert_malformed passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.4.wat:1:22: error: unexpected token \"i16x8.div_sat\", expected an instr.\n  (func (result v128) (i16x8.div_sat (v128.const i16x8 1 1 1 1 1 1 1 1) (v128.c...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_i16x8_sat_arith.wast:623: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.5.wasm:0000022: error: type mismatch in i16x8.add_sat_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:624: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.6.wasm:0000022: error: type mismatch in i16x8.add_sat_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:625: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.7.wasm:0000022: error: type mismatch in i16x8.sub_sat_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:626: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.8.wasm:0000022: error: type mismatch in i16x8.sub_sat_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:631: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.9.wasm:000002d: error: type mismatch in i16x8.add_sat_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:639: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.10.wasm:000001b: error: type mismatch in i16x8.add_sat_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:647: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.11.wasm:000002d: error: type mismatch in i16x8.add_sat_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:655: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.12.wasm:000001b: error: type mismatch in i16x8.add_sat_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:663: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.13.wasm:000002d: error: type mismatch in i16x8.sub_sat_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:671: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.14.wasm:000001b: error: type mismatch in i16x8.sub_sat_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:679: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.15.wasm:000002d: error: type mismatch in i16x8.sub_sat_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i16x8_sat_arith.wast:687: assert_invalid passed:\n  out/test/spec/simd_i16x8_sat_arith/simd_i16x8_sat_arith.16.wasm:000001b: error: type mismatch in i16x8.sub_sat_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n222/222 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i32x4_arith.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_arith.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i32x4_arith.wast:528: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.1.wasm:000001d: error: type mismatch in i32x4.neg, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:529: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.2.wasm:0000022: error: type mismatch in i32x4.add, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:530: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.3.wasm:0000022: error: type mismatch in i32x4.sub, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:531: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.4.wasm:0000022: error: type mismatch in i32x4.mul, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:536: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.5.wasm:000001b: error: type mismatch in i32x4.neg, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:544: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.6.wasm:000002d: error: type mismatch in i32x4.add, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:552: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.7.wasm:000001b: error: type mismatch in i32x4.add, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:560: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.8.wasm:000002d: error: type mismatch in i32x4.sub, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:568: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.9.wasm:000001b: error: type mismatch in i32x4.sub, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:576: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.10.wasm:000002d: error: type mismatch in i32x4.mul, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith.wast:584: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith/simd_i32x4_arith.11.wasm:000001b: error: type mismatch in i32x4.mul, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n194/194 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i32x4_arith2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_arith2.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i32x4_arith2.wast:281: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.1.wat:1:33: error: unexpected token \"f32x4.min_s\", expected an instr.\n  (memory 1) (func (result v128) (f32x4.min_s (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:282: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.2.wat:1:33: error: unexpected token \"f32x4.min_u\", expected an instr.\n  (memory 1) (func (result v128) (f32x4.min_u (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:283: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.3.wat:1:33: error: unexpected token \"f32x4.max_s\", expected an instr.\n  (memory 1) (func (result v128) (f32x4.max_s (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:284: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.4.wat:1:33: error: unexpected token \"f32x4.max_u\", expected an instr.\n  (memory 1) (func (result v128) (f32x4.max_u (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:285: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.5.wat:1:33: error: unexpected token \"i64x2.min_s\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.min_s (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:286: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.6.wat:1:33: error: unexpected token \"i64x2.min_u\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.min_u (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:287: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.7.wat:1:33: error: unexpected token \"i64x2.max_s\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.max_s (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:288: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.8.wat:1:33: error: unexpected token \"i64x2.max_u\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.max_u (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:289: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.9.wat:1:33: error: unexpected token \"f64x2.min_s\", expected an instr.\n  (memory 1) (func (result v128) (f64x2.min_s (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:290: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.10.wat:1:33: error: unexpected token \"f64x2.min_u\", expected an instr.\n  (memory 1) (func (result v128) (f64x2.min_u (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:291: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.11.wat:1:33: error: unexpected token \"f64x2.max_s\", expected an instr.\n  (memory 1) (func (result v128) (f64x2.max_s (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:292: assert_malformed passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.12.wat:1:33: error: unexpected token \"f64x2.max_u\", expected an instr.\n  (memory 1) (func (result v128) (f64x2.max_u (v128.const i32x4 0 0 0 0) (v128....\n                                  ^^^^^^^^^^^\nout/test/spec/simd_i32x4_arith2.wast:295: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.13.wasm:0000022: error: type mismatch in i32x4.min_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:296: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.14.wasm:0000022: error: type mismatch in i32x4.min_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:297: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.15.wasm:0000022: error: type mismatch in i32x4.max_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:298: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.16.wasm:0000022: error: type mismatch in i32x4.max_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:299: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.17.wasm:0000020: error: type mismatch in i32x4.abs, expected [v128] but got [f32]\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:304: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.18.wasm:000002d: error: type mismatch in i32x4.min_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:312: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.19.wasm:000001b: error: type mismatch in i32x4.min_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:320: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.20.wasm:000002d: error: type mismatch in i32x4.min_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:328: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.21.wasm:000001b: error: type mismatch in i32x4.min_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:336: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.22.wasm:000002d: error: type mismatch in i32x4.max_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:344: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.23.wasm:000001b: error: type mismatch in i32x4.max_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:352: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.24.wasm:000002d: error: type mismatch in i32x4.max_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:360: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.25.wasm:000001b: error: type mismatch in i32x4.max_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_arith2.wast:368: assert_invalid passed:\n  out/test/spec/simd_i32x4_arith2/simd_i32x4_arith2.26.wasm:000001b: error: type mismatch in i32x4.abs, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\n149/149 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i32x4_cmp.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_cmp.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i32x4_cmp.wast:1461: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.1.wasm:0000021: error: type mismatch in i32x4.eq, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1462: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.2.wasm:0000021: error: type mismatch in i32x4.ge_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1463: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.3.wasm:0000021: error: type mismatch in i32x4.ge_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1464: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.4.wasm:0000021: error: type mismatch in i32x4.gt_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1465: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.5.wasm:0000021: error: type mismatch in i32x4.gt_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1466: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.6.wasm:0000021: error: type mismatch in i32x4.le_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1467: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.7.wasm:0000021: error: type mismatch in i32x4.le_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1468: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.8.wasm:0000021: error: type mismatch in i32x4.lt_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1469: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.9.wasm:0000021: error: type mismatch in i32x4.lt_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1470: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.10.wasm:0000021: error: type mismatch in i32x4.ne, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1749: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.12.wasm:000002c: error: type mismatch in i32x4.eq, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1757: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.13.wasm:000001a: error: type mismatch in i32x4.eq, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1765: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.14.wasm:000002c: error: type mismatch in i32x4.ne, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1773: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.15.wasm:000001a: error: type mismatch in i32x4.ne, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1781: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.16.wasm:000002c: error: type mismatch in i32x4.lt_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1789: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.17.wasm:000001a: error: type mismatch in i32x4.lt_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1797: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.18.wasm:000002c: error: type mismatch in i32x4.lt_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1805: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.19.wasm:000001a: error: type mismatch in i32x4.lt_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1813: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.20.wasm:000002c: error: type mismatch in i32x4.le_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1821: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.21.wasm:000001a: error: type mismatch in i32x4.le_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1829: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.22.wasm:000002c: error: type mismatch in i32x4.le_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1837: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.23.wasm:000001a: error: type mismatch in i32x4.le_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1845: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.24.wasm:000002c: error: type mismatch in i32x4.gt_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1853: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.25.wasm:000001a: error: type mismatch in i32x4.gt_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1861: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.26.wasm:000002c: error: type mismatch in i32x4.gt_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1869: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.27.wasm:000001a: error: type mismatch in i32x4.gt_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1877: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.28.wasm:000002c: error: type mismatch in i32x4.ge_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1885: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.29.wasm:000001a: error: type mismatch in i32x4.ge_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1893: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.30.wasm:000002c: error: type mismatch in i32x4.ge_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1901: assert_invalid passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.31.wasm:000001a: error: type mismatch in i32x4.ge_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i32x4_cmp.wast:1910: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.32.wat:1:65: error: unexpected token \"i4x32.eq\", expected an instr.\n  ...v128) (param $y v128) (result v128) (i4x32.eq (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1911: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.33.wat:1:65: error: unexpected token \"i4x32.ne\", expected an instr.\n  ...v128) (param $y v128) (result v128) (i4x32.ne (local.get $x) (local.get $y)))\n                                          ^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1912: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.34.wat:1:65: error: unexpected token \"i4x32.lt_s\", expected an instr.\n  ...28) (param $y v128) (result v128) (i4x32.lt_s (local.get $x) (local.get $y)))\n                                        ^^^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1913: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.35.wat:1:65: error: unexpected token \"i4x32.lt_u\", expected an instr.\n  ...28) (param $y v128) (result v128) (i4x32.lt_u (local.get $x) (local.get $y)))\n                                        ^^^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1914: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.36.wat:1:65: error: unexpected token \"i4x32.le_s\", expected an instr.\n  ...28) (param $y v128) (result v128) (i4x32.le_s (local.get $x) (local.get $y)))\n                                        ^^^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1915: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.37.wat:1:65: error: unexpected token \"i4x32.le_u\", expected an instr.\n  ...28) (param $y v128) (result v128) (i4x32.le_u (local.get $x) (local.get $y)))\n                                        ^^^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1916: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.38.wat:1:65: error: unexpected token \"i4x32.gt_s\", expected an instr.\n  ...28) (param $y v128) (result v128) (i4x32.gt_s (local.get $x) (local.get $y)))\n                                        ^^^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1917: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.39.wat:1:65: error: unexpected token \"i4x32.gt_u\", expected an instr.\n  ...28) (param $y v128) (result v128) (i4x32.gt_u (local.get $x) (local.get $y)))\n                                        ^^^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1918: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.40.wat:1:65: error: unexpected token \"i4x32.ge_s\", expected an instr.\n  ...28) (param $y v128) (result v128) (i4x32.ge_s (local.get $x) (local.get $y)))\n                                        ^^^^^^^^^^\nout/test/spec/simd_i32x4_cmp.wast:1919: assert_malformed passed:\n  out/test/spec/simd_i32x4_cmp/simd_i32x4_cmp.41.wat:1:65: error: unexpected token \"i4x32.ge_u\", expected an instr.\n  ...28) (param $y v128) (result v128) (i4x32.ge_u (local.get $x) (local.get $y)))\n                                        ^^^^^^^^^^\n475/475 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i32x4_dot_i16x8.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_dot_i16x8.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i32x4_dot_i16x8.wast:90: assert_invalid passed:\n  out/test/spec/simd_i32x4_dot_i16x8/simd_i32x4_dot_i16x8.1.wasm:0000022: error: type mismatch in i32x4.dot_i16x8_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_dot_i16x8.wast:95: assert_invalid passed:\n  out/test/spec/simd_i32x4_dot_i16x8/simd_i32x4_dot_i16x8.2.wasm:000002d: error: type mismatch in i32x4.dot_i16x8_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_dot_i16x8.wast:103: assert_invalid passed:\n  out/test/spec/simd_i32x4_dot_i16x8/simd_i32x4_dot_i16x8.3.wasm:000001b: error: type mismatch in i32x4.dot_i16x8_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n30/30 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i32x4_extadd_pairwise_i16x8.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_extadd_pairwise_i16x8.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i32x4_extadd_pairwise_i16x8.wast:47: assert_invalid passed:\n  out/test/spec/simd_i32x4_extadd_pairwise_i16x8/simd_i32x4_extadd_pairwise_i16x8.1.wasm:000001c: error: type mismatch in i32x4.extadd_pairwise_i16x8_s, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_i32x4_extadd_pairwise_i16x8.wast:48: assert_invalid passed:\n  out/test/spec/simd_i32x4_extadd_pairwise_i16x8/simd_i32x4_extadd_pairwise_i16x8.2.wasm:000001c: error: type mismatch in i32x4.extadd_pairwise_i16x8_u, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_i32x4_extadd_pairwise_i16x8.wast:53: assert_invalid passed:\n  out/test/spec/simd_i32x4_extadd_pairwise_i16x8/simd_i32x4_extadd_pairwise_i16x8.3.wasm:000001a: error: type mismatch in i32x4.extadd_pairwise_i16x8_s, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_i32x4_extadd_pairwise_i16x8.wast:61: assert_invalid passed:\n  out/test/spec/simd_i32x4_extadd_pairwise_i16x8/simd_i32x4_extadd_pairwise_i16x8.4.wasm:000001a: error: type mismatch in i32x4.extadd_pairwise_i16x8_u, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\n21/21 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i32x4_extmul_i16x8.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_extmul_i16x8.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i32x4_extmul_i16x8.wast:333: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.1.wasm:0000022: error: type mismatch in i32x4.extmul_low_i16x8_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:334: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.2.wasm:0000022: error: type mismatch in i32x4.extmul_high_i16x8_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:335: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.3.wasm:0000022: error: type mismatch in i32x4.extmul_low_i16x8_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:336: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.4.wasm:0000022: error: type mismatch in i32x4.extmul_high_i16x8_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:341: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.5.wasm:000002d: error: type mismatch in i32x4.extmul_low_i16x8_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:349: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.6.wasm:000001b: error: type mismatch in i32x4.extmul_low_i16x8_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:357: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.7.wasm:000002d: error: type mismatch in i32x4.extmul_high_i16x8_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:365: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.8.wasm:000001b: error: type mismatch in i32x4.extmul_high_i16x8_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:373: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.9.wasm:000002d: error: type mismatch in i32x4.extmul_low_i16x8_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:381: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.10.wasm:000001b: error: type mismatch in i32x4.extmul_low_i16x8_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:389: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.11.wasm:000002d: error: type mismatch in i32x4.extmul_high_i16x8_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i32x4_extmul_i16x8.wast:397: assert_invalid passed:\n  out/test/spec/simd_i32x4_extmul_i16x8/simd_i32x4_extmul_i16x8.12.wasm:000001b: error: type mismatch in i32x4.extmul_high_i16x8_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n117/117 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i32x4_trunc_sat_f32x4.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_trunc_sat_f32x4.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i32x4_trunc_sat_f32x4.wast:218: assert_invalid passed:\n  out/test/spec/simd_i32x4_trunc_sat_f32x4/simd_i32x4_trunc_sat_f32x4.1.wasm:000001d: error: type mismatch in i32x4.trunc_sat_f32x4_s, expected [v128] but got [i32]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/simd_i32x4_trunc_sat_f32x4.wast:219: assert_invalid passed:\n  out/test/spec/simd_i32x4_trunc_sat_f32x4/simd_i32x4_trunc_sat_f32x4.2.wasm:000001d: error: type mismatch in i32x4.trunc_sat_f32x4_u, expected [v128] but got [i32]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/simd_i32x4_trunc_sat_f32x4.wast:224: assert_invalid passed:\n  out/test/spec/simd_i32x4_trunc_sat_f32x4/simd_i32x4_trunc_sat_f32x4.3.wasm:000001b: error: type mismatch in i32x4.trunc_sat_f32x4_s, expected [v128] but got []\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/simd_i32x4_trunc_sat_f32x4.wast:232: assert_invalid passed:\n  out/test/spec/simd_i32x4_trunc_sat_f32x4/simd_i32x4_trunc_sat_f32x4.4.wasm:000001b: error: type mismatch in i32x4.trunc_sat_f32x4_u, expected [v128] but got []\n  000001b: error: OnConvertExpr callback failed\n107/107 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i32x4_trunc_sat_f64x2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_trunc_sat_f64x2.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i32x4_trunc_sat_f64x2.wast:218: assert_invalid passed:\n  out/test/spec/simd_i32x4_trunc_sat_f64x2/simd_i32x4_trunc_sat_f64x2.1.wasm:000001d: error: type mismatch in i32x4.trunc_sat_f64x2_s_zero, expected [v128] but got [i32]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/simd_i32x4_trunc_sat_f64x2.wast:219: assert_invalid passed:\n  out/test/spec/simd_i32x4_trunc_sat_f64x2/simd_i32x4_trunc_sat_f64x2.2.wasm:000001d: error: type mismatch in i32x4.trunc_sat_f64x2_u_zero, expected [v128] but got [i32]\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/simd_i32x4_trunc_sat_f64x2.wast:224: assert_invalid passed:\n  out/test/spec/simd_i32x4_trunc_sat_f64x2/simd_i32x4_trunc_sat_f64x2.3.wasm:000001b: error: type mismatch in i32x4.trunc_sat_f64x2_s_zero, expected [v128] but got []\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/simd_i32x4_trunc_sat_f64x2.wast:232: assert_invalid passed:\n  out/test/spec/simd_i32x4_trunc_sat_f64x2/simd_i32x4_trunc_sat_f64x2.4.wasm:000001b: error: type mismatch in i32x4.trunc_sat_f64x2_u_zero, expected [v128] but got []\n  000001b: error: OnConvertExpr callback failed\n107/107 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i64x2_arith.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i64x2_arith.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i64x2_arith.wast:546: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.1.wasm:000001d: error: type mismatch in i64x2.neg, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:547: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.2.wasm:0000022: error: type mismatch in i64x2.add, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:548: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.3.wasm:0000022: error: type mismatch in i64x2.sub, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:549: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.4.wasm:0000022: error: type mismatch in i64x2.mul, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:554: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.5.wasm:000001b: error: type mismatch in i64x2.neg, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:562: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.6.wasm:000002d: error: type mismatch in i64x2.add, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:570: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.7.wasm:000001b: error: type mismatch in i64x2.add, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:578: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.8.wasm:000002d: error: type mismatch in i64x2.sub, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:586: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.9.wasm:000001b: error: type mismatch in i64x2.sub, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:594: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.10.wasm:000002d: error: type mismatch in i64x2.mul, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_arith.wast:602: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith/simd_i64x2_arith.11.wasm:000001b: error: type mismatch in i64x2.mul, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n200/200 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i64x2_arith2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i64x2_arith2.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i64x2_arith2.wast:59: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith2/simd_i64x2_arith2.1.wasm:0000020: error: type mismatch in i64x2.abs, expected [v128] but got [f32]\n  0000020: error: OnUnaryExpr callback failed\nout/test/spec/simd_i64x2_arith2.wast:64: assert_invalid passed:\n  out/test/spec/simd_i64x2_arith2/simd_i64x2_arith2.2.wasm:000001b: error: type mismatch in i64x2.abs, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\n25/25 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i64x2_cmp.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i64x2_cmp.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i64x2_cmp.wast:380: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.1.wasm:0000022: error: type mismatch in i64x2.eq, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:381: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.2.wasm:0000022: error: type mismatch in i64x2.ne, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:382: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.3.wasm:0000022: error: type mismatch in i64x2.ge_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:383: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.4.wasm:0000022: error: type mismatch in i64x2.gt_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:384: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.5.wasm:0000022: error: type mismatch in i64x2.le_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:385: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.6.wasm:0000022: error: type mismatch in i64x2.lt_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:390: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.7.wasm:000002d: error: type mismatch in i64x2.eq, expected [v128, v128] but got [v128]\n  000002d: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:398: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.8.wasm:000001b: error: type mismatch in i64x2.eq, expected [v128, v128] but got []\n  000001b: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:406: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.9.wasm:000002d: error: type mismatch in i64x2.ne, expected [v128, v128] but got [v128]\n  000002d: error: OnCompareExpr callback failed\nout/test/spec/simd_i64x2_cmp.wast:414: assert_invalid passed:\n  out/test/spec/simd_i64x2_cmp/simd_i64x2_cmp.10.wasm:000001b: error: type mismatch in i64x2.ne, expected [v128, v128] but got []\n  000001b: error: OnCompareExpr callback failed\n113/113 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i64x2_extmul_i32x4.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i64x2_extmul_i32x4.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i64x2_extmul_i32x4.wast:333: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.1.wasm:0000022: error: type mismatch in i64x2.extmul_low_i32x4_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:334: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.2.wasm:0000022: error: type mismatch in i64x2.extmul_high_i32x4_s, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:335: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.3.wasm:0000022: error: type mismatch in i64x2.extmul_low_i32x4_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:336: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.4.wasm:0000022: error: type mismatch in i64x2.extmul_high_i32x4_u, expected [v128, v128] but got [i32, f32]\n  0000022: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:341: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.5.wasm:000002d: error: type mismatch in i64x2.extmul_low_i32x4_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:349: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.6.wasm:000001b: error: type mismatch in i64x2.extmul_low_i32x4_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:357: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.7.wasm:000002d: error: type mismatch in i64x2.extmul_high_i32x4_s, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:365: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.8.wasm:000001b: error: type mismatch in i64x2.extmul_high_i32x4_s, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:373: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.9.wasm:000002d: error: type mismatch in i64x2.extmul_low_i32x4_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:381: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.10.wasm:000001b: error: type mismatch in i64x2.extmul_low_i32x4_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:389: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.11.wasm:000002d: error: type mismatch in i64x2.extmul_high_i32x4_u, expected [v128, v128] but got [v128]\n  000002d: error: OnBinaryExpr callback failed\nout/test/spec/simd_i64x2_extmul_i32x4.wast:397: assert_invalid passed:\n  out/test/spec/simd_i64x2_extmul_i32x4/simd_i64x2_extmul_i32x4.12.wasm:000001b: error: type mismatch in i64x2.extmul_high_i32x4_u, expected [v128, v128] but got []\n  000001b: error: OnBinaryExpr callback failed\n117/117 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i8x16_arith.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i8x16_arith.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i8x16_arith.wast:354: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith/simd_i8x16_arith.1.wasm:000001c: error: type mismatch in i8x16.neg, expected [v128] but got [i32]\n  000001c: error: OnUnaryExpr callback failed\nout/test/spec/simd_i8x16_arith.wast:355: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith/simd_i8x16_arith.2.wasm:0000021: error: type mismatch in i8x16.add, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith.wast:356: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith/simd_i8x16_arith.3.wasm:0000021: error: type mismatch in i8x16.sub, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith.wast:361: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith/simd_i8x16_arith.4.wasm:000001a: error: type mismatch in i8x16.neg, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_i8x16_arith.wast:369: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith/simd_i8x16_arith.5.wasm:000002c: error: type mismatch in i8x16.add, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith.wast:377: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith/simd_i8x16_arith.6.wasm:000001a: error: type mismatch in i8x16.add, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith.wast:385: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith/simd_i8x16_arith.7.wasm:000002c: error: type mismatch in i8x16.sub, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith.wast:393: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith/simd_i8x16_arith.8.wasm:000001a: error: type mismatch in i8x16.sub, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\n131/131 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i8x16_arith2.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i8x16_arith2.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i8x16_arith2.wast:378: assert_malformed passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.1.wat:1:33: error: unexpected token \"i32x4.avgr_u\", expected an instr.\n  (memory 1) (func (result v128) (i32x4.avgr_u (v128.const i8x16 0 0 0 0 0 0 0 ...\n                                  ^^^^^^^^^^^^\nout/test/spec/simd_i8x16_arith2.wast:379: assert_malformed passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.2.wat:1:33: error: unexpected token \"f32x4.avgr_u\", expected an instr.\n  (memory 1) (func (result v128) (f32x4.avgr_u (v128.const i8x16 0 0 0 0 0 0 0 ...\n                                  ^^^^^^^^^^^^\nout/test/spec/simd_i8x16_arith2.wast:380: assert_malformed passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.3.wat:1:33: error: unexpected token \"i64x2.avgr_u\", expected an instr.\n  (memory 1) (func (result v128) (i64x2.avgr_u (v128.const i8x16 0 0 0 0 0 0 0 ...\n                                  ^^^^^^^^^^^^\nout/test/spec/simd_i8x16_arith2.wast:381: assert_malformed passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.4.wat:1:33: error: unexpected token \"f64x2.avgr_u\", expected an instr.\n  (memory 1) (func (result v128) (f64x2.avgr_u (v128.const i8x16 0 0 0 0 0 0 0 ...\n                                  ^^^^^^^^^^^^\nout/test/spec/simd_i8x16_arith2.wast:382: assert_malformed passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.5.wat:1:33: error: unexpected token \"i8x16.avgr\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.avgr (v128.const i8x16 0 0 0 0 0 0 0 0 ...\n                                  ^^^^^^^^^^\nout/test/spec/simd_i8x16_arith2.wast:383: assert_malformed passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.6.wat:1:33: error: unexpected token \"i8x16.avgr_s\", expected an instr.\n  (memory 1) (func (result v128) (i8x16.avgr_s (v128.const i8x16 0 0 0 0 0 0 0 ...\n                                  ^^^^^^^^^^^^\nout/test/spec/simd_i8x16_arith2.wast:386: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.7.wasm:0000021: error: type mismatch in i8x16.min_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:387: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.8.wasm:0000021: error: type mismatch in i8x16.min_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:388: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.9.wasm:0000021: error: type mismatch in i8x16.max_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:389: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.10.wasm:0000021: error: type mismatch in i8x16.max_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:390: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.11.wasm:0000021: error: type mismatch in i8x16.avgr_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:391: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.12.wasm:000001f: error: type mismatch in i8x16.abs, expected [v128] but got [f32]\n  000001f: error: OnUnaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:392: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.13.wasm:000001f: error: type mismatch in i8x16.popcnt, expected [v128] but got [f32]\n  000001f: error: OnUnaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:397: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.14.wasm:000002c: error: type mismatch in i8x16.min_s, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:405: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.15.wasm:000001a: error: type mismatch in i8x16.min_s, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:413: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.16.wasm:000002c: error: type mismatch in i8x16.min_u, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:421: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.17.wasm:000001a: error: type mismatch in i8x16.min_u, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:429: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.18.wasm:000002c: error: type mismatch in i8x16.max_s, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:437: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.19.wasm:000001a: error: type mismatch in i8x16.max_s, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:445: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.20.wasm:000002c: error: type mismatch in i8x16.max_u, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:453: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.21.wasm:000001a: error: type mismatch in i8x16.max_u, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:461: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.22.wasm:000002c: error: type mismatch in i8x16.avgr_u, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:469: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.23.wasm:000001a: error: type mismatch in i8x16.avgr_u, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:477: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.24.wasm:000001a: error: type mismatch in i8x16.abs, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_i8x16_arith2.wast:485: assert_invalid passed:\n  out/test/spec/simd_i8x16_arith2/simd_i8x16_arith2.25.wasm:000001a: error: type mismatch in i8x16.popcnt, expected [v128] but got []\n  000001a: error: OnUnaryExpr callback failed\n211/211 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i8x16_cmp.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i8x16_cmp.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i8x16_cmp.wast:1401: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.1.wasm:0000021: error: type mismatch in i8x16.eq, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1402: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.2.wasm:0000021: error: type mismatch in i8x16.ge_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1403: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.3.wasm:0000021: error: type mismatch in i8x16.ge_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1404: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.4.wasm:0000021: error: type mismatch in i8x16.gt_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1405: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.5.wasm:0000021: error: type mismatch in i8x16.gt_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1406: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.6.wasm:0000021: error: type mismatch in i8x16.le_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1407: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.7.wasm:0000021: error: type mismatch in i8x16.le_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1408: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.8.wasm:0000021: error: type mismatch in i8x16.lt_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1409: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.9.wasm:0000021: error: type mismatch in i8x16.lt_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1410: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.10.wasm:0000021: error: type mismatch in i8x16.ne, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1689: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.12.wasm:000002c: error: type mismatch in i8x16.eq, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1697: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.13.wasm:000001a: error: type mismatch in i8x16.eq, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1705: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.14.wasm:000002c: error: type mismatch in i8x16.ne, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1713: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.15.wasm:000001a: error: type mismatch in i8x16.ne, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1721: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.16.wasm:000002c: error: type mismatch in i8x16.lt_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1729: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.17.wasm:000001a: error: type mismatch in i8x16.lt_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1737: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.18.wasm:000002c: error: type mismatch in i8x16.lt_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1745: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.19.wasm:000001a: error: type mismatch in i8x16.lt_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1753: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.20.wasm:000002c: error: type mismatch in i8x16.le_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1761: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.21.wasm:000001a: error: type mismatch in i8x16.le_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1769: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.22.wasm:000002c: error: type mismatch in i8x16.le_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1777: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.23.wasm:000001a: error: type mismatch in i8x16.le_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1785: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.24.wasm:000002c: error: type mismatch in i8x16.gt_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1793: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.25.wasm:000001a: error: type mismatch in i8x16.gt_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1801: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.26.wasm:000002c: error: type mismatch in i8x16.gt_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1809: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.27.wasm:000001a: error: type mismatch in i8x16.gt_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1817: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.28.wasm:000002c: error: type mismatch in i8x16.ge_s, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1825: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.29.wasm:000001a: error: type mismatch in i8x16.ge_s, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1833: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.30.wasm:000002c: error: type mismatch in i8x16.ge_u, expected [v128, v128] but got [v128]\n  000002c: error: OnCompareExpr callback failed\nout/test/spec/simd_i8x16_cmp.wast:1841: assert_invalid passed:\n  out/test/spec/simd_i8x16_cmp/simd_i8x16_cmp.31.wasm:000001a: error: type mismatch in i8x16.ge_u, expected [v128, v128] but got []\n  000001a: error: OnCompareExpr callback failed\n445/445 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_i8x16_sat_arith.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_i8x16_sat_arith.wast\n(;; STDOUT ;;;\nout/test/spec/simd_i8x16_sat_arith.wast:561: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.1.wat:1:22: error: unexpected token \"i8x16.add_sat\", expected an instr.\n  (func (result v128) (i8x16.add_sat (v128.const i8x16 1 1 1 1 1 1 1 1 1 1 1 1 ...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:564: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.2.wat:1:22: error: unexpected token \"i8x16.sub_sat\", expected an instr.\n  (func (result v128) (i8x16.sub_sat (v128.const i8x16 1 1 1 1 1 1 1 1 1 1 1 1 ...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:567: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.3.wat:1:22: error: unexpected token \"i8x16.mul_sat\", expected an instr.\n  (func (result v128) (i8x16.mul_sat (v128.const i8x16 1 1 1 1 1 1 1 1 1 1 1 1 ...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:570: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.4.wat:1:22: error: unexpected token \"i8x16.div_sat\", expected an instr.\n  (func (result v128) (i8x16.div_sat (v128.const i8x16 1 1 1 1 1 1 1 1 1 1 1 1 ...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:573: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.5.wat:1:22: error: unexpected token \"i32x4.add_sat_s\", expected an instr.\n  (func (result v128) (i32x4.add_sat_s (v128.const i32x4 0 0 0 0) (v128.const i...\n                       ^^^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:576: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.6.wat:1:22: error: unexpected token \"i32x4.add_sat_u\", expected an instr.\n  (func (result v128) (i32x4.add_sat_u (v128.const i32x4 0 0 0 0) (v128.const i...\n                       ^^^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:579: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.7.wat:1:22: error: unexpected token \"i32x4.sub_sat_s\", expected an instr.\n  (func (result v128) (i32x4.sub_sat_s (v128.const i32x4 0 0 0 0) (v128.const i...\n                       ^^^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:582: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.8.wat:1:22: error: unexpected token \"i32x4.sub_sat_u\", expected an instr.\n  (func (result v128) (i32x4.sub_sat_u (v128.const i32x4 0 0 0 0) (v128.const i...\n                       ^^^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:585: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.9.wat:1:22: error: unexpected token \"f32x4.add_sat_s\", expected an instr.\n  (func (result v128) (f32x4.add_sat_s (v128.const f32x4 0 0 0 0) (v128.const f...\n                       ^^^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:588: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.10.wat:1:22: error: unexpected token \"f32x4.add_sat_u\", expected an instr.\n  (func (result v128) (f32x4.add_sat_u (v128.const f32x4 0 0 0 0) (v128.const f...\n                       ^^^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:591: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.11.wat:1:22: error: unexpected token \"f32x4.sub_sat_s\", expected an instr.\n  (func (result v128) (f32x4.sub_sat_s (v128.const f32x4 0 0 0 0) (v128.const f...\n                       ^^^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:594: assert_malformed passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.12.wat:1:22: error: unexpected token \"f32x4.sub_sat_u\", expected an instr.\n  (func (result v128) (f32x4.sub_sat_u (v128.const f32x4 0 0 0 0) (v128.const f...\n                       ^^^^^^^^^^^^^^^\nout/test/spec/simd_i8x16_sat_arith.wast:599: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.13.wasm:0000021: error: type mismatch in i8x16.add_sat_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:600: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.14.wasm:0000021: error: type mismatch in i8x16.add_sat_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:601: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.15.wasm:0000021: error: type mismatch in i8x16.sub_sat_s, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:602: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.16.wasm:0000021: error: type mismatch in i8x16.sub_sat_u, expected [v128, v128] but got [i32, f32]\n  0000021: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:607: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.17.wasm:000002c: error: type mismatch in i8x16.add_sat_s, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:615: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.18.wasm:000001a: error: type mismatch in i8x16.add_sat_s, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:623: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.19.wasm:000002c: error: type mismatch in i8x16.add_sat_u, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:631: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.20.wasm:000001a: error: type mismatch in i8x16.add_sat_u, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:639: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.21.wasm:000002c: error: type mismatch in i8x16.sub_sat_s, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:647: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.22.wasm:000001a: error: type mismatch in i8x16.sub_sat_s, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:655: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.23.wasm:000002c: error: type mismatch in i8x16.sub_sat_u, expected [v128, v128] but got [v128]\n  000002c: error: OnBinaryExpr callback failed\nout/test/spec/simd_i8x16_sat_arith.wast:663: assert_invalid passed:\n  out/test/spec/simd_i8x16_sat_arith/simd_i8x16_sat_arith.24.wasm:000001a: error: type mismatch in i8x16.sub_sat_u, expected [v128, v128] but got []\n  000001a: error: OnBinaryExpr callback failed\n214/214 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_int_to_int_extend.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_int_to_int_extend.wast\n(;; STDOUT ;;;\nout/test/spec/simd_int_to_int_extend.wast:488: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.1.wasm:000001d: error: type mismatch in i16x8.extend_high_i8x16_s, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:489: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.2.wasm:000001d: error: type mismatch in i16x8.extend_high_i8x16_u, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:490: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.3.wasm:000001d: error: type mismatch in i16x8.extend_low_i8x16_s, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:491: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.4.wasm:000001d: error: type mismatch in i16x8.extend_low_i8x16_u, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:492: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.5.wasm:000001d: error: type mismatch in i32x4.extend_high_i16x8_s, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:493: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.6.wasm:000001d: error: type mismatch in i32x4.extend_high_i16x8_u, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:494: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.7.wasm:000001d: error: type mismatch in i32x4.extend_low_i16x8_s, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:495: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.8.wasm:000001d: error: type mismatch in i32x4.extend_low_i16x8_u, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:496: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.9.wasm:000001d: error: type mismatch in i64x2.extend_high_i32x4_s, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:497: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.10.wasm:000001d: error: type mismatch in i64x2.extend_high_i32x4_u, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:498: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.11.wasm:000001d: error: type mismatch in i64x2.extend_low_i32x4_s, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:499: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.12.wasm:000001d: error: type mismatch in i64x2.extend_low_i32x4_u, expected [v128] but got [i32]\n  000001d: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:504: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.13.wasm:000001b: error: type mismatch in i16x8.extend_high_i8x16_s, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:512: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.14.wasm:000001b: error: type mismatch in i16x8.extend_high_i8x16_u, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:520: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.15.wasm:000001b: error: type mismatch in i16x8.extend_low_i8x16_s, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:528: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.16.wasm:000001b: error: type mismatch in i16x8.extend_low_i8x16_u, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:536: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.17.wasm:000001b: error: type mismatch in i32x4.extend_high_i16x8_s, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:544: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.18.wasm:000001b: error: type mismatch in i32x4.extend_high_i16x8_u, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:552: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.19.wasm:000001b: error: type mismatch in i32x4.extend_low_i16x8_s, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:560: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.20.wasm:000001b: error: type mismatch in i32x4.extend_low_i16x8_u, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:568: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.21.wasm:000001b: error: type mismatch in i64x2.extend_high_i32x4_s, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:576: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.22.wasm:000001b: error: type mismatch in i64x2.extend_high_i32x4_u, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:584: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.23.wasm:000001b: error: type mismatch in i64x2.extend_low_i32x4_s, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\nout/test/spec/simd_int_to_int_extend.wast:592: assert_invalid passed:\n  out/test/spec/simd_int_to_int_extend/simd_int_to_int_extend.24.wasm:000001b: error: type mismatch in i64x2.extend_low_i32x4_u, expected [v128] but got []\n  000001b: error: OnUnaryExpr callback failed\n253/253 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_lane.wast:398: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.1.wat:1:21: error: invalid literal \"-1\"\n  (func (result i32) (i8x16.extract_lane_s  -1 (v128.const i8x16 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.1.wat:1:97: error: unexpected token ), expected EOF.\n  ...i8x16.extract_lane_s  -1 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:399: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.2.wat:1:21: error: invalid literal \"-1\"\n  (func (result i32) (i8x16.extract_lane_u  -1 (v128.const i8x16 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.2.wat:1:97: error: unexpected token ), expected EOF.\n  ...i8x16.extract_lane_u  -1 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:400: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.3.wat:1:21: error: invalid literal \"-1\"\n  (func (result i32) (i16x8.extract_lane_s  -1 (v128.const i16x8 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.3.wat:1:81: error: unexpected token ), expected EOF.\n  ...c (result i32) (i16x8.extract_lane_s  -1 (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:401: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.4.wat:1:21: error: invalid literal \"-1\"\n  (func (result i32) (i16x8.extract_lane_u  -1 (v128.const i16x8 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.4.wat:1:81: error: unexpected token ), expected EOF.\n  ...c (result i32) (i16x8.extract_lane_u  -1 (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:402: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.5.wat:1:21: error: invalid literal \"-1\"\n  (func (result i32) (i32x4.extract_lane  -1 (v128.const i32x4 0 0 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.5.wat:1:71: error: unexpected token ), expected EOF.\n  (func (result i32) (i32x4.extract_lane  -1 (v128.const i32x4 0 0 0 0)))\n                                                                        ^\nout/test/spec/simd_lane.wast:403: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.6.wat:1:21: error: invalid literal \"-1\"\n  (func (result f32) (f32x4.extract_lane  -1 (v128.const f32x4 0 0 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.6.wat:1:71: error: unexpected token ), expected EOF.\n  (func (result f32) (f32x4.extract_lane  -1 (v128.const f32x4 0 0 0 0)))\n                                                                        ^\nout/test/spec/simd_lane.wast:404: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.7.wat:1:22: error: invalid literal \"-1\"\n  (func (result v128) (i8x16.replace_lane  -1 (v128.const i8x16 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.7.wat:1:110: error: unexpected token ), expected EOF.\n  ...e_lane  -1 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:405: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.8.wat:1:22: error: invalid literal \"-1\"\n  (func (result v128) (i16x8.replace_lane  -1 (v128.const i16x8 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.8.wat:1:94: error: unexpected token ), expected EOF.\n  ...8) (i16x8.replace_lane  -1 (v128.const i16x8 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:406: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.9.wat:1:22: error: invalid literal \"-1\"\n  (func (result v128) (i32x4.replace_lane  -1 (v128.const i32x4 0 0 0 0) (i32.c...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.9.wat:1:86: error: unexpected token ), expected EOF.\n  ...sult v128) (i32x4.replace_lane  -1 (v128.const i32x4 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:407: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.10.wat:1:22: error: invalid literal \"-1\"\n  (func (result v128) (f32x4.replace_lane  -1 (v128.const f32x4 0 0 0 0) (i32.c...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.10.wat:1:86: error: unexpected token ), expected EOF.\n  ...sult v128) (f32x4.replace_lane  -1 (v128.const f32x4 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:408: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.11.wat:1:21: error: invalid literal \"-1\"\n  (func (result i64) (i64x2.extract_lane  -1 (v128.const i64x2 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.11.wat:1:67: error: unexpected token ), expected EOF.\n  (func (result i64) (i64x2.extract_lane  -1 (v128.const i64x2 0 0)))\n                                                                    ^\nout/test/spec/simd_lane.wast:409: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.12.wat:1:21: error: invalid literal \"-1\"\n  (func (result f64) (f64x2.extract_lane  -1 (v128.const f64x2 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.12.wat:1:67: error: unexpected token ), expected EOF.\n  (func (result f64) (f64x2.extract_lane  -1 (v128.const f64x2 0 0)))\n                                                                    ^\nout/test/spec/simd_lane.wast:410: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.13.wat:1:22: error: invalid literal \"-1\"\n  (func (result v128) (i64x2.replace_lane  -1 (v128.const i64x2 0 0) (i64.const...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.13.wat:1:82: error: unexpected token ), expected EOF.\n  ... (result v128) (i64x2.replace_lane  -1 (v128.const i64x2 0 0) (i64.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:411: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.14.wat:1:22: error: invalid literal \"-1\"\n  (func (result v128) (f64x2.replace_lane  -1 (v128.const f64x2 0 0) (f64.const...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.14.wat:1:82: error: unexpected token ), expected EOF.\n  ... (result v128) (f64x2.replace_lane  -1 (v128.const f64x2 0 0) (f64.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:415: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.15.wat:1:21: error: lane index \"256\" out-of-range [0, 32)\n  (func (result i32) (i8x16.extract_lane_s 256 (v128.const i8x16 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.15.wat:1:97: error: unexpected token ), expected EOF.\n  ...i8x16.extract_lane_s 256 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:416: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.16.wat:1:21: error: lane index \"256\" out-of-range [0, 32)\n  (func (result i32) (i8x16.extract_lane_u 256 (v128.const i8x16 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.16.wat:1:97: error: unexpected token ), expected EOF.\n  ...i8x16.extract_lane_u 256 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:417: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.17.wat:1:21: error: lane index \"256\" out-of-range [0, 32)\n  (func (result i32) (i16x8.extract_lane_s 256 (v128.const i16x8 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.17.wat:1:81: error: unexpected token ), expected EOF.\n  ...c (result i32) (i16x8.extract_lane_s 256 (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:418: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.18.wat:1:21: error: lane index \"256\" out-of-range [0, 32)\n  (func (result i32) (i16x8.extract_lane_u 256 (v128.const i16x8 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.18.wat:1:81: error: unexpected token ), expected EOF.\n  ...c (result i32) (i16x8.extract_lane_u 256 (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:419: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.19.wat:1:21: error: lane index \"256\" out-of-range [0, 32)\n  (func (result i32) (i32x4.extract_lane 256 (v128.const i32x4 0 0 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.19.wat:1:71: error: unexpected token ), expected EOF.\n  (func (result i32) (i32x4.extract_lane 256 (v128.const i32x4 0 0 0 0)))\n                                                                        ^\nout/test/spec/simd_lane.wast:420: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.20.wat:1:21: error: lane index \"256\" out-of-range [0, 32)\n  (func (result f32) (f32x4.extract_lane 256 (v128.const f32x4 0 0 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.20.wat:1:71: error: unexpected token ), expected EOF.\n  (func (result f32) (f32x4.extract_lane 256 (v128.const f32x4 0 0 0 0)))\n                                                                        ^\nout/test/spec/simd_lane.wast:421: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.21.wat:1:22: error: lane index \"256\" out-of-range [0, 32)\n  (func (result v128) (i8x16.replace_lane 256 (v128.const i8x16 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.21.wat:1:110: error: unexpected token ), expected EOF.\n  ...e_lane 256 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:422: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.22.wat:1:22: error: lane index \"256\" out-of-range [0, 32)\n  (func (result v128) (i16x8.replace_lane 256 (v128.const i16x8 0 0 0 0 0 0 0 0...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.22.wat:1:94: error: unexpected token ), expected EOF.\n  ...8) (i16x8.replace_lane 256 (v128.const i16x8 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:423: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.23.wat:1:22: error: lane index \"256\" out-of-range [0, 32)\n  (func (result v128) (i32x4.replace_lane 256 (v128.const i32x4 0 0 0 0) (i32.c...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.23.wat:1:86: error: unexpected token ), expected EOF.\n  ...sult v128) (i32x4.replace_lane 256 (v128.const i32x4 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:424: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.24.wat:1:22: error: lane index \"256\" out-of-range [0, 32)\n  (func (result v128) (f32x4.replace_lane 256 (v128.const f32x4 0 0 0 0) (i32.c...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.24.wat:1:86: error: unexpected token ), expected EOF.\n  ...sult v128) (f32x4.replace_lane 256 (v128.const f32x4 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:425: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.25.wat:1:21: error: lane index \"256\" out-of-range [0, 32)\n  (func (result i64) (i64x2.extract_lane 256 (v128.const i64x2 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.25.wat:1:67: error: unexpected token ), expected EOF.\n  (func (result i64) (i64x2.extract_lane 256 (v128.const i64x2 0 0)))\n                                                                    ^\nout/test/spec/simd_lane.wast:426: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.26.wat:1:21: error: lane index \"256\" out-of-range [0, 32)\n  (func (result f64) (f64x2.extract_lane 256 (v128.const f64x2 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.26.wat:1:67: error: unexpected token ), expected EOF.\n  (func (result f64) (f64x2.extract_lane 256 (v128.const f64x2 0 0)))\n                                                                    ^\nout/test/spec/simd_lane.wast:427: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.27.wat:1:22: error: lane index \"256\" out-of-range [0, 32)\n  (func (result v128) (i64x2.replace_lane 256 (v128.const i64x2 0 0) (i64.const...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.27.wat:1:82: error: unexpected token ), expected EOF.\n  ... (result v128) (i64x2.replace_lane 256 (v128.const i64x2 0 0) (i64.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:428: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.28.wat:1:22: error: lane index \"256\" out-of-range [0, 32)\n  (func (result v128) (f64x2.replace_lane 256 (v128.const f64x2 0 0) (f64.const...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.28.wat:1:82: error: unexpected token ), expected EOF.\n  ... (result v128) (f64x2.replace_lane 256 (v128.const f64x2 0 0) (f64.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:432: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.29.wasm:000002d: error: lane index must be less than 16 (got 16)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:433: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.30.wasm:000002d: error: lane index must be less than 16 (got 255)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:434: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.31.wasm:000002d: error: lane index must be less than 16 (got 16)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:435: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.32.wasm:000002d: error: lane index must be less than 16 (got 255)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:436: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.33.wasm:000002d: error: lane index must be less than 8 (got 8)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:437: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.34.wasm:000002d: error: lane index must be less than 8 (got 255)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:438: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.35.wasm:000002d: error: lane index must be less than 8 (got 8)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:439: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.36.wasm:000002d: error: lane index must be less than 8 (got 255)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:440: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.37.wasm:000002d: error: lane index must be less than 4 (got 4)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:441: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.38.wasm:000002d: error: lane index must be less than 4 (got 255)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:442: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.39.wasm:000002d: error: lane index must be less than 4 (got 4)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:443: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.40.wasm:000002d: error: lane index must be less than 4 (got 255)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:444: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.41.wasm:000002f: error: lane index must be less than 16 (got 16)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:445: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.42.wasm:000002f: error: lane index must be less than 16 (got 255)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:446: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.43.wasm:000002f: error: lane index must be less than 8 (got 16)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:447: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.44.wasm:000002f: error: lane index must be less than 8 (got 255)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:448: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.45.wasm:000002f: error: lane index must be less than 4 (got 4)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:449: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.46.wasm:000002f: error: lane index must be less than 4 (got 255)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:450: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.47.wasm:0000032: error: lane index must be less than 4 (got 4)\n  0000032: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:451: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.48.wasm:0000032: error: lane index must be less than 4 (got 255)\n  0000032: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:452: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.49.wasm:000002d: error: lane index must be less than 2 (got 2)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:453: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.50.wasm:000002d: error: lane index must be less than 2 (got 255)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:454: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.51.wasm:000002d: error: lane index must be less than 2 (got 2)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:455: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.52.wasm:000002d: error: lane index must be less than 2 (got 255)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:456: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.53.wasm:000002f: error: lane index must be less than 2 (got 2)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:457: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.54.wasm:000002f: error: lane index must be less than 2 (got 255)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:458: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.55.wasm:0000036: error: lane index must be less than 2 (got 2)\n  0000036: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:459: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.56.wasm:0000036: error: lane index must be less than 2 (got 255)\n  0000036: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:463: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.57.wasm:000002d: error: lane index must be less than 8 (got 8)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:464: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.58.wasm:000002d: error: lane index must be less than 8 (got 8)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:465: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.59.wasm:000002d: error: lane index must be less than 4 (got 4)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:466: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.60.wasm:000002d: error: lane index must be less than 4 (got 4)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:467: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.61.wasm:000002f: error: lane index must be less than 8 (got 8)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:468: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.62.wasm:000002f: error: lane index must be less than 4 (got 4)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:469: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.63.wasm:0000032: error: lane index must be less than 4 (got 4)\n  0000032: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:470: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.64.wasm:000002d: error: lane index must be less than 2 (got 2)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:471: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.65.wasm:000002d: error: lane index must be less than 2 (got 2)\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:472: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.66.wasm:000002f: error: lane index must be less than 2 (got 2)\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:473: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.67.wasm:0000036: error: lane index must be less than 2 (got 2)\n  0000036: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:477: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.68.wasm:000001d: error: type mismatch in i8x16.extract_lane_s, expected [v128] but got [i32]\n  000001d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:478: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.69.wasm:000001d: error: type mismatch in i8x16.extract_lane_u, expected [v128] but got [i64]\n  000001d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:479: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.70.wasm:0000020: error: type mismatch in i8x16.extract_lane_s, expected [v128] but got [f32]\n  0000020: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:480: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.71.wasm:0000024: error: type mismatch in i8x16.extract_lane_u, expected [v128] but got [f64]\n  0000024: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:481: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.72.wasm:000001d: error: type mismatch in i32x4.extract_lane, expected [v128] but got [i32]\n  000001d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:482: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.73.wasm:0000020: error: type mismatch in f32x4.extract_lane, expected [v128] but got [f32]\n  0000020: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:483: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.74.wasm:000001f: error: type mismatch in i8x16.replace_lane, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:484: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.75.wasm:000001f: error: type mismatch in i16x8.replace_lane, expected [v128, i32] but got [i64, i32]\n  000001f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:485: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.76.wasm:000001f: error: type mismatch in i32x4.replace_lane, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:486: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.77.wasm:0000022: error: type mismatch in f32x4.replace_lane, expected [v128, f32] but got [f32, i32]\n  0000022: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:487: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.78.wasm:000001d: error: type mismatch in i64x2.extract_lane, expected [v128] but got [i64]\n  000001d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:488: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.79.wasm:0000024: error: type mismatch in f64x2.extract_lane, expected [v128] but got [f64]\n  0000024: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:489: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.80.wasm:000001f: error: type mismatch in i32x4.replace_lane, expected [v128, i32] but got [i32, i32]\n  000001f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:490: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.81.wasm:0000022: error: type mismatch in f32x4.replace_lane, expected [v128, f32] but got [f32, i32]\n  0000022: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:494: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.82.wasm:0000032: error: type mismatch in i8x16.replace_lane, expected [v128, i32] but got [v128, f32]\n  0000032: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:495: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.83.wasm:0000036: error: type mismatch in i16x8.replace_lane, expected [v128, i32] but got [v128, f64]\n  0000036: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:496: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.84.wasm:0000032: error: type mismatch in i32x4.replace_lane, expected [v128, i32] but got [v128, f32]\n  0000032: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:497: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.85.wasm:000002f: error: type mismatch in f32x4.replace_lane, expected [v128, f32] but got [v128, i32]\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:499: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.86.wasm:0000036: error: type mismatch in i64x2.replace_lane, expected [v128, i64] but got [v128, f64]\n  0000036: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:500: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.87.wasm:000002f: error: type mismatch in f64x2.replace_lane, expected [v128, f64] but got [v128, i64]\n  000002f: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:503: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.88.wasm:000002e: error: type mismatch in i8x16.swizzle, expected [v128, v128] but got [i32, v128]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_lane.wast:505: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.89.wasm:000002e: error: type mismatch in i8x16.swizzle, expected [v128, v128] but got [v128, i32]\n  000002e: error: OnBinaryExpr callback failed\nout/test/spec/simd_lane.wast:507: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.90.wasm:0000041: error: type mismatch in i8x16.shuffle, expected [v128, v128] but got [f32, v128]\n  0000041: error: OnSimdShuffleOpExpr callback failed\nout/test/spec/simd_lane.wast:510: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.91.wasm:0000041: error: type mismatch in i8x16.shuffle, expected [v128, v128] but got [v128, f32]\n  0000041: error: OnSimdShuffleOpExpr callback failed\nout/test/spec/simd_lane.wast:515: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.92.wat:1:83: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...8x16.shuffle 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 (local.get 0) (local.get 0)))\n                                                     ^\n  out/test/spec/simd_lane/simd_lane.92.wat:1:97: error: unexpected token (, expected EOF.\n  ...8x16.shuffle 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 (local.get 0) (local.get 0)))\n                                                                   ^\nout/test/spec/simd_lane.wast:518: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.93.wat:1:86: error: unexpected token 16, expected ).\n  ...huffle 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (local.get 0) (local.get 0)))\n                                                  ^^\n  out/test/spec/simd_lane/simd_lane.93.wat:1:117: error: unexpected token ), expected EOF.\n  ...huffle 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (local.get 0) (local.get 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:521: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.94.wat:1:70: error: invalid literal \"-1\"\n  ... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -1(v128.const i8x16 15 14 13 12 11 10 ...\n                                         ^^\n  out/test/spec/simd_lane/simd_lane.94.wat:1:185: error: unexpected token ), expected EOF.\n  ... 8 7 6 5 4 3 2 1 0)(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:525: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.95.wat:1:70: error: lane index \"256\" out-of-range [0, 32)\n  ... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 256(v128.const i8x16 15 14 13 12 11 10...\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.95.wat:1:186: error: unexpected token ), expected EOF.\n  ... 8 7 6 5 4 3 2 1 0)(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:529: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.96.wasm:000004e: error: lane index must be less than 32 (got 255)\n  000004e: error: OnSimdShuffleOpExpr callback failed\nout/test/spec/simd_lane.wast:536: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.97.wat:1:21: error: unexpected token \"i8x16.extract_lane\", expected an instr.\n  (func (result i32) (i8x16.extract_lane 0 (v128.const i8x16 0 0 0 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:537: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.98.wat:1:21: error: unexpected token \"i16x8.extract_lane\", expected an instr.\n  (func (result i32) (i16x8.extract_lane 0 (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:538: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.99.wat:1:21: error: unexpected token \"i32x4.extract_lane_s\", expected an instr.\n  (func (result i32) (i32x4.extract_lane_s 0 (v128.const i32x4 0 0 0 0)))\n                      ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:539: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.100.wat:1:21: error: unexpected token \"i32x4.extract_lane_u\", expected an instr.\n  (func (result i32) (i32x4.extract_lane_u 0 (v128.const i32x4 0 0 0 0)))\n                      ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:540: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.101.wat:1:21: error: unexpected token \"i64x2.extract_lane_s\", expected an instr.\n  (func (result i32) (i64x2.extract_lane_s 0 (v128.const i64x2 0 0)))\n                      ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:541: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.102.wat:1:21: error: unexpected token \"i64x2.extract_lane_u\", expected an instr.\n  (func (result i32) (i64x2.extract_lane_u 0 (v128.const i64x2 0 0)))\n                      ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:545: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.103.wat:1:22: error: unexpected token \"i8x16.shuffle1\", expected an instr.\n  (func (result v128) (i8x16.shuffle1 (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 ...\n                       ^^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:549: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.104.wat:1:22: error: unexpected token \"i8x16.shuffle2_imm\", expected an instr.\n  (func (result v128) (i8x16.shuffle2_imm  0  1  2  3  4  5  6  7  8  9 10 11 1...\n                       ^^^^^^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:555: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.105.wat:1:22: error: unexpected token \"v8x16.swizzle\", expected an instr.\n  (func (result v128) (v8x16.swizzle (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 1...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:559: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.106.wat:1:22: error: unexpected token \"v8x16.shuffle\", expected an instr.\n  (func (result v128) (v8x16.shuffle  0  1  2  3  4  5  6  7  8  9 10 11 12 13 ...\n                       ^^^^^^^^^^^^^\nout/test/spec/simd_lane.wast:570: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.107.wat:1:54: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...) (result i32) (i8x16.extract_lane_s (local.get 0) (v128.const i8x16 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.107.wat:1:68: error: unexpected token (, expected EOF.\n  ... (i8x16.extract_lane_s (local.get 0) (v128.const i8x16 0 0 0 0 0 0 0 0 0 0...\n                                          ^\nout/test/spec/simd_lane.wast:571: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.108.wat:1:54: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...) (result i32) (i8x16.extract_lane_u (local.get 0) (v128.const i8x16 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.108.wat:1:68: error: unexpected token (, expected EOF.\n  ... (i8x16.extract_lane_u (local.get 0) (v128.const i8x16 0 0 0 0 0 0 0 0 0 0...\n                                          ^\nout/test/spec/simd_lane.wast:572: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.109.wat:1:54: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...) (result i32) (i16x8.extract_lane_s (local.get 0) (v128.const i16x8 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.109.wat:1:68: error: unexpected token (, expected EOF.\n  ...i32) (i16x8.extract_lane_s (local.get 0) (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                              ^\nout/test/spec/simd_lane.wast:573: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.110.wat:1:54: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...) (result i32) (i16x8.extract_lane_u (local.get 0) (v128.const i16x8 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.110.wat:1:68: error: unexpected token (, expected EOF.\n  ...i32) (i16x8.extract_lane_u (local.get 0) (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                              ^\nout/test/spec/simd_lane.wast:574: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.111.wat:1:52: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...32) (result i32) (i32x4.extract_lane (local.get 0) (v128.const i32x4 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.111.wat:1:66: error: unexpected token (, expected EOF.\n  ...) (result i32) (i32x4.extract_lane (local.get 0) (v128.const i32x4 0 0 0 0)))\n                                                      ^\nout/test/spec/simd_lane.wast:575: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.112.wat:1:52: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...32) (result f32) (f32x4.extract_lane (local.get 0) (v128.const f32x4 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.112.wat:1:66: error: unexpected token (, expected EOF.\n  ...) (result f32) (f32x4.extract_lane (local.get 0) (v128.const f32x4 0 0 0 0)))\n                                                      ^\nout/test/spec/simd_lane.wast:576: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.113.wat:1:53: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...2) (result v128) (i8x16.replace_lane (local.get 0) (v128.const i8x16 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.113.wat:1:67: error: unexpected token (, expected EOF.\n  ...8) (i8x16.replace_lane (local.get 0) (v128.const i8x16 0 0 0 0 0 0 0 0 0 0...\n                                          ^\nout/test/spec/simd_lane.wast:577: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.114.wat:1:53: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...2) (result v128) (i16x8.replace_lane (local.get 0) (v128.const i16x8 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.114.wat:1:67: error: unexpected token (, expected EOF.\n  ...8) (i16x8.replace_lane (local.get 0) (v128.const i16x8 0 0 0 0 0 0 0 0) (i...\n                                          ^\nout/test/spec/simd_lane.wast:578: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.115.wat:1:53: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...2) (result v128) (i32x4.replace_lane (local.get 0) (v128.const i32x4 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.115.wat:1:67: error: unexpected token (, expected EOF.\n  ...8) (i32x4.replace_lane (local.get 0) (v128.const i32x4 0 0 0 0) (i32.const...\n                                          ^\nout/test/spec/simd_lane.wast:579: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.116.wat:1:53: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...2) (result v128) (f32x4.replace_lane (local.get 0) (v128.const f32x4 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.116.wat:1:67: error: unexpected token (, expected EOF.\n  ...8) (f32x4.replace_lane (local.get 0) (v128.const f32x4 0 0 0 0) (f32.const...\n                                          ^\nout/test/spec/simd_lane.wast:581: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.117.wat:1:52: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ... i32) (result i64) (i64x2.extract_lane (local.get 0) (v128.const i64x2 0 0)))\n                                            ^\n  out/test/spec/simd_lane/simd_lane.117.wat:1:66: error: unexpected token (, expected EOF.\n  ... i32) (result i64) (i64x2.extract_lane (local.get 0) (v128.const i64x2 0 0)))\n                                                          ^\nout/test/spec/simd_lane.wast:582: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.118.wat:1:52: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ... i32) (result f64) (f64x2.extract_lane (local.get 0) (v128.const f64x2 0 0)))\n                                            ^\n  out/test/spec/simd_lane/simd_lane.118.wat:1:66: error: unexpected token (, expected EOF.\n  ... i32) (result f64) (f64x2.extract_lane (local.get 0) (v128.const f64x2 0 0)))\n                                                          ^\nout/test/spec/simd_lane.wast:583: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.119.wat:1:53: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...2) (result v128) (i64x2.replace_lane (local.get 0) (v128.const i64x2 0 0) ...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.119.wat:1:67: error: unexpected token (, expected EOF.\n  ...128) (i64x2.replace_lane (local.get 0) (v128.const i64x2 0 0) (i64.const 1)))\n                                            ^\nout/test/spec/simd_lane.wast:584: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.120.wat:1:53: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...2) (result v128) (f64x2.replace_lane (local.get 0) (v128.const f64x2 0 0) ...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.120.wat:1:67: error: unexpected token (, expected EOF.\n  ...8) (f64x2.replace_lane (local.get 0) (v128.const f64x2 0 0) (f64.const 1.0)))\n                                          ^\nout/test/spec/simd_lane.wast:588: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.121.wat:1:42: error: unexpected token \"1.5\", expected a natural number in range [0, 32).\n  ... (result i32) (i8x16.extract_lane_s 1.5 (v128.const i8x16 0 0 0 0 0 0 0 0 ...\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.121.wat:1:97: error: unexpected token ), expected EOF.\n  ...i8x16.extract_lane_s 1.5 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:589: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.122.wat:1:42: error: unexpected token \"nan\", expected a natural number in range [0, 32).\n  ... (result i32) (i8x16.extract_lane_u nan (v128.const i8x16 0 0 0 0 0 0 0 0 ...\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.122.wat:1:97: error: unexpected token ), expected EOF.\n  ...i8x16.extract_lane_u nan (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:590: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.123.wat:1:42: error: unexpected token \"inf\", expected a natural number in range [0, 32).\n  ...c (result i32) (i16x8.extract_lane_s inf (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                          ^^^\n  out/test/spec/simd_lane/simd_lane.123.wat:1:81: error: unexpected token ), expected EOF.\n  ...c (result i32) (i16x8.extract_lane_s inf (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:591: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.124.wat:1:42: error: unexpected token \"-inf\", expected a natural number in range [0, 32).\n  ... (result i32) (i16x8.extract_lane_u -inf (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                         ^^^^\n  out/test/spec/simd_lane/simd_lane.124.wat:1:82: error: unexpected token ), expected EOF.\n  ... (result i32) (i16x8.extract_lane_u -inf (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:592: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.125.wat:1:40: error: unexpected token \"nan\", expected a natural number in range [0, 32).\n  (func (result i32) (i32x4.extract_lane nan (v128.const i32x4 0 0 0 0)))\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.125.wat:1:71: error: unexpected token ), expected EOF.\n  (func (result i32) (i32x4.extract_lane nan (v128.const i32x4 0 0 0 0)))\n                                                                        ^\nout/test/spec/simd_lane.wast:593: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.126.wat:1:40: error: unexpected token \"nan\", expected a natural number in range [0, 32).\n  (func (result f32) (f32x4.extract_lane nan (v128.const f32x4 0 0 0 0)))\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.126.wat:1:71: error: unexpected token ), expected EOF.\n  (func (result f32) (f32x4.extract_lane nan (v128.const f32x4 0 0 0 0)))\n                                                                        ^\nout/test/spec/simd_lane.wast:594: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.127.wat:1:41: error: unexpected token \"-2.5\", expected a natural number in range [0, 32).\n  ... (result v128) (i8x16.replace_lane -2.5 (v128.const i8x16 0 0 0 0 0 0 0 0 ...\n                                        ^^^^\n  out/test/spec/simd_lane/simd_lane.127.wat:1:111: error: unexpected token ), expected EOF.\n  ..._lane -2.5 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:595: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.128.wat:1:41: error: unexpected token \"nan\", expected a natural number in range [0, 32).\n  ...c (result v128) (i16x8.replace_lane nan (v128.const i16x8 0 0 0 0 0 0 0 0)...\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.128.wat:1:94: error: unexpected token ), expected EOF.\n  ...8) (i16x8.replace_lane nan (v128.const i16x8 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:596: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.129.wat:1:41: error: unexpected token \"inf\", expected a natural number in range [0, 32).\n  ...c (result v128) (i32x4.replace_lane inf (v128.const i32x4 0 0 0 0) (i32.co...\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.129.wat:1:86: error: unexpected token ), expected EOF.\n  ...sult v128) (i32x4.replace_lane inf (v128.const i32x4 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:597: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.130.wat:1:41: error: unexpected token \"-inf\", expected a natural number in range [0, 32).\n  ... (result v128) (f32x4.replace_lane -inf (v128.const f32x4 0 0 0 0) (f32.co...\n                                        ^^^^\n  out/test/spec/simd_lane/simd_lane.130.wat:1:89: error: unexpected token ), expected EOF.\n  ...t v128) (f32x4.replace_lane -inf (v128.const f32x4 0 0 0 0) (f32.const 1.1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:600: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.131.wat:1:36: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  (func (result v128) (i8x16.shuffle (v128.const i8x16 16 17 18 19 20 21 22 23 ...\n                                     ^\n  out/test/spec/simd_lane/simd_lane.131.wat:1:103: error: unexpected token (, expected EOF.\n  ...20 21 22 23 24 25 26 27 28 29 30 31) (v128.const i8x16 15 14 13 12 11 10 9...\n                                          ^\nout/test/spec/simd_lane.wast:604: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.132.wat:1:71: error: unexpected token \"15.0\", expected a natural number in range [0, 32).\n  ...0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15.0) (v128.const i8x16 15 14 13 12 11 ...\n                                        ^^^^\n  out/test/spec/simd_lane/simd_lane.132.wat:1:191: error: unexpected token ), expected EOF.\n  ...8 7 6 5 4 3 2 1 0) (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:608: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.133.wat:1:36: error: unexpected token \"0.5\", expected a natural number in range [0, 32).\n  (func (result v128) (i8x16.shuffle 0.5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) (...\n                                     ^^^\nout/test/spec/simd_lane.wast:612: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.134.wat:1:36: error: unexpected token \"-inf\", expected a natural number in range [0, 32).\n  (func (result v128) (i8x16.shuffle -inf 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) ...\n                                     ^^^^\nout/test/spec/simd_lane.wast:616: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.135.wat:1:71: error: unexpected token \"inf\", expected a natural number in range [0, 32).\n  ... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 inf) (v128.const i8x16 15 14 13 12 11 ...\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.135.wat:1:190: error: unexpected token ), expected EOF.\n  ...8 7 6 5 4 3 2 1 0) (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:620: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.136.wat:1:36: error: unexpected token \"nan\", expected a natural number in range [0, 32).\n  (func (result v128) (i8x16.shuffle nan 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) (...\n                                     ^^^\nout/test/spec/simd_lane.wast:877: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.141.wat:1:21: error: invalid literal \"+0x0f\"\n  (func (result i32) (i8x16.extract_lane_u +0x0f (v128.const i8x16 0 0 0 0 0 0 ...\n                      ^^^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.141.wat:1:99: error: unexpected token ), expected EOF.\n  ...x16.extract_lane_u +0x0f (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:878: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.142.wat:1:21: error: invalid literal \"+03\"\n  (func (result f32) (f32x4.extract_lane +03 (v128.const f32x4 0 0 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.142.wat:1:71: error: unexpected token ), expected EOF.\n  (func (result f32) (f32x4.extract_lane +03 (v128.const f32x4 0 0 0 0)))\n                                                                        ^\nout/test/spec/simd_lane.wast:879: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.143.wat:1:21: error: invalid literal \"+1\"\n  (func (result i64) (i64x2.extract_lane +1 (v128.const i64x2 0 0)))\n                      ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.143.wat:1:66: error: unexpected token ), expected EOF.\n  (func (result i64) (i64x2.extract_lane +1 (v128.const i64x2 0 0)))\n                                                                   ^\nout/test/spec/simd_lane.wast:880: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.144.wat:1:22: error: invalid literal \"+015\"\n  (func (result v128) (i8x16.replace_lane +015 (v128.const i8x16 0 0 0 0 0 0 0 ...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.144.wat:1:111: error: unexpected token ), expected EOF.\n  ..._lane +015 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:881: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.145.wat:1:22: error: invalid literal \"+0x7\"\n  (func (result v128) (i16x8.replace_lane +0x7 (v128.const i16x8 0 0 0 0 0 0 0 ...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.145.wat:1:95: error: unexpected token ), expected EOF.\n  ...) (i16x8.replace_lane +0x7 (v128.const i16x8 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:882: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.146.wat:1:22: error: invalid literal \"+3\"\n  (func (result v128) (i32x4.replace_lane +3 (v128.const i32x4 0 0 0 0) (i32.co...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.146.wat:1:85: error: unexpected token ), expected EOF.\n  ...esult v128) (i32x4.replace_lane +3 (v128.const i32x4 0 0 0 0) (i32.const 1)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:883: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.147.wat:1:22: error: invalid literal \"+0x01\"\n  (func (result v128) (f64x2.replace_lane +0x01 (v128.const f64x2 0 0) (f64.con...\n                       ^^^^^^^^^^^^^^^^^^\n  out/test/spec/simd_lane/simd_lane.147.wat:1:86: error: unexpected token ), expected EOF.\n  ...sult v128) (f64x2.replace_lane +0x01 (v128.const f64x2 0 0) (f64.const 1.0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:897: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.155.wat:1:42: error: unexpected token \"1.0\", expected a natural number in range [0, 32).\n  ... (result i32) (i8x16.extract_lane_s 1.0 (v128.const i8x16 0 0 0 0 0 0 0 0 ...\n                                         ^^^\n  out/test/spec/simd_lane/simd_lane.155.wat:1:97: error: unexpected token ), expected EOF.\n  ...i8x16.extract_lane_s 1.0 (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                 ^\nout/test/spec/simd_lane.wast:902: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.156.wat:1:79: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ... (result i32)  (i8x16.extract_lane_s (v128.const i8x16 0 0 0 0 0 0 0 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.156.wat:1:129: error: unexpected token ), expected EOF.\n  ...)  (i8x16.extract_lane_s (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)))\n                                                                                ^\nout/test/spec/simd_lane.wast:910: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.157.wasm:000001b: error: type mismatch in i8x16.extract_lane_s, expected [v128] but got []\n  000001b: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:918: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.158.wat:1:74: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i8x16.extract_lane_s-arg-empty (result i32)  (i8x16.extract_lane_s))\n                                                                           ^\nout/test/spec/simd_lane.wast:926: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.159.wat:1:79: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...mpty (result i32)  (i16x8.extract_lane_u (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                              ^\n  out/test/spec/simd_lane/simd_lane.159.wat:1:113: error: unexpected token ), expected EOF.\n  ...mpty (result i32)  (i16x8.extract_lane_u (v128.const i16x8 0 0 0 0 0 0 0 0)))\n                                                                                ^\nout/test/spec/simd_lane.wast:934: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.160.wasm:000001b: error: type mismatch in i16x8.extract_lane_u, expected [v128] but got []\n  000001b: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:942: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.161.wat:1:74: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i16x8.extract_lane_u-arg-empty (result i32)  (i16x8.extract_lane_u))\n                                                                           ^\nout/test/spec/simd_lane.wast:950: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.162.wat:1:75: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...-1st-arg-empty (result i32)  (i32x4.extract_lane (v128.const i32x4 0 0 0 0)))\n                                                      ^\n  out/test/spec/simd_lane/simd_lane.162.wat:1:101: error: unexpected token ), expected EOF.\n  ...-1st-arg-empty (result i32)  (i32x4.extract_lane (v128.const i32x4 0 0 0 0)))\n                                                                                ^\nout/test/spec/simd_lane.wast:958: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.163.wasm:000001b: error: type mismatch in i32x4.extract_lane, expected [v128] but got []\n  000001b: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:966: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.164.wat:1:70: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i32x4.extract_lane-arg-empty (result i32)  (i32x4.extract_lane))\n                                                                       ^\nout/test/spec/simd_lane.wast:974: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.165.wat:1:75: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...lane-1st-arg-empty (result i64)  (i64x2.extract_lane (v128.const i64x2 0 0)))\n                                                          ^\n  out/test/spec/simd_lane/simd_lane.165.wat:1:97: error: unexpected token ), expected EOF.\n  ...lane-1st-arg-empty (result i64)  (i64x2.extract_lane (v128.const i64x2 0 0)))\n                                                                                ^\nout/test/spec/simd_lane.wast:982: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.166.wasm:000001b: error: type mismatch in i64x2.extract_lane, expected [v128] but got []\n  000001b: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:990: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.167.wat:1:70: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i64x2.extract_lane-arg-empty (result i64)  (i64x2.extract_lane))\n                                                                       ^\nout/test/spec/simd_lane.wast:998: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.168.wat:1:75: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...-1st-arg-empty (result f32)  (f32x4.extract_lane (v128.const f32x4 0 0 0 0)))\n                                                      ^\n  out/test/spec/simd_lane/simd_lane.168.wat:1:101: error: unexpected token ), expected EOF.\n  ...-1st-arg-empty (result f32)  (f32x4.extract_lane (v128.const f32x4 0 0 0 0)))\n                                                                                ^\nout/test/spec/simd_lane.wast:1006: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.169.wasm:000001b: error: type mismatch in f32x4.extract_lane, expected [v128] but got []\n  000001b: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1014: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.170.wat:1:70: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $f32x4.extract_lane-arg-empty (result f32)  (f32x4.extract_lane))\n                                                                       ^\nout/test/spec/simd_lane.wast:1022: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.171.wat:1:75: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...lane-1st-arg-empty (result f64)  (f64x2.extract_lane (v128.const f64x2 0 0)))\n                                                          ^\n  out/test/spec/simd_lane/simd_lane.171.wat:1:97: error: unexpected token ), expected EOF.\n  ...lane-1st-arg-empty (result f64)  (f64x2.extract_lane (v128.const f64x2 0 0)))\n                                                                                ^\nout/test/spec/simd_lane.wast:1030: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.172.wasm:000001b: error: type mismatch in f64x2.extract_lane, expected [v128] but got []\n  000001b: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1038: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.173.wat:1:70: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $f64x2.extract_lane-arg-empty (result f64)  (f64x2.extract_lane))\n                                                                       ^\nout/test/spec/simd_lane.wast:1046: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.174.wat:1:76: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...y (result v128)  (i8x16.replace_lane (v128.const i8x16 0 0 0 0 0 0 0 0 0 0...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.174.wat:1:127: error: unexpected token (, expected EOF.\n  ...place_lane (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                   ^\nout/test/spec/simd_lane.wast:1054: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.175.wasm:000001d: error: type mismatch in i8x16.replace_lane, expected [v128, i32] but got [i32]\n  000001d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1062: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.176.wasm:000002d: error: type mismatch in i8x16.replace_lane, expected [v128, i32] but got [v128]\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1070: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.177.wat:1:71: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i8x16.replace_lane-arg-empty (result v128)  (i8x16.replace_lane))\n                                                                        ^\nout/test/spec/simd_lane.wast:1078: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.178.wat:1:76: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...y (result v128)  (i16x8.replace_lane (v128.const i16x8 0 0 0 0 0 0 0 0) (i...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.178.wat:1:111: error: unexpected token (, expected EOF.\n  ...v128)  (i16x8.replace_lane (v128.const i16x8 0 0 0 0 0 0 0 0) (i32.const 1)))\n                                                                   ^\nout/test/spec/simd_lane.wast:1086: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.179.wasm:000001d: error: type mismatch in i16x8.replace_lane, expected [v128, i32] but got [i32]\n  000001d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1094: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.180.wasm:000002d: error: type mismatch in i16x8.replace_lane, expected [v128, i32] but got [v128]\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1102: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.181.wat:1:71: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i16x8.replace_lane-arg-empty (result v128)  (i16x8.replace_lane))\n                                                                        ^\nout/test/spec/simd_lane.wast:1110: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.182.wat:1:76: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...y (result v128)  (i32x4.replace_lane (v128.const i32x4 0 0 0 0) (i32.const...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.182.wat:1:103: error: unexpected token (, expected EOF.\n  ...(result v128)  (i32x4.replace_lane (v128.const i32x4 0 0 0 0) (i32.const 1)))\n                                                                   ^\nout/test/spec/simd_lane.wast:1118: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.183.wasm:000001d: error: type mismatch in i32x4.replace_lane, expected [v128, i32] but got [i32]\n  000001d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1126: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.184.wasm:000002d: error: type mismatch in i32x4.replace_lane, expected [v128, i32] but got [v128]\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1134: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.185.wat:1:71: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i32x4.replace_lane-arg-empty (result v128)  (i32x4.replace_lane))\n                                                                        ^\nout/test/spec/simd_lane.wast:1142: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.186.wat:1:76: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...y (result v128)  (f32x4.replace_lane (v128.const f32x4 0 0 0 0) (f32.const...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.186.wat:1:103: error: unexpected token (, expected EOF.\n  ...esult v128)  (f32x4.replace_lane (v128.const f32x4 0 0 0 0) (f32.const 1.0)))\n                                                                 ^\nout/test/spec/simd_lane.wast:1150: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.187.wasm:0000020: error: type mismatch in f32x4.replace_lane, expected [v128, f32] but got [f32]\n  0000020: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1158: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.188.wasm:000002d: error: type mismatch in f32x4.replace_lane, expected [v128, f32] but got [v128]\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1166: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.189.wat:1:71: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $f32x4.replace_lane-arg-empty (result v128)  (f32x4.replace_lane))\n                                                                        ^\nout/test/spec/simd_lane.wast:1174: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.190.wat:1:76: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...pty (result v128)  (i64x2.replace_lane (v128.const i64x2 0 0) (i64.const 1)))\n                                            ^\n  out/test/spec/simd_lane/simd_lane.190.wat:1:99: error: unexpected token (, expected EOF.\n  ...pty (result v128)  (i64x2.replace_lane (v128.const i64x2 0 0) (i64.const 1)))\n                                                                   ^\nout/test/spec/simd_lane.wast:1182: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.191.wasm:000001d: error: type mismatch in i64x2.replace_lane, expected [v128, i64] but got [i64]\n  000001d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1190: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.192.wasm:000002d: error: type mismatch in i64x2.replace_lane, expected [v128, i64] but got [v128]\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1198: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.193.wat:1:71: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i64x2.replace_lane-arg-empty (result v128)  (i64x2.replace_lane))\n                                                                        ^\nout/test/spec/simd_lane.wast:1206: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.194.wat:1:76: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...y (result v128)  (f64x2.replace_lane (v128.const f64x2 0 0) (f64.const 1.0)))\n                                          ^\n  out/test/spec/simd_lane/simd_lane.194.wat:1:99: error: unexpected token (, expected EOF.\n  ...y (result v128)  (f64x2.replace_lane (v128.const f64x2 0 0) (f64.const 1.0)))\n                                                                 ^\nout/test/spec/simd_lane.wast:1214: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.195.wasm:0000024: error: type mismatch in f64x2.replace_lane, expected [v128, f64] but got [f64]\n  0000024: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1222: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.196.wasm:000002d: error: type mismatch in f64x2.replace_lane, expected [v128, f64] but got [v128]\n  000002d: error: OnSimdLaneOpExpr callback failed\nout/test/spec/simd_lane.wast:1230: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.197.wat:1:71: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $f64x2.replace_lane-arg-empty (result v128)  (f64x2.replace_lane))\n                                                                        ^\nout/test/spec/simd_lane.wast:1238: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.198.wat:1:69: error: unexpected token \"(\", expected a natural number in range [0, 32).\n  ...pty (result v128)  (i8x16.shuffle    (v128.const i8x16 0 1 2 3 5 6 6 7 8 9...\n                                          ^\n  out/test/spec/simd_lane/simd_lane.198.wat:1:129: error: unexpected token (, expected EOF.\n  ... 3 5 6 6 7 8 9 10 11 12 13 14 15)    (v128.const i8x16 1 2 3 5 6 6 7 8 9 1...\n                                          ^\nout/test/spec/simd_lane.wast:1249: assert_invalid passed:\n  out/test/spec/simd_lane/simd_lane.199.wasm:000003c: error: type mismatch in i8x16.shuffle, expected [v128, v128] but got [v128]\n  000003c: error: OnSimdShuffleOpExpr callback failed\nout/test/spec/simd_lane.wast:1259: assert_malformed passed:\n  out/test/spec/simd_lane/simd_lane.200.wat:1:61: error: unexpected token \")\", expected a natural number in range [0, 32).\n  (func $i8x16.shuffle-arg-empty (result v128)  (i8x16.shuffle))\n                                                              ^\n475/475 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_linking.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_linking.wast\n(;; STDOUT ;;;\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_load.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_load.wast\n(;; STDOUT ;;;\nout/test/spec/simd_load.wast:141: assert_malformed passed:\n  out/test/spec/simd_load/simd_load.14.wat:1:37: error: unexpected token \"v128.load8\", expected an expr.\n  (memory 1)(func (local v128) (drop (v128.load8 (i32.const 0))))\n                                      ^^^^^^^^^^\n  out/test/spec/simd_load/simd_load.14.wat:1:62: error: unexpected token ), expected EOF.\n  (memory 1)(func (local v128) (drop (v128.load8 (i32.const 0))))\n                                                               ^\nout/test/spec/simd_load.wast:148: assert_malformed passed:\n  out/test/spec/simd_load/simd_load.15.wat:1:37: error: unexpected token \"v128.load16\", expected an expr.\n  (memory 1)(func (local v128) (drop (v128.load16 (i32.const 0))))\n                                      ^^^^^^^^^^^\n  out/test/spec/simd_load/simd_load.15.wat:1:63: error: unexpected token ), expected EOF.\n  (memory 1)(func (local v128) (drop (v128.load16 (i32.const 0))))\n                                                                ^\nout/test/spec/simd_load.wast:155: assert_malformed passed:\n  out/test/spec/simd_load/simd_load.16.wat:1:37: error: unexpected token \"v128.load32\", expected an expr.\n  (memory 1)(func (local v128) (drop (v128.load32 (i32.const 0))))\n                                      ^^^^^^^^^^^\n  out/test/spec/simd_load/simd_load.16.wat:1:63: error: unexpected token ), expected EOF.\n  (memory 1)(func (local v128) (drop (v128.load32 (i32.const 0))))\n                                                                ^\nout/test/spec/simd_load.wast:166: assert_invalid passed:\n  out/test/spec/simd_load/simd_load.17.wasm:0000027: error: type mismatch in v128.load, expected [i32] but got [f32]\n  0000027: error: OnLoadExpr callback failed\nout/test/spec/simd_load.wast:170: assert_invalid passed:\n  out/test/spec/simd_load/simd_load.18.wasm:0000028: error: type mismatch in br_if, expected [i32] but got [v128]\n  0000028: error: OnBrIfExpr callback failed\nout/test/spec/simd_load.wast:174: assert_invalid passed:\n  out/test/spec/simd_load/simd_load.19.wasm:0000025: error: type mismatch at end of function, expected [] but got [v128]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/simd_load.wast:182: assert_invalid passed:\n  out/test/spec/simd_load/simd_load.20.wasm:000001e: error: local variable out of range (max 0)\n  000001e: error: OnLocalGetExpr callback failed\nout/test/spec/simd_load.wast:186: assert_invalid passed:\n  out/test/spec/simd_load/simd_load.21.wasm:0000020: error: type mismatch in v128.load, expected [i32] but got []\n  0000020: error: OnLoadExpr callback failed\n39/39 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_load16_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_load16_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_load16_lane.wast:195: assert_invalid passed:\n  out/test/spec/simd_load16_lane/simd_load16_lane.1.wasm:0000027: error: type mismatch in v128.load16_lane, expected [i32, v128] but got [v128, i32]\n  0000027: error: OnSimdLoadLaneExpr callback failed\nout/test/spec/simd_load16_lane.wast:201: assert_invalid passed:\n  out/test/spec/simd_load16_lane/simd_load16_lane.2.wasm:0000027: error: lane index must be less than 8 (got 8)\n  0000027: error: OnSimdLoadLaneExpr callback failed\nout/test/spec/simd_load16_lane.wast:208: assert_invalid passed:\n  out/test/spec/simd_load16_lane/simd_load16_lane.3.wasm:0000027: error: alignment must not be larger than natural alignment (2)\n  0000027: error: OnSimdLoadLaneExpr callback failed\n36/36 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_load32_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_load32_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_load32_lane.wast:127: assert_invalid passed:\n  out/test/spec/simd_load32_lane/simd_load32_lane.1.wasm:0000027: error: type mismatch in v128.load32_lane, expected [i32, v128] but got [v128, i32]\n  0000027: error: OnSimdLoadLaneExpr callback failed\nout/test/spec/simd_load32_lane.wast:133: assert_invalid passed:\n  out/test/spec/simd_load32_lane/simd_load32_lane.2.wasm:0000027: error: lane index must be less than 4 (got 4)\n  0000027: error: OnSimdLoadLaneExpr callback failed\nout/test/spec/simd_load32_lane.wast:140: assert_invalid passed:\n  out/test/spec/simd_load32_lane/simd_load32_lane.3.wasm:0000027: error: alignment must not be larger than natural alignment (4)\n  0000027: error: OnSimdLoadLaneExpr callback failed\n24/24 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_load64_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_load64_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_load64_lane.wast:81: assert_invalid passed:\n  out/test/spec/simd_load64_lane/simd_load64_lane.1.wasm:0000027: error: type mismatch in v128.load64_lane, expected [i32, v128] but got [v128, i32]\n  0000027: error: OnSimdLoadLaneExpr callback failed\nout/test/spec/simd_load64_lane.wast:87: assert_invalid passed:\n  out/test/spec/simd_load64_lane/simd_load64_lane.2.wasm:0000027: error: lane index must be less than 2 (got 2)\n  0000027: error: OnSimdLoadLaneExpr callback failed\nout/test/spec/simd_load64_lane.wast:94: assert_invalid passed:\n  out/test/spec/simd_load64_lane/simd_load64_lane.3.wasm:0000027: error: alignment must not be larger than natural alignment (8)\n  0000027: error: OnSimdLoadLaneExpr callback failed\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_load8_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_load8_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_load8_lane.wast:283: assert_invalid passed:\n  out/test/spec/simd_load8_lane/simd_load8_lane.1.wasm:0000027: error: type mismatch in v128.load8_lane, expected [i32, v128] but got [v128, i32]\n  0000027: error: OnSimdLoadLaneExpr callback failed\nout/test/spec/simd_load8_lane.wast:289: assert_invalid passed:\n  out/test/spec/simd_load8_lane/simd_load8_lane.2.wasm:0000027: error: lane index must be less than 16 (got 16)\n  0000027: error: OnSimdLoadLaneExpr callback failed\nout/test/spec/simd_load8_lane.wast:296: assert_invalid passed:\n  out/test/spec/simd_load8_lane/simd_load8_lane.3.wasm:0000027: error: alignment must not be larger than natural alignment (1)\n  0000027: error: OnSimdLoadLaneExpr callback failed\n52/52 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_load_extend.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_load_extend.wast\n(;; STDOUT ;;;\nout/test/spec/simd_load_extend.wast:226: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:227: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:228: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:229: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:230: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:231: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:233: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:234: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:235: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:236: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:237: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:238: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/simd_load_extend.wast:241: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.1.wasm:0000026: error: type mismatch in v128.load8x8_s, expected [i32] but got [f32]\n  0000026: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:242: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.2.wasm:0000026: error: type mismatch in v128.load8x8_u, expected [i32] but got [f32]\n  0000026: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:243: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.3.wasm:000002a: error: type mismatch in v128.load16x4_s, expected [i32] but got [f64]\n  000002a: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:244: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.4.wasm:000002a: error: type mismatch in v128.load16x4_u, expected [i32] but got [f64]\n  000002a: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:245: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.5.wasm:0000033: error: type mismatch in v128.load32x2_s, expected [i32] but got [v128]\n  0000033: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:246: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.6.wasm:0000033: error: type mismatch in v128.load32x2_u, expected [i32] but got [v128]\n  0000033: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:251: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.7.wasm:0000021: error: type mismatch in v128.load8x8_s, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:259: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.8.wasm:0000021: error: type mismatch in v128.load8x8_u, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:267: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.9.wasm:0000021: error: type mismatch in v128.load16x4_s, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:275: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.10.wasm:0000021: error: type mismatch in v128.load16x4_u, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:283: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.11.wasm:0000021: error: type mismatch in v128.load32x2_s, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:291: assert_invalid passed:\n  out/test/spec/simd_load_extend/simd_load_extend.12.wasm:0000021: error: type mismatch in v128.load32x2_u, expected [i32] but got []\n  0000021: error: OnLoadExpr callback failed\nout/test/spec/simd_load_extend.wast:301: assert_malformed passed:\n  out/test/spec/simd_load_extend/simd_load_extend.13.wat:1:25: error: unexpected token \"i16x8.load16x4_s\", expected an expr.\n  (memory 1) (func (drop (i16x8.load16x4_s (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_extend/simd_load_extend.13.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i16x8.load16x4_s (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_extend.wast:302: assert_malformed passed:\n  out/test/spec/simd_load_extend/simd_load_extend.14.wat:1:25: error: unexpected token \"i16x8.load16x4_u\", expected an expr.\n  (memory 1) (func (drop (i16x8.load16x4_u (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_extend/simd_load_extend.14.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i16x8.load16x4_u (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_extend.wast:303: assert_malformed passed:\n  out/test/spec/simd_load_extend/simd_load_extend.15.wat:1:25: error: unexpected token \"i32x4.load32x2_s\", expected an expr.\n  (memory 1) (func (drop (i32x4.load32x2_s (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_extend/simd_load_extend.15.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i32x4.load32x2_s (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_extend.wast:304: assert_malformed passed:\n  out/test/spec/simd_load_extend/simd_load_extend.16.wat:1:25: error: unexpected token \"i32x4.load32x2_u\", expected an expr.\n  (memory 1) (func (drop (i32x4.load32x2_u (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_extend/simd_load_extend.16.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i32x4.load32x2_u (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_extend.wast:305: assert_malformed passed:\n  out/test/spec/simd_load_extend/simd_load_extend.17.wat:1:25: error: unexpected token \"i64x2.load64x1_s\", expected an expr.\n  (memory 1) (func (drop (i64x2.load64x1_s (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_extend/simd_load_extend.17.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i64x2.load64x1_s (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_extend.wast:306: assert_malformed passed:\n  out/test/spec/simd_load_extend/simd_load_extend.18.wat:1:25: error: unexpected token \"i64x2.load64x1_u\", expected an expr.\n  (memory 1) (func (drop (i64x2.load64x1_u (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_extend/simd_load_extend.18.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i64x2.load64x1_u (i32.const 0))))\n                                                         ^\n104/104 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_load_splat.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_load_splat.wast\n(;; STDOUT ;;;\nout/test/spec/simd_load_splat.wast:119: assert_trap passed: out of bounds memory access: access at 4294967295+1 >= max value 65536\nout/test/spec/simd_load_splat.wast:120: assert_trap passed: out of bounds memory access: access at 4294967295+2 >= max value 65536\nout/test/spec/simd_load_splat.wast:121: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/simd_load_splat.wast:122: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/simd_load_splat.wast:123: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/simd_load_splat.wast:124: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/simd_load_splat.wast:125: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/simd_load_splat.wast:126: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/simd_load_splat.wast:128: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/simd_load_splat.wast:129: assert_trap passed: out of bounds memory access: access at 65537+1 >= max value 65536\nout/test/spec/simd_load_splat.wast:130: assert_trap passed: out of bounds memory access: access at 65550+1 >= max value 65536\nout/test/spec/simd_load_splat.wast:131: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/simd_load_splat.wast:132: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/simd_load_splat.wast:133: assert_trap passed: out of bounds memory access: access at 65549+2 >= max value 65536\nout/test/spec/simd_load_splat.wast:134: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/simd_load_splat.wast:135: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/simd_load_splat.wast:136: assert_trap passed: out of bounds memory access: access at 65547+4 >= max value 65536\nout/test/spec/simd_load_splat.wast:137: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/simd_load_splat.wast:138: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/simd_load_splat.wast:139: assert_trap passed: out of bounds memory access: access at 65543+8 >= max value 65536\nout/test/spec/simd_load_splat.wast:141: assert_trap passed: out of bounds memory access: access at 4294967296+1 >= max value 65536\nout/test/spec/simd_load_splat.wast:142: assert_trap passed: out of bounds memory access: access at 4294967296+2 >= max value 65536\nout/test/spec/simd_load_splat.wast:143: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/simd_load_splat.wast:144: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/simd_load_splat.wast:146: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/simd_load_splat.wast:147: assert_trap passed: out of bounds memory access: access at 65535+2 >= max value 65536\nout/test/spec/simd_load_splat.wast:148: assert_trap passed: out of bounds memory access: access at 65533+4 >= max value 65536\nout/test/spec/simd_load_splat.wast:149: assert_trap passed: out of bounds memory access: access at 65529+8 >= max value 65536\nout/test/spec/simd_load_splat.wast:150: assert_trap passed: out of bounds memory access: access at 65537+1 >= max value 65536\nout/test/spec/simd_load_splat.wast:151: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/simd_load_splat.wast:152: assert_trap passed: out of bounds memory access: access at 65534+4 >= max value 65536\nout/test/spec/simd_load_splat.wast:153: assert_trap passed: out of bounds memory access: access at 65530+8 >= max value 65536\nout/test/spec/simd_load_splat.wast:214: assert_invalid passed:\n  out/test/spec/simd_load_splat/simd_load_splat.2.wasm:0000033: error: type mismatch in v128.load8_splat, expected [i32] but got [v128]\n  0000033: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_load_splat.wast:215: assert_invalid passed:\n  out/test/spec/simd_load_splat/simd_load_splat.3.wasm:0000033: error: type mismatch in v128.load16_splat, expected [i32] but got [v128]\n  0000033: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_load_splat.wast:216: assert_invalid passed:\n  out/test/spec/simd_load_splat/simd_load_splat.4.wasm:0000033: error: type mismatch in v128.load32_splat, expected [i32] but got [v128]\n  0000033: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_load_splat.wast:217: assert_invalid passed:\n  out/test/spec/simd_load_splat/simd_load_splat.5.wasm:0000033: error: type mismatch in v128.load64_splat, expected [i32] but got [v128]\n  0000033: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_load_splat.wast:222: assert_malformed passed:\n  out/test/spec/simd_load_splat/simd_load_splat.6.wat:1:25: error: unexpected token \"i8x16.load_splat\", expected an expr.\n  (memory 1) (func (drop (i8x16.load_splat (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_splat/simd_load_splat.6.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i8x16.load_splat (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_splat.wast:223: assert_malformed passed:\n  out/test/spec/simd_load_splat/simd_load_splat.7.wat:1:25: error: unexpected token \"i16x8.load_splat\", expected an expr.\n  (memory 1) (func (drop (i16x8.load_splat (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_splat/simd_load_splat.7.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i16x8.load_splat (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_splat.wast:224: assert_malformed passed:\n  out/test/spec/simd_load_splat/simd_load_splat.8.wat:1:25: error: unexpected token \"i32x4.load_splat\", expected an expr.\n  (memory 1) (func (drop (i32x4.load_splat (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_splat/simd_load_splat.8.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i32x4.load_splat (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_splat.wast:225: assert_malformed passed:\n  out/test/spec/simd_load_splat/simd_load_splat.9.wat:1:25: error: unexpected token \"i64x2.load_splat\", expected an expr.\n  (memory 1) (func (drop (i64x2.load_splat (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_splat/simd_load_splat.9.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i64x2.load_splat (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_splat.wast:231: assert_invalid passed:\n  out/test/spec/simd_load_splat/simd_load_splat.10.wasm:0000021: error: type mismatch in v128.load8_splat, expected [i32] but got []\n  0000021: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_load_splat.wast:239: assert_invalid passed:\n  out/test/spec/simd_load_splat/simd_load_splat.11.wasm:0000021: error: type mismatch in v128.load16_splat, expected [i32] but got []\n  0000021: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_load_splat.wast:247: assert_invalid passed:\n  out/test/spec/simd_load_splat/simd_load_splat.12.wasm:0000021: error: type mismatch in v128.load32_splat, expected [i32] but got []\n  0000021: error: OnLoadSplatExpr callback failed\nout/test/spec/simd_load_splat.wast:255: assert_invalid passed:\n  out/test/spec/simd_load_splat/simd_load_splat.13.wasm:0000021: error: type mismatch in v128.load64_splat, expected [i32] but got []\n  0000021: error: OnLoadSplatExpr callback failed\n126/126 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_load_zero.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_load_zero.wast\n(;; STDOUT ;;;\nout/test/spec/simd_load_zero.wast:88: assert_trap passed: out of bounds memory access: access at 4294967295+4 >= max value 65536\nout/test/spec/simd_load_zero.wast:89: assert_trap passed: out of bounds memory access: access at 4294967295+8 >= max value 65536\nout/test/spec/simd_load_zero.wast:91: assert_trap passed: out of bounds memory access: access at 4294967296+4 >= max value 65536\nout/test/spec/simd_load_zero.wast:92: assert_trap passed: out of bounds memory access: access at 4294967296+8 >= max value 65536\nout/test/spec/simd_load_zero.wast:95: assert_invalid passed:\n  out/test/spec/simd_load_zero/simd_load_zero.1.wasm:0000026: error: type mismatch in v128.load32_zero, expected [i32] but got [f32]\n  0000026: error: OnLoadZeroExpr callback failed\nout/test/spec/simd_load_zero.wast:96: assert_invalid passed:\n  out/test/spec/simd_load_zero/simd_load_zero.2.wasm:0000026: error: type mismatch in v128.load64_zero, expected [i32] but got [f32]\n  0000026: error: OnLoadZeroExpr callback failed\nout/test/spec/simd_load_zero.wast:101: assert_invalid passed:\n  out/test/spec/simd_load_zero/simd_load_zero.3.wasm:0000021: error: type mismatch in v128.load32_zero, expected [i32] but got []\n  0000021: error: OnLoadZeroExpr callback failed\nout/test/spec/simd_load_zero.wast:109: assert_invalid passed:\n  out/test/spec/simd_load_zero/simd_load_zero.4.wasm:0000021: error: type mismatch in v128.load64_zero, expected [i32] but got []\n  0000021: error: OnLoadZeroExpr callback failed\nout/test/spec/simd_load_zero.wast:119: assert_malformed passed:\n  out/test/spec/simd_load_zero/simd_load_zero.5.wat:1:25: error: unexpected token \"i16x8.load16x4_s\", expected an expr.\n  (memory 1) (func (drop (i16x8.load16x4_s (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_zero/simd_load_zero.5.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i16x8.load16x4_s (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_zero.wast:120: assert_malformed passed:\n  out/test/spec/simd_load_zero/simd_load_zero.6.wat:1:25: error: unexpected token \"i16x8.load16x4_u\", expected an expr.\n  (memory 1) (func (drop (i16x8.load16x4_u (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_zero/simd_load_zero.6.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i16x8.load16x4_u (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_zero.wast:121: assert_malformed passed:\n  out/test/spec/simd_load_zero/simd_load_zero.7.wat:1:25: error: unexpected token \"i32x4.load32x2_s\", expected an expr.\n  (memory 1) (func (drop (i32x4.load32x2_s (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_zero/simd_load_zero.7.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i32x4.load32x2_s (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_zero.wast:122: assert_malformed passed:\n  out/test/spec/simd_load_zero/simd_load_zero.8.wat:1:25: error: unexpected token \"i32x4.load32x2_u\", expected an expr.\n  (memory 1) (func (drop (i32x4.load32x2_u (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_zero/simd_load_zero.8.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i32x4.load32x2_u (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_zero.wast:123: assert_malformed passed:\n  out/test/spec/simd_load_zero/simd_load_zero.9.wat:1:25: error: unexpected token \"i64x2.load64x1_s\", expected an expr.\n  (memory 1) (func (drop (i64x2.load64x1_s (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_zero/simd_load_zero.9.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i64x2.load64x1_s (i32.const 0))))\n                                                         ^\nout/test/spec/simd_load_zero.wast:124: assert_malformed passed:\n  out/test/spec/simd_load_zero/simd_load_zero.10.wat:1:25: error: unexpected token \"i64x2.load64x1_u\", expected an expr.\n  (memory 1) (func (drop (i64x2.load64x1_u (i32.const 0))))\n                          ^^^^^^^^^^^^^^^^\n  out/test/spec/simd_load_zero/simd_load_zero.10.wat:1:56: error: unexpected token ), expected EOF.\n  (memory 1) (func (drop (i64x2.load64x1_u (i32.const 0))))\n                                                         ^\n39/39 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_splat.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_splat.wast\n(;; STDOUT ;;;\nout/test/spec/simd_splat.wast:122: assert_malformed passed:\n  out/test/spec/simd_splat/simd_splat.1.wat:1:22: error: unexpected token \"v128.splat\", expected an instr.\n  (func (result v128) (v128.splat (i32.const 0)))\n                       ^^^^^^^^^^\nout/test/spec/simd_splat.wast:127: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.2.wasm:000001a: error: type mismatch in i8x16.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:128: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.3.wasm:000001a: error: type mismatch in i8x16.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:129: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.4.wasm:000001a: error: type mismatch in i8x16.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:130: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.5.wasm:000001a: error: type mismatch in i16x8.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:131: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.6.wasm:000001a: error: type mismatch in i16x8.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:132: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.7.wasm:000001a: error: type mismatch in i16x8.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:133: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.8.wasm:000001a: error: type mismatch in i32x4.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:134: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.9.wasm:000001a: error: type mismatch in i32x4.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:135: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.10.wasm:000001a: error: type mismatch in i32x4.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:136: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.11.wasm:000001a: error: type mismatch in f32x4.splat, expected [f32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:137: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.12.wasm:000001a: error: type mismatch in f32x4.splat, expected [f32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:138: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.13.wasm:000001a: error: type mismatch in f32x4.splat, expected [f32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:139: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.14.wasm:000001a: error: type mismatch in i64x2.splat, expected [i64] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:140: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.15.wasm:000001a: error: type mismatch in i64x2.splat, expected [i64] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:141: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.16.wasm:000001a: error: type mismatch in f64x2.splat, expected [f64] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:142: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.17.wasm:000001a: error: type mismatch in f64x2.splat, expected [f64] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:384: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.21.wasm:000001a: error: type mismatch in i8x16.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:392: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.22.wasm:000001a: error: type mismatch in i16x8.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:400: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.23.wasm:000001a: error: type mismatch in i32x4.splat, expected [i32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:408: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.24.wasm:000001a: error: type mismatch in f32x4.splat, expected [f32] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:416: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.25.wasm:000001a: error: type mismatch in i64x2.splat, expected [i64] but got []\n  000001a: error: OnUnaryExpr callback failed\nout/test/spec/simd_splat.wast:424: assert_invalid passed:\n  out/test/spec/simd_splat/simd_splat.26.wasm:000001a: error: type mismatch in f64x2.splat, expected [f64] but got []\n  000001a: error: OnUnaryExpr callback failed\n185/185 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_store.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_store.wast\n(;; STDOUT ;;;\nout/test/spec/simd_store.wast:103: assert_malformed passed:\n  out/test/spec/simd_store/simd_store.2.wat:1:18: error: unexpected token \"v128.store8\", expected an instr.\n  (memory 1)(func (v128.store8 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                   ^^^^^^^^^^^\nout/test/spec/simd_store.wast:110: assert_malformed passed:\n  out/test/spec/simd_store/simd_store.3.wat:1:18: error: unexpected token \"v128.store16\", expected an instr.\n  (memory 1)(func (v128.store16 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                   ^^^^^^^^^^^^\nout/test/spec/simd_store.wast:117: assert_malformed passed:\n  out/test/spec/simd_store/simd_store.4.wat:1:18: error: unexpected token \"v128.store32\", expected an instr.\n  (memory 1)(func (v128.store32 (i32.const 0) (v128.const i32x4 0 0 0 0)))\n                   ^^^^^^^^^^^^\nout/test/spec/simd_store.wast:128: assert_invalid passed:\n  out/test/spec/simd_store/simd_store.5.wasm:0000037: error: type mismatch in v128.store, expected [i32, v128] but got [f32, v128]\n  0000037: error: OnStoreExpr callback failed\nout/test/spec/simd_store.wast:132: assert_invalid passed:\n  out/test/spec/simd_store/simd_store.6.wasm:0000024: error: type mismatch in v128.store, expected [i32, v128] but got []\n  0000024: error: OnStoreExpr callback failed\nout/test/spec/simd_store.wast:136: assert_invalid passed:\n  out/test/spec/simd_store/simd_store.7.wasm:0000036: error: type mismatch in implicit return, expected [v128] but got []\n  0000036: error: EndFunctionBody callback failed\nout/test/spec/simd_store.wast:144: assert_invalid passed:\n  out/test/spec/simd_store/simd_store.8.wasm:0000032: error: type mismatch in v128.store, expected [i32, v128] but got [v128]\n  0000032: error: OnStoreExpr callback failed\nout/test/spec/simd_store.wast:152: assert_invalid passed:\n  out/test/spec/simd_store/simd_store.9.wasm:0000022: error: type mismatch in v128.store, expected [i32, v128] but got [i32]\n  0000022: error: OnStoreExpr callback failed\nout/test/spec/simd_store.wast:160: assert_invalid passed:\n  out/test/spec/simd_store/simd_store.10.wasm:0000020: error: type mismatch in v128.store, expected [i32, v128] but got []\n  0000020: error: OnStoreExpr callback failed\n28/28 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_store16_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_store16_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_store16_lane.wast:283: assert_invalid passed:\n  out/test/spec/simd_store16_lane/simd_store16_lane.1.wasm:0000027: error: type mismatch in v128.store16_lane, expected [i32, v128] but got [v128, i32]\n  0000027: error: OnSimdStoreLaneExpr callback failed\nout/test/spec/simd_store16_lane.wast:289: assert_invalid passed:\n  out/test/spec/simd_store16_lane/simd_store16_lane.2.wasm:0000027: error: lane index must be less than 8 (got 8)\n  0000027: error: OnSimdStoreLaneExpr callback failed\nout/test/spec/simd_store16_lane.wast:296: assert_invalid passed:\n  out/test/spec/simd_store16_lane/simd_store16_lane.3.wasm:0000027: error: alignment must not be larger than natural alignment (2)\n  0000027: error: OnSimdStoreLaneExpr callback failed\n36/36 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_store32_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_store32_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_store32_lane.wast:183: assert_invalid passed:\n  out/test/spec/simd_store32_lane/simd_store32_lane.1.wasm:0000027: error: type mismatch in v128.store32_lane, expected [i32, v128] but got [v128, i32]\n  0000027: error: OnSimdStoreLaneExpr callback failed\nout/test/spec/simd_store32_lane.wast:189: assert_invalid passed:\n  out/test/spec/simd_store32_lane/simd_store32_lane.2.wasm:0000027: error: lane index must be less than 4 (got 4)\n  0000027: error: OnSimdStoreLaneExpr callback failed\nout/test/spec/simd_store32_lane.wast:196: assert_invalid passed:\n  out/test/spec/simd_store32_lane/simd_store32_lane.3.wasm:0000027: error: alignment must not be larger than natural alignment (4)\n  0000027: error: OnSimdStoreLaneExpr callback failed\n24/24 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_store64_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_store64_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_store64_lane.wast:115: assert_invalid passed:\n  out/test/spec/simd_store64_lane/simd_store64_lane.1.wasm:0000027: error: type mismatch in v128.store64_lane, expected [i32, v128] but got [v128, i32]\n  0000027: error: OnSimdStoreLaneExpr callback failed\nout/test/spec/simd_store64_lane.wast:121: assert_invalid passed:\n  out/test/spec/simd_store64_lane/simd_store64_lane.2.wasm:0000027: error: lane index must be less than 2 (got 2)\n  0000027: error: OnSimdStoreLaneExpr callback failed\nout/test/spec/simd_store64_lane.wast:128: assert_invalid passed:\n  out/test/spec/simd_store64_lane/simd_store64_lane.3.wasm:0000027: error: alignment must not be larger than natural alignment (8)\n  0000027: error: OnSimdStoreLaneExpr callback failed\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/simd_store8_lane.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/simd_store8_lane.wast\n(;; STDOUT ;;;\nout/test/spec/simd_store8_lane.wast:411: assert_invalid passed:\n  out/test/spec/simd_store8_lane/simd_store8_lane.1.wasm:0000027: error: type mismatch in v128.store8_lane, expected [i32, v128] but got [v128, i32]\n  0000027: error: OnSimdStoreLaneExpr callback failed\nout/test/spec/simd_store8_lane.wast:417: assert_invalid passed:\n  out/test/spec/simd_store8_lane/simd_store8_lane.2.wasm:0000027: error: lane index must be less than 16 (got 16)\n  0000027: error: OnSimdStoreLaneExpr callback failed\nout/test/spec/simd_store8_lane.wast:424: assert_invalid passed:\n  out/test/spec/simd_store8_lane/simd_store8_lane.3.wasm:0000027: error: alignment must not be larger than natural alignment (1)\n  0000027: error: OnSimdStoreLaneExpr callback failed\n52/52 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/skip-stack-guard-page.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/skip-stack-guard-page.wast\n(;; STDOUT ;;;\n11/11 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/stack.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/stack.wast\n(;; STDOUT ;;;\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/start.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/start.wast\n(;; STDOUT ;;;\nout/test/spec/start.wast:2: assert_invalid passed:\n  out/test/spec/start/start.0.wasm:0000015: error: function variable out of range: 1 (max 1)\n  0000015: error: OnStartFunction callback failed\nout/test/spec/start.wast:7: assert_invalid passed:\n  out/test/spec/start/start.1.wasm:0000016: error: start function must not return anything\n  0000016: error: OnStartFunction callback failed\nout/test/spec/start.wast:14: assert_invalid passed:\n  out/test/spec/start/start.2.wasm:0000016: error: start function must be nullary\n  0000016: error: OnStartFunction callback failed\ninc() =>\ninc() =>\ninc() =>\ninc() =>\ncalled host spectest.print_i32(i32:1) =>\ncalled host spectest.print_i32(i32:2) =>\ncalled host spectest.print() =>\nout/test/spec/start.wast:103: assert_malformed passed:\n  out/test/spec/start/start.9.wat:1:69: error: multiple start sections\n  (module (func $a (unreachable)) (func $b (unreachable)) (start $a) (start $b))\n                                                                      ^^^^^\n20/20 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/store.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/store.wast\n(;; STDOUT ;;;\nout/test/spec/store.wast:58: assert_malformed passed:\n  out/test/spec/store/store.1.wat:1:30: error: unexpected token \"i32.store32\", expected an instr.\n  (memory 1)(func (param i32) (i32.store32 (local.get 0) (i32.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/store.wast:65: assert_malformed passed:\n  out/test/spec/store/store.2.wat:1:30: error: unexpected token \"i32.store64\", expected an instr.\n  (memory 1)(func (param i32) (i32.store64 (local.get 0) (i64.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/store.wast:73: assert_malformed passed:\n  out/test/spec/store/store.3.wat:1:30: error: unexpected token \"i64.store64\", expected an instr.\n  (memory 1)(func (param i32) (i64.store64 (local.get 0) (i64.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/store.wast:81: assert_malformed passed:\n  out/test/spec/store/store.4.wat:1:30: error: unexpected token \"f32.store32\", expected an instr.\n  (memory 1)(func (param i32) (f32.store32 (local.get 0) (f32.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/store.wast:88: assert_malformed passed:\n  out/test/spec/store/store.5.wat:1:30: error: unexpected token \"f32.store64\", expected an instr.\n  (memory 1)(func (param i32) (f32.store64 (local.get 0) (f64.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/store.wast:96: assert_malformed passed:\n  out/test/spec/store/store.6.wat:1:30: error: unexpected token \"f64.store32\", expected an instr.\n  (memory 1)(func (param i32) (f64.store32 (local.get 0) (f32.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/store.wast:103: assert_malformed passed:\n  out/test/spec/store/store.7.wat:1:30: error: unexpected token \"f64.store64\", expected an instr.\n  (memory 1)(func (param i32) (f64.store64 (local.get 0) (f64.const 0)))\n                               ^^^^^^^^^^^\nout/test/spec/store.wast:112: assert_invalid passed:\n  out/test/spec/store/store.8.wasm:0000026: error: type mismatch in implicit return, expected [i32] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/store.wast:116: assert_invalid passed:\n  out/test/spec/store/store.9.wasm:0000026: error: type mismatch in implicit return, expected [i64] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/store.wast:120: assert_invalid passed:\n  out/test/spec/store/store.10.wasm:0000029: error: type mismatch in implicit return, expected [f32] but got []\n  0000029: error: EndFunctionBody callback failed\nout/test/spec/store.wast:124: assert_invalid passed:\n  out/test/spec/store/store.11.wasm:000002d: error: type mismatch in implicit return, expected [f64] but got []\n  000002d: error: EndFunctionBody callback failed\nout/test/spec/store.wast:128: assert_invalid passed:\n  out/test/spec/store/store.12.wasm:0000026: error: type mismatch in implicit return, expected [i32] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/store.wast:132: assert_invalid passed:\n  out/test/spec/store/store.13.wasm:0000026: error: type mismatch in implicit return, expected [i32] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/store.wast:136: assert_invalid passed:\n  out/test/spec/store/store.14.wasm:0000026: error: type mismatch in implicit return, expected [i64] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/store.wast:140: assert_invalid passed:\n  out/test/spec/store/store.15.wasm:0000026: error: type mismatch in implicit return, expected [i64] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/store.wast:144: assert_invalid passed:\n  out/test/spec/store/store.16.wasm:0000026: error: type mismatch in implicit return, expected [i64] but got []\n  0000026: error: EndFunctionBody callback failed\nout/test/spec/store.wast:150: assert_invalid passed:\n  out/test/spec/store/store.17.wasm:000001f: error: type mismatch in i32.store, expected [i32, i32] but got []\n  000001f: error: OnStoreExpr callback failed\nout/test/spec/store.wast:159: assert_invalid passed:\n  out/test/spec/store/store.18.wasm:0000021: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/store.wast:168: assert_invalid passed:\n  out/test/spec/store/store.19.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:178: assert_invalid passed:\n  out/test/spec/store/store.20.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:188: assert_invalid passed:\n  out/test/spec/store/store.21.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:198: assert_invalid passed:\n  out/test/spec/store/store.22.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:208: assert_invalid passed:\n  out/test/spec/store/store.23.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:218: assert_invalid passed:\n  out/test/spec/store/store.24.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:228: assert_invalid passed:\n  out/test/spec/store/store.25.wasm:0000028: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000028: error: OnStoreExpr callback failed\nout/test/spec/store.wast:238: assert_invalid passed:\n  out/test/spec/store/store.26.wasm:0000028: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000028: error: OnStoreExpr callback failed\nout/test/spec/store.wast:248: assert_invalid passed:\n  out/test/spec/store/store.27.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:258: assert_invalid passed:\n  out/test/spec/store/store.28.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:268: assert_invalid passed:\n  out/test/spec/store/store.29.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:278: assert_invalid passed:\n  out/test/spec/store/store.30.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:288: assert_invalid passed:\n  out/test/spec/store/store.31.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:298: assert_invalid passed:\n  out/test/spec/store/store.32.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:308: assert_invalid passed:\n  out/test/spec/store/store.33.wasm:000001f: error: type mismatch in i32.store, expected [i32, i32] but got []\n  000001f: error: OnStoreExpr callback failed\nout/test/spec/store.wast:317: assert_invalid passed:\n  out/test/spec/store/store.34.wasm:0000021: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/store.wast:326: assert_invalid passed:\n  out/test/spec/store/store.35.wasm:000001f: error: type mismatch in i32.store, expected [i32, i32] but got []\n  000001f: error: OnStoreExpr callback failed\nout/test/spec/store.wast:335: assert_invalid passed:\n  out/test/spec/store/store.36.wasm:0000021: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000021: error: OnStoreExpr callback failed\nout/test/spec/store.wast:344: assert_invalid passed:\n  out/test/spec/store/store.37.wasm:0000025: error: type mismatch in i32.store, expected [i32, i32] but got []\n  0000025: error: OnStoreExpr callback failed\nout/test/spec/store.wast:354: assert_invalid passed:\n  out/test/spec/store/store.38.wasm:0000027: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  0000027: error: OnStoreExpr callback failed\nout/test/spec/store.wast:364: assert_invalid passed:\n  out/test/spec/store/store.39.wasm:000003c: error: type mismatch in i32.store, expected [i32, i32] but got []\n  000003c: error: OnStoreExpr callback failed\nout/test/spec/store.wast:380: assert_invalid passed:\n  out/test/spec/store/store.40.wasm:000003e: error: type mismatch in i32.store, expected [i32, i32] but got [i32]\n  000003e: error: OnStoreExpr callback failed\nout/test/spec/store.wast:399: assert_invalid passed:\n  out/test/spec/store/store.41.wasm:0000026: error: type mismatch in i32.store, expected [i32, i32] but got [f32, i32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:400: assert_invalid passed:\n  out/test/spec/store/store.42.wasm:0000026: error: type mismatch in i32.store8, expected [i32, i32] but got [f32, i32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:401: assert_invalid passed:\n  out/test/spec/store/store.43.wasm:0000026: error: type mismatch in i32.store16, expected [i32, i32] but got [f32, i32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:402: assert_invalid passed:\n  out/test/spec/store/store.44.wasm:0000026: error: type mismatch in i64.store, expected [i32, i64] but got [f32, i32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:403: assert_invalid passed:\n  out/test/spec/store/store.45.wasm:0000026: error: type mismatch in i64.store8, expected [i32, i64] but got [f32, i64]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:404: assert_invalid passed:\n  out/test/spec/store/store.46.wasm:0000026: error: type mismatch in i64.store16, expected [i32, i64] but got [f32, i64]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:405: assert_invalid passed:\n  out/test/spec/store/store.47.wasm:0000026: error: type mismatch in i64.store32, expected [i32, i64] but got [f32, i64]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:406: assert_invalid passed:\n  out/test/spec/store/store.48.wasm:0000029: error: type mismatch in f32.store, expected [i32, f32] but got [f32, f32]\n  0000029: error: OnStoreExpr callback failed\nout/test/spec/store.wast:407: assert_invalid passed:\n  out/test/spec/store/store.49.wasm:000002d: error: type mismatch in f64.store, expected [i32, f64] but got [f32, f64]\n  000002d: error: OnStoreExpr callback failed\nout/test/spec/store.wast:409: assert_invalid passed:\n  out/test/spec/store/store.50.wasm:0000026: error: type mismatch in i32.store, expected [i32, i32] but got [i32, f32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:410: assert_invalid passed:\n  out/test/spec/store/store.51.wasm:0000026: error: type mismatch in i32.store8, expected [i32, i32] but got [i32, f32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:411: assert_invalid passed:\n  out/test/spec/store/store.52.wasm:0000026: error: type mismatch in i32.store16, expected [i32, i32] but got [i32, f32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:412: assert_invalid passed:\n  out/test/spec/store/store.53.wasm:0000026: error: type mismatch in i64.store, expected [i32, i64] but got [i32, f32]\n  0000026: error: OnStoreExpr callback failed\nout/test/spec/store.wast:413: assert_invalid passed:\n  out/test/spec/store/store.54.wasm:000002a: error: type mismatch in i64.store8, expected [i32, i64] but got [i32, f64]\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/store.wast:414: assert_invalid passed:\n  out/test/spec/store/store.55.wasm:000002a: error: type mismatch in i64.store16, expected [i32, i64] but got [i32, f64]\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/store.wast:415: assert_invalid passed:\n  out/test/spec/store/store.56.wasm:000002a: error: type mismatch in i64.store32, expected [i32, i64] but got [i32, f64]\n  000002a: error: OnStoreExpr callback failed\nout/test/spec/store.wast:416: assert_invalid passed:\n  out/test/spec/store/store.57.wasm:0000023: error: type mismatch in f32.store, expected [i32, f32] but got [i32, i32]\n  0000023: error: OnStoreExpr callback failed\nout/test/spec/store.wast:417: assert_invalid passed:\n  out/test/spec/store/store.58.wasm:0000023: error: type mismatch in f64.store, expected [i32, f64] but got [i32, i64]\n  0000023: error: OnStoreExpr callback failed\n68/68 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/switch.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/switch.wast\n(;; STDOUT ;;;\nout/test/spec/switch.wast:150: assert_invalid passed:\n  out/test/spec/switch/switch.1.wasm:000001c: error: invalid depth: 3 (max 0)\n  000001c: error: OnBrTableExpr callback failed\n28/28 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table-sub.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table-sub.wast\n(;; STDOUT ;;;\nout/test/spec/table-sub.wast:2: assert_invalid passed:\n  out/test/spec/table-sub/table-sub.0.wasm:000002a: error: type mismatch at table.copy. got externref, expected funcref\n  000002a: error: OnTableCopyExpr callback failed\nout/test/spec/table-sub.wast:13: assert_invalid passed:\n  out/test/spec/table-sub/table-sub.1.wasm:000002d: error: type mismatch at table.init. got externref, expected funcref\n  000002d: error: OnTableInitExpr callback failed\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table.wast\n(;; STDOUT ;;;\nout/test/spec/table.wast:14: assert_invalid passed:\n  out/test/spec/table/table.9.wasm:000000c: error: table variable out of range: 0 (max 0)\n  000000c: error: BeginElemSegment callback failed\nout/test/spec/table.wast:15: assert_invalid passed:\n  out/test/spec/table/table.10.wasm:0000016: error: table variable out of range: 0 (max 0)\n  0000016: error: BeginElemSegment callback failed\nout/test/spec/table.wast:19: assert_invalid passed:\n  out/test/spec/table/table.11.wasm:000000f: error: max elems (0) must be >= initial elems (1)\n  000000f: error: BeginTable callback failed\nout/test/spec/table.wast:23: assert_invalid passed:\n  out/test/spec/table/table.12.wasm:0000013: error: max elems (0) must be >= initial elems (4294967295)\n  0000013: error: BeginTable callback failed\nout/test/spec/table.wast:28: assert_malformed passed:\n  out/test/spec/table/table.13.wat:1:8: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 funcref)\n         ^^^^^^^^^^^^^\nout/test/spec/table.wast:32: assert_malformed passed:\n  out/test/spec/table/table.14.wat:1:8: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 0x1_0000_0000 funcref)\n         ^^^^^^^^^^^^^\n  out/test/spec/table/table.14.wat:1:22: error: invalid int \"0x1_0000_0000\"\n  (table 0x1_0000_0000 0x1_0000_0000 funcref)\n                       ^^^^^^^^^^^^^\nout/test/spec/table.wast:36: assert_malformed passed:\n  out/test/spec/table/table.15.wat:1:10: error: invalid int \"0x1_0000_0000\"\n  (table 0 0x1_0000_0000 funcref)\n           ^^^^^^^^^^^^^\nout/test/spec/table.wast:43: assert_malformed passed:\n  out/test/spec/table/table.16.wat:1:24: error: redefinition of table \"$foo\"\n  (table $foo 1 funcref)(table $foo 1 funcref)\n                         ^^^^^\nout/test/spec/table.wast:47: assert_malformed passed:\n  out/test/spec/table/table.17.wat:1:39: error: redefinition of table \"$foo\"\n  (import \"\" \"\" (table $foo 1 funcref))(table $foo 1 funcref)\n                                        ^^^^^\nout/test/spec/table.wast:51: assert_malformed passed:\n  out/test/spec/table/table.18.wat:1:39: error: redefinition of table \"$foo\"\n  (import \"\" \"\" (table $foo 1 funcref))(import \"\" \"\" (table $foo 1 funcref))\n                                        ^^^^^^\n19/19 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table_copy.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table_copy.wast\n(;; STDOUT ;;;\ntest() =>\nout/test/spec/table_copy.wast:46: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:47: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:52: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:53: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:54: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:55: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:56: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:57: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:63: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:64: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:65: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:66: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:67: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:68: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:69: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:70: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:71: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:72: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:73: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:74: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:75: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:76: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:77: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:78: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:83: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:84: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:85: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:86: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:92: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:93: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:94: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:95: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:96: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:97: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:98: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:99: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:100: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:101: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:102: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:103: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:104: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:105: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:138: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:139: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:144: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:145: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:146: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:147: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:148: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:149: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:155: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:156: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:157: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:158: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:159: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:160: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:161: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:162: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:163: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:164: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:165: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:166: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:167: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:168: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:169: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:170: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:175: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:176: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:177: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:178: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:184: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:185: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:186: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:187: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:188: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:189: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:190: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:191: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:192: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:193: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:194: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:195: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:196: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:197: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:230: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:231: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:236: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:237: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:238: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:239: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:240: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:241: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:247: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:248: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:249: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:250: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:251: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:252: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:253: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:254: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:257: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:258: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:259: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:260: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:261: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:262: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:267: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:268: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:269: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:270: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:276: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:277: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:278: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:279: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:280: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:281: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:282: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:283: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:284: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:285: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:286: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:287: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:288: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:289: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:322: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:323: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:328: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:329: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:330: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:331: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:332: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:333: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:335: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:336: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:337: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:339: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:340: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:341: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:342: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:343: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:344: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:345: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:346: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:347: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:348: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:349: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:350: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:351: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:352: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:353: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:354: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:359: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:360: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:361: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:362: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:368: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:369: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:370: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:371: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:372: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:373: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:374: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:375: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:376: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:377: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:378: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:379: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:380: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:381: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:414: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:415: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:420: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:421: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:422: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:423: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:424: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:425: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:431: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:432: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:433: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:434: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:435: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:436: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:437: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:438: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:439: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:440: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:441: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:442: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:443: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:444: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:445: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:446: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:451: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:452: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:453: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:454: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:460: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:461: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:462: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:463: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:464: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:465: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:466: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:467: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:468: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:469: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:470: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:471: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:472: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:473: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:506: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:507: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:512: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:513: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:514: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:515: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:516: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:517: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:523: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:524: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:525: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:526: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:527: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:528: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:529: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:530: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:531: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:534: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:535: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:536: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:537: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:538: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:543: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:544: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:545: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:546: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:552: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:553: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:554: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:555: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:556: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:557: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:558: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:559: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:560: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:561: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:562: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:563: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:564: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:565: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:598: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:599: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:604: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:605: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:606: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:607: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:613: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:614: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:615: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:616: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:617: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:618: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:619: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:620: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:621: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:622: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:623: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:624: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:625: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:626: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:627: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:628: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:629: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:630: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:635: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:636: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:637: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:638: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:644: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:645: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:646: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:647: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:648: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:649: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:650: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:651: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:652: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:653: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:654: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:655: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:656: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:657: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:690: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:691: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:696: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:697: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:698: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:699: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:700: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:701: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:702: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:703: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:709: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:710: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:711: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:712: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:713: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:714: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:715: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:716: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:717: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:718: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:719: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:720: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:721: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:722: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:727: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:728: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:729: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:730: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:736: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:737: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:738: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:739: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:740: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:741: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:742: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:743: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:744: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:745: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:746: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:747: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:748: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:749: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:782: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:783: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:788: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:789: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:790: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:791: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:792: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:793: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:799: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:800: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:801: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:802: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:803: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:804: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:805: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:806: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:807: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:808: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:809: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:810: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:811: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:812: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:813: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:814: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:819: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:820: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:821: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:822: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:823: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:828: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:829: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:830: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:831: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:832: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:833: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:839: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:840: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:841: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:874: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:875: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:880: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:881: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:882: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:883: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:884: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:885: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:891: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:892: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:893: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:894: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:895: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:896: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:897: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:898: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:899: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:900: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:901: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:902: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:903: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:904: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:905: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:906: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:911: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:912: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:913: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:914: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:920: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:921: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:922: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:923: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:924: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:925: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:926: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:927: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:928: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:929: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:930: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:931: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:932: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:933: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:966: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:967: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:972: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:973: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:974: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:975: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:976: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:977: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:983: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:984: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:985: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:986: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:987: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:988: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:989: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:990: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:991: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:992: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:993: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:994: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:995: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:996: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:997: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:998: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1003: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1004: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1005: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1006: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1012: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1013: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1014: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1015: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1016: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1017: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1018: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1019: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1020: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1021: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1022: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1023: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1024: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1025: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:1058: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1059: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1064: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1065: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1066: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1067: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1068: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1069: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1075: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1076: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1077: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1078: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1079: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1080: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1081: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1082: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1085: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1086: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1087: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1088: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1089: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1090: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1095: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1096: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1097: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1098: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1104: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1105: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1106: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1107: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1108: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1109: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1110: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1111: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1112: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1113: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1114: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1115: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1116: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1117: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:1150: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1151: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1156: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1157: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1158: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1159: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1160: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1161: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1163: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1164: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1165: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1167: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1168: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1169: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1170: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1171: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1172: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1173: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1174: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1175: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1176: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1177: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1178: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1179: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1180: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1181: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1182: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1187: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1188: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1189: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1190: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1196: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1197: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1198: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1199: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1200: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1201: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1202: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1203: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1204: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1205: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1206: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1207: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1208: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1209: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:1242: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1243: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1248: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1249: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1250: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1251: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1252: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1253: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1259: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1260: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1261: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1262: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1263: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1264: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1265: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1266: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1267: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1268: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1269: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1270: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1271: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1272: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1273: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1274: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1279: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1280: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1281: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1282: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1288: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1289: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1290: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1291: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1292: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1293: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1294: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1295: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1296: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1297: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1298: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1299: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1300: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1301: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:1334: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1335: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1340: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1341: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1342: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1343: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1344: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1345: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1351: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1352: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1353: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1354: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1355: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1356: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1357: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1358: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1359: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1362: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1363: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1364: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1365: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1366: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1371: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1372: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1373: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1374: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1380: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1381: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1382: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1383: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1384: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1385: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1386: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1387: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1388: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1389: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1390: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1391: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1392: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1393: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:1426: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1427: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1432: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1433: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1434: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1435: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1441: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1442: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1443: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1444: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1445: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1446: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1447: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1448: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1449: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1450: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1451: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1452: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1453: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1454: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1455: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1456: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1457: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1458: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1463: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1464: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1465: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1466: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1472: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1473: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1474: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1475: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1476: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1477: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1478: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1479: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1480: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1481: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1482: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1483: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1484: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1485: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:1518: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1519: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1524: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1525: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1526: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1527: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1528: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1529: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1530: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1531: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1537: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1538: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1539: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1540: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1541: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1542: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1543: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1544: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1545: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1546: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1547: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1548: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1549: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1550: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1555: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1556: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1557: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1558: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1564: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1565: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1566: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1567: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1568: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1569: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1570: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1571: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1572: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1573: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1574: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1575: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1576: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1577: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_copy.wast:1610: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1611: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1616: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1617: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1618: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1619: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1620: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1621: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1627: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1628: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1629: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1630: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1631: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1632: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1633: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1634: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1635: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1636: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1637: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1638: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1639: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1640: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1641: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1642: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1647: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1648: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1649: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1650: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1651: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1656: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1657: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1658: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1659: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1660: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1661: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1667: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1668: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1669: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:1694: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:1719: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:1744: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:1769: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\ntest() =>\nout/test/spec/table_copy.wast:1844: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/table_copy.wast:1894: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/table_copy.wast:1944: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:1969: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:1994: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2019: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2044: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\ntest() =>\nout/test/spec/table_copy.wast:2119: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/table_copy.wast:2169: assert_trap passed: out of bounds table access: table.copy out of bounds\ntest() =>\nout/test/spec/table_copy.wast:2219: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2247: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2257: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2258: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2259: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2260: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2261: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2262: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2263: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2264: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2265: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2266: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2267: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2268: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2269: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2270: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2271: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2272: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2273: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2274: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2275: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2276: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2277: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2278: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2279: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2280: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2308: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2319: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2320: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2321: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2322: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2323: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2324: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2325: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2326: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2327: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2328: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2329: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2330: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2331: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2332: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2333: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2334: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2335: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2336: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2337: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2338: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2339: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2340: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2341: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2369: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2371: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2372: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2373: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2374: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2375: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2376: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2377: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2378: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2379: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2380: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2381: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2382: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2383: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2384: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2385: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2386: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2387: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2388: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2389: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2390: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2391: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2392: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2393: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2394: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2430: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2432: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2433: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2434: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2435: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2436: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2437: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2438: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2439: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2440: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2441: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2442: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2443: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2444: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2445: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2446: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2447: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2448: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2449: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2450: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2451: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2452: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2453: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2454: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2491: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2493: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2494: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2495: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2496: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2497: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2498: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2499: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2500: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2501: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2502: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2503: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2512: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2513: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2514: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2515: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2516: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2517: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2518: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2519: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2520: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2521: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2522: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2523: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2524: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2552: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2554: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2555: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2556: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2557: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2558: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2559: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2560: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2561: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2562: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2563: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2564: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2565: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2566: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2567: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2568: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2569: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2570: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2571: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2572: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2573: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2574: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2575: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2576: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2577: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2613: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2615: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2616: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2617: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2618: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2619: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2620: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2621: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2622: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2623: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2624: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2625: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2626: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2627: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2628: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2629: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2630: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2631: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2632: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2633: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2634: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2635: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2644: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2645: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2646: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2674: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2676: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2677: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2678: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2679: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2680: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2681: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2682: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2683: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2684: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2685: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2686: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2687: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2688: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2689: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2690: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2691: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2692: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2693: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2694: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2695: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2696: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2697: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2698: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2699: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2735: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2737: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2738: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2739: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2740: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2741: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2742: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2743: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2744: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2745: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2746: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2747: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2748: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2749: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2750: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2751: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2752: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2753: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2754: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2755: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2756: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2757: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2796: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2798: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2799: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2800: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2801: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2802: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2803: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2804: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2805: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2806: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2807: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2808: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2809: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2810: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2811: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2812: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2813: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2814: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2815: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2816: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2817: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2818: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2819: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2820: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2821: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2822: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2823: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2824: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2825: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2826: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2827: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2828: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2829: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2830: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2831: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2832: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2833: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2834: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2835: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2836: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2837: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2838: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2839: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2840: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2841: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2842: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2843: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2844: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2845: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2846: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2847: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2848: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2849: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2850: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2851: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2852: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2853: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2854: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2855: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2856: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2857: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2858: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2859: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2860: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2861: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2862: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2863: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2864: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2865: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2866: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2867: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2868: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2869: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2870: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2871: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2872: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2873: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2874: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2875: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2876: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2877: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2878: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2879: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2880: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2881: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2882: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2883: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2884: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2885: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2886: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2887: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2888: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2889: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2890: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2891: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2892: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2893: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2894: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2895: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2896: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2897: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2898: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2899: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2900: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2901: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2902: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2903: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2904: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2905: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2906: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2907: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2908: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2909: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2953: assert_trap passed: out of bounds table access: table.copy out of bounds\nout/test/spec/table_copy.wast:2971: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2972: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2973: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2974: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2975: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2976: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2977: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2978: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2979: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2980: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2981: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2982: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2983: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2984: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2985: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2986: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2987: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2988: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2989: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2990: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2991: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2992: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2993: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2994: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2995: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2996: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2997: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2998: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:2999: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3000: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3001: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3002: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3003: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3004: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3005: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3006: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3007: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3008: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3009: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3010: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3011: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3012: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3013: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3014: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3015: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3016: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3017: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3018: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3019: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3020: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3021: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3022: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3023: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3024: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3025: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3026: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3027: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3028: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3029: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3030: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3031: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3032: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3033: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3034: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3035: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3036: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3037: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3038: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3039: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3040: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3041: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3042: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3043: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3044: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3045: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3046: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3047: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3048: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3049: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3050: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3051: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3052: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3053: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3054: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3055: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3056: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3057: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3058: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3059: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3060: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3061: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3062: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3063: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3064: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3065: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3066: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3067: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3068: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3069: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3070: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3071: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3072: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3073: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3074: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3075: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3076: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3077: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3078: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3079: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3080: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3081: assert_trap passed: uninitialized table element\nout/test/spec/table_copy.wast:3082: assert_trap passed: uninitialized table element\n1727/1727 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table_fill.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table_fill.wast\n(;; STDOUT ;;;\nout/test/spec/table_fill.wast:54: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/table_fill.wast:62: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/table_fill.wast:67: assert_trap passed: out of bounds table access: table.fill out of bounds\nout/test/spec/table_fill.wast:75: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.1.wasm:0000020: error: type mismatch in table.fill, expected [i32, externref, i32] but got []\n  0000020: error: OnTableFillExpr callback failed\nout/test/spec/table_fill.wast:84: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.2.wasm:0000024: error: type mismatch in table.fill, expected [i32, externref, i32] but got [externref, i32]\n  0000024: error: OnTableFillExpr callback failed\nout/test/spec/table_fill.wast:93: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.3.wasm:0000024: error: type mismatch in table.fill, expected [i32, externref, i32] but got [i32, i32]\n  0000024: error: OnTableFillExpr callback failed\nout/test/spec/table_fill.wast:102: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.4.wasm:0000024: error: type mismatch in table.fill, expected [i32, externref, i32] but got [i32, externref]\n  0000024: error: OnTableFillExpr callback failed\nout/test/spec/table_fill.wast:111: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.5.wasm:0000029: error: type mismatch in table.fill, expected [i32, externref, i32] but got [f32, externref, i32]\n  0000029: error: OnTableFillExpr callback failed\nout/test/spec/table_fill.wast:120: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.6.wasm:0000027: error: type mismatch in table.fill, expected [i32, funcref, i32] but got [i32, externref, i32]\n  0000027: error: OnTableFillExpr callback failed\nout/test/spec/table_fill.wast:129: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.7.wasm:0000029: error: type mismatch in table.fill, expected [i32, externref, i32] but got [i32, externref, f32]\n  0000029: error: OnTableFillExpr callback failed\nout/test/spec/table_fill.wast:139: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.8.wasm:000002a: error: type mismatch in table.fill, expected [i32, funcref, i32] but got [i32, externref, i32]\n  000002a: error: OnTableFillExpr callback failed\nout/test/spec/table_fill.wast:150: assert_invalid passed:\n  out/test/spec/table_fill/table_fill.9.wasm:0000028: error: type mismatch in implicit return, expected [i32] but got []\n  0000028: error: EndFunctionBody callback failed\n45/45 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table_get.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table_get.wast\n(;; STDOUT ;;;\ninit(externref:2) =>\nout/test/spec/table_get.wast:33: assert_trap passed: out of bounds table access: table.get at 2 >= max value 2\nout/test/spec/table_get.wast:34: assert_trap passed: out of bounds table access: table.get at 3 >= max value 3\nout/test/spec/table_get.wast:35: assert_trap passed: out of bounds table access: table.get at 4294967295 >= max value 2\nout/test/spec/table_get.wast:36: assert_trap passed: out of bounds table access: table.get at 4294967295 >= max value 3\nout/test/spec/table_get.wast:42: assert_invalid passed:\n  out/test/spec/table_get/table_get.1.wasm:0000020: error: type mismatch in table.get, expected [i32] but got []\n  0000020: error: OnTableGetExpr callback failed\nout/test/spec/table_get.wast:51: assert_invalid passed:\n  out/test/spec/table_get/table_get.2.wasm:0000025: error: type mismatch in table.get, expected [i32] but got [f32]\n  0000025: error: OnTableGetExpr callback failed\nout/test/spec/table_get.wast:61: assert_invalid passed:\n  out/test/spec/table_get/table_get.3.wasm:0000022: error: type mismatch at end of function, expected [] but got [externref]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/table_get.wast:70: assert_invalid passed:\n  out/test/spec/table_get/table_get.4.wasm:0000023: error: type mismatch in implicit return, expected [funcref] but got [externref]\n  0000023: error: EndFunctionBody callback failed\nout/test/spec/table_get.wast:80: assert_invalid passed:\n  out/test/spec/table_get/table_get.5.wasm:0000026: error: type mismatch in implicit return, expected [funcref] but got [externref]\n  0000026: error: EndFunctionBody callback failed\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table_grow.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table_grow.wast\n(;; STDOUT ;;;\nout/test/spec/table_grow.wast:17: assert_trap passed: out of bounds table access: table.set at 0 >= max value 0\nout/test/spec/table_grow.wast:18: assert_trap passed: out of bounds table access: table.get at 0 >= max value 0\nout/test/spec/table_grow.wast:25: assert_trap passed: out of bounds table access: table.set at 1 >= max value 1\nout/test/spec/table_grow.wast:26: assert_trap passed: out of bounds table access: table.get at 1 >= max value 1\nout/test/spec/table_grow.wast:37: assert_trap passed: out of bounds table access: table.set at 5 >= max value 5\nout/test/spec/table_grow.wast:38: assert_trap passed: out of bounds table access: table.get at 5 >= max value 5\nout/test/spec/table_grow.wast:135: assert_invalid passed:\n  out/test/spec/table_grow/table_grow.8.wasm:0000021: error: type mismatch in table.grow, expected [externref, i32] but got []\n  0000021: error: OnTableGrowExpr callback failed\nout/test/spec/table_grow.wast:144: assert_invalid passed:\n  out/test/spec/table_grow/table_grow.9.wasm:0000023: error: type mismatch in table.grow, expected [externref, i32] but got [externref]\n  0000023: error: OnTableGrowExpr callback failed\nout/test/spec/table_grow.wast:153: assert_invalid passed:\n  out/test/spec/table_grow/table_grow.10.wasm:0000023: error: type mismatch in table.grow, expected [externref, i32] but got [i32]\n  0000023: error: OnTableGrowExpr callback failed\nout/test/spec/table_grow.wast:162: assert_invalid passed:\n  out/test/spec/table_grow/table_grow.11.wasm:0000028: error: type mismatch in table.grow, expected [externref, i32] but got [externref, f32]\n  0000028: error: OnTableGrowExpr callback failed\nout/test/spec/table_grow.wast:171: assert_invalid passed:\n  out/test/spec/table_grow/table_grow.12.wasm:0000026: error: type mismatch in table.grow, expected [funcref, i32] but got [externref, i32]\n  0000026: error: OnTableGrowExpr callback failed\nout/test/spec/table_grow.wast:181: assert_invalid passed:\n  out/test/spec/table_grow/table_grow.13.wasm:0000025: error: type mismatch at end of function, expected [] but got [i32]\n  0000025: error: EndFunctionBody callback failed\nout/test/spec/table_grow.wast:190: assert_invalid passed:\n  out/test/spec/table_grow/table_grow.14.wasm:0000026: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000026: error: EndFunctionBody callback failed\n56/56 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table_init.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table_init.wast\n(;; STDOUT ;;;\ntest() =>\nout/test/spec/table_init.wast:42: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:43: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:48: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:53: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:59: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:60: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:61: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:62: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:63: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:64: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:65: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:66: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:67: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:68: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:69: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:70: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:71: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_init.wast:100: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:101: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:106: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:107: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:108: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:109: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:110: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:111: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:118: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:119: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:120: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:121: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:122: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:123: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:124: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:125: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:126: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:127: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:128: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:129: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_init.wast:166: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:167: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:172: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:177: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:179: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:184: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:186: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:188: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:191: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:192: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:193: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:194: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:195: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_init.wast:224: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:225: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:230: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:235: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:241: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:242: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:243: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:244: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:245: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:246: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:247: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:248: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:249: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:250: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:251: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:252: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:253: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_init.wast:282: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:283: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:288: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:289: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:290: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:291: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:292: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:293: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:300: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:301: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:302: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:303: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:304: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:305: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:306: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:307: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:308: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:309: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:310: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:311: assert_trap passed: uninitialized table element\ntest() =>\nout/test/spec/table_init.wast:348: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:349: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:354: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:359: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:361: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:366: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:368: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:370: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:373: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:374: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:375: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:376: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:377: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:379: assert_invalid passed:\n  out/test/spec/table_init/table_init.7.wasm:0000024: error: elem_segment variable out of range: 0 (max 0)\n  0000024: error: OnElemDropExpr callback failed\nout/test/spec/table_init.wast:385: assert_invalid passed:\n  out/test/spec/table_init/table_init.8.wasm:000002b: error: table variable out of range: 0 (max 0)\n  out/test/spec/table_init/table_init.8.wasm:000002b: error: elem_segment variable out of range: 0 (max 0)\n  000002b: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:391: assert_invalid passed:\n  out/test/spec/table_init/table_init.9.wasm:0000035: error: elem_segment variable out of range: 4 (max 1)\n  0000035: error: OnElemDropExpr callback failed\nout/test/spec/table_init.wast:399: assert_invalid passed:\n  out/test/spec/table_init/table_init.10.wasm:000003c: error: table variable out of range: 0 (max 0)\n  out/test/spec/table_init/table_init.10.wasm:000003c: error: elem_segment variable out of range: 4 (max 1)\n  000003c: error: OnTableInitExpr callback failed\ntest() =>\nout/test/spec/table_init.wast:453: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\ntest() =>\nout/test/spec/table_init.wast:525: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:549: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:573: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:597: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/table_init.wast:645: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/table_init.wast:693: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/table_init.wast:741: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:765: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/table_init.wast:813: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/table_init.wast:861: assert_trap passed: out of bounds table access: table.init out of bounds\ntest() =>\nout/test/spec/table_init.wast:909: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:912: assert_invalid passed:\n  out/test/spec/table_init/table_init.32.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i32, f32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:921: assert_invalid passed:\n  out/test/spec/table_init/table_init.33.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i32, i64]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:930: assert_invalid passed:\n  out/test/spec/table_init/table_init.34.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i32, f64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:939: assert_invalid passed:\n  out/test/spec/table_init/table_init.35.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f32, i32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:948: assert_invalid passed:\n  out/test/spec/table_init/table_init.36.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f32, f32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:957: assert_invalid passed:\n  out/test/spec/table_init/table_init.37.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f32, i64]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:966: assert_invalid passed:\n  out/test/spec/table_init/table_init.38.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f32, f64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:975: assert_invalid passed:\n  out/test/spec/table_init/table_init.39.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i64, i32]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:984: assert_invalid passed:\n  out/test/spec/table_init/table_init.40.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i64, f32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:993: assert_invalid passed:\n  out/test/spec/table_init/table_init.41.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i64, i64]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1002: assert_invalid passed:\n  out/test/spec/table_init/table_init.42.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, i64, f64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1011: assert_invalid passed:\n  out/test/spec/table_init/table_init.43.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f64, i32]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1020: assert_invalid passed:\n  out/test/spec/table_init/table_init.44.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f64, f32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1029: assert_invalid passed:\n  out/test/spec/table_init/table_init.45.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f64, i64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1038: assert_invalid passed:\n  out/test/spec/table_init/table_init.46.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [i32, f64, f64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1047: assert_invalid passed:\n  out/test/spec/table_init/table_init.47.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i32, i32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1056: assert_invalid passed:\n  out/test/spec/table_init/table_init.48.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i32, f32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1065: assert_invalid passed:\n  out/test/spec/table_init/table_init.49.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i32, i64]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1074: assert_invalid passed:\n  out/test/spec/table_init/table_init.50.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i32, f64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1083: assert_invalid passed:\n  out/test/spec/table_init/table_init.51.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f32, i32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1092: assert_invalid passed:\n  out/test/spec/table_init/table_init.52.wasm:0000047: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f32, f32]\n  0000047: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1101: assert_invalid passed:\n  out/test/spec/table_init/table_init.53.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f32, i64]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1110: assert_invalid passed:\n  out/test/spec/table_init/table_init.54.wasm:000004b: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f32, f64]\n  000004b: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1119: assert_invalid passed:\n  out/test/spec/table_init/table_init.55.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i64, i32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1128: assert_invalid passed:\n  out/test/spec/table_init/table_init.56.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i64, f32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1137: assert_invalid passed:\n  out/test/spec/table_init/table_init.57.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i64, i64]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1146: assert_invalid passed:\n  out/test/spec/table_init/table_init.58.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, i64, f64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1155: assert_invalid passed:\n  out/test/spec/table_init/table_init.59.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f64, i32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1164: assert_invalid passed:\n  out/test/spec/table_init/table_init.60.wasm:000004b: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f64, f32]\n  000004b: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1173: assert_invalid passed:\n  out/test/spec/table_init/table_init.61.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f64, i64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1182: assert_invalid passed:\n  out/test/spec/table_init/table_init.62.wasm:000004f: error: type mismatch in table.init, expected [i32, i32, i32] but got [f32, f64, f64]\n  000004f: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1191: assert_invalid passed:\n  out/test/spec/table_init/table_init.63.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i32, i32]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1200: assert_invalid passed:\n  out/test/spec/table_init/table_init.64.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i32, f32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1209: assert_invalid passed:\n  out/test/spec/table_init/table_init.65.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i32, i64]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1218: assert_invalid passed:\n  out/test/spec/table_init/table_init.66.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i32, f64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1227: assert_invalid passed:\n  out/test/spec/table_init/table_init.67.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f32, i32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1236: assert_invalid passed:\n  out/test/spec/table_init/table_init.68.wasm:0000044: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f32, f32]\n  0000044: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1245: assert_invalid passed:\n  out/test/spec/table_init/table_init.69.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f32, i64]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1254: assert_invalid passed:\n  out/test/spec/table_init/table_init.70.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f32, f64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1263: assert_invalid passed:\n  out/test/spec/table_init/table_init.71.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i64, i32]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1272: assert_invalid passed:\n  out/test/spec/table_init/table_init.72.wasm:0000041: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i64, f32]\n  0000041: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1281: assert_invalid passed:\n  out/test/spec/table_init/table_init.73.wasm:000003e: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i64, i64]\n  000003e: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1290: assert_invalid passed:\n  out/test/spec/table_init/table_init.74.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, i64, f64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1299: assert_invalid passed:\n  out/test/spec/table_init/table_init.75.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f64, i32]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1308: assert_invalid passed:\n  out/test/spec/table_init/table_init.76.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f64, f32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1317: assert_invalid passed:\n  out/test/spec/table_init/table_init.77.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f64, i64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1326: assert_invalid passed:\n  out/test/spec/table_init/table_init.78.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [i64, f64, f64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1335: assert_invalid passed:\n  out/test/spec/table_init/table_init.79.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i32, i32]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1344: assert_invalid passed:\n  out/test/spec/table_init/table_init.80.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i32, f32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1353: assert_invalid passed:\n  out/test/spec/table_init/table_init.81.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i32, i64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1362: assert_invalid passed:\n  out/test/spec/table_init/table_init.82.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i32, f64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1371: assert_invalid passed:\n  out/test/spec/table_init/table_init.83.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f32, i32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1380: assert_invalid passed:\n  out/test/spec/table_init/table_init.84.wasm:000004b: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f32, f32]\n  000004b: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1389: assert_invalid passed:\n  out/test/spec/table_init/table_init.85.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f32, i64]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1398: assert_invalid passed:\n  out/test/spec/table_init/table_init.86.wasm:000004f: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f32, f64]\n  000004f: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1407: assert_invalid passed:\n  out/test/spec/table_init/table_init.87.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i64, i32]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1416: assert_invalid passed:\n  out/test/spec/table_init/table_init.88.wasm:0000048: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i64, f32]\n  0000048: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1425: assert_invalid passed:\n  out/test/spec/table_init/table_init.89.wasm:0000045: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i64, i64]\n  0000045: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1434: assert_invalid passed:\n  out/test/spec/table_init/table_init.90.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, i64, f64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1443: assert_invalid passed:\n  out/test/spec/table_init/table_init.91.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f64, i32]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1452: assert_invalid passed:\n  out/test/spec/table_init/table_init.92.wasm:000004f: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f64, f32]\n  000004f: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1461: assert_invalid passed:\n  out/test/spec/table_init/table_init.93.wasm:000004c: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f64, i64]\n  000004c: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1470: assert_invalid passed:\n  out/test/spec/table_init/table_init.94.wasm:0000053: error: type mismatch in table.init, expected [i32, i32, i32] but got [f64, f64, f64]\n  0000053: error: OnTableInitExpr callback failed\nout/test/spec/table_init.wast:1506: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:1507: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1508: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1509: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1510: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1511: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1512: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1513: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1514: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1515: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1516: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1517: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1518: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1519: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1520: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1521: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1522: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1523: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1524: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1525: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1526: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1527: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1528: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1529: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1530: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1531: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1532: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1533: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1534: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1535: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1536: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1537: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1538: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1568: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:1569: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1570: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1571: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1572: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1573: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1574: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1575: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1576: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1577: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1578: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1579: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1580: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1581: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1582: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1583: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1584: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1585: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1586: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1587: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1588: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1589: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1590: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1591: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1592: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1593: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1594: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1595: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1596: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1597: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1598: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1599: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1600: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1630: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:1631: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1632: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1633: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1634: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1635: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1636: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1637: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1638: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1639: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1640: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1641: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1642: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1643: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1644: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1645: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1646: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1647: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1648: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1649: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1650: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1651: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1652: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1653: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1654: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1655: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1656: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1657: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1658: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1659: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1660: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1661: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1662: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1663: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1664: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1665: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1666: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1667: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1668: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1669: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1670: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1671: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1672: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1673: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1674: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1675: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1676: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1677: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1678: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1679: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1680: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1681: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1682: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1683: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1684: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1685: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1686: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1687: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1688: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1689: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1690: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1691: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1692: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1693: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1694: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1695: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1696: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1697: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1698: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1699: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1700: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1701: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1702: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1703: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1704: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1705: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1706: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1707: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1708: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1709: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1710: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1711: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1712: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1713: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1714: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1715: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1716: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1717: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1718: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1719: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1720: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1721: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1722: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1723: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1724: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1725: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1726: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1727: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1728: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1729: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1730: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1731: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1732: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1733: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1734: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1735: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1736: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1737: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1738: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1739: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1740: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1741: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1742: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1743: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1744: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1745: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1746: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1747: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1748: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1749: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1750: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1751: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1752: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1753: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1754: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1755: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1756: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1757: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1758: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1759: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1760: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1761: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1762: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1763: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1764: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1765: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1766: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1767: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1768: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1769: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1770: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1771: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1772: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1773: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1774: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1775: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1776: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1777: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1778: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1779: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1780: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1781: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1782: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1783: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1784: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1785: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1786: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1787: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1788: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1789: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1790: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1820: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:1821: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1822: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1823: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1824: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1825: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1826: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1827: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1828: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1829: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1830: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1831: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1832: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1833: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1834: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1835: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1836: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1837: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1838: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1839: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1840: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1841: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1842: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1843: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1844: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1845: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1846: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1847: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1848: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1849: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1850: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1851: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1852: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1853: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1854: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1855: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1856: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1857: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1858: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1859: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1860: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1861: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1862: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1863: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1864: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1865: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1866: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1867: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1868: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1869: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1870: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1871: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1872: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1873: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1874: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1875: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1876: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1877: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1878: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1879: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1880: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1881: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1882: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1883: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1884: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1885: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1886: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1887: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1888: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1889: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1890: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1891: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1892: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1893: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1894: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1895: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1896: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1897: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1898: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1899: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1900: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1901: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1902: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1903: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1904: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1905: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1906: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1907: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1908: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1909: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1910: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1911: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1912: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1913: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1914: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1915: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1916: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1917: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1918: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1919: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1920: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1921: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1922: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1923: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1924: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1925: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1926: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1927: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1928: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1929: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1930: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1931: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1932: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1933: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1934: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1935: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1936: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1937: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1938: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1939: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1940: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1941: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1942: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1943: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1944: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1945: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1946: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1947: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1948: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1949: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1950: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1951: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1952: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1953: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1954: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1955: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1956: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1957: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1958: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1959: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1960: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1961: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1962: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1963: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1964: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1965: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1966: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1967: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1968: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1969: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1970: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1971: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1972: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1973: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1974: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1975: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1976: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1977: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1978: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1979: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:1980: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2010: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:2011: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2012: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2013: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2014: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2015: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2016: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2017: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2018: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2019: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2020: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2021: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2022: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2023: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2024: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2025: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2026: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2027: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2028: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2029: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2030: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2031: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2032: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2033: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2034: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2035: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2036: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2037: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2038: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2039: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2040: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2041: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2042: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2043: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2044: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2045: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2046: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2047: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2048: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2049: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2050: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2051: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2052: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2053: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2054: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2055: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2056: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2057: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2058: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2059: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2060: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2061: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2062: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2063: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2064: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2065: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2066: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2067: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2068: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2069: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2070: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2071: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2072: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2073: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2074: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2104: assert_trap passed: out of bounds table access: table.init out of bounds\nout/test/spec/table_init.wast:2105: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2106: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2107: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2108: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2109: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2110: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2111: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2112: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2113: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2114: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2115: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2116: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2117: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2118: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2119: assert_trap passed: uninitialized table element\nout/test/spec/table_init.wast:2120: assert_trap passed: uninitialized table element\n779/779 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table_set.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table_set.wast\n(;; STDOUT ;;;\nout/test/spec/table_set.wast:41: assert_trap passed: out of bounds table access: table.set at 2 >= max value 1\nout/test/spec/table_set.wast:42: assert_trap passed: out of bounds table access: table.set at 3 >= max value 2\nout/test/spec/table_set.wast:43: assert_trap passed: out of bounds table access: table.set at 4294967295 >= max value 1\nout/test/spec/table_set.wast:44: assert_trap passed: out of bounds table access: table.set at 4294967295 >= max value 2\nout/test/spec/table_set.wast:46: assert_trap passed: out of bounds table access: table.set at 2 >= max value 1\nout/test/spec/table_set.wast:47: assert_trap passed: out of bounds table access: table.set at 3 >= max value 2\nout/test/spec/table_set.wast:48: assert_trap passed: out of bounds table access: table.set at 4294967295 >= max value 1\nout/test/spec/table_set.wast:49: assert_trap passed: out of bounds table access: table.set at 4294967295 >= max value 2\nout/test/spec/table_set.wast:55: assert_invalid passed:\n  out/test/spec/table_set/table_set.1.wasm:000001f: error: type mismatch in table.set, expected [i32, externref] but got []\n  000001f: error: OnTableSetExpr callback failed\nout/test/spec/table_set.wast:64: assert_invalid passed:\n  out/test/spec/table_set/table_set.2.wasm:0000021: error: type mismatch in table.set, expected [i32, externref] but got [externref]\n  0000021: error: OnTableSetExpr callback failed\nout/test/spec/table_set.wast:73: assert_invalid passed:\n  out/test/spec/table_set/table_set.3.wasm:0000021: error: type mismatch in table.set, expected [i32, externref] but got [i32]\n  0000021: error: OnTableSetExpr callback failed\nout/test/spec/table_set.wast:82: assert_invalid passed:\n  out/test/spec/table_set/table_set.4.wasm:0000026: error: type mismatch in table.set, expected [i32, externref] but got [f32, externref]\n  0000026: error: OnTableSetExpr callback failed\nout/test/spec/table_set.wast:91: assert_invalid passed:\n  out/test/spec/table_set/table_set.5.wasm:0000024: error: type mismatch in table.set, expected [i32, funcref] but got [i32, externref]\n  0000024: error: OnTableSetExpr callback failed\nout/test/spec/table_set.wast:101: assert_invalid passed:\n  out/test/spec/table_set/table_set.6.wasm:0000027: error: type mismatch in table.set, expected [i32, funcref] but got [i32, externref]\n  0000027: error: OnTableSetExpr callback failed\nout/test/spec/table_set.wast:112: assert_invalid passed:\n  out/test/spec/table_set/table_set.7.wasm:0000025: error: type mismatch in implicit return, expected [i32] but got []\n  0000025: error: EndFunctionBody callback failed\n26/26 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/table_size.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/table_size.wast\n(;; STDOUT ;;;\nout/test/spec/table_size.wast:70: assert_invalid passed:\n  out/test/spec/table_size/table_size.1.wasm:0000021: error: type mismatch at end of function, expected [] but got [i32]\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/table_size.wast:79: assert_invalid passed:\n  out/test/spec/table_size/table_size.2.wasm:0000022: error: type mismatch in implicit return, expected [f32] but got [i32]\n  0000022: error: EndFunctionBody callback failed\n39/39 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/tail-call/return_call.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/wasm-3.0/return_call.wast\n;;; ARGS*: --enable-tail-call\n(;; STDOUT ;;;\ncalled host spectest.print_i32_f32(i32:5, f32:91.000000) =>\nout/test/spec/tail-call/return_call.wast:141: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.1.wasm:000001e: error: return signatures have inconsistent types: expected [i32], got []\n  000001e: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:148: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.2.wasm:000001f: error: return signatures have inconsistent types: expected [i32], got [i64]\n  000001f: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:156: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.3.wasm:000001e: error: type mismatch in return_call, expected [i32] but got []\n  000001e: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:163: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.4.wasm:000001f: error: type mismatch in return_call, expected [f64, i32] but got []\n  000001f: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:181: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.7.wasm:0000022: error: type mismatch in return_call, expected [i32, i32] but got [i32]\n  0000022: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:188: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.8.wasm:0000022: error: type mismatch in return_call, expected [i32, i32] but got [i32]\n  0000022: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:195: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.9.wasm:000002a: error: type mismatch in return_call, expected [i32, f64] but got [f64, i32]\n  000002a: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:202: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.10.wasm:000002a: error: type mismatch in return_call, expected [f64, i32] but got [i32, f64]\n  000002a: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:209: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.11.wasm:0000024: error: return signatures have inconsistent types: expected [i32], got [i32, i32]\n  0000024: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:221: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.12.wasm:0000019: error: function variable out of range: 1 (max 1)\n  0000019: error: OnReturnCallExpr callback failed\nout/test/spec/tail-call/return_call.wast:225: assert_invalid passed:\n  out/test/spec/tail-call/return_call/return_call.13.wasm:000001d: error: function variable out of range: 1012321300 (max 1)\n  000001d: error: OnReturnCallExpr callback failed\n47/47 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/tail-call/return_call_indirect.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/proposals/wasm-3.0/return_call_indirect.wast\n;;; ARGS*: --enable-tail-call\n(;; STDOUT ;;;\nout/test/spec/tail-call/return_call_indirect.wast:260: assert_trap passed: indirect call signature mismatch\nout/test/spec/tail-call/return_call_indirect.wast:261: assert_trap passed: indirect call signature mismatch\nout/test/spec/tail-call/return_call_indirect.wast:262: assert_trap passed: undefined table index\nout/test/spec/tail-call/return_call_indirect.wast:263: assert_trap passed: undefined table index\nout/test/spec/tail-call/return_call_indirect.wast:264: assert_trap passed: undefined table index\nout/test/spec/tail-call/return_call_indirect.wast:270: assert_trap passed: indirect call signature mismatch\nout/test/spec/tail-call/return_call_indirect.wast:271: assert_trap passed: indirect call signature mismatch\ncalled host spectest.print_i32_f32(i32:5, f32:91.000000) =>\nout/test/spec/tail-call/return_call_indirect.wast:301: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.1.wat:1:129: error: unexpected token \"param\", expected an expr.\n  ...indirect (type $sig) (result i32) (param i32)    (i32.const 0) (i32.const ...\n                                        ^^^^^\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.1.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (type $sig) (result i32) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/tail-call/return_call_indirect.wast:313: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.2.wat:1:116: error: unexpected token \"type\", expected an expr.\n  ...(return_call_indirect (param i32) (type $sig) (result i32)    (i32.const 0...\n                                        ^^^^\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.2.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (param i32) (type $sig) (result i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/tail-call/return_call_indirect.wast:325: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.3.wat:1:129: error: unexpected token \"type\", expected an expr.\n  ...indirect (param i32) (result i32) (type $sig)    (i32.const 0) (i32.const ...\n                                        ^^^^\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.3.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (param i32) (result i32) (type $sig)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/tail-call/return_call_indirect.wast:337: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.4.wat:1:117: error: unexpected token \"type\", expected an expr.\n  ...return_call_indirect (result i32) (type $sig) (param i32)    (i32.const 0)...\n                                        ^^^^\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.4.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (result i32) (type $sig) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/tail-call/return_call_indirect.wast:349: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.5.wat:1:117: error: unexpected token \"param\", expected an expr.\n  ...return_call_indirect (result i32) (param i32) (type $sig)    (i32.const 0)...\n                                        ^^^^^\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.5.wat:1:173: error: unexpected token ), expected EOF.\n  ...irect (result i32) (param i32) (type $sig)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/tail-call/return_call_indirect.wast:361: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.6.wat:1:74: error: unexpected token \"param\", expected an expr.\n  ...return_call_indirect (result i32) (param i32)    (i32.const 0) (i32.const ...\n                                        ^^^^^\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.6.wat:1:118: error: unexpected token ), expected EOF.\n  ...urn_call_indirect (result i32) (param i32)    (i32.const 0) (i32.const 0)  ))\n                                                                                 ^\nout/test/spec/tail-call/return_call_indirect.wast:373: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.7.wat:1:53: error: unexpected token $x, expected ).\n  ...cref)(func (return_call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\n                                             ^^\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.7.wat:1:89: error: unexpected token ), expected EOF.\n  ...cref)(func (return_call_indirect (param $x i32) (i32.const 0) (i32.const 0)))\n                                                                                 ^\nout/test/spec/tail-call/return_call_indirect.wast:380: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.8.wat:1:57: error: expected 0 results, got 1\n  ...ncref)(func (result i32)  (return_call_indirect (type $sig) (result i32) (...\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/tail-call/return_call_indirect.wast:390: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.9.wat:1:82: error: expected 1 arguments, got 0\n  ...ncref)(func (result i32)  (return_call_indirect (type $sig) (result i32) (...\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/tail-call/return_call_indirect.wast:400: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.10.wat:1:69: error: expected 1 results, got 0\n  ...))(table 0 funcref)(func  (return_call_indirect (type $sig) (param i32)   ...\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/tail-call/return_call_indirect.wast:412: assert_malformed passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.11.wat:1:86: error: expected 2 arguments, got 1\n  ...ncref)(func (result i32)  (return_call_indirect (type $sig) (param i32) (r...\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/tail-call/return_call_indirect.wast:427: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.12.wasm:000001c: error: table variable out of range: 0 (max 0)\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.12.wasm:000001c: error: type mismatch: return_call_indirect must reference table of funcref type\n  000001c: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:435: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.13.wasm:0000024: error: type mismatch at end of function, expected [] but got [i32]\n  0000024: error: EndFunctionBody callback failed\nout/test/spec/tail-call/return_call_indirect.wast:443: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.14.wasm:0000026: error: return signatures have inconsistent types: expected [], got [i64]\n  0000026: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:452: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.15.wasm:0000026: error: type mismatch in return_call_indirect, expected [i32] but got []\n  0000026: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:460: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.16.wasm:0000027: error: type mismatch in return_call_indirect, expected [f64, i32] but got []\n  0000027: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:483: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.19.wasm:0000027: error: type mismatch in return_call_indirect, expected [i32] but got []\n  0000027: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:491: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.20.wasm:0000028: error: type mismatch in return_call_indirect, expected [i32] but got [... i64]\n  0000028: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:500: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.21.wasm:000002a: error: type mismatch in return_call_indirect, expected [i32, i32] but got [i32]\n  000002a: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:510: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.22.wasm:000002a: error: type mismatch in return_call_indirect, expected [i32, i32] but got [i32]\n  000002a: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:520: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.23.wasm:0000032: error: type mismatch in return_call_indirect, expected [i32, f64] but got [f64, i32]\n  0000032: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:530: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.24.wasm:0000032: error: type mismatch in return_call_indirect, expected [f64, i32] but got [i32, f64]\n  0000032: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:540: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.25.wasm:0000034: error: return signatures have inconsistent types: expected [i32], got [i32, i32]\n  0000034: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:553: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.26.wasm:0000022: error: type mismatch: return_call_indirect must reference table of funcref type\n  0000022: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:564: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.27.wasm:0000022: error: function type variable out of range: 1 (max 1)\n  0000022: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:571: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.28.wasm:0000026: error: function type variable out of range: 1012321300 (max 1)\n  0000026: error: OnReturnCallIndirectExpr callback failed\nout/test/spec/tail-call/return_call_indirect.wast:582: assert_invalid passed:\n  out/test/spec/tail-call/return_call_indirect/return_call_indirect.29.wasm:0000018: error: function variable out of range: 0 (max 0)\n  0000018: error: OnRefFuncExpr callback failed\n79/79 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/token.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/token.wast\n(;; STDOUT ;;;\nout/test/spec/token.wast:4: assert_malformed passed:\n  out/test/spec/token/token.0.wat:1:14: error: unexpected token \"i32.const0\", expected an expr.\n  (func (drop (i32.const0)))\n               ^^^^^^^^^^\nout/test/spec/token.wast:8: assert_malformed passed:\n  out/test/spec/token/token.1.wat:1:10: error: unexpected token \"0drop\", expected a numeric index or a name (e.g. 12 or $foo).\n  (func br 0drop)\n           ^^^^^\nout/test/spec/token.wast:86: assert_malformed passed:\n  out/test/spec/token/token.19.wat:1:41: error: unexpected token \"0$l\", expected a var (e.g. 12 or $foo).\n  (func (block $l (i32.const 0) (br_table 0$l)))\n                                          ^^^\nout/test/spec/token.wast:96: assert_malformed passed:\n  out/test/spec/token/token.21.wat:1:41: error: undefined label variable \"$l0\"\n  (func (block $l (i32.const 0) (br_table $l0)))\n                                          ^^^\nout/test/spec/token.wast:106: assert_malformed passed:\n  out/test/spec/token/token.23.wat:1:41: error: undefined label variable \"$l$l\"\n  (func (block $l (i32.const 0) (br_table $l$l)))\n                                          ^^^^\nout/test/spec/token.wast:126: assert_malformed passed:\n  out/test/spec/token/token.27.wat:1:2: error: unexpected token \"data\"a\"\", expected a module field or a module.\n  (data\"a\")\n   ^^^^^^^\n  out/test/spec/token/token.27.wat:1:9: error: unexpected token ), expected EOF.\n  (data\"a\")\n          ^\nout/test/spec/token.wast:136: assert_malformed passed:\n  out/test/spec/token/token.29.wat:1:7: error: unexpected token $l\"a\", expected ).\n  (data $l\"a\")\n        ^^^^^\nout/test/spec/token.wast:146: assert_malformed passed:\n  out/test/spec/token/token.31.wat:1:7: error: unexpected token $l\" a\", expected ).\n  (data $l\" a\")\n        ^^^^^^\nout/test/spec/token.wast:156: assert_malformed passed:\n  out/test/spec/token/token.33.wat:1:7: error: unexpected token $l\"a \", expected ).\n  (data $l\"a \")\n        ^^^^^^\nout/test/spec/token.wast:166: assert_malformed passed:\n  out/test/spec/token/token.35.wat:1:7: error: invalid string token\n  (data $l\"a \"\"b\")\n        ^^^^^^\n  out/test/spec/token/token.35.wat:1:7: error: unexpected token $l\"a \"\"b\", expected ).\n  (data $l\"a \"\"b\")\n        ^^^^^^^^^\nout/test/spec/token.wast:176: assert_malformed passed:\n  out/test/spec/token/token.37.wat:1:7: error: unexpected token $l\"\", expected ).\n  (data $l\"\")\n        ^^^^^^^^^^\nout/test/spec/token.wast:186: assert_malformed passed:\n  out/test/spec/token/token.39.wat:1:7: error: unexpected token $l\" \", expected ).\n  (data $l\" \")\n        ^^^^^^^^^^^\nout/test/spec/token.wast:196: assert_malformed passed:\n  out/test/spec/token/token.41.wat:1:7: error: unexpected token $l\" \", expected ).\n  (data $l\" \")\n        ^^^^^^^^^^^\nout/test/spec/token.wast:206: assert_malformed passed:\n  out/test/spec/token/token.43.wat:1:7: error: invalid string token\n  (data \"a\"\"b\")\n        ^^^\n  out/test/spec/token/token.43.wat:1:7: error: unexpected token Invalid, expected ).\n  (data \"a\"\"b\")\n        ^^^\nout/test/spec/token.wast:216: assert_malformed passed:\n  out/test/spec/token/token.45.wat:1:7: error: invalid string token\n  (data \"a\"\" b\")\n        ^^^\n  out/test/spec/token/token.45.wat:1:7: error: unexpected token Invalid, expected ).\n  (data \"a\"\" b\")\n        ^^^\nout/test/spec/token.wast:226: assert_malformed passed:\n  out/test/spec/token/token.47.wat:1:7: error: invalid string token\n  (data \"a \"\"b\")\n        ^^^^\n  out/test/spec/token/token.47.wat:1:7: error: unexpected token Invalid, expected ).\n  (data \"a \"\"b\")\n        ^^^^\nout/test/spec/token.wast:236: assert_malformed passed:\n  out/test/spec/token/token.49.wat:1:7: error: invalid string token\n  (data \"\"\"\")\n        ^^^^^^^^\n  out/test/spec/token/token.49.wat:1:7: error: unexpected token Invalid, expected ).\n  (data \"\"\"\")\n        ^^^^^^^^\nout/test/spec/token.wast:246: assert_malformed passed:\n  out/test/spec/token/token.51.wat:1:7: error: invalid string token\n  (data \"\"\" \")\n        ^^^^^^^^\n  out/test/spec/token/token.51.wat:1:7: error: unexpected token Invalid, expected ).\n  (data \"\"\" \")\n        ^^^^^^^^\nout/test/spec/token.wast:256: assert_malformed passed:\n  out/test/spec/token/token.53.wat:1:7: error: invalid string token\n  (data \" \"\"\")\n        ^^^^^^^^^\n  out/test/spec/token/token.53.wat:1:7: error: unexpected token Invalid, expected ).\n  (data \" \"\"\")\n        ^^^^^^^^^\nout/test/spec/token.wast:264: assert_malformed passed:\n  out/test/spec/token/token.54.wat:1:7: error: unexpected token \"a\", expected ).\n  (func \"a\"x)\n        ^^^\n  out/test/spec/token/token.54.wat:1:10: error: unexpected token x.\n  (func \"a\"x)\n           ^\nout/test/spec/token.wast:270: assert_malformed passed:\n  out/test/spec/token/token.55.wat:1:7: error: unexpected token \"a\", expected ).\n  (func \"a\"0)\n        ^^^\nout/test/spec/token.wast:276: assert_malformed passed:\n  out/test/spec/token/token.56.wat:1:7: error: unexpected token 0\"a\", expected ).\n  (func 0\"a\")\n        ^^^^\nout/test/spec/token.wast:282: assert_malformed passed:\n  out/test/spec/token/token.57.wat:1:7: error: unexpected token \"a\", expected ).\n  (func \"a\"$x)\n        ^^^\n58/58 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/traps.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/traps.wast\n(;; STDOUT ;;;\nout/test/spec/traps.wast:16: assert_trap passed: integer divide by zero\nout/test/spec/traps.wast:17: assert_trap passed: integer divide by zero\nout/test/spec/traps.wast:18: assert_trap passed: integer divide by zero\nout/test/spec/traps.wast:19: assert_trap passed: integer divide by zero\nout/test/spec/traps.wast:20: assert_trap passed: integer overflow\nout/test/spec/traps.wast:21: assert_trap passed: integer overflow\nout/test/spec/traps.wast:34: assert_trap passed: integer divide by zero\nout/test/spec/traps.wast:35: assert_trap passed: integer divide by zero\nout/test/spec/traps.wast:36: assert_trap passed: integer divide by zero\nout/test/spec/traps.wast:37: assert_trap passed: integer divide by zero\nout/test/spec/traps.wast:50: assert_trap passed: invalid conversion to integer\nout/test/spec/traps.wast:51: assert_trap passed: invalid conversion to integer\nout/test/spec/traps.wast:52: assert_trap passed: invalid conversion to integer\nout/test/spec/traps.wast:53: assert_trap passed: invalid conversion to integer\nout/test/spec/traps.wast:54: assert_trap passed: invalid conversion to integer\nout/test/spec/traps.wast:55: assert_trap passed: invalid conversion to integer\nout/test/spec/traps.wast:56: assert_trap passed: invalid conversion to integer\nout/test/spec/traps.wast:57: assert_trap passed: invalid conversion to integer\nout/test/spec/traps.wast:78: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/traps.wast:79: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/traps.wast:80: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/traps.wast:81: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/traps.wast:82: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/traps.wast:83: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\nout/test/spec/traps.wast:84: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/traps.wast:85: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/traps.wast:86: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/traps.wast:87: assert_trap passed: out of bounds memory access: access at 65536+2 >= max value 65536\nout/test/spec/traps.wast:88: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/traps.wast:89: assert_trap passed: out of bounds memory access: access at 65536+1 >= max value 65536\nout/test/spec/traps.wast:90: assert_trap passed: out of bounds memory access: access at 65536+4 >= max value 65536\nout/test/spec/traps.wast:91: assert_trap passed: out of bounds memory access: access at 65536+8 >= max value 65536\n36/36 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/type.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/type.wast\n(;; STDOUT ;;;\nout/test/spec/type.wast:44: assert_malformed passed:\n  out/test/spec/type/type.1.wat:1:27: error: unexpected token \"param\", expected param or result.\n  (type (func (result i32) (param i32)))\n                            ^^^^^\nout/test/spec/type.wast:48: assert_malformed passed:\n  out/test/spec/type/type.2.wat:1:21: error: unexpected token $x, expected ).\n  (type (func (result $x i32)))\n                      ^^\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/unreachable.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/unreachable.wast\n(;; STDOUT ;;;\nout/test/spec/unreachable.wast:221: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:222: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:223: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:224: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:226: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:227: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:228: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:229: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:231: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:232: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:233: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:234: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:237: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:238: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:239: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:242: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:244: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:245: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:246: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:248: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:249: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:250: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:251: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:252: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:254: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:256: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:257: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:259: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:261: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:264: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:265: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:266: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:267: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:268: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:270: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:271: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:272: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:274: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:275: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:276: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:277: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:279: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:280: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:281: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:283: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:284: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:286: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:287: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:288: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:289: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:291: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:293: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:294: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:296: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:298: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:299: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:301: assert_trap passed: unreachable executed\nout/test/spec/unreachable.wast:303: assert_trap passed: unreachable executed\n64/64 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/unreached-invalid.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/unreached-invalid.wast\n(;; STDOUT ;;;\nout/test/spec/unreached-invalid.wast:4: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.0.wasm:000001a: error: local variable out of range (max 0)\n  000001a: error: OnLocalGetExpr callback failed\nout/test/spec/unreached-invalid.wast:8: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.1.wasm:000001a: error: global variable out of range: 0 (max 0)\n  000001a: error: OnGlobalGetExpr callback failed\nout/test/spec/unreached-invalid.wast:12: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.2.wasm:000001a: error: function variable out of range: 1 (max 1)\n  000001a: error: OnCallExpr callback failed\nout/test/spec/unreached-invalid.wast:16: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.3.wasm:0000018: error: invalid depth: 1 (max 0)\n  000001a: error: OnBrExpr callback failed\nout/test/spec/unreached-invalid.wast:21: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.4.wasm:000001b: error: type mismatch in i64.eqz, expected [i64] but got [i32]\n  000001b: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:27: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.5.wasm:000001f: error: type mismatch in implicit return, expected [i32] but got [i64]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:33: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.6.wasm:0000023: error: type mismatch in select, expected [i32, i32, i32] but got [i64, i32, i32]\n  0000023: error: OnSelectExpr callback failed\nout/test/spec/unreached-invalid.wast:42: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.7.wasm:000001b: error: type mismatch at end of function, expected [] but got [i32]\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:46: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.8.wasm:000001a: error: type mismatch at end of function, expected [] but got [i32]\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:50: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.9.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:56: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.10.wasm:000001a: error: type mismatch at end of function, expected [] but got [any]\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:60: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.11.wasm:000001c: error: type mismatch at end of function, expected [] but got [any]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:64: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.12.wasm:000001e: error: type mismatch at end of function, expected [] but got [i32]\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:71: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.13.wasm:000001f: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001f: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:77: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.14.wasm:0000021: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000021: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:83: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.15.wasm:0000020: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:89: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.16.wasm:0000023: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000023: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:95: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.17.wasm:000001e: error: type mismatch at end of block, expected [] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:101: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.18.wasm:0000024: error: type mismatch in block, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:107: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.19.wasm:0000020: error: type mismatch at end of loop, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:113: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.20.wasm:0000024: error: type mismatch in loop, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:119: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.21.wasm:000001c: error: type mismatch at end of function, expected [] but got [i32]\n  000001c: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:125: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.22.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:132: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.23.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:138: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.24.wasm:000001e: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:144: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.25.wasm:000001d: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  000001d: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:150: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.26.wasm:0000020: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:156: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.27.wasm:000001d: error: type mismatch at end of block, expected [] but got [i32]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:162: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.28.wasm:0000025: error: type mismatch in block, expected [i32] but got [f32]\n  0000025: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:168: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.29.wasm:000001f: error: type mismatch at end of loop, expected [] but got [i32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:174: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.30.wasm:0000023: error: type mismatch in loop, expected [i32] but got [f32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:180: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.31.wasm:000001b: error: type mismatch at end of function, expected [] but got [i32]\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:186: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.32.wasm:0000021: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000021: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:193: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.33.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:199: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.34.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:205: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.35.wasm:000001c: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:211: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.36.wasm:000001e: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:217: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.37.wasm:000001d: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  000001d: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:223: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.38.wasm:0000020: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:229: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.39.wasm:000001d: error: type mismatch at end of block, expected [] but got [i32]\n  000001d: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:235: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.40.wasm:0000023: error: type mismatch in block, expected [i32] but got [f32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:241: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.41.wasm:000001f: error: type mismatch at end of loop, expected [] but got [i32]\n  000001f: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:247: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.42.wasm:0000021: error: type mismatch in loop, expected [i32] but got [f32]\n  0000021: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:253: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.43.wasm:000001b: error: type mismatch at end of function, expected [] but got [i32]\n  000001b: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:259: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.44.wasm:000001f: error: type mismatch in implicit return, expected [i32] but got [f32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:265: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.45.wasm:000001e: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001e: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:271: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.46.wasm:0000020: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000020: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:277: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.47.wasm:000001f: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001f: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:284: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.48.wasm:000001f: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001f: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:290: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.49.wasm:0000021: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000021: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:296: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.50.wasm:0000020: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  0000020: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:302: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.51.wasm:0000023: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000023: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:308: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.52.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:314: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.53.wasm:0000026: error: type mismatch in block, expected [i32] but got [... f32]\n  out/test/spec/unreached-invalid/unreached-invalid.53.wasm:0000026: error: type mismatch at end of block, expected [] but got [i32]\n  0000026: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:321: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.54.wasm:0000022: error: type mismatch at end of loop, expected [] but got [i32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:327: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.55.wasm:0000024: error: type mismatch in loop, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:334: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.56.wasm:000001e: error: type mismatch at end of function, expected [] but got [i32]\n  000001e: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:340: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.57.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:348: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.58.wasm:0000020: error: type mismatch in i32.eqz, expected [i32] but got []\n  0000020: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:354: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.59.wasm:0000022: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000022: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:360: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.60.wasm:0000021: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  0000021: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:366: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.61.wasm:0000024: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000024: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:372: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.62.wasm:0000021: error: type mismatch at end of block, expected [] but got [i32]\n  0000021: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:378: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.63.wasm:0000027: error: type mismatch in block, expected [i32] but got [... f32]\n  out/test/spec/unreached-invalid/unreached-invalid.63.wasm:0000027: error: type mismatch at end of block, expected [] but got [i32]\n  0000027: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:384: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.64.wasm:0000023: error: type mismatch at end of loop, expected [] but got [i32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:390: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.65.wasm:0000025: error: type mismatch in loop, expected [i32] but got [f32]\n  0000025: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:396: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.66.wasm:000001f: error: type mismatch at end of function, expected [] but got [i32]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:402: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.67.wasm:0000023: error: type mismatch in implicit return, expected [i32] but got [f32]\n  0000023: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:409: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.68.wasm:000001d: error: type mismatch in i32.eqz, expected [i32] but got []\n  000001d: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:415: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.69.wasm:0000021: error: type mismatch in i32.eqz, expected [i32] but got [f32]\n  0000021: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:421: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.70.wasm:000001e: error: type mismatch in f32.eq, expected [f32, f32] but got [i32]\n  000001e: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:427: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.71.wasm:0000023: error: type mismatch in f32.eq, expected [f32, f32] but got [i32, f32]\n  0000023: error: OnCompareExpr callback failed\nout/test/spec/unreached-invalid.wast:433: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.72.wasm:000001e: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n  000001e: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:439: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.73.wasm:0000022: error: type mismatch in `if true` branch, expected [i32] but got [f32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:445: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.74.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:451: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.75.wasm:0000024: error: type mismatch in block, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:457: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.76.wasm:0000020: error: type mismatch at end of loop, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:463: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.77.wasm:0000024: error: type mismatch in loop, expected [i32] but got [f32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:470: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.78.wasm:0000025: error: type mismatch in return, expected [i32] but got [f64]\n  0000025: error: OnReturnExpr callback failed\nout/test/spec/unreached-invalid.wast:477: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.79.wasm:0000029: error: type mismatch in br, expected [i32] but got [f64]\n  0000029: error: OnBrExpr callback failed\nout/test/spec/unreached-invalid.wast:484: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.80.wasm:0000021: error: type mismatch in br_if, expected [i32] but got [f32]\n  0000021: error: OnBrIfExpr callback failed\nout/test/spec/unreached-invalid.wast:490: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.81.wasm:0000024: error: type mismatch at end of block, expected [] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:498: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.82.wasm:0000024: error: type mismatch in block, expected [f32] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:507: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.83.wasm:0000024: error: type mismatch at end of block, expected [] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:515: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.84.wasm:0000022: error: type mismatch in br_table, expected [i32] but got [f32]\n  0000022: error: OnBrTableExpr callback failed\nout/test/spec/unreached-invalid.wast:521: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.85.wasm:0000025: error: type mismatch in br_table, expected [i32] but got [f32]\n  0000025: error: OnBrTableExpr callback failed\nout/test/spec/unreached-invalid.wast:527: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.86.wasm:0000023: error: br_table labels have inconsistent types: expected [f32], got []\n  0000023: error: OnBrTableExpr callback failed\nout/test/spec/unreached-invalid.wast:540: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.87.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:546: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.88.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got []\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:552: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.89.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:558: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.90.wasm:0000023: error: type mismatch at end of block, expected [] but got [i32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:565: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.91.wasm:0000021: error: type mismatch at end of block, expected [] but got [i32]\n  0000021: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:571: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.92.wasm:0000022: error: type mismatch in block, expected [i32] but got []\n  0000022: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:577: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.93.wasm:0000024: error: type mismatch in block, expected [i32] but got [i64]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:584: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.94.wasm:0000023: error: type mismatch at end of block, expected [] but got [i32]\n  0000023: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:590: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.95.wasm:0000025: error: type mismatch in block, expected [i32] but got []\n  0000025: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:596: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.96.wasm:0000027: error: type mismatch in block, expected [i32] but got [i64]\n  0000027: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:604: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.97.wasm:0000024: error: type mismatch at end of block, expected [] but got [i32]\n  0000024: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:611: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.98.wasm:0000020: error: type mismatch at end of block, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:617: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.99.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got []\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:623: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.100.wasm:0000024: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000024: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:629: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.101.wasm:0000025: error: type mismatch at end of block, expected [] but got [i32]\n  0000025: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:637: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.102.wasm:0000020: error: type mismatch at end of loop, expected [] but got [i32]\n  0000020: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:643: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.103.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got []\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:649: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.104.wasm:0000022: error: type mismatch in implicit return, expected [i32] but got [i64]\n  0000022: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:656: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.105.wasm:000001f: error: type mismatch in implicit return, expected [i32] but got []\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:662: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.106.wasm:0000020: error: type mismatch in implicit return, expected [i32] but got []\n  0000020: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:669: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.107.wasm:000001d: error: type mismatch at end of function, expected [] but got [i32]\n  000001d: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:676: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.108.wasm:0000022: error: type mismatch at end of block, expected [] but got [i32]\n  0000022: error: OnEndExpr callback failed\nout/test/spec/unreached-invalid.wast:687: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.109.wasm:000001c: error: type mismatch in i64.extend_i32_u, expected [i32] but got [i64]\n  000001c: error: OnConvertExpr callback failed\nout/test/spec/unreached-invalid.wast:699: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.110.wasm:000001f: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, i32]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/unreached-invalid.wast:704: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.111.wasm:000001f: error: type mismatch in select, expected [i32, i32, i32] but got [i64, i32, i32]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/unreached-invalid.wast:710: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.112.wasm:000001f: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i32, i64]\n  000001f: error: OnSelectExpr callback failed\nout/test/spec/unreached-invalid.wast:715: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.113.wasm:000001d: error: type mismatch in select, expected [i32, i32, i32] but got [i32, i64]\n  000001d: error: OnSelectExpr callback failed\nout/test/spec/unreached-invalid.wast:720: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.114.wasm:000001b: error: type mismatch in select, expected [any, any, i32] but got [i64]\n  000001b: error: OnSelectExpr callback failed\nout/test/spec/unreached-invalid.wast:726: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.115.wasm:000001f: error: type mismatch in implicit return, expected [i32] but got [i64]\n  000001f: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:733: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.116.wasm:000001a: error: type mismatch at end of function, expected [] but got [any]\n  000001a: error: EndFunctionBody callback failed\nout/test/spec/unreached-invalid.wast:738: assert_invalid passed:\n  out/test/spec/unreached-invalid/unreached-invalid.117.wasm:0000026: error: type mismatch in br_table, expected [i32] but got [externref]\n  0000026: error: OnBrTableExpr callback failed\n118/118 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/unreached-valid.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/unreached-valid.wast\n(;; STDOUT ;;;\nout/test/spec/unreached-valid.wast:42: assert_trap passed: unreachable executed\nout/test/spec/unreached-valid.wast:43: assert_trap passed: unreachable executed\nout/test/spec/unreached-valid.wast:44: assert_trap passed: unreachable executed\nout/test/spec/unreached-valid.wast:45: assert_trap passed: unreachable executed\nout/test/spec/unreached-valid.wast:63: assert_trap passed: unreachable executed\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/unwind.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/unwind.wast\n(;; STDOUT ;;;\nout/test/spec/unwind.wast:212: assert_trap passed: unreachable executed\nout/test/spec/unwind.wast:221: assert_trap passed: unreachable executed\nout/test/spec/unwind.wast:230: assert_trap passed: unreachable executed\nout/test/spec/unwind.wast:239: assert_trap passed: unreachable executed\nout/test/spec/unwind.wast:245: assert_trap passed: unreachable executed\nout/test/spec/unwind.wast:251: assert_trap passed: unreachable executed\nout/test/spec/unwind.wast:257: assert_trap passed: unreachable executed\nout/test/spec/unwind.wast:263: assert_trap passed: unreachable executed\n50/50 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/utf8-custom-section-id.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/utf8-custom-section-id.wast\n(;; STDOUT ;;;\nout/test/spec/utf8-custom-section-id.wast:7: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:17: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:27: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:37: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:47: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:57: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:69: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:79: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:89: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:101: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:111: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:121: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:131: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:141: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:151: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:161: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:171: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:181: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:191: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:201: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:211: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:223: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:233: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:243: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:253: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:263: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:275: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:285: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:295: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:305: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:315: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:325: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:335: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:345: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:355: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:365: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:375: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:385: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:395: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:405: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:415: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:425: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:435: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:445: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:455: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:465: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:475: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:485: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:495: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:505: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:515: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:525: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:535: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:545: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:555: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:565: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:575: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:585: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:597: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:607: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:617: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:627: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:637: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:647: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:657: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:667: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:677: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:687: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:697: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:707: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:717: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:727: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:737: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:747: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:757: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:767: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:777: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:787: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:797: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:807: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:817: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:827: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:839: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:849: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:859: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:869: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:879: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:889: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:899: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:911: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:921: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:931: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:941: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:951: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:961: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:971: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:981: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:991: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1001: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1011: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1021: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1031: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1041: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1051: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1061: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1071: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1081: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1091: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1101: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1111: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1121: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1131: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1141: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1151: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1163: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1173: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1183: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1193: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1203: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1213: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1223: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1233: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1243: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1253: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1263: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1273: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1283: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1293: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1303: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1313: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1325: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1335: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1345: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1355: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1365: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1375: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1385: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1395: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1405: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1415: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1425: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1435: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1445: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1455: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1465: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1475: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1487: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1497: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1507: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1517: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1527: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1537: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1547: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1557: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1567: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1579: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1589: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1601: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1611: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1621: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1631: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1641: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1651: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1661: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1671: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1681: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1691: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1701: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1713: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1723: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1735: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1745: assert_malformed passed:\n  000000c: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1755: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1765: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1775: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: section name\nout/test/spec/utf8-custom-section-id.wast:1785: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: section name\n176/176 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/utf8-import-field.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/utf8-import-field.wast\n(;; STDOUT ;;;\nout/test/spec/utf8-import-field.wast:7: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:22: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:37: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:52: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:67: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:82: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:99: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:114: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:129: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:146: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:161: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:176: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:191: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:206: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:221: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:236: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:251: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:266: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:281: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:296: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:311: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:328: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:343: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:358: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:373: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:388: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:405: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:420: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:435: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:450: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:465: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:480: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:495: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:510: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:525: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:540: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:555: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:570: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:585: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:600: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:615: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:630: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:645: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:660: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:675: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:690: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:705: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:720: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:735: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:750: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:765: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:780: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:795: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:810: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:825: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:840: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:855: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:870: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:887: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:902: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:917: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:932: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:947: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:962: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:977: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:992: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1007: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1022: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1037: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1052: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1067: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1082: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1097: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1112: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1127: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1142: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1157: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1172: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1187: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1202: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1217: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1232: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1249: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1264: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1279: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1294: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1309: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1324: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1339: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1356: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1371: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1386: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1401: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1416: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1431: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1446: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1461: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1476: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1491: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1506: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1521: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1536: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1551: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1566: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1581: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1596: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1611: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1626: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1641: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1656: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1671: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1686: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1701: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1716: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1733: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1748: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1763: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1778: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1793: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1808: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1823: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1838: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1853: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1868: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1883: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1898: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1913: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1928: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1943: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1958: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1975: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:1990: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2005: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2020: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2035: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2050: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2065: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2080: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2095: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2110: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2125: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2140: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2155: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2170: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2185: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2200: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2217: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2232: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2247: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2262: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2277: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2292: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2307: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2322: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2337: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2354: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2369: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2386: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2401: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2416: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2431: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2446: assert_malformed passed:\n  0000011: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2461: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2476: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2491: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2506: assert_malformed passed:\n  000000f: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2521: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2536: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2553: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2568: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2585: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2600: assert_malformed passed:\n  000000d: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2615: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2630: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2645: assert_malformed passed:\n  000000e: error: invalid utf-8 encoding: import module name\nout/test/spec/utf8-import-field.wast:2660: assert_malformed passed:\n  0000010: error: invalid utf-8 encoding: import module name\n176/176 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/utf8-import-module.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/utf8-import-module.wast\n(;; STDOUT ;;;\nout/test/spec/utf8-import-module.wast:7: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:22: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:37: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:52: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:67: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:82: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:99: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:114: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:129: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:146: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:161: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:176: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:191: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:206: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:221: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:236: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:251: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:266: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:281: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:296: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:311: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:328: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:343: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:358: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:373: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:388: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:405: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:420: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:435: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:450: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:465: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:480: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:495: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:510: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:525: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:540: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:555: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:570: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:585: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:600: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:615: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:630: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:645: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:660: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:675: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:690: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:705: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:720: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:735: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:750: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:765: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:780: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:795: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:810: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:825: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:840: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:855: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:870: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:887: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:902: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:917: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:932: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:947: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:962: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:977: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:992: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1007: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1022: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1037: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1052: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1067: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1082: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1097: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1112: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1127: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1142: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1157: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1172: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1187: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1202: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1217: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1232: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1249: assert_malformed passed:\n  0000016: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1264: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1279: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1294: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1309: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1324: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1339: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1356: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1371: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1386: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1401: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1416: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1431: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1446: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1461: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1476: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1491: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1506: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1521: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1536: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1551: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1566: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1581: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1596: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1611: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1626: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1641: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1656: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1671: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1686: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1701: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1716: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1733: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1748: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1763: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1778: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1793: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1808: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1823: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1838: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1853: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1868: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1883: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1898: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1913: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1928: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1943: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1958: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1975: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:1990: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2005: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2020: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2035: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2050: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2065: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2080: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2095: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2110: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2125: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2140: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2155: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2170: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2185: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2200: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2217: assert_malformed passed:\n  0000017: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2232: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2247: assert_malformed passed:\n  0000016: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2262: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2277: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2292: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2307: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2322: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2337: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2354: assert_malformed passed:\n  0000016: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2369: assert_malformed passed:\n  0000016: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2386: assert_malformed passed:\n  0000018: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2401: assert_malformed passed:\n  0000016: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2416: assert_malformed passed:\n  0000017: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2431: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2446: assert_malformed passed:\n  0000016: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2461: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2476: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2491: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2506: assert_malformed passed:\n  0000014: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2521: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2536: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2553: assert_malformed passed:\n  0000017: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2568: assert_malformed passed:\n  0000017: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2585: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2600: assert_malformed passed:\n  0000012: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2615: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2630: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2645: assert_malformed passed:\n  0000013: error: invalid utf-8 encoding: import field name\nout/test/spec/utf8-import-module.wast:2660: assert_malformed passed:\n  0000015: error: invalid utf-8 encoding: import field name\n176/176 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec/utf8-invalid-encoding.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; STDIN_FILE: third_party/testsuite/utf8-invalid-encoding.wast\n(;; STDOUT ;;;\nout/test/spec/utf8-invalid-encoding.wast:1: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.0.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\00\\00\\fe\\ff\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:2: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.1.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\80\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:3: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.2.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\8f\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:4: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.3.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\90\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:5: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.4.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\9f\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:6: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.5.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\a0\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:7: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.6.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\bf\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:8: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.7.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c0\\80\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:9: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.8.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c0\\bf\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:10: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.9.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c1\\80\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:11: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.10.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c1\\bf\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:12: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.11.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c2\\00\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:13: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.12.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c2\\2e\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:14: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.13.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c2\\7f\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:15: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.14.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c2\\80\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:16: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.15.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c2\\c0\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:17: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.16.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c2\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:18: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.17.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\c2\\fd\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:19: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.18.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\df\\00\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:20: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.19.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\df\\7f\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:21: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.20.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\df\\c0\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:22: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.21.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\df\\fd\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:23: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.22.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\00\\a0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:24: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.23.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\7f\\a0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:25: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.24.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\80\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:26: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.25.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\80\\a0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:27: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.26.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\9f\\a0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:28: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.27.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\9f\\bf\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:29: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.28.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\a0\\00\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:30: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.29.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\a0\\7f\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:31: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.30.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\a0\\c0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:32: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.31.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\a0\\fd\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:33: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.32.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\c0\\a0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:34: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.33.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e0\\fd\\a0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:35: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.34.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\00\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:36: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.35.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\2e\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:37: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.36.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\7f\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:38: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.37.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\80\\00\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:39: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.38.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\80\\2e\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:40: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.39.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\80\\7f\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:41: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.40.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:42: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.41.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\80\\c0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:43: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.42.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\80\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:44: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.43.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\80\\fd\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:45: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.44.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\c0\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:46: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.45.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:47: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.46.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\e1\\fd\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:48: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.47.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ec\\00\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:49: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.48.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ec\\7f\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:50: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.49.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ec\\80\\00\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:51: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.50.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ec\\80\\7f\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:52: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.51.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ec\\80\\c0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:53: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.52.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ec\\80\\fd\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:54: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.53.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ec\\c0\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:55: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.54.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ec\\fd\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:56: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.55.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\00\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:57: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.56.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\7f\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:58: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.57.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\80\\00\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:59: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.58.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\80\\7f\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:60: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.59.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\80\\c0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:61: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.60.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\80\\fd\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:62: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.61.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\a0\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:63: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.62.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\a0\\bf\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:64: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.63.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\bf\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:65: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.64.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\bf\\bf\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:66: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.65.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\c0\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:67: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.66.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ed\\fd\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:68: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.67.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ee\\00\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:69: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.68.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ee\\7f\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:70: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.69.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ee\\80\\00\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:71: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.70.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ee\\80\\7f\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:72: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.71.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ee\\80\\c0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:73: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.72.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ee\\80\\fd\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:74: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.73.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ee\\c0\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:75: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.74.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ee\\fd\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:76: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.75.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ef\\00\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:77: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.76.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ef\\7f\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:78: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.77.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ef\\80\\00\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:79: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.78.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ef\\80\\7f\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:80: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.79.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ef\\80\\c0\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:81: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.80.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ef\\80\\fd\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:82: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.81.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ef\\c0\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:83: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.82.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ef\\fd\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:84: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.83.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\00\\90\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:85: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.84.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\7f\\90\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:86: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.85.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:87: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.86.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\80\\90\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:88: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.87.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\8f\\90\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:89: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.88.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\8f\\bf\\bf\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:90: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.89.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\90\\00\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:91: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.90.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\90\\7f\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:92: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.91.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\90\\90\\00\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:93: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.92.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\90\\90\\7f\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:94: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.93.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\90\\90\\c0\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:95: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.94.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\90\\90\\fd\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:96: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.95.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\90\\c0\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:97: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.96.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\90\\fd\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:98: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.97.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\c0\\90\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:99: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.98.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f0\\fd\\90\\90\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:100: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.99.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\00\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:101: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.100.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\23\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:102: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.101.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\7f\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:103: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.102.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\00\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:104: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.103.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\23\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:105: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.104.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\7f\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:106: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.105.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\80\\00\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:107: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.106.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\80\\23\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:108: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.107.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\80\\7f\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:109: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.108.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:110: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.109.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\80\\c0\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:111: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.110.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:112: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.111.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\80\\fd\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:113: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.112.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\c0\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:114: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.113.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:115: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.114.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\80\\fd\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:116: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.115.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\c0\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:117: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.116.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:118: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.117.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f1\\fd\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:119: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.118.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\00\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:120: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.119.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\7f\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:121: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.120.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\80\\00\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:122: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.121.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\80\\7f\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:123: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.122.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\80\\80\\00\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:124: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.123.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\80\\80\\7f\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:125: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.124.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\80\\80\\c0\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:126: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.125.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\80\\80\\fd\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:127: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.126.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\80\\c0\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:128: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.127.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\80\\fd\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:129: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.128.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\c0\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:130: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.129.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f3\\fd\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:131: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.130.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\00\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:132: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.131.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\7f\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:133: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.132.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\80\\00\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:134: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.133.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\80\\7f\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:135: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.134.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\80\\80\\00\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:136: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.135.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\80\\80\\7f\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:137: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.136.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\80\\80\\c0\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:138: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.137.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\80\\80\\fd\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:139: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.138.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\80\\c0\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:140: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.139.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\80\\fd\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:141: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.140.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\90\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:142: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.141.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\bf\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:143: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.142.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\c0\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:144: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.143.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f4\\fd\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:145: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.144.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f5\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:146: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.145.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f7\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:147: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.146.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f7\\bf\\bf\\bf\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:148: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.147.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\23\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:149: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.148.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\80\\23\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:150: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.149.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\80\\80\\23\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:151: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.150.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\80\\80\\80\\23\"))\n                ^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:152: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.151.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\80\\80\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:153: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.152.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\80\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:154: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.153.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:155: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.154.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\80\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:156: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.155.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\\80\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:157: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.156.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\f8\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:158: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.157.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fb\\bf\\bf\\bf\\bf\"))\n                ^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:159: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.158.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\23\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:160: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.159.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\23\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:161: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.160.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\80\\23\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:162: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.161.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\80\\80\\23\"))\n                ^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:163: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.162.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\80\\80\\80\\23\"))\n                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:164: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.163.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\80\\80\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:165: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.164.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\80\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:166: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.165.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:167: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.166.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\80\\80\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:168: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.167.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\\80\"))\n                ^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:169: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.168.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\\80\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:170: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.169.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fc\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:171: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.170.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fd\\bf\\bf\\bf\\bf\\bf\"))\n                ^^^^^^^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:172: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.171.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fe\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:173: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.172.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\fe\\ff\"))\n                ^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:174: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.173.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ff\"))\n                ^^^^^\nout/test/spec/utf8-invalid-encoding.wast:175: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.174.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ff\\fe\\00\\00\"))\n                ^^^^^^^^^^^^^^\nout/test/spec/utf8-invalid-encoding.wast:176: assert_malformed passed:\n  out/test/spec/utf8-invalid-encoding/utf8-invalid-encoding.175.wat:1:15: error: quoted string has an invalid utf-8 encoding\n  (func (export \"\\ff\\fe\"))\n                ^^^^^^^^\n176/176 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spec-new/README.md",
    "content": "This directory contains tests from upstream proposals that either\nare not yet in the testsuite repo, or are in a verion of the testsuite\nrepo that we do not yet support/import.\n\nwide-arithmetic.wast comes from:\nhttps://github.com/WebAssembly/testsuite/tree/main/proposals/wide-arithmetic\n\nThis can be deleted on once we import the latest version of testsuite repo\nthat includes this test.\n"
  },
  {
    "path": "test/spec-new/wide-arithmetic.txt",
    "content": ";;; TOOL: wast2json\n;;; STDIN_FILE: test/spec-new/wide-arithmetic.wast\n"
  },
  {
    "path": "test/spec-new/wide-arithmetic.wast",
    "content": "(module\n  (func (export \"i64.add128\") (param i64 i64 i64 i64) (result i64 i64)\n    local.get 0\n    local.get 1\n    local.get 2\n    local.get 3\n    i64.add128)\n  (func (export \"i64.sub128\") (param i64 i64 i64 i64) (result i64 i64)\n    local.get 0\n    local.get 1\n    local.get 2\n    local.get 3\n    i64.sub128)\n  (func (export \"i64.mul_wide_s\") (param i64 i64) (result i64 i64)\n    local.get 0\n    local.get 1\n    i64.mul_wide_s)\n  (func (export \"i64.mul_wide_u\") (param i64 i64) (result i64 i64)\n    local.get 0\n    local.get 1\n    i64.mul_wide_u)\n)\n\n;; simple addition\n(assert_return (invoke \"i64.add128\"\n                  (i64.const 0) (i64.const 0)\n                  (i64.const 0) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.add128\"\n                  (i64.const 0) (i64.const 1)\n                  (i64.const 1) (i64.const 0))\n               (i64.const 1) (i64.const 1))\n(assert_return (invoke \"i64.add128\"\n                  (i64.const 1) (i64.const 0)\n                  (i64.const -1) (i64.const 0))\n               (i64.const 0) (i64.const 1))\n(assert_return (invoke \"i64.add128\"\n                  (i64.const 1) (i64.const 1)\n                  (i64.const -1) (i64.const -1))\n               (i64.const 0) (i64.const 1))\n\n;; simple subtraction\n(assert_return (invoke \"i64.sub128\"\n                  (i64.const 0) (i64.const 0)\n                  (i64.const 0) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.sub128\"\n                  (i64.const 0) (i64.const 0)\n                  (i64.const 1) (i64.const 0))\n               (i64.const -1) (i64.const -1))\n(assert_return (invoke \"i64.sub128\"\n                  (i64.const 0) (i64.const 1)\n                  (i64.const 1) (i64.const 1))\n               (i64.const -1) (i64.const -1))\n(assert_return (invoke \"i64.sub128\"\n                  (i64.const 0) (i64.const 0)\n                  (i64.const 1) (i64.const 1))\n               (i64.const -1) (i64.const -2))\n\n;; simple mul_wide\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 0) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 0) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 1) (i64.const 1))\n               (i64.const 1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1) (i64.const 1))\n               (i64.const 1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -1) (i64.const -1))\n               (i64.const 1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -1) (i64.const 1))\n               (i64.const -1) (i64.const -1))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const -1) (i64.const 1))\n               (i64.const -1) (i64.const 0))\n\n;; 20 randomly generated test cases for i64.add128\n(assert_return (invoke \"i64.add128\"\n                   (i64.const -2418420703207364752) (i64.const -1)\n                   (i64.const -1) (i64.const -1))\n               (i64.const -2418420703207364753) (i64.const -1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 0) (i64.const 0)\n                   (i64.const -4579433644172935106) (i64.const -1))\n               (i64.const -4579433644172935106) (i64.const -1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 0) (i64.const 0)\n                   (i64.const 1) (i64.const -1))\n               (i64.const 1) (i64.const -1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 1) (i64.const 0)\n                   (i64.const 1) (i64.const 0))\n               (i64.const 2) (i64.const 0))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const -1) (i64.const -1)\n                   (i64.const -1) (i64.const -1))\n               (i64.const -2) (i64.const -1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 0) (i64.const -1)\n                   (i64.const 1) (i64.const 0))\n               (i64.const 1) (i64.const -1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 0) (i64.const 0)\n                   (i64.const 0) (i64.const -1))\n               (i64.const 0) (i64.const -1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 1) (i64.const 0)\n                   (i64.const -1) (i64.const -1))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 0) (i64.const 6184727276166606191)\n                   (i64.const 0) (i64.const 1))\n               (i64.const 0) (i64.const 6184727276166606192))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const -8434911321912688222) (i64.const -1)\n                   (i64.const 1) (i64.const -1))\n               (i64.const -8434911321912688221) (i64.const -2))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 1) (i64.const -1)\n                   (i64.const 0) (i64.const -1))\n               (i64.const 1) (i64.const -2))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 1) (i64.const -5148941131328838092)\n                   (i64.const 0) (i64.const 0))\n               (i64.const 1) (i64.const -5148941131328838092))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 1) (i64.const 1)\n                   (i64.const 1) (i64.const 0))\n               (i64.const 2) (i64.const 1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const -1) (i64.const -1)\n                   (i64.const -3636740005180858631) (i64.const -1))\n               (i64.const -3636740005180858632) (i64.const -1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const -5529682780229988275) (i64.const -1)\n                   (i64.const 0) (i64.const 0))\n               (i64.const -5529682780229988275) (i64.const -1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 1) (i64.const -5381447440966559717)\n                   (i64.const 1020031372481336745) (i64.const 1))\n               (i64.const 1020031372481336746) (i64.const -5381447440966559716))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 1) (i64.const 1)\n                   (i64.const 0) (i64.const 0))\n               (i64.const 1) (i64.const 1))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const -9133888546939907356) (i64.const -1)\n                   (i64.const 1) (i64.const 1))\n               (i64.const -9133888546939907355) (i64.const 0))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const -4612047512704241719) (i64.const -1)\n                   (i64.const 0) (i64.const -1))\n               (i64.const -4612047512704241719) (i64.const -2))\n(assert_return (invoke \"i64.add128\"\n                   (i64.const 414720966820876428) (i64.const -1)\n                   (i64.const 1) (i64.const 0))\n               (i64.const 414720966820876429) (i64.const -1))\n\n\n;; 20 randomly generated test cases for i64.sub128\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 0) (i64.const -2459085471354756766)\n                   (i64.const -9151153060221070927) (i64.const -1))\n               (i64.const 9151153060221070927) (i64.const -2459085471354756766))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 4566502638724063423) (i64.const -4282658540409485563)\n                   (i64.const -6884077310018979971) (i64.const -1))\n               (i64.const -6996164124966508222) (i64.const -4282658540409485563))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 1) (i64.const 3118380319444903041)\n                   (i64.const 0) (i64.const 3283115686417695443))\n               (i64.const 1) (i64.const -164735366972792402))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const -7208415241680161810) (i64.const -1)\n                   (i64.const 1) (i64.const 0))\n               (i64.const -7208415241680161811) (i64.const -1))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 0) (i64.const 3944850126731328706)\n                   (i64.const 1) (i64.const 1))\n               (i64.const -1) (i64.const 3944850126731328704))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 1) (i64.const -1)\n                   (i64.const -1) (i64.const -1))\n               (i64.const 2) (i64.const -1))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const -1) (i64.const -1)\n                   (i64.const 4855833073346115923) (i64.const -6826437637438999645))\n               (i64.const -4855833073346115924) (i64.const 6826437637438999644))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 1) (i64.const 0)\n                   (i64.const -1) (i64.const -1))\n               (i64.const 2) (i64.const 0))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 1) (i64.const 0)\n                   (i64.const 1) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const -1) (i64.const -1)\n                   (i64.const 0) (i64.const 0))\n               (i64.const -1) (i64.const -1))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 1) (i64.const -1)\n                   (i64.const -6365475388498096428) (i64.const -1))\n               (i64.const 6365475388498096429) (i64.const -1))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 6804238617560992346) (i64.const -1)\n                   (i64.const 0) (i64.const -1))\n               (i64.const 6804238617560992346) (i64.const 0))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 0) (i64.const 1)\n                   (i64.const 1) (i64.const -7756145513466453619))\n               (i64.const -1) (i64.const 7756145513466453619))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 1) (i64.const -1)\n                   (i64.const 1) (i64.const 1))\n               (i64.const 0) (i64.const -2))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 0) (i64.const 1)\n                   (i64.const 1) (i64.const 0))\n               (i64.const -1) (i64.const 0))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 1) (i64.const 5602881641763648953)\n                   (i64.const -2110589244314239080) (i64.const -1))\n               (i64.const 2110589244314239081) (i64.const 5602881641763648953))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 0) (i64.const 1)\n                   (i64.const -1) (i64.const -1))\n               (i64.const 1) (i64.const 1))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 0) (i64.const -1)\n                   (i64.const 3553816990259121806) (i64.const -2105235417856431622))\n               (i64.const -3553816990259121806) (i64.const 2105235417856431620))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 1861102705894987245) (i64.const 1)\n                   (i64.const 3713781778534059871) (i64.const 1))\n               (i64.const -1852679072639072626) (i64.const -1))\n(assert_return (invoke \"i64.sub128\"\n                   (i64.const 0) (i64.const -1)\n                   (i64.const 1) (i64.const 1832524486821761762))\n               (i64.const -1) (i64.const -1832524486821761764))\n\n;; 20 randomly generated test cases for i64.mul_wide_s\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 1) (i64.const 1))\n               (i64.const 1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 0) (i64.const 6287758211025156705))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -6643537319803451357) (i64.const 1))\n               (i64.const -6643537319803451357) (i64.const -1))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -2483565146858803428) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 1) (i64.const 1))\n               (i64.const 1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -3838951433439430085) (i64.const 3471602925362676030))\n               (i64.const 5186941893001237834) (i64.const -722475195264825124))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -8262495286814853129) (i64.const 7883241869666573970))\n               (i64.const -8557189786755031842) (i64.const -3530988912334554469))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 4278371902407959701) (i64.const 1))\n               (i64.const 4278371902407959701) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -8852706149487089182) (i64.const -1))\n               (i64.const 8852706149487089182) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 1) (i64.const -1))\n               (i64.const -1) (i64.const -1))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -1) (i64.const -4329244561838653387))\n               (i64.const 4329244561838653387) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -1) (i64.const -1))\n               (i64.const 1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 697896157315764057) (i64.const 1))\n               (i64.const 697896157315764057) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 1) (i64.const 1))\n               (i64.const 1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const -1) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 0) (i64.const -3769664482072947073))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 1) (i64.const 8414291037346403854))\n               (i64.const 8414291037346403854) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 1) (i64.const -1))\n               (i64.const -1) (i64.const -1))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 5014655679779318485) (i64.const -5080037812563681985))\n               (i64.const 2842857627777395563) (i64.const -1380983027057486843))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 0) (i64.const 1))\n               (i64.const 0) (i64.const 0))\n\n;; 20 randomly generated test cases for i64.mul_wide_u\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const -4734436040338162711) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 3270597527173764279) (i64.const 6636648075495406358))\n               (i64.const -5430303818902260550) (i64.const 1176674035141685826))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const -7771814344630108151) (i64.const 1))\n               (i64.const -7771814344630108151) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1) (i64.const -7864138787704962081))\n               (i64.const -7864138787704962081) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1) (i64.const 518555141550256010))\n               (i64.const 518555141550256010) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1) (i64.const -1))\n               (i64.const -1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1118900477321231571) (i64.const -1))\n               (i64.const -1118900477321231571) (i64.const 1118900477321231570))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const -1) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const -5586890671027490027) (i64.const 1))\n               (i64.const -5586890671027490027) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 0) (i64.const 3603850799751152505))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const -1) (i64.const -1))\n               (i64.const 1) (i64.const 18446744073709551614))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 0) (i64.const 1))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const -7344082851774441644) (i64.const 3896439839137544024))\n               (i64.const 5738542512914895072) (i64.const 2345175459296971666))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 0) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 616395976148874061) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 2810729703362889816) (i64.const -1))\n               (i64.const -2810729703362889816) (i64.const 2810729703362889815))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1) (i64.const -1))\n               (i64.const -1) (i64.const 0))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 1) (i64.const 0))\n               (i64.const 0) (i64.const 0))\n\n;; assert overlong encodings for each instruction's binary encoding are accepted\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n\n  \"\\01\\11\"                  ;; type section, 17 bytes\n  \"\\02\"                     ;; 2 count\n  \"\\60\"                     ;; type0 = function\n  \"\\04\\7e\\7e\\7e\\7e\"         ;;  4 params - all i64\n  \"\\02\\7e\\7e\"               ;;  2 results - both i64\n  \"\\60\"                     ;; type1 = function\n  \"\\02\\7e\\7e\"               ;;  2 params - both i64\n  \"\\02\\7e\\7e\"               ;;  2 results - both i64\n\n  \"\\03\\05\"                  ;; function section, 5 byte\n  \"\\04\"                     ;; 4 count\n  \"\\00\\00\\01\\01\"            ;; types of each function (0, 0, 1, 1)\n\n  \"\\07\\3d\"                  ;; export section 0x3d bytes\n  \"\\04\"                     ;; 4 count\n  \"\\0ai64.add128\\00\\00\"     ;; \"i64.add128\" which is function 0\n  \"\\0ai64.sub128\\00\\01\"     ;; \"i64.add128\" which is function 1\n  \"\\0ei64.mul_wide_s\\00\\02\" ;; \"i64.mul_wide_s\" which is function 2\n  \"\\0ei64.mul_wide_u\\00\\03\" ;; \"i64.mul_wide_s\" which is function 3\n\n  \"\\0a\\37\"                  ;; code section + byte length\n  \"\\04\"                     ;; 4 count\n\n  \"\\0e\"                     ;; byte length\n  \"\\00\"                     ;; no locals\n  \"\\20\\00\"                  ;; local.get 0\n  \"\\20\\01\"                  ;; local.get 1\n  \"\\20\\02\"                  ;; local.get 2\n  \"\\20\\03\"                  ;; local.get 3\n  \"\\fc\\93\\80\\00\"            ;; i64.add128 (overlong)\n  \"\\0b\"                     ;; end\n\n  \"\\0d\"                     ;; byte length\n  \"\\00\"                     ;; no locals\n  \"\\20\\00\"                  ;; local.get 0\n  \"\\20\\01\"                  ;; local.get 1\n  \"\\20\\02\"                  ;; local.get 2\n  \"\\20\\03\"                  ;; local.get 3\n  \"\\fc\\94\\00\"               ;; i64.sub128 (overlong)\n  \"\\0b\"                     ;; end\n\n  \"\\0c\"                     ;; byte length\n  \"\\00\"                     ;; no locals\n  \"\\20\\00\"                  ;; local.get 0\n  \"\\20\\01\"                  ;; local.get 1\n  \"\\fc\\95\\80\\80\\80\\00\"      ;; i64.mul_wide_s (overlong)\n  \"\\0b\"                     ;; end\n\n  \"\\0b\"                     ;; byte length\n  \"\\00\"                     ;; no locals\n  \"\\20\\00\"                  ;; local.get 0\n  \"\\20\\01\"                  ;; local.get 1\n  \"\\fc\\96\\80\\80\\00\"         ;; i64.mul_wide_u (overlong)\n  \"\\0b\"                     ;; end\n)\n\n(assert_return (invoke \"i64.add128\"\n                  (i64.const 1) (i64.const 2)\n                  (i64.const 3) (i64.const 4))\n               (i64.const 4) (i64.const 6))\n(assert_return (invoke \"i64.sub128\"\n                  (i64.const 2) (i64.const 5)\n                  (i64.const 1) (i64.const 2))\n               (i64.const 1) (i64.const 3))\n(assert_return (invoke \"i64.mul_wide_s\" (i64.const 1) (i64.const -2))\n               (i64.const -2) (i64.const -1))\n(assert_return (invoke \"i64.mul_wide_u\" (i64.const 3) (i64.const 2))\n               (i64.const 6) (i64.const 0))\n\n;; some invalid types for these instructions\n\n(assert_invalid\n  (module\n    (func (param i64 i64 i64 i64) (result i64)\n      local.get 0\n      local.get 1\n      local.get 2\n      local.get 3\n      i64.add128)\n  )\n  \"type mismatch\")\n(assert_invalid\n  (module\n    (func (param i64 i64 i64) (result i64 i64)\n      local.get 0\n      local.get 1\n      local.get 2\n      i64.add128)\n  )\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (func (param i64 i64 i64 i64) (result i64)\n      local.get 0\n      local.get 1\n      local.get 2\n      local.get 3\n      i64.sub128)\n  )\n  \"type mismatch\")\n(assert_invalid\n  (module\n    (func (param i64 i64 i64) (result i64 i64)\n      local.get 0\n      local.get 1\n      local.get 2\n      i64.sub128)\n  )\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (func (param i64 i64) (result i64)\n      local.get 0\n      local.get 1\n      i64.mul_wide_s)\n  )\n  \"type mismatch\")\n(assert_invalid\n  (module\n    (func (param i64) (result i64 i64)\n      local.get 0\n      i64.mul_wide_s)\n  )\n  \"type mismatch\")\n\n(assert_invalid\n  (module\n    (func (param i64 i64) (result i64)\n      local.get 0\n      local.get 1\n      i64.mul_wide_u)\n  )\n  \"type mismatch\")\n(assert_invalid\n  (module\n    (func (param i64) (result i64 i64)\n      local.get 0\n      i64.mul_wide_u)\n  )\n  \"type mismatch\")\n"
  },
  {
    "path": "test/spec-wasm2c-prefix.c",
    "content": "#include <assert.h>\n#define __STDC_FORMAT_MACROS\n#include <inttypes.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"wasm-rt.h\"\n#include \"wasm-rt-impl.h\"\n#include \"wasm-rt-exceptions.h\"\n\n/* NOTE: function argument evaluation order is implementation-defined in C,\n   so it SHOULD NOT be relied on by tests. */\n#if WABT_BIG_ENDIAN\n#define v128_i8x16_make(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \\\n\tsimde_wasm_i8x16_make(p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a)\n#define v128_u8x16_make(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \\\n\tsimde_wasm_u8x16_make(p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a)\n#define v128_i16x8_make(a,b,c,d,e,f,g,h) simde_wasm_i16x8_make(h,g,f,e,d,c,b,a)\n#define v128_u16x8_make(a,b,c,d,e,f,g,h) simde_wasm_u16x8_make(h,g,f,e,d,c,b,a)\n#define v128_i32x4_make(a,b,c,d) simde_wasm_i32x4_make(d,c,b,a)\n#define v128_u32x4_make(a,b,c,d) simde_wasm_u32x4_make(d,c,b,a)\n#define v128_i64x2_make(a,b) simde_wasm_i64x2_make(b,a)\n#define v128_u64x2_make(a,b) simde_wasm_u64x2_make(b,a)\n#define v128_f32x4_make(a,b,c,d) simde_wasm_f32x4_make(d,c,b,a)\n#define v128_f64x2_make(a,b) simde_wasm_f64x2_make(b,a)\n#define v128_i8x16_extract_lane(a,n) simde_wasm_u8x16_extract_lane(a,15-(n))\n#define v128_u8x16_extract_lane(a,n) simde_wasm_u8x16_extract_lane(a,15-(n))\n#define v128_i16x8_extract_lane(a,n) simde_wasm_u16x8_extract_lane(a,7-(n))\n#define v128_u16x8_extract_lane(a,n) simde_wasm_u16x8_extract_lane(a,7-(n))\n#define v128_i32x4_extract_lane(a,n) simde_wasm_u32x4_extract_lane(a,3-(n))\n#define v128_u32x4_extract_lane(a,n) simde_wasm_u32x4_extract_lane(a,3-(n))\n#define v128_i64x2_extract_lane(a,n) simde_wasm_u64x2_extract_lane(a,1-(n))\n#define v128_u64x2_extract_lane(a,n) simde_wasm_u64x2_extract_lane(a,1-(n))\n#define v128_f32x4_extract_lane(a,n) simde_wasm_f32x4_extract_lane(a,3-(n))\n#define v128_f64x2_extract_lane(a,n) simde_wasm_f64x2_extract_lane(a,1-(n))\n#else\n#define v128_i8x16_make simde_wasm_i8x16_make\n#define v128_u8x16_make simde_wasm_u8x16_make\n#define v128_i16x8_make simde_wasm_i16x8_make\n#define v128_u16x8_make simde_wasm_u16x8_make\n#define v128_i32x4_make simde_wasm_i32x4_make\n#define v128_u32x4_make simde_wasm_u32x4_make\n#define v128_i64x2_make simde_wasm_i64x2_make\n#define v128_u64x2_make simde_wasm_u64x2_make\n#define v128_f32x4_make simde_wasm_f32x4_make\n#define v128_f64x2_make simde_wasm_f64x2_make\n// like is_equal_TYPE below, always use unsigned for these\n#define v128_i8x16_extract_lane simde_wasm_u8x16_extract_lane\n#define v128_u8x16_extract_lane simde_wasm_u8x16_extract_lane\n#define v128_i16x8_extract_lane simde_wasm_u16x8_extract_lane\n#define v128_u16x8_extract_lane simde_wasm_u16x8_extract_lane\n#define v128_i32x4_extract_lane simde_wasm_u32x4_extract_lane\n#define v128_u32x4_extract_lane simde_wasm_u32x4_extract_lane\n#define v128_i64x2_extract_lane simde_wasm_u64x2_extract_lane\n#define v128_u64x2_extract_lane simde_wasm_u64x2_extract_lane\n#define v128_f32x4_extract_lane simde_wasm_f32x4_extract_lane\n#define v128_f64x2_extract_lane simde_wasm_f64x2_extract_lane\n#endif\n\nstatic int g_tests_run;\nstatic int g_tests_passed;\n\nstatic void run_spec_tests(void);\n\nstatic void error(const char* file, int line, const char* format, ...) {\n  va_list args;\n  va_start(args, format);\n  fprintf(stderr, \"%s:%d: assertion failed: \", file, line);\n  vfprintf(stderr, format, args);\n  va_end(args);\n}\n\n#define ASSERT_EXCEPTION(f)                                               \\\n  do {                                                                    \\\n    g_tests_run++;                                                        \\\n    if (wasm_rt_impl_try() == WASM_RT_TRAP_UNCAUGHT_EXCEPTION) {          \\\n      g_tests_passed++;                                                   \\\n    } else {                                                              \\\n      (void)(f);                                                          \\\n      error(__FILE__, __LINE__, \"expected \" #f \" to throw exception.\\n\"); \\\n    }                                                                     \\\n  } while (0)\n\n#define ASSERT_TRAP(f)                                         \\\n  do {                                                         \\\n    g_tests_run++;                                             \\\n    if (wasm_rt_impl_try() != 0) {                             \\\n      g_tests_passed++;                                        \\\n    } else {                                                   \\\n      (void)(f);                                               \\\n      error(__FILE__, __LINE__, \"expected \" #f \" to trap.\\n\"); \\\n    }                                                          \\\n  } while (0)\n\n#define ASSERT_EXHAUSTION(f)                                     \\\n  do {                                                           \\\n    g_tests_run++;                                               \\\n    wasm_rt_trap_t code = wasm_rt_impl_try();                    \\\n    switch (code) {                                              \\\n      case WASM_RT_TRAP_NONE:                                    \\\n        (void)(f);                                               \\\n        error(__FILE__, __LINE__, \"expected \" #f \" to trap.\\n\"); \\\n        break;                                                   \\\n      case WASM_RT_TRAP_EXHAUSTION:                              \\\n        g_tests_passed++;                                        \\\n        break;                                                   \\\n      default:                                                   \\\n        error(__FILE__, __LINE__,                                \\\n              \"expected \" #f                                     \\\n              \" to trap due to exhaustion, got trap code %d.\\n\", \\\n              code);                                             \\\n        break;                                                   \\\n    }                                                            \\\n  } while (0)\n\n#define ASSERT_RETURN(f)                               \\\n  do {                                                 \\\n    g_tests_run++;                                     \\\n    int trap_code = wasm_rt_impl_try();                \\\n    if (trap_code) {                                   \\\n      error(__FILE__, __LINE__, #f \" trapped (%s).\\n\", \\\n            wasm_rt_strerror(trap_code));              \\\n    } else {                                           \\\n      f;                                               \\\n      g_tests_passed++;                                \\\n    }                                                  \\\n  } while (0)\n\n#define ASSERT_RETURN_T(type, fmt, f, expected)                          \\\n  do {                                                                   \\\n    g_tests_run++;                                                       \\\n    int trap_code = wasm_rt_impl_try();                                  \\\n    if (trap_code) {                                                     \\\n      error(__FILE__, __LINE__, #f \" trapped (%s).\\n\",                   \\\n            wasm_rt_strerror(trap_code));                                \\\n    } else {                                                             \\\n      type actual = f;                                                   \\\n      if (is_equal_##type(actual, expected)) {                           \\\n        g_tests_passed++;                                                \\\n      } else {                                                           \\\n        error(__FILE__, __LINE__,                                        \\\n              \"in \" #f \": expected %\" fmt \", got %\" fmt \".\\n\", expected, \\\n              actual);                                                   \\\n      }                                                                  \\\n    }                                                                    \\\n  } while (0)\n\n#define ASSERT_RETURN_FUNCREF(f, expected)                                \\\n  do {                                                                    \\\n    g_tests_run++;                                                        \\\n    int trap_code = wasm_rt_impl_try();                                   \\\n    if (trap_code) {                                                      \\\n      error(__FILE__, __LINE__, #f \" trapped (%s).\\n\",                    \\\n            wasm_rt_strerror(trap_code));                                 \\\n    } else {                                                              \\\n      wasm_rt_funcref_t actual = f;                                       \\\n      if (is_equal_wasm_rt_funcref_t(actual, expected)) {                 \\\n        g_tests_passed++;                                                 \\\n      } else {                                                            \\\n        error(__FILE__, __LINE__,                                         \\\n              \"in \" #f \": mismatch between expected and actual funcref\"); \\\n      }                                                                   \\\n    }                                                                     \\\n  } while (0)\n\n#define ASSERT_RETURN_EXNREF(f, expected)                                \\\n  do {                                                                   \\\n    g_tests_run++;                                                       \\\n    int trap_code = wasm_rt_impl_try();                                  \\\n    if (trap_code) {                                                     \\\n      error(__FILE__, __LINE__, #f \" trapped (%s).\\n\",                   \\\n            wasm_rt_strerror(trap_code));                                \\\n    } else {                                                             \\\n      wasm_rt_exnref_t actual = f;                                       \\\n      if (is_equal_wasm_rt_exnref_t(actual, expected)) {                 \\\n        g_tests_passed++;                                                \\\n      } else {                                                           \\\n        error(__FILE__, __LINE__,                                        \\\n              \"in \" #f \": mismatch between expected and actual exnref\"); \\\n      }                                                                  \\\n    }                                                                    \\\n  } while (0)\n\n#define ASSERT_RETURN_NAN_T(type, itype, fmt, f, kind)                        \\\n  do {                                                                        \\\n    g_tests_run++;                                                            \\\n    int trap_code = wasm_rt_impl_try();                                       \\\n    if (trap_code) {                                                          \\\n      error(__FILE__, __LINE__, #f \" trapped (%s).\\n\",                        \\\n            wasm_rt_strerror(trap_code));                                     \\\n    } else {                                                                  \\\n      type actual = f;                                                        \\\n      itype iactual;                                                          \\\n      memcpy(&iactual, &actual, sizeof(iactual));                             \\\n      if (is_##kind##_nan_##type(iactual)) {                                  \\\n        g_tests_passed++;                                                     \\\n      } else {                                                                \\\n        error(__FILE__, __LINE__,                                             \\\n              \"in \" #f \": expected result to be a \" #kind \" nan, got 0x%\" fmt \\\n              \".\\n\",                                                          \\\n              iactual);                                                       \\\n      }                                                                       \\\n    }                                                                         \\\n  } while (0)\n\n#define MULTI_T_UNPACK_(...) __VA_ARGS__\n#define MULTI_T_UNPACK(arg) MULTI_T_UNPACK_ arg\n#define MULTI_i8 \"%\" PRIu8 \" \"\n#define MULTI_i16 \"%\" PRIu16 \" \"\n#define MULTI_i32 \"%u \"\n#define MULTI_i64 \"%\" PRIu64 \" \"\n#define MULTI_f32 \"%.9g \"\n#define MULTI_f64 \"%.17g \"\n#define MULTI_str \"%s \"\n#define ASSERT_RETURN_MULTI_T(type, fmt_expected, fmt_got, f, compare,        \\\n                              expected, found)                                \\\n  do {                                                                        \\\n    g_tests_run++;                                                            \\\n    int trap_code = wasm_rt_impl_try();                                       \\\n    if (trap_code) {                                                          \\\n      error(__FILE__, __LINE__, #f \" trapped (%s).\\n\",                        \\\n            wasm_rt_strerror(trap_code));                                     \\\n    } else {                                                                  \\\n      type actual = f;                                                        \\\n      if (compare) {                                                          \\\n        g_tests_passed++;                                                     \\\n      } else {                                                                \\\n        error(__FILE__, __LINE__,                                             \\\n              \"in \" #f \": expected <\" fmt_expected \">, got <\" fmt_got \">.\\n\", \\\n              MULTI_T_UNPACK(expected), MULTI_T_UNPACK(found));               \\\n      }                                                                       \\\n    }                                                                         \\\n  } while (0)\n\n\n#define ASSERT_RETURN_I32(f, expected) ASSERT_RETURN_T(u32, \"u\", f, expected)\n#define ASSERT_RETURN_I64(f, expected) ASSERT_RETURN_T(u64, PRIu64, f, expected)\n#define ASSERT_RETURN_F32(f, expected) ASSERT_RETURN_T(f32, \".9g\", f, expected)\n#define ASSERT_RETURN_F64(f, expected) ASSERT_RETURN_T(f64, \".17g\", f, expected)\n#define ASSERT_RETURN_EXTERNREF(f, expected) \\\n  ASSERT_RETURN_T(wasm_rt_externref_t, \"p\", f, expected);\n\n#define ASSERT_RETURN_CANONICAL_NAN_F32(f) \\\n  ASSERT_RETURN_NAN_T(f32, u32, \"08x\", f, canonical)\n#define ASSERT_RETURN_CANONICAL_NAN_F64(f) \\\n  ASSERT_RETURN_NAN_T(f64, u64, \"016x\", f, canonical)\n#define ASSERT_RETURN_ARITHMETIC_NAN_F32(f) \\\n  ASSERT_RETURN_NAN_T(f32, u32, \"08x\", f, arithmetic)\n#define ASSERT_RETURN_ARITHMETIC_NAN_F64(f) \\\n  ASSERT_RETURN_NAN_T(f64, u64, \"016x\", f, arithmetic)\n\nstatic bool is_equal_u8(u8 x, u8 y) {\n  return x == y;\n}\n\nstatic bool is_equal_u16(u16 x, u16 y) {\n  return x == y;\n}\n\nstatic bool is_equal_u32(u32 x, u32 y) {\n  return x == y;\n}\n\nstatic bool is_equal_u64(u64 x, u64 y) {\n  return x == y;\n}\n\n#define is_equal_i8 is_equal_u8\n#define is_equal_i16 is_equal_u16\n#define is_equal_i32 is_equal_u32\n#define is_equal_i64 is_equal_u64\n\nstatic bool is_equal_wasm_rt_externref_t(wasm_rt_externref_t x,\n                                         wasm_rt_externref_t y) {\n  return x == y;\n}\n\nstatic inline bool is_equal_wasm_rt_func_type_t(const wasm_rt_func_type_t a,\n                                                const wasm_rt_func_type_t b) {\n  return (a == b) || (a && b && !memcmp(a, b, 32));\n}\n\nstatic bool is_equal_wasm_rt_funcref_t(wasm_rt_funcref_t x,\n                                       wasm_rt_funcref_t y) {\n  return is_equal_wasm_rt_func_type_t(x.func_type, y.func_type) &&\n         (x.func == y.func) && (x.module_instance == y.module_instance);\n}\n\n#ifdef WASM_EXN_MAX_SIZE\nstatic bool is_equal_wasm_rt_exnref_t(wasm_rt_exnref_t x, wasm_rt_exnref_t y) {\n  return x.tag == y.tag && x.size == y.size && !memcmp(x.data, y.data, x.size);\n}\n#endif\n\nwasm_rt_externref_t spectest_make_externref(uintptr_t x) {\n  return (wasm_rt_externref_t)(x + 1);  // externref(0) is not null\n}\n\nstatic u32 f32_bits(f32 x) {\n  u32 ux;\n  memcpy(&ux, &x, sizeof(ux));\n  return ux;\n}\n\nstatic u64 f64_bits(f64 x) {\n  u64 ux;\n  memcpy(&ux, &x, sizeof(ux));\n  return ux;\n}\n\nstatic bool is_equal_f32(f32 x, f32 y) {\n  return f32_bits(x) == f32_bits(y);\n}\n\nstatic bool is_equal_f64(f64 x, f64 y) {\n  return f64_bits(x) == f64_bits(y);\n}\n\nstatic f32 make_nan_f32(u32 x) {\n  x |= 0x7f800000;\n  f32 res;\n  memcpy(&res, &x, sizeof(res));\n  return res;\n}\n\nstatic f64 make_nan_f64(u64 x) {\n  x |= 0x7ff0000000000000;\n  f64 res;\n  memcpy(&res, &x, sizeof(res));\n  return res;\n}\n\nstatic bool is_canonical_nan_f32(u32 x) {\n  return (x & 0x7fffffff) == 0x7fc00000;\n}\n\nstatic bool is_canonical_nan_f64(u64 x) {\n  return (x & 0x7fffffffffffffff) == 0x7ff8000000000000;\n}\n\nstatic bool is_arithmetic_nan_f32(u32 x) {\n  return (x & 0x7fc00000) == 0x7fc00000;\n}\n\nstatic bool is_arithmetic_nan_f64(u64 x) {\n  return (x & 0x7ff8000000000000) == 0x7ff8000000000000;\n}\n\ntypedef struct w2c_spectest {\n  wasm_rt_funcref_table_t spectest_table;\n  wasm_rt_funcref_table_t spectest_table64;\n  wasm_rt_memory_t spectest_memory;\n  uint32_t spectest_global_i32;\n  uint64_t spectest_global_i64;\n  float spectest_global_f32;\n  double spectest_global_f64;\n} w2c_spectest;\n\nstatic w2c_spectest spectest_instance;\n\n/*\n * spectest implementations\n */\nvoid w2c_spectest_print(w2c_spectest* instance) {\n  printf(\"spectest.print()\\n\");\n}\n\nvoid w2c_spectest_print_i32(w2c_spectest* instance, uint32_t i) {\n  printf(\"spectest.print_i32(%d)\\n\", i);\n}\n\nvoid w2c_spectest_print_i64(w2c_spectest* instance, uint64_t i) {\n  printf(\"spectest.print_i64(%\" PRIu64 \")\\n\", i);\n}\n\nvoid w2c_spectest_print_f32(w2c_spectest* instance, float f) {\n  printf(\"spectest.print_f32(%g)\\n\", f);\n}\n\nvoid w2c_spectest_print_i32_f32(w2c_spectest* instance, uint32_t i, float f) {\n  printf(\"spectest.print_i32_f32(%d %g)\\n\", i, f);\n}\n\nvoid w2c_spectest_print_f64(w2c_spectest* instance, double d) {\n  printf(\"spectest.print_f64(%g)\\n\", d);\n}\n\nvoid w2c_spectest_print_f64_f64(w2c_spectest* instance, double d1, double d2) {\n  printf(\"spectest.print_f64_f64(%g %g)\\n\", d1, d2);\n}\n\nwasm_rt_funcref_table_t* w2c_spectest_table(w2c_spectest* instance) {\n  return &instance->spectest_table;\n}\n\nwasm_rt_funcref_table_t* w2c_spectest_table64(w2c_spectest* instance) {\n  return &instance->spectest_table64;\n}\n\nwasm_rt_memory_t* w2c_spectest_memory(w2c_spectest* instance) {\n  return &instance->spectest_memory;\n}\n\nuint32_t* w2c_spectest_global_i32(w2c_spectest* instance) {\n  return &instance->spectest_global_i32;\n}\n\nuint64_t* w2c_spectest_global_i64(w2c_spectest* instance) {\n  return &instance->spectest_global_i64;\n}\n\nfloat* w2c_spectest_global_f32(w2c_spectest* instance) {\n  return &instance->spectest_global_f32;\n}\n\ndouble* w2c_spectest_global_f64(w2c_spectest* instance) {\n  return &instance->spectest_global_f64;\n}\n\nstatic void init_spectest_module(w2c_spectest* instance) {\n  instance->spectest_global_i32 = 666;\n  instance->spectest_global_i64 = 666l;\n  instance->spectest_global_f32 = 666.6;\n  instance->spectest_global_f64 = 666.6;\n  wasm_rt_allocate_memory(&instance->spectest_memory, 1, 2, false,\n                          WASM_DEFAULT_PAGE_SIZE);\n  wasm_rt_allocate_funcref_table(&instance->spectest_table, 10, 20);\n  wasm_rt_allocate_funcref_table(&instance->spectest_table64, 10, 20);\n}\n\n// POSIX-only test config where embedder handles signals instead of w2c runtime\n#ifdef WASM2C_TEST_EMBEDDER_SIGNAL_HANDLING\n#include <signal.h>\n\nstatic void posix_signal_handler(int sig, siginfo_t* si, void* unused) {\n  wasm_rt_trap((si->si_code == SEGV_ACCERR) ? WASM_RT_TRAP_OOB\n                                            : WASM_RT_TRAP_EXHAUSTION);\n}\n\nstatic void posix_install_signal_handler(void) {\n  /* install altstack */\n  stack_t ss;\n  ss.ss_sp = malloc(SIGSTKSZ);\n  ss.ss_flags = 0;\n  ss.ss_size = SIGSTKSZ;\n  if (sigaltstack(&ss, NULL) != 0) {\n    perror(\"sigaltstack failed\");\n    abort();\n  }\n\n  /* install signal handler */\n  struct sigaction sa;\n  memset(&sa, '\\0', sizeof(sa));\n  sa.sa_flags = SA_SIGINFO | SA_ONSTACK;\n  sigemptyset(&sa.sa_mask);\n  sa.sa_sigaction = posix_signal_handler;\n  if (sigaction(SIGSEGV, &sa, NULL) != 0 || sigaction(SIGBUS, &sa, NULL) != 0) {\n    perror(\"sigaction failed\");\n    abort();\n  }\n}\n\nstatic void posix_cleanup_signal_handler(void) {\n  /* remove signal handler */\n  struct sigaction sa;\n  memset(&sa, '\\0', sizeof(sa));\n  sa.sa_handler = SIG_DFL;\n  if (sigaction(SIGSEGV, &sa, NULL) != 0 || sigaction(SIGBUS, &sa, NULL)) {\n    perror(\"sigaction failed\");\n    abort();\n  }\n\n  /* disable and free altstack */\n  stack_t ss;\n  ss.ss_flags = SS_DISABLE;\n  if (sigaltstack(&ss, NULL) != 0) {\n    perror(\"sigaltstack failed\");\n    abort();\n  }\n  free(ss.ss_sp);\n}\n#endif\n\nint main(int argc, char** argv) {\n#ifdef WASM2C_TEST_EMBEDDER_SIGNAL_HANDLING\n  posix_install_signal_handler();\n#endif\n  wasm_rt_init();\n  init_spectest_module(&spectest_instance);\n  run_spec_tests();\n  printf(\"%u/%u tests passed.\\n\", g_tests_passed, g_tests_run);\n  wasm_rt_free();\n#ifdef WASM2C_TEST_EMBEDDER_SIGNAL_HANDLING\n  posix_cleanup_signal_handler();\n#endif\n  return g_tests_passed != g_tests_run;\n}\n"
  },
  {
    "path": "test/spectest-interp-assert-failure.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ERROR: 2\n;; spectest-interp returns the number of failed tests as the error code.\n(module\n  (func (export \"func32\") (result f32) (f32.const 0.1))\n  (func (export \"func64\") (result f64) (f64.const 0.2))\n  (func (export \"func32nan\") (result f32) (f32.const nan))\n  (func (export \"func64nan\") (result f64) (f64.const nan))\n)\n(assert_return (invoke \"func32\") (f32.const nan:canonical))\n(assert_return (invoke \"func64\") (f64.const nan:arithmetic))\n(assert_return (invoke \"func32nan\") (f32.const nan:arithmetic))\n(assert_return (invoke \"func64nan\") (f64.const nan:arithmetic))\n(assert_return (invoke \"func32nan\") (f32.const nan:canonical))\n(assert_return (invoke \"func64nan\") (f64.const nan:canonical))\n(;; STDOUT ;;;\nout/test/spectest-interp-assert-failure.txt:10: mismatch in result 0 of assert_return: expected f32:nan:canonical, got f32:0.100000\nout/test/spectest-interp-assert-failure.txt:11: mismatch in result 0 of assert_return: expected f64:nan:arithmetic, got f64:0.200000\n5/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spectest-interp-error-count.txt",
    "content": ";;; TOOL: run-interp-spec\n;;; ERROR: 3\n;; spectest-interp returns the number of failed tests as the error code.\n(module (func (export \"f\") (result i32) (i32.const 0)))\n\n(assert_return (invoke \"f\") (i32.const 0))\n(assert_return (invoke \"f\") (i32.const 1))\n(assert_return (invoke \"f\") (i32.const 2))\n(assert_return (invoke \"f\") (i32.const 3))\n(;; STDOUT ;;;\nout/test/spectest-interp-error-count.txt:7: mismatch in result 0 of assert_return: expected i32:1, got i32:0\nout/test/spectest-interp-error-count.txt:8: mismatch in result 0 of assert_return: expected i32:2, got i32:0\nout/test/spectest-interp-error-count.txt:9: mismatch in result 0 of assert_return: expected i32:3, got i32:0\n2/5 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/spectest-interp-invalid-literal.txt",
    "content": ";;; RUN: %(spectest-interp)s %(in_file)s\n;;; ERROR: 1\n{\n  \"source_filename\": \"test.wast\",\n  \"commands\": [\n    {\"type\": \"module\", \"line\": 1, \"filename\": \"test.0.wasm\"}, \n    {\n      \"type\": \"assert_return\",\n      \"line\": 3,\n      \"action\": {\"type\": \"invoke\", \"field\": \"f\", \"args\": []},\n      \"expected\": [{\"type\": \"i32\", \"value\": \"xx\"}]\n    }\n  ]\n}\n(;; STDERR ;;;\nout/test/spectest-interp-invalid-literal.txt:11:49: invalid i32 literal\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/stats/basic.txt",
    "content": ";;; TOOL: run-stats\n(module\n  (memory (data \"hello, world\"))\n  (func\n    (local i32 i32)\n    i32.const 1\n    i32.const 2\n    local.get 0\n    local.get 0\n    local.get 0\n    local.get 1\n    local.get 1\n    br 0)\n\n  (func\n    i32.const 0\n    i32.load\n    f32.const 2\n    f32.const 3\n    f32.add\n    br 0))\n(;; STDOUT ;;;\nTotal opcodes: 18\n\nOpcode counts:\nlocal.get: 5\ni32.const: 4\nend: 3\nbr: 2\nf32.const: 2\ni32.load: 1\nf32.add: 1\n\nOpcode counts with immediates:\nend: 3\nlocal.get 0: 3\nbr 0: 2\nlocal.get 1: 2\ni32.const 0 (0x0): 2\ni32.load 2, 0: 1\ni32.const 1 (0x1): 1\ni32.const 2 (0x2): 1\nf32.const 2 (0x1p+1): 1\nf32.const 3 (0x1.8p+1): 1\nf32.add: 1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/stats/cutoff.txt",
    "content": ";;; TOOL: run-stats\n;;; ARGS: --cutoff 3\n(module\n  (func\n    i32.const 1\n    i32.const 2\n    i32.const 3\n    i32.const 4\n    i32.const 5\n    f32.const 6\n    f32.const 7\n    f32.const 8\n    f64.const 9\n    return))\n(;; STDOUT ;;;\nTotal opcodes: 11\n\nOpcode counts:\ni32.const: 5\nf32.const: 3\n\nOpcode counts with immediates:\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/stats/immediates.txt",
    "content": ";;; TOOL: run-stats\n(module\n  (memory 1)\n  (func\n    ;; constants\n    i32.const 1\n    i64.const 2\n    f32.const 3.125\n    f64.const 4.5\n    v128.const i32x4 0 1 2 3\n\n    ;; load\n    i32.const 0\n    i32.load offset=1 align=4\n    i32.const 0\n    v128.load offset=1 align=4\n    i32.const 0\n    v128.load8x8_s offset=1 align=4\n    i32.const 0\n    v128.load8_splat offset=1 align=1\n    i32.const 0\n    v128.const i32x4 0 1 2 3\n    v128.load8_lane offset=3 2\n    i32.const 0\n    v128.const i32x4 0 1 2 3\n    v128.store16_lane offset=3 2\n\n    ;; store\n    i32.const 0\n    i32.const 0\n    i32.store offset=3 align=4\n\n    ;; bare block\n    block\n    end\n\n    ;; block with signature\n    block (result i64)\n      unreachable\n    end\n\n    ;; br\n    br 0\n\n    ;; br_table\n    i32.const 0\n    br_table 0 0 0 0 0 0\n\n    ;; simd extract/replace lane\n    v128.const i32x4 0 1 2 3\n    i32x4.extract_lane 3\n\n    return))\n(;; STDOUT ;;;\nTotal opcodes: 34\n\nOpcode counts:\ni32.const: 10\nv128.const: 4\nend: 3\nblock: 2\nunreachable: 1\nbr: 1\nbr_table: 1\nreturn: 1\ni32.load: 1\ni32.store: 1\ni64.const: 1\nf32.const: 1\nf64.const: 1\nv128.load: 1\nv128.load8x8_s: 1\nv128.load8_splat: 1\ni32x4.extract_lane: 1\nv128.load8_lane: 1\nv128.store16_lane: 1\n\nOpcode counts with immediates:\ni32.const 0 (0x0): 9\nv128.const 0 1 2 3 (0x0 0x1 0x2 0x3): 4\nend: 3\nunreachable: 1\nblock: 1\nblock i64: 1\nbr 0: 1\nbr_table 0, 0, 0, 0, 0, 0: 1\nreturn: 1\ni32.load 2, 1: 1\ni32.store 2, 3: 1\ni32.const 1 (0x1): 1\ni64.const 2 (0x2): 1\nf32.const 3.125 (0x1.9p+1): 1\nf64.const 4.5 (0x1.2p+2): 1\nv128.load 2, 1: 1\nv128.load8x8_s 2, 1: 1\nv128.load8_splat 0, 1: 1\ni32x4.extract_lane 3 (0x3): 1\nv128.load8_lane 0, 3, 2: 1\nv128.store16_lane 1, 3, 2: 1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/strip/basic.txt",
    "content": ";;; TOOL: run-gen-wasm-strip\nmagic\nversion\nsection(\"one\") { \"Lorem ipsum dolor sit amet,\" }\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(\"two\") { \"consectetur adipiscing elit,\" }\nsection(FUNCTION) { count[1] type[0] }\nsection(\"three\") { \"sed do eiusmod tempor incididunt\" }\nsection(EXPORT) { count[1] str(\"main\") func_kind func[0] }\nsection(\"four\") { \"ut labore et dolore magna aliqua.\" }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const\n    leb_i32(-420)\n    return\n  }\n}\nsection(\"five\") { \"Ut enim ad minim veniam,\" }\n(;; STDOUT ;;;\n\nbasic.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000f (size=0x00000005) count: 1\n Function start=0x00000011 end=0x00000013 (size=0x00000002) count: 1\n   Export start=0x00000015 end=0x0000001d (size=0x00000008) count: 1\n     Code start=0x0000001f end=0x00000027 (size=0x00000008) count: 1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/strip/keep_section.txt",
    "content": ";;; RUN: %(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm\n;;; RUN: %(wasm-strip)s --keep-section one %(temp_file)s.wasm -o %(temp_file)s_stripped.wasm\n;;; RUN: %(wasm-objdump)s -h %(temp_file)s_stripped.wasm\nmagic\nversion\nsection(\"one\") { \"Lorem ipsum dolor sit amet,\" }\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(\"two\") { \"consectetur adipiscing elit,\" }\nsection(FUNCTION) { count[1] type[0] }\nsection(\"three\") { \"sed do eiusmod tempor incididunt\" }\nsection(EXPORT) { count[1] str(\"main\") func_kind func[0] }\nsection(\"four\") { \"ut labore et dolore magna aliqua.\" }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const\n    leb_i32(-420)\n    return\n  }\n}\nsection(\"five\") { \"Ut enim ad minim veniam,\" }\n(;; STDOUT ;;;\n\nkeep_section_stripped.wasm:\tfile format wasm 0x1\n\nSections:\n\n   Custom start=0x0000000a end=0x00000029 (size=0x0000001f) \"one\"\n     Type start=0x0000002b end=0x00000030 (size=0x00000005) count: 1\n Function start=0x00000032 end=0x00000034 (size=0x00000002) count: 1\n   Export start=0x00000036 end=0x0000003e (size=0x00000008) count: 1\n     Code start=0x00000040 end=0x00000048 (size=0x00000008) count: 1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/strip/names.txt",
    "content": ";;; TOOL: run-gen-wasm-strip\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n}\nsection(\"name\") {\n  section(NAME_MODULE) {\n    str(\"M0\")\n  }\n\n  section(NAME_FUNCTION) {\n    func_count[1]\n    index[0]\n    str(\"F0\")\n  }\n\n  section(NAME_LOCALS) {\n    func_count[1]\n    index[0]\n    local_count[1]\n    index[0]\n    str(\"L0\")\n  }\n}\n(;; STDOUT ;;;\n\nnames.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000f (size=0x00000005) count: 1\n Function start=0x00000011 end=0x00000013 (size=0x00000002) count: 1\n     Code start=0x00000015 end=0x0000001d (size=0x00000008) count: 1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/strip/no-custom-sections.txt",
    "content": ";;; TOOL: run-gen-wasm-strip\nmagic\nversion\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[decl_count[1] i32_count[1] i32]\n    local.get 0\n  }\n}\n(;; STDOUT ;;;\n\nno-custom-sections.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000f (size=0x00000005) count: 1\n Function start=0x00000011 end=0x00000013 (size=0x00000002) count: 1\n     Code start=0x00000015 end=0x0000001d (size=0x00000008) count: 1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/strip/out_file.txt",
    "content": ";;; RUN: %(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm\n;;; RUN: %(wasm-strip)s %(temp_file)s.wasm -o %(temp_file)s_stripped.wasm\n;;; RUN: %(wasm-objdump)s -h %(temp_file)s_stripped.wasm\nmagic\nversion\nsection(\"one\") { \"Lorem ipsum dolor sit amet,\" }\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(\"two\") { \"consectetur adipiscing elit,\" }\nsection(FUNCTION) { count[1] type[0] }\nsection(\"three\") { \"sed do eiusmod tempor incididunt\" }\nsection(EXPORT) { count[1] str(\"main\") func_kind func[0] }\nsection(\"four\") { \"ut labore et dolore magna aliqua.\" }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const\n    leb_i32(-420)\n    return\n  }\n}\nsection(\"five\") { \"Ut enim ad minim veniam,\" }\n(;; STDOUT ;;;\n\nout_file_stripped.wasm:\tfile format wasm 0x1\n\nSections:\n\n     Type start=0x0000000a end=0x0000000f (size=0x00000005) count: 1\n Function start=0x00000011 end=0x00000013 (size=0x00000002) count: 1\n   Export start=0x00000015 end=0x0000001d (size=0x00000008) count: 1\n     Code start=0x0000001f end=0x00000027 (size=0x00000008) count: 1\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/strip/remove_section.txt",
    "content": ";;; RUN: %(gen_wasm_py)s %(in_file)s -o %(temp_file)s.wasm\n;;; RUN: %(wasm-strip)s --remove-section one %(temp_file)s.wasm -o %(temp_file)s_stripped.wasm\n;;; RUN: %(wasm-objdump)s -h %(temp_file)s_stripped.wasm\nmagic\nversion\nsection(\"one\") { \"Lorem ipsum dolor sit amet,\" }\nsection(\"two\") { \"consectetur adipiscing elit,\" }\nsection(\"three\") { \"sed do eiusmod tempor incididunt\" }\nsection(\"four\") { \"ut labore et dolore magna aliqua.\" }\nsection(TYPE) { count[1] function params[0] results[1] i32 }\nsection(FUNCTION) { count[1] type[0] }\nsection(EXPORT) { count[1] str(\"main\") func_kind func[0] }\nsection(CODE) {\n  count[1]\n  func {\n    locals[0]\n    i32.const\n    leb_i32(-420)\n    return\n  }\n}\nsection(\"five\") { \"Ut enim ad minim veniam,\" }\n(;; STDOUT ;;;\n\nremove_section_stripped.wasm:\tfile format wasm 0x1\n\nSections:\n\n   Custom start=0x0000000a end=0x0000002a (size=0x00000020) \"two\"\n   Custom start=0x0000002c end=0x00000052 (size=0x00000026) \"three\"\n   Custom start=0x00000054 end=0x0000007a (size=0x00000026) \"four\"\n     Type start=0x0000007c end=0x00000081 (size=0x00000005) count: 1\n Function start=0x00000083 end=0x00000085 (size=0x00000002) count: 1\n   Export start=0x00000087 end=0x0000008f (size=0x00000008) count: 1\n     Code start=0x00000091 end=0x00000099 (size=0x00000008) count: 1\n   Custom start=0x0000009b end=0x000000b8 (size=0x0000001d) \"five\"\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/too-many-arguments.txt",
    "content": ";;; RUN: %(wat2wasm)s\n;;; ARGS: foo.txt bar.txt\n;;; ERROR: 1\n(;; STDERR ;;;\nwat2wasm: unexpected argument 'bar.txt'\nTry '--help' for more information.\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/two-commands.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: -v\n;;; TOOL: wat2wasm\n;;; ARGS: -v\n(module)\n(;; STDERR ;;;\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n0000000: 0061 736d                                 ; WASM_BINARY_MAGIC\n0000004: 0100 0000                                 ; WASM_BINARY_VERSION\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/atomic-no-shared-memory.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-threads\n\n(module\n  (memory 1)\n  (func\n    i32.const 0 i32.const 0 memory.atomic.notify drop\n    i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop\n    i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop\n\n    i32.const 0 i32.atomic.load drop\n    i32.const 0 i64.atomic.load drop\n    i32.const 0 i32.atomic.load8_u drop\n    i32.const 0 i32.atomic.load16_u drop\n    i32.const 0 i64.atomic.load8_u drop\n    i32.const 0 i64.atomic.load16_u drop\n    i32.const 0 i64.atomic.load32_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.store\n    i32.const 0 i64.const 0 i64.atomic.store\n    i32.const 0 i32.const 0 i32.atomic.store8\n    i32.const 0 i32.const 0 i32.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store8\n    i32.const 0 i64.const 0 i64.atomic.store16\n    i32.const 0 i64.const 0 i64.atomic.store32\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.add drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.add drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.add_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.add_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.add_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.sub drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.sub drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.and drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.and drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.and_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.and_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.and_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.or drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.or drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.or_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.or_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.or_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xor drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xor drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop\n\n    i32.const 0 i32.const 0 i32.atomic.rmw.xchg drop\n    i32.const 0 i64.const 0 i64.atomic.rmw.xchg drop\n    i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop\n    i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop\n    i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop\n\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop\n    i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop\n\n))\n"
  },
  {
    "path": "test/typecheck/bad-assertexception-type-mismatch.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func (export \"foo\") (param i32) (result i32) local.get 0)\n  )\n(assert_exception (invoke \"foo\" (f32.const 0)))\n(;; STDERR ;;;\nout/test/typecheck/bad-assertexception-type-mismatch.txt:6:44: error: type mismatch for argument 0 of invoke. got f32, expected i32\n(assert_exception (invoke \"foo\" (f32.const 0)))\n                                           ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-assertreturn-invoke-type-mismatch.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func (param i32) (result i32) local.get 0)\n  (export \"foo\" (func 0)))\n(assert_return (invoke \"foo\" (f32.const 0)) (i32.const 0))\n(;; STDERR ;;;\nout/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt:6:41: error: type mismatch for argument 0 of invoke. got f32, expected i32\n(assert_return (invoke \"foo\" (f32.const 0)) (i32.const 0))\n                                        ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-assertreturn-type-mismatch.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func (param i32) (result i32) local.get 0)\n  (export \"foo\" (func 0)))\n(assert_return (invoke \"foo\" (i32.const 0)) (f32.const 0))\n(;; STDERR ;;;\nout/test/typecheck/bad-assertreturn-type-mismatch.txt:6:17: error: type mismatch for result 0 of action. got f32, expected i32\n(assert_return (invoke \"foo\" (i32.const 0)) (f32.const 0))\n                ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-atomic-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-threads\n;;; ERROR: 1\n\n(module\n  (memory 1 1 shared)\n\n  ;; Mismatch address.\n  (func f32.const 0 i32.const 0 memory.atomic.notify drop)\n  (func f32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop)\n  (func f32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop)\n  (func f32.const 0 i32.atomic.load drop)\n  (func f32.const 0 i64.atomic.load drop)\n  (func f32.const 0 i32.atomic.load8_u drop)\n  (func f32.const 0 i32.atomic.load16_u drop)\n  (func f32.const 0 i64.atomic.load8_u drop)\n  (func f32.const 0 i64.atomic.load16_u drop)\n  (func f32.const 0 i64.atomic.load32_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.store)\n  (func f32.const 0 i64.const 0 i64.atomic.store)\n  (func f32.const 0 i32.const 0 i32.atomic.store8)\n  (func f32.const 0 i32.const 0 i32.atomic.store16)\n  (func f32.const 0 i64.const 0 i64.atomic.store8)\n  (func f32.const 0 i64.const 0 i64.atomic.store16)\n  (func f32.const 0 i64.const 0 i64.atomic.store32)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.add drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.add drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.add_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.add_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.add_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.add_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.add_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.sub drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.sub drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.and drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.and drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.and_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.and_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.and_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.and_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.and_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.or drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.or drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.or_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.or_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.or_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.or_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.or_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.xor drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.xor drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.xchg drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.xchg drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop)\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop)\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop)\n  (func f32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop)\n  (func f32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop)\n  (func f32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop)\n  (func f32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop)\n  (func f32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop)\n  (func f32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop)\n  (func f32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop)\n\n  ;; Mismatch first value operand.\n  (func i32.const 0 f32.const 0 memory.atomic.notify drop)\n  (func i32.const 0 f32.const 0 i64.const 0 memory.atomic.wait32 drop)\n  (func i32.const 0 f64.const 0 i64.const 0 memory.atomic.wait64 drop)\n  (func i32.const 0 f32.const 0 i32.atomic.store)\n  (func i32.const 0 f64.const 0 i64.atomic.store)\n  (func i32.const 0 f32.const 0 i32.atomic.store8)\n  (func i32.const 0 f32.const 0 i32.atomic.store16)\n  (func i32.const 0 f64.const 0 i64.atomic.store8)\n  (func i32.const 0 f64.const 0 i64.atomic.store16)\n  (func i32.const 0 f64.const 0 i64.atomic.store32)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.add drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.add drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.add_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.add_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.add_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.add_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.add_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.sub drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.sub drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.sub_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.sub_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.sub_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.sub_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.sub_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.and drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.and drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.and_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.and_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.and_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.and_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.and_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.or drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.or drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.or_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.or_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.or_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.or_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.or_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.xor drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.xor drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.xor_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.xor_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.xor_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.xor_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.xor_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.xchg drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.xchg drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.xchg_u drop)\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.xchg_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.xchg_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.xchg_u drop)\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.xchg_u drop)\n  (func i32.const 0 f32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop)\n  (func i32.const 0 f64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop)\n  (func i32.const 0 f32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop)\n  (func i32.const 0 f32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop)\n  (func i32.const 0 f64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop)\n  (func i32.const 0 f64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop)\n  (func i32.const 0 f64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop)\n\n  ;; Mismatch second value operand.\n  (func i32.const 0 i32.const 0 f64.const 0 memory.atomic.wait32 drop)\n  (func i32.const 0 i64.const 0 f64.const 0 memory.atomic.wait64 drop)\n  (func i32.const 0 i32.const 0 f32.const 0 i32.atomic.rmw.cmpxchg drop)\n  (func i32.const 0 i64.const 0 f64.const 0 i64.atomic.rmw.cmpxchg drop)\n  (func i32.const 0 i32.const 0 f32.const 0 i32.atomic.rmw8.cmpxchg_u drop)\n  (func i32.const 0 i32.const 0 f32.const 0 i32.atomic.rmw16.cmpxchg_u drop)\n  (func i32.const 0 i64.const 0 f64.const 0 i64.atomic.rmw8.cmpxchg_u drop)\n  (func i32.const 0 i64.const 0 f64.const 0 i64.atomic.rmw16.cmpxchg_u drop)\n  (func i32.const 0 i64.const 0 f64.const 0 i64.atomic.rmw32.cmpxchg_u drop)\n\n  ;; Mismatch result.\n  (func (result f32) i32.const 0 i32.const 0 memory.atomic.notify)\n  (func (result f32) i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32)\n  (func (result f32) i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64)\n  (func (result f32) i32.const 0 i32.atomic.load)\n  (func (result f64) i32.const 0 i64.atomic.load)\n  (func (result f32) i32.const 0 i32.atomic.load8_u)\n  (func (result f32) i32.const 0 i32.atomic.load16_u)\n  (func (result f64) i32.const 0 i64.atomic.load8_u)\n  (func (result f64) i32.const 0 i64.atomic.load16_u)\n  (func (result f64) i32.const 0 i64.atomic.load32_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.add)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.add)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.add_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.add_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.add_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.add_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.add_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.sub)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.sub)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.and)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.and)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.and_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.and_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.and_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.and_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.and_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.or)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.or)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.or_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.or_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.or_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.or_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.or_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.xor)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.xor)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.xchg)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.xchg)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg)\n  (func (result f64) i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg)\n  (func (result f32) i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u)\n  (func (result f32) i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u)\n  (func (result f64) i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u)\n\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-atomic-type-mismatch.txt:9:33: error: type mismatch in memory.atomic.notify, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 memory.atomic.notify drop)\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:10:45: error: type mismatch in memory.atomic.wait32, expected [i32, i32, i64] but got [f32, i32, i64]\n  (func f32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32 drop)\n                                            ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:11:45: error: type mismatch in memory.atomic.wait64, expected [i32, i64, i64] but got [f32, i64, i64]\n  (func f32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64 drop)\n                                            ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:12:21: error: type mismatch in i32.atomic.load, expected [i32] but got [f32]\n  (func f32.const 0 i32.atomic.load drop)\n                    ^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:13:21: error: type mismatch in i64.atomic.load, expected [i32] but got [f32]\n  (func f32.const 0 i64.atomic.load drop)\n                    ^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:14:21: error: type mismatch in i32.atomic.load8_u, expected [i32] but got [f32]\n  (func f32.const 0 i32.atomic.load8_u drop)\n                    ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:15:21: error: type mismatch in i32.atomic.load16_u, expected [i32] but got [f32]\n  (func f32.const 0 i32.atomic.load16_u drop)\n                    ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:16:21: error: type mismatch in i64.atomic.load8_u, expected [i32] but got [f32]\n  (func f32.const 0 i64.atomic.load8_u drop)\n                    ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:17:21: error: type mismatch in i64.atomic.load16_u, expected [i32] but got [f32]\n  (func f32.const 0 i64.atomic.load16_u drop)\n                    ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:18:21: error: type mismatch in i64.atomic.load32_u, expected [i32] but got [f32]\n  (func f32.const 0 i64.atomic.load32_u drop)\n                    ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:19:33: error: type mismatch in i32.atomic.store, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.store)\n                                ^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:20:33: error: type mismatch in i64.atomic.store, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.store)\n                                ^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:21:33: error: type mismatch in i32.atomic.store8, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.store8)\n                                ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:22:33: error: type mismatch in i32.atomic.store16, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.store16)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:23:33: error: type mismatch in i64.atomic.store8, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.store8)\n                                ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:24:33: error: type mismatch in i64.atomic.store16, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.store16)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:25:33: error: type mismatch in i64.atomic.store32, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.store32)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:26:33: error: type mismatch in i32.atomic.rmw.add, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.add drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:27:33: error: type mismatch in i64.atomic.rmw.add, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.add drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:28:33: error: type mismatch in i32.atomic.rmw8.add_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:29:33: error: type mismatch in i32.atomic.rmw16.add_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:30:33: error: type mismatch in i64.atomic.rmw8.add_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:31:33: error: type mismatch in i64.atomic.rmw16.add_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:32:33: error: type mismatch in i64.atomic.rmw32.add_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:33:33: error: type mismatch in i32.atomic.rmw.sub, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.sub drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:34:33: error: type mismatch in i64.atomic.rmw.sub, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.sub drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:35:33: error: type mismatch in i32.atomic.rmw8.sub_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:36:33: error: type mismatch in i32.atomic.rmw16.sub_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:37:33: error: type mismatch in i64.atomic.rmw8.sub_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:38:33: error: type mismatch in i64.atomic.rmw16.sub_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:39:33: error: type mismatch in i64.atomic.rmw32.sub_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:40:33: error: type mismatch in i32.atomic.rmw.and, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.and drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:41:33: error: type mismatch in i64.atomic.rmw.and, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.and drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:42:33: error: type mismatch in i32.atomic.rmw8.and_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:43:33: error: type mismatch in i32.atomic.rmw16.and_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:44:33: error: type mismatch in i64.atomic.rmw8.and_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:45:33: error: type mismatch in i64.atomic.rmw16.and_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:46:33: error: type mismatch in i64.atomic.rmw32.and_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:47:33: error: type mismatch in i32.atomic.rmw.or, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.or drop)\n                                ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:48:33: error: type mismatch in i64.atomic.rmw.or, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.or drop)\n                                ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:49:33: error: type mismatch in i32.atomic.rmw8.or_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:50:33: error: type mismatch in i32.atomic.rmw16.or_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:51:33: error: type mismatch in i64.atomic.rmw8.or_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:52:33: error: type mismatch in i64.atomic.rmw16.or_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:53:33: error: type mismatch in i64.atomic.rmw32.or_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:54:33: error: type mismatch in i32.atomic.rmw.xor, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.xor drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:55:33: error: type mismatch in i64.atomic.rmw.xor, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.xor drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:56:33: error: type mismatch in i32.atomic.rmw8.xor_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:57:33: error: type mismatch in i32.atomic.rmw16.xor_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:58:33: error: type mismatch in i64.atomic.rmw8.xor_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:59:33: error: type mismatch in i64.atomic.rmw16.xor_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:60:33: error: type mismatch in i64.atomic.rmw32.xor_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:61:33: error: type mismatch in i32.atomic.rmw.xchg, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw.xchg drop)\n                                ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:62:33: error: type mismatch in i64.atomic.rmw.xchg, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw.xchg drop)\n                                ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:63:33: error: type mismatch in i32.atomic.rmw8.xchg_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:64:33: error: type mismatch in i32.atomic.rmw16.xchg_u, expected [i32, i32] but got [f32, i32]\n  (func f32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:65:33: error: type mismatch in i64.atomic.rmw8.xchg_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:66:33: error: type mismatch in i64.atomic.rmw16.xchg_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:67:33: error: type mismatch in i64.atomic.rmw32.xchg_u, expected [i32, i64] but got [f32, i64]\n  (func f32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:68:45: error: type mismatch in i32.atomic.rmw.cmpxchg, expected [i32, i32, i32] but got [f32, i32, i32]\n  (func f32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:69:45: error: type mismatch in i64.atomic.rmw.cmpxchg, expected [i32, i64, i64] but got [f32, i64, i64]\n  (func f32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:70:45: error: type mismatch in i32.atomic.rmw8.cmpxchg_u, expected [i32, i32, i32] but got [f32, i32, i32]\n  (func f32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:71:45: error: type mismatch in i32.atomic.rmw16.cmpxchg_u, expected [i32, i32, i32] but got [f32, i32, i32]\n  (func f32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:72:45: error: type mismatch in i64.atomic.rmw8.cmpxchg_u, expected [i32, i64, i64] but got [f32, i64, i64]\n  (func f32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:73:45: error: type mismatch in i64.atomic.rmw16.cmpxchg_u, expected [i32, i64, i64] but got [f32, i64, i64]\n  (func f32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:74:45: error: type mismatch in i64.atomic.rmw32.cmpxchg_u, expected [i32, i64, i64] but got [f32, i64, i64]\n  (func f32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:77:33: error: type mismatch in memory.atomic.notify, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 memory.atomic.notify drop)\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:78:45: error: type mismatch in memory.atomic.wait32, expected [i32, i32, i64] but got [i32, f32, i64]\n  (func i32.const 0 f32.const 0 i64.const 0 memory.atomic.wait32 drop)\n                                            ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:79:45: error: type mismatch in memory.atomic.wait64, expected [i32, i64, i64] but got [i32, f64, i64]\n  (func i32.const 0 f64.const 0 i64.const 0 memory.atomic.wait64 drop)\n                                            ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:80:33: error: type mismatch in i32.atomic.store, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.store)\n                                ^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:81:33: error: type mismatch in i64.atomic.store, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.store)\n                                ^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:82:33: error: type mismatch in i32.atomic.store8, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.store8)\n                                ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:83:33: error: type mismatch in i32.atomic.store16, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.store16)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:84:33: error: type mismatch in i64.atomic.store8, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.store8)\n                                ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:85:33: error: type mismatch in i64.atomic.store16, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.store16)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:86:33: error: type mismatch in i64.atomic.store32, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.store32)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:87:33: error: type mismatch in i32.atomic.rmw.add, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.add drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:88:33: error: type mismatch in i64.atomic.rmw.add, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.add drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:89:33: error: type mismatch in i32.atomic.rmw8.add_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:90:33: error: type mismatch in i32.atomic.rmw16.add_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:91:33: error: type mismatch in i64.atomic.rmw8.add_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:92:33: error: type mismatch in i64.atomic.rmw16.add_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:93:33: error: type mismatch in i64.atomic.rmw32.add_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.add_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:94:33: error: type mismatch in i32.atomic.rmw.sub, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.sub drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:95:33: error: type mismatch in i64.atomic.rmw.sub, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.sub drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:96:33: error: type mismatch in i32.atomic.rmw8.sub_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:97:33: error: type mismatch in i32.atomic.rmw16.sub_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:98:33: error: type mismatch in i64.atomic.rmw8.sub_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:99:33: error: type mismatch in i64.atomic.rmw16.sub_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:100:33: error: type mismatch in i64.atomic.rmw32.sub_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.sub_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:101:33: error: type mismatch in i32.atomic.rmw.and, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.and drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:102:33: error: type mismatch in i64.atomic.rmw.and, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.and drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:103:33: error: type mismatch in i32.atomic.rmw8.and_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:104:33: error: type mismatch in i32.atomic.rmw16.and_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:105:33: error: type mismatch in i64.atomic.rmw8.and_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:106:33: error: type mismatch in i64.atomic.rmw16.and_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:107:33: error: type mismatch in i64.atomic.rmw32.and_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.and_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:108:33: error: type mismatch in i32.atomic.rmw.or, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.or drop)\n                                ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:109:33: error: type mismatch in i64.atomic.rmw.or, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.or drop)\n                                ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:110:33: error: type mismatch in i32.atomic.rmw8.or_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:111:33: error: type mismatch in i32.atomic.rmw16.or_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:112:33: error: type mismatch in i64.atomic.rmw8.or_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:113:33: error: type mismatch in i64.atomic.rmw16.or_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:114:33: error: type mismatch in i64.atomic.rmw32.or_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.or_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:115:33: error: type mismatch in i32.atomic.rmw.xor, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.xor drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:116:33: error: type mismatch in i64.atomic.rmw.xor, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.xor drop)\n                                ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:117:33: error: type mismatch in i32.atomic.rmw8.xor_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:118:33: error: type mismatch in i32.atomic.rmw16.xor_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:119:33: error: type mismatch in i64.atomic.rmw8.xor_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:120:33: error: type mismatch in i64.atomic.rmw16.xor_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:121:33: error: type mismatch in i64.atomic.rmw32.xor_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.xor_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:122:33: error: type mismatch in i32.atomic.rmw.xchg, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw.xchg drop)\n                                ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:123:33: error: type mismatch in i64.atomic.rmw.xchg, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw.xchg drop)\n                                ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:124:33: error: type mismatch in i32.atomic.rmw8.xchg_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw8.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:125:33: error: type mismatch in i32.atomic.rmw16.xchg_u, expected [i32, i32] but got [i32, f32]\n  (func i32.const 0 f32.const 0 i32.atomic.rmw16.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:126:33: error: type mismatch in i64.atomic.rmw8.xchg_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw8.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:127:33: error: type mismatch in i64.atomic.rmw16.xchg_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw16.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:128:33: error: type mismatch in i64.atomic.rmw32.xchg_u, expected [i32, i64] but got [i32, f64]\n  (func i32.const 0 f64.const 0 i64.atomic.rmw32.xchg_u drop)\n                                ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:129:45: error: type mismatch in i32.atomic.rmw.cmpxchg, expected [i32, i32, i32] but got [i32, f32, i32]\n  (func i32.const 0 f32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:130:45: error: type mismatch in i64.atomic.rmw.cmpxchg, expected [i32, i64, i64] but got [i32, f64, i64]\n  (func i32.const 0 f64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:131:45: error: type mismatch in i32.atomic.rmw8.cmpxchg_u, expected [i32, i32, i32] but got [i32, f32, i32]\n  (func i32.const 0 f32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:132:45: error: type mismatch in i32.atomic.rmw16.cmpxchg_u, expected [i32, i32, i32] but got [i32, f32, i32]\n  (func i32.const 0 f32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:133:45: error: type mismatch in i64.atomic.rmw8.cmpxchg_u, expected [i32, i64, i64] but got [i32, f64, i64]\n  (func i32.const 0 f64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:134:45: error: type mismatch in i64.atomic.rmw16.cmpxchg_u, expected [i32, i64, i64] but got [i32, f64, i64]\n  (func i32.const 0 f64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:135:45: error: type mismatch in i64.atomic.rmw32.cmpxchg_u, expected [i32, i64, i64] but got [i32, f64, i64]\n  (func i32.const 0 f64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:138:45: error: type mismatch in memory.atomic.wait32, expected [i32, i32, i64] but got [i32, i32, f64]\n  (func i32.const 0 i32.const 0 f64.const 0 memory.atomic.wait32 drop)\n                                            ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:139:45: error: type mismatch in memory.atomic.wait64, expected [i32, i64, i64] but got [i32, i64, f64]\n  (func i32.const 0 i64.const 0 f64.const 0 memory.atomic.wait64 drop)\n                                            ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:140:45: error: type mismatch in i32.atomic.rmw.cmpxchg, expected [i32, i32, i32] but got [i32, i32, f32]\n  (func i32.const 0 i32.const 0 f32.const 0 i32.atomic.rmw.cmpxchg drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:141:45: error: type mismatch in i64.atomic.rmw.cmpxchg, expected [i32, i64, i64] but got [i32, i64, f64]\n  (func i32.const 0 i64.const 0 f64.const 0 i64.atomic.rmw.cmpxchg drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:142:45: error: type mismatch in i32.atomic.rmw8.cmpxchg_u, expected [i32, i32, i32] but got [i32, i32, f32]\n  (func i32.const 0 i32.const 0 f32.const 0 i32.atomic.rmw8.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:143:45: error: type mismatch in i32.atomic.rmw16.cmpxchg_u, expected [i32, i32, i32] but got [i32, i32, f32]\n  (func i32.const 0 i32.const 0 f32.const 0 i32.atomic.rmw16.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:144:45: error: type mismatch in i64.atomic.rmw8.cmpxchg_u, expected [i32, i64, i64] but got [i32, i64, f64]\n  (func i32.const 0 i64.const 0 f64.const 0 i64.atomic.rmw8.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:145:45: error: type mismatch in i64.atomic.rmw16.cmpxchg_u, expected [i32, i64, i64] but got [i32, i64, f64]\n  (func i32.const 0 i64.const 0 f64.const 0 i64.atomic.rmw16.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:146:45: error: type mismatch in i64.atomic.rmw32.cmpxchg_u, expected [i32, i64, i64] but got [i32, i64, f64]\n  (func i32.const 0 i64.const 0 f64.const 0 i64.atomic.rmw32.cmpxchg_u drop)\n                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:149:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 memory.atomic.notify)\n                                             ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:150:58: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i64.const 0 memory.atomic.wait32)\n                                                         ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:151:58: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i64.const 0 i64.const 0 memory.atomic.wait64)\n                                                         ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:152:34: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.atomic.load)\n                                 ^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:153:34: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.atomic.load)\n                                 ^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:154:34: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.atomic.load8_u)\n                                 ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:155:34: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.atomic.load16_u)\n                                 ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:156:34: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.atomic.load8_u)\n                                 ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:157:34: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.atomic.load16_u)\n                                 ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:158:34: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.atomic.load32_u)\n                                 ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:159:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.add)\n                                             ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:160:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.add)\n                                             ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:161:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.add_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:162:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.add_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:163:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.add_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:164:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.add_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:165:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.add_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:166:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.sub)\n                                             ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:167:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.sub)\n                                             ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:168:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.sub_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:169:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.sub_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:170:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.sub_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:171:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.sub_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:172:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.sub_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:173:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.and)\n                                             ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:174:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.and)\n                                             ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:175:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.and_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:176:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.and_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:177:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.and_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:178:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.and_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:179:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.and_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:180:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.or)\n                                             ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:181:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.or)\n                                             ^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:182:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.or_u)\n                                             ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:183:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.or_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:184:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.or_u)\n                                             ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:185:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.or_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:186:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.or_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:187:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.xor)\n                                             ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:188:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.xor)\n                                             ^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:189:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.xor_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:190:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.xor_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:191:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.xor_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:192:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.xor_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:193:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.xor_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:194:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw.xchg)\n                                             ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:195:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw.xchg)\n                                             ^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:196:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw8.xchg_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:197:46: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.atomic.rmw16.xchg_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:198:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw8.xchg_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:199:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw16.xchg_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:200:46: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.atomic.rmw32.xchg_u)\n                                             ^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:201:58: error: type mismatch in implicit return, expected [f32] but got [i32]\n  (func (result f32) i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw.cmpxchg)\n                                                         ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:202:58: error: type mismatch in implicit return, expected [f64] but got [i64]\n  (func (result f64) i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw.cmpxchg)\n                                                         ^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:203:58: error: type mismatch in implicit return, expected [f32] but got [i32]\n...c (result f32) i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw8.cmpxchg_u)\n                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:204:58: error: type mismatch in implicit return, expected [f32] but got [i32]\n... (result f32) i32.const 0 i32.const 0 i32.const 0 i32.atomic.rmw16.cmpxchg_u)\n                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:205:58: error: type mismatch in implicit return, expected [f64] but got [i64]\n...c (result f64) i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw8.cmpxchg_u)\n                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:206:58: error: type mismatch in implicit return, expected [f64] but got [i64]\n... (result f64) i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw16.cmpxchg_u)\n                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-atomic-type-mismatch.txt:207:58: error: type mismatch in implicit return, expected [f64] but got [i64]\n... (result f64) i32.const 0 i64.const 0 i64.const 0 i64.atomic.rmw32.cmpxchg_u)\n                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-binary-type-mismatch-1.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    f32.const 0\n    i32.const 0\n    i32.add  \n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-binary-type-mismatch-1.txt:7:5: error: type mismatch in i32.add, expected [i32, i32] but got [f32, i32]\n    i32.add  \n    ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-binary-type-mismatch-2.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 0\n    f32.const 0\n    i32.add \n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-binary-type-mismatch-2.txt:7:5: error: type mismatch in i32.add, expected [i32, i32] but got [i32, f32]\n    i32.add \n    ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-block-multi-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  ;; too few results\n  (func\n    block (result i32 i32)\n      i32.const 0\n    end\n    return)\n\n  ;; too many results\n  (func\n    block (result i32 i32)\n      i32.const 0\n      i32.const 0\n      i32.const 0\n    end\n    return)\n\n  ;; result type mismatch\n  (func\n    block (result f32 i32)\n      i32.const 0\n      i32.const 1\n    end\n    return)\n\n  ;; too few params\n  (func\n    block (param i32)\n      drop\n    end)\n\n  ;; param type mismatch\n  (func\n    f32.const 0\n    block (param i32)\n      drop\n    end)\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-block-multi-mismatch.txt:8:5: error: type mismatch in block, expected [i32, i32] but got [i32]\n    end\n    ^^^\nout/test/typecheck/bad-block-multi-mismatch.txt:17:5: error: type mismatch at end of block, expected [] but got [i32]\n    end\n    ^^^\nout/test/typecheck/bad-block-multi-mismatch.txt:25:5: error: type mismatch in block, expected [f32, i32] but got [i32, i32]\n    end\n    ^^^\nout/test/typecheck/bad-block-multi-mismatch.txt:30:5: error: type mismatch in block, expected [i32] but got []\n    block (param i32)\n    ^^^^^\nout/test/typecheck/bad-block-multi-mismatch.txt:37:5: error: type mismatch in block, expected [i32] but got [f32]\n    block (param i32)\n    ^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-brtable-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i32)\n    block\n      block\n        f32.const 0\n        br_table 0 1 \n      end\n      i32.const 1\n      return\n    end\n    i32.const 2))\n(;; STDERR ;;;\nout/test/typecheck/bad-brtable-type-mismatch.txt:8:9: error: type mismatch in br_table, expected [i32] but got [f32]\n        br_table 0 1 \n        ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-bulk-memory-invalid-segment.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\n(module\n  (memory 1)\n  (func\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n    data.drop 0\n  )\n\n  (table 1 funcref)\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n    elem.drop 0\n  )\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-bulk-memory-invalid-segment.txt:7:53: error: data_segment variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n                                                    ^\nout/test/typecheck/bad-bulk-memory-invalid-segment.txt:8:15: error: data_segment variable out of range: 0 (max 0)\n    data.drop 0\n              ^\nout/test/typecheck/bad-bulk-memory-invalid-segment.txt:13:52: error: elem_segment variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n                                                   ^\nout/test/typecheck/bad-bulk-memory-invalid-segment.txt:14:15: error: elem_segment variable out of range: 0 (max 0)\n    elem.drop 0\n              ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-bulk-memory-no-memory.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\n(module\n  (func\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n    i32.const 0 i32.const 0 i32.const 0 memory.copy\n    i32.const 0 i32.const 0 i32.const 0 memory.fill\n  )\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-bulk-memory-no-memory.txt:6:41: error: memory variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n                                        ^^^^^^^^^^^\nout/test/typecheck/bad-bulk-memory-no-memory.txt:6:53: error: data_segment variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 memory.init 0\n                                                    ^\nout/test/typecheck/bad-bulk-memory-no-memory.txt:7:41: error: memory variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 memory.copy\n                                        ^^^^^^^^^^^\nout/test/typecheck/bad-bulk-memory-no-memory.txt:7:41: error: memory variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 memory.copy\n                                        ^^^^^^^^^^^\nout/test/typecheck/bad-bulk-memory-no-memory.txt:8:41: error: memory variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 memory.fill\n                                        ^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-bulk-memory-no-table.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\n(module\n  (func\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n    i32.const 0 i32.const 0 i32.const 0 table.copy\n  )\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-bulk-memory-no-table.txt:6:41: error: table variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n                                        ^^^^^^^^^^\nout/test/typecheck/bad-bulk-memory-no-table.txt:6:52: error: elem_segment variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 table.init 0\n                                                   ^\nout/test/typecheck/bad-bulk-memory-no-table.txt:7:41: error: table variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 table.copy\n                                        ^^^^^^^^^^\nout/test/typecheck/bad-bulk-memory-no-table.txt:7:41: error: table variable out of range: 0 (max 0)\n    i32.const 0 i32.const 0 i32.const 0 table.copy\n                                        ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-bulk-memory-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\n(module\n  (memory 1)\n  (data \"a\")\n  (table 1 funcref)\n  (elem funcref 0)\n\n  (func\n    ;; Mismatch first operand.\n    f32.const 0 i32.const 0 i32.const 0 memory.init 0\n    f32.const 0 i32.const 0 i32.const 0 memory.copy\n    f32.const 0 i32.const 0 i32.const 0 memory.fill\n    f32.const 0 i32.const 0 i32.const 0 table.init 0\n    f32.const 0 i32.const 0 i32.const 0 table.copy\n\n    ;; Mismatch second operand.\n    i32.const 0 f32.const 0 i32.const 0 memory.init 0\n    i32.const 0 f32.const 0 i32.const 0 memory.copy\n    i32.const 0 f32.const 0 i32.const 0 memory.fill\n    i32.const 0 f32.const 0 i32.const 0 table.init 0\n    i32.const 0 f32.const 0 i32.const 0 table.copy\n\n    ;; Mismatch third operand.\n    i32.const 0 i32.const 0 i64.const 0 memory.init 0\n    i32.const 0 i32.const 0 i64.const 0 memory.copy\n    i32.const 0 i32.const 0 i64.const 0 memory.fill\n    i32.const 0 i32.const 0 i64.const 0 table.init 0\n    i32.const 0 i32.const 0 i64.const 0 table.copy\n  )\n)\n\n\n(;; STDERR ;;;\nout/test/typecheck/bad-bulk-memory-type-mismatch.txt:8:17: error: unexpected token 0, expected ).\n  (elem funcref 0)\n                ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-call-result-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (import \"foo\" \"bar\" (func $import (result f32)))\n  (func $direct (result i64) (i64.const 0))\n  (type $indirect (func (result i64)))\n  (table funcref (elem $direct))\n\n  (func\n    if\n      call $direct\n    else\n      nop\n    end\n    if\n      call $import\n    else\n      nop\n    end\n    if\n      i32.const 0\n      call_indirect (type $indirect)\n    else\n      nop\n    end))\n(;; STDERR ;;;\nout/test/typecheck/bad-call-result-mismatch.txt:10:5: error: type mismatch in if, expected [i32] but got []\n    if\n    ^^\nout/test/typecheck/bad-call-result-mismatch.txt:11:7: error: type mismatch at end of `if true` branch, expected [] but got [i64]\n      call $direct\n      ^^^^\nout/test/typecheck/bad-call-result-mismatch.txt:15:5: error: type mismatch in if, expected [i32] but got []\n    if\n    ^^\nout/test/typecheck/bad-call-result-mismatch.txt:16:7: error: type mismatch at end of `if true` branch, expected [] but got [f32]\n      call $import\n      ^^^^\nout/test/typecheck/bad-call-result-mismatch.txt:20:5: error: type mismatch in if, expected [i32] but got []\n    if\n    ^^\nout/test/typecheck/bad-call-result-mismatch.txt:22:7: error: type mismatch at end of `if true` branch, expected [] but got [i64]\n      call_indirect (type $indirect)\n      ^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-call-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (param i32 i64)\n    i64.const 0\n    i64.const 0\n    call 0))\n(;; STDERR ;;;\nout/test/typecheck/bad-call-type-mismatch.txt:7:5: error: type mismatch in call, expected [i32, i64] but got [i64, i64]\n    call 0))\n    ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-callimport-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (import \"foo\" \"bar\" (func (param i32)))\n  (func\n    f32.const 0\n    call 0))\n(;; STDERR ;;;\nout/test/typecheck/bad-callimport-type-mismatch.txt:7:5: error: type mismatch in call, expected [i32] but got [f32]\n    call 0))\n    ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-callindirect-func-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (table funcref (elem 0))\n  (type $t (func))\n  (func \n    f32.const 0\n    call_indirect (type $t)))\n(;; STDERR ;;;\nout/test/typecheck/bad-callindirect-func-type-mismatch.txt:8:5: error: type mismatch in call_indirect, expected [i32] but got [f32]\n    call_indirect (type $t)))\n    ^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-callindirect-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (type $t (func (param i32) (result i32)))\n  (func $f (type $t) (i32.const 0))\n  (table funcref (elem $f))\n  (func\n    f32.const 0\n    i32.const 0\n    call_indirect (type $t)\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-callindirect-type-mismatch.txt:10:5: error: type mismatch in call_indirect, expected [i32] but got [f32]\n    call_indirect (type $t)\n    ^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-callref-empty.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n;;; ERROR: 1\n(module\n  (type (func))\n\n  (func (export \"main\")\n    (call_ref 0\n    )\n  )\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-callref-empty.txt:8:6: error: type mismatch in call_ref, expected [(ref null 0)] but got []\n    (call_ref 0\n     ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-callref-int32.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n;;; ERROR: 1\n(module\n  (type $t (func))\n\n  (func (export \"main\") (result i32)\n    (call_ref $t (i32.const 10)\n                 (i32.const 13)\n    )\n  )\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-callref-int32.txt:8:6: error: type mismatch in call_ref, expected [(ref null 0)] but got [... i32]\n    (call_ref $t (i32.const 10)\n     ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-callref-nosubtype.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n;;; ERROR: 1\n(module\n  (func (export \"main\") (param (ref $t1))\n    (call_ref $t2 (i64.const 10)\n                  (local.get 0)\n    )\n  )\n\n  (type $t1 (func (param i32)))\n  (type $t2 (func (param i64)))\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-callref-nosubtype.txt:6:6: error: type mismatch in call_ref, expected [(ref null 1)] but got [... (ref 0)]\n    (call_ref $t2 (i64.const 10)\n     ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-callref-null.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n;;; ERROR: 1\n(module\n  (func (export \"main\") (result i32)\n    (call_ref $t (i32.const 10)\n                 (ref.null func)\n    )\n  )\n\n  (type $t (func))\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-callref-null.txt:6:6: error: type mismatch in call_ref, expected [(ref null 0)] but got [... funcref]\n    (call_ref $t (i32.const 10)\n     ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-callref-wrong-signature.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-function-references\n;;; ERROR: 1\n(module\n  (type $f32-f32 (func (param f32) (result f32)))\n\n  (func $foo (param $f (ref $f32-f32)) (result f32)\n    (f32.const 1.0)\n  )\n\n  (func $mul (param $x f32) (param $y f32) (result f32)\n    (f32.mul (local.get $x)\n             (local.get $y))\n  )\n\n  (func (export \"main\") (result f32)\n    (call $foo (ref.func $mul))\n  )\n\n  (elem declare funcref (ref.func $mul))\n)\n\n(;; STDERR ;;;\nout/test/typecheck/bad-callref-wrong-signature.txt:17:6: error: type mismatch in call, expected [(ref 0)] but got [(ref 2)]\n    (call $foo (ref.func $mul))\n     ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-cast-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    f32.const 0\n    f32.reinterpret_i32\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-cast-type-mismatch.txt:6:5: error: type mismatch in f32.reinterpret_i32, expected [i32] but got [f32]\n    f32.reinterpret_i32\n    ^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-compare-type-mismatch-1.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    f32.const 0\n    i32.const 0\n    i32.eq\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-compare-type-mismatch-1.txt:7:5: error: type mismatch in i32.eq, expected [i32, i32] but got [f32, i32]\n    i32.eq\n    ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-compare-type-mismatch-2.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    f32.const 0\n    i32.const 0\n    f32.lt\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-compare-type-mismatch-2.txt:7:5: error: type mismatch in f32.lt, expected [f32, f32] but got [f32, i32]\n    f32.lt\n    ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-convert-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 0\n    i32.trunc_f32_s \n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-convert-type-mismatch.txt:6:5: error: type mismatch in i32.trunc_f32_s, expected [f32] but got [i32]\n    i32.trunc_f32_s \n    ^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-delegate-depth.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e)\n  (func\n    try\n      block\n        try\n          throw $e\n        delegate 3\n      end\n    catch $e\n    end))\n(;; STDERR ;;;\nout/test/typecheck/bad-delegate-depth.txt:9:9: error: invalid depth: 4 (max 3)\n        try\n        ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-empty-catch-all.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n;;; ERROR: 1\n(module\n  (func (result i32)\n    try (result i32)\n      i32.const 1\n    catch_all\n    end\n  ))\n(;; STDERR ;;;\nout/test/typecheck/bad-empty-catch-all.txt:9:5: error: type mismatch in try catch, expected [i32] but got []\n    end\n    ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-empty-catch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n;;; ERROR: 1\n(module\n  (tag (param i32))\n  (func\n    try\n    catch 0\n    end\n  ))\n(;; STDERR ;;;\nout/test/typecheck/bad-empty-catch.txt:9:5: error: type mismatch at end of try catch, expected [] but got [i32]\n    end\n    ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-expr-if.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i32)\n    i32.const 1\n    i32.const 2\n    if \n      i32.const 3\n      drop\n    end\n    i32.add))\n(;; STDERR ;;;\nout/test/typecheck/bad-expr-if.txt:11:5: error: type mismatch in i32.add, expected [i32, i32] but got [i32]\n    i32.add))\n    ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-function-result-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i32)\n    f32.const 0))\n(;; STDERR ;;;\nout/test/typecheck/bad-function-result-type-mismatch.txt:5:5: error: type mismatch in implicit return, expected [i32] but got [f32]\n    f32.const 0))\n    ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-global-globalget-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (import \"foo\" \"bar\" (global i32))\n  (global f32 (global.get 0)))\n(;; STDERR ;;;\nout/test/typecheck/bad-global-globalget-type-mismatch.txt:5:16: error: type mismatch in initializer expression, expected [f32] but got [i32]\n  (global f32 (global.get 0)))\n               ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-global-no-init-expr.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (global i32)\n  (global (mut f32)))\n(;; STDERR ;;;\nout/test/typecheck/bad-global-no-init-expr.txt:4:4: error: type mismatch in initializer expression, expected [i32] but got []\n  (global i32)\n   ^^^^^^\nout/test/typecheck/bad-global-no-init-expr.txt:5:4: error: type mismatch in initializer expression, expected [f32] but got []\n  (global (mut f32)))\n   ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-global-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (global i32 (f32.const 1)))\n(;; STDERR ;;;\nout/test/typecheck/bad-global-type-mismatch.txt:4:16: error: type mismatch in initializer expression, expected [i32] but got [f32]\n  (global i32 (f32.const 1)))\n               ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-if-condition-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    f32.const 0\n    if (result i32)\n      i32.const 0\n    else\n      i32.const 0\n    end\n    drop)\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-if-condition-type-mismatch.txt:6:5: error: type mismatch in if, expected [i32] but got [f32]\n    if (result i32)\n    ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-if-multi-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  ;; too many results\n  (func\n    i32.const 0\n    if (result i32 i64)\n      i32.const 0\n      i32.const 0\n      i64.const 0\n    else\n      i32.const 0\n      i32.const 0\n      i64.const 0\n    end\n    return)\n\n  ;; too few results\n  (func\n    i32.const 0\n    if (result i32 f64)\n      f64.const 0\n    else\n      f64.const 0\n    end\n    return)\n\n  ;; result type mismatch\n  (func\n    i32.const 0\n    if (result i32 f64)\n      f32.const 0\n      f64.const 0\n    else\n      f32.const 0\n      f64.const 0\n    end\n    return)\n\n  ;; too few params\n  (func\n    i32.const 0\n    if (param i32)\n      drop\n    else\n      drop\n    end)\n\n  ;; param type mismatch\n  (func\n    f32.const 0\n    i32.const 0\n    if (param i32)\n      drop\n    else\n      drop\n    end)\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-if-multi-mismatch.txt:10:7: error: type mismatch at end of `if true` branch, expected [] but got [i32]\n      i64.const 0\n      ^^^^^^^^^\nout/test/typecheck/bad-if-multi-mismatch.txt:15:5: error: type mismatch at end of `if false` branch, expected [] but got [i32]\n    end\n    ^^^\nout/test/typecheck/bad-if-multi-mismatch.txt:22:7: error: type mismatch in `if true` branch, expected [i32, f64] but got [f64]\n      f64.const 0\n      ^^^^^^^^^\nout/test/typecheck/bad-if-multi-mismatch.txt:25:5: error: type mismatch in `if false` branch, expected [i32, f64] but got [f64]\n    end\n    ^^^\nout/test/typecheck/bad-if-multi-mismatch.txt:33:7: error: type mismatch in `if true` branch, expected [i32, f64] but got [f32, f64]\n      f64.const 0\n      ^^^^^^^^^\nout/test/typecheck/bad-if-multi-mismatch.txt:37:5: error: type mismatch in `if false` branch, expected [i32, f64] but got [f32, f64]\n    end\n    ^^^\nout/test/typecheck/bad-if-multi-mismatch.txt:43:5: error: type mismatch in if, expected [i32] but got []\n    if (param i32)\n    ^^\nout/test/typecheck/bad-if-multi-mismatch.txt:53:5: error: type mismatch in if, expected [i32] but got [f32]\n    if (param i32)\n    ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-if-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 0\n    if (result i32)\n      f32.const 0\n    else\n      i32.const 0\n    end\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-if-type-mismatch.txt:7:7: error: type mismatch in `if true` branch, expected [i32] but got [f32]\n      f32.const 0\n      ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-if-value-void.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    block $b\n      i32.const 0\n      if (result f32)\n        nop\n      else\n        f32.const 0\n      end\n      drop\n    end))\n(;; STDERR ;;;\nout/test/typecheck/bad-if-value-void.txt:8:9: error: type mismatch in `if true` branch, expected [f32] but got []\n        nop\n        ^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-invoke-type-mismatch.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module\n  (func (param i32))\n  (export \"foo\" 0))\n(invoke \"foo\" (f32.const 1.5))\n(;; STDERR ;;;\nout/test/typecheck/bad-invoke-type-mismatch.txt:5:17: error: unexpected token 0, expected (.\n  (export \"foo\" 0))\n                ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-load-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (memory 1)\n  (func\n    f32.const 0\n    i32.load\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-load-type-mismatch.txt:7:5: error: type mismatch in i32.load, expected [i32] but got [f32]\n    i32.load\n    ^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-localset-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (local i32)\n    f32.const 0\n    local.set 0))\n(;; STDERR ;;;\nout/test/typecheck/bad-localset-type-mismatch.txt:6:5: error: type mismatch in local.set, expected [i32] but got [f32]\n    local.set 0))\n    ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-loop-multi-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  ;; too few results\n  (func\n    loop (result i32 i32)\n      i32.const 0\n    end\n    return)\n\n  ;; too many results\n  (func\n    loop (result i32 i32)\n      i32.const 0\n      i32.const 0\n      i32.const 0\n    end\n    return)\n\n  ;; result type mismatch\n  (func\n    loop (result f32 i32)\n      i32.const 0\n      i32.const 1\n    end\n    return)\n\n  ;; too few params\n  (func\n    loop (param i32)\n      drop\n    end)\n\n  ;; param type mismatch\n  (func\n    f32.const 0\n    loop (param i32)\n      drop\n    end)\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-loop-multi-mismatch.txt:8:5: error: type mismatch in loop, expected [i32, i32] but got [i32]\n    end\n    ^^^\nout/test/typecheck/bad-loop-multi-mismatch.txt:17:5: error: type mismatch at end of loop, expected [] but got [i32]\n    end\n    ^^^\nout/test/typecheck/bad-loop-multi-mismatch.txt:25:5: error: type mismatch in loop, expected [f32, i32] but got [i32, i32]\n    end\n    ^^^\nout/test/typecheck/bad-loop-multi-mismatch.txt:30:5: error: type mismatch in loop, expected [i32] but got []\n    loop (param i32)\n    ^^^^\nout/test/typecheck/bad-loop-multi-mismatch.txt:37:5: error: type mismatch in loop, expected [i32] but got [f32]\n    loop (param i32)\n    ^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-memory-grow-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (memory 0)\n  (func\n    f32.const 100\n    memory.grow\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-memory-grow-type-mismatch.txt:7:5: error: type mismatch in memory.grow, expected [i32] but got [f32]\n    memory.grow\n    ^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-nested-br.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i32)\n    block $outer\n      block $inner\n        loop\n          i32.const 1\n          if \n            br $outer\n          end\n          br $inner\n        end\n      end\n      i32.const 2\n      return\n    end\n    ;; the existence of the (br $outer) statement requires there to be a\n    ;; return statement here, or a value returned from (br $outer).\n  ))\n(;; STDERR ;;;\nout/test/typecheck/bad-nested-br.txt:5:5: error: type mismatch in implicit return, expected [i32] but got []\n    block $outer\n    ^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-no-shared-memory.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module (memory 1 1 shared))\n(;; STDERR ;;;\nout/test/typecheck/bad-no-shared-memory.txt:3:10: error: memories may not be shared\n(module (memory 1 1 shared))\n         ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-reference-types-no-table.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n\n(module\n  (func\n    i32.const 0\n    i32.const 0\n    table.get $t\n    table.set $t\n  )\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-reference-types-no-table.txt:8:15: error: undefined table variable \"$t\"\n    table.get $t\n              ^^\nout/test/typecheck/bad-reference-types-no-table.txt:9:15: error: undefined table variable \"$t\"\n    table.set $t\n              ^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-rethrow-depth.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e)\n  (func\n    try $l1\n      nop\n    catch $e\n      block $l2\n        try $l3\n          nop\n        catch $e\n          try $l4\n            rethrow $l4\n            rethrow 0\n            rethrow $l2\n            rethrow 2\n          catch $e\n            rethrow $l2\n            rethrow 2\n          end\n        end\n      end\n    end)\n  )\n(;; STDERR ;;;\nout/test/typecheck/bad-rethrow-depth.txt:15:13: error: invalid rethrow depth: 0 (catches: 1, 3)\n            rethrow $l4\n            ^^^^^^^\nout/test/typecheck/bad-rethrow-depth.txt:16:13: error: invalid rethrow depth: 0 (catches: 1, 3)\n            rethrow 0\n            ^^^^^^^\nout/test/typecheck/bad-rethrow-depth.txt:17:13: error: invalid rethrow depth: 2 (catches: 1, 3)\n            rethrow $l2\n            ^^^^^^^\nout/test/typecheck/bad-rethrow-depth.txt:18:13: error: invalid rethrow depth: 2 (catches: 1, 3)\n            rethrow 2\n            ^^^^^^^\nout/test/typecheck/bad-rethrow-depth.txt:20:13: error: invalid rethrow depth: 2 (catches: 0, 1, 3)\n            rethrow $l2\n            ^^^^^^^\nout/test/typecheck/bad-rethrow-depth.txt:21:13: error: invalid rethrow depth: 2 (catches: 0, 1, 3)\n            rethrow 2\n            ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-rethrow-not-in-catch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e)\n  (func\n    block\n      try\n        rethrow 0\n      catch $e\n      end\n    end))\n(;; STDERR ;;;\nout/test/typecheck/bad-rethrow-not-in-catch.txt:9:9: error: rethrow not in try catch block\n        rethrow 0\n        ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-return-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i32)\n    f32.const 0\n    return))\n(;; STDERR ;;;\nout/test/typecheck/bad-return-type-mismatch.txt:6:5: error: type mismatch in return, expected [i32] but got [f32]\n    return))\n    ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-returncall-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-tail-call\n;;; ERROR: 1\n(module\n  (func $v_v)\n  (func $i_i (param i32) (result i32) i32.const 0)\n  (func $fff_v (param f32 f32 f32))\n\n  ;; Mismatch on param type.\n  (func (result i32) return_call $i_i)\n  (func (result i32) f32.const 0 return_call $i_i)\n  (func f32.const 0 f32.const 0 return_call $fff_v)\n  (func f32.const 0 f32.const 0 i32.const 0 return_call $fff_v)\n\n  ;; Mismatch on return type.\n  (func (result i32) return_call $v_v)\n  (func i32.const 0 return_call $i_i)\n  (func (result f32) i32.const 0 return_call $i_i)\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-returncall-type-mismatch.txt:10:22: error: type mismatch in return_call, expected [i32] but got []\n  (func (result i32) return_call $i_i)\n                     ^^^^^^^^^^^\nout/test/typecheck/bad-returncall-type-mismatch.txt:11:34: error: type mismatch in return_call, expected [i32] but got [f32]\n  (func (result i32) f32.const 0 return_call $i_i)\n                                 ^^^^^^^^^^^\nout/test/typecheck/bad-returncall-type-mismatch.txt:12:33: error: type mismatch in return_call, expected [f32, f32, f32] but got [f32, f32]\n  (func f32.const 0 f32.const 0 return_call $fff_v)\n                                ^^^^^^^^^^^\nout/test/typecheck/bad-returncall-type-mismatch.txt:13:45: error: type mismatch in return_call, expected [f32, f32, f32] but got [f32, f32, i32]\n  (func f32.const 0 f32.const 0 i32.const 0 return_call $fff_v)\n                                            ^^^^^^^^^^^\nout/test/typecheck/bad-returncall-type-mismatch.txt:16:22: error: return signatures have inconsistent types: expected [i32], got []\n  (func (result i32) return_call $v_v)\n                     ^^^^^^^^^^^\nout/test/typecheck/bad-returncall-type-mismatch.txt:17:21: error: return signatures have inconsistent types: expected [], got [i32]\n  (func i32.const 0 return_call $i_i)\n                    ^^^^^^^^^^^\nout/test/typecheck/bad-returncall-type-mismatch.txt:18:34: error: return signatures have inconsistent types: expected [f32], got [i32]\n  (func (result f32) i32.const 0 return_call $i_i)\n                                 ^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-returncallindirect-no-table.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-tail-call\n;;; ERROR: 1\n(module\n  (type $v_v (func))\n\n  (func\n    i32.const 0\n    return_call_indirect)\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-returncallindirect-no-table.txt:9:5: error: table variable out of range: 0 (max 0)\n    return_call_indirect)\n    ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-returncallindirect-no-table.txt:9:5: error: type mismatch: return_call_indirect must reference table of funcref type\n    return_call_indirect)\n    ^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-returncallindirect-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-tail-call\n;;; ERROR: 1\n(module\n  (table 1 funcref)\n\n  (type $v_v (func))\n  (type $l_l (func (param i64) (result i64)))\n  (type $fff_v (func (param f32 f32 f32)))\n\n  ;; Mismatch on call_indirect key.\n  (func (result i64)\n    f64.const 0\n    f32.const 0\n    return_call_indirect (type $l_l))\n\n  ;; Mismatch on param type.\n  (func (result i64)\n    i32.const 0\n    return_call_indirect (type $l_l))\n\n  (func (result i64)\n    f32.const 0\n    i32.const 0\n    return_call_indirect (type $l_l))\n\n  (func\n    f32.const 0 f32.const 0 i64.const 0\n    i32.const 0\n    return_call_indirect (type $fff_v))\n\n  ;; Mismatch on return type.\n  (func (result i64)\n    i32.const 0\n    return_call_indirect (type $v_v))\n\n  (func\n    i64.const 0\n    i32.const 0\n    return_call_indirect (type $l_l))\n\n  (func (result f32)\n    i64.const 0\n    i32.const 0\n    return_call_indirect (type $l_l))\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-returncallindirect-type-mismatch.txt:15:5: error: type mismatch in return_call_indirect, expected [i32] but got [... f32]\n    return_call_indirect (type $l_l))\n    ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-returncallindirect-type-mismatch.txt:15:5: error: type mismatch in return_call_indirect, expected [i64] but got [f64]\n    return_call_indirect (type $l_l))\n    ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-returncallindirect-type-mismatch.txt:20:5: error: type mismatch in return_call_indirect, expected [i64] but got []\n    return_call_indirect (type $l_l))\n    ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-returncallindirect-type-mismatch.txt:25:5: error: type mismatch in return_call_indirect, expected [i64] but got [f32]\n    return_call_indirect (type $l_l))\n    ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-returncallindirect-type-mismatch.txt:30:5: error: type mismatch in return_call_indirect, expected [f32, f32, f32] but got [f32, f32, i64]\n    return_call_indirect (type $fff_v))\n    ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-returncallindirect-type-mismatch.txt:35:5: error: return signatures have inconsistent types: expected [i64], got []\n    return_call_indirect (type $v_v))\n    ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-returncallindirect-type-mismatch.txt:40:5: error: return signatures have inconsistent types: expected [], got [i64]\n    return_call_indirect (type $l_l))\n    ^^^^^^^^^^^^^^^^^^^^\nout/test/typecheck/bad-returncallindirect-type-mismatch.txt:45:5: error: return signatures have inconsistent types: expected [f32], got [i64]\n    return_call_indirect (type $l_l))\n    ^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-select-cond.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i64)\n    i64.const 0\n    i64.const 0\n    f32.const 0\n    select))\n(;; STDERR ;;;\nout/test/typecheck/bad-select-cond.txt:8:5: error: type mismatch in select, expected [i64, i64, i32] but got [i64, i64, f32]\n    select))\n    ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-select-value0.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 0\n    f64.const 0\n    f32.const 0\n    select\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-select-value0.txt:8:5: error: type mismatch in select, expected [f64, f64, i32] but got [i32, f64, f32]\n    select\n    ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-select-value1.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    i32.const 0\n    i64.const 0\n    f32.const 0\n    select\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-select-value1.txt:8:5: error: type mismatch in select, expected [i64, i64, i32] but got [i32, i64, f32]\n    select\n    ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-simd-lane.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func (result i32) v128.const i32x4 0 0 0 0 i8x16.extract_lane_s 16)\n  (func (result i32) v128.const i32x4 0 0 0 0 i8x16.extract_lane_u 16)\n  (func (result i32) v128.const i32x4 0 0 0 0 i16x8.extract_lane_s 8)\n  (func (result i32) v128.const i32x4 0 0 0 0 i16x8.extract_lane_u 8)\n  (func (result i32) v128.const i32x4 0 0 0 0 i32x4.extract_lane 4)\n  (func (result f32) v128.const i32x4 0 0 0 0 f32x4.extract_lane 4)\n  (func (result f64) v128.const i32x4 0 0 0 0 f64x2.extract_lane 2)\n\n  (func (result v128) v128.const i32x4 0 0 0 0 i32.const 0 i8x16.replace_lane 16)\n  (func (result v128) v128.const i32x4 0 0 0 0 i32.const 0 i16x8.replace_lane 8)\n  (func (result v128) v128.const i32x4 0 0 0 0 i32.const 0 i32x4.replace_lane 4)\n  (func (result v128) v128.const i32x4 0 0 0 0 f32.const 0 f32x4.replace_lane 4)\n  (func (result v128) v128.const i32x4 0 0 0 0 f64.const 0 f64x2.replace_lane 2)\n\n  ;; Test a 64-bit index.\n  (func (result i32) v128.const i32x4 0 0 0 0 i8x16.extract_lane_s 0x100000000)\n)\n(;; STDERR ;;;\nout/test/typecheck/bad-simd-lane.txt:19:47: error: lane index \"0x100000000\" out-of-range [0, 32)\n  (func (result i32) v128.const i32x4 0 0 0 0 i8x16.extract_lane_s 0x100000000)\n                                              ^^^^^^^^^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-store-index-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (memory 1)\n  (func\n    i32.const 0\n    f32.const 0\n    i32.store))\n(;; STDERR ;;;\nout/test/typecheck/bad-store-index-type-mismatch.txt:8:5: error: type mismatch in i32.store, expected [i32, i32] but got [i32, f32]\n    i32.store))\n    ^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-tag-results.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n;;; ERROR: 1\n(module (tag (result i32)))\n(;; STDERR ;;;\nout/test/typecheck/bad-tag-results.txt:4:14: error: Tag signature must have 0 results.\n(module (tag (result i32)))\n             ^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-typed-select-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  ;; The result of typed select (result funcref) should be funcref,\n  ;; so using it where externref is expected should fail.\n  (global (mut externref) (ref.null extern))\n  (func\n    ref.null func\n    ref.null func\n    i32.const 1\n    select (result funcref)\n    global.set 0\n  ))\n(;; STDERR ;;;\nout/test/typecheck/bad-typed-select-type-mismatch.txt:12:5: error: type mismatch in global.set, expected [externref] but got [funcref]\n    global.set 0\n    ^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/bad-unary-type-mismatch.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ERROR: 1\n(module\n  (func\n    f64.const 0x0p+0 (;=0;)\n    f32.neg\n    drop))\n(;; STDERR ;;;\nout/test/typecheck/bad-unary-type-mismatch.txt:6:5: error: type mismatch in f32.neg, expected [f32] but got [f64]\n    f32.neg\n    ^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/br-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  ;; block\n  (func\n    block (result i32 i64)\n      i32.const 1\n      i64.const 2\n      br 0\n    end\n    return)\n\n  ;; loop\n  (func\n    loop (result i32 i64)\n      br 0\n    end\n    return)\n\n  ;; loop w/ param\n  (func\n    i32.const 1\n    loop (param i32)\n      drop         ;; drop loop param\n      i32.const 2  ;; push loop param for br\n      br 0\n    end)\n\n  ;; if\n  (func\n    i32.const 1\n    if (result i32 i64)\n      i32.const 1\n      i64.const 2\n      br 0\n    else\n      i32.const 3\n      i64.const 4\n      br 0\n    end\n    return)\n)\n"
  },
  {
    "path": "test/typecheck/br-table-loop.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n (table 0 funcref)\n (memory $0 17)\n (func $foo (param $0 i32) (result i32)\n  (loop $label$1 (result i32)\n   (block $label$2\n    (br_table $label$1 $label$2 $label$2\n     (local.get $0)\n    )\n    (return\n     (i32.const 0)\n    )\n   )\n   (i32.const 1)\n  )\n )\n)\n"
  },
  {
    "path": "test/typecheck/brif-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  ;; block\n  (func\n    block (result i32 i64)\n      i32.const 1\n      i64.const 2\n      i32.const 0  ;; cond\n      br_if 0\n    end\n    return)\n\n  ;; loop\n  (func\n    loop (result i32 i64)\n      i32.const 0  ;; cond\n      br_if 0\n      i32.const 1\n      i64.const 2\n    end\n    return)\n\n  ;; loop w/ param\n  (func\n    i32.const 1\n    loop (param i32)\n      drop         ;; drop loop param\n      i32.const 2  ;; push loop param for br\n      i32.const 0  ;; cond\n      br_if 0\n      drop         ;; drop `i32.const 2`\n    end)\n\n  ;; if\n  (func\n    i32.const 1\n    if (result i32 i64)\n      i32.const 1\n      i64.const 2\n      i32.const 0  ;; cond\n      br_if 0\n    else\n      i32.const 3\n      i64.const 4\n      i32.const 0  ;; cond\n      br_if 0\n    end\n    return)\n)\n"
  },
  {
    "path": "test/typecheck/brtable-multi.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  ;; block\n  (func\n    block (result f32 f32)\n      block\n        block (result f32 f32)\n          f32.const 1\n          f32.const 2\n          i32.const 0  ;; key\n          br_table 0 2\n        end\n        drop\n        drop\n      end\n      f32.const 3\n      f32.const 4\n    end\n    return)\n\n  ;; loop\n  (func\n    loop (result f32 f32)\n      loop\n        loop (result f32 f32)\n          i32.const 0  ;; key\n          br_table 0 2\n        end\n        drop\n        drop\n      end\n      f32.const 3\n      f32.const 4\n    end\n    return)\n\n  ;; loop w/ param\n  (func\n    i32.const 1\n    loop (param i32)\n      drop  ;; loop param\n      loop\n        i32.const 2\n        loop (param i32)\n          ;; br param is passed through as loop param\n          i32.const 0  ;; key\n          br_table 0 2\n        end\n      end\n    end)\n)\n"
  },
  {
    "path": "test/typecheck/delegate.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e)\n  (func\n    try\n      try\n        try\n          throw $e\n        delegate 0\n      catch $e\n      end\n    catch $e\n    end)\n\n  (func\n    try\n      block\n        try\n          throw $e\n        delegate 1\n      end\n    catch $e\n    end)\n\n  (func\n    try\n      block\n        try\n          throw $e\n        delegate 2\n      end\n    catch $e\n    end))\n"
  },
  {
    "path": "test/typecheck/if-anyref.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (param externref) (result externref)\n    i32.const 0\n    if (result externref)\n      local.get 0\n    else\n      local.get 0\n    end))\n"
  },
  {
    "path": "test/typecheck/if-then-br.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func\n    block\n      i32.const 0\n      if\n        br 0\n      end\n    end))\n"
  },
  {
    "path": "test/typecheck/if-value.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    i32.const 0\n    if (result i32)\n      i32.const 1\n    else\n      i32.const 2\n    end))\n"
  },
  {
    "path": "test/typecheck/label-redefinition.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    block $l1 (result i32)\n      block $l1 (result i32)\n        i32.const 2\n      end\n      block $l1 (result i32)\n        i32.const 3\n        br $l1\n      end\n      i32.add\n    end))\n"
  },
  {
    "path": "test/typecheck/missing-ref.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS*: --enable-function-references\n;;; ERROR: 1\n(module\n  (type $t0 (func (param (ref $first_type))))\n\n  (func $f (param (ref $second_type))\n           (result (ref $third_type))\n    (local (ref $fourth_type))\n  )\n)\n(;; STDERR ;;;\nout/test/typecheck/missing-ref.txt:5:31: error: undefined reference type name $first_type\n  (type $t0 (func (param (ref $first_type))))\n                              ^^^^^^^^^^^\nout/test/typecheck/missing-ref.txt:7:24: error: undefined reference type name $second_type\n  (func $f (param (ref $second_type))\n                       ^^^^^^^^^^^^\nout/test/typecheck/missing-ref.txt:8:25: error: undefined reference type name $third_type\n           (result (ref $third_type))\n                        ^^^^^^^^^^^\nout/test/typecheck/missing-ref.txt:9:17: error: undefined reference type name $fourth_type\n    (local (ref $fourth_type))\n                ^^^^^^^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/typecheck/nested-br.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    block $outer\n      block $inner\n        loop\n          i32.const 1\n          if \n            br $outer\n          end\n          br $inner\n        end\n      end\n      i32.const 2\n      return\n    end\n    i32.const 3\n    return))\n"
  },
  {
    "path": "test/typecheck/nocheck.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --no-check\n(module\n  (func (result i32)\n    nop))  ;;; this is a typecheck error, but succeeds because of --no-check\n"
  },
  {
    "path": "test/typecheck/rethrow.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e)\n  (func\n    try $l1\n      nop\n    catch $e\n      block $l2\n        try $l3\n          nop\n        catch $e\n          try $l4\n            rethrow $l3\n            rethrow 1\n            rethrow $l1\n            rethrow 3\n          catch $e\n            rethrow $l4\n            rethrow 0\n            rethrow $l3\n            rethrow 1\n            rethrow $l1\n            rethrow 3\n          end\n        end\n      end\n    end)\n\n  (func\n    try $l1\n      nop\n    catch_all\n      block $l2\n        try $l3\n          nop\n        catch_all\n          try $l4\n            rethrow $l3\n            rethrow 1\n            rethrow $l1\n            rethrow 3\n          catch_all\n            rethrow $l4\n            rethrow 0\n            rethrow $l3\n            rethrow 1\n            rethrow $l1\n            rethrow 3\n          end\n        end\n      end\n    end)\n  )\n"
  },
  {
    "path": "test/typecheck/return-drop-value-2.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func \n    i32.const 0\n    return))\n"
  },
  {
    "path": "test/typecheck/return-drop-value.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func \n    nop\n    return))\n"
  },
  {
    "path": "test/typecheck/return-value.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  (func (result i32)\n    i32.const 1\n    return\n    i32.const 2\n    i32.add))\n"
  },
  {
    "path": "test/typecheck/try-delegate.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: --enable-exceptions\n(module\n  (tag $e)\n  (func\n    try $l\n      try\n      delegate $l\n    catch $e\n    end)\n\n  (func\n    try $l\n      try\n        try\n        delegate $l\n      catch $e\n      end\n    catch $e\n    end)\n\n  (func\n    block $l\n      try\n      delegate $l\n    end)\n\n  (func\n    try $l\n    catch_all\n      try\n      delegate $l\n    end)\n\n  (func\n    try\n    delegate 0)\n  )\n"
  },
  {
    "path": "test/typecheck/typed-select-result-type.txt",
    "content": ";;; TOOL: wat2wasm\n(module\n  ;; Typed select with funcref should propagate the annotated type,\n  ;; allowing the result to be stored where funcref is expected.\n  (global (mut funcref) (ref.null func))\n  (func\n    ref.null func\n    ref.null func\n    i32.const 1\n    select (result funcref)\n    global.set 0\n  )\n  ;; Typed select with externref should also propagate the type.\n  (func (param externref externref) (result externref)\n    local.get 0\n    local.get 1\n    i32.const 0\n    select (result externref)\n  ))\n"
  },
  {
    "path": "test/update-spec-tests.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport argparse\nimport os\nimport sys\n\nSCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))\nTEST_DIR = SCRIPT_DIR\nREPO_ROOT_DIR = os.path.dirname(SCRIPT_DIR)\nTESTSUITE_DIR = os.path.join(REPO_ROOT_DIR, 'third_party', 'testsuite')\nPROPOSALS_DIR = os.path.join(TESTSUITE_DIR, 'proposals')\nSPEC_TEST_DIR = os.path.join(TEST_DIR, 'spec')\nWASM2C_SPEC_TEST_DIR = os.path.join(TEST_DIR, 'wasm2c', 'spec')\n\n# snapshot of older version of proposals where WABT doesn't support current version\nOLD_PROPOSALS_DIR = os.path.join(REPO_ROOT_DIR, 'test', 'old-spec', 'proposals')\n\noptions = None\n\n\ndef GetFilesWithExtension(src_dir, want_ext):\n    result = set()\n    if os.path.exists(src_dir):\n        for filename in os.listdir(src_dir):\n            name, ext = os.path.splitext(filename)\n            if ext == want_ext:\n                result.add(name)\n    return result\n\n\ndef ProcessDir(wabt_test_dir, testsuite_dir, tool, flags=None):\n    testsuite_tests = GetFilesWithExtension(testsuite_dir, '.wast')\n    wabt_tests = GetFilesWithExtension(wabt_test_dir, '.txt')\n\n    for removed_test_name in wabt_tests - testsuite_tests:\n        test_filename = os.path.join(wabt_test_dir, removed_test_name + '.txt')\n        if options.verbose:\n            print('Removing %s' % test_filename)\n        os.remove(test_filename)\n\n    for added_test_name in testsuite_tests - wabt_tests:\n        wast_filename = os.path.join(\n            os.path.relpath(testsuite_dir, REPO_ROOT_DIR),\n            added_test_name + '.wast')\n        test_filename = os.path.join(wabt_test_dir, added_test_name + '.txt')\n        if options.verbose:\n            print('Adding %s' % test_filename)\n\n        test_dirname = os.path.dirname(test_filename)\n        if not os.path.exists(test_dirname):\n            os.makedirs(test_dirname)\n\n        with open(test_filename, 'w') as f:\n            f.write(';;; TOOL: %s\\n' % tool)\n            f.write(';;; STDIN_FILE: %s\\n' % wast_filename.replace(os.sep, '/'))\n            if flags:\n                f.write(';;; ARGS*: %s\\n' % flags)\n\n\ndef ProcessProposalDir(name, flags=None, old=False):\n    proposals_dir = OLD_PROPOSALS_DIR if old else PROPOSALS_DIR\n    ProcessDir(os.path.join(SPEC_TEST_DIR, name),\n               os.path.join(proposals_dir, name),\n               'run-interp-spec',\n               flags)\n    ProcessDir(os.path.join(WASM2C_SPEC_TEST_DIR, name),\n               os.path.join(proposals_dir, name),\n               'run-spec-wasm2c',\n               flags)\n\n\ndef main(args):\n    parser = argparse.ArgumentParser()\n    parser.add_argument('-v', '--verbose', help='print more diagnotic messages.',\n                        action='store_true')\n    global options\n    options = parser.parse_args(args)\n\n    ProcessDir(SPEC_TEST_DIR, TESTSUITE_DIR, 'run-interp-spec')\n    ProcessDir(WASM2C_SPEC_TEST_DIR, TESTSUITE_DIR, 'run-spec-wasm2c')\n\n    all_proposals = [e.name for e in os.scandir(PROPOSALS_DIR) if e.is_dir()]\n\n    flags = {\n        'multi-memory': '--enable-multi-memory',\n        'exception-handling': '--enable-exceptions',\n        'extended-const': '--enable-extended-const',\n        'tail-call': '--enable-tail-call',\n        'relaxed-simd': '--enable-relaxed-simd',\n        'exception-handling': '--enable-exceptions',\n        'custom-page-sizes': '--enable-custom-page-sizes',\n        'function-references': '--enable-function-references',\n    }\n\n    old_proposal_flags = {\n        'memory64': '--enable-memory64',\n    }\n\n    unimplemented = set([\n        'gc',\n        'threads',\n        'annotations',\n        'wide-arithmetic',\n        'wasm-3.0',\n    ])\n\n    # sanity check to verify that all flags are valid\n    for proposal in flags:\n        assert proposal in all_proposals, proposal\n    # sanity check to verify that all unimplemented are valid\n    for proposal in unimplemented:\n        assert proposal in all_proposals, proposal\n\n    proposals = [p for p in all_proposals if p not in unimplemented]\n    for proposal in proposals:\n        ProcessProposalDir(proposal, flags.get(proposal))\n\n    for proposal in old_proposal_flags:\n        ProcessProposalDir(proposal, old_proposal_flags.get(proposal), True)\n\n    return 0\n\n\nif __name__ == '__main__':\n    sys.exit(main(sys.argv[1:]))\n"
  },
  {
    "path": "test/utils.py",
    "content": "#!/usr/bin/env python3\n#\n# Copyright 2016 WebAssembly Community Group participants\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nimport contextlib\nimport os\nimport json\nimport shutil\nimport shlex\nimport signal\nimport subprocess\nimport sys\nimport tempfile\n\n# Get signal names from numbers in Python\n# http://stackoverflow.com/a/2549950\nSIGNAMES = dict((k, v) for v, k in reversed(sorted(signal.__dict__.items()))\n                if v.startswith('SIG') and not v.startswith('SIG_'))\n\n\nclass Error(Exception):\n    pass\n\n\nclass Executable(object):\n\n    def __init__(self, exe, *after_args, **kwargs):\n        self.exe = exe\n        self.after_args = list(after_args)\n        self.basename = kwargs.get('basename',\n                                   os.path.basename(exe)).replace('.exe', '')\n        self.error_cmdline = kwargs.get('error_cmdline', True)\n        self.stdout_handle = self._ForwardHandle(kwargs.get('forward_stdout'))\n        self.stderr_handle = self._ForwardHandle(kwargs.get('forward_stderr'))\n        self.verbose = False\n\n    def _ForwardHandle(self, forward):\n        return None if forward else subprocess.PIPE\n\n    def _RunWithArgsInternal(self, *args, **kwargs):\n        cmd = [self.exe] + list(args) + self.after_args\n        cmd_str = shlex.join(cmd)\n        if self.verbose:\n            print(cmd_str)\n\n        if self.error_cmdline:\n            err_cmd_str = cmd_str\n        else:\n            err_cmd_str = self.basename\n\n        stdout = ''\n        stderr = ''\n        error = None\n        try:\n            process = subprocess.run(cmd, check=False, text=True,\n                                     stdout=self.stdout_handle,\n                                     stderr=self.stderr_handle, **kwargs)\n            stdout = process.stdout\n            stderr = process.stderr\n            if process.returncode < 0:\n                # Terminated by signal\n                signame = SIGNAMES.get(-process.returncode, '<unknown>')\n                error = Error('Signal raised running \"%s\": %s\\n%s' % (err_cmd_str,\n                              signame, stderr))\n            elif process.returncode > 0:\n                error = Error('Error running \"%s\" (%d):\\n%s\\n%s' % (err_cmd_str, process.returncode, stdout, stderr))\n        except OSError as e:\n            error = Error('Error running \"%s\": %s' % (err_cmd_str, str(e)))\n        return stdout, stderr, error\n\n    def RunWithArgsForStdout(self, *args, **kwargs):\n        stdout, stderr, error = self._RunWithArgsInternal(*args, **kwargs)\n        if error:\n            raise error\n        return stdout\n\n    def RunWithArgs(self, *args, **kwargs):\n        stdout, stderr, error = self._RunWithArgsInternal(*args, **kwargs)\n        if stdout:\n            sys.stdout.write(stdout)\n        if error:\n            raise error\n\n    def AppendArg(self, arg):\n        self.after_args.append(arg)\n\n    def AppendOptionalArgs(self, option_dict):\n        for option, value in option_dict.items():\n            if value:\n                if value is True:\n                    self.AppendArg(option)\n                else:\n                    self.AppendArg('%s=%s' % (option, value))\n\n\n@contextlib.contextmanager\ndef TempDirectory(out_dir, prefix=None):\n    if out_dir:\n        out_dir_is_temp = False\n        if not os.path.exists(out_dir):\n            os.makedirs(out_dir)\n    else:\n        out_dir = tempfile.mkdtemp(prefix=prefix)\n        out_dir_is_temp = True\n\n    try:\n        yield out_dir\n    finally:\n        if out_dir_is_temp:\n            shutil.rmtree(out_dir)\n\n\ndef ChangeExt(path, new_ext):\n    return os.path.splitext(path)[0] + new_ext\n\n\ndef ChangeDir(path, new_dir):\n    return os.path.join(new_dir, os.path.basename(path))\n\n\ndef Hexdump(data):\n    DUMP_OCTETS_PER_LINE = 16\n    DUMP_OCTETS_PER_GROUP = 2\n\n    p = 0\n    end = len(data)\n    lines = []\n    while p < end:\n        line_start = p\n        line_end = p + DUMP_OCTETS_PER_LINE\n        line = '%07x: ' % p\n        while p < line_end:\n            for i in range(DUMP_OCTETS_PER_GROUP):\n                if p < end:\n                    line += '%02x' % data[p]\n                else:\n                    line += '  '\n                p += 1\n            line += ' '\n        line += ' '\n        p = line_start\n        for i in range(DUMP_OCTETS_PER_LINE):\n            if p >= end:\n                break\n            x = data[p]\n            if x >= 32 and x < 0x7f:\n                line += '%c' % x\n            else:\n                line += '.'\n            p += 1\n        line += '\\n'\n        lines.append(line)\n\n    return lines\n\n\ndef GetModuleFilenamesFromSpecJSON(json_filename):\n    with open(json_filename) as json_file:\n        json_data = json.load(json_file)\n    return [m['filename'] for m in json_data['commands'] if 'filename' in m]\n"
  },
  {
    "path": "test/wasi/clock.txt",
    "content": ";;; TOOL: run-interp-wasi\n;;; ARGS: --trace\n;; __WASI_CLOCKID_REALTIME = 0\n\n(import \"wasi_snapshot_preview1\" \"clock_time_get\" (func $clock_time_get (param i32 i64 i32) (result i32)))\n(memory (export \"memory\") 1)\n(data (i32.const 20) \"\\00\\00\\00\\00\\00\\00\\00\\00\")\n\n(func (export \"_start\")\n  (call $clock_time_get (i32.const 0) (i64.const 0) (i32.const 20))\n  drop\n)\n(;; STDOUT ;;;\n#0.    0: V:0  | i32.const 0\n#0.    8: V:1  | i64.const 0\n#0.   20: V:2  | i32.const 20\n#0.   28: V:3  | call_import $0\n>>> running wasi function \"clock_time_get\":\n#0.   36: V:1  | drop\n#0.   40: V:0  | return\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasi/empty.txt",
    "content": ";;; TOOL: run-interp-wasi\n(memory (export \"memory\") 1)\n(func (export \"_start\")\n)\n"
  },
  {
    "path": "test/wasi/exit.txt",
    "content": ";;; TOOL: run-interp-wasi\n;;; ARGS: --trace\n;;; ERROR: 42\n(import \"wasi_snapshot_preview1\" \"proc_exit\" (func $exit (param i32)))\n\n(memory (export \"memory\") 1)\n\n(func (export \"_start\")\n  (call $exit (i32.const 42))\n)\n(;; STDOUT ;;;\n#0.    0: V:0  | i32.const 42\n#0.    8: V:1  | call_import $0\n>>> running wasi function \"proc_exit\":\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasi/oob_trap.txt",
    "content": ";;; TOOL: run-interp-wasi\n;;; ARGS: --trace\n;;; ERROR: 1\n;;\n;; Just like the write_stdout.txt, but with an interior point that is OOB.\n;; Specifically rather than pointing to the `hello` string at address zero,\n;; iovec[0].buf points to memsize - 1 (65536 - 1 = 65535 = 0xffff)\n;;\n\n(import \"wasi_snapshot_preview1\" \"fd_write\" (func $fd_write (param i32 i32 i32 i32) (result i32)))\n(memory (export \"memory\") 1)\n(data (i32.const  0) \"hello\\n\\00\\00\")\n(data (i32.const  8) \"\\08\\00\\00\\00\")\n(data (i32.const 12) \"\\ff\\ff\\00\\00\\06\\00\\00\\00\")\n(data (i32.const 20) \"\\00\\00\\00\\00\")\n\n(func (export \"_start\")\n  (call $fd_write (i32.const 1) (i32.const 12) (i32.const 1) (i32.const 20))\n  drop\n)\n(;; STDERR ;;;\nerror: out of bounds memory access: [65535, 65541) >= max value 65536\n;;; STDERR ;;)\n(;; STDOUT ;;;\n#0.    0: V:0  | i32.const 1\n#0.    8: V:1  | i32.const 12\n#0.   16: V:2  | i32.const 1\n#0.   24: V:3  | i32.const 20\n#0.   32: V:4  | call_import $0\n>>> running wasi function \"fd_write\":\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasi/write_stdout.txt",
    "content": ";;; TOOL: run-interp-wasi\n;;; ARGS: --trace\n;;\n;; For details of fs_write API see:\n;;   https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs.md#fd_write\n;;\n;; It takes 4 args: fd, iovec, iovec_len, out_len\n;;\n;; Data Layout:\n;;\n;; 0-8  : \"hello\\n\\0\\0\"\n;; 8-12 : iovs ptr : 8\n;; 12-20: iovs[0]  : 0, 4\n;; 20-24: bytes written out param\n;;\n\n(import \"wasi_snapshot_preview1\" \"fd_write\" (func $fd_write (param i32 i32 i32 i32) (result i32)))\n(memory (export \"memory\") 1)\n(data (i32.const  0) \"hello\\n\\00\\00\")\n(data (i32.const  8) \"\\08\\00\\00\\00\")\n(data (i32.const 12) \"\\00\\00\\00\\00\\06\\00\\00\\00\")\n(data (i32.const 20) \"\\00\\00\\00\\00\")\n\n(func (export \"_start\")\n  (call $fd_write (i32.const 1) (i32.const 12) (i32.const 1) (i32.const 20))\n  drop\n)\n(;; STDOUT ;;;\nhello\n#0.    0: V:0  | i32.const 1\n#0.    8: V:1  | i32.const 12\n#0.   16: V:2  | i32.const 1\n#0.   24: V:3  | i32.const 20\n#0.   32: V:4  | call_import $0\n>>> running wasi function \"fd_write\":\n#0.   40: V:1  | drop\n#0.   44: V:0  | return\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/add.txt",
    "content": ";;; TOOL: run-wasm2c\n(module\n  (func (export \"add\") (param i32 i32) (result i32)\n        (i32.add (local.get 0) (local.get 1))))\n\n(;; STDOUT ;;;\n/* Automatically generated by wasm2c */\n#ifndef WASM_H_GENERATED_\n#define WASM_H_GENERATED_\n\n#include \"wasm-rt.h\"\n\n#include <stdint.h>\n\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\ntypedef uint8_t u8;\ntypedef int8_t s8;\ntypedef uint16_t u16;\ntypedef int16_t s16;\ntypedef uint32_t u32;\ntypedef int32_t s32;\ntypedef uint64_t u64;\ntypedef int64_t s64;\ntypedef float f32;\ntypedef double f64;\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct w2c_test {\n  char dummy_member;\n} w2c_test;\n\nvoid wasm2c_test_instantiate(w2c_test*);\nvoid wasm2c_test_free(w2c_test*);\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\n/* export: 'add' */\nu32 w2c_test_add(w2c_test*, u32, u32);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  /* WASM_H_GENERATED_ */\n/* Automatically generated by wasm2c */\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#if defined(__MINGW32__)\n#include <malloc.h>\n#elif defined(_MSC_VER)\n#include <intrin.h>\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <stdlib.h>\n#else\n#include <alloca.h>\n#endif\n\n#include \"wasm.h\"\n\n// Computes a pointer to an object of the given size in a little-endian memory.\n//\n// On a little-endian host, this is just &mem->data[addr] - the object's size is\n// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n// is the object's size.\n//\n// Note that mem may be evaluated multiple times.\n//\n// Parameters:\n// mem - The memory.\n// addr - The address.\n// n - The size of the object.\n//\n// Result:\n// A pointer for an object of size n.\n#if WABT_BIG_ENDIAN\n#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n#else\n#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n#endif\n\n// We can only use Segue for this module if it uses a single unshared imported\n// or exported memory\n#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n#else\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n#endif\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n// POSIX uses FS for TLS, GS is free\nstatic inline void* wasm_rt_segue_read_base() {\n  if (wasm_rt_fsgsbase_inst_supported) {\n    return (void*)__builtin_ia32_rdgsbase64();\n  } else {\n    return wasm_rt_syscall_get_segue_base();\n  }\n}\nstatic inline void wasm_rt_segue_write_base(void* base) {\n#if WASM_RT_SEGUE_FREE_SEGMENT\n  if (wasm_rt_last_segment_val == base) {\n    return;\n  }\n\n  wasm_rt_last_segment_val = base;\n#endif\n\n  if (wasm_rt_fsgsbase_inst_supported) {\n    __builtin_ia32_wrgsbase64((uintptr_t)base);\n  } else {\n    wasm_rt_syscall_set_segue_base(base);\n  }\n}\n#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n#else\n#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n#endif\n\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n\n#if WASM_RT_STACK_DEPTH_COUNT\n#define FUNC_PROLOGUE                                            \\\n  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n    TRAP(EXHAUSTION);\n\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n#else\n#define FUNC_PROLOGUE\n\n#define FUNC_EPILOGUE\n#endif\n\n#define UNREACHABLE TRAP(UNREACHABLE)\n\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n                                 const wasm_rt_func_type_t b) {\n  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n}\n\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n  (LIKELY((x) < table.size && table.data[x].func &&      \\\n          func_types_eq(ft, table.data[x].func_type)) || \\\n   TRAP(CALL_INDIRECT))\n\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n#if __has_builtin(__builtin_add_overflow)\n  return __builtin_add_overflow(a, b, resptr);\n#elif defined(_MSC_VER)\n  return _addcarry_u64(0, a, b, resptr);\n#else\n#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n#endif\n}\n\n#define RANGE_CHECK(mem, offset, len)              \\\n  do {                                             \\\n    uint64_t res;                                  \\\n    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n      TRAP(OOB);                                   \\\n    if (UNLIKELY(res > (mem)->size))               \\\n      TRAP(OOB);                                   \\\n  } while (0);\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n#include <stdio.h>\n#define WASM_RT_CHECK_BASE(mem)                                               \\\n  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n    puts(\"Segment register mismatch\\n\");                                      \\\n    abort();                                                                  \\\n  }\n#else\n#define WASM_RT_CHECK_BASE(mem)\n#endif\n\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n// default-page-size, 32-bit memories. It may do nothing at all\n// (if hardware bounds-checking is enabled via guard pages)\n// or it may do a slightly faster RANGE_CHECK.\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n#else\n#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n  WASM_RT_CHECK_BASE(mem);                           \\\n  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n    TRAP(OOB);\n#endif\n\n// MEMCHECK_GENERAL can be used for any memory\n#define MEMCHECK_GENERAL(mem, a, t) \\\n  WASM_RT_CHECK_BASE(mem);          \\\n  RANGE_CHECK(mem, a, sizeof(t));\n\n#ifdef __GNUC__\n#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n// Clang on Mips requires \"f\" constraints on floats\n// See https://github.com/llvm/llvm-project/issues/64241\n#if defined(__clang__) && \\\n    (defined(mips) || defined(__mips__) || defined(__mips))\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n#else\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n#endif\n#else\n#define FORCE_READ_INT(var)\n#define FORCE_READ_FLOAT(var)\n#endif\n\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n  if (!n) {\n    return;\n  }\n#if WABT_BIG_ENDIAN\n  for (size_t i = 0; i < n; i++) {\n    dest[i] = src[n - i - 1];\n  }\n#else\n  wasm_rt_memcpy(dest, src, n);\n#endif\n}\n\n#define LOAD_DATA(m, o, i, s)            \\\n  do {                                   \\\n    RANGE_CHECK((&m), o, s);             \\\n    load_data(MEM_ADDR(&m, o, s), i, s); \\\n  } while (0)\n\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr) {                     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }\n\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1)                                           \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1) {     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1) {                           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }\n\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1, val_type2)                                \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1,       \\\n                                             val_type2 val2) {               \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1, val_type2 val2) {           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }\n\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    t1 result;                                                         \\\n    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n                   sizeof(t1));                                        \\\n    force_read(result);                                                \\\n    return (t3)(t2)result;                                             \\\n  }                                                                    \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n\n#define DEFINE_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      t2 value) {                      \\\n    t1 wrapped = (t1)value;                                            \\\n    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n                   sizeof(t1));                                        \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\nDEFINE_STORE(i32_store, u32, u32)\nDEFINE_STORE(i64_store, u64, u64)\nDEFINE_STORE(f32_store, f32, f32)\nDEFINE_STORE(f64_store, f64, f64)\nDEFINE_STORE(i32_store8, u8, u32)\nDEFINE_STORE(i32_store16, u16, u32)\nDEFINE_STORE(i64_store8, u8, u64)\nDEFINE_STORE(i64_store16, u16, u64)\nDEFINE_STORE(i64_store32, u32, u64)\n\n#if defined(_MSC_VER)\n\n// Adapted from\n// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n\nstatic inline int I64_CLZ(unsigned long long v) {\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  if (_BitScanReverse64(&r, v)) {\n    return 63 - r;\n  }\n#else\n  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n    return 31 - r;\n  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n    return 63 - r;\n  }\n#endif\n  return 64;\n}\n\nstatic inline int I32_CLZ(unsigned long v) {\n  unsigned long r = 0;\n  if (_BitScanReverse(&r, v)) {\n    return 31 - r;\n  }\n  return 32;\n}\n\nstatic inline int I64_CTZ(unsigned long long v) {\n  if (!v) {\n    return 64;\n  }\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  _BitScanForward64(&r, v);\n  return (int)r;\n#else\n  if (_BitScanForward(&r, (unsigned int)(v))) {\n    return (int)(r);\n  }\n\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n  return (int)(r + 32);\n#endif\n}\n\nstatic inline int I32_CTZ(unsigned long v) {\n  if (!v) {\n    return 32;\n  }\n  unsigned long r = 0;\n  _BitScanForward(&r, v);\n  return (int)r;\n}\n\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n  static inline u32 f_n(T x) {                                      \\\n    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n  }\n\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\nPOPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n\n#undef POPCOUNT_DEFINE_PORTABLE\n\n#else\n\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n#define I32_POPCNT(x) (__builtin_popcount(x))\n#define I64_POPCNT(x) (__builtin_popcountll(x))\n\n#endif\n\n#define DIV_S(ut, min, x, y)                                  \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n                                         : (ut)((x) / (y)))\n\n#define REM_S(ut, min, x, y)                                 \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n                                         : (ut)((x) % (y)))\n\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n\n#define DIVREM_U(op, x, y) \\\n  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n#define REM_U(x, y) DIVREM_U(%, x, y)\n\n#define ROTL(x, y, mask) \\\n  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n#define ROTR(x, y, mask) \\\n  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n#define I64_ROTL(x, y) ROTL(x, y, 63)\n#define I32_ROTR(x, y) ROTR(x, y, 31)\n#define I64_ROTR(x, y) ROTR(x, y, 63)\n\n#define FMIN(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n   : (x < y)                          ? x                    \\\n                                      : y)\n\n#define FMAX(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n   : (x > y)                          ? x                    \\\n                                      : y)\n\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                 : (ut)(st)(x))\n\n#define I32_TRUNC_S_F32(x) \\\n  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n#define I64_TRUNC_S_F32(x) \\\n  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n#define I32_TRUNC_S_F64(x) \\\n  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n#define I64_TRUNC_S_F64(x) \\\n  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n\n#define TRUNC_U(ut, ft, max, x)                                              \\\n  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                  : (ut)(x))\n\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))         ? 0                           \\\n   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n                                  : (ut)(st)(x))\n\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F32(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n              INT64_MAX, x)\n#define I32_TRUNC_SAT_S_F64(x)                                        \\\n  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F64(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n              INT64_MAX, x)\n\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))          ? 0    \\\n   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n   : (UNLIKELY(!((x) < (max))))    ? smax \\\n                                   : (ut)(x))\n\n#define I32_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F64(x) \\\n  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n  static inline t2 name(t1 x) {                  \\\n    t2 result;                                   \\\n    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n    return result;                               \\\n  }\n\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\nDEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\nDEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\nDEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n\nstatic float quiet_nanf(float x) {\n  uint32_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 4);\n  tmp |= 0x7fc00000lu;\n  wasm_rt_memcpy(&x, &tmp, 4);\n  return x;\n}\n\nstatic double quiet_nan(double x) {\n  uint64_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 8);\n  tmp |= 0x7ff8000000000000llu;\n  wasm_rt_memcpy(&x, &tmp, 8);\n  return x;\n}\n\nstatic double wasm_quiet(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return x;\n}\n\nstatic float wasm_quietf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return x;\n}\n\nstatic double wasm_floor(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return floor(x);\n}\n\nstatic float wasm_floorf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return floorf(x);\n}\n\nstatic double wasm_ceil(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return ceil(x);\n}\n\nstatic float wasm_ceilf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return ceilf(x);\n}\n\nstatic double wasm_trunc(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return trunc(x);\n}\n\nstatic float wasm_truncf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return truncf(x);\n}\n\nstatic float wasm_nearbyintf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return nearbyintf(x);\n}\n\nstatic double wasm_nearbyint(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return nearbyint(x);\n}\n\nstatic float wasm_fabsf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    uint32_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 4);\n    tmp = tmp & ~(1UL << 31);\n    wasm_rt_memcpy(&x, &tmp, 4);\n    return x;\n  }\n  return fabsf(x);\n}\n\nstatic double wasm_fabs(double x) {\n  if (UNLIKELY(isnan(x))) {\n    uint64_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 8);\n    tmp = tmp & ~(1ULL << 63);\n    wasm_rt_memcpy(&x, &tmp, 8);\n    return x;\n  }\n  return fabs(x);\n}\n\nstatic double wasm_sqrt(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return sqrt(x);\n}\n\nstatic float wasm_sqrtf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return sqrtf(x);\n}\n\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n  RANGE_CHECK(mem, d, n);\n  memset(MEM_ADDR(mem, d, n), val, n);\n}\n\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n                               const wasm_rt_memory_t* src,\n                               u64 dest_addr,\n                               u64 src_addr,\n                               u64 n) {\n  RANGE_CHECK(dest, dest_addr, n);\n  RANGE_CHECK(src, src_addr, n);\n  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n}\n\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n                               const u8* src,\n                               u32 src_size,\n                               u64 dest_addr,\n                               u32 src_addr,\n                               u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n}\n\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n\ntypedef struct {\n  wasm_elem_segment_expr_type_t expr_type;\n  wasm_rt_func_type_t type;\n  wasm_rt_function_ptr_t func;\n  wasm_rt_tailcallee_t func_tailcallee;\n  size_t module_offset;\n} wasm_elem_segment_expr_t;\n\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n                                      const wasm_elem_segment_expr_t* src,\n                                      u32 src_size,\n                                      u64 dest_addr,\n                                      u32 src_addr,\n                                      u32 n,\n                                      void* module_instance) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n    switch (src_expr->expr_type) {\n      case RefFunc:\n        *dest_val = (wasm_rt_funcref_t){\n            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n            (char*)module_instance + src_expr->module_offset};\n        break;\n      case RefNull:\n        *dest_val = wasm_rt_funcref_null_value;\n        break;\n      case GlobalGet:\n        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n                                            src_expr->module_offset);\n        break;\n    }\n  }\n}\n\n// Currently wasm2c only supports initializing externref tables with ref.null.\nstatic inline void externref_table_init(wasm_rt_externref_table_t* dest,\n                                        u32 src_size,\n                                        u64 dest_addr,\n                                        u32 src_addr,\n                                        u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n  }\n}\n\n#define DEFINE_TABLE_COPY(type)                                              \\\n  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n                                       const wasm_rt_##type##_table_t* src,  \\\n                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n    RANGE_CHECK(dest, dest_addr, n);                                         \\\n    RANGE_CHECK(src, src_addr, n);                                           \\\n    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n            n * sizeof(wasm_rt_##type##_t));                                 \\\n  }\n\nDEFINE_TABLE_COPY(funcref)\nDEFINE_TABLE_COPY(externref)\n\n#define DEFINE_TABLE_GET(type)                        \\\n  static inline wasm_rt_##type##_t type##_table_get(  \\\n      const wasm_rt_##type##_table_t* table, u64 i) { \\\n    if (UNLIKELY(i >= table->size))                   \\\n      TRAP(OOB);                                      \\\n    return table->data[i];                            \\\n  }\n\nDEFINE_TABLE_GET(funcref)\nDEFINE_TABLE_GET(externref)\n\n#define DEFINE_TABLE_SET(type)                                               \\\n  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n                                      u64 i, const wasm_rt_##type##_t val) { \\\n    if (UNLIKELY(i >= table->size))                                          \\\n      TRAP(OOB);                                                             \\\n    table->data[i] = val;                                                    \\\n  }\n\nDEFINE_TABLE_SET(funcref)\nDEFINE_TABLE_SET(externref)\n\n#define DEFINE_TABLE_FILL(type)                                               \\\n  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n                                       u64 d, const wasm_rt_##type##_t val,   \\\n                                       u64 n) {                               \\\n    RANGE_CHECK(table, d, n);                                                 \\\n    for (uint32_t i = d; i < d + n; i++) {                                    \\\n      table->data[i] = val;                                                   \\\n    }                                                                         \\\n  }\n\nDEFINE_TABLE_FILL(funcref)\nDEFINE_TABLE_FILL(externref)\n\n#if defined(__GNUC__) || defined(__clang__)\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n#define FUNC_TYPE_EXTERN_T(x) const char* const x\n#define FUNC_TYPE_T(x) static const char* const x\n#else\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n#define FUNC_TYPE_EXTERN_T(x) const char x[]\n#define FUNC_TYPE_T(x) static const char x[]\n#endif\n\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n#define static_assert(X) \\\n  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n#endif\n\n#ifdef _MSC_VER\n#define WEAK_FUNC_DECL(func, fallback)                             \\\n  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n                                                                   \\\n      void                                                         \\\n      fallback(void** instance_ptr, void* tail_call_stack,         \\\n               wasm_rt_tailcallee_t* next)\n#else\n#define WEAK_FUNC_DECL(func, fallback)                                        \\\n  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n                                  wasm_rt_tailcallee_t* next)\n#endif\n\nstatic u32 w2c_test_add_0(w2c_test*, u32, u32);\n\nFUNC_TYPE_T(w2c_test_t0) = \"\\x92\\xfb\\x6a\\xdf\\x49\\x07\\x0a\\x83\\xbe\\x08\\x02\\x68\\xcd\\xf6\\x95\\x27\\x4a\\xc2\\xf3\\xe5\\xe4\\x7d\\x29\\x49\\xe8\\xed\\x42\\x92\\x6a\\x9d\\xda\\xf0\";\n\n/* export: 'add' */\nu32 w2c_test_add(w2c_test* instance, u32 var_p0, u32 var_p1) {\n  u32 ret = w2c_test_add_0(instance, var_p0, var_p1);\n  return ret;\n}\n\nvoid wasm2c_test_instantiate(w2c_test* instance) {\n  assert(wasm_rt_is_initialized());\n}\n\nvoid wasm2c_test_free(w2c_test* instance) {\n}\n\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...) {\n  va_list args;\n  \n  if (param_count == 2 && result_count == 1) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32) {\n      va_end(args);\n      return w2c_test_t0;\n    }\n    va_end(args);\n  }\n  \n  return NULL;\n}\n\nu32 w2c_test_add_0(w2c_test* instance, u32 var_p0, u32 var_p1) {\n  FUNC_PROLOGUE;\n  u32 var_i0, var_i1;\n  var_i0 = var_p0;\n  var_i1 = var_p1;\n  var_i0 += var_i1;\n  FUNC_EPILOGUE;\n  return var_i0;\n}\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/address-overflow.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n(module\n  (memory 1)\n  (func (export \"test\") (param i32)\n    local.get 0\n    i32.load8_u offset=1\n    drop)\n)\n(assert_trap (invoke \"test\" (i32.const -1)) \"out of bounds memory access\")\n(;; STDOUT ;;;\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/bad-enable-feature.txt",
    "content": ";;; RUN: %(wasm2c)s\n;;; ARGS: --enable-gc %(in_file)s\n;;; ERROR: 1\n(;; STDERR ;;;\nwasm2c currently only supports a limited set of features.\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/wasm2c/check-imports.txt",
    "content": ";;; TOOL: run-wasm2c\n(module\n  (type (;0;) (func (param i32) (result i32)))\n  (type (;1;) (func (result i32)))\n  (type (;2;) (func (param i32 i32) (result i32)))\n  (import \"env\" \"__linear_memory\" (memory (;0;) 0))\n  (import \"env\" \"__indirect_function_table\" (table (;0;) 1 funcref))\n  (func $invoke (type 0) (param i32) (result i32)\n    local.get 0\n    call_indirect (type 1))\n  (func $callee (type 1) (result i32)\n    i32.const 16\n    i32.load)\n  (func $main (type 2) (param i32 i32) (result i32)\n    i32.const 1\n    call $invoke)\n  (elem (;0;) (i32.const 1) func $callee))\n\n(;; STDOUT ;;;\n/* Automatically generated by wasm2c */\n#ifndef WASM_H_GENERATED_\n#define WASM_H_GENERATED_\n\n#include \"wasm-rt.h\"\n\n#include <stdint.h>\n\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\ntypedef uint8_t u8;\ntypedef int8_t s8;\ntypedef uint16_t u16;\ntypedef int16_t s16;\ntypedef uint32_t u32;\ntypedef int32_t s32;\ntypedef uint64_t u64;\ntypedef int64_t s64;\ntypedef float f32;\ntypedef double f64;\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct w2c_env;\nextern wasm_rt_funcref_table_t* w2c_env_0x5F_indirect_function_table(struct w2c_env*);\nextern wasm_rt_memory_t* w2c_env_0x5F_linear_memory(struct w2c_env*);\n\ntypedef struct w2c_test {\n  /* import: 'env' '__indirect_function_table' */\n  wasm_rt_funcref_table_t *w2c_env_0x5F_indirect_function_table;\n  /* import: 'env' '__linear_memory' */\n  wasm_rt_memory_t *w2c_env_0x5F_linear_memory;\n} w2c_test;\n\nvoid wasm2c_test_instantiate(w2c_test*, struct w2c_env*);\nvoid wasm2c_test_free(w2c_test*);\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\nextern const u32 wasm2c_test_min_env_0x5F_indirect_function_table;\nextern const u32 wasm2c_test_max_env_0x5F_indirect_function_table;\nextern const u64 wasm2c_test_min_env_0x5F_linear_memory;\nextern const u64 wasm2c_test_max_env_0x5F_linear_memory;\nextern const u8 wasm2c_test_is64_env_0x5F_linear_memory;\nextern const u32 wasm2c_test_pagesize_env_0x5F_linear_memory;\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  /* WASM_H_GENERATED_ */\n/* Automatically generated by wasm2c */\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#if defined(__MINGW32__)\n#include <malloc.h>\n#elif defined(_MSC_VER)\n#include <intrin.h>\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <stdlib.h>\n#else\n#include <alloca.h>\n#endif\n\n#include \"wasm.h\"\n#define IS_SINGLE_UNSHARED_MEMORY 1\n\n// Computes a pointer to an object of the given size in a little-endian memory.\n//\n// On a little-endian host, this is just &mem->data[addr] - the object's size is\n// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n// is the object's size.\n//\n// Note that mem may be evaluated multiple times.\n//\n// Parameters:\n// mem - The memory.\n// addr - The address.\n// n - The size of the object.\n//\n// Result:\n// A pointer for an object of size n.\n#if WABT_BIG_ENDIAN\n#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n#else\n#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n#endif\n\n// We can only use Segue for this module if it uses a single unshared imported\n// or exported memory\n#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n#else\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n#endif\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n// POSIX uses FS for TLS, GS is free\nstatic inline void* wasm_rt_segue_read_base() {\n  if (wasm_rt_fsgsbase_inst_supported) {\n    return (void*)__builtin_ia32_rdgsbase64();\n  } else {\n    return wasm_rt_syscall_get_segue_base();\n  }\n}\nstatic inline void wasm_rt_segue_write_base(void* base) {\n#if WASM_RT_SEGUE_FREE_SEGMENT\n  if (wasm_rt_last_segment_val == base) {\n    return;\n  }\n\n  wasm_rt_last_segment_val = base;\n#endif\n\n  if (wasm_rt_fsgsbase_inst_supported) {\n    __builtin_ia32_wrgsbase64((uintptr_t)base);\n  } else {\n    wasm_rt_syscall_set_segue_base(base);\n  }\n}\n#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n#else\n#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n#endif\n\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n\n#if WASM_RT_STACK_DEPTH_COUNT\n#define FUNC_PROLOGUE                                            \\\n  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n    TRAP(EXHAUSTION);\n\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n#else\n#define FUNC_PROLOGUE\n\n#define FUNC_EPILOGUE\n#endif\n\n#define UNREACHABLE TRAP(UNREACHABLE)\n\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n                                 const wasm_rt_func_type_t b) {\n  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n}\n\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n  (LIKELY((x) < table.size && table.data[x].func &&      \\\n          func_types_eq(ft, table.data[x].func_type)) || \\\n   TRAP(CALL_INDIRECT))\n\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n#if __has_builtin(__builtin_add_overflow)\n  return __builtin_add_overflow(a, b, resptr);\n#elif defined(_MSC_VER)\n  return _addcarry_u64(0, a, b, resptr);\n#else\n#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n#endif\n}\n\n#define RANGE_CHECK(mem, offset, len)              \\\n  do {                                             \\\n    uint64_t res;                                  \\\n    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n      TRAP(OOB);                                   \\\n    if (UNLIKELY(res > (mem)->size))               \\\n      TRAP(OOB);                                   \\\n  } while (0);\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n#include <stdio.h>\n#define WASM_RT_CHECK_BASE(mem)                                               \\\n  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n    puts(\"Segment register mismatch\\n\");                                      \\\n    abort();                                                                  \\\n  }\n#else\n#define WASM_RT_CHECK_BASE(mem)\n#endif\n\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n// default-page-size, 32-bit memories. It may do nothing at all\n// (if hardware bounds-checking is enabled via guard pages)\n// or it may do a slightly faster RANGE_CHECK.\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n#else\n#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n  WASM_RT_CHECK_BASE(mem);                           \\\n  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n    TRAP(OOB);\n#endif\n\n// MEMCHECK_GENERAL can be used for any memory\n#define MEMCHECK_GENERAL(mem, a, t) \\\n  WASM_RT_CHECK_BASE(mem);          \\\n  RANGE_CHECK(mem, a, sizeof(t));\n\n#ifdef __GNUC__\n#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n// Clang on Mips requires \"f\" constraints on floats\n// See https://github.com/llvm/llvm-project/issues/64241\n#if defined(__clang__) && \\\n    (defined(mips) || defined(__mips__) || defined(__mips))\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n#else\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n#endif\n#else\n#define FORCE_READ_INT(var)\n#define FORCE_READ_FLOAT(var)\n#endif\n\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n  if (!n) {\n    return;\n  }\n#if WABT_BIG_ENDIAN\n  for (size_t i = 0; i < n; i++) {\n    dest[i] = src[n - i - 1];\n  }\n#else\n  wasm_rt_memcpy(dest, src, n);\n#endif\n}\n\n#define LOAD_DATA(m, o, i, s)            \\\n  do {                                   \\\n    RANGE_CHECK((&m), o, s);             \\\n    load_data(MEM_ADDR(&m, o, s), i, s); \\\n  } while (0)\n\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr) {                     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }\n\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1)                                           \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1) {     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1) {                           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }\n\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1, val_type2)                                \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1,       \\\n                                             val_type2 val2) {               \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1, val_type2 val2) {           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }\n\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    t1 result;                                                         \\\n    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n                   sizeof(t1));                                        \\\n    force_read(result);                                                \\\n    return (t3)(t2)result;                                             \\\n  }                                                                    \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n\n#define DEFINE_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      t2 value) {                      \\\n    t1 wrapped = (t1)value;                                            \\\n    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n                   sizeof(t1));                                        \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\nDEFINE_STORE(i32_store, u32, u32)\nDEFINE_STORE(i64_store, u64, u64)\nDEFINE_STORE(f32_store, f32, f32)\nDEFINE_STORE(f64_store, f64, f64)\nDEFINE_STORE(i32_store8, u8, u32)\nDEFINE_STORE(i32_store16, u16, u32)\nDEFINE_STORE(i64_store8, u8, u64)\nDEFINE_STORE(i64_store16, u16, u64)\nDEFINE_STORE(i64_store32, u32, u64)\n\n#if defined(_MSC_VER)\n\n// Adapted from\n// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n\nstatic inline int I64_CLZ(unsigned long long v) {\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  if (_BitScanReverse64(&r, v)) {\n    return 63 - r;\n  }\n#else\n  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n    return 31 - r;\n  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n    return 63 - r;\n  }\n#endif\n  return 64;\n}\n\nstatic inline int I32_CLZ(unsigned long v) {\n  unsigned long r = 0;\n  if (_BitScanReverse(&r, v)) {\n    return 31 - r;\n  }\n  return 32;\n}\n\nstatic inline int I64_CTZ(unsigned long long v) {\n  if (!v) {\n    return 64;\n  }\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  _BitScanForward64(&r, v);\n  return (int)r;\n#else\n  if (_BitScanForward(&r, (unsigned int)(v))) {\n    return (int)(r);\n  }\n\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n  return (int)(r + 32);\n#endif\n}\n\nstatic inline int I32_CTZ(unsigned long v) {\n  if (!v) {\n    return 32;\n  }\n  unsigned long r = 0;\n  _BitScanForward(&r, v);\n  return (int)r;\n}\n\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n  static inline u32 f_n(T x) {                                      \\\n    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n  }\n\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\nPOPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n\n#undef POPCOUNT_DEFINE_PORTABLE\n\n#else\n\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n#define I32_POPCNT(x) (__builtin_popcount(x))\n#define I64_POPCNT(x) (__builtin_popcountll(x))\n\n#endif\n\n#define DIV_S(ut, min, x, y)                                  \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n                                         : (ut)((x) / (y)))\n\n#define REM_S(ut, min, x, y)                                 \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n                                         : (ut)((x) % (y)))\n\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n\n#define DIVREM_U(op, x, y) \\\n  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n#define REM_U(x, y) DIVREM_U(%, x, y)\n\n#define ROTL(x, y, mask) \\\n  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n#define ROTR(x, y, mask) \\\n  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n#define I64_ROTL(x, y) ROTL(x, y, 63)\n#define I32_ROTR(x, y) ROTR(x, y, 31)\n#define I64_ROTR(x, y) ROTR(x, y, 63)\n\n#define FMIN(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n   : (x < y)                          ? x                    \\\n                                      : y)\n\n#define FMAX(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n   : (x > y)                          ? x                    \\\n                                      : y)\n\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                 : (ut)(st)(x))\n\n#define I32_TRUNC_S_F32(x) \\\n  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n#define I64_TRUNC_S_F32(x) \\\n  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n#define I32_TRUNC_S_F64(x) \\\n  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n#define I64_TRUNC_S_F64(x) \\\n  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n\n#define TRUNC_U(ut, ft, max, x)                                              \\\n  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                  : (ut)(x))\n\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))         ? 0                           \\\n   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n                                  : (ut)(st)(x))\n\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F32(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n              INT64_MAX, x)\n#define I32_TRUNC_SAT_S_F64(x)                                        \\\n  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F64(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n              INT64_MAX, x)\n\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))          ? 0    \\\n   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n   : (UNLIKELY(!((x) < (max))))    ? smax \\\n                                   : (ut)(x))\n\n#define I32_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F64(x) \\\n  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n  static inline t2 name(t1 x) {                  \\\n    t2 result;                                   \\\n    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n    return result;                               \\\n  }\n\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\nDEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\nDEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\nDEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n\nstatic float quiet_nanf(float x) {\n  uint32_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 4);\n  tmp |= 0x7fc00000lu;\n  wasm_rt_memcpy(&x, &tmp, 4);\n  return x;\n}\n\nstatic double quiet_nan(double x) {\n  uint64_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 8);\n  tmp |= 0x7ff8000000000000llu;\n  wasm_rt_memcpy(&x, &tmp, 8);\n  return x;\n}\n\nstatic double wasm_quiet(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return x;\n}\n\nstatic float wasm_quietf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return x;\n}\n\nstatic double wasm_floor(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return floor(x);\n}\n\nstatic float wasm_floorf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return floorf(x);\n}\n\nstatic double wasm_ceil(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return ceil(x);\n}\n\nstatic float wasm_ceilf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return ceilf(x);\n}\n\nstatic double wasm_trunc(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return trunc(x);\n}\n\nstatic float wasm_truncf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return truncf(x);\n}\n\nstatic float wasm_nearbyintf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return nearbyintf(x);\n}\n\nstatic double wasm_nearbyint(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return nearbyint(x);\n}\n\nstatic float wasm_fabsf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    uint32_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 4);\n    tmp = tmp & ~(1UL << 31);\n    wasm_rt_memcpy(&x, &tmp, 4);\n    return x;\n  }\n  return fabsf(x);\n}\n\nstatic double wasm_fabs(double x) {\n  if (UNLIKELY(isnan(x))) {\n    uint64_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 8);\n    tmp = tmp & ~(1ULL << 63);\n    wasm_rt_memcpy(&x, &tmp, 8);\n    return x;\n  }\n  return fabs(x);\n}\n\nstatic double wasm_sqrt(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return sqrt(x);\n}\n\nstatic float wasm_sqrtf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return sqrtf(x);\n}\n\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n  RANGE_CHECK(mem, d, n);\n  memset(MEM_ADDR(mem, d, n), val, n);\n}\n\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n                               const wasm_rt_memory_t* src,\n                               u64 dest_addr,\n                               u64 src_addr,\n                               u64 n) {\n  RANGE_CHECK(dest, dest_addr, n);\n  RANGE_CHECK(src, src_addr, n);\n  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n}\n\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n                               const u8* src,\n                               u32 src_size,\n                               u64 dest_addr,\n                               u32 src_addr,\n                               u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n}\n\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n\ntypedef struct {\n  wasm_elem_segment_expr_type_t expr_type;\n  wasm_rt_func_type_t type;\n  wasm_rt_function_ptr_t func;\n  wasm_rt_tailcallee_t func_tailcallee;\n  size_t module_offset;\n} wasm_elem_segment_expr_t;\n\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n                                      const wasm_elem_segment_expr_t* src,\n                                      u32 src_size,\n                                      u64 dest_addr,\n                                      u32 src_addr,\n                                      u32 n,\n                                      void* module_instance) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n    switch (src_expr->expr_type) {\n      case RefFunc:\n        *dest_val = (wasm_rt_funcref_t){\n            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n            (char*)module_instance + src_expr->module_offset};\n        break;\n      case RefNull:\n        *dest_val = wasm_rt_funcref_null_value;\n        break;\n      case GlobalGet:\n        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n                                            src_expr->module_offset);\n        break;\n    }\n  }\n}\n\n// Currently wasm2c only supports initializing externref tables with ref.null.\nstatic inline void externref_table_init(wasm_rt_externref_table_t* dest,\n                                        u32 src_size,\n                                        u64 dest_addr,\n                                        u32 src_addr,\n                                        u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n  }\n}\n\n#define DEFINE_TABLE_COPY(type)                                              \\\n  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n                                       const wasm_rt_##type##_table_t* src,  \\\n                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n    RANGE_CHECK(dest, dest_addr, n);                                         \\\n    RANGE_CHECK(src, src_addr, n);                                           \\\n    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n            n * sizeof(wasm_rt_##type##_t));                                 \\\n  }\n\nDEFINE_TABLE_COPY(funcref)\nDEFINE_TABLE_COPY(externref)\n\n#define DEFINE_TABLE_GET(type)                        \\\n  static inline wasm_rt_##type##_t type##_table_get(  \\\n      const wasm_rt_##type##_table_t* table, u64 i) { \\\n    if (UNLIKELY(i >= table->size))                   \\\n      TRAP(OOB);                                      \\\n    return table->data[i];                            \\\n  }\n\nDEFINE_TABLE_GET(funcref)\nDEFINE_TABLE_GET(externref)\n\n#define DEFINE_TABLE_SET(type)                                               \\\n  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n                                      u64 i, const wasm_rt_##type##_t val) { \\\n    if (UNLIKELY(i >= table->size))                                          \\\n      TRAP(OOB);                                                             \\\n    table->data[i] = val;                                                    \\\n  }\n\nDEFINE_TABLE_SET(funcref)\nDEFINE_TABLE_SET(externref)\n\n#define DEFINE_TABLE_FILL(type)                                               \\\n  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n                                       u64 d, const wasm_rt_##type##_t val,   \\\n                                       u64 n) {                               \\\n    RANGE_CHECK(table, d, n);                                                 \\\n    for (uint32_t i = d; i < d + n; i++) {                                    \\\n      table->data[i] = val;                                                   \\\n    }                                                                         \\\n  }\n\nDEFINE_TABLE_FILL(funcref)\nDEFINE_TABLE_FILL(externref)\n\n#if defined(__GNUC__) || defined(__clang__)\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n#define FUNC_TYPE_EXTERN_T(x) const char* const x\n#define FUNC_TYPE_T(x) static const char* const x\n#else\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n#define FUNC_TYPE_EXTERN_T(x) const char x[]\n#define FUNC_TYPE_T(x) static const char x[]\n#endif\n\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n#define static_assert(X) \\\n  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n#endif\n\n#ifdef _MSC_VER\n#define WEAK_FUNC_DECL(func, fallback)                             \\\n  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n                                                                   \\\n      void                                                         \\\n      fallback(void** instance_ptr, void* tail_call_stack,         \\\n               wasm_rt_tailcallee_t* next)\n#else\n#define WEAK_FUNC_DECL(func, fallback)                                        \\\n  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n                                  wasm_rt_tailcallee_t* next)\n#endif\n\nstatic u32 w2c_test_f0(w2c_test*, u32);\nstatic u32 w2c_test_f1(w2c_test*);\nstatic u32 w2c_test_f2(w2c_test*, u32, u32);\n\nFUNC_TYPE_T(w2c_test_t0) = \"\\x07\\x80\\x96\\x7a\\x42\\xf7\\x3e\\xe6\\x70\\x5c\\x2f\\xac\\x83\\xf5\\x67\\xd2\\xa2\\xa0\\x69\\x41\\x5f\\xf8\\xe7\\x96\\x7f\\x23\\xab\\x00\\x03\\x5f\\x4a\\x3c\";\nFUNC_TYPE_T(w2c_test_t1) = \"\\x72\\xab\\x00\\xdf\\x20\\x3d\\xce\\xa1\\xf2\\x29\\xc7\\x9d\\x13\\x40\\x7e\\x98\\xac\\x7d\\x41\\x4a\\x53\\x2e\\x42\\x42\\x61\\x55\\x2e\\xaa\\xeb\\xbe\\xc6\\x35\";\nFUNC_TYPE_T(w2c_test_t2) = \"\\x92\\xfb\\x6a\\xdf\\x49\\x07\\x0a\\x83\\xbe\\x08\\x02\\x68\\xcd\\xf6\\x95\\x27\\x4a\\xc2\\xf3\\xe5\\xe4\\x7d\\x29\\x49\\xe8\\xed\\x42\\x92\\x6a\\x9d\\xda\\xf0\";\n\nstatic u32 wrap_w2c_test_f1(void *instance) {\n  return w2c_test_f1((struct w2c_test*) instance);\n}\n\nstatic void init_memories(w2c_test* instance) {\n}\n\nstatic const wasm_elem_segment_expr_t elem_segment_exprs_w2c_test_e0[] = {\n  {RefFunc, w2c_test_t1, (wasm_rt_function_ptr_t)wrap_w2c_test_f1, {NULL}, 0},\n};\n\nstatic void init_tables(w2c_test* instance) {\n  funcref_table_init(instance->w2c_env_0x5F_indirect_function_table, elem_segment_exprs_w2c_test_e0, 1, 1u, 0, 1, instance);\n}\n\nstatic void init_elem_instances(w2c_test *instance) {\n}\n\nstatic void init_instance_import(w2c_test* instance, struct w2c_env* w2c_env_instance) {\n  instance->w2c_env_0x5F_indirect_function_table = w2c_env_0x5F_indirect_function_table(w2c_env_instance);\n  instance->w2c_env_0x5F_linear_memory = w2c_env_0x5F_linear_memory(w2c_env_instance);\n}\n\nconst u32 wasm2c_test_min_env_0x5F_indirect_function_table = 1;\nconst u32 wasm2c_test_max_env_0x5F_indirect_function_table = 4294967295;\nconst u64 wasm2c_test_min_env_0x5F_linear_memory = 0;\nconst u64 wasm2c_test_max_env_0x5F_linear_memory = 65536;\nconst u8 wasm2c_test_is64_env_0x5F_linear_memory = 0;\nconst u32 wasm2c_test_pagesize_env_0x5F_linear_memory = 65536;\n\nvoid wasm2c_test_instantiate(w2c_test* instance, struct w2c_env* w2c_env_instance) {\n  assert(wasm_rt_is_initialized());\n  init_instance_import(instance, w2c_env_instance);\n  init_tables(instance);\n  init_memories(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base((*instance->w2c_env_0x5F_linear_memory).data);\n#endif\n  init_elem_instances(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\nvoid wasm2c_test_free(w2c_test* instance) {\n}\n\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...) {\n  va_list args;\n  \n  if (param_count == 1 && result_count == 1) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32) {\n      va_end(args);\n      return w2c_test_t0;\n    }\n    va_end(args);\n  }\n  \n  if (param_count == 0 && result_count == 1) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32) {\n      va_end(args);\n      return w2c_test_t1;\n    }\n    va_end(args);\n  }\n  \n  if (param_count == 2 && result_count == 1) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32) {\n      va_end(args);\n      return w2c_test_t2;\n    }\n    va_end(args);\n  }\n  \n  return NULL;\n}\n\nu32 w2c_test_f0(w2c_test* instance, u32 var_p0) {\n  FUNC_PROLOGUE;\n  u32 var_i0;\n  var_i0 = var_p0;\n  var_i0 = CALL_INDIRECT((*instance->w2c_env_0x5F_indirect_function_table), u32 (*)(void*), w2c_test_t1, var_i0, (*instance->w2c_env_0x5F_indirect_function_table).data[var_i0].module_instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n  wasm_rt_segue_write_base((*instance->w2c_env_0x5F_linear_memory).data);\n#endif\n  FUNC_EPILOGUE;\n  return var_i0;\n}\n\nu32 w2c_test_f1(w2c_test* instance) {\n  FUNC_PROLOGUE;\n  u32 var_i0;\n  var_i0 = 16u;\n  var_i0 = i32_load_default32(instance->w2c_env_0x5F_linear_memory, (u64)(var_i0));\n  FUNC_EPILOGUE;\n  return var_i0;\n}\n\nu32 w2c_test_f2(w2c_test* instance, u32 var_p0, u32 var_p1) {\n  FUNC_PROLOGUE;\n  u32 var_i0;\n  var_i0 = 1u;\n  var_i0 = w2c_test_f0(instance, var_i0);\n  FUNC_EPILOGUE;\n  return var_i0;\n}\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/duplicate-names.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS: --debug-names\n(module\n (func $B0 (export \"$B0\") (param $B0 i32)\n       (block\n\t(br 0))))\n\n(assert_return (invoke \"$B0\" (i32.const 5)))\n(;; STDOUT ;;;\n1/1 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/export-names.txt",
    "content": ";;; TOOL: run-wasm2c\n(memory $m (import \"\\\\module\" \"import */\") 0)\n(func $f)\n(export \"\" (func $f))\n(export \"*/\" (func $f))\n(export \"??/\" (func $f))\n(export \"\\0a\" (func $f))\n(export \"❤️\" (func $f))\n(;; STDOUT ;;;\n/* Automatically generated by wasm2c */\n#ifndef WASM_H_GENERATED_\n#define WASM_H_GENERATED_\n\n#include \"wasm-rt.h\"\n\n#include <stdint.h>\n\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\ntypedef uint8_t u8;\ntypedef int8_t s8;\ntypedef uint16_t u16;\ntypedef int16_t s16;\ntypedef uint32_t u32;\ntypedef int32_t s32;\ntypedef uint64_t u64;\ntypedef int64_t s64;\ntypedef float f32;\ntypedef double f64;\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct w2c_0x5Cmodule;\nextern wasm_rt_memory_t* w2c_0x5Cmodule_import0x200x2A0x2F(struct w2c_0x5Cmodule*);\n\ntypedef struct w2c_test {\n  /* import: '\\module' 'import *\\2F' */\n  wasm_rt_memory_t *w2c_0x5Cmodule_import0x200x2A0x2F;\n} w2c_test;\n\nvoid wasm2c_test_instantiate(w2c_test*, struct w2c_0x5Cmodule*);\nvoid wasm2c_test_free(w2c_test*);\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\nextern const u64 wasm2c_test_min_0x5Cmodule_import0x200x2A0x2F;\nextern const u64 wasm2c_test_max_0x5Cmodule_import0x200x2A0x2F;\nextern const u8 wasm2c_test_is64_0x5Cmodule_import0x200x2A0x2F;\nextern const u32 wasm2c_test_pagesize_0x5Cmodule_import0x200x2A0x2F;\n\n/* export: '' */\nvoid w2c_test_(w2c_test*);\n\n/* export: '*\\2F' */\nvoid w2c_test_0x2A0x2F(w2c_test*);\n\n/* export: '\\3F\\3F\\2F' */\nvoid w2c_test_0x3F0x3F0x2F(w2c_test*);\n\n/* export: '\\0A' */\nvoid w2c_test_0x0A(w2c_test*);\n\n/* export: '\\E2\\9D\\A4\\EF\\B8\\8F' */\nvoid w2c_test_0xE20x9D0xA40xEF0xB80x8F(w2c_test*);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  /* WASM_H_GENERATED_ */\n/* Automatically generated by wasm2c */\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#if defined(__MINGW32__)\n#include <malloc.h>\n#elif defined(_MSC_VER)\n#include <intrin.h>\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <stdlib.h>\n#else\n#include <alloca.h>\n#endif\n\n#include \"wasm.h\"\n#define IS_SINGLE_UNSHARED_MEMORY 1\n\n// Computes a pointer to an object of the given size in a little-endian memory.\n//\n// On a little-endian host, this is just &mem->data[addr] - the object's size is\n// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n// is the object's size.\n//\n// Note that mem may be evaluated multiple times.\n//\n// Parameters:\n// mem - The memory.\n// addr - The address.\n// n - The size of the object.\n//\n// Result:\n// A pointer for an object of size n.\n#if WABT_BIG_ENDIAN\n#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n#else\n#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n#endif\n\n// We can only use Segue for this module if it uses a single unshared imported\n// or exported memory\n#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n#else\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n#endif\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n// POSIX uses FS for TLS, GS is free\nstatic inline void* wasm_rt_segue_read_base() {\n  if (wasm_rt_fsgsbase_inst_supported) {\n    return (void*)__builtin_ia32_rdgsbase64();\n  } else {\n    return wasm_rt_syscall_get_segue_base();\n  }\n}\nstatic inline void wasm_rt_segue_write_base(void* base) {\n#if WASM_RT_SEGUE_FREE_SEGMENT\n  if (wasm_rt_last_segment_val == base) {\n    return;\n  }\n\n  wasm_rt_last_segment_val = base;\n#endif\n\n  if (wasm_rt_fsgsbase_inst_supported) {\n    __builtin_ia32_wrgsbase64((uintptr_t)base);\n  } else {\n    wasm_rt_syscall_set_segue_base(base);\n  }\n}\n#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n#else\n#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n#endif\n\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n\n#if WASM_RT_STACK_DEPTH_COUNT\n#define FUNC_PROLOGUE                                            \\\n  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n    TRAP(EXHAUSTION);\n\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n#else\n#define FUNC_PROLOGUE\n\n#define FUNC_EPILOGUE\n#endif\n\n#define UNREACHABLE TRAP(UNREACHABLE)\n\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n                                 const wasm_rt_func_type_t b) {\n  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n}\n\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n  (LIKELY((x) < table.size && table.data[x].func &&      \\\n          func_types_eq(ft, table.data[x].func_type)) || \\\n   TRAP(CALL_INDIRECT))\n\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n#if __has_builtin(__builtin_add_overflow)\n  return __builtin_add_overflow(a, b, resptr);\n#elif defined(_MSC_VER)\n  return _addcarry_u64(0, a, b, resptr);\n#else\n#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n#endif\n}\n\n#define RANGE_CHECK(mem, offset, len)              \\\n  do {                                             \\\n    uint64_t res;                                  \\\n    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n      TRAP(OOB);                                   \\\n    if (UNLIKELY(res > (mem)->size))               \\\n      TRAP(OOB);                                   \\\n  } while (0);\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n#include <stdio.h>\n#define WASM_RT_CHECK_BASE(mem)                                               \\\n  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n    puts(\"Segment register mismatch\\n\");                                      \\\n    abort();                                                                  \\\n  }\n#else\n#define WASM_RT_CHECK_BASE(mem)\n#endif\n\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n// default-page-size, 32-bit memories. It may do nothing at all\n// (if hardware bounds-checking is enabled via guard pages)\n// or it may do a slightly faster RANGE_CHECK.\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n#else\n#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n  WASM_RT_CHECK_BASE(mem);                           \\\n  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n    TRAP(OOB);\n#endif\n\n// MEMCHECK_GENERAL can be used for any memory\n#define MEMCHECK_GENERAL(mem, a, t) \\\n  WASM_RT_CHECK_BASE(mem);          \\\n  RANGE_CHECK(mem, a, sizeof(t));\n\n#ifdef __GNUC__\n#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n// Clang on Mips requires \"f\" constraints on floats\n// See https://github.com/llvm/llvm-project/issues/64241\n#if defined(__clang__) && \\\n    (defined(mips) || defined(__mips__) || defined(__mips))\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n#else\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n#endif\n#else\n#define FORCE_READ_INT(var)\n#define FORCE_READ_FLOAT(var)\n#endif\n\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n  if (!n) {\n    return;\n  }\n#if WABT_BIG_ENDIAN\n  for (size_t i = 0; i < n; i++) {\n    dest[i] = src[n - i - 1];\n  }\n#else\n  wasm_rt_memcpy(dest, src, n);\n#endif\n}\n\n#define LOAD_DATA(m, o, i, s)            \\\n  do {                                   \\\n    RANGE_CHECK((&m), o, s);             \\\n    load_data(MEM_ADDR(&m, o, s), i, s); \\\n  } while (0)\n\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr) {                     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }\n\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1)                                           \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1) {     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1) {                           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }\n\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1, val_type2)                                \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1,       \\\n                                             val_type2 val2) {               \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1, val_type2 val2) {           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }\n\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    t1 result;                                                         \\\n    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n                   sizeof(t1));                                        \\\n    force_read(result);                                                \\\n    return (t3)(t2)result;                                             \\\n  }                                                                    \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n\n#define DEFINE_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      t2 value) {                      \\\n    t1 wrapped = (t1)value;                                            \\\n    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n                   sizeof(t1));                                        \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\nDEFINE_STORE(i32_store, u32, u32)\nDEFINE_STORE(i64_store, u64, u64)\nDEFINE_STORE(f32_store, f32, f32)\nDEFINE_STORE(f64_store, f64, f64)\nDEFINE_STORE(i32_store8, u8, u32)\nDEFINE_STORE(i32_store16, u16, u32)\nDEFINE_STORE(i64_store8, u8, u64)\nDEFINE_STORE(i64_store16, u16, u64)\nDEFINE_STORE(i64_store32, u32, u64)\n\n#if defined(_MSC_VER)\n\n// Adapted from\n// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n\nstatic inline int I64_CLZ(unsigned long long v) {\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  if (_BitScanReverse64(&r, v)) {\n    return 63 - r;\n  }\n#else\n  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n    return 31 - r;\n  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n    return 63 - r;\n  }\n#endif\n  return 64;\n}\n\nstatic inline int I32_CLZ(unsigned long v) {\n  unsigned long r = 0;\n  if (_BitScanReverse(&r, v)) {\n    return 31 - r;\n  }\n  return 32;\n}\n\nstatic inline int I64_CTZ(unsigned long long v) {\n  if (!v) {\n    return 64;\n  }\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  _BitScanForward64(&r, v);\n  return (int)r;\n#else\n  if (_BitScanForward(&r, (unsigned int)(v))) {\n    return (int)(r);\n  }\n\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n  return (int)(r + 32);\n#endif\n}\n\nstatic inline int I32_CTZ(unsigned long v) {\n  if (!v) {\n    return 32;\n  }\n  unsigned long r = 0;\n  _BitScanForward(&r, v);\n  return (int)r;\n}\n\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n  static inline u32 f_n(T x) {                                      \\\n    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n  }\n\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\nPOPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n\n#undef POPCOUNT_DEFINE_PORTABLE\n\n#else\n\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n#define I32_POPCNT(x) (__builtin_popcount(x))\n#define I64_POPCNT(x) (__builtin_popcountll(x))\n\n#endif\n\n#define DIV_S(ut, min, x, y)                                  \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n                                         : (ut)((x) / (y)))\n\n#define REM_S(ut, min, x, y)                                 \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n                                         : (ut)((x) % (y)))\n\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n\n#define DIVREM_U(op, x, y) \\\n  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n#define REM_U(x, y) DIVREM_U(%, x, y)\n\n#define ROTL(x, y, mask) \\\n  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n#define ROTR(x, y, mask) \\\n  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n#define I64_ROTL(x, y) ROTL(x, y, 63)\n#define I32_ROTR(x, y) ROTR(x, y, 31)\n#define I64_ROTR(x, y) ROTR(x, y, 63)\n\n#define FMIN(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n   : (x < y)                          ? x                    \\\n                                      : y)\n\n#define FMAX(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n   : (x > y)                          ? x                    \\\n                                      : y)\n\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                 : (ut)(st)(x))\n\n#define I32_TRUNC_S_F32(x) \\\n  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n#define I64_TRUNC_S_F32(x) \\\n  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n#define I32_TRUNC_S_F64(x) \\\n  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n#define I64_TRUNC_S_F64(x) \\\n  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n\n#define TRUNC_U(ut, ft, max, x)                                              \\\n  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                  : (ut)(x))\n\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))         ? 0                           \\\n   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n                                  : (ut)(st)(x))\n\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F32(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n              INT64_MAX, x)\n#define I32_TRUNC_SAT_S_F64(x)                                        \\\n  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F64(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n              INT64_MAX, x)\n\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))          ? 0    \\\n   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n   : (UNLIKELY(!((x) < (max))))    ? smax \\\n                                   : (ut)(x))\n\n#define I32_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F64(x) \\\n  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n  static inline t2 name(t1 x) {                  \\\n    t2 result;                                   \\\n    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n    return result;                               \\\n  }\n\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\nDEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\nDEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\nDEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n\nstatic float quiet_nanf(float x) {\n  uint32_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 4);\n  tmp |= 0x7fc00000lu;\n  wasm_rt_memcpy(&x, &tmp, 4);\n  return x;\n}\n\nstatic double quiet_nan(double x) {\n  uint64_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 8);\n  tmp |= 0x7ff8000000000000llu;\n  wasm_rt_memcpy(&x, &tmp, 8);\n  return x;\n}\n\nstatic double wasm_quiet(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return x;\n}\n\nstatic float wasm_quietf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return x;\n}\n\nstatic double wasm_floor(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return floor(x);\n}\n\nstatic float wasm_floorf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return floorf(x);\n}\n\nstatic double wasm_ceil(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return ceil(x);\n}\n\nstatic float wasm_ceilf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return ceilf(x);\n}\n\nstatic double wasm_trunc(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return trunc(x);\n}\n\nstatic float wasm_truncf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return truncf(x);\n}\n\nstatic float wasm_nearbyintf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return nearbyintf(x);\n}\n\nstatic double wasm_nearbyint(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return nearbyint(x);\n}\n\nstatic float wasm_fabsf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    uint32_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 4);\n    tmp = tmp & ~(1UL << 31);\n    wasm_rt_memcpy(&x, &tmp, 4);\n    return x;\n  }\n  return fabsf(x);\n}\n\nstatic double wasm_fabs(double x) {\n  if (UNLIKELY(isnan(x))) {\n    uint64_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 8);\n    tmp = tmp & ~(1ULL << 63);\n    wasm_rt_memcpy(&x, &tmp, 8);\n    return x;\n  }\n  return fabs(x);\n}\n\nstatic double wasm_sqrt(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return sqrt(x);\n}\n\nstatic float wasm_sqrtf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return sqrtf(x);\n}\n\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n  RANGE_CHECK(mem, d, n);\n  memset(MEM_ADDR(mem, d, n), val, n);\n}\n\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n                               const wasm_rt_memory_t* src,\n                               u64 dest_addr,\n                               u64 src_addr,\n                               u64 n) {\n  RANGE_CHECK(dest, dest_addr, n);\n  RANGE_CHECK(src, src_addr, n);\n  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n}\n\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n                               const u8* src,\n                               u32 src_size,\n                               u64 dest_addr,\n                               u32 src_addr,\n                               u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n}\n\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n\ntypedef struct {\n  wasm_elem_segment_expr_type_t expr_type;\n  wasm_rt_func_type_t type;\n  wasm_rt_function_ptr_t func;\n  wasm_rt_tailcallee_t func_tailcallee;\n  size_t module_offset;\n} wasm_elem_segment_expr_t;\n\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n                                      const wasm_elem_segment_expr_t* src,\n                                      u32 src_size,\n                                      u64 dest_addr,\n                                      u32 src_addr,\n                                      u32 n,\n                                      void* module_instance) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n    switch (src_expr->expr_type) {\n      case RefFunc:\n        *dest_val = (wasm_rt_funcref_t){\n            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n            (char*)module_instance + src_expr->module_offset};\n        break;\n      case RefNull:\n        *dest_val = wasm_rt_funcref_null_value;\n        break;\n      case GlobalGet:\n        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n                                            src_expr->module_offset);\n        break;\n    }\n  }\n}\n\n// Currently wasm2c only supports initializing externref tables with ref.null.\nstatic inline void externref_table_init(wasm_rt_externref_table_t* dest,\n                                        u32 src_size,\n                                        u64 dest_addr,\n                                        u32 src_addr,\n                                        u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n  }\n}\n\n#define DEFINE_TABLE_COPY(type)                                              \\\n  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n                                       const wasm_rt_##type##_table_t* src,  \\\n                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n    RANGE_CHECK(dest, dest_addr, n);                                         \\\n    RANGE_CHECK(src, src_addr, n);                                           \\\n    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n            n * sizeof(wasm_rt_##type##_t));                                 \\\n  }\n\nDEFINE_TABLE_COPY(funcref)\nDEFINE_TABLE_COPY(externref)\n\n#define DEFINE_TABLE_GET(type)                        \\\n  static inline wasm_rt_##type##_t type##_table_get(  \\\n      const wasm_rt_##type##_table_t* table, u64 i) { \\\n    if (UNLIKELY(i >= table->size))                   \\\n      TRAP(OOB);                                      \\\n    return table->data[i];                            \\\n  }\n\nDEFINE_TABLE_GET(funcref)\nDEFINE_TABLE_GET(externref)\n\n#define DEFINE_TABLE_SET(type)                                               \\\n  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n                                      u64 i, const wasm_rt_##type##_t val) { \\\n    if (UNLIKELY(i >= table->size))                                          \\\n      TRAP(OOB);                                                             \\\n    table->data[i] = val;                                                    \\\n  }\n\nDEFINE_TABLE_SET(funcref)\nDEFINE_TABLE_SET(externref)\n\n#define DEFINE_TABLE_FILL(type)                                               \\\n  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n                                       u64 d, const wasm_rt_##type##_t val,   \\\n                                       u64 n) {                               \\\n    RANGE_CHECK(table, d, n);                                                 \\\n    for (uint32_t i = d; i < d + n; i++) {                                    \\\n      table->data[i] = val;                                                   \\\n    }                                                                         \\\n  }\n\nDEFINE_TABLE_FILL(funcref)\nDEFINE_TABLE_FILL(externref)\n\n#if defined(__GNUC__) || defined(__clang__)\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n#define FUNC_TYPE_EXTERN_T(x) const char* const x\n#define FUNC_TYPE_T(x) static const char* const x\n#else\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n#define FUNC_TYPE_EXTERN_T(x) const char x[]\n#define FUNC_TYPE_T(x) static const char x[]\n#endif\n\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n#define static_assert(X) \\\n  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n#endif\n\n#ifdef _MSC_VER\n#define WEAK_FUNC_DECL(func, fallback)                             \\\n  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n                                                                   \\\n      void                                                         \\\n      fallback(void** instance_ptr, void* tail_call_stack,         \\\n               wasm_rt_tailcallee_t* next)\n#else\n#define WEAK_FUNC_DECL(func, fallback)                                        \\\n  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n                                  wasm_rt_tailcallee_t* next)\n#endif\n\nstatic void w2c_test__0(w2c_test*);\n\nFUNC_TYPE_T(w2c_test_t0) = \"\\x36\\xa9\\xe7\\xf1\\xc9\\x5b\\x82\\xff\\xb9\\x97\\x43\\xe0\\xc5\\xc4\\xce\\x95\\xd8\\x3c\\x9a\\x43\\x0a\\xac\\x59\\xf8\\x4e\\xf3\\xcb\\xfa\\xb6\\x14\\x50\\x68\";\n\nstatic void init_memories(w2c_test* instance) {\n}\n\n/* export: '' */\nvoid w2c_test_(w2c_test* instance) {\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base((*instance->w2c_0x5Cmodule_import0x200x2A0x2F).data);\n#endif\n  w2c_test__0(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\n/* export: '*\\2F' */\nvoid w2c_test_0x2A0x2F(w2c_test* instance) {\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base((*instance->w2c_0x5Cmodule_import0x200x2A0x2F).data);\n#endif\n  w2c_test__0(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\n/* export: '\\3F\\3F\\2F' */\nvoid w2c_test_0x3F0x3F0x2F(w2c_test* instance) {\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base((*instance->w2c_0x5Cmodule_import0x200x2A0x2F).data);\n#endif\n  w2c_test__0(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\n/* export: '\\0A' */\nvoid w2c_test_0x0A(w2c_test* instance) {\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base((*instance->w2c_0x5Cmodule_import0x200x2A0x2F).data);\n#endif\n  w2c_test__0(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\n/* export: '\\E2\\9D\\A4\\EF\\B8\\8F' */\nvoid w2c_test_0xE20x9D0xA40xEF0xB80x8F(w2c_test* instance) {\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base((*instance->w2c_0x5Cmodule_import0x200x2A0x2F).data);\n#endif\n  w2c_test__0(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\nstatic void init_instance_import(w2c_test* instance, struct w2c_0x5Cmodule* w2c_0x5Cmodule_instance) {\n  instance->w2c_0x5Cmodule_import0x200x2A0x2F = w2c_0x5Cmodule_import0x200x2A0x2F(w2c_0x5Cmodule_instance);\n}\n\nconst u64 wasm2c_test_min_0x5Cmodule_import0x200x2A0x2F = 0;\nconst u64 wasm2c_test_max_0x5Cmodule_import0x200x2A0x2F = 65536;\nconst u8 wasm2c_test_is64_0x5Cmodule_import0x200x2A0x2F = 0;\nconst u32 wasm2c_test_pagesize_0x5Cmodule_import0x200x2A0x2F = 65536;\n\nvoid wasm2c_test_instantiate(w2c_test* instance, struct w2c_0x5Cmodule* w2c_0x5Cmodule_instance) {\n  assert(wasm_rt_is_initialized());\n  init_instance_import(instance, w2c_0x5Cmodule_instance);\n  init_memories(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base((*instance->w2c_0x5Cmodule_import0x200x2A0x2F).data);\n#endif\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\nvoid wasm2c_test_free(w2c_test* instance) {\n}\n\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...) {\n  va_list args;\n  \n  if (param_count == 0 && result_count == 0) {\n    va_start(args, result_count);\n    if (true) {\n      va_end(args);\n      return w2c_test_t0;\n    }\n    va_end(args);\n  }\n  \n  return NULL;\n}\n\nvoid w2c_test__0(w2c_test* instance) {\n  FUNC_PROLOGUE;\n  FUNC_EPILOGUE;\n}\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/hello.txt",
    "content": ";;; TOOL: run-wasm2c\n(module\n (type $fd_write_t (func (param i32 i32 i32 i32) (result i32)))\n (import \"wasi_snapshot_preview1\" \"fd_write\" (func $fd_write (type $fd_write_t)))\n (import \"wasi_snapshot_preview1\" \"proc_exit\" (func $proc_exit (param i32)))\n (memory (export \"memory\") 1)\n (data (i32.const 8) \"Hello, world.\\0a\")\n (table funcref (elem $fd_write))\n (func (export \"_start\")\n       ;; the string is already in memory (from the active data segment)\n       ;; step 1: store the string's address and length in memory\n       (i32.store (i32.const 0)        ;; iov_base location in memory\n                  (i32.const 8))       ;; iov_base value\n       (i32.store (i32.const 4)        ;; iov_size location in memory\n                  (i32.const 14))      ;; iov_size value\n       ;; step 2: write the string from memory\n       (call $proc_exit (call_indirect (type $fd_write_t)\n                                       (i32.const 1)     ;; fd\n                                       (i32.const 0)     ;; iovs location in memory\n                                       (i32.const 1)     ;; iovs_len\n                                       (i32.const 0)     ;; retptr0 location in memory\n                                       (i32.const 0))))) ;; fd_write function\n\n(;; STDOUT ;;;\n/* Automatically generated by wasm2c */\n#ifndef WASM_H_GENERATED_\n#define WASM_H_GENERATED_\n\n#include \"wasm-rt.h\"\n\n#include <stdint.h>\n\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\ntypedef uint8_t u8;\ntypedef int8_t s8;\ntypedef uint16_t u16;\ntypedef int16_t s16;\ntypedef uint32_t u32;\ntypedef int32_t s32;\ntypedef uint64_t u64;\ntypedef int64_t s64;\ntypedef float f32;\ntypedef double f64;\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct w2c_wasi__snapshot__preview1;\n\ntypedef struct w2c_test {\n  struct w2c_wasi__snapshot__preview1* w2c_wasi__snapshot__preview1_instance;\n  wasm_rt_memory_t w2c_memory;\n  wasm_rt_funcref_table_t w2c_T0;\n} w2c_test;\n\nvoid wasm2c_test_instantiate(w2c_test*, struct w2c_wasi__snapshot__preview1*);\nvoid wasm2c_test_free(w2c_test*);\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\n/* import: 'wasi_snapshot_preview1' 'fd_write' */\nu32 w2c_wasi__snapshot__preview1_fd_write(struct w2c_wasi__snapshot__preview1*, u32, u32, u32, u32);\n\n/* import: 'wasi_snapshot_preview1' 'proc_exit' */\nvoid w2c_wasi__snapshot__preview1_proc_exit(struct w2c_wasi__snapshot__preview1*, u32);\n\n/* export: 'memory' */\nwasm_rt_memory_t* w2c_test_memory(w2c_test* instance);\n\n/* export: '_start' */\nvoid w2c_test_0x5Fstart(w2c_test*);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  /* WASM_H_GENERATED_ */\n/* Automatically generated by wasm2c */\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#if defined(__MINGW32__)\n#include <malloc.h>\n#elif defined(_MSC_VER)\n#include <intrin.h>\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <stdlib.h>\n#else\n#include <alloca.h>\n#endif\n\n#include \"wasm.h\"\n#define IS_SINGLE_UNSHARED_MEMORY 1\n\n// Computes a pointer to an object of the given size in a little-endian memory.\n//\n// On a little-endian host, this is just &mem->data[addr] - the object's size is\n// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n// is the object's size.\n//\n// Note that mem may be evaluated multiple times.\n//\n// Parameters:\n// mem - The memory.\n// addr - The address.\n// n - The size of the object.\n//\n// Result:\n// A pointer for an object of size n.\n#if WABT_BIG_ENDIAN\n#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n#else\n#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n#endif\n\n// We can only use Segue for this module if it uses a single unshared imported\n// or exported memory\n#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n#else\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n#endif\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n// POSIX uses FS for TLS, GS is free\nstatic inline void* wasm_rt_segue_read_base() {\n  if (wasm_rt_fsgsbase_inst_supported) {\n    return (void*)__builtin_ia32_rdgsbase64();\n  } else {\n    return wasm_rt_syscall_get_segue_base();\n  }\n}\nstatic inline void wasm_rt_segue_write_base(void* base) {\n#if WASM_RT_SEGUE_FREE_SEGMENT\n  if (wasm_rt_last_segment_val == base) {\n    return;\n  }\n\n  wasm_rt_last_segment_val = base;\n#endif\n\n  if (wasm_rt_fsgsbase_inst_supported) {\n    __builtin_ia32_wrgsbase64((uintptr_t)base);\n  } else {\n    wasm_rt_syscall_set_segue_base(base);\n  }\n}\n#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n#else\n#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n#endif\n\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n\n#if WASM_RT_STACK_DEPTH_COUNT\n#define FUNC_PROLOGUE                                            \\\n  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n    TRAP(EXHAUSTION);\n\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n#else\n#define FUNC_PROLOGUE\n\n#define FUNC_EPILOGUE\n#endif\n\n#define UNREACHABLE TRAP(UNREACHABLE)\n\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n                                 const wasm_rt_func_type_t b) {\n  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n}\n\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n  (LIKELY((x) < table.size && table.data[x].func &&      \\\n          func_types_eq(ft, table.data[x].func_type)) || \\\n   TRAP(CALL_INDIRECT))\n\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n#if __has_builtin(__builtin_add_overflow)\n  return __builtin_add_overflow(a, b, resptr);\n#elif defined(_MSC_VER)\n  return _addcarry_u64(0, a, b, resptr);\n#else\n#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n#endif\n}\n\n#define RANGE_CHECK(mem, offset, len)              \\\n  do {                                             \\\n    uint64_t res;                                  \\\n    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n      TRAP(OOB);                                   \\\n    if (UNLIKELY(res > (mem)->size))               \\\n      TRAP(OOB);                                   \\\n  } while (0);\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n#include <stdio.h>\n#define WASM_RT_CHECK_BASE(mem)                                               \\\n  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n    puts(\"Segment register mismatch\\n\");                                      \\\n    abort();                                                                  \\\n  }\n#else\n#define WASM_RT_CHECK_BASE(mem)\n#endif\n\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n// default-page-size, 32-bit memories. It may do nothing at all\n// (if hardware bounds-checking is enabled via guard pages)\n// or it may do a slightly faster RANGE_CHECK.\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n#else\n#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n  WASM_RT_CHECK_BASE(mem);                           \\\n  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n    TRAP(OOB);\n#endif\n\n// MEMCHECK_GENERAL can be used for any memory\n#define MEMCHECK_GENERAL(mem, a, t) \\\n  WASM_RT_CHECK_BASE(mem);          \\\n  RANGE_CHECK(mem, a, sizeof(t));\n\n#ifdef __GNUC__\n#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n// Clang on Mips requires \"f\" constraints on floats\n// See https://github.com/llvm/llvm-project/issues/64241\n#if defined(__clang__) && \\\n    (defined(mips) || defined(__mips__) || defined(__mips))\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n#else\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n#endif\n#else\n#define FORCE_READ_INT(var)\n#define FORCE_READ_FLOAT(var)\n#endif\n\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n  if (!n) {\n    return;\n  }\n#if WABT_BIG_ENDIAN\n  for (size_t i = 0; i < n; i++) {\n    dest[i] = src[n - i - 1];\n  }\n#else\n  wasm_rt_memcpy(dest, src, n);\n#endif\n}\n\n#define LOAD_DATA(m, o, i, s)            \\\n  do {                                   \\\n    RANGE_CHECK((&m), o, s);             \\\n    load_data(MEM_ADDR(&m, o, s), i, s); \\\n  } while (0)\n\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr) {                     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }\n\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1)                                           \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1) {     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1) {                           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }\n\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1, val_type2)                                \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1,       \\\n                                             val_type2 val2) {               \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1, val_type2 val2) {           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }\n\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    t1 result;                                                         \\\n    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n                   sizeof(t1));                                        \\\n    force_read(result);                                                \\\n    return (t3)(t2)result;                                             \\\n  }                                                                    \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n\n#define DEFINE_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      t2 value) {                      \\\n    t1 wrapped = (t1)value;                                            \\\n    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n                   sizeof(t1));                                        \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\nDEFINE_STORE(i32_store, u32, u32)\nDEFINE_STORE(i64_store, u64, u64)\nDEFINE_STORE(f32_store, f32, f32)\nDEFINE_STORE(f64_store, f64, f64)\nDEFINE_STORE(i32_store8, u8, u32)\nDEFINE_STORE(i32_store16, u16, u32)\nDEFINE_STORE(i64_store8, u8, u64)\nDEFINE_STORE(i64_store16, u16, u64)\nDEFINE_STORE(i64_store32, u32, u64)\n\n#if defined(_MSC_VER)\n\n// Adapted from\n// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n\nstatic inline int I64_CLZ(unsigned long long v) {\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  if (_BitScanReverse64(&r, v)) {\n    return 63 - r;\n  }\n#else\n  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n    return 31 - r;\n  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n    return 63 - r;\n  }\n#endif\n  return 64;\n}\n\nstatic inline int I32_CLZ(unsigned long v) {\n  unsigned long r = 0;\n  if (_BitScanReverse(&r, v)) {\n    return 31 - r;\n  }\n  return 32;\n}\n\nstatic inline int I64_CTZ(unsigned long long v) {\n  if (!v) {\n    return 64;\n  }\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  _BitScanForward64(&r, v);\n  return (int)r;\n#else\n  if (_BitScanForward(&r, (unsigned int)(v))) {\n    return (int)(r);\n  }\n\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n  return (int)(r + 32);\n#endif\n}\n\nstatic inline int I32_CTZ(unsigned long v) {\n  if (!v) {\n    return 32;\n  }\n  unsigned long r = 0;\n  _BitScanForward(&r, v);\n  return (int)r;\n}\n\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n  static inline u32 f_n(T x) {                                      \\\n    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n  }\n\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\nPOPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n\n#undef POPCOUNT_DEFINE_PORTABLE\n\n#else\n\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n#define I32_POPCNT(x) (__builtin_popcount(x))\n#define I64_POPCNT(x) (__builtin_popcountll(x))\n\n#endif\n\n#define DIV_S(ut, min, x, y)                                  \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n                                         : (ut)((x) / (y)))\n\n#define REM_S(ut, min, x, y)                                 \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n                                         : (ut)((x) % (y)))\n\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n\n#define DIVREM_U(op, x, y) \\\n  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n#define REM_U(x, y) DIVREM_U(%, x, y)\n\n#define ROTL(x, y, mask) \\\n  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n#define ROTR(x, y, mask) \\\n  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n#define I64_ROTL(x, y) ROTL(x, y, 63)\n#define I32_ROTR(x, y) ROTR(x, y, 31)\n#define I64_ROTR(x, y) ROTR(x, y, 63)\n\n#define FMIN(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n   : (x < y)                          ? x                    \\\n                                      : y)\n\n#define FMAX(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n   : (x > y)                          ? x                    \\\n                                      : y)\n\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                 : (ut)(st)(x))\n\n#define I32_TRUNC_S_F32(x) \\\n  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n#define I64_TRUNC_S_F32(x) \\\n  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n#define I32_TRUNC_S_F64(x) \\\n  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n#define I64_TRUNC_S_F64(x) \\\n  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n\n#define TRUNC_U(ut, ft, max, x)                                              \\\n  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                  : (ut)(x))\n\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))         ? 0                           \\\n   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n                                  : (ut)(st)(x))\n\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F32(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n              INT64_MAX, x)\n#define I32_TRUNC_SAT_S_F64(x)                                        \\\n  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F64(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n              INT64_MAX, x)\n\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))          ? 0    \\\n   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n   : (UNLIKELY(!((x) < (max))))    ? smax \\\n                                   : (ut)(x))\n\n#define I32_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F64(x) \\\n  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n  static inline t2 name(t1 x) {                  \\\n    t2 result;                                   \\\n    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n    return result;                               \\\n  }\n\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\nDEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\nDEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\nDEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n\nstatic float quiet_nanf(float x) {\n  uint32_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 4);\n  tmp |= 0x7fc00000lu;\n  wasm_rt_memcpy(&x, &tmp, 4);\n  return x;\n}\n\nstatic double quiet_nan(double x) {\n  uint64_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 8);\n  tmp |= 0x7ff8000000000000llu;\n  wasm_rt_memcpy(&x, &tmp, 8);\n  return x;\n}\n\nstatic double wasm_quiet(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return x;\n}\n\nstatic float wasm_quietf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return x;\n}\n\nstatic double wasm_floor(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return floor(x);\n}\n\nstatic float wasm_floorf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return floorf(x);\n}\n\nstatic double wasm_ceil(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return ceil(x);\n}\n\nstatic float wasm_ceilf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return ceilf(x);\n}\n\nstatic double wasm_trunc(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return trunc(x);\n}\n\nstatic float wasm_truncf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return truncf(x);\n}\n\nstatic float wasm_nearbyintf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return nearbyintf(x);\n}\n\nstatic double wasm_nearbyint(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return nearbyint(x);\n}\n\nstatic float wasm_fabsf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    uint32_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 4);\n    tmp = tmp & ~(1UL << 31);\n    wasm_rt_memcpy(&x, &tmp, 4);\n    return x;\n  }\n  return fabsf(x);\n}\n\nstatic double wasm_fabs(double x) {\n  if (UNLIKELY(isnan(x))) {\n    uint64_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 8);\n    tmp = tmp & ~(1ULL << 63);\n    wasm_rt_memcpy(&x, &tmp, 8);\n    return x;\n  }\n  return fabs(x);\n}\n\nstatic double wasm_sqrt(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return sqrt(x);\n}\n\nstatic float wasm_sqrtf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return sqrtf(x);\n}\n\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n  RANGE_CHECK(mem, d, n);\n  memset(MEM_ADDR(mem, d, n), val, n);\n}\n\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n                               const wasm_rt_memory_t* src,\n                               u64 dest_addr,\n                               u64 src_addr,\n                               u64 n) {\n  RANGE_CHECK(dest, dest_addr, n);\n  RANGE_CHECK(src, src_addr, n);\n  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n}\n\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n                               const u8* src,\n                               u32 src_size,\n                               u64 dest_addr,\n                               u32 src_addr,\n                               u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n}\n\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n\ntypedef struct {\n  wasm_elem_segment_expr_type_t expr_type;\n  wasm_rt_func_type_t type;\n  wasm_rt_function_ptr_t func;\n  wasm_rt_tailcallee_t func_tailcallee;\n  size_t module_offset;\n} wasm_elem_segment_expr_t;\n\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n                                      const wasm_elem_segment_expr_t* src,\n                                      u32 src_size,\n                                      u64 dest_addr,\n                                      u32 src_addr,\n                                      u32 n,\n                                      void* module_instance) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n    switch (src_expr->expr_type) {\n      case RefFunc:\n        *dest_val = (wasm_rt_funcref_t){\n            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n            (char*)module_instance + src_expr->module_offset};\n        break;\n      case RefNull:\n        *dest_val = wasm_rt_funcref_null_value;\n        break;\n      case GlobalGet:\n        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n                                            src_expr->module_offset);\n        break;\n    }\n  }\n}\n\n// Currently wasm2c only supports initializing externref tables with ref.null.\nstatic inline void externref_table_init(wasm_rt_externref_table_t* dest,\n                                        u32 src_size,\n                                        u64 dest_addr,\n                                        u32 src_addr,\n                                        u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n  }\n}\n\n#define DEFINE_TABLE_COPY(type)                                              \\\n  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n                                       const wasm_rt_##type##_table_t* src,  \\\n                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n    RANGE_CHECK(dest, dest_addr, n);                                         \\\n    RANGE_CHECK(src, src_addr, n);                                           \\\n    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n            n * sizeof(wasm_rt_##type##_t));                                 \\\n  }\n\nDEFINE_TABLE_COPY(funcref)\nDEFINE_TABLE_COPY(externref)\n\n#define DEFINE_TABLE_GET(type)                        \\\n  static inline wasm_rt_##type##_t type##_table_get(  \\\n      const wasm_rt_##type##_table_t* table, u64 i) { \\\n    if (UNLIKELY(i >= table->size))                   \\\n      TRAP(OOB);                                      \\\n    return table->data[i];                            \\\n  }\n\nDEFINE_TABLE_GET(funcref)\nDEFINE_TABLE_GET(externref)\n\n#define DEFINE_TABLE_SET(type)                                               \\\n  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n                                      u64 i, const wasm_rt_##type##_t val) { \\\n    if (UNLIKELY(i >= table->size))                                          \\\n      TRAP(OOB);                                                             \\\n    table->data[i] = val;                                                    \\\n  }\n\nDEFINE_TABLE_SET(funcref)\nDEFINE_TABLE_SET(externref)\n\n#define DEFINE_TABLE_FILL(type)                                               \\\n  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n                                       u64 d, const wasm_rt_##type##_t val,   \\\n                                       u64 n) {                               \\\n    RANGE_CHECK(table, d, n);                                                 \\\n    for (uint32_t i = d; i < d + n; i++) {                                    \\\n      table->data[i] = val;                                                   \\\n    }                                                                         \\\n  }\n\nDEFINE_TABLE_FILL(funcref)\nDEFINE_TABLE_FILL(externref)\n\n#if defined(__GNUC__) || defined(__clang__)\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n#define FUNC_TYPE_EXTERN_T(x) const char* const x\n#define FUNC_TYPE_T(x) static const char* const x\n#else\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n#define FUNC_TYPE_EXTERN_T(x) const char x[]\n#define FUNC_TYPE_T(x) static const char x[]\n#endif\n\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n#define static_assert(X) \\\n  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n#endif\n\n#ifdef _MSC_VER\n#define WEAK_FUNC_DECL(func, fallback)                             \\\n  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n                                                                   \\\n      void                                                         \\\n      fallback(void** instance_ptr, void* tail_call_stack,         \\\n               wasm_rt_tailcallee_t* next)\n#else\n#define WEAK_FUNC_DECL(func, fallback)                                        \\\n  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n                                  wasm_rt_tailcallee_t* next)\n#endif\n\nstatic void w2c_test_0x5Fstart_0(w2c_test*);\n\nFUNC_TYPE_T(w2c_test_t0) = \"\\xf6\\x98\\x1b\\xc6\\x10\\xda\\xb7\\xb2\\x63\\x37\\xcd\\xdc\\x72\\xca\\xe9\\x50\\x00\\x13\\xba\\x10\\x6c\\xde\\x87\\x27\\x10\\xf8\\x86\\x2f\\xe3\\xdb\\x94\\xe4\";\nFUNC_TYPE_T(w2c_test_t1) = \"\\x89\\x3a\\x3d\\x2c\\x8f\\x4d\\x7f\\x6d\\x6c\\x9d\\x62\\x67\\x29\\xaf\\x3d\\x44\\x39\\x8e\\xc3\\xf3\\xe8\\x51\\xc1\\x99\\xb9\\xdd\\x9f\\xd5\\x3d\\x1f\\xd3\\xe4\";\nFUNC_TYPE_T(w2c_test_t2) = \"\\x36\\xa9\\xe7\\xf1\\xc9\\x5b\\x82\\xff\\xb9\\x97\\x43\\xe0\\xc5\\xc4\\xce\\x95\\xd8\\x3c\\x9a\\x43\\x0a\\xac\\x59\\xf8\\x4e\\xf3\\xcb\\xfa\\xb6\\x14\\x50\\x68\";\n\nstatic u32 wrap_w2c_wasi__snapshot__preview1_fd_write(void *instance, u32 var_0, u32 var_1, u32 var_2, u32 var_3) {\n  return w2c_wasi__snapshot__preview1_fd_write((struct w2c_wasi__snapshot__preview1*) instance, var_0, var_1, var_2, var_3);\n}\n\nstatic const u8 data_segment_data_w2c_test_d0[] = {\n  0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, \n  0x2e, 0x0a, \n};\n\nstatic void init_memories(w2c_test* instance) {\n  wasm_rt_allocate_memory(&instance->w2c_memory, 1, 65536, 0, 65536);\n  LOAD_DATA(instance->w2c_memory, 8u, data_segment_data_w2c_test_d0, 14);\n}\n\nstatic void init_data_instances(w2c_test *instance) {\n}\n\nstatic const wasm_elem_segment_expr_t elem_segment_exprs_w2c_test_e0[] = {\n  {RefFunc, w2c_test_t0, (wasm_rt_function_ptr_t)wrap_w2c_wasi__snapshot__preview1_fd_write, {NULL}, offsetof(w2c_test, w2c_wasi__snapshot__preview1_instance)},\n};\n\nstatic void init_tables(w2c_test* instance) {\n  wasm_rt_allocate_funcref_table(&instance->w2c_T0, 1, 1);\n  funcref_table_init(&instance->w2c_T0, elem_segment_exprs_w2c_test_e0, 1, 0u, 0, 1, instance);\n}\n\nstatic void init_elem_instances(w2c_test *instance) {\n}\n\n/* export: 'memory' */\nwasm_rt_memory_t* w2c_test_memory(w2c_test* instance) {\n  return &instance->w2c_memory;\n}\n\n/* export: '_start' */\nvoid w2c_test_0x5Fstart(w2c_test* instance) {\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base(instance->w2c_memory.data);\n#endif\n  w2c_test_0x5Fstart_0(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\nstatic void init_instance_import(w2c_test* instance, struct w2c_wasi__snapshot__preview1* w2c_wasi__snapshot__preview1_instance) {\n  instance->w2c_wasi__snapshot__preview1_instance = w2c_wasi__snapshot__preview1_instance;\n}\n\nvoid wasm2c_test_instantiate(w2c_test* instance, struct w2c_wasi__snapshot__preview1* w2c_wasi__snapshot__preview1_instance) {\n  assert(wasm_rt_is_initialized());\n  init_instance_import(instance, w2c_wasi__snapshot__preview1_instance);\n  init_tables(instance);\n  init_memories(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n#if !WASM_RT_SEGUE_FREE_SEGMENT\n  void* segue_saved_base = wasm_rt_segue_read_base();\n#endif\n  wasm_rt_segue_write_base(instance->w2c_memory.data);\n#endif\n  init_elem_instances(instance);\n  init_data_instances(instance);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && !WASM_RT_SEGUE_FREE_SEGMENT\n  wasm_rt_segue_write_base(segue_saved_base);\n#endif\n}\n\nvoid wasm2c_test_free(w2c_test* instance) {\n  wasm_rt_free_funcref_table(&instance->w2c_T0);\n  wasm_rt_free_memory(&instance->w2c_memory);\n}\n\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...) {\n  va_list args;\n  \n  if (param_count == 4 && result_count == 1) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32) {\n      va_end(args);\n      return w2c_test_t0;\n    }\n    va_end(args);\n  }\n  \n  if (param_count == 1 && result_count == 0) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32) {\n      va_end(args);\n      return w2c_test_t1;\n    }\n    va_end(args);\n  }\n  \n  if (param_count == 0 && result_count == 0) {\n    va_start(args, result_count);\n    if (true) {\n      va_end(args);\n      return w2c_test_t2;\n    }\n    va_end(args);\n  }\n  \n  return NULL;\n}\n\nvoid w2c_test_0x5Fstart_0(w2c_test* instance) {\n  FUNC_PROLOGUE;\n  u32 var_i0, var_i1, var_i2, var_i3, var_i4;\n  var_i0 = 0u;\n  var_i1 = 8u;\n  i32_store_default32(&instance->w2c_memory, (u64)(var_i0), var_i1);\n  var_i0 = 4u;\n  var_i1 = 14u;\n  i32_store_default32(&instance->w2c_memory, (u64)(var_i0), var_i1);\n  var_i0 = 1u;\n  var_i1 = 0u;\n  var_i2 = 1u;\n  var_i3 = 0u;\n  var_i4 = 0u;\n  var_i0 = CALL_INDIRECT(instance->w2c_T0, u32 (*)(void*, u32, u32, u32, u32), w2c_test_t0, var_i4, instance->w2c_T0.data[var_i4].module_instance, var_i0, var_i1, var_i2, var_i3);\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n  wasm_rt_segue_write_base(instance->w2c_memory.data);\n#endif\n  w2c_wasi__snapshot__preview1_proc_exit(instance->w2c_wasi__snapshot__preview1_instance, var_i0);\n  FUNC_EPILOGUE;\n}\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/minimal.txt",
    "content": ";;; TOOL: run-wasm2c\n(module)\n(;; STDOUT ;;;\n/* Automatically generated by wasm2c */\n#ifndef WASM_H_GENERATED_\n#define WASM_H_GENERATED_\n\n#include \"wasm-rt.h\"\n\n#include <stdint.h>\n\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\ntypedef uint8_t u8;\ntypedef int8_t s8;\ntypedef uint16_t u16;\ntypedef int16_t s16;\ntypedef uint32_t u32;\ntypedef int32_t s32;\ntypedef uint64_t u64;\ntypedef int64_t s64;\ntypedef float f32;\ntypedef double f64;\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct w2c_test {\n  char dummy_member;\n} w2c_test;\n\nvoid wasm2c_test_instantiate(w2c_test*);\nvoid wasm2c_test_free(w2c_test*);\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  /* WASM_H_GENERATED_ */\n/* Automatically generated by wasm2c */\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#if defined(__MINGW32__)\n#include <malloc.h>\n#elif defined(_MSC_VER)\n#include <intrin.h>\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <stdlib.h>\n#else\n#include <alloca.h>\n#endif\n\n#include \"wasm.h\"\n\n// Computes a pointer to an object of the given size in a little-endian memory.\n//\n// On a little-endian host, this is just &mem->data[addr] - the object's size is\n// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n// is the object's size.\n//\n// Note that mem may be evaluated multiple times.\n//\n// Parameters:\n// mem - The memory.\n// addr - The address.\n// n - The size of the object.\n//\n// Result:\n// A pointer for an object of size n.\n#if WABT_BIG_ENDIAN\n#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n#else\n#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n#endif\n\n// We can only use Segue for this module if it uses a single unshared imported\n// or exported memory\n#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n#else\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n#endif\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n// POSIX uses FS for TLS, GS is free\nstatic inline void* wasm_rt_segue_read_base() {\n  if (wasm_rt_fsgsbase_inst_supported) {\n    return (void*)__builtin_ia32_rdgsbase64();\n  } else {\n    return wasm_rt_syscall_get_segue_base();\n  }\n}\nstatic inline void wasm_rt_segue_write_base(void* base) {\n#if WASM_RT_SEGUE_FREE_SEGMENT\n  if (wasm_rt_last_segment_val == base) {\n    return;\n  }\n\n  wasm_rt_last_segment_val = base;\n#endif\n\n  if (wasm_rt_fsgsbase_inst_supported) {\n    __builtin_ia32_wrgsbase64((uintptr_t)base);\n  } else {\n    wasm_rt_syscall_set_segue_base(base);\n  }\n}\n#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n#else\n#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n#endif\n\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n\n#if WASM_RT_STACK_DEPTH_COUNT\n#define FUNC_PROLOGUE                                            \\\n  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n    TRAP(EXHAUSTION);\n\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n#else\n#define FUNC_PROLOGUE\n\n#define FUNC_EPILOGUE\n#endif\n\n#define UNREACHABLE TRAP(UNREACHABLE)\n\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n                                 const wasm_rt_func_type_t b) {\n  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n}\n\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n  (LIKELY((x) < table.size && table.data[x].func &&      \\\n          func_types_eq(ft, table.data[x].func_type)) || \\\n   TRAP(CALL_INDIRECT))\n\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n#if __has_builtin(__builtin_add_overflow)\n  return __builtin_add_overflow(a, b, resptr);\n#elif defined(_MSC_VER)\n  return _addcarry_u64(0, a, b, resptr);\n#else\n#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n#endif\n}\n\n#define RANGE_CHECK(mem, offset, len)              \\\n  do {                                             \\\n    uint64_t res;                                  \\\n    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n      TRAP(OOB);                                   \\\n    if (UNLIKELY(res > (mem)->size))               \\\n      TRAP(OOB);                                   \\\n  } while (0);\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n#include <stdio.h>\n#define WASM_RT_CHECK_BASE(mem)                                               \\\n  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n    puts(\"Segment register mismatch\\n\");                                      \\\n    abort();                                                                  \\\n  }\n#else\n#define WASM_RT_CHECK_BASE(mem)\n#endif\n\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n// default-page-size, 32-bit memories. It may do nothing at all\n// (if hardware bounds-checking is enabled via guard pages)\n// or it may do a slightly faster RANGE_CHECK.\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n#else\n#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n  WASM_RT_CHECK_BASE(mem);                           \\\n  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n    TRAP(OOB);\n#endif\n\n// MEMCHECK_GENERAL can be used for any memory\n#define MEMCHECK_GENERAL(mem, a, t) \\\n  WASM_RT_CHECK_BASE(mem);          \\\n  RANGE_CHECK(mem, a, sizeof(t));\n\n#ifdef __GNUC__\n#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n// Clang on Mips requires \"f\" constraints on floats\n// See https://github.com/llvm/llvm-project/issues/64241\n#if defined(__clang__) && \\\n    (defined(mips) || defined(__mips__) || defined(__mips))\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n#else\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n#endif\n#else\n#define FORCE_READ_INT(var)\n#define FORCE_READ_FLOAT(var)\n#endif\n\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n  if (!n) {\n    return;\n  }\n#if WABT_BIG_ENDIAN\n  for (size_t i = 0; i < n; i++) {\n    dest[i] = src[n - i - 1];\n  }\n#else\n  wasm_rt_memcpy(dest, src, n);\n#endif\n}\n\n#define LOAD_DATA(m, o, i, s)            \\\n  do {                                   \\\n    RANGE_CHECK((&m), o, s);             \\\n    load_data(MEM_ADDR(&m, o, s), i, s); \\\n  } while (0)\n\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr) {                     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }\n\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1)                                           \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1) {     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1) {                           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }\n\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1, val_type2)                                \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1,       \\\n                                             val_type2 val2) {               \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1, val_type2 val2) {           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }\n\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    t1 result;                                                         \\\n    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n                   sizeof(t1));                                        \\\n    force_read(result);                                                \\\n    return (t3)(t2)result;                                             \\\n  }                                                                    \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n\n#define DEFINE_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      t2 value) {                      \\\n    t1 wrapped = (t1)value;                                            \\\n    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n                   sizeof(t1));                                        \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\nDEFINE_STORE(i32_store, u32, u32)\nDEFINE_STORE(i64_store, u64, u64)\nDEFINE_STORE(f32_store, f32, f32)\nDEFINE_STORE(f64_store, f64, f64)\nDEFINE_STORE(i32_store8, u8, u32)\nDEFINE_STORE(i32_store16, u16, u32)\nDEFINE_STORE(i64_store8, u8, u64)\nDEFINE_STORE(i64_store16, u16, u64)\nDEFINE_STORE(i64_store32, u32, u64)\n\n#if defined(_MSC_VER)\n\n// Adapted from\n// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n\nstatic inline int I64_CLZ(unsigned long long v) {\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  if (_BitScanReverse64(&r, v)) {\n    return 63 - r;\n  }\n#else\n  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n    return 31 - r;\n  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n    return 63 - r;\n  }\n#endif\n  return 64;\n}\n\nstatic inline int I32_CLZ(unsigned long v) {\n  unsigned long r = 0;\n  if (_BitScanReverse(&r, v)) {\n    return 31 - r;\n  }\n  return 32;\n}\n\nstatic inline int I64_CTZ(unsigned long long v) {\n  if (!v) {\n    return 64;\n  }\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  _BitScanForward64(&r, v);\n  return (int)r;\n#else\n  if (_BitScanForward(&r, (unsigned int)(v))) {\n    return (int)(r);\n  }\n\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n  return (int)(r + 32);\n#endif\n}\n\nstatic inline int I32_CTZ(unsigned long v) {\n  if (!v) {\n    return 32;\n  }\n  unsigned long r = 0;\n  _BitScanForward(&r, v);\n  return (int)r;\n}\n\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n  static inline u32 f_n(T x) {                                      \\\n    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n  }\n\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\nPOPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n\n#undef POPCOUNT_DEFINE_PORTABLE\n\n#else\n\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n#define I32_POPCNT(x) (__builtin_popcount(x))\n#define I64_POPCNT(x) (__builtin_popcountll(x))\n\n#endif\n\n#define DIV_S(ut, min, x, y)                                  \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n                                         : (ut)((x) / (y)))\n\n#define REM_S(ut, min, x, y)                                 \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n                                         : (ut)((x) % (y)))\n\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n\n#define DIVREM_U(op, x, y) \\\n  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n#define REM_U(x, y) DIVREM_U(%, x, y)\n\n#define ROTL(x, y, mask) \\\n  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n#define ROTR(x, y, mask) \\\n  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n#define I64_ROTL(x, y) ROTL(x, y, 63)\n#define I32_ROTR(x, y) ROTR(x, y, 31)\n#define I64_ROTR(x, y) ROTR(x, y, 63)\n\n#define FMIN(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n   : (x < y)                          ? x                    \\\n                                      : y)\n\n#define FMAX(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n   : (x > y)                          ? x                    \\\n                                      : y)\n\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                 : (ut)(st)(x))\n\n#define I32_TRUNC_S_F32(x) \\\n  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n#define I64_TRUNC_S_F32(x) \\\n  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n#define I32_TRUNC_S_F64(x) \\\n  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n#define I64_TRUNC_S_F64(x) \\\n  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n\n#define TRUNC_U(ut, ft, max, x)                                              \\\n  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                  : (ut)(x))\n\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))         ? 0                           \\\n   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n                                  : (ut)(st)(x))\n\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F32(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n              INT64_MAX, x)\n#define I32_TRUNC_SAT_S_F64(x)                                        \\\n  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F64(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n              INT64_MAX, x)\n\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))          ? 0    \\\n   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n   : (UNLIKELY(!((x) < (max))))    ? smax \\\n                                   : (ut)(x))\n\n#define I32_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F64(x) \\\n  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n  static inline t2 name(t1 x) {                  \\\n    t2 result;                                   \\\n    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n    return result;                               \\\n  }\n\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\nDEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\nDEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\nDEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n\nstatic float quiet_nanf(float x) {\n  uint32_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 4);\n  tmp |= 0x7fc00000lu;\n  wasm_rt_memcpy(&x, &tmp, 4);\n  return x;\n}\n\nstatic double quiet_nan(double x) {\n  uint64_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 8);\n  tmp |= 0x7ff8000000000000llu;\n  wasm_rt_memcpy(&x, &tmp, 8);\n  return x;\n}\n\nstatic double wasm_quiet(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return x;\n}\n\nstatic float wasm_quietf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return x;\n}\n\nstatic double wasm_floor(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return floor(x);\n}\n\nstatic float wasm_floorf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return floorf(x);\n}\n\nstatic double wasm_ceil(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return ceil(x);\n}\n\nstatic float wasm_ceilf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return ceilf(x);\n}\n\nstatic double wasm_trunc(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return trunc(x);\n}\n\nstatic float wasm_truncf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return truncf(x);\n}\n\nstatic float wasm_nearbyintf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return nearbyintf(x);\n}\n\nstatic double wasm_nearbyint(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return nearbyint(x);\n}\n\nstatic float wasm_fabsf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    uint32_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 4);\n    tmp = tmp & ~(1UL << 31);\n    wasm_rt_memcpy(&x, &tmp, 4);\n    return x;\n  }\n  return fabsf(x);\n}\n\nstatic double wasm_fabs(double x) {\n  if (UNLIKELY(isnan(x))) {\n    uint64_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 8);\n    tmp = tmp & ~(1ULL << 63);\n    wasm_rt_memcpy(&x, &tmp, 8);\n    return x;\n  }\n  return fabs(x);\n}\n\nstatic double wasm_sqrt(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return sqrt(x);\n}\n\nstatic float wasm_sqrtf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return sqrtf(x);\n}\n\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n  RANGE_CHECK(mem, d, n);\n  memset(MEM_ADDR(mem, d, n), val, n);\n}\n\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n                               const wasm_rt_memory_t* src,\n                               u64 dest_addr,\n                               u64 src_addr,\n                               u64 n) {\n  RANGE_CHECK(dest, dest_addr, n);\n  RANGE_CHECK(src, src_addr, n);\n  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n}\n\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n                               const u8* src,\n                               u32 src_size,\n                               u64 dest_addr,\n                               u32 src_addr,\n                               u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n}\n\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n\ntypedef struct {\n  wasm_elem_segment_expr_type_t expr_type;\n  wasm_rt_func_type_t type;\n  wasm_rt_function_ptr_t func;\n  wasm_rt_tailcallee_t func_tailcallee;\n  size_t module_offset;\n} wasm_elem_segment_expr_t;\n\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n                                      const wasm_elem_segment_expr_t* src,\n                                      u32 src_size,\n                                      u64 dest_addr,\n                                      u32 src_addr,\n                                      u32 n,\n                                      void* module_instance) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n    switch (src_expr->expr_type) {\n      case RefFunc:\n        *dest_val = (wasm_rt_funcref_t){\n            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n            (char*)module_instance + src_expr->module_offset};\n        break;\n      case RefNull:\n        *dest_val = wasm_rt_funcref_null_value;\n        break;\n      case GlobalGet:\n        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n                                            src_expr->module_offset);\n        break;\n    }\n  }\n}\n\n// Currently wasm2c only supports initializing externref tables with ref.null.\nstatic inline void externref_table_init(wasm_rt_externref_table_t* dest,\n                                        u32 src_size,\n                                        u64 dest_addr,\n                                        u32 src_addr,\n                                        u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n  }\n}\n\n#define DEFINE_TABLE_COPY(type)                                              \\\n  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n                                       const wasm_rt_##type##_table_t* src,  \\\n                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n    RANGE_CHECK(dest, dest_addr, n);                                         \\\n    RANGE_CHECK(src, src_addr, n);                                           \\\n    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n            n * sizeof(wasm_rt_##type##_t));                                 \\\n  }\n\nDEFINE_TABLE_COPY(funcref)\nDEFINE_TABLE_COPY(externref)\n\n#define DEFINE_TABLE_GET(type)                        \\\n  static inline wasm_rt_##type##_t type##_table_get(  \\\n      const wasm_rt_##type##_table_t* table, u64 i) { \\\n    if (UNLIKELY(i >= table->size))                   \\\n      TRAP(OOB);                                      \\\n    return table->data[i];                            \\\n  }\n\nDEFINE_TABLE_GET(funcref)\nDEFINE_TABLE_GET(externref)\n\n#define DEFINE_TABLE_SET(type)                                               \\\n  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n                                      u64 i, const wasm_rt_##type##_t val) { \\\n    if (UNLIKELY(i >= table->size))                                          \\\n      TRAP(OOB);                                                             \\\n    table->data[i] = val;                                                    \\\n  }\n\nDEFINE_TABLE_SET(funcref)\nDEFINE_TABLE_SET(externref)\n\n#define DEFINE_TABLE_FILL(type)                                               \\\n  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n                                       u64 d, const wasm_rt_##type##_t val,   \\\n                                       u64 n) {                               \\\n    RANGE_CHECK(table, d, n);                                                 \\\n    for (uint32_t i = d; i < d + n; i++) {                                    \\\n      table->data[i] = val;                                                   \\\n    }                                                                         \\\n  }\n\nDEFINE_TABLE_FILL(funcref)\nDEFINE_TABLE_FILL(externref)\n\n#if defined(__GNUC__) || defined(__clang__)\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n#define FUNC_TYPE_EXTERN_T(x) const char* const x\n#define FUNC_TYPE_T(x) static const char* const x\n#else\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n#define FUNC_TYPE_EXTERN_T(x) const char x[]\n#define FUNC_TYPE_T(x) static const char x[]\n#endif\n\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n#define static_assert(X) \\\n  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n#endif\n\n#ifdef _MSC_VER\n#define WEAK_FUNC_DECL(func, fallback)                             \\\n  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n                                                                   \\\n      void                                                         \\\n      fallback(void** instance_ptr, void* tail_call_stack,         \\\n               wasm_rt_tailcallee_t* next)\n#else\n#define WEAK_FUNC_DECL(func, fallback)                                        \\\n  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n                                  wasm_rt_tailcallee_t* next)\n#endif\n\nvoid wasm2c_test_instantiate(w2c_test* instance) {\n  assert(wasm_rt_is_initialized());\n}\n\nvoid wasm2c_test_free(w2c_test* instance) {\n}\n\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...) {\n  va_list args;\n  \n  return NULL;\n}\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/address.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/address.wast\n(;; STDOUT ;;;\n255/255 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/align.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/align.wast\n(;; STDOUT ;;;\n48/48 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/binary-leb128.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/binary-leb128.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/binary.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/binary.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/block.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/block.wast\n(;; STDOUT ;;;\n52/52 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/br.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/br.wast\n(;; STDOUT ;;;\n76/76 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/br_if.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/br_if.wast\n(;; STDOUT ;;;\n88/88 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/br_table.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/br_table.wast\n(;; STDOUT ;;;\n149/149 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/bulk.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/bulk.wast\n(;; STDOUT ;;;\n66/66 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/call.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/call.wast\n(;; STDOUT ;;;\n72/72 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/call_indirect.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/call_indirect.wast\n(;; STDOUT ;;;\n134/134 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/comments.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/comments.wast\n(;; STDOUT ;;;\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/const.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/const.wast\n;;; SLOW:\n(;; STDOUT ;;;\n300/300 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/conversions.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/conversions.wast\n(;; STDOUT ;;;\n593/593 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/custom-page-sizes/custom-page-sizes-invalid.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS*: --enable-custom-page-sizes --enable-multi-memory\n;;; STDIN_FILE: third_party/testsuite/proposals/custom-page-sizes/custom-page-sizes-invalid.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/custom-page-sizes/custom-page-sizes.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS*: --enable-custom-page-sizes --enable-multi-memory\n;;; STDIN_FILE: third_party/testsuite/proposals/custom-page-sizes/custom-page-sizes.wast\n(;; STDOUT ;;;\n31/31 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/custom-page-sizes/memory_max.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/custom-page-sizes/memory_max.wast\n;;; ARGS*: --enable-custom-page-sizes\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/custom-page-sizes/memory_max_i64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/custom-page-sizes/memory_max_i64.wast\n;;; ARGS*: --enable-custom-page-sizes --enable-memory64\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/custom.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/custom.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/data.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/data.wast\n(;; STDOUT ;;;\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/elem.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/elem.wast\n(;; STDOUT ;;;\n38/38 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/endianness.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/endianness.wast\n(;; STDOUT ;;;\n68/68 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/binary.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/binary.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/exports.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/exports.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/imports.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/imports.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\nspectest.print_i32(13)\nspectest.print_i32_f32(14 42)\nspectest.print_i32(13)\nspectest.print_i32(13)\nspectest.print_f32(13)\nspectest.print_i32(13)\nspectest.print_i64(24)\nspectest.print_f64_f64(25 53)\nspectest.print_i64(24)\nspectest.print_f64(24)\nspectest.print_f64(24)\nspectest.print_f64(24)\nspectest.print_i32(13)\n34/34 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/legacy/rethrow.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/rethrow.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n12/12 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/legacy/throw.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/throw.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/legacy/try_catch.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/try_catch.wast\n;;; ARGS*: --enable-exceptions --enable-tail-call\n(;; STDOUT ;;;\n31/31 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/legacy/try_delegate.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/try_delegate.wast\n;;; ARGS*: --enable-exceptions --enable-tail-call\n(;; STDOUT ;;;\n20/20 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/ref_null.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/ref_null.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/tag.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/tag.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/throw.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/throw.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/throw_ref.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/throw_ref.wast\n;;; ARGS*: --enable-exceptions\n(;; STDOUT ;;;\n12/12 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exception-handling/try_table.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/try_table.wast\n;;; ARGS*: --enable-exceptions --enable-tail-call\n(;; STDOUT ;;;\n40/40 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/exports.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/exports.wast\n(;; STDOUT ;;;\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/extended-const/data.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/extended-const/data.wast\n;;; ARGS*: --enable-extended-const\n(;; STDOUT ;;;\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/extended-const/elem.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/extended-const/elem.wast\n;;; ARGS*: --enable-extended-const\n(;; STDOUT ;;;\n46/46 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/extended-const/global.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/extended-const/global.wast\n;;; ARGS*: --enable-extended-const\n(;; STDOUT ;;;\n62/62 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/f32.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/f32.wast\n(;; STDOUT ;;;\n2500/2500 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/f32_bitwise.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/f32_bitwise.wast\n(;; STDOUT ;;;\n360/360 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/f32_cmp.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/f32_cmp.wast\n(;; STDOUT ;;;\n2400/2400 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/f64.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/f64.wast\n(;; STDOUT ;;;\n2500/2500 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/f64_bitwise.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/f64_bitwise.wast\n(;; STDOUT ;;;\n360/360 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/f64_cmp.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/f64_cmp.wast\n(;; STDOUT ;;;\n2400/2400 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/fac.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/fac.wast\n(;; STDOUT ;;;\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/float_exprs.txt",
    "content": ";;; SLOW:\n;;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/float_exprs.wast\n(;; STDOUT ;;;\n819/819 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/float_literals.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/float_literals.wast\n(;; STDOUT ;;;\n99/99 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/float_memory.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/float_memory.wast\n(;; STDOUT ;;;\n60/60 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/float_misc.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/float_misc.wast\n(;; STDOUT ;;;\n470/470 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/forward.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/forward.wast\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/func.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/func.wast\n(;; STDOUT ;;;\n96/96 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/func_ptrs.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/func_ptrs.wast\n(;; STDOUT ;;;\nspectest.print_i32(83)\n25/25 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/global.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/global.wast\n(;; STDOUT ;;;\n58/58 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/i32.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/i32.wast\n(;; STDOUT ;;;\n374/374 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/i64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/i64.wast\n(;; STDOUT ;;;\n384/384 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/if.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/if.wast\n(;; STDOUT ;;;\n124/124 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/imports.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/imports.wast\n(;; STDOUT ;;;\nspectest.print_i32(13)\nspectest.print_i32_f32(14 42)\nspectest.print_i32(13)\nspectest.print_i32(13)\nspectest.print_f32(13)\nspectest.print_i32(13)\nspectest.print_i64(24)\nspectest.print_f64_f64(25 53)\nspectest.print_i64(24)\nspectest.print_f64(24)\nspectest.print_f64(24)\nspectest.print_f64(24)\nspectest.print_i32(13)\n34/34 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/inline-module.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/inline-module.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/int_exprs.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/int_exprs.wast\n(;; STDOUT ;;;\n89/89 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/int_literals.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/int_literals.wast\n(;; STDOUT ;;;\n30/30 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/labels.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/labels.wast\n(;; STDOUT ;;;\n25/25 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/left-to-right.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/left-to-right.wast\n(;; STDOUT ;;;\n95/95 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/linking.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/linking.wast\n(;; STDOUT ;;;\n90/90 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/load.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/load.wast\n(;; STDOUT ;;;\n37/37 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/local_get.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/local_get.wast\n(;; STDOUT ;;;\n19/19 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/local_set.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/local_set.wast\n(;; STDOUT ;;;\n19/19 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/local_tee.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/local_tee.wast\n(;; STDOUT ;;;\n55/55 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/loop.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/loop.wast\n(;; STDOUT ;;;\n77/77 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory.wast\n(;; STDOUT ;;;\n53/53 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/address.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/address.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n255/255 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/address64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/address64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n238/238 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/align64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/align64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n48/48 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/binary-leb128.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/binary-leb128.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/binary.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/binary.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/binary0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/binary0.wast\n;;; ARGS*: --enable-memory64 --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/call_indirect.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/call_indirect.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n135/135 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/endianness64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/endianness64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n68/68 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/float_memory64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/float_memory64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n60/60 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/imports.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/imports.wast\n;;; ARGS*: --enable-memory64 --enable-exceptions --enable-multi-memory\n(;; STDOUT ;;;\nspectest.print_i32(13)\nspectest.print_i32_f32(14 42)\nspectest.print_i32(13)\nspectest.print_i32(13)\nspectest.print_f32(13)\nspectest.print_i32(13)\nspectest.print_i64(24)\nspectest.print_f64_f64(25 53)\nspectest.print_i64(24)\nspectest.print_f64(24)\nspectest.print_f64(24)\nspectest.print_f64(24)\nspectest.print_i32(13)\n34/34 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/load64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/load64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n37/37 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/memory.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n53/53 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/memory64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n45/45 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/memory_copy.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_copy.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n8676/8676 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/memory_fill.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_fill.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n40/40 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/memory_grow64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_grow64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n45/45 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/memory_init.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_init.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n280/280 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/memory_redundancy64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_redundancy64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/memory_trap64.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/memory_trap64.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n170/170 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/simd_address.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/simd_address.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n42/42 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS*: --enable-memory64\n;; memory64 table.wast from last commit before wasm-3.0 merge\n\n(module (table 0 funcref))\n(module (table 1 funcref))\n(module (table 0 0 funcref))\n(module (table 0 1 funcref))\n(module (table 1 256 funcref))\n(module (table 0 65536 funcref))\n(module (table 0 0xffff_ffff funcref))\n\n(module (table 0 funcref) (table 0 funcref))\n(module (table (import \"spectest\" \"table\") 0 funcref) (table 0 funcref))\n\n(assert_invalid\n  (module (table 1 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n(assert_invalid\n  (module (table 0xffff_ffff 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n\n(assert_invalid\n  (module quote \"(table 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n(assert_invalid\n  (module quote \"(table 0x1_0000_0000 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n(assert_invalid\n  (module quote \"(table 0 0x1_0000_0000 funcref)\")\n  \"table size must be at most 2^32-1\"\n)\n\n;; Same as above but with i64 index types\n\n(module (table i64 0 funcref))\n(module (table i64 1 funcref))\n(module (table i64 0 0 funcref))\n(module (table i64 0 1 funcref))\n(module (table i64 1 256 funcref))\n(module (table i64 0 65536 funcref))\n(module (table i64 0 0xffff_ffff funcref))\n\n(module (table i64 0 funcref) (table i64 0 funcref))\n(module (table (import \"spectest\" \"table64\") i64 0 funcref) (table i64 0 funcref))\n\n(assert_invalid\n  (module (table i64 1 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n(assert_invalid\n  (module (table i64 0xffff_ffff 0 funcref))\n  \"size minimum must not be greater than maximum\"\n)\n\n;; Elem segments with no table\n\n(assert_invalid (module (elem (i32.const 0))) \"unknown table\")\n(assert_invalid (module (elem (i32.const 0) $f) (func $f)) \"unknown table\")\n\n;; Duplicate table identifiers\n\n(assert_malformed (module quote\n  \"(table $foo 1 funcref)\"\n  \"(table $foo 1 funcref)\")\n  \"duplicate table\")\n(assert_malformed (module quote\n  \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\"\n  \"(table $foo 1 funcref)\")\n  \"duplicate table\")\n(assert_malformed (module quote\n  \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\"\n  \"(import \\\"\\\" \\\"\\\" (table $foo 1 funcref))\")\n  \"duplicate table\")\n\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table_copy.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_copy.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n1663/1663 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table_copy_mixed.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_copy_mixed.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table_fill.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_fill.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n70/70 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table_get.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_get.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n10/10 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table_grow.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_grow.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n62/62 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table_init.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_init.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n752/752 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table_set.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_set.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n20/20 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory64/table_size.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: test/old-spec/proposals/memory64/table_size.wast\n;;; ARGS*: --enable-memory64\n(;; STDOUT ;;;\n37/37 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory_copy.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory_copy.wast\n(;; STDOUT ;;;\n4338/4338 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory_fill.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory_fill.wast\n(;; STDOUT ;;;\n20/20 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory_grow.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory_grow.wast\n(;; STDOUT ;;;\n87/87 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory_init.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory_init.wast\n(;; STDOUT ;;;\n140/140 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory_redundancy.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory_redundancy.wast\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory_size.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory_size.wast\n(;; STDOUT ;;;\n36/36 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/memory_trap.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory_trap.wast\n(;; STDOUT ;;;\n180/180 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/address0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/address0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n91/91 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/address1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/address1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n126/126 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/align.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/align.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n48/48 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/align0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/align0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/binary.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/binary.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/binary0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/binary0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/data.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/data0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/data1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/data_drop0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/data_drop0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/exports0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/exports0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/float_exprs0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/float_exprs0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/float_exprs1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/float_exprs1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/float_memory0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/float_memory0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n20/20 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/imports.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports.wast\n(;; STDOUT ;;;\nspectest.print_i32(13)\nspectest.print_i32_f32(14 42)\nspectest.print_i32(13)\nspectest.print_i32(13)\nspectest.print_f32(13)\nspectest.print_i32(13)\nspectest.print_i64(24)\nspectest.print_f64_f64(25 53)\nspectest.print_i64(24)\nspectest.print_f64(24)\nspectest.print_f64(24)\nspectest.print_f64(24)\nspectest.print_i32(13)\n34/34 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/imports0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/imports1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/imports2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports2.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/imports3.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports3.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/imports4.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/imports4.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/linking0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/linking0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n3/3 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/linking1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/linking1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/linking2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/linking2.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/linking3.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/linking3.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/load.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/load.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n54/54 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/load0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/load0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/load1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/load1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n15/15 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/load2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/load2.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n37/37 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory-multi.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory-multi.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n53/53 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_copy0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_copy0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n21/21 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_copy1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_copy1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_fill0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_fill0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n11/11 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_grow.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_grow.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n134/134 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_init0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_init0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_size.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n40/40 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_size0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_size1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_size2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size2.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n20/20 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_size3.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_size3.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_trap0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_trap0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n13/13 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/memory_trap1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/memory_trap1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n167/167 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/simd_memory-multi.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/simd_memory-multi.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/start0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/start0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n6/6 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/store.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/store.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n35/35 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/store0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/store0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/store1.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/store1.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n4/4 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/multi-memory/traps0.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/multi-memory/traps0.wast\n;;; ARGS*: --enable-multi-memory\n(;; STDOUT ;;;\n14/14 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/names.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/names.wast\n(;; STDOUT ;;;\nspectest.print_i32(42)\nspectest.print_i32(123)\n482/482 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/nop.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/nop.wast\n(;; STDOUT ;;;\n83/83 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/obsolete-keywords.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/obsolete-keywords.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/ref_func.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/ref_func.wast\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/ref_is_null.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/ref_is_null.wast\n(;; STDOUT ;;;\n11/11 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/ref_null.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/ref_null.wast\n(;; STDOUT ;;;\n2/2 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/return.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/return.wast\n(;; STDOUT ;;;\n63/63 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/select.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/select.wast\n(;; STDOUT ;;;\n118/118 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_address.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_address.wast\n(;; STDOUT ;;;\n42/42 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_align.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_align.wast\n(;; STDOUT ;;;\n8/8 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_bit_shift.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_bit_shift.wast\n(;; STDOUT ;;;\n211/211 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_bitwise.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_bitwise.wast\n(;; STDOUT ;;;\n139/139 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_boolean.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_boolean.wast\n(;; STDOUT ;;;\n259/259 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_const.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_const.wast\n(;; STDOUT ;;;\n265/265 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_conversions.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_conversions.wast\n(;; STDOUT ;;;\n232/232 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f32x4.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4.wast\n(;; STDOUT ;;;\n772/772 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f32x4_arith.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4_arith.wast\n;;; SLOW:\n(;; STDOUT ;;;\n1803/1803 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f32x4_cmp.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4_cmp.wast\n;;; SLOW:\n(;; STDOUT ;;;\n2581/2581 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f32x4_pmin_pmax.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4_pmin_pmax.wast\n;;; SLOW:\n(;; STDOUT ;;;\n3872/3872 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f32x4_rounding.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f32x4_rounding.wast\n(;; STDOUT ;;;\n176/176 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f64x2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2.wast\n(;; STDOUT ;;;\n793/793 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f64x2_arith.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2_arith.wast\n;;; SLOW:\n(;; STDOUT ;;;\n1806/1806 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f64x2_cmp.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2_cmp.wast\n;;; SLOW:\n(;; STDOUT ;;;\n2659/2659 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f64x2_pmin_pmax.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2_pmin_pmax.wast\n;;; SLOW:\n(;; STDOUT ;;;\n3872/3872 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_f64x2_rounding.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_f64x2_rounding.wast\n(;; STDOUT ;;;\n176/176 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i16x8_arith.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_arith.wast\n(;; STDOUT ;;;\n181/181 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i16x8_arith2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_arith2.wast\n(;; STDOUT ;;;\n151/151 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i16x8_cmp.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_cmp.wast\n(;; STDOUT ;;;\n433/433 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i16x8_extadd_pairwise_i8x16.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_extadd_pairwise_i8x16.wast\n(;; STDOUT ;;;\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i16x8_extmul_i8x16.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_extmul_i8x16.wast\n(;; STDOUT ;;;\n104/104 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i16x8_q15mulr_sat_s.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_q15mulr_sat_s.wast\n(;; STDOUT ;;;\n26/26 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i16x8_sat_arith.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i16x8_sat_arith.wast\n(;; STDOUT ;;;\n204/204 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i32x4_arith.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_arith.wast\n(;; STDOUT ;;;\n181/181 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i32x4_arith2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_arith2.wast\n(;; STDOUT ;;;\n121/121 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i32x4_cmp.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_cmp.wast\n(;; STDOUT ;;;\n433/433 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i32x4_dot_i16x8.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_dot_i16x8.wast\n(;; STDOUT ;;;\n26/26 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i32x4_extadd_pairwise_i16x8.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_extadd_pairwise_i16x8.wast\n(;; STDOUT ;;;\n16/16 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i32x4_extmul_i16x8.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_extmul_i16x8.wast\n(;; STDOUT ;;;\n104/104 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i32x4_trunc_sat_f32x4.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_trunc_sat_f32x4.wast\n(;; STDOUT ;;;\n102/102 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i32x4_trunc_sat_f64x2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i32x4_trunc_sat_f64x2.wast\n(;; STDOUT ;;;\n102/102 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i64x2_arith.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i64x2_arith.wast\n(;; STDOUT ;;;\n187/187 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i64x2_arith2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i64x2_arith2.wast\n(;; STDOUT ;;;\n21/21 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i64x2_cmp.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i64x2_cmp.wast\n(;; STDOUT ;;;\n102/102 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i64x2_extmul_i32x4.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i64x2_extmul_i32x4.wast\n(;; STDOUT ;;;\n104/104 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i8x16_arith.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i8x16_arith.wast\n(;; STDOUT ;;;\n121/121 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i8x16_arith2.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i8x16_arith2.wast\n(;; STDOUT ;;;\n184/184 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i8x16_cmp.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i8x16_cmp.wast\n;;; SLOW:\n(;; STDOUT ;;;\n413/413 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_i8x16_sat_arith.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_i8x16_sat_arith.wast\n(;; STDOUT ;;;\n188/188 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_int_to_int_extend.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_int_to_int_extend.wast\n(;; STDOUT ;;;\n228/228 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_lane.wast\n(;; STDOUT ;;;\n274/274 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_linking.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_linking.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_load.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_load.wast\n(;; STDOUT ;;;\n17/17 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_load16_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_load16_lane.wast\n(;; STDOUT ;;;\n32/32 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_load32_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_load32_lane.wast\n(;; STDOUT ;;;\n20/20 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_load64_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_load64_lane.wast\n(;; STDOUT ;;;\n12/12 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_load8_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_load8_lane.wast\n(;; STDOUT ;;;\n48/48 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_load_extend.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_load_extend.wast\n(;; STDOUT ;;;\n84/84 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_load_splat.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_load_splat.wast\n(;; STDOUT ;;;\n112/112 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_load_zero.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_load_zero.wast\n(;; STDOUT ;;;\n27/27 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_splat.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_splat.wast\n(;; STDOUT ;;;\n158/158 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_store.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_store.wast\n(;; STDOUT ;;;\n17/17 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_store16_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_store16_lane.wast\n(;; STDOUT ;;;\n32/32 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_store32_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_store32_lane.wast\n(;; STDOUT ;;;\n20/20 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_store64_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_store64_lane.wast\n(;; STDOUT ;;;\n12/12 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/simd_store8_lane.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/simd_store8_lane.wast\n(;; STDOUT ;;;\n48/48 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/skip-stack-guard-page.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/skip-stack-guard-page.wast\n(;; STDOUT ;;;\n10/10 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/stack.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/stack.wast\n(;; STDOUT ;;;\n5/5 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/start.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/start.wast\n(;; STDOUT ;;;\nspectest.print_i32(1)\nspectest.print_i32(2)\nspectest.print()\n7/7 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/store.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/store.wast\n(;; STDOUT ;;;\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/switch.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/switch.wast\n(;; STDOUT ;;;\n26/26 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table-sub.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table-sub.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table_copy.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table_copy.wast\n(;; STDOUT ;;;\n1649/1649 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table_fill.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table_fill.wast\n(;; STDOUT ;;;\n35/35 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table_get.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table_get.wast\n(;; STDOUT ;;;\n9/9 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table_grow.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table_grow.wast\n(;; STDOUT ;;;\n41/41 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table_init.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table_init.wast\n(;; STDOUT ;;;\n662/662 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table_set.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table_set.wast\n(;; STDOUT ;;;\n18/18 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/table_size.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/table_size.wast\n(;; STDOUT ;;;\n36/36 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/tail-call/return_call.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/wasm-3.0/return_call.wast\n;;; ARGS*: --enable-tail-call\n(;; STDOUT ;;;\nspectest.print_i32_f32(5 91)\n33/33 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/tail-call/return_call_indirect.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/proposals/wasm-3.0/return_call_indirect.wast\n;;; ARGS*: --enable-tail-call\n(;; STDOUT ;;;\nspectest.print_i32_f32(5 91)\n49/49 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/threads/atomic.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; ARGS*: --enable-threads\n;; atomic operations --- This is a subset of the full test suite taken from the\n;;   threads proposal repo, from the upstream-rebuild branch (pending future\n;;   merge of threads upstream-rebuild branch).\n(module\n  (memory 1 1 shared)\n\n  (func (export \"init\") (param $value i64) (i64.store (i32.const 0) (local.get $value)))\n\n  (func (export \"i32.atomic.load\") (param $addr i32) (result i32) (i32.atomic.load (local.get $addr)))\n  (func (export \"i64.atomic.load\") (param $addr i32) (result i64) (i64.atomic.load (local.get $addr)))\n  (func (export \"i32.atomic.load8_u\") (param $addr i32) (result i32) (i32.atomic.load8_u (local.get $addr)))\n  (func (export \"i32.atomic.load16_u\") (param $addr i32) (result i32) (i32.atomic.load16_u (local.get $addr)))\n  (func (export \"i64.atomic.load8_u\") (param $addr i32) (result i64) (i64.atomic.load8_u (local.get $addr)))\n  (func (export \"i64.atomic.load16_u\") (param $addr i32) (result i64) (i64.atomic.load16_u (local.get $addr)))\n  (func (export \"i64.atomic.load32_u\") (param $addr i32) (result i64) (i64.atomic.load32_u (local.get $addr)))\n\n  (func (export \"i32.atomic.store\") (param $addr i32) (param $value i32) (i32.atomic.store (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.store\") (param $addr i32) (param $value i64) (i64.atomic.store (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.store8\") (param $addr i32) (param $value i32) (i32.atomic.store8 (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.store16\") (param $addr i32) (param $value i32) (i32.atomic.store16 (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.store8\") (param $addr i32) (param $value i64) (i64.atomic.store8 (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.store16\") (param $addr i32) (param $value i64) (i64.atomic.store16 (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.store32\") (param $addr i32) (param $value i64) (i64.atomic.store32 (local.get $addr) (local.get $value)))\n\n  (func (export \"i32.atomic.rmw.add\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.add (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw.add\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.add (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw8.add_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.add_u (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw16.add_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.add_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw8.add_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.add_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw16.add_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.add_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw32.add_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.add_u (local.get $addr) (local.get $value)))\n\n  (func (export \"i32.atomic.rmw.sub\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.sub (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw.sub\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.sub (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw8.sub_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.sub_u (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw16.sub_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.sub_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw8.sub_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.sub_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw16.sub_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.sub_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw32.sub_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.sub_u (local.get $addr) (local.get $value)))\n\n  (func (export \"i32.atomic.rmw.and\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.and (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw.and\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.and (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw8.and_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.and_u (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw16.and_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.and_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw8.and_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.and_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw16.and_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.and_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw32.and_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.and_u (local.get $addr) (local.get $value)))\n\n  (func (export \"i32.atomic.rmw.or\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.or (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw.or\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.or (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw8.or_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.or_u (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw16.or_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.or_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw8.or_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.or_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw16.or_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.or_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw32.or_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.or_u (local.get $addr) (local.get $value)))\n\n  (func (export \"i32.atomic.rmw.xor\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.xor (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw.xor\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.xor (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw8.xor_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.xor_u (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw16.xor_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.xor_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw8.xor_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.xor_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw16.xor_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.xor_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw32.xor_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.xor_u (local.get $addr) (local.get $value)))\n\n  (func (export \"i32.atomic.rmw.xchg\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw.xchg (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw.xchg\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw.xchg (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw8.xchg_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw8.xchg_u (local.get $addr) (local.get $value)))\n  (func (export \"i32.atomic.rmw16.xchg_u\") (param $addr i32) (param $value i32) (result i32) (i32.atomic.rmw16.xchg_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw8.xchg_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw8.xchg_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw16.xchg_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw16.xchg_u (local.get $addr) (local.get $value)))\n  (func (export \"i64.atomic.rmw32.xchg_u\") (param $addr i32) (param $value i64) (result i64) (i64.atomic.rmw32.xchg_u (local.get $addr) (local.get $value)))\n\n  (func (export \"i32.atomic.rmw.cmpxchg\") (param $addr i32) (param $expected i32) (param $value i32) (result i32) (i32.atomic.rmw.cmpxchg (local.get $addr) (local.get $expected) (local.get $value)))\n  (func (export \"i64.atomic.rmw.cmpxchg\") (param $addr i32) (param $expected i64)  (param $value i64) (result i64) (i64.atomic.rmw.cmpxchg (local.get $addr) (local.get $expected) (local.get $value)))\n  (func (export \"i32.atomic.rmw8.cmpxchg_u\") (param $addr i32) (param $expected i32)  (param $value i32) (result i32) (i32.atomic.rmw8.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value)))\n  (func (export \"i32.atomic.rmw16.cmpxchg_u\") (param $addr i32) (param $expected i32)  (param $value i32) (result i32) (i32.atomic.rmw16.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value)))\n  (func (export \"i64.atomic.rmw8.cmpxchg_u\") (param $addr i32) (param $expected i64)  (param $value i64) (result i64) (i64.atomic.rmw8.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value)))\n  (func (export \"i64.atomic.rmw16.cmpxchg_u\") (param $addr i32) (param $expected i64)  (param $value i64) (result i64) (i64.atomic.rmw16.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value)))\n  (func (export \"i64.atomic.rmw32.cmpxchg_u\") (param $addr i32) (param $expected i64)  (param $value i64) (result i64) (i64.atomic.rmw32.cmpxchg_u (local.get $addr) (local.get $expected) (local.get $value)))\n\n)\n\n;; *.atomic.load*\n\n(invoke \"init\" (i64.const 0x0706050403020100))\n\n(assert_return (invoke \"i32.atomic.load\" (i32.const 0)) (i32.const 0x03020100))\n(assert_return (invoke \"i32.atomic.load\" (i32.const 4)) (i32.const 0x07060504))\n\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0706050403020100))\n\n(assert_return (invoke \"i32.atomic.load8_u\" (i32.const 0)) (i32.const 0x00))\n(assert_return (invoke \"i32.atomic.load8_u\" (i32.const 5)) (i32.const 0x05))\n\n(assert_return (invoke \"i32.atomic.load16_u\" (i32.const 0)) (i32.const 0x0100))\n(assert_return (invoke \"i32.atomic.load16_u\" (i32.const 6)) (i32.const 0x0706))\n\n(assert_return (invoke \"i64.atomic.load8_u\" (i32.const 0)) (i64.const 0x00))\n(assert_return (invoke \"i64.atomic.load8_u\" (i32.const 5)) (i64.const 0x05))\n\n(assert_return (invoke \"i64.atomic.load16_u\" (i32.const 0)) (i64.const 0x0100))\n(assert_return (invoke \"i64.atomic.load16_u\" (i32.const 6)) (i64.const 0x0706))\n\n(assert_return (invoke \"i64.atomic.load32_u\" (i32.const 0)) (i64.const 0x03020100))\n(assert_return (invoke \"i64.atomic.load32_u\" (i32.const 4)) (i64.const 0x07060504))\n\n;; *.atomic.store*\n\n(invoke \"init\" (i64.const 0x0000000000000000))\n\n(assert_return (invoke \"i32.atomic.store\" (i32.const 0) (i32.const 0xffeeddcc)))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x00000000ffeeddcc))\n\n(assert_return (invoke \"i64.atomic.store\" (i32.const 0) (i64.const 0x0123456789abcdef)))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0123456789abcdef))\n\n(assert_return (invoke \"i32.atomic.store8\" (i32.const 1) (i32.const 0x42)))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0123456789ab42ef))\n\n(assert_return (invoke \"i32.atomic.store16\" (i32.const 4) (i32.const 0x8844)))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0123884489ab42ef))\n\n(assert_return (invoke \"i64.atomic.store8\" (i32.const 1) (i64.const 0x99)))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0123884489ab99ef))\n\n(assert_return (invoke \"i64.atomic.store16\" (i32.const 4) (i64.const 0xcafe)))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0123cafe89ab99ef))\n\n(assert_return (invoke \"i64.atomic.store32\" (i32.const 4) (i64.const 0xdeadbeef)))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0xdeadbeef89ab99ef))\n\n;; *.atomic.rmw*.add\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw.add\" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111123456789))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw.add\" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1212121213131313))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.add_u\" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111111111de))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.add_u\" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111dc0f))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.add_u\" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111153))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.add_u\" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111d000))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.add_u\" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111dbccb7f6))\n\n;; *.atomic.rmw*.sub\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw.sub\" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111fedcba99))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw.sub\" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x101010100f0f0f0f))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.sub_u\" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111144))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.sub_u\" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111114613))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.sub_u\" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111111111cf))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.sub_u\" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111115222))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.sub_u\" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111146556a2c))\n\n;; *.atomic.rmw*.and\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw.and\" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111110101010))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw.and\" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0101010100000000))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.and_u\" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111101))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.and_u\" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111110010))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.and_u\" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111100))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.and_u\" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111001))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.and_u\" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111100110001))\n\n;; *.atomic.rmw*.or\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw.or\" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111113355779))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw.or\" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111113131313))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.or_u\" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111111111dd))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.or_u\" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111dbff))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.or_u\" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111153))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.or_u\" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111bfff))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.or_u\" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111dbbbb7f5))\n\n;; *.atomic.rmw*.xor\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw.xor\" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111103254769))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw.xor\" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1010101013131313))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.xor_u\" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111111111dc))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.xor_u\" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111dbef))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.xor_u\" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111153))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.xor_u\" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111affe))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.xor_u\" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111dbaab7f4))\n\n;; *.atomic.rmw*.xchg\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw.xchg\" (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111112345678))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw.xchg\" (i32.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0101010102020202))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.xchg_u\" (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111111111cd))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.xchg_u\" (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111cafe))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.xchg_u\" (i32.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111142))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.xchg_u\" (i32.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111beef))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.xchg_u\" (i32.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111cabba6e5))\n\n;; *.atomic.rmw*.cmpxchg (compare false)\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw.cmpxchg\" (i32.const 0) (i32.const 0) (i32.const 0x12345678)) (i32.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111111))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw.cmpxchg\" (i32.const 0) (i64.const 0) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111111))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.cmpxchg_u\" (i32.const 0) (i32.const 0) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111111))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.cmpxchg_u\" (i32.const 0) (i32.const 0x11111111) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111111111cd))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.cmpxchg_u\" (i32.const 0) (i32.const 0) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111111))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.cmpxchg_u\" (i32.const 0) (i32.const 0x11111111) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111cafe))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.cmpxchg_u\" (i32.const 0) (i64.const 0) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111111))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.cmpxchg_u\" (i32.const 0) (i64.const 0x1111111111111111) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111142))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.cmpxchg_u\" (i32.const 0) (i64.const 0) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111111))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.cmpxchg_u\" (i32.const 0) (i64.const 0x1111111111111111) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111beef))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.cmpxchg_u\" (i32.const 0) (i64.const 0) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111111))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.cmpxchg_u\" (i32.const 0) (i64.const 0x1111111111111111) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111cabba6e5))\n\n;; *.atomic.rmw*.cmpxchg (compare true)\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw.cmpxchg\" (i32.const 0) (i32.const 0x11111111) (i32.const 0x12345678)) (i32.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111112345678))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw.cmpxchg\" (i32.const 0) (i64.const 0x1111111111111111) (i64.const 0x0101010102020202)) (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x0101010102020202))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw8.cmpxchg_u\" (i32.const 0) (i32.const 0x11) (i32.const 0xcdcdcdcd)) (i32.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111111111cd))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i32.atomic.rmw16.cmpxchg_u\" (i32.const 0) (i32.const 0x1111) (i32.const 0xcafecafe)) (i32.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111cafe))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw8.cmpxchg_u\" (i32.const 0) (i64.const 0x11) (i64.const 0x4242424242424242)) (i64.const 0x11))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x1111111111111142))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw16.cmpxchg_u\" (i32.const 0) (i64.const 0x1111) (i64.const 0xbeefbeefbeefbeef)) (i64.const 0x1111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x111111111111beef))\n\n(invoke \"init\" (i64.const 0x1111111111111111))\n(assert_return (invoke \"i64.atomic.rmw32.cmpxchg_u\" (i32.const 0) (i64.const 0x11111111) (i64.const 0xcabba6e5cabba6e5)) (i64.const 0x11111111))\n(assert_return (invoke \"i64.atomic.load\" (i32.const 0)) (i64.const 0x11111111cabba6e5))\n\n\n;; unaligned accesses\n\n(assert_trap (invoke \"i32.atomic.load\" (i32.const 1)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.load\" (i32.const 1)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.load16_u\" (i32.const 1)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.load16_u\" (i32.const 1)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.load32_u\" (i32.const 1)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.store\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.store\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.store16\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.store16\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.store32\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw.add\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw.add\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw16.add_u\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw16.add_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw32.add_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw.sub\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw.sub\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw16.sub_u\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw16.sub_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw32.sub_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw.and\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw.and\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw16.and_u\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw16.and_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw32.and_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw.or\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw.or\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw16.or_u\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw16.or_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw32.or_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw.xor\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw.xor\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw16.xor_u\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw16.xor_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw32.xor_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw.xchg\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw.xchg\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw16.xchg_u\" (i32.const 1) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw16.xchg_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw32.xchg_u\" (i32.const 1) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw.cmpxchg\" (i32.const 1) (i32.const 0) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw.cmpxchg\" (i32.const 1) (i64.const 0)  (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i32.atomic.rmw16.cmpxchg_u\" (i32.const 1) (i32.const 0) (i32.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw16.cmpxchg_u\" (i32.const 1) (i64.const 0) (i64.const 0)) \"unaligned atomic\")\n(assert_trap (invoke \"i64.atomic.rmw32.cmpxchg_u\" (i32.const 1) (i64.const 0) (i64.const 0)) \"unaligned atomic\")\n\n(module\n  (memory 1 1 shared)\n\n  (func (export \"init\") (param $value i64) (i64.store (i32.const 0) (local.get $value)))\n)\n\n;; unshared memory is OK\n(module\n  (memory 1 1)\n  (func (drop (i32.atomic.load (i32.const 0))))\n  (func (drop (i64.atomic.load (i32.const 0))))\n  (func (drop (i32.atomic.load16_u (i32.const 0))))\n  (func (drop (i64.atomic.load16_u (i32.const 0))))\n  (func (drop (i64.atomic.load32_u (i32.const 0))))\n  (func       (i32.atomic.store (i32.const 0) (i32.const 0)))\n  (func       (i64.atomic.store (i32.const 0) (i64.const 0)))\n  (func       (i32.atomic.store16 (i32.const 0) (i32.const 0)))\n  (func       (i64.atomic.store16 (i32.const 0) (i64.const 0)))\n  (func       (i64.atomic.store32 (i32.const 0) (i64.const 0)))\n  (func (drop (i32.atomic.rmw.add (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw.add (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw16.add_u (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw16.add_u (i32.const 0) (i64.const 0))))\n  (func (drop (i64.atomic.rmw32.add_u (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw.sub (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw.sub (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw16.sub_u (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw16.sub_u (i32.const 0) (i64.const 0))))\n  (func (drop (i64.atomic.rmw32.sub_u (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw.and (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw.and (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw16.and_u (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw16.and_u (i32.const 0) (i64.const 0))))\n  (func (drop (i64.atomic.rmw32.and_u (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw.or (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw.or (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw16.or_u (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw16.or_u (i32.const 0) (i64.const 0))))\n  (func (drop (i64.atomic.rmw32.or_u (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw.xor (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw.xor (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw16.xor_u (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw16.xor_u (i32.const 0) (i64.const 0))))\n  (func (drop (i64.atomic.rmw32.xor_u (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw.xchg (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw.xchg (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw16.xchg_u (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw16.xchg_u (i32.const 0) (i64.const 0))))\n  (func (drop (i64.atomic.rmw32.xchg_u (i32.const 0) (i64.const 0))))\n  (func (drop (i32.atomic.rmw.cmpxchg (i32.const 0) (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw.cmpxchg (i32.const 0) (i64.const 0)  (i64.const 0))))\n  (func (drop (i32.atomic.rmw16.cmpxchg_u (i32.const 0) (i32.const 0) (i32.const 0))))\n  (func (drop (i64.atomic.rmw16.cmpxchg_u (i32.const 0) (i64.const 0) (i64.const 0))))\n  (func (drop (i64.atomic.rmw32.cmpxchg_u (i32.const 0) (i64.const 0) (i64.const 0))))\n)\n\n;; atomic.fence: no memory is ok\n(module\n  (func (export \"fence\") (atomic.fence))\n)\n\n(assert_return (invoke \"fence\"))\n\n;; Fails with no memory\n(assert_invalid (module (func (drop (i32.atomic.load (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.load (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.load16_u (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.load16_u (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.load32_u (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func       (i32.atomic.store (i32.const 0) (i32.const 0)))) \"unknown memory\")\n(assert_invalid (module (func       (i64.atomic.store (i32.const 0) (i64.const 0)))) \"unknown memory\")\n(assert_invalid (module (func       (i32.atomic.store16 (i32.const 0) (i32.const 0)))) \"unknown memory\")\n(assert_invalid (module (func       (i64.atomic.store16 (i32.const 0) (i64.const 0)))) \"unknown memory\")\n(assert_invalid (module (func       (i64.atomic.store32 (i32.const 0) (i64.const 0)))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw.add (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw.add (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw16.add_u (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw16.add_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw32.add_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw.sub (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw.sub (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw16.sub_u (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw16.sub_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw32.sub_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw.and (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw.and (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw16.and_u (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw16.and_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw32.and_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw.or (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw.or (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw16.or_u (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw16.or_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw32.or_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw.xor (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw.xor (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw16.xor_u (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw16.xor_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw32.xor_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw.xchg (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw.xchg (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw16.xchg_u (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw16.xchg_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw32.xchg_u (i32.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw.cmpxchg (i32.const 0) (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw.cmpxchg (i32.const 0) (i64.const 0)  (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i32.atomic.rmw16.cmpxchg_u (i32.const 0) (i32.const 0) (i32.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw16.cmpxchg_u (i32.const 0) (i64.const 0) (i64.const 0))))) \"unknown memory\")\n(assert_invalid (module (func (drop (i64.atomic.rmw32.cmpxchg_u (i32.const 0) (i64.const 0) (i64.const 0))))) \"unknown memory\")\n(;; STDOUT ;;;\n195/195 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/token.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/token.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/traps.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/traps.wast\n(;; STDOUT ;;;\n32/32 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/type.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/type.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/unreachable.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/unreachable.wast\n(;; STDOUT ;;;\n63/63 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/unreached-invalid.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/unreached-invalid.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/unreached-valid.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/unreached-valid.wast\n(;; STDOUT ;;;\n5/5 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/unwind.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/unwind.wast\n(;; STDOUT ;;;\n49/49 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/utf8-custom-section-id.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/utf8-custom-section-id.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/utf8-import-field.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/utf8-import-field.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/utf8-import-module.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/utf8-import-module.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec/utf8-invalid-encoding.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/utf8-invalid-encoding.wast\n(;; STDOUT ;;;\n0/0 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec-multi-output/call.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/call.wast\n;;; ARGS*: --num-outputs=4\n(;; STDOUT ;;;\n72/72 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec-multi-output/linking.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/linking.wast\n;;; ARGS*: --num-outputs=4\n(;; STDOUT ;;;\n90/90 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/spec-multi-output/memory_init.txt",
    "content": ";;; TOOL: run-spec-wasm2c\n;;; STDIN_FILE: third_party/testsuite/memory_init.wast\n;;; ARGS*: --num-outputs=4\n(;; STDOUT ;;;\n140/140 tests passed.\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wasm2c/tail-calls.txt",
    "content": ";;; TOOL: run-wasm2c\n;;; ARGS0: --debug-names\n;;; ARGS*: --enable-tail-call\n(type $i32_f32 (func (param i32 f32)))\n(import \"spectest\" \"print_i32_f32\" (func $print_i32_f32 (type $i32_f32)))\n(table $tab funcref (elem $print_i32_f32))\n(func (export \"tailcaller\")\n  (return_call_indirect (type $i32_f32)\n    (i32.const 1) (f32.const 2.0) (i32.const 0)))\n(func $infiniteloop (param i32 f64) (result i32 f64)\n  (return_call $infiniteloop (local.get 0) (local.get 1)))\n(;; STDOUT ;;;\n/* Automatically generated by wasm2c */\n#ifndef WASM_H_GENERATED_\n#define WASM_H_GENERATED_\n\n#include \"wasm-rt.h\"\n\n#include <stdint.h>\n\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\ntypedef uint8_t u8;\ntypedef int8_t s8;\ntypedef uint16_t u16;\ntypedef int16_t s16;\ntypedef uint32_t u32;\ntypedef int32_t s32;\ntypedef uint64_t u64;\ntypedef int64_t s64;\ntypedef float f32;\ntypedef double f64;\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct w2c_spectest;\n\ntypedef struct w2c_test {\n  struct w2c_spectest* w2c_spectest_instance;\n  wasm_rt_funcref_table_t w2c_tab;\n} w2c_test;\n\nvoid wasm2c_test_instantiate(w2c_test*, struct w2c_spectest*);\nvoid wasm2c_test_free(w2c_test*);\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\n#ifndef wasm_multi_id\n#define wasm_multi_id wasm_multi_id\nstruct wasm_multi_id {\n  u32 i0;\n  f64 d1;\n};\n#endif  /* wasm_multi_id */\n\n/* import: 'spectest' 'print_i32_f32' */\nvoid w2c_spectest_print_i32_f32(struct w2c_spectest*, u32, f32);\nvoid wasm_tailcall_w2c_spectest_print_i32_f32(void **instance_ptr, void *tail_call_stack, wasm_rt_tailcallee_t *next);\n\n/* export: 'tailcaller' */\nvoid w2c_test_tailcaller(w2c_test*);\n\n/* export for tail-call of 'tailcaller' */\nvoid wasm_tailcall_w2c_test_tailcaller(void **instance_ptr, void *tail_call_stack, wasm_rt_tailcallee_t *next);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  /* WASM_H_GENERATED_ */\n/* Automatically generated by wasm2c */\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#if defined(__MINGW32__)\n#include <malloc.h>\n#elif defined(_MSC_VER)\n#include <intrin.h>\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <stdlib.h>\n#else\n#include <alloca.h>\n#endif\n\n#include \"wasm.h\"\n\n// Computes a pointer to an object of the given size in a little-endian memory.\n//\n// On a little-endian host, this is just &mem->data[addr] - the object's size is\n// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n// is the object's size.\n//\n// Note that mem may be evaluated multiple times.\n//\n// Parameters:\n// mem - The memory.\n// addr - The address.\n// n - The size of the object.\n//\n// Result:\n// A pointer for an object of size n.\n#if WABT_BIG_ENDIAN\n#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n#else\n#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n#endif\n\n// We can only use Segue for this module if it uses a single unshared imported\n// or exported memory\n#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n#else\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n#endif\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n// POSIX uses FS for TLS, GS is free\nstatic inline void* wasm_rt_segue_read_base() {\n  if (wasm_rt_fsgsbase_inst_supported) {\n    return (void*)__builtin_ia32_rdgsbase64();\n  } else {\n    return wasm_rt_syscall_get_segue_base();\n  }\n}\nstatic inline void wasm_rt_segue_write_base(void* base) {\n#if WASM_RT_SEGUE_FREE_SEGMENT\n  if (wasm_rt_last_segment_val == base) {\n    return;\n  }\n\n  wasm_rt_last_segment_val = base;\n#endif\n\n  if (wasm_rt_fsgsbase_inst_supported) {\n    __builtin_ia32_wrgsbase64((uintptr_t)base);\n  } else {\n    wasm_rt_syscall_set_segue_base(base);\n  }\n}\n#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n#else\n#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n#endif\n\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n\n#if WASM_RT_STACK_DEPTH_COUNT\n#define FUNC_PROLOGUE                                            \\\n  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n    TRAP(EXHAUSTION);\n\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n#else\n#define FUNC_PROLOGUE\n\n#define FUNC_EPILOGUE\n#endif\n\n#define UNREACHABLE TRAP(UNREACHABLE)\n\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n                                 const wasm_rt_func_type_t b) {\n  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n}\n\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n  (LIKELY((x) < table.size && table.data[x].func &&      \\\n          func_types_eq(ft, table.data[x].func_type)) || \\\n   TRAP(CALL_INDIRECT))\n\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n#if __has_builtin(__builtin_add_overflow)\n  return __builtin_add_overflow(a, b, resptr);\n#elif defined(_MSC_VER)\n  return _addcarry_u64(0, a, b, resptr);\n#else\n#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n#endif\n}\n\n#define RANGE_CHECK(mem, offset, len)              \\\n  do {                                             \\\n    uint64_t res;                                  \\\n    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n      TRAP(OOB);                                   \\\n    if (UNLIKELY(res > (mem)->size))               \\\n      TRAP(OOB);                                   \\\n  } while (0);\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n#include <stdio.h>\n#define WASM_RT_CHECK_BASE(mem)                                               \\\n  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n    puts(\"Segment register mismatch\\n\");                                      \\\n    abort();                                                                  \\\n  }\n#else\n#define WASM_RT_CHECK_BASE(mem)\n#endif\n\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n// default-page-size, 32-bit memories. It may do nothing at all\n// (if hardware bounds-checking is enabled via guard pages)\n// or it may do a slightly faster RANGE_CHECK.\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n#else\n#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n  WASM_RT_CHECK_BASE(mem);                           \\\n  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n    TRAP(OOB);\n#endif\n\n// MEMCHECK_GENERAL can be used for any memory\n#define MEMCHECK_GENERAL(mem, a, t) \\\n  WASM_RT_CHECK_BASE(mem);          \\\n  RANGE_CHECK(mem, a, sizeof(t));\n\n#ifdef __GNUC__\n#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n// Clang on Mips requires \"f\" constraints on floats\n// See https://github.com/llvm/llvm-project/issues/64241\n#if defined(__clang__) && \\\n    (defined(mips) || defined(__mips__) || defined(__mips))\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n#else\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n#endif\n#else\n#define FORCE_READ_INT(var)\n#define FORCE_READ_FLOAT(var)\n#endif\n\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n  if (!n) {\n    return;\n  }\n#if WABT_BIG_ENDIAN\n  for (size_t i = 0; i < n; i++) {\n    dest[i] = src[n - i - 1];\n  }\n#else\n  wasm_rt_memcpy(dest, src, n);\n#endif\n}\n\n#define LOAD_DATA(m, o, i, s)            \\\n  do {                                   \\\n    RANGE_CHECK((&m), o, s);             \\\n    load_data(MEM_ADDR(&m, o, s), i, s); \\\n  } while (0)\n\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr) {                     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }\n\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1)                                           \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1) {     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1) {                           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }\n\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1, val_type2)                                \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1,       \\\n                                             val_type2 val2) {               \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1, val_type2 val2) {           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }\n\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    t1 result;                                                         \\\n    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n                   sizeof(t1));                                        \\\n    force_read(result);                                                \\\n    return (t3)(t2)result;                                             \\\n  }                                                                    \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n\n#define DEFINE_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      t2 value) {                      \\\n    t1 wrapped = (t1)value;                                            \\\n    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n                   sizeof(t1));                                        \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\nDEFINE_STORE(i32_store, u32, u32)\nDEFINE_STORE(i64_store, u64, u64)\nDEFINE_STORE(f32_store, f32, f32)\nDEFINE_STORE(f64_store, f64, f64)\nDEFINE_STORE(i32_store8, u8, u32)\nDEFINE_STORE(i32_store16, u16, u32)\nDEFINE_STORE(i64_store8, u8, u64)\nDEFINE_STORE(i64_store16, u16, u64)\nDEFINE_STORE(i64_store32, u32, u64)\n\n#if defined(_MSC_VER)\n\n// Adapted from\n// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n\nstatic inline int I64_CLZ(unsigned long long v) {\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  if (_BitScanReverse64(&r, v)) {\n    return 63 - r;\n  }\n#else\n  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n    return 31 - r;\n  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n    return 63 - r;\n  }\n#endif\n  return 64;\n}\n\nstatic inline int I32_CLZ(unsigned long v) {\n  unsigned long r = 0;\n  if (_BitScanReverse(&r, v)) {\n    return 31 - r;\n  }\n  return 32;\n}\n\nstatic inline int I64_CTZ(unsigned long long v) {\n  if (!v) {\n    return 64;\n  }\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  _BitScanForward64(&r, v);\n  return (int)r;\n#else\n  if (_BitScanForward(&r, (unsigned int)(v))) {\n    return (int)(r);\n  }\n\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n  return (int)(r + 32);\n#endif\n}\n\nstatic inline int I32_CTZ(unsigned long v) {\n  if (!v) {\n    return 32;\n  }\n  unsigned long r = 0;\n  _BitScanForward(&r, v);\n  return (int)r;\n}\n\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n  static inline u32 f_n(T x) {                                      \\\n    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n  }\n\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\nPOPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n\n#undef POPCOUNT_DEFINE_PORTABLE\n\n#else\n\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n#define I32_POPCNT(x) (__builtin_popcount(x))\n#define I64_POPCNT(x) (__builtin_popcountll(x))\n\n#endif\n\n#define DIV_S(ut, min, x, y)                                  \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n                                         : (ut)((x) / (y)))\n\n#define REM_S(ut, min, x, y)                                 \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n                                         : (ut)((x) % (y)))\n\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n\n#define DIVREM_U(op, x, y) \\\n  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n#define REM_U(x, y) DIVREM_U(%, x, y)\n\n#define ROTL(x, y, mask) \\\n  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n#define ROTR(x, y, mask) \\\n  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n#define I64_ROTL(x, y) ROTL(x, y, 63)\n#define I32_ROTR(x, y) ROTR(x, y, 31)\n#define I64_ROTR(x, y) ROTR(x, y, 63)\n\n#define FMIN(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n   : (x < y)                          ? x                    \\\n                                      : y)\n\n#define FMAX(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n   : (x > y)                          ? x                    \\\n                                      : y)\n\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                 : (ut)(st)(x))\n\n#define I32_TRUNC_S_F32(x) \\\n  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n#define I64_TRUNC_S_F32(x) \\\n  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n#define I32_TRUNC_S_F64(x) \\\n  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n#define I64_TRUNC_S_F64(x) \\\n  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n\n#define TRUNC_U(ut, ft, max, x)                                              \\\n  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                  : (ut)(x))\n\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))         ? 0                           \\\n   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n                                  : (ut)(st)(x))\n\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F32(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n              INT64_MAX, x)\n#define I32_TRUNC_SAT_S_F64(x)                                        \\\n  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F64(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n              INT64_MAX, x)\n\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))          ? 0    \\\n   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n   : (UNLIKELY(!((x) < (max))))    ? smax \\\n                                   : (ut)(x))\n\n#define I32_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F64(x) \\\n  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n  static inline t2 name(t1 x) {                  \\\n    t2 result;                                   \\\n    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n    return result;                               \\\n  }\n\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\nDEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\nDEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\nDEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n\nstatic float quiet_nanf(float x) {\n  uint32_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 4);\n  tmp |= 0x7fc00000lu;\n  wasm_rt_memcpy(&x, &tmp, 4);\n  return x;\n}\n\nstatic double quiet_nan(double x) {\n  uint64_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 8);\n  tmp |= 0x7ff8000000000000llu;\n  wasm_rt_memcpy(&x, &tmp, 8);\n  return x;\n}\n\nstatic double wasm_quiet(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return x;\n}\n\nstatic float wasm_quietf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return x;\n}\n\nstatic double wasm_floor(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return floor(x);\n}\n\nstatic float wasm_floorf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return floorf(x);\n}\n\nstatic double wasm_ceil(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return ceil(x);\n}\n\nstatic float wasm_ceilf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return ceilf(x);\n}\n\nstatic double wasm_trunc(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return trunc(x);\n}\n\nstatic float wasm_truncf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return truncf(x);\n}\n\nstatic float wasm_nearbyintf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return nearbyintf(x);\n}\n\nstatic double wasm_nearbyint(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return nearbyint(x);\n}\n\nstatic float wasm_fabsf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    uint32_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 4);\n    tmp = tmp & ~(1UL << 31);\n    wasm_rt_memcpy(&x, &tmp, 4);\n    return x;\n  }\n  return fabsf(x);\n}\n\nstatic double wasm_fabs(double x) {\n  if (UNLIKELY(isnan(x))) {\n    uint64_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 8);\n    tmp = tmp & ~(1ULL << 63);\n    wasm_rt_memcpy(&x, &tmp, 8);\n    return x;\n  }\n  return fabs(x);\n}\n\nstatic double wasm_sqrt(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return sqrt(x);\n}\n\nstatic float wasm_sqrtf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return sqrtf(x);\n}\n\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n  RANGE_CHECK(mem, d, n);\n  memset(MEM_ADDR(mem, d, n), val, n);\n}\n\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n                               const wasm_rt_memory_t* src,\n                               u64 dest_addr,\n                               u64 src_addr,\n                               u64 n) {\n  RANGE_CHECK(dest, dest_addr, n);\n  RANGE_CHECK(src, src_addr, n);\n  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n}\n\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n                               const u8* src,\n                               u32 src_size,\n                               u64 dest_addr,\n                               u32 src_addr,\n                               u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n}\n\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n\ntypedef struct {\n  wasm_elem_segment_expr_type_t expr_type;\n  wasm_rt_func_type_t type;\n  wasm_rt_function_ptr_t func;\n  wasm_rt_tailcallee_t func_tailcallee;\n  size_t module_offset;\n} wasm_elem_segment_expr_t;\n\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n                                      const wasm_elem_segment_expr_t* src,\n                                      u32 src_size,\n                                      u64 dest_addr,\n                                      u32 src_addr,\n                                      u32 n,\n                                      void* module_instance) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n    switch (src_expr->expr_type) {\n      case RefFunc:\n        *dest_val = (wasm_rt_funcref_t){\n            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n            (char*)module_instance + src_expr->module_offset};\n        break;\n      case RefNull:\n        *dest_val = wasm_rt_funcref_null_value;\n        break;\n      case GlobalGet:\n        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n                                            src_expr->module_offset);\n        break;\n    }\n  }\n}\n\n// Currently wasm2c only supports initializing externref tables with ref.null.\nstatic inline void externref_table_init(wasm_rt_externref_table_t* dest,\n                                        u32 src_size,\n                                        u64 dest_addr,\n                                        u32 src_addr,\n                                        u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n  }\n}\n\n#define DEFINE_TABLE_COPY(type)                                              \\\n  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n                                       const wasm_rt_##type##_table_t* src,  \\\n                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n    RANGE_CHECK(dest, dest_addr, n);                                         \\\n    RANGE_CHECK(src, src_addr, n);                                           \\\n    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n            n * sizeof(wasm_rt_##type##_t));                                 \\\n  }\n\nDEFINE_TABLE_COPY(funcref)\nDEFINE_TABLE_COPY(externref)\n\n#define DEFINE_TABLE_GET(type)                        \\\n  static inline wasm_rt_##type##_t type##_table_get(  \\\n      const wasm_rt_##type##_table_t* table, u64 i) { \\\n    if (UNLIKELY(i >= table->size))                   \\\n      TRAP(OOB);                                      \\\n    return table->data[i];                            \\\n  }\n\nDEFINE_TABLE_GET(funcref)\nDEFINE_TABLE_GET(externref)\n\n#define DEFINE_TABLE_SET(type)                                               \\\n  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n                                      u64 i, const wasm_rt_##type##_t val) { \\\n    if (UNLIKELY(i >= table->size))                                          \\\n      TRAP(OOB);                                                             \\\n    table->data[i] = val;                                                    \\\n  }\n\nDEFINE_TABLE_SET(funcref)\nDEFINE_TABLE_SET(externref)\n\n#define DEFINE_TABLE_FILL(type)                                               \\\n  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n                                       u64 d, const wasm_rt_##type##_t val,   \\\n                                       u64 n) {                               \\\n    RANGE_CHECK(table, d, n);                                                 \\\n    for (uint32_t i = d; i < d + n; i++) {                                    \\\n      table->data[i] = val;                                                   \\\n    }                                                                         \\\n  }\n\nDEFINE_TABLE_FILL(funcref)\nDEFINE_TABLE_FILL(externref)\n\n#if defined(__GNUC__) || defined(__clang__)\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n#define FUNC_TYPE_EXTERN_T(x) const char* const x\n#define FUNC_TYPE_T(x) static const char* const x\n#else\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n#define FUNC_TYPE_EXTERN_T(x) const char x[]\n#define FUNC_TYPE_T(x) static const char x[]\n#endif\n\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n#define static_assert(X) \\\n  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n#endif\n\n#ifdef _MSC_VER\n#define WEAK_FUNC_DECL(func, fallback)                             \\\n  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n                                                                   \\\n      void                                                         \\\n      fallback(void** instance_ptr, void* tail_call_stack,         \\\n               wasm_rt_tailcallee_t* next)\n#else\n#define WEAK_FUNC_DECL(func, fallback)                                        \\\n  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n                                  wasm_rt_tailcallee_t* next)\n#endif\n\nstatic void w2c_test_tailcaller_0(w2c_test*);\nstatic void wasm_tailcall_w2c_test_tailcaller_0(void **instance_ptr, void *tail_call_stack, wasm_rt_tailcallee_t *next);\nstatic struct wasm_multi_id w2c_test_infiniteloop(w2c_test*, u32, f64);\nstatic void wasm_tailcall_w2c_test_infiniteloop(void **instance_ptr, void *tail_call_stack, wasm_rt_tailcallee_t *next);\n\n#ifndef wasm_multi_if\n#define wasm_multi_if wasm_multi_if\nstruct wasm_multi_if {\n  u32 i0;\n  f32 f1;\n};\n#endif  /* wasm_multi_if */\n\nFUNC_TYPE_T(w2c_test_i32_f32) = \"\\x98\\x89\\x5c\\xbd\\x28\\xfd\\x0e\\x4d\\xc5\\xdc\\x68\\x2c\\x7c\\xee\\x61\\x09\\x14\\x19\\x30\\x62\\xc2\\x2f\\x49\\xc5\\xb5\\x81\\x57\\x55\\x6b\\xe7\\xa5\\xb9\";\nFUNC_TYPE_T(w2c_test_t1) = \"\\x36\\xa9\\xe7\\xf1\\xc9\\x5b\\x82\\xff\\xb9\\x97\\x43\\xe0\\xc5\\xc4\\xce\\x95\\xd8\\x3c\\x9a\\x43\\x0a\\xac\\x59\\xf8\\x4e\\xf3\\xcb\\xfa\\xb6\\x14\\x50\\x68\";\nFUNC_TYPE_T(w2c_test_t2) = \"\\xe5\\x11\\x86\\xc7\\x24\\xdb\\x44\\x80\\xbe\\xd1\\xe0\\x89\\xbc\\xc0\\x20\\xea\\xfb\\x1c\\x9a\\x27\\xa5\\xc3\\xdb\\xca\\x5d\\xb0\\x05\\x0f\\x7c\\x03\\x74\\x0a\";\n\nstatic void wrap_w2c_spectest_print_i32_f32(void *instance, u32 var_0, f32 var_1) {\n  return w2c_spectest_print_i32_f32((struct w2c_spectest*) instance, var_0, var_1);\n}\n\nstatic const wasm_elem_segment_expr_t elem_segment_exprs_w2c_test_e0[] = {\n  {RefFunc, w2c_test_i32_f32, (wasm_rt_function_ptr_t)wrap_w2c_spectest_print_i32_f32, {wasm_tailcall_w2c_spectest_print_i32_f32}, offsetof(w2c_test, w2c_spectest_instance)},\n};\n\nstatic void init_tables(w2c_test* instance) {\n  wasm_rt_allocate_funcref_table(&instance->w2c_tab, 1, 1);\n  funcref_table_init(&instance->w2c_tab, elem_segment_exprs_w2c_test_e0, 1, 0u, 0, 1, instance);\n}\n\nstatic void init_elem_instances(w2c_test *instance) {\n}\n\n/* export: 'tailcaller' */\nvoid w2c_test_tailcaller(w2c_test* instance) {\n  w2c_test_tailcaller_0(instance);\n}\n\n/* export for tail-call of 'tailcaller' */\nvoid wasm_tailcall_w2c_test_tailcaller(void **instance_ptr, void *tail_call_stack, wasm_rt_tailcallee_t *next) {\n  wasm_tailcall_w2c_test_tailcaller_0(instance_ptr, tail_call_stack, next);\n}\n\n/* handler for missing tail-call on import: 'spectest' 'print_i32_f32' */\nWEAK_FUNC_DECL(wasm_tailcall_w2c_spectest_print_i32_f32, wasm_fallback_test_w2c_spectest_print_i32_f32)\n{\n  next->fn = NULL;\n  struct wasm_multi_if params;\n  wasm_rt_memcpy(&params, tail_call_stack, sizeof(params));\n  w2c_spectest_print_i32_f32(*instance_ptr, params.i0, params.f1);\n}\n\nstatic void init_instance_import(w2c_test* instance, struct w2c_spectest* w2c_spectest_instance) {\n  instance->w2c_spectest_instance = w2c_spectest_instance;\n}\n\nvoid wasm2c_test_instantiate(w2c_test* instance, struct w2c_spectest* w2c_spectest_instance) {\n  assert(wasm_rt_is_initialized());\n  init_instance_import(instance, w2c_spectest_instance);\n  init_tables(instance);\n  init_elem_instances(instance);\n}\n\nvoid wasm2c_test_free(w2c_test* instance) {\n  wasm_rt_free_funcref_table(&instance->w2c_tab);\n}\n\nwasm_rt_func_type_t wasm2c_test_get_func_type(uint32_t param_count, uint32_t result_count, ...) {\n  va_list args;\n  \n  if (param_count == 2 && result_count == 0) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_F32) {\n      va_end(args);\n      return w2c_test_i32_f32;\n    }\n    va_end(args);\n  }\n  \n  if (param_count == 0 && result_count == 0) {\n    va_start(args, result_count);\n    if (true) {\n      va_end(args);\n      return w2c_test_t1;\n    }\n    va_end(args);\n  }\n  \n  if (param_count == 2 && result_count == 2) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_F64 && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_F64) {\n      va_end(args);\n      return w2c_test_t2;\n    }\n    va_end(args);\n  }\n  \n  return NULL;\n}\n\nvoid w2c_test_tailcaller_0(w2c_test* instance) {\n  FUNC_PROLOGUE;\n  u32 var_i0, var_i2;\n  f32 var_f1;\n  var_i0 = 1u;\n  var_f1 = 2;\n  var_i2 = 0u;\n  static_assert(sizeof(struct wasm_multi_if) <= 1024);\n  CHECK_CALL_INDIRECT(instance->w2c_tab, w2c_test_i32_f32, var_i2);\n  if (!instance->w2c_tab.data[var_i2].func_tailcallee.fn) {\n    CALL_INDIRECT(instance->w2c_tab, void (*)(void*, u32, f32), w2c_test_i32_f32, var_i2, instance->w2c_tab.data[var_i2].module_instance, var_i0, var_f1);\n  } else {\n    void *instance_ptr_storage;\n    void **instance_ptr = &instance_ptr_storage;\n    char tail_call_stack[1024];\n    wasm_rt_tailcallee_t next_storage;\n    wasm_rt_tailcallee_t *next = &next_storage;\n    {\n      struct wasm_multi_if tmp;\n      tmp.i0 = var_i0;\n      tmp.f1 = var_f1;\n      wasm_rt_memcpy(tail_call_stack, &tmp, sizeof(tmp));\n    }\n    next->fn = instance->w2c_tab.data[var_i2].func_tailcallee.fn;\n    *instance_ptr = instance->w2c_tab.data[var_i2].module_instance;\n    while (next->fn) { next->fn(instance_ptr, tail_call_stack, next); }\n  }\n  goto var_Bfunc;\n  var_Bfunc:;\n  FUNC_EPILOGUE;\n}\n\nvoid wasm_tailcall_w2c_test_tailcaller_0(void **instance_ptr, void *tail_call_stack, wasm_rt_tailcallee_t *next) {\n  w2c_test* instance = *instance_ptr;\n  u32 var_i0, var_i2;\n  f32 var_f1;\n  var_i0 = 1u;\n  var_f1 = 2;\n  var_i2 = 0u;\n  static_assert(sizeof(struct wasm_multi_if) <= 1024);\n  CHECK_CALL_INDIRECT(instance->w2c_tab, w2c_test_i32_f32, var_i2);\n  if (!instance->w2c_tab.data[var_i2].func_tailcallee.fn) {\n    CALL_INDIRECT(instance->w2c_tab, void (*)(void*, u32, f32), w2c_test_i32_f32, var_i2, instance->w2c_tab.data[var_i2].module_instance, var_i0, var_f1);\n    next->fn = NULL;\n  } else {\n    {\n      struct wasm_multi_if tmp;\n      tmp.i0 = var_i0;\n      tmp.f1 = var_f1;\n      wasm_rt_memcpy(tail_call_stack, &tmp, sizeof(tmp));\n    }\n    next->fn = instance->w2c_tab.data[var_i2].func_tailcallee.fn;\n    *instance_ptr = instance->w2c_tab.data[var_i2].module_instance;\n  }\n  return;\n  var_Bfunc:;\n  next->fn = NULL;\n}\n\nstruct wasm_multi_id w2c_test_infiniteloop(w2c_test* instance, u32 var_p0, f64 var_p1) {\n  FUNC_PROLOGUE;\n  u32 var_i0;\n  f64 var_d1;\n  var_i0 = var_p0;\n  var_d1 = var_p1;\n  static_assert(sizeof(struct wasm_multi_id) <= 1024);\n  {\n    void *instance_ptr_storage;\n    void **instance_ptr = &instance_ptr_storage;\n    char tail_call_stack[1024];\n    wasm_rt_tailcallee_t next_storage;\n    wasm_rt_tailcallee_t *next = &next_storage;\n    {\n      struct wasm_multi_id tmp;\n      tmp.i0 = var_i0;\n      tmp.d1 = var_d1;\n      wasm_rt_memcpy(tail_call_stack, &tmp, sizeof(tmp));\n    }\n    next->fn = wasm_tailcall_w2c_test_infiniteloop;\n    while (next->fn) { next->fn(instance_ptr, tail_call_stack, next); }\n    {\n      struct wasm_multi_id tmp;\n      wasm_rt_memcpy(&tmp, tail_call_stack, sizeof(tmp));\n      var_i0 = tmp.i0;\n      var_d1 = tmp.d1;\n    }\n  }\n  goto var_Bfunc;\n  var_Bfunc:;\n  FUNC_EPILOGUE;\n  {\n    struct wasm_multi_id tmp;\n    tmp.i0 = var_i0;\n    tmp.d1 = var_d1;\n    return tmp;\n  }\n}\n\nvoid wasm_tailcall_w2c_test_infiniteloop(void **instance_ptr, void *tail_call_stack, wasm_rt_tailcallee_t *next) {\n  static_assert(sizeof(struct wasm_multi_id) <= 1024);\n  w2c_test* instance = *instance_ptr;\n  u32 var_p0;\n  f64 var_p1;\n  {\n    struct wasm_multi_id tmp;\n    wasm_rt_memcpy(&tmp, tail_call_stack, sizeof(tmp));\n    var_p0 = tmp.i0;\n    var_p1 = tmp.d1;\n  }\n  u32 var_i0;\n  f64 var_d1;\n  var_i0 = var_p0;\n  var_d1 = var_p1;\n  static_assert(sizeof(struct wasm_multi_id) <= 1024);\n  {\n    {\n      struct wasm_multi_id tmp;\n      tmp.i0 = var_i0;\n      tmp.d1 = var_d1;\n      wasm_rt_memcpy(tail_call_stack, &tmp, sizeof(tmp));\n    }\n    next->fn = wasm_tailcall_w2c_test_infiniteloop;\n  }\n  return;\n  var_Bfunc:;\n  {\n    struct wasm_multi_id tmp;\n    tmp.i0 = var_i0;\n    tmp.d1 = var_d1;\n    wasm_rt_memcpy(tail_call_stack, &tmp, sizeof(tmp));\n  }\n  next->fn = NULL;\n}\n;;; STDOUT ;;)\n"
  },
  {
    "path": "test/wast2json/module-binary.txt",
    "content": ";;; TOOL: wast2json\n;;; ARGS: -v\n(module binary\n  \"\\00asm\" \"\\01\\00\\00\\00\"\n  \"\\04\\04\\01\"                          ;; Table section with 1 entry\n  \"\\70\\00\\00\"                          ;; no max, minimum 0, funcref\n  \"\\09\\09\\01\"                          ;; Element section with 1 entry\n  \"\\02\"                                ;; Element with explicit table index\n  \"\\80\\00\"                             ;; Table index 0, encoded with 2 bytes\n  \"\\41\\00\\0b\\00\\00\"                    ;; (i32.const 0) with no elements\n)\n(;; STDERR ;;;\n0000000: 0061 736d 0100 0000 0404 0170 0000 0909 \n0000010: 0102 8000 4100 0b00 00                    ; \n;;; STDERR ;;)\n"
  },
  {
    "path": "test/wast2json/test-invalid-quoted-modules.txt",
    "content": ";;; TOOL: wast2json\n;;; ERROR: 1\n(module quote \"invalid\")\n(;; STDERR ;;;\nout/test/wast2json/test-invalid-quoted-modules.txt:3:2: error: error in quoted module: @0x100000001: unexpected token \"invalid\", expected a module field or a module.\n(module quote \"invalid\")\n ^^^^^^\n;;; STDERR ;;)\n"
  },
  {
    "path": "test/wat2wasm_stdout.txt",
    "content": ";;; TOOL: wat2wasm\n;;; ARGS: -o - > %(temp_file)s_tmp.wasm\n;;; RUN: %(wasm2wat)s %(temp_file)s_tmp.wasm\n(module\n  (func)\n)\n(;; STDOUT ;;;\n(module\n  (type (;0;) (func))\n  (func (;0;) (type 0)))\n;;; STDOUT ;;)\n"
  },
  {
    "path": "ubsan.blacklist",
    "content": "# Work around libstdc++ bug: https://llvm.org/bugs/show_bug.cgi?id=18156\n# Also see: http://lists.llvm.org/pipermail/cfe-dev/2015-January/040945.html\nsrc:*/ios_base.h\n\n# Work around another libstdc++ bug:\n# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60734\nsrc:*/stl_tree.h\n\n# Work around for libstdc++ 4.8 bug:\n# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59829\nsrc:*/stl_vector.h\nsrc:*/stl_iterator.h\n"
  },
  {
    "path": "wasm2c/.gitignore",
    "content": "wasm-rt-impl.o\nwasm-rt-mem-impl.o\nwasm-rt-exceptions-impl.o\nexamples/**/*.o\nexamples/fac/fac\nexamples/rot13/rot13\nexamples/rot13/rot13.c\nexamples/rot13/rot13.h\nexamples/rot13/rot13.wasm\nexamples/callback/callback\nexamples/callback/callback.c\nexamples/callback/callback.h\nexamples/callback/callback.wasm\nexamples/threads/threads\nexamples/threads/sample.c\nexamples/threads/sample.h\nexamples/threads/sample.wasm\n"
  },
  {
    "path": "wasm2c/README.md",
    "content": "# wasm2c: Convert wasm files to C source and header\n\n`wasm2c` takes a WebAssembly module and produces an equivalent C source and\nheader. Some examples:\n\n```sh\n# parse binary file test.wasm and write test.c and test.h\n$ wasm2c test.wasm -o test.c\n\n# parse test.wasm, write test.c and test.h, but ignore the debug names, if any\n$ wasm2c test.wasm --no-debug-names -o test.c\n```\n\nThe C code produced targets the C99 standard. If, however, the Wasm module uses\nWasm threads/atomics, the code produced targets the C11 standard.\n\n## Tutorial: .wat -> .wasm -> .c\n\nLet's look at a simple example of a factorial function.\n\n```wasm\n(memory $mem 1)\n(func (export \"fac\") (param $x i32) (result i32)\n  (if (result i32) (i32.eq (local.get $x) (i32.const 0))\n    (then (i32.const 1))\n    (else\n      (i32.mul (local.get $x) (call 0 (i32.sub (local.get $x) (i32.const 1))))\n    )\n  )\n)\n```\n\nSave this to `fac.wat`. We can convert this to a `.wasm` file by using the\n`wat2wasm` tool:\n\n```sh\n$ wat2wasm fac.wat -o fac.wasm\n```\n\nWe can then convert it to a C source and header by using the `wasm2c` tool:\n\n```sh\n$ wasm2c fac.wasm -o fac.c\n```\n\nThis generates two files, `fac.c` and `fac.h`. We'll take a closer look at\nthese files below, but first let's show a simple example of how to use these\nfiles.\n\n## Using the generated module\n\nTo actually use our `fac` module, we'll use create a new file, `main.c`, that\ninclude `fac.h`, initializes the module, and calls `fac`.\n\n`wasm2c` generates a few C symbols based on the `fac.wasm` module.\nThe first is `w2c_fac`, a type that represents an instance of the\n`fac` module. `wasm2c` generates functions that construct and free a\n`w2c_fac` instance: `wasm2c_fac_instantiate` and\n`wasm2c_fac_free`. Finally, `wasm2c` generates the exported `fac`\nfunction itself (`w2c_fac_fac`), which acts on a `w2c_fac` instance.\n\nAll the exported symbols shared a common module ID (`fac`) which, by default, is\nbased on the name section in the module or the name of input file.  This prefix\ncan be overridden using the `-n/--module-name` command line flag.\n\n```c\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"fac.h\"\n\nint main(int argc, char** argv) {\n  /* Make sure there is at least one command-line argument. */\n  if (argc < 2) {\n    printf(\"Invalid argument. Expected '%s NUMBER'\\n\", argv[0]);\n    return 1;\n  }\n\n  /* Convert the argument from a string to an int. We'll implicitly cast the int\n  to a `u32`, which is what `fac` expects. */\n  u32 x = atoi(argv[1]);\n\n  /* Initialize the Wasm runtime. */\n  wasm_rt_init();\n\n  /* Declare an instance of the `fac` module. */\n  w2c_fac fac;\n\n  /* Construct the module instance. */\n  wasm2c_fac_instantiate(&fac);\n\n  /* Call `fac`, using the mangled name. */\n  u32 result = w2c_fac_fac(&fac, x);\n\n  /* Print the result. */\n  printf(\"fac(%u) -> %u\\n\", x, result);\n\n  /* Free the fac module. */\n  wasm2c_fac_free(&fac);\n\n  /* Free the Wasm runtime state. */\n  wasm_rt_free();\n\n  return 0;\n}\n\n```\n\n## Compiling the wasm2c output\n\nTo compile the executable, we need to use `main.c` and the generated `fac.c`.\nWe'll also include `wasm-rt-impl.c` and `wasm-rt-mem-impl.c`, which have implementations of the various\n`wasm_rt_*` functions used by `fac.c` and `fac.h`.\n\n```sh\n$ cc -o fac main.c fac.c wasm2c/wasm-rt-impl.c wasm2c/wasm-rt-mem-impl.c -Iwasm2c -lm\n```\n\nA note on compiling with optimization: wasm2c relies on certain\nbehavior from the C compiler to maintain conformance with the\nWebAssembly specification, especially with regards to requirements to\nconvert \"signaling\" to \"quiet\" floating-point NaN values and for\ninfinite recursion to produce a trap. When compiling with optimization\n(e.g. `-O2` or `-O3`), it's necessary to disable some optimizations to\npreserve conformance. With GCC 11, adding the command-line arguments\n`-fno-optimize-sibling-calls -frounding-math -fsignaling-nans` appears\nto be sufficient. With clang 14, just `-fno-optimize-sibling-calls\n-frounding-math` appears to be sufficient.\n\nNow let's test it out!\n\n```sh\n$ ./fac 1\nfac(1) -> 1\n$ ./fac 5\nfac(5) -> 120\n$ ./fac 10\nfac(10) -> 3628800\n```\n\nYou can take a look at the all of these files in\n[wasm2c/examples/fac](/wasm2c/examples/fac).\n\n### Enabling extra sanity checks\n\nWasm2c provides a macro `WASM_RT_SANITY_CHECKS` that if defined enables\nadditional sanity checks in the produced Wasm2c code. Note that this may have a\nhigh performance overhead, and is thus only recommended for debug builds.\n\n### Enabling Segue (a Linux x86_64 target specific optimization)\n\nWasm2c can use the \"Segue\" optimization if allowed. The segue optimization uses\nan x86 segment register to store the location of Wasm's linear memory, when\ncompiling a Wasm module with clang, running on x86_64 Linux, the macro\n`WASM_RT_ALLOW_SEGUE` is defined, and the flag `-mfsgsbase` is passed to clang.\nSegue is not used if\n\n1. The Wasm module uses a more than a single unshared imported or exported\n   memory\n2. The wasm2c code is compiled with GCC. Segue requires intrinsics for\n   (rd|wr)gsbase, \"address namespaces\" for accessing pointers, and support for\n   memcpy on pointers with custom \"address namespaces\". GCC does not support the\n   memcpy requirement.\n3. The code is compiled for Windows as Windows doesn't restore the segment\n   register on context switch.\n\nThe wasm2c generated code automatically sets the unused segment register (the\n`%gs` register on x86_64 Linux) during the function calls into wasm2c generated\nmodule, restores it after calls to external modules etc. Any host function\nwritten in C would continue to work without changes as C code does not modify\nthe unused segment register `%gs` (See\n[here](https://www.kernel.org/doc/html/next/x86/x86_64/fsgs.html) for details).\nHowever, any host functions written in assembly that clobber the free segment\nregister must restore the value of this register prior to executing or returning\ncontrol to wasm2c generated code.\n\nAs an additional optimization, if the host program does not use the `%gs`\nsegment register for any other purpose (which is typically the case in most\nprograms), you can additionally allow wasm2c to unconditionally overwrite the\nvalue of the `%gs` register without restoring the old value. This can be done\ndefining the macro `WASM_RT_SEGUE_FREE_SEGMENT`.\n\nYou can test the performance of the Segue optimization by running Dhrystone with\nand without Segue:\n\n```bash\ncd wasm2c/benchmarks/segue && make\n```\n\n## Looking at the generated header, `fac.h`\n\nThe generated header file looks something like this:\n\n```c\n/* Automatically generated by wasm2c */\n#ifndef FAC_H_GENERATED_\n#define FAC_H_GENERATED_\n\n...\n\n#include \"wasm-rt.h\"\n\n...\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\n\n...\n\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct w2c_fac {\n  char dummy_member;\n} w2c_fac;\n\nvoid wasm2c_fac_instantiate(w2c_fac*);\nvoid wasm2c_fac_free(w2c_fac*);\nwasm_rt_func_type_t wasm2c_fac_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\n/* export: 'fac' */\nu32 w2c_fac_fac(w2c_fac*, u32);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  /* FAC_H_GENERATED_ */\n\n```\n\nLet's look at each section. The outer `#ifndef` is standard C\nboilerplate for a header. This `WASM_RT_CORE_TYPES_DEFINED` section\ncontains a number of definitions required for all WebAssembly\nmodules. The `extern \"C\"` part makes sure to not mangle the symbols if\nusing this header in C++.\n\nThe included `wasm-rt.h` file also includes a number of relevant definitions.\nFirst is the `wasm_rt_trap_t` enum, which is used to give the reason a trap\noccurred.\n\n```c\ntypedef enum {\n  WASM_RT_TRAP_NONE,\n  WASM_RT_TRAP_OOB,\n  WASM_RT_TRAP_INT_OVERFLOW,\n  WASM_RT_TRAP_DIV_BY_ZERO,\n  WASM_RT_TRAP_INVALID_CONVERSION,\n  WASM_RT_TRAP_UNREACHABLE,\n  WASM_RT_TRAP_CALL_INDIRECT,\n  WASM_RT_TRAP_UNCAUGHT_EXCEPTION,\n  WASM_RT_TRAP_EXHAUSTION,\n} wasm_rt_trap_t;\n```\n\nNext is the `wasm_rt_type_t` enum, which is used for specifying function\nsignatures. Six WebAssembly value types are included:\n\n```c\ntypedef enum {\n  WASM_RT_I32,\n  WASM_RT_I64,\n  WASM_RT_F32,\n  WASM_RT_F64,\n  WASM_RT_FUNCREF,\n  WASM_RT_EXTERNREF,\n} wasm_rt_type_t;\n\nNext is `wasm_rt_function_ptr_t`, the function signature for a generic function\ncallback. Since a WebAssembly table can contain functions of any given\nsignature, it is necessary to convert them to a canonical form:\n\n```c\ntypedef void (*wasm_rt_function_ptr_t)(void);\n```\n\nNext is the definition for a function reference (in WebAssembly 1.0,\nthis was the type of all table elements, but funcrefs can now also be\nused as ordinary values, and tables can alternately be declared as\ntype externref). In this structure, `wasm_rt_func_type_t` is an opaque\n256-bit ID that can be looked up via the `Z_[modname]_get_func_type`\nfunction. (A demonstration of this can be found in the `callback`\nexample.) `module_instance` is the pointer to the function's\noriginating module instance, which will be passed in when the func is\ncalled.\n\n```c\ntypedef struct {\n  wasm_rt_func_type_t func_type;\n  wasm_rt_function_ptr_t func;\n  void* module_instance;\n} wasm_rt_funcref_t;\n\n```\n\nNext is the definition of a memory instance. The `data` field is a pointer to\n`size` bytes of linear memory. The `size` field of `wasm_rt_memory_t` is the\ncurrent size of the memory instance in bytes, `pages` is the current\nsize in pages, and `page_size` contains the page size in bytes (65,536 by default).\n`max_pages` is the maximum number of pages specified by the module or allowed\nby the memory index type (`is64` is true for memories that can grow to 2^64 bytes;\n`false` for memories limited to 2^32 bytes).\n\n```c\ntypedef struct {\n  uint8_t* data;\n  uint32_t page_size;\n  uint64_t pages, max_pages;\n  uint64_t size;\n  bool is64;\n} wasm_rt_memory_t;\n```\n\nThis is followed by the definition of a shared memory instance. This is similar\nto a regular memory instance, but represents memory that can be used by multiple\nWasm instances, and thus enforces a minimum amount of memory order on\noperations. The Shared memory definition has one additional member, `mem_lock`,\nwhich is a lock that is used during memory grow operations for thread safety.\n\n```c\ntypedef struct {\n  _Atomic volatile uint8_t* data;\n  uint64_t pages, max_pages;\n  uint64_t size;\n  bool is64;\n  mtx_t mem_lock;\n} wasm_rt_shared_memory_t;\n```\n\nNext is the definition of a table instance. The `data` field is a pointer to\n`size` elements. Like a memory instance, `size` is the current size of a table,\nand `max_size` is the maximum size of the table, or `0xffffffff` if there is no\nlimit.\n\n```c\ntypedef struct {\n  wasm_rt_funcref_t* data;\n  uint32_t max_size;\n  uint32_t size;\n} wasm_rt_funcref_table_t;\n```\n\n## Symbols that must be defined by the embedder\n\nNext in `wasm-rt.h` are a collection of function declarations that must be implemented by\nthe embedder (i.e. you) before this C source can be used.\n\nA C implementation of these functions is defined in\n[`wasm-rt-impl.h`](wasm-rt-impl.h) and [`wasm-rt-impl.c`](wasm-rt-impl.c).\n\n```c\nvoid wasm_rt_init(void);\nbool wasm_rt_is_initialized(void);\nvoid wasm_rt_free(void);\nvoid wasm_rt_trap(wasm_rt_trap_t) __attribute__((noreturn));\nconst char* wasm_rt_strerror(wasm_rt_trap_t trap);\nvoid wasm_rt_allocate_memory(wasm_rt_memory_t*, uint32_t initial_pages, uint32_t max_pages, bool is64, uint32_t page_size);\nuint32_t wasm_rt_grow_memory(wasm_rt_memory_t*, uint32_t pages);\nvoid wasm_rt_free_memory(wasm_rt_memory_t*);\nvoid wasm_rt_allocate_memory_shared(wasm_rt_shared_memory_t*, uint32_t initial_pages, uint32_t max_pages, bool is64, uint32_t page_size);\nuint32_t wasm_rt_grow_memory_shared(wasm_rt_shared_memory_t*, uint32_t pages);\nvoid wasm_rt_free_memory_shared(wasm_rt_shared_memory_t*);\nvoid wasm_rt_allocate_funcref_table(wasm_rt_table_t*, uint32_t elements, uint32_t max_elements);\nvoid wasm_rt_allocate_externref_table(wasm_rt_externref_table_t*, uint32_t elements, uint32_t max_elements);\nvoid wasm_rt_free_funcref_table(wasm_rt_table_t*);\nvoid wasm_rt_free_externref_table(wasm_rt_table_t*);\nuint32_t wasm_rt_call_stack_depth; /* on platforms that don't use the signal handler to detect exhaustion */\nvoid wasm_rt_init_thread(void);\nvoid wasm_rt_free_thread(void);\n```\n\n`wasm_rt_init` must be called by the embedder before anything else, to\ninitialize the runtime. `wasm_rt_free` frees any global\nstate. `wasm_rt_is_initialized` can be used to confirm that the\nruntime has been initialized.\n\n`wasm_rt_trap` is a function that is called when the module traps. Some possible\nimplementations are to throw a C++ exception, or to just abort the program\nexecution. The default runtime included in wasm2c unwinds the stack using\n`longjmp`. The host can overide this call to `longjmp` by compiling the runtime\nwith `WASM_RT_TRAP_HANDLER` defined to the name of a trap handler function. The\nhandler function should be a function taking a `wasm_rt_trap_t` as a parameter\nand returning `void`. e.g. `-DWASM_RT_TRAP_HANDLER=my_trap_handler`\n\n`wasm_rt_allocate_memory` initializes a memory instance, and allocates\nat least enough space for the given number of initial pages, each of\nsize `page_size` (which must be `WASM_DEFAULT_PAGE_SIZE`, equal to 64\nKiB, unless using the custom-page-sizes feature). The memory must be\ncleared to zero. The `is64` parameter indicates if the memory is\nindexed with an i32 or i64 address.\n\n`wasm_rt_grow_memory` must grow the given memory instance by the given number of\npages. If there isn't enough memory to do so, or the new page count would be\ngreater than the maximum page count, the function must fail by returning\n`0xffffffff`. If the function succeeds, it must return the previous size of the\nmemory instance, in pages. The host can optionally be notified of failures by\ncompiling the runtime with `WASM_RT_GROW_FAILED_HANDLER` defined to the name of\na handler function.  The handler function should be a function taking no\narguments and returning `void` . e.g.\n`-DWASM_RT_GROW_FAILED_HANDLER=my_growfail_handler`\n\n`wasm_rt_free_memory` frees the memory instance.\n\n`wasm_rt_allocate_memory_shared` initializes a memory instance that can be\nshared by different Wasm threads. Its operation is otherwise similar to\n`wasm_rt_allocate_memory`.\n\n`wasm_rt_grow_memory_shared` must grow the given shared memory instance by the\ngiven number of pages. It's operation is otherwise similar to\n`wasm_rt_grow_memory`.\n\n`wasm_rt_free_memory_shared` frees the shared memory instance.\n\n`wasm_rt_allocate_funcref_table` and the similar `..._externref_table`\ninitialize a table instance of the given type, and allocate at least\nenough space for the given number of initial elements. The elements\nmust be cleared to zero.\n\n`wasm_rt_free_funcref_table` and `..._externref_table` free the table instance.\n\n`wasm_rt_call_stack_depth` is the current stack call depth. Since this is\nshared between modules, it must be defined only once, by the embedder.\nIt is only used on platforms that don't use the signal handler to detect\nexhaustion.\n\n`wasm_rt_init_thread` and `wasm_rt_free_thread` are used to initialize\nand free the runtime state for a given thread (other than the one that\ncalled `wasm_rt_init`). An example can be found in\n`wasm2c/examples/threads`.\n\n### Runtime support for exception handling\n\nSeveral additional symbols must be defined if wasm2c is being run with support\nfor exceptions (`--enable-exceptions`). These are defined in\n`wasm-rt-exceptions.h`. These symbols are:\n\n```c\nvoid wasm_rt_load_exception(const char* tag, uint32_t size, const void* values);\nWASM_RT_NO_RETURN void wasm_rt_throw(void);\nWASM_RT_UNWIND_TARGET\nWASM_RT_UNWIND_TARGET* wasm_rt_get_unwind_target(void);\nvoid wasm_rt_set_unwind_target(WASM_RT_UNWIND_TARGET* target);\nuint32_t wasm_rt_exception_tag(void);\nuint32_t wasm_rt_exception_size(void);\nvoid* wasm_rt_exception(void);\nwasm_rt_try(target)\n```\n\nA C implementation of these functions is also available in\n[`wasm-rt-exceptions-impl.c`](wasm-rt-exceptions-impl.c).\n\n`wasm_rt_load_exception` sets the active exception to a given tag, size, and contents.\n\n`wasm_rt_throw` throws the active exception.\n\n`WASM_RT_UNWIND_TARGET` is the type of an unwind target if an\nexception is thrown and caught.\n\n`wasm_rt_get_unwind_target` gets the current unwind target if an exception is thrown.\n\n`wasm_rt_set_unwind_target` sets the unwind target if an exception is thrown.\n\nThree functions provide access to the active exception:\n`wasm_rt_exception_tag`, `wasm_rt_exception_size`, and\n`wasm_rt_exception` return its tag, size, and contents, respectively.\n\n`wasm_rt_try(target)` is a macro that captures the current calling\nenvironment as an unwind target and stores it into `target`, which\nmust be of type `WASM_RT_UNWIND_TARGET`.\n\n## Exported symbols\n\nFinally, `fac.h` defines the module instance type (which in the case\nof `fac` is essentially empty), and the exported symbols provided by\nthe module. In our example, the only function we exported was\n`fac`.\n\n`wasm2c_fac_instantiate(w2c_fac*)` creates an instance of\nthe module and must be called before the module instance can be\nused. `wasm2c_fac_free(w2c_fac*)` frees the instance.\n`wasm2c_fac_get_func_type` can be used to look up a function type ID\nat runtime. It is a variadic function where the first two arguments\ngive the number of parameters and results, and the following arguments\nare the types from the wasm_rt_type_t enum described above. The\n`callback` example demonstrates using this to pass a host function to\na WebAssembly module dynamically at runtime.\n\n```c\ntypedef struct w2c_fac {\n  char dummy_member;\n} w2c_fac;\n\nvoid wasm2c_fac_instantiate(w2c_fac*);\nvoid wasm2c_fac_free(w2c_fac*);\nwasm_rt_func_type_t wasm2c_fac_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\n/* export: 'fac' */\nu32 w2c_fac_fac(w2c_fac*, u32);\n```\n\n## Handling other kinds of imports and exports of modules\n\nExported functions are handled by declaring a prefixed equivalent\nfunction in the header. If a module imports a function, `wasm2c`\ndeclares the function in the output header file, and the host function\nis responsible for defining the function.\n\nExports of other kinds (globals, memories, tables) are handled\ndifferently, since they are part of the module instance, and each\ninstance can have its own exports. For these cases, `wasm2c` provides\na function that takes in a module instance as argument, and returns\nthe corresponding export. For example, if `fac` exported a memory as\nsuch:\n\n```wasm\n(export \"mem\" (memory $mem))\n```\n\nthen `wasm2c` would declare the following function in the header:\n\n```c\n/* export: 'mem' */\nwasm_rt_memory_t* w2c_fac_mem(w2c_fac* instance);\n\n```\n\nwhich would be defined as:\n```c\n/* export: 'mem' */\nwasm_rt_memory_t* w2c_fac_mem(w2c_fac* instance) {\n  return &instance->w2c_mem;\n}\n```\n\n## A quick look at `fac.c`\n\nThe contents of `fac.c` are internals, but it is useful to see a little about\nhow it works.\n\nThe first few hundred lines define macros that are used to implement the\nvarious WebAssembly instructions. Their implementations may be interesting to\nthe curious reader, but are out of scope for this document.\n\nFollowing those definitions are various initialization functions (`init`, `free`,\n`init_func_types`, `init_globals`, `init_memory`, `init_table`, and\n`init_exports`.) In our example, most of these functions are empty, since the\nmodule doesn't use any globals, memory or tables.\n\nThe most interesting part is the definition of the function `fac`:\n\n```c\nstatic u32 w2c_fac_fac_0(w2c_fac* instance, u32 var_p0) {\n  FUNC_PROLOGUE;\n  u32 var_i0, var_i1, var_i2;\n  var_i0 = var_p0;\n  var_i1 = 0u;\n  var_i0 = var_i0 == var_i1;\n  if (var_i0) {\n    var_i0 = 1u;\n  } else {\n    var_i0 = var_p0;\n    var_i1 = var_p0;\n    var_i2 = 1u;\n    var_i1 -= var_i2;\n    var_i1 = w2c_fac_fac_0(instance, var_i1);\n    var_i0 *= var_i1;\n  }\n  FUNC_EPILOGUE;\n  return var_i0;\n}\n```\n\nIf you look at the original WebAssembly text in the flat format, you can see\nthat there is a 1-1 mapping in the output:\n\n```wasm\n(func $fac (param $x i32) (result i32)\n  local.get $x\n  i32.const 0\n  i32.eq\n  if (result i32)\n    i32.const 1\n  else\n    local.get $x\n    local.get $x\n    i32.const 1\n    i32.sub\n    call 0\n    i32.mul\n  end)\n```\n\nThis looks different than the factorial function above because it is using the\n\"flat format\" instead of the \"folded format\". You can use `wat-desugar` to\nconvert between the two to be sure:\n\n```sh\n$ wat-desugar fac-flat.wat --fold -o fac-folded.wat\n```\n\n```wasm\n(module\n  (func (;0;) (param i32) (result i32)\n    (if (result i32)  ;; label = @1\n      (i32.eq\n        (local.get 0)\n        (i32.const 0))\n      (then\n        (i32.const 1))\n      (else\n        (i32.mul\n          (local.get 0)\n          (call 0\n            (i32.sub\n              (local.get 0)\n              (i32.const 1)))))))\n  (export \"fac\" (func 0))\n  (type (;0;) (func (param i32) (result i32))))\n```\n\nThe formatting is different and the variable and function names are gone, but\nthe structure is the same.\n\n## Create multiple instances of a module\n\nSince information about the execution context, such as memories, is encapsulated\nin the module instance structure, and a pointer to the structure is being passed through \nfunction calls, multiple instances of the same module can be instantiated alongside\none another.\n\nWe can take a look at another version of the `main` function for a `rot13` example. By \ndeclaring two sets of context information, two instances of `rot13` can be instantiated \nin the same address space.\n\n```c\n#include <assert.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"rot13.h\"\n\n/* Define structure to hold the imports */\ntypedef struct w2c_host {\n  wasm_rt_memory_t memory;\n  char* input;\n} w2c_host;\n\n/* Accessor to access the memory member of the host */\nwasm_rt_memory_t* w2c_host_mem(w2c_host* instance) {\n  return &instance->memory;\n}\n\nint main(int argc, char** argv) {\n  /* Make sure there is at least one command-line argument. */\n  if (argc < 2) {\n    printf(\"Invalid argument. Expected '%s WORD...'\\n\", argv[0]);\n    return 1;\n  }\n  /* Initialize the Wasm runtime. */\n  wasm_rt_init();\n\n  /* Create two `host` instances to store the memory and current string */\n  w2c_host host_1, host_2;\n  wasm_rt_allocate_memory(&host_1.memory, 1, 1, false, WASM_DEFAULT_PAGE_SIZE);\n  wasm_rt_allocate_memory(&host_2.memory, 1, 1, false, WASM_DEFAULT_PAGE_SIZE);\n\n  /* Construct the `rot13` module instances */\n  w2c_rot13 rot13_1, rot13_2;\n  wasm2c_rot13_instantiate(&rot13_1, &host_1);\n  wasm2c_rot13_instantiate(&rot13_2, &host_2);\n\n  /* Call `rot13` on the first two arguments. */\n  assert(argc > 2);\n  host_1.input = argv[1];\n  w2c_rot13_rot13(&rot13_1);\n  host_2.input = argv[2];\n  w2c_rot13_rot13(&rot13_2);\n\n  /* Free the rot13 instances. */\n  wasm2c_rot13_free(&rot13_1);\n  wasm2c_rot13_free(&rot13_2);\n\n  /* Free the Wasm runtime state. */\n  wasm_rt_free();\n\n  return 0;\n}\n\n/* Fill the wasm buffer with the input to be rot13'd.\n *\n * params:\n *   instance: An instance of the w2c_host structure\n *   ptr: The wasm memory address of the buffer to fill data.\n *   size: The size of the buffer in wasm memory.\n * result:\n *   The number of bytes filled into the buffer. (Must be <= size).\n */\nu32 w2c_host_fill_buf(w2c_host* instance, u32 ptr, u32 size) {\n  for (size_t i = 0; i < size; ++i) {\n    if (instance->input[i] == 0) {\n      return i;\n    }\n    instance->memory.data[ptr + i] = instance->input[i];\n  }\n  return size;\n}\n\n/* Called when the wasm buffer has been rot13'd.\n *\n * params:\n *   w2c_host: An instance of the w2c_host structure\n *   ptr: The wasm memory address of the buffer.\n *   size: The size of the buffer in wasm memory.\n */\nvoid w2c_host_buf_done(w2c_host* instance, u32 ptr, u32 size) {\n  /* The output buffer is not necessarily null-terminated, so use the %*.s\n   * printf format to limit the number of characters printed. */\n  printf(\"%s -> %.*s\\n\", instance->input, (int)size, &instance->memory.data[ptr]);\n}\n```\n"
  },
  {
    "path": "wasm2c/examples/callback/Makefile",
    "content": "# Use implicit rules for compiling C files.\nCFLAGS=-I../..\nLDLIBS=-lm\n\nall: callback\n\nclean:\n\trm -rf callback callback.wasm callback.c callback.h *.o\n\ncallback: main.o callback.o ../../wasm-rt-impl.o ../../wasm-rt-mem-impl.o\n\ncallback.wasm: callback.wat ../../../bin/wat2wasm\n\t../../../bin/wat2wasm --debug-names $< -o $@\n\ncallback.c: callback.wasm ../../../bin/wasm2c\n\t../../../bin/wasm2c $< -o $@ --disable-simd\n\n.PHONY: all clean\n"
  },
  {
    "path": "wasm2c/examples/callback/callback.wat",
    "content": ";; Module demonstrating use of a host-installed callback function.\n\n;; The type of the callback function. The type ID can be looked up outside the module by calling\n;; wasm2c_[modname]_get_func_type(1, 0, WASM_RT_I32) (indicating 1 param, 0 results, param type is i32).\n(type $print_type (func (param i32)))\n\n;; An indirect function table to hold the callback function\n(table $table 1 funcref)\n\n;; A memory holding the string to be printed\n(memory (export \"memory\") (data \"Hello, world.\\00\"))\n\n;; Allow the host to set the callback function\n(func (export \"set_print_function\") (param funcref)\n      (table.set $table (i32.const 0) (local.get 0)))\n\n;; Call the callback function with the location of \"Hello, world.\"\n(func (export \"say_hello\")\n      (call_indirect (type $print_type) (i32.const 0) (i32.const 0)))\n"
  },
  {
    "path": "wasm2c/examples/callback/main.c",
    "content": "#include <stdio.h>\n\n#include \"callback.h\"\n\n/*\n * The callback function. Prints the null-terminated string at the given\n * location in the instance's exported memory.\n */\nvoid print(w2c_callback* instance, uint32_t ptr) {\n  puts(w2c_callback_memory(instance)->data + ptr);\n}\n\nint main(int argc, char** argv) {\n  /* Initialize the Wasm runtime. */\n  wasm_rt_init();\n\n  /* Instantiate the callback module. */\n  w2c_callback inst;\n  wasm2c_callback_instantiate(&inst);\n\n  /*\n   * Call the module's \"set_print_function\" function, which takes a funcref to\n   * the callback. A funcref has three members: the function type (which can be\n   * looked up with \"Z_callback_get_func_type\"), a pointer to the function, and\n   * a module instance pointer that will be passed to the function when called.\n   */\n  wasm_rt_func_type_t fn_type =\n      wasm2c_callback_get_func_type(1, 0, WASM_RT_I32);\n  wasm_rt_funcref_t fn_ref = {\n      fn_type, (wasm_rt_function_ptr_t)print, {NULL}, &inst};\n  w2c_callback_set_print_function(&inst, fn_ref);\n\n  /* \"say_hello\" uses the previously installed callback. */\n  w2c_callback_say_hello(&inst);\n\n  /* Free the module instance and the Wasm runtime state. */\n  wasm2c_callback_free(&inst);\n  wasm_rt_free();\n\n  return 0;\n}\n"
  },
  {
    "path": "wasm2c/examples/fac/Makefile",
    "content": "# Use implicit rules for compiling C files.\nCFLAGS=-I../..\nLDLIBS=-lm\n\nall: fac\n\nclean:\n\trm -rf fac fac.wasm fac.c *.o\n\nfac: main.o fac.o ../../wasm-rt-impl.o\n\nfac.wasm: fac.wat ../../../bin/wat2wasm\n\t../../../bin/wat2wasm $< -o $@\n\nfac.c: fac.wasm ../../../bin/wasm2c\n\t../../../bin/wasm2c $< -o $@ --disable-simd\n\n.PHONY: all clean\n"
  },
  {
    "path": "wasm2c/examples/fac/fac.c",
    "content": "/* Automatically generated by wasm2c */\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n#if defined(__MINGW32__)\n#include <malloc.h>\n#elif defined(_MSC_VER)\n#include <intrin.h>\n#include <malloc.h>\n#define alloca _alloca\n#elif defined(__FreeBSD__) || defined(__OpenBSD__)\n#include <stdlib.h>\n#else\n#include <alloca.h>\n#endif\n\n#include \"fac.h\"\n\n// Computes a pointer to an object of the given size in a little-endian memory.\n//\n// On a little-endian host, this is just &mem->data[addr] - the object's size is\n// unused. On a big-endian host, it's &mem->data[mem->size - addr - n], where n\n// is the object's size.\n//\n// Note that mem may be evaluated multiple times.\n//\n// Parameters:\n// mem - The memory.\n// addr - The address.\n// n - The size of the object.\n//\n// Result:\n// A pointer for an object of size n.\n#if WABT_BIG_ENDIAN\n#define MEM_ADDR(mem, addr, n) ((mem)->data_end - (addr) - (n))\n#else\n#define MEM_ADDR(mem, addr, n) &((mem)->data[addr])\n#endif\n\n// We can only use Segue for this module if it uses a single unshared imported\n// or exported memory\n#if WASM_RT_USE_SEGUE && IS_SINGLE_UNSHARED_MEMORY\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 1\n#else\n#define WASM_RT_USE_SEGUE_FOR_THIS_MODULE 0\n#endif\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE\n// POSIX uses FS for TLS, GS is free\nstatic inline void* wasm_rt_segue_read_base() {\n  if (wasm_rt_fsgsbase_inst_supported) {\n    return (void*)__builtin_ia32_rdgsbase64();\n  } else {\n    return wasm_rt_syscall_get_segue_base();\n  }\n}\nstatic inline void wasm_rt_segue_write_base(void* base) {\n#if WASM_RT_SEGUE_FREE_SEGMENT\n  if (wasm_rt_last_segment_val == base) {\n    return;\n  }\n\n  wasm_rt_last_segment_val = base;\n#endif\n\n  if (wasm_rt_fsgsbase_inst_supported) {\n    __builtin_ia32_wrgsbase64((uintptr_t)base);\n  } else {\n    wasm_rt_syscall_set_segue_base(base);\n  }\n}\n#define MEM_ADDR_MEMOP(mem, addr, n) ((uint8_t __seg_gs*)(uintptr_t)addr)\n#else\n#define MEM_ADDR_MEMOP(mem, addr, n) MEM_ADDR(mem, addr, n)\n#endif\n\n#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)\n\n#if WASM_RT_STACK_DEPTH_COUNT\n#define FUNC_PROLOGUE                                            \\\n  if (++wasm_rt_call_stack_depth > WASM_RT_MAX_CALL_STACK_DEPTH) \\\n    TRAP(EXHAUSTION);\n\n#define FUNC_EPILOGUE --wasm_rt_call_stack_depth\n#else\n#define FUNC_PROLOGUE\n\n#define FUNC_EPILOGUE\n#endif\n\n#define UNREACHABLE TRAP(UNREACHABLE)\n\nstatic inline bool func_types_eq(const wasm_rt_func_type_t a,\n                                 const wasm_rt_func_type_t b) {\n  return (a == b) || LIKELY(a && b && !memcmp(a, b, 32));\n}\n\n#define CHECK_CALL_INDIRECT(table, ft, x)                \\\n  (LIKELY((x) < table.size && table.data[x].func &&      \\\n          func_types_eq(ft, table.data[x].func_type)) || \\\n   TRAP(CALL_INDIRECT))\n\n#define DO_CALL_INDIRECT(table, t, x, ...) ((t)table.data[x].func)(__VA_ARGS__)\n\n#define CALL_INDIRECT(table, t, ft, x, ...) \\\n  (CHECK_CALL_INDIRECT(table, ft, x),       \\\n   DO_CALL_INDIRECT(table, t, x, __VA_ARGS__))\n\nstatic inline bool add_overflow(uint64_t a, uint64_t b, uint64_t* resptr) {\n#if __has_builtin(__builtin_add_overflow)\n  return __builtin_add_overflow(a, b, resptr);\n#elif defined(_MSC_VER)\n  return _addcarry_u64(0, a, b, resptr);\n#else\n#error \"Missing implementation of __builtin_add_overflow or _addcarry_u64\"\n#endif\n}\n\n#define RANGE_CHECK(mem, offset, len)              \\\n  do {                                             \\\n    uint64_t res;                                  \\\n    if (UNLIKELY(add_overflow(offset, len, &res))) \\\n      TRAP(OOB);                                   \\\n    if (UNLIKELY(res > (mem)->size))               \\\n      TRAP(OOB);                                   \\\n  } while (0);\n\n#if WASM_RT_USE_SEGUE_FOR_THIS_MODULE && WASM_RT_SANITY_CHECKS\n#include <stdio.h>\n#define WASM_RT_CHECK_BASE(mem)                                               \\\n  if (((uintptr_t)((mem)->data)) != ((uintptr_t)wasm_rt_segue_read_base())) { \\\n    puts(\"Segment register mismatch\\n\");                                      \\\n    abort();                                                                  \\\n  }\n#else\n#define WASM_RT_CHECK_BASE(mem)\n#endif\n\n// MEMCHECK_DEFAULT32 is an \"accelerated\" MEMCHECK used only for\n// default-page-size, 32-bit memories. It may do nothing at all\n// (if hardware bounds-checking is enabled via guard pages)\n// or it may do a slightly faster RANGE_CHECK.\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n#define MEMCHECK_DEFAULT32(mem, a, t) WASM_RT_CHECK_BASE(mem);\n#else\n#define MEMCHECK_DEFAULT32(mem, a, t)                \\\n  WASM_RT_CHECK_BASE(mem);                           \\\n  if (UNLIKELY(a + (uint64_t)sizeof(t) > mem->size)) \\\n    TRAP(OOB);\n#endif\n\n// MEMCHECK_GENERAL can be used for any memory\n#define MEMCHECK_GENERAL(mem, a, t) \\\n  WASM_RT_CHECK_BASE(mem);          \\\n  RANGE_CHECK(mem, a, sizeof(t));\n\n#ifdef __GNUC__\n#define FORCE_READ_INT(var) __asm__(\"\" ::\"r\"(var));\n// Clang on Mips requires \"f\" constraints on floats\n// See https://github.com/llvm/llvm-project/issues/64241\n#if defined(__clang__) && \\\n    (defined(mips) || defined(__mips__) || defined(__mips))\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"f\"(var));\n#else\n#define FORCE_READ_FLOAT(var) __asm__(\"\" ::\"r\"(var));\n#endif\n#else\n#define FORCE_READ_INT(var)\n#define FORCE_READ_FLOAT(var)\n#endif\n\nstatic inline void load_data(u8* dest, const u8* src, size_t n) {\n  if (!n) {\n    return;\n  }\n#if WABT_BIG_ENDIAN\n  for (size_t i = 0; i < n; i++) {\n    dest[i] = src[n - i - 1];\n  }\n#else\n  wasm_rt_memcpy(dest, src, n);\n#endif\n}\n\n#define LOAD_DATA(m, o, i, s)            \\\n  do {                                   \\\n    RANGE_CHECK((&m), o, s);             \\\n    load_data(MEM_ADDR(&m, o, s), i, s); \\\n  } while (0)\n\n#define DEF_MEM_CHECKS0(name, shared, mem_type, ret_kw, return_type)         \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr) {                     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr) { \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr);                                      \\\n  }\n\n#define DEF_MEM_CHECKS1(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1)                                           \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1) {     \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1) {                           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1);                                \\\n  }\n\n#define DEF_MEM_CHECKS2(name, shared, mem_type, ret_kw, return_type,         \\\n                        val_type1, val_type2)                                \\\n  static inline return_type name##_default32(wasm_rt##shared##memory_t* mem, \\\n                                             u64 addr, val_type1 val1,       \\\n                                             val_type2 val2) {               \\\n    MEMCHECK_DEFAULT32(mem, addr, mem_type);                                 \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }                                                                          \\\n  static inline return_type name(wasm_rt##shared##memory_t* mem, u64 addr,   \\\n                                 val_type1 val1, val_type2 val2) {           \\\n    MEMCHECK_GENERAL(mem, addr, mem_type);                                   \\\n    ret_kw name##_unchecked(mem, addr, val1, val2);                          \\\n  }\n\n#define DEFINE_LOAD(name, t1, t2, t3, force_read)                      \\\n  static inline t3 name##_unchecked(wasm_rt_memory_t* mem, u64 addr) { \\\n    t1 result;                                                         \\\n    wasm_rt_memcpy(&result, MEM_ADDR_MEMOP(mem, addr, sizeof(t1)),     \\\n                   sizeof(t1));                                        \\\n    force_read(result);                                                \\\n    return (t3)(t2)result;                                             \\\n  }                                                                    \\\n  DEF_MEM_CHECKS0(name, _, t1, return, t3)\n\n#define DEFINE_STORE(name, t1, t2)                                     \\\n  static inline void name##_unchecked(wasm_rt_memory_t* mem, u64 addr, \\\n                                      t2 value) {                      \\\n    t1 wrapped = (t1)value;                                            \\\n    wasm_rt_memcpy(MEM_ADDR_MEMOP(mem, addr, sizeof(t1)), &wrapped,    \\\n                   sizeof(t1));                                        \\\n  }                                                                    \\\n  DEF_MEM_CHECKS1(name, _, t1, , void, t2)\n\nDEFINE_LOAD(i32_load, u32, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load, u64, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(f32_load, f32, f32, f32, FORCE_READ_FLOAT)\nDEFINE_LOAD(f64_load, f64, f64, f64, FORCE_READ_FLOAT)\nDEFINE_LOAD(i32_load8_s, s8, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_s, s8, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load8_u, u8, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load8_u, u8, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_s, s16, s32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_s, s16, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i32_load16_u, u16, u32, u32, FORCE_READ_INT)\nDEFINE_LOAD(i64_load16_u, u16, u64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_s, s32, s64, u64, FORCE_READ_INT)\nDEFINE_LOAD(i64_load32_u, u32, u64, u64, FORCE_READ_INT)\nDEFINE_STORE(i32_store, u32, u32)\nDEFINE_STORE(i64_store, u64, u64)\nDEFINE_STORE(f32_store, f32, f32)\nDEFINE_STORE(f64_store, f64, f64)\nDEFINE_STORE(i32_store8, u8, u32)\nDEFINE_STORE(i32_store16, u16, u32)\nDEFINE_STORE(i64_store8, u8, u64)\nDEFINE_STORE(i64_store16, u16, u64)\nDEFINE_STORE(i64_store32, u32, u64)\n\n#if defined(_MSC_VER)\n\n// Adapted from\n// https://github.com/nemequ/portable-snippets/blob/master/builtin/builtin.h\n\nstatic inline int I64_CLZ(unsigned long long v) {\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  if (_BitScanReverse64(&r, v)) {\n    return 63 - r;\n  }\n#else\n  if (_BitScanReverse(&r, (unsigned long)(v >> 32))) {\n    return 31 - r;\n  } else if (_BitScanReverse(&r, (unsigned long)v)) {\n    return 63 - r;\n  }\n#endif\n  return 64;\n}\n\nstatic inline int I32_CLZ(unsigned long v) {\n  unsigned long r = 0;\n  if (_BitScanReverse(&r, v)) {\n    return 31 - r;\n  }\n  return 32;\n}\n\nstatic inline int I64_CTZ(unsigned long long v) {\n  if (!v) {\n    return 64;\n  }\n  unsigned long r = 0;\n#if defined(_M_AMD64) || defined(_M_ARM)\n  _BitScanForward64(&r, v);\n  return (int)r;\n#else\n  if (_BitScanForward(&r, (unsigned int)(v))) {\n    return (int)(r);\n  }\n\n  _BitScanForward(&r, (unsigned int)(v >> 32));\n  return (int)(r + 32);\n#endif\n}\n\nstatic inline int I32_CTZ(unsigned long v) {\n  if (!v) {\n    return 32;\n  }\n  unsigned long r = 0;\n  _BitScanForward(&r, v);\n  return (int)r;\n}\n\n#define POPCOUNT_DEFINE_PORTABLE(f_n, T)                            \\\n  static inline u32 f_n(T x) {                                      \\\n    x = x - ((x >> 1) & (T) ~(T)0 / 3);                             \\\n    x = (x & (T) ~(T)0 / 15 * 3) + ((x >> 2) & (T) ~(T)0 / 15 * 3); \\\n    x = (x + (x >> 4)) & (T) ~(T)0 / 255 * 15;                      \\\n    return (T)(x * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;       \\\n  }\n\nPOPCOUNT_DEFINE_PORTABLE(I32_POPCNT, u32)\nPOPCOUNT_DEFINE_PORTABLE(I64_POPCNT, u64)\n\n#undef POPCOUNT_DEFINE_PORTABLE\n\n#else\n\n#define I32_CLZ(x) ((x) ? __builtin_clz(x) : 32)\n#define I64_CLZ(x) ((x) ? __builtin_clzll(x) : 64)\n#define I32_CTZ(x) ((x) ? __builtin_ctz(x) : 32)\n#define I64_CTZ(x) ((x) ? __builtin_ctzll(x) : 64)\n#define I32_POPCNT(x) (__builtin_popcount(x))\n#define I64_POPCNT(x) (__builtin_popcountll(x))\n\n#endif\n\n#define DIV_S(ut, min, x, y)                                  \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO)  \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? TRAP(INT_OVERFLOW) \\\n                                         : (ut)((x) / (y)))\n\n#define REM_S(ut, min, x, y)                                 \\\n  ((UNLIKELY((y) == 0))                  ? TRAP(DIV_BY_ZERO) \\\n   : (UNLIKELY((x) == min && (y) == -1)) ? 0                 \\\n                                         : (ut)((x) % (y)))\n\n#define I32_DIV_S(x, y) DIV_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_DIV_S(x, y) DIV_S(u64, INT64_MIN, (s64)x, (s64)y)\n#define I32_REM_S(x, y) REM_S(u32, INT32_MIN, (s32)x, (s32)y)\n#define I64_REM_S(x, y) REM_S(u64, INT64_MIN, (s64)x, (s64)y)\n\n#define DIVREM_U(op, x, y) \\\n  ((UNLIKELY((y) == 0)) ? TRAP(DIV_BY_ZERO) : ((x)op(y)))\n\n#define DIV_U(x, y) DIVREM_U(/, x, y)\n#define REM_U(x, y) DIVREM_U(%, x, y)\n\n#define ROTL(x, y, mask) \\\n  (((x) << ((y) & (mask))) | ((x) >> (((mask) - (y) + 1) & (mask))))\n#define ROTR(x, y, mask) \\\n  (((x) >> ((y) & (mask))) | ((x) << (((mask) - (y) + 1) & (mask))))\n\n#define I32_ROTL(x, y) ROTL(x, y, 31)\n#define I64_ROTL(x, y) ROTL(x, y, 63)\n#define I32_ROTR(x, y) ROTR(x, y, 31)\n#define I64_ROTR(x, y) ROTR(x, y, 63)\n\n#define FMIN(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? x : y) \\\n   : (x < y)                          ? x                    \\\n                                      : y)\n\n#define FMAX(x, y)                                           \\\n  ((UNLIKELY((x) != (x)))             ? NAN                  \\\n   : (UNLIKELY((y) != (y)))           ? NAN                  \\\n   : (UNLIKELY((x) == 0 && (y) == 0)) ? (signbit(x) ? y : x) \\\n   : (x > y)                          ? x                    \\\n                                      : y)\n\n#define TRUNC_S(ut, st, ft, min, minop, max, x)                             \\\n  ((UNLIKELY((x) != (x)))                        ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x)minop(min) && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                 : (ut)(st)(x))\n\n#define I32_TRUNC_S_F32(x) \\\n  TRUNC_S(u32, s32, f32, (f32)INT32_MIN, >=, 2147483648.f, x)\n#define I64_TRUNC_S_F32(x) \\\n  TRUNC_S(u64, s64, f32, (f32)INT64_MIN, >=, (f32)INT64_MAX, x)\n#define I32_TRUNC_S_F64(x) \\\n  TRUNC_S(u32, s32, f64, -2147483649., >, 2147483648., x)\n#define I64_TRUNC_S_F64(x) \\\n  TRUNC_S(u64, s64, f64, (f64)INT64_MIN, >=, (f64)INT64_MAX, x)\n\n#define TRUNC_U(ut, ft, max, x)                                              \\\n  ((UNLIKELY((x) != (x)))                         ? TRAP(INVALID_CONVERSION) \\\n   : (UNLIKELY(!((x) > (ft) - 1 && (x) < (max)))) ? TRAP(INT_OVERFLOW)       \\\n                                                  : (ut)(x))\n\n#define I32_TRUNC_U_F32(x) TRUNC_U(u32, f32, 4294967296.f, x)\n#define I64_TRUNC_U_F32(x) TRUNC_U(u64, f32, (f32)UINT64_MAX, x)\n#define I32_TRUNC_U_F64(x) TRUNC_U(u32, f64, 4294967296., x)\n#define I64_TRUNC_U_F64(x) TRUNC_U(u64, f64, (f64)UINT64_MAX, x)\n\n#define TRUNC_SAT_S(ut, st, ft, min, smin, minop, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))         ? 0                           \\\n   : (UNLIKELY(!((x)minop(min)))) ? smin                        \\\n   : (UNLIKELY(!((x) < (max))))   ? smax                        \\\n                                  : (ut)(st)(x))\n\n#define I32_TRUNC_SAT_S_F32(x)                                            \\\n  TRUNC_SAT_S(u32, s32, f32, (f32)INT32_MIN, INT32_MIN, >=, 2147483648.f, \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F32(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f32, (f32)INT64_MIN, INT64_MIN, >=, (f32)INT64_MAX, \\\n              INT64_MAX, x)\n#define I32_TRUNC_SAT_S_F64(x)                                        \\\n  TRUNC_SAT_S(u32, s32, f64, -2147483649., INT32_MIN, >, 2147483648., \\\n              INT32_MAX, x)\n#define I64_TRUNC_SAT_S_F64(x)                                              \\\n  TRUNC_SAT_S(u64, s64, f64, (f64)INT64_MIN, INT64_MIN, >=, (f64)INT64_MAX, \\\n              INT64_MAX, x)\n\n#define TRUNC_SAT_U(ut, ft, max, smax, x) \\\n  ((UNLIKELY((x) != (x)))          ? 0    \\\n   : (UNLIKELY(!((x) > (ft) - 1))) ? 0    \\\n   : (UNLIKELY(!((x) < (max))))    ? smax \\\n                                   : (ut)(x))\n\n#define I32_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u32, f32, 4294967296.f, UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F32(x) \\\n  TRUNC_SAT_U(u64, f32, (f32)UINT64_MAX, UINT64_MAX, x)\n#define I32_TRUNC_SAT_U_F64(x) TRUNC_SAT_U(u32, f64, 4294967296., UINT32_MAX, x)\n#define I64_TRUNC_SAT_U_F64(x) \\\n  TRUNC_SAT_U(u64, f64, (f64)UINT64_MAX, UINT64_MAX, x)\n\n#define DEFINE_REINTERPRET(name, t1, t2)         \\\n  static inline t2 name(t1 x) {                  \\\n    t2 result;                                   \\\n    wasm_rt_memcpy(&result, &x, sizeof(result)); \\\n    return result;                               \\\n  }\n\nDEFINE_REINTERPRET(f32_reinterpret_i32, u32, f32)\nDEFINE_REINTERPRET(i32_reinterpret_f32, f32, u32)\nDEFINE_REINTERPRET(f64_reinterpret_i64, u64, f64)\nDEFINE_REINTERPRET(i64_reinterpret_f64, f64, u64)\n\nstatic float quiet_nanf(float x) {\n  uint32_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 4);\n  tmp |= 0x7fc00000lu;\n  wasm_rt_memcpy(&x, &tmp, 4);\n  return x;\n}\n\nstatic double quiet_nan(double x) {\n  uint64_t tmp;\n  wasm_rt_memcpy(&tmp, &x, 8);\n  tmp |= 0x7ff8000000000000llu;\n  wasm_rt_memcpy(&x, &tmp, 8);\n  return x;\n}\n\nstatic double wasm_quiet(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return x;\n}\n\nstatic float wasm_quietf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return x;\n}\n\nstatic double wasm_floor(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return floor(x);\n}\n\nstatic float wasm_floorf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return floorf(x);\n}\n\nstatic double wasm_ceil(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return ceil(x);\n}\n\nstatic float wasm_ceilf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return ceilf(x);\n}\n\nstatic double wasm_trunc(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return trunc(x);\n}\n\nstatic float wasm_truncf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return truncf(x);\n}\n\nstatic float wasm_nearbyintf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return nearbyintf(x);\n}\n\nstatic double wasm_nearbyint(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return nearbyint(x);\n}\n\nstatic float wasm_fabsf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    uint32_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 4);\n    tmp = tmp & ~(1UL << 31);\n    wasm_rt_memcpy(&x, &tmp, 4);\n    return x;\n  }\n  return fabsf(x);\n}\n\nstatic double wasm_fabs(double x) {\n  if (UNLIKELY(isnan(x))) {\n    uint64_t tmp;\n    wasm_rt_memcpy(&tmp, &x, 8);\n    tmp = tmp & ~(1ULL << 63);\n    wasm_rt_memcpy(&x, &tmp, 8);\n    return x;\n  }\n  return fabs(x);\n}\n\nstatic double wasm_sqrt(double x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nan(x);\n  }\n  return sqrt(x);\n}\n\nstatic float wasm_sqrtf(float x) {\n  if (UNLIKELY(isnan(x))) {\n    return quiet_nanf(x);\n  }\n  return sqrtf(x);\n}\n\nstatic inline void memory_fill(wasm_rt_memory_t* mem, u64 d, u32 val, u64 n) {\n  RANGE_CHECK(mem, d, n);\n  memset(MEM_ADDR(mem, d, n), val, n);\n}\n\nstatic inline void memory_copy(wasm_rt_memory_t* dest,\n                               const wasm_rt_memory_t* src,\n                               u64 dest_addr,\n                               u64 src_addr,\n                               u64 n) {\n  RANGE_CHECK(dest, dest_addr, n);\n  RANGE_CHECK(src, src_addr, n);\n  memmove(MEM_ADDR(dest, dest_addr, n), MEM_ADDR(src, src_addr, n), n);\n}\n\nstatic inline void memory_init(wasm_rt_memory_t* dest,\n                               const u8* src,\n                               u32 src_size,\n                               u64 dest_addr,\n                               u32 src_addr,\n                               u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  LOAD_DATA((*dest), dest_addr, src + src_addr, n);\n}\n\ntypedef enum { RefFunc, RefNull, GlobalGet } wasm_elem_segment_expr_type_t;\n\ntypedef struct {\n  wasm_elem_segment_expr_type_t expr_type;\n  wasm_rt_func_type_t type;\n  wasm_rt_function_ptr_t func;\n  wasm_rt_tailcallee_t func_tailcallee;\n  size_t module_offset;\n} wasm_elem_segment_expr_t;\n\nstatic inline void funcref_table_init(wasm_rt_funcref_table_t* dest,\n                                      const wasm_elem_segment_expr_t* src,\n                                      u32 src_size,\n                                      u64 dest_addr,\n                                      u32 src_addr,\n                                      u32 n,\n                                      void* module_instance) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    const wasm_elem_segment_expr_t* const src_expr = &src[src_addr + i];\n    wasm_rt_funcref_t* const dest_val = &(dest->data[dest_addr + i]);\n    switch (src_expr->expr_type) {\n      case RefFunc:\n        *dest_val = (wasm_rt_funcref_t){\n            src_expr->type, src_expr->func, src_expr->func_tailcallee,\n            (char*)module_instance + src_expr->module_offset};\n        break;\n      case RefNull:\n        *dest_val = wasm_rt_funcref_null_value;\n        break;\n      case GlobalGet:\n        *dest_val = **(wasm_rt_funcref_t**)((char*)module_instance +\n                                            src_expr->module_offset);\n        break;\n    }\n  }\n}\n\n// Currently wasm2c only supports initializing externref tables with ref.null.\nstatic inline void externref_table_init(wasm_rt_externref_table_t* dest,\n                                        u32 src_size,\n                                        u64 dest_addr,\n                                        u32 src_addr,\n                                        u32 n) {\n  if (UNLIKELY(src_addr + (uint64_t)n > src_size))\n    TRAP(OOB);\n  RANGE_CHECK(dest, dest_addr, n);\n  for (u32 i = 0; i < n; i++) {\n    dest->data[dest_addr + i] = wasm_rt_externref_null_value;\n  }\n}\n\n#define DEFINE_TABLE_COPY(type)                                              \\\n  static inline void type##_table_copy(wasm_rt_##type##_table_t* dest,       \\\n                                       const wasm_rt_##type##_table_t* src,  \\\n                                       u64 dest_addr, u64 src_addr, u64 n) { \\\n    RANGE_CHECK(dest, dest_addr, n);                                         \\\n    RANGE_CHECK(src, src_addr, n);                                           \\\n    memmove(dest->data + dest_addr, src->data + src_addr,                    \\\n            n * sizeof(wasm_rt_##type##_t));                                 \\\n  }\n\nDEFINE_TABLE_COPY(funcref)\nDEFINE_TABLE_COPY(externref)\n\n#define DEFINE_TABLE_GET(type)                        \\\n  static inline wasm_rt_##type##_t type##_table_get(  \\\n      const wasm_rt_##type##_table_t* table, u64 i) { \\\n    if (UNLIKELY(i >= table->size))                   \\\n      TRAP(OOB);                                      \\\n    return table->data[i];                            \\\n  }\n\nDEFINE_TABLE_GET(funcref)\nDEFINE_TABLE_GET(externref)\n\n#define DEFINE_TABLE_SET(type)                                               \\\n  static inline void type##_table_set(const wasm_rt_##type##_table_t* table, \\\n                                      u64 i, const wasm_rt_##type##_t val) { \\\n    if (UNLIKELY(i >= table->size))                                          \\\n      TRAP(OOB);                                                             \\\n    table->data[i] = val;                                                    \\\n  }\n\nDEFINE_TABLE_SET(funcref)\nDEFINE_TABLE_SET(externref)\n\n#define DEFINE_TABLE_FILL(type)                                               \\\n  static inline void type##_table_fill(const wasm_rt_##type##_table_t* table, \\\n                                       u64 d, const wasm_rt_##type##_t val,   \\\n                                       u64 n) {                               \\\n    RANGE_CHECK(table, d, n);                                                 \\\n    for (uint32_t i = d; i < d + n; i++) {                                    \\\n      table->data[i] = val;                                                   \\\n    }                                                                         \\\n  }\n\nDEFINE_TABLE_FILL(funcref)\nDEFINE_TABLE_FILL(externref)\n\n#if defined(__GNUC__) || defined(__clang__)\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char* const x\n#define FUNC_TYPE_EXTERN_T(x) const char* const x\n#define FUNC_TYPE_T(x) static const char* const x\n#else\n#define FUNC_TYPE_DECL_EXTERN_T(x) extern const char x[]\n#define FUNC_TYPE_EXTERN_T(x) const char x[]\n#define FUNC_TYPE_T(x) static const char x[]\n#endif\n\n#if (__STDC_VERSION__ < 201112L) && !defined(static_assert)\n#define static_assert(X) \\\n  extern int(*assertion(void))[!!sizeof(struct { int x : (X) ? 2 : -1; })];\n#endif\n\n#ifdef _MSC_VER\n#define WEAK_FUNC_DECL(func, fallback)                             \\\n  __pragma(comment(linker, \"/alternatename:\" #func \"=\" #fallback)) \\\n                                                                   \\\n      void                                                         \\\n      fallback(void** instance_ptr, void* tail_call_stack,         \\\n               wasm_rt_tailcallee_t* next)\n#else\n#define WEAK_FUNC_DECL(func, fallback)                                        \\\n  __attribute__((weak)) void func(void** instance_ptr, void* tail_call_stack, \\\n                                  wasm_rt_tailcallee_t* next)\n#endif\n\nstatic u32 w2c_fac_fac_0(w2c_fac*, u32);\n\nFUNC_TYPE_T(w2c_fac_t0) = \"\\x07\\x80\\x96\\x7a\\x42\\xf7\\x3e\\xe6\\x70\\x5c\\x2f\\xac\\x83\\xf5\\x67\\xd2\\xa2\\xa0\\x69\\x41\\x5f\\xf8\\xe7\\x96\\x7f\\x23\\xab\\x00\\x03\\x5f\\x4a\\x3c\";\n\n/* export: 'fac' */\nu32 w2c_fac_fac(w2c_fac* instance, u32 var_p0) {\n  u32 ret = w2c_fac_fac_0(instance, var_p0);\n  return ret;\n}\n\nvoid wasm2c_fac_instantiate(w2c_fac* instance) {\n  assert(wasm_rt_is_initialized());\n}\n\nvoid wasm2c_fac_free(w2c_fac* instance) {\n}\n\nwasm_rt_func_type_t wasm2c_fac_get_func_type(uint32_t param_count, uint32_t result_count, ...) {\n  va_list args;\n  \n  if (param_count == 1 && result_count == 1) {\n    va_start(args, result_count);\n    if (true && va_arg(args, int) == WASM_RT_I32 && va_arg(args, int) == WASM_RT_I32) {\n      va_end(args);\n      return w2c_fac_t0;\n    }\n    va_end(args);\n  }\n  \n  return NULL;\n}\n\nu32 w2c_fac_fac_0(w2c_fac* instance, u32 var_p0) {\n  FUNC_PROLOGUE;\n  u32 var_i0, var_i1, var_i2;\n  var_i0 = var_p0;\n  var_i1 = 0u;\n  var_i0 = var_i0 == var_i1;\n  if (var_i0) {\n    var_i0 = 1u;\n  } else {\n    var_i0 = var_p0;\n    var_i1 = var_p0;\n    var_i2 = 1u;\n    var_i1 -= var_i2;\n    var_i1 = w2c_fac_fac_0(instance, var_i1);\n    var_i0 *= var_i1;\n  }\n  FUNC_EPILOGUE;\n  return var_i0;\n}\n"
  },
  {
    "path": "wasm2c/examples/fac/fac.h",
    "content": "/* Automatically generated by wasm2c */\n#ifndef FAC_H_GENERATED_\n#define FAC_H_GENERATED_\n\n#include \"wasm-rt.h\"\n\n#include <stdint.h>\n\n#ifndef WASM_RT_CORE_TYPES_DEFINED\n#define WASM_RT_CORE_TYPES_DEFINED\ntypedef uint8_t u8;\ntypedef int8_t s8;\ntypedef uint16_t u16;\ntypedef int16_t s16;\ntypedef uint32_t u32;\ntypedef int32_t s32;\ntypedef uint64_t u64;\ntypedef int64_t s64;\ntypedef float f32;\ntypedef double f64;\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct w2c_fac {\n  char dummy_member;\n} w2c_fac;\n\nvoid wasm2c_fac_instantiate(w2c_fac*);\nvoid wasm2c_fac_free(w2c_fac*);\nwasm_rt_func_type_t wasm2c_fac_get_func_type(uint32_t param_count, uint32_t result_count, ...);\n\n/* export: 'fac' */\nu32 w2c_fac_fac(w2c_fac*, u32);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  /* FAC_H_GENERATED_ */\n"
  },
  {
    "path": "wasm2c/examples/fac/fac.wat",
    "content": "(func (export \"fac\") (param i32) (result i32)\n  (if (result i32) (i32.eq (local.get 0) (i32.const 0))\n    (then (i32.const 1))\n    (else\n      (i32.mul (local.get 0) (call 0 (i32.sub (local.get 0) (i32.const 1))))\n    )\n  )\n)\n"
  },
  {
    "path": "wasm2c/examples/fac/main.c",
    "content": "#include <stdio.h>\n#include <stdlib.h>\n\n#include \"fac.h\"\n\nint main(int argc, char** argv) {\n  /* Make sure there is at least one command-line argument. */\n  if (argc < 2) {\n    printf(\"Invalid argument. Expected '%s NUMBER'\\n\", argv[0]);\n    return 1;\n  }\n\n  /* Convert the argument from a string to an int. We'll implicitly cast the int\n  to a `u32`, which is what `fac` expects. */\n  u32 x = atoi(argv[1]);\n\n  /* Initialize the Wasm runtime. */\n  wasm_rt_init();\n\n  /* Declare an instance of the `fac` module. */\n  w2c_fac fac;\n\n  /* Construct the module instance. */\n  wasm2c_fac_instantiate(&fac);\n\n  /* Call `fac`, using the mangled name. */\n  u32 result = w2c_fac_fac(&fac, x);\n\n  /* Print the result. */\n  printf(\"fac(%u) -> %u\\n\", x, result);\n\n  /* Free the fac module. */\n  wasm2c_fac_free(&fac);\n\n  /* Free the Wasm runtime state. */\n  wasm_rt_free();\n\n  return 0;\n}\n"
  },
  {
    "path": "wasm2c/examples/rot13/Makefile",
    "content": "# Use implicit rules for compiling C files.\nCFLAGS=-I../..\nLDLIBS=-lm\n\nall: rot13\n\nclean:\n\trm -rf rot13 rot13.wasm rot13.c rot13.h *.o\n\nrot13: main.o rot13.o ../../wasm-rt-impl.o ../../wasm-rt-mem-impl.o\n\nmain.o: rot13.h\n\nrot13.wasm: rot13.wat ../../../bin/wat2wasm\n\t../../../bin/wat2wasm $< -o $@\n\nrot13.c rot13.h: rot13.wasm ../../../bin/wasm2c\n\t../../../bin/wasm2c $< -o rot13.c --disable-simd\n\n.PHONY: all clean\n"
  },
  {
    "path": "wasm2c/examples/rot13/main.c",
    "content": "/* Entry point for the rot13 example.\n *\n * This example shows how you can fulfill wasm module imports in your C\n * program, and access linear memory.\n *\n * The program reads arguments from the command line, and [rot13] encodes them,\n * e.g.:\n *\n * ```\n * $ rot13 foo bar\n * foo -> sbb\n * bar -> one\n * ```\n *\n * [rot13]: https://en.wikipedia.org/wiki/ROT13\n */\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"rot13.h\"\n\n/* Define structure to hold the imports */\nstruct w2c_host {\n  wasm_rt_memory_t memory;\n  char* input;\n};\n\n/* Accessor to access the memory member of the host */\nwasm_rt_memory_t* w2c_host_mem(struct w2c_host* instance) {\n  return &instance->memory;\n}\n\nint main(int argc, char** argv) {\n  /* Make sure there is at least one command-line argument. */\n  if (argc < 2) {\n    printf(\"Invalid argument. Expected '%s WORD...'\\n\", argv[0]);\n    return 1;\n  }\n  /* Initialize the Wasm runtime. */\n  wasm_rt_init();\n\n  /* Create a structure to store the memory and current string, allocating 1\n     page of Wasm memory (64 KiB) that the rot13 module instance will import. */\n  struct w2c_host host;\n  wasm_rt_allocate_memory(&host.memory, 1, 1, false, WASM_DEFAULT_PAGE_SIZE);\n\n  // Construct an instance of the `rot13` module, which imports from the host.\n  w2c_rot13 rot13;\n  wasm2c_rot13_instantiate(&rot13, &host);\n\n  /* Call `rot13` on each argument. */\n  while (argc > 1) {\n    /* Move to next arg. Do this first, so the program name is skipped. */\n    argc--;\n    argv++;\n\n    host.input = argv[0];\n    w2c_rot13_rot13(&rot13);\n  }\n\n  /* Free the rot13 module. */\n  wasm2c_rot13_free(&rot13);\n\n  /* Free the Wasm runtime state. */\n  wasm_rt_free();\n\n  return 0;\n}\n\n/* Fill the wasm buffer with the input to be rot13'd.\n *\n * params:\n *   instance: An instance of the w2c_host structure\n *   ptr: The wasm memory address of the buffer to fill data.\n *   size: The size of the buffer in wasm memory.\n * result:\n *   The number of bytes filled into the buffer. (Must be <= size).\n */\nu32 w2c_host_fill_buf(struct w2c_host* instance, u32 ptr, u32 size) {\n  for (size_t i = 0; i < size; ++i) {\n    if (instance->input[i] == 0) {\n      return i;\n    }\n    instance->memory.data[ptr + i] = instance->input[i];\n  }\n  return size;\n}\n\n/* Called when the wasm buffer has been rot13'd.\n *\n * params:\n *   w2c_host: An instance of the w2c_host structure\n *   ptr: The wasm memory address of the buffer.\n *   size: The size of the buffer in wasm memory.\n */\nvoid w2c_host_buf_done(struct w2c_host* instance, u32 ptr, u32 size) {\n  /* The output buffer is not necessarily null-terminated, so use the %*.s\n   * printf format to limit the number of characters printed. */\n  printf(\"%s -> %.*s\\n\", instance->input, (int)size,\n         &instance->memory.data[ptr]);\n}\n"
  },
  {
    "path": "wasm2c/examples/rot13/rot13.wat",
    "content": "(import \"host\" \"mem\" (memory $mem 1))\n(import \"host\" \"fill_buf\" (func $fill_buf (param i32 i32) (result i32)))\n(import \"host\" \"buf_done\" (func $buf_done (param i32 i32)))\n\n(func $rot13c (param $c i32) (result i32)\n  (local $uc i32)\n\n  ;; No change if < 'A'.\n  (if (i32.lt_u (local.get $c) (i32.const 65))\n    (then (return (local.get $c))))\n\n  ;; Clear 5th bit of c, to force uppercase. 0xdf = 0b11011111\n  (local.set $uc (i32.and (local.get $c) (i32.const 0xdf)))\n\n  ;; In range ['A', 'M'] return |c| + 13.\n  (if (i32.le_u (local.get $uc) (i32.const 77))\n    (then (return (i32.add (local.get $c) (i32.const 13)))))\n\n  ;; In range ['N', 'Z'] return |c| - 13.\n  (if (i32.le_u (local.get $uc) (i32.const 90))\n    (then (return (i32.sub (local.get $c) (i32.const 13)))))\n\n  ;; No change for everything else.\n  (return (local.get $c))\n)\n\n(func (export \"rot13\")\n  (local $size i32)\n  (local $i i32)\n\n  ;; Ask host to fill memory [0, 1024) with data.\n  (call $fill_buf (i32.const 0) (i32.const 1024))\n\n  ;; The host returns the size filled.\n  (local.set $size)\n\n  ;; Loop over all bytes and rot13 them.\n  (block $exit\n    (loop $top\n      ;; if (i >= size) break\n      (if (i32.ge_u (local.get $i) (local.get $size)) (then (br $exit)))\n\n      ;; mem[i] = rot13c(mem[i])\n      (i32.store8\n        (local.get $i)\n        (call $rot13c\n          (i32.load8_u (local.get $i))))\n\n      ;; i++\n      (local.set $i (i32.add (local.get $i) (i32.const 1)))\n      (br $top)\n    )\n  )\n\n  (call $buf_done (i32.const 0) (local.get $size))\n)\n"
  },
  {
    "path": "wasm2c/examples/threads/Makefile",
    "content": "#SANITIZERS=-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all\nCFLAGS=-I../.. -g -O2 -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wno-array-bounds -Wno-ignored-optimization-argument -Wno-tautological-constant-out-of-range-compare -Wno-infinite-recursion -fno-optimize-sibling-calls -frounding-math -fsignaling-nans ${SANITIZERS} -pthread\nLDLIBS=${SANITIZERS} -pthread -lm\n\nall: threads\n\nclean:\n\trm -rf threads sample.wasm sample.c sample.h *.o ../../*.o\n\nthreads: threads.o sample.o ../../wasm-rt-impl.o ../../wasm-rt-exceptions-impl.o\n\nsample.wasm: sample.wat ../../../bin/wat2wasm\n\t../../../bin/wat2wasm --debug-names $< -o $@\n\nsample.c: sample.wasm ../../../bin/wasm2c\n\t../../../bin/wasm2c $< -o $@\n\nthreads.o: sample.c\n\n.PHONY: all clean\n"
  },
  {
    "path": "wasm2c/examples/threads/sample.wat",
    "content": ";; Module for demonstrating multi-threaded runtime\n\n(func (export \"multiplyby3\") (param i32) (result i32) (i32.mul (local.get 0) (i32.const 3)))\n\n(func $stackoverflow (export \"stackoverflow\")\n      (call $stackoverflow))\n"
  },
  {
    "path": "wasm2c/examples/threads/threads.c",
    "content": "#include <pthread.h>\n#include <stdio.h>\n\n#include \"sample.h\"\n#include \"wasm-rt-exceptions.h\"\n#include \"wasm-rt-impl.h\"\n\n#define NUM_THREADS 1024\n\nvoid* do_thread(void* arg);\n\n/**\n * Example demonstrating use of the wasm2c runtime in multithreaded code.\n *\n * The program calls wasm_rt_init() on startup, and each new thread calls\n * wasm_rt_init_thread() before instantiating a Wasm module. The sample\n * module is designed to trap with stack exhaustion; this example tests\n * that each thread can successfully catch the trap (in its own altstack)\n * independently.\n */\n\nint main(int argc, char** argv) {\n  pthread_t threads[NUM_THREADS];\n  int arguments[NUM_THREADS];\n\n  /* Initialize the Wasm runtime. */\n  wasm_rt_init();\n\n  /* Create and launch threads running the `do_thread` function. */\n  for (int i = 0; i < NUM_THREADS; ++i) {\n    arguments[i] = i;\n    if (pthread_create(&threads[i], NULL, do_thread, &arguments[i])) {\n      perror(\"pthread_create\");\n      exit(EXIT_FAILURE);\n    }\n  }\n\n  /* Join each thread. */\n  for (int i = 0; i < NUM_THREADS; ++i) {\n    void* retval;\n    if (pthread_join(threads[i], &retval)) {\n      perror(\"pthread_join\");\n      exit(EXIT_FAILURE);\n    }\n\n    /* Verify returned value is as expected */\n    if ((retval != &arguments[i]) || (arguments[i] != 3 * i)) {\n      fprintf(stderr, \"Unexpected return value from thread.\\n\");\n      exit(EXIT_FAILURE);\n    }\n  }\n\n  /* Free the Wasm runtime's state. */\n  wasm_rt_free();\n\n  printf(\"%d/%d threads trapped successfully.\\n\", NUM_THREADS, NUM_THREADS);\n\n  return EXIT_SUCCESS;\n}\n\nvoid* do_thread(void* arg) {\n  int param;\n  memcpy(&param, arg, sizeof(int));\n\n  /* Initialize the per-thread context for the Wasm runtime (in\n     practice, this allocates and installs an alternate stack for\n     catching segfaults caused by stack exhaustion or out-of-bounds\n     memory access). */\n  wasm_rt_init_thread();\n\n  /* Instantiate the Wasm module. */\n  w2c_sample inst;\n  wasm2c_sample_instantiate(&inst);\n\n  /* Expect a stack-exhaustion trap. (N.B. in a pthreads-created stack, Linux's\n     segfault for stack overflow appears the same as one for memory OOB. This is\n     similar to the behavior of macOS when exhausting a non-pthreads stack. */\n  wasm_rt_trap_t code = wasm_rt_impl_try();\n  if (code != 0) {\n    if (code == WASM_RT_TRAP_OOB || code == WASM_RT_TRAP_EXHAUSTION) {\n      /* Trap arrived as expected. Now call the \"real\" function. */\n      int returnval = w2c_sample_multiplyby3(&inst, param);\n      memcpy(arg, &returnval, sizeof(int));\n\n      /* Free the module instance. */\n      wasm2c_sample_free(&inst);\n\n      /* Free the per-thread runtime context. */\n      wasm_rt_free_thread();\n\n      return arg;\n    } else {\n      fprintf(stderr, \"Expected OOB or exhaustion trap but got %s\\n\",\n              wasm_rt_strerror(code));\n      return NULL;\n    }\n  }\n\n  /* Call the stack-overflow function. Expect a trap back to above. */\n  w2c_sample_stackoverflow(&inst);\n\n  /* If no trap... */\n  fprintf(stderr, \"Expected trap but did not get one\\n\");\n  return NULL;\n}\n"
  },
  {
    "path": "wasm2c/wasm-rt-exceptions-impl.c",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wasm-rt.h\"\n\n#include \"wasm-rt-exceptions.h\"\n\n#include <string.h>\n\n#define MAX_EXCEPTION_SIZE 256\n\nstatic WASM_RT_THREAD_LOCAL wasm_rt_tag_t g_active_exception_tag;\nstatic WASM_RT_THREAD_LOCAL uint8_t g_active_exception[MAX_EXCEPTION_SIZE];\nstatic WASM_RT_THREAD_LOCAL uint32_t g_active_exception_size;\n\nstatic WASM_RT_THREAD_LOCAL wasm_rt_jmp_buf* g_unwind_target;\n\nvoid wasm_rt_load_exception(const wasm_rt_tag_t tag,\n                            uint32_t size,\n                            const void* values) {\n  if (size > MAX_EXCEPTION_SIZE) {\n    wasm_rt_trap(WASM_RT_TRAP_EXHAUSTION);\n  }\n\n  g_active_exception_tag = tag;\n  g_active_exception_size = size;\n\n  if (size) {\n    memcpy(g_active_exception, values, size);\n  }\n}\n\nWASM_RT_NO_RETURN void wasm_rt_throw(void) {\n  WASM_RT_LONGJMP(*g_unwind_target, WASM_RT_TRAP_UNCAUGHT_EXCEPTION);\n}\n\nWASM_RT_UNWIND_TARGET* wasm_rt_get_unwind_target(void) {\n  return g_unwind_target;\n}\n\nvoid wasm_rt_set_unwind_target(WASM_RT_UNWIND_TARGET* target) {\n  g_unwind_target = target;\n}\n\nwasm_rt_tag_t wasm_rt_exception_tag(void) {\n  return g_active_exception_tag;\n}\n\nuint32_t wasm_rt_exception_size(void) {\n  return g_active_exception_size;\n}\n\nvoid* wasm_rt_exception(void) {\n  return g_active_exception;\n}\n\n// Include table operations for exnref\n#define WASM_RT_TABLE_OPS_EXNREF\n#include \"wasm-rt-impl-tableops.inc\"\n#undef WASM_RT_TABLE_OPS_EXNREF\n"
  },
  {
    "path": "wasm2c/wasm-rt-exceptions.h",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WASM_RT_EXCEPTIONS_H_\n#define WASM_RT_EXCEPTIONS_H_\n\n#include \"wasm-rt.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/**\n * A tag is represented as an arbitrary pointer.\n */\ntypedef const void* wasm_rt_tag_t;\n\n/**\n * Set the active exception to given tag, size, and contents.\n */\nvoid wasm_rt_load_exception(const wasm_rt_tag_t tag,\n                            uint32_t size,\n                            const void* values);\n\n/**\n * Throw the active exception.\n */\nWASM_RT_NO_RETURN void wasm_rt_throw(void);\n\n/**\n * The type of an unwind target if an exception is thrown and caught.\n */\n#define WASM_RT_UNWIND_TARGET wasm_rt_jmp_buf\n\n/**\n * Get the current unwind target if an exception is thrown.\n */\nWASM_RT_UNWIND_TARGET* wasm_rt_get_unwind_target(void);\n\n/**\n * Set the unwind target if an exception is thrown.\n */\nvoid wasm_rt_set_unwind_target(WASM_RT_UNWIND_TARGET* target);\n\n/**\n * Tag of the active exception.\n */\nwasm_rt_tag_t wasm_rt_exception_tag(void);\n\n/**\n * Size of the active exception.\n */\nuint32_t wasm_rt_exception_size(void);\n\n/**\n * Contents of the active exception.\n */\nvoid* wasm_rt_exception(void);\n\n/**\n * The maximum size of an exception.\n */\n#define WASM_EXN_MAX_SIZE 256\n\n/**\n * An exception instance (the runtime representation of a function).\n * These can be stored in tables of type exnref, or used as values.\n */\ntypedef struct {\n  /** The exceptions's tag. */\n  wasm_rt_tag_t tag;\n  /** The size of the exception. */\n  uint32_t size;\n  /**\n   * The actual contents of the exception are stored inline.\n   */\n  char data[WASM_EXN_MAX_SIZE];\n} wasm_rt_exnref_t;\n\n/** Default (null) value of an exnref */\n#define wasm_rt_exnref_null_value ((wasm_rt_exnref_t){NULL, 0, {0}})\n\n/** A Table of type exnref. */\ntypedef struct {\n  /** The table element data, with an element count of `size`. */\n  wasm_rt_exnref_t* data;\n  /**\n   * The maximum element count of this Table object. If there is no maximum,\n   * `max_size` is 0xffffffffu (i.e. UINT32_MAX).\n   */\n  uint32_t max_size;\n  /** The current element count of the table. */\n  uint32_t size;\n} wasm_rt_exnref_table_t;\n\n/**\n * Initialize an exnref Table object with an element count of `elements` and a\n * maximum size of `max_elements`.\n *\n *  ```\n *    wasm_rt_exnref_table_t my_table;\n *    // 5 elements and a maximum of 10 elements.\n *    wasm_rt_allocate_exnref_table(&my_table, 5, 10);\n *  ```\n */\nvoid wasm_rt_allocate_exnref_table(wasm_rt_exnref_table_t*,\n                                   uint32_t elements,\n                                   uint32_t max_elements);\n\n/** Free an exnref Table object. */\nvoid wasm_rt_free_exnref_table(wasm_rt_exnref_table_t*);\n\n/**\n * Grow a Table object by `delta` elements (giving the new elements the value\n * `init`), and return the previous element count. If this new element count is\n * greater than the maximum element count, the grow fails and 0xffffffffu\n * (UINT32_MAX) is returned instead.\n */\nuint32_t wasm_rt_grow_exnref_table(wasm_rt_exnref_table_t*,\n                                   uint32_t delta,\n                                   wasm_rt_exnref_t init);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "wasm2c/wasm-rt-impl-tableops.inc",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// This file is used as a template to generate code for table operations for\n// funcref or externref. For this, the file must be included after defining\n// either WASM_RT_TABLE_OPS_FUNCREF or WASM_RT_TABLE_OPS_EXTERNREF\n\n#if defined(WASM_RT_TABLE_OPS_FUNCREF) +       \\\n        defined(WASM_RT_TABLE_OPS_EXTERNREF) + \\\n        defined(WASM_RT_TABLE_OPS_EXNREF) >    \\\n    1\n#error \\\n    \"Expected only one of { WASM_RT_TABLE_OPS_FUNCREF, WASM_RT_TABLE_OPS_EXTERNREF, WASM_RT_TABLE_OPS_EXNREF } to be defined\"\n#elif defined(WASM_RT_TABLE_OPS_FUNCREF) +     \\\n        defined(WASM_RT_TABLE_OPS_EXTERNREF) + \\\n        defined(WASM_RT_TABLE_OPS_EXNREF) <    \\\n    1\n#error \\\n    \"Expected one of { WASM_RT_TABLE_OPS_FUNCREF, WASM_RT_TABLE_OPS_EXTERNREF, WASM_RT_TABLE_OPS_EXNREF } to be defined\"\n#endif\n\n#if defined(WASM_RT_TABLE_OPS_FUNCREF)\n#define WASM_RT_TABLE_TYPE wasm_rt_funcref_table_t\n#define WASM_RT_TABLE_ELEMENT_TYPE wasm_rt_funcref_t\n#define WASM_RT_TABLE_APINAME(name) name##_funcref_table\n#elif defined(WASM_RT_TABLE_OPS_EXTERNREF)\n#define WASM_RT_TABLE_TYPE wasm_rt_externref_table_t\n#define WASM_RT_TABLE_ELEMENT_TYPE wasm_rt_externref_t\n#define WASM_RT_TABLE_APINAME(name) name##_externref_table\n#elif defined(WASM_RT_TABLE_OPS_EXNREF)\n#define WASM_RT_TABLE_TYPE wasm_rt_exnref_table_t\n#define WASM_RT_TABLE_ELEMENT_TYPE wasm_rt_exnref_t\n#define WASM_RT_TABLE_APINAME(name) name##_exnref_table\n#endif\n\nvoid WASM_RT_TABLE_APINAME(wasm_rt_allocate)(WASM_RT_TABLE_TYPE* table,\n                                             uint32_t elements,\n                                             uint32_t max_elements) {\n  table->size = elements;\n  table->max_size = max_elements;\n  table->data = calloc(table->size, sizeof(WASM_RT_TABLE_ELEMENT_TYPE));\n}\n\nvoid WASM_RT_TABLE_APINAME(wasm_rt_free)(WASM_RT_TABLE_TYPE* table) {\n  free(table->data);\n}\n\nuint32_t WASM_RT_TABLE_APINAME(wasm_rt_grow)(WASM_RT_TABLE_TYPE* table,\n                                             uint32_t delta,\n                                             WASM_RT_TABLE_ELEMENT_TYPE init) {\n  uint32_t old_elems = table->size;\n  uint64_t new_elems = (uint64_t)table->size + delta;\n  if (new_elems == 0) {\n    return 0;\n  }\n  if ((new_elems < old_elems) || (new_elems > table->max_size)) {\n    return (uint32_t)-1;\n  }\n  void* new_data =\n      realloc(table->data, new_elems * sizeof(WASM_RT_TABLE_ELEMENT_TYPE));\n  if (!new_data) {\n    return (uint32_t)-1;\n  }\n  table->data = new_data;\n  table->size = new_elems;\n  for (uint32_t i = old_elems; i < new_elems; i++) {\n    table->data[i] = init;\n  }\n  return old_elems;\n}\n\n#undef WASM_RT_TABLE_APINAME\n#undef WASM_RT_TABLE_ELEMENT_TYPE\n#undef WASM_RT_TABLE_TYPE\n"
  },
  {
    "path": "wasm2c/wasm-rt-impl.c",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wasm-rt-impl.h\"\n\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#if WASM_RT_INSTALL_SIGNAL_HANDLER && !defined(_WIN32)\n#include <signal.h>\n#include <unistd.h>\n#endif\n\n#ifdef _WIN32\n#include <windows.h>\n#else\n#include <sys/mman.h>\n#endif\n\n#ifndef NDEBUG\n#define DEBUG_PRINTF(...) fprintf(stderr, __VA_ARGS__);\n#else\n#define DEBUG_PRINTF(...)\n#endif\n\n#if WASM_RT_INSTALL_SIGNAL_HANDLER\nstatic bool g_signal_handler_installed = false;\n#ifdef _WIN32\nstatic void* g_sig_handler_handle = 0;\n#endif\n#endif\n\n#if WASM_RT_USE_SEGUE\nbool wasm_rt_fsgsbase_inst_supported = false;\n#ifdef __linux__\n#include <sys/auxv.h>\n#ifdef __GLIBC__\n#include <gnu/libc-version.h>\n#endif\n#include <asm/prctl.h>    // For ARCH_SET_GS\n#include <sys/syscall.h>  // For SYS_arch_prctl\n#include <unistd.h>       // For syscall\n#ifndef HWCAP2_FSGSBASE\n#define HWCAP2_FSGSBASE (1 << 1)\n#endif\n#elif defined(__FreeBSD__)\n#include <machine/sysarch.h>  // For amd64_set_gsbase etc.\n#endif\n#endif\n\n#if WASM_RT_SEGUE_FREE_SEGMENT\nWASM_RT_THREAD_LOCAL void* wasm_rt_last_segment_val = NULL;\n#endif\n\n#if WASM_RT_STACK_DEPTH_COUNT\nWASM_RT_THREAD_LOCAL uint32_t wasm_rt_call_stack_depth;\nWASM_RT_THREAD_LOCAL uint32_t wasm_rt_saved_call_stack_depth;\n#elif WASM_RT_STACK_EXHAUSTION_HANDLER\nstatic WASM_RT_THREAD_LOCAL void* g_alt_stack = NULL;\n#endif\n\n#ifndef WASM_RT_TRAP_HANDLER\nWASM_RT_THREAD_LOCAL wasm_rt_jmp_buf g_wasm_rt_jmp_buf;\n#endif\n\n#ifdef WASM_RT_TRAP_HANDLER\nextern void WASM_RT_TRAP_HANDLER(wasm_rt_trap_t code);\n#endif\n\nvoid wasm_rt_trap(wasm_rt_trap_t code) {\n  assert(code != WASM_RT_TRAP_NONE);\n#if WASM_RT_STACK_DEPTH_COUNT\n  wasm_rt_call_stack_depth = wasm_rt_saved_call_stack_depth;\n#endif\n\n#ifdef WASM_RT_TRAP_HANDLER\n  WASM_RT_TRAP_HANDLER(code);\n  wasm_rt_unreachable();\n#else\n  WASM_RT_LONGJMP(g_wasm_rt_jmp_buf, code);\n#endif\n}\n\n#ifdef _WIN32\n\n#if WASM_RT_INSTALL_SIGNAL_HANDLER\n\nstatic LONG os_signal_handler(PEXCEPTION_POINTERS info) {\n  if (info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {\n    wasm_rt_trap(WASM_RT_TRAP_OOB);\n  } else if (info->ExceptionRecord->ExceptionCode == EXCEPTION_STACK_OVERFLOW) {\n    wasm_rt_trap(WASM_RT_TRAP_EXHAUSTION);\n  }\n  return EXCEPTION_CONTINUE_SEARCH;\n}\n\nstatic void os_install_signal_handler(void) {\n  g_sig_handler_handle =\n      AddVectoredExceptionHandler(1 /* CALL_FIRST */, os_signal_handler);\n}\n\nstatic void os_cleanup_signal_handler(void) {\n  RemoveVectoredExceptionHandler(g_sig_handler_handle);\n}\n\n#endif\n\n#else\n\n#if WASM_RT_INSTALL_SIGNAL_HANDLER\nstatic void os_signal_handler(int sig, siginfo_t* si, void* unused) {\n  if (si->si_code == SEGV_ACCERR) {\n    wasm_rt_trap(WASM_RT_TRAP_OOB);\n  } else {\n    wasm_rt_trap(WASM_RT_TRAP_EXHAUSTION);\n  }\n}\n\nstatic void os_install_signal_handler(void) {\n  struct sigaction sa;\n  memset(&sa, '\\0', sizeof(sa));\n  sa.sa_flags = SA_SIGINFO;\n#if WASM_RT_STACK_EXHAUSTION_HANDLER\n  sa.sa_flags |= SA_ONSTACK;\n#endif\n  sigemptyset(&sa.sa_mask);\n  sa.sa_sigaction = os_signal_handler;\n\n  /* Install SIGSEGV and SIGBUS handlers, since macOS seems to use SIGBUS. */\n  if (sigaction(SIGSEGV, &sa, NULL) != 0 || sigaction(SIGBUS, &sa, NULL) != 0) {\n    perror(\"sigaction failed\");\n    abort();\n  }\n}\n\nstatic void os_cleanup_signal_handler(void) {\n  /* Undo what was done in os_install_signal_handler */\n  struct sigaction sa;\n  memset(&sa, '\\0', sizeof(sa));\n  sa.sa_handler = SIG_DFL;\n  if (sigaction(SIGSEGV, &sa, NULL) != 0 || sigaction(SIGBUS, &sa, NULL)) {\n    perror(\"sigaction failed\");\n    abort();\n  }\n}\n#endif\n\n#if WASM_RT_STACK_EXHAUSTION_HANDLER\nstatic bool os_has_altstack_installed() {\n  /* check for altstack already in place */\n  stack_t ss;\n  if (sigaltstack(NULL, &ss) != 0) {\n    perror(\"os_has_altstack_installed: sigaltstack failed\");\n    abort();\n  }\n\n  return !(ss.ss_flags & SS_DISABLE);\n}\n\n/* These routines set up an altstack to handle SIGSEGV from stack overflow. */\nstatic void os_allocate_and_install_altstack(void) {\n  /* verify altstack not already allocated */\n  assert(!g_alt_stack &&\n         \"wasm-rt error: tried to re-allocate thread-local alternate stack\");\n\n  /* We could check and warn if an altstack is already installed, but some\n   * sanitizers install their own altstack, so this warning would fire\n   * spuriously and break the test outputs. */\n\n  /* allocate altstack */\n  g_alt_stack = malloc(SIGSTKSZ);\n  if (g_alt_stack == NULL) {\n    perror(\"malloc failed\");\n    abort();\n  }\n\n  /* install altstack */\n  stack_t ss;\n  ss.ss_sp = g_alt_stack;\n  ss.ss_flags = 0;\n  ss.ss_size = SIGSTKSZ;\n  if (sigaltstack(&ss, NULL) != 0) {\n    perror(\"os_allocate_and_install_altstack: sigaltstack failed\");\n    abort();\n  }\n}\n\nstatic void os_disable_and_deallocate_altstack(void) {\n  /* in debug build, verify altstack allocated */\n  assert(g_alt_stack &&\n         \"wasm-rt error: thread-local alternate stack not allocated\");\n\n  /* verify altstack was still in place */\n  stack_t ss;\n  if (sigaltstack(NULL, &ss) != 0) {\n    perror(\"os_disable_and_deallocate_altstack: sigaltstack failed\");\n    abort();\n  }\n\n  if ((!g_alt_stack) || (ss.ss_flags & SS_DISABLE) ||\n      (ss.ss_sp != g_alt_stack) || (ss.ss_size != SIGSTKSZ)) {\n    DEBUG_PRINTF(\n        \"wasm-rt warning: alternate stack was modified unexpectedly\\n\");\n    return;\n  }\n\n  assert(!(ss.ss_flags & SS_ONSTACK) &&\n         \"attempt to deallocate altstack while in use\");\n\n  /* disable and free */\n  ss.ss_flags = SS_DISABLE;\n  if (sigaltstack(&ss, NULL) != 0) {\n    perror(\"sigaltstack disable failed\");\n    abort();\n  }\n  assert(!os_has_altstack_installed());\n  free(g_alt_stack);\n  g_alt_stack = NULL;\n}\n#endif\n\n#endif\n\n#if WASM_RT_USE_SEGUE && defined(__FreeBSD__)\nstatic void call_cpuid(uint64_t* rax,\n                       uint64_t* rbx,\n                       uint64_t* rcx,\n                       uint64_t* rdx) {\n  __asm__ volatile(\n      \"cpuid\"\n      : \"=a\"(*rax), \"=b\"(*rbx), \"=c\"(*rcx), \"=d\"(*rdx)  // output operands\n      : \"a\"(*rax), \"c\"(*rcx)                            // input operands\n  );\n}\n#endif\n\nvoid wasm_rt_init(void) {\n  wasm_rt_init_thread();\n#if WASM_RT_INSTALL_SIGNAL_HANDLER\n  if (!g_signal_handler_installed) {\n    g_signal_handler_installed = true;\n    os_install_signal_handler();\n  }\n#endif\n\n#if WASM_RT_USE_SEGUE\n#if defined(__linux__) && defined(__GLIBC__) && __GLIBC__ >= 2 && \\\n    __GLIBC_MINOR__ >= 18\n  // Check for support for userspace wrgsbase instructions\n  unsigned long val = getauxval(AT_HWCAP2);\n  wasm_rt_fsgsbase_inst_supported = val & HWCAP2_FSGSBASE;\n#elif defined(__FreeBSD__)\n  // FreeBSD enables fsgsbase on the newer kernels if the hardware supports it.\n  // We just need to check if the hardware supports it by querying the correct\n  // cpuid leaf.\n  uint64_t rax, rbx, rcx, rdx;\n  rax = 0;\n  call_cpuid(&rax, &rbx, &rcx, &rdx);\n\n  if (rax > 7) {\n    rax = 7;\n    rcx = 0;\n    call_cpuid(&rax, &rbx, &rcx, &rdx);\n    if (rbx & 0x1) {\n      wasm_rt_fsgsbase_inst_supported = true;\n    }\n  }\n#endif\n#endif\n\n  assert(wasm_rt_is_initialized());\n}\n\nbool wasm_rt_is_initialized(void) {\n#if WASM_RT_STACK_EXHAUSTION_HANDLER\n  if (!os_has_altstack_installed()) {\n    return false;\n  }\n#endif\n#if WASM_RT_INSTALL_SIGNAL_HANDLER\n  return g_signal_handler_installed;\n#else\n  return true;\n#endif\n}\n\nvoid wasm_rt_free(void) {\n  assert(wasm_rt_is_initialized());\n#if WASM_RT_INSTALL_SIGNAL_HANDLER\n  os_cleanup_signal_handler();\n  g_signal_handler_installed = false;\n#endif\n  wasm_rt_free_thread();\n}\n\nvoid wasm_rt_init_thread(void) {\n#if WASM_RT_STACK_EXHAUSTION_HANDLER\n  os_allocate_and_install_altstack();\n#endif\n}\n\nvoid wasm_rt_free_thread(void) {\n#if WASM_RT_STACK_EXHAUSTION_HANDLER\n  os_disable_and_deallocate_altstack();\n#endif\n}\n\n#if WASM_RT_USE_SEGUE\nvoid wasm_rt_syscall_set_segue_base(void* base) {\n  int error_code = 0;\n#ifdef __linux__\n  error_code = syscall(SYS_arch_prctl, ARCH_SET_GS, base);\n#elif defined(__FreeBSD__)\n  error_code = amd64_set_gsbase(base);\n#else\n#error \"Unknown platform\"\n#endif\n  if (error_code != 0) {\n    perror(\"wasm_rt_syscall_set_segue_base error\");\n    abort();\n  }\n}\nvoid* wasm_rt_syscall_get_segue_base() {\n  void* base;\n  int error_code = 0;\n#ifdef __linux__\n  error_code = syscall(SYS_arch_prctl, ARCH_GET_GS, &base);\n#elif defined(__FreeBSD__)\n  error_code = amd64_get_gsbase(&base);\n#else\n#error \"Unknown platform\"\n#endif\n  if (error_code != 0) {\n    perror(\"wasm_rt_syscall_get_segue_base error\");\n    abort();\n  }\n  return base;\n}\n#endif\n\n// Include table operations for funcref\n#define WASM_RT_TABLE_OPS_FUNCREF\n#include \"wasm-rt-impl-tableops.inc\"\n#undef WASM_RT_TABLE_OPS_FUNCREF\n\n// Include table operations for externref\n#define WASM_RT_TABLE_OPS_EXTERNREF\n#include \"wasm-rt-impl-tableops.inc\"\n#undef WASM_RT_TABLE_OPS_EXTERNREF\n\nconst char* wasm_rt_strerror(wasm_rt_trap_t trap) {\n  switch (trap) {\n    case WASM_RT_TRAP_NONE:\n      return \"No error\";\n    case WASM_RT_TRAP_OOB:\n#if WASM_RT_MERGED_OOB_AND_EXHAUSTION_TRAPS\n      return \"Out-of-bounds access in linear memory or a table, or call stack \"\n             \"exhausted\";\n#else\n      return \"Out-of-bounds access in linear memory or a table\";\n    case WASM_RT_TRAP_EXHAUSTION:\n      return \"Call stack exhausted\";\n#endif\n    case WASM_RT_TRAP_INT_OVERFLOW:\n      return \"Integer overflow on divide or truncation\";\n    case WASM_RT_TRAP_DIV_BY_ZERO:\n      return \"Integer divide by zero\";\n    case WASM_RT_TRAP_INVALID_CONVERSION:\n      return \"Conversion from NaN to integer\";\n    case WASM_RT_TRAP_UNREACHABLE:\n      return \"Unreachable instruction executed\";\n    case WASM_RT_TRAP_CALL_INDIRECT:\n      return \"Invalid call_indirect or return_call_indirect\";\n    case WASM_RT_TRAP_UNCAUGHT_EXCEPTION:\n      return \"Uncaught exception\";\n    case WASM_RT_TRAP_UNALIGNED:\n      return \"Unaligned atomic memory access\";\n    case WASM_RT_TRAP_NULL_REF:\n      return \"Null reference\";\n  }\n  return \"invalid trap code\";\n}\n"
  },
  {
    "path": "wasm2c/wasm-rt-impl.h",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WASM_RT_IMPL_H_\n#define WASM_RT_IMPL_H_\n\n#include \"wasm-rt.h\"\n\n#ifdef _WIN32\n#include <windows.h>\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef WASM_RT_TRAP_HANDLER\n/** A setjmp buffer used for handling traps. */\nextern WASM_RT_THREAD_LOCAL wasm_rt_jmp_buf g_wasm_rt_jmp_buf;\n#endif\n\n#if WASM_RT_STACK_DEPTH_COUNT\n/** Saved call stack depth that will be restored in case a trap occurs. */\nextern WASM_RT_THREAD_LOCAL uint32_t wasm_rt_saved_call_stack_depth;\n#define WASM_RT_SAVE_STACK_DEPTH() \\\n  wasm_rt_saved_call_stack_depth = wasm_rt_call_stack_depth\n#else\n#define WASM_RT_SAVE_STACK_DEPTH() (void)0\n#endif\n\n/**\n * Convenience macro to use before calling a wasm function. On first execution\n * it will return `WASM_RT_TRAP_NONE` (i.e. 0). If the function traps, it will\n * jump back and return the trap that occurred.\n *\n * ```\n *   wasm_rt_trap_t code = wasm_rt_impl_try();\n *   if (code != 0) {\n *     printf(\"A trap occurred with code: %d\\n\", code);\n *     ...\n *   }\n *\n *   // Call the potentially-trapping function.\n *   my_wasm_func();\n * ```\n */\n#define wasm_rt_impl_try()                                                    \\\n  (WASM_RT_SAVE_STACK_DEPTH(), wasm_rt_set_unwind_target(&g_wasm_rt_jmp_buf), \\\n   WASM_RT_SETJMP(g_wasm_rt_jmp_buf))\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* WASM_RT_IMPL_H_ */\n"
  },
  {
    "path": "wasm2c/wasm-rt-mem-impl-helper.inc",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// This file is used as a template to generate code for regular memories or for\n// shared memories. For this, the file must be included after defining either\n// WASM_RT_MEM_OPS or WASM_RT_MEM_OPS_SHARED.\n\n#if defined(WASM_RT_MEM_OPS) && defined(WASM_RT_MEM_OPS_SHARED)\n#error \\\n    \"Expected only one of { WASM_RT_MEM_OPS, WASM_RT_MEM_OPS_SHARED } to be defined\"\n#elif !defined(WASM_RT_MEM_OPS) && !defined(WASM_RT_MEM_OPS_SHARED)\n#error \\\n    \"Expected one of { WASM_RT_MEM_OPS, WASM_RT_MEM_OPS_SHARED } to be defined\"\n#endif\n\n// Shared memory operations are defined only if we have C11\n#if defined(WASM_RT_MEM_OPS) || \\\n    (defined(WASM_RT_MEM_OPS_SHARED) && defined(WASM_RT_C11_AVAILABLE))\n\n#ifdef WASM_RT_MEM_OPS\n\n// Memory operations on wasm_rt_memory_t\n#define MEMORY_TYPE wasm_rt_memory_t\n#define MEMORY_API_NAME(name) name\n#define MEMORY_CELL_TYPE uint8_t*\n#define MEMORY_LOCK_VAR_INIT(name)\n#define MEMORY_LOCK_AQUIRE(name)\n#define MEMORY_LOCK_RELEASE(name)\n\n#else\n\n// Memory operations on wasm_rt_shared_memory_t\n#define MEMORY_TYPE wasm_rt_shared_memory_t\n#define MEMORY_API_NAME(name) name##_shared\n#define MEMORY_CELL_TYPE _Atomic volatile uint8_t*\n\n#if WASM_RT_USE_CRITICALSECTION\n#define MEMORY_LOCK_VAR_INIT(name) WIN_MEMORY_LOCK_VAR_INIT(name)\n#define MEMORY_LOCK_AQUIRE(name) WIN_MEMORY_LOCK_AQUIRE(name)\n#define MEMORY_LOCK_RELEASE(name) WIN_MEMORY_LOCK_RELEASE(name)\n#elif WASM_RT_USE_PTHREADS\n#define MEMORY_LOCK_VAR_INIT(name) PTHREAD_MEMORY_LOCK_VAR_INIT(name)\n#define MEMORY_LOCK_AQUIRE(name) PTHREAD_MEMORY_LOCK_AQUIRE(name)\n#define MEMORY_LOCK_RELEASE(name) PTHREAD_MEMORY_LOCK_RELEASE(name)\n#endif\n\n#endif\n\nbool MEMORY_API_NAME(wasm_rt_memory_is_default32)(const MEMORY_TYPE* memory) {\n  return memory->page_size == WASM_DEFAULT_PAGE_SIZE && !memory->is64;\n}\n\nvoid MEMORY_API_NAME(wasm_rt_allocate_memory)(MEMORY_TYPE* memory,\n                                              uint64_t initial_pages,\n                                              uint64_t max_pages,\n                                              bool is64,\n                                              uint32_t page_size) {\n  uint64_t byte_length = initial_pages * page_size;\n  memory->size = byte_length;\n  memory->pages = initial_pages;\n  memory->max_pages = max_pages;\n  memory->is64 = is64;\n  memory->page_size = page_size;\n  MEMORY_LOCK_VAR_INIT(memory->mem_lock);\n\n#if WASM_RT_USE_MMAP\n  if (MEMORY_API_NAME(wasm_rt_memory_is_default32)(memory)) {\n    const uint64_t mmap_size =\n        get_alloc_size_for_mmap_default32(memory->max_pages);\n    uint8_t* addr = os_mmap(mmap_size);\n    if (!addr) {\n      os_print_last_error(\"os_mmap failed.\");\n      abort();\n    }\n    uint8_t* data_end = addr + mmap_size;\n#if !WABT_BIG_ENDIAN\n    int ret = os_mprotect(addr, byte_length);\n#else\n    int ret = os_mprotect(data_end - byte_length, byte_length);\n#endif\n    if (ret != 0) {\n      os_print_last_error(\"os_mprotect failed.\");\n      abort();\n    }\n    memory->data = (MEMORY_CELL_TYPE)addr;\n    memory->data_end = (MEMORY_CELL_TYPE)data_end;\n    return;\n  }\n#endif\n\n  memory->data = (MEMORY_CELL_TYPE)calloc(byte_length, 1);\n  memory->data_end = memory->data + byte_length;\n}\n\n// Returns 0 on success\nstatic int MEMORY_API_NAME(expand_data_allocation)(MEMORY_TYPE* memory,\n                                                   uint64_t old_size,\n                                                   uint64_t new_size,\n                                                   uint64_t delta_size) {\n#if WASM_RT_USE_MMAP\n  if (MEMORY_API_NAME(wasm_rt_memory_is_default32)(memory)) {\n#if !WABT_BIG_ENDIAN\n    return os_mprotect((void*)(memory->data + old_size), delta_size);\n#else\n    return os_mprotect((void*)(memory->data_end - old_size - delta_size),\n                       delta_size);\n#endif\n  }\n#endif\n\n  uint8_t* new_data = realloc((void*)memory->data, new_size);\n  if (new_data == NULL) {\n    return -1;\n  }\n#if !WABT_BIG_ENDIAN\n  memset((void*)(new_data + old_size), 0, delta_size);\n#else\n  memmove((void*)(new_data + new_size - old_size), (void*)new_data, old_size);\n  memset((void*)new_data, 0, delta_size);\n#endif\n\n  memory->data = (MEMORY_CELL_TYPE)new_data;\n  memory->data_end = memory->data + new_size;\n  return 0;\n}\n\nstatic uint64_t MEMORY_API_NAME(grow_memory_impl)(MEMORY_TYPE* memory,\n                                                  uint64_t delta) {\n  uint64_t old_pages = memory->pages;\n  uint64_t new_pages = memory->pages + delta;\n  if (new_pages == 0) {\n    return 0;\n  }\n  if (new_pages < old_pages || new_pages > memory->max_pages) {\n    return (uint64_t)-1;\n  }\n  uint64_t old_size = old_pages * memory->page_size;\n  uint64_t new_size = new_pages * memory->page_size;\n  uint64_t delta_size = delta * memory->page_size;\n\n  int err = MEMORY_API_NAME(expand_data_allocation)(memory, old_size, new_size,\n                                                    delta_size);\n  if (err != 0) {\n    return (uint64_t)-1;\n  }\n\n  memory->pages = new_pages;\n  memory->size = new_size;\n  return old_pages;\n}\n\nuint64_t MEMORY_API_NAME(wasm_rt_grow_memory)(MEMORY_TYPE* memory,\n                                              uint64_t delta) {\n  MEMORY_LOCK_AQUIRE(memory->mem_lock);\n  uint64_t ret = MEMORY_API_NAME(grow_memory_impl)(memory, delta);\n  MEMORY_LOCK_RELEASE(memory->mem_lock);\n#ifdef WASM_RT_GROW_FAILED_HANDLER\n  if (ret == (uint64_t)-1) {\n    WASM_RT_GROW_FAILED_HANDLER();\n  }\n#endif\n  return ret;\n}\n\nvoid MEMORY_API_NAME(wasm_rt_free_memory)(MEMORY_TYPE* memory) {\n#if WASM_RT_USE_MMAP\n  if (MEMORY_API_NAME(wasm_rt_memory_is_default32)(memory)) {\n    const uint64_t mmap_size =\n        get_alloc_size_for_mmap_default32(memory->max_pages);\n    os_munmap((void*)memory->data, mmap_size);  // ignore error\n    return;\n  }\n#endif\n  free((void*)memory->data);\n}\n\n#undef MEMORY_LOCK_RELEASE\n#undef MEMORY_LOCK_AQUIRE\n#undef MEMORY_LOCK_VAR_INIT\n#undef MEMORY_CELL_TYPE\n#undef MEMORY_API_NAME\n#undef MEMORY_TYPE\n\n#endif\n"
  },
  {
    "path": "wasm2c/wasm-rt-mem-impl.c",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"wasm-rt-impl.h\"\n\n#include <assert.h>\n#include <stdio.h>\n\n#ifdef _WIN32\n#include <windows.h>\n#else\n#include <sys/mman.h>\n#endif\n\n#ifdef WASM_RT_GROW_FAILED_HANDLER\nextern void WASM_RT_GROW_FAILED_HANDLER();\n#endif\n\n#define PTHREAD_MEMORY_LOCK_VAR_INIT(name)      \\\n  if (pthread_mutex_init(&(name), NULL) != 0) { \\\n    fprintf(stderr, \"Lock init failed\\n\");      \\\n    abort();                                    \\\n  }\n#define PTHREAD_MEMORY_LOCK_AQUIRE(name)      \\\n  if (pthread_mutex_lock(&(name)) != 0) {     \\\n    fprintf(stderr, \"Lock acquire failed\\n\"); \\\n    abort();                                  \\\n  }\n#define PTHREAD_MEMORY_LOCK_RELEASE(name)     \\\n  if (pthread_mutex_unlock(&(name)) != 0) {   \\\n    fprintf(stderr, \"Lock release failed\\n\"); \\\n    abort();                                  \\\n  }\n\n#define WIN_MEMORY_LOCK_VAR_INIT(name) InitializeCriticalSection(&(name))\n#define WIN_MEMORY_LOCK_AQUIRE(name) EnterCriticalSection(&(name))\n#define WIN_MEMORY_LOCK_RELEASE(name) LeaveCriticalSection(&(name))\n\n#if WASM_RT_USE_MMAP\n\n#ifdef _WIN32\nstatic void* os_mmap(size_t size) {\n  void* ret = VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_NOACCESS);\n  return ret;\n}\n\nstatic int os_munmap(void* addr, size_t size) {\n  // Windows can only unmap the whole mapping\n  (void)size; /* unused */\n  BOOL succeeded = VirtualFree(addr, 0, MEM_RELEASE);\n  return succeeded ? 0 : -1;\n}\n\nstatic int os_mprotect(void* addr, size_t size) {\n  if (size == 0) {\n    return 0;\n  }\n  void* ret = VirtualAlloc(addr, size, MEM_COMMIT, PAGE_READWRITE);\n  if (ret == addr) {\n    return 0;\n  }\n  VirtualFree(addr, 0, MEM_RELEASE);\n  return -1;\n}\n\nstatic void os_print_last_error(const char* msg) {\n  DWORD errorMessageID = GetLastError();\n  if (errorMessageID != 0) {\n    LPSTR messageBuffer = 0;\n    // The api creates the buffer that holds the message\n    size_t size = FormatMessageA(\n        FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |\n            FORMAT_MESSAGE_IGNORE_INSERTS,\n        NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),\n        (LPSTR)&messageBuffer, 0, NULL);\n    (void)size;\n    printf(\"%s. %s\\n\", msg, messageBuffer);\n    LocalFree(messageBuffer);\n  } else {\n    printf(\"%s. No error code.\\n\", msg);\n  }\n}\n\n#else /* !_WIN32 */\nstatic void* os_mmap(size_t size) {\n  int map_prot = PROT_NONE;\n  int map_flags = MAP_ANONYMOUS | MAP_PRIVATE;\n  uint8_t* addr = mmap(NULL, size, map_prot, map_flags, -1, 0);\n  if (addr == MAP_FAILED)\n    return NULL;\n  return addr;\n}\n\nstatic int os_munmap(void* addr, size_t size) {\n  return munmap(addr, size);\n}\n\nstatic int os_mprotect(void* addr, size_t size) {\n  if (size == 0) {\n    return 0;\n  }\n  return mprotect(addr, size, PROT_READ | PROT_WRITE);\n}\n\nstatic void os_print_last_error(const char* msg) {\n  perror(msg);\n}\n\n#endif /* _WIN32 */\n\nstatic uint64_t get_alloc_size_for_mmap_default32(uint64_t max_pages) {\n#if WASM_RT_MEMCHECK_GUARD_PAGES\n  /* Reserve 8GiB. */\n  const uint64_t max_size = 0x200000000ul;\n  return max_size;\n#else\n  if (max_pages != 0) {\n    const uint64_t max_size = max_pages * WASM_DEFAULT_PAGE_SIZE;\n    return max_size;\n  }\n\n  /* Reserve 4GiB. */\n  const uint64_t max_size = 0x100000000ul;\n  return max_size;\n#endif\n}\n\n#endif /* WASM_RT_USE_MMAP */\n\n// Include operations for memory\n#define WASM_RT_MEM_OPS\n#include \"wasm-rt-mem-impl-helper.inc\"\n#undef WASM_RT_MEM_OPS\n\n// Include operations for shared memory\n#define WASM_RT_MEM_OPS_SHARED\n#include \"wasm-rt-mem-impl-helper.inc\"\n#undef WASM_RT_MEM_OPS_SHARED\n\n#undef C11_MEMORY_LOCK_VAR_INIT\n#undef C11_MEMORY_LOCK_AQUIRE\n#undef C11_MEMORY_LOCK_RELEASE\n#undef PTHREAD_MEMORY_LOCK_VAR_INIT\n#undef PTHREAD_MEMORY_LOCK_AQUIRE\n#undef PTHREAD_MEMORY_LOCK_RELEASE\n#undef WIN_MEMORY_LOCK_VAR_INIT\n#undef WIN_MEMORY_LOCK_AQUIRE\n#undef WIN_MEMORY_LOCK_RELEASE\n"
  },
  {
    "path": "wasm2c/wasm-rt.h",
    "content": "/*\n * Copyright 2018 WebAssembly Community Group participants\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#ifndef WASM_RT_H_\n#define WASM_RT_H_\n\n#include <setjmp.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef __has_builtin\n#define __has_builtin(x) 0 /** Compatibility with non-clang compilers. */\n#endif\n\n#if __has_builtin(__builtin_expect)\n#define UNLIKELY(x) __builtin_expect(!!(x), 0)\n#define LIKELY(x) __builtin_expect(!!(x), 1)\n#else\n#define UNLIKELY(x) (x)\n#define LIKELY(x) (x)\n#endif\n\n#if __has_builtin(__builtin_memcpy)\n#define wasm_rt_memcpy __builtin_memcpy\n#else\n#define wasm_rt_memcpy memcpy\n#endif\n\n#if __has_builtin(__builtin_unreachable)\n#define wasm_rt_unreachable __builtin_unreachable\n#else\n#define wasm_rt_unreachable abort\n#endif\n\n#ifdef __STDC_VERSION__\n#if __STDC_VERSION__ >= 201112L\n#define WASM_RT_C11_AVAILABLE\n#endif\n#endif\n\n/**\n * Many devices don't implement the C11 threads.h. We use CriticalSection APIs\n * for Windows and pthreads on other platforms where threads are not available.\n */\n#ifdef WASM_RT_C11_AVAILABLE\n\n#if defined(_WIN32)\n#include <windows.h>\n#define WASM_RT_MUTEX CRITICAL_SECTION\n#define WASM_RT_USE_CRITICALSECTION 1\n#else\n#include <pthread.h>\n#define WASM_RT_MUTEX pthread_mutex_t\n#define WASM_RT_USE_PTHREADS 1\n#endif\n\n#endif\n\n#ifdef WASM_RT_C11_AVAILABLE\n#define WASM_RT_THREAD_LOCAL _Thread_local\n#elif defined(_MSC_VER)\n#define WASM_RT_THREAD_LOCAL __declspec(thread)\n#elif (defined(__GNUC__) || defined(__clang__)) && !defined(__APPLE__)\n// Disabled on Apple systems due to sporadic test failures.\n#define WASM_RT_THREAD_LOCAL __thread\n#else\n#define WASM_RT_THREAD_LOCAL\n#endif\n\n/**\n * If enabled, perform additional sanity checks in the generated wasm2c code and\n * wasm2c runtime. This is useful to enable on debug builds.\n */\n#ifndef WASM_RT_SANITY_CHECKS\n#define WASM_RT_SANITY_CHECKS 0\n#endif\n\n/**\n * Backward compatibility: Convert the previously exposed\n * WASM_RT_MEMCHECK_SIGNAL_HANDLER macro to the ALLOCATION and CHECK macros that\n * are now used.\n */\n#if defined(WASM_RT_MEMCHECK_SIGNAL_HANDLER)\n\n#if WASM_RT_MEMCHECK_SIGNAL_HANDLER\n#define WASM_RT_USE_MMAP 1\n#define WASM_RT_MEMCHECK_GUARD_PAGES 1\n#else\n#define WASM_RT_USE_MMAP 0\n#define WASM_RT_MEMCHECK_BOUNDS_CHECK 1\n#endif\n\n#warning \\\n    \"WASM_RT_MEMCHECK_SIGNAL_HANDLER has been deprecated in favor of WASM_RT_USE_MMAP and WASM_RT_MEMORY_CHECK_* macros\"\n#endif\n\n/**\n * Specify if we use OR mmap/mprotect (+ Windows equivalents) OR malloc/realloc\n * for the Wasm memory allocation and growth. mmap/mprotect guarantees memory\n * will grow without being moved, while malloc ensures the virtual memory is\n * consumed only as needed, but may relocate the memory to handle memory\n * fragmentation.\n *\n * This defaults to malloc on 32-bit platforms or if memory64 support is needed.\n * It defaults to mmap on 64-bit platforms assuming memory64 support is not\n * needed (so we can use the guard based range checks below).\n */\n#ifndef WASM_RT_USE_MMAP\n#if UINTPTR_MAX > 0xffffffff\n#define WASM_RT_USE_MMAP 1\n#else\n#define WASM_RT_USE_MMAP 0\n#endif\n#endif\n\n/**\n * Set the range checking strategy for Wasm memories.\n *\n * GUARD_PAGES:  memory accesses rely on unmapped pages/guard pages to trap\n * out-of-bound accesses.\n *\n * BOUNDS_CHECK: memory accesses are checked with explicit bounds checks.\n *\n * This defaults to GUARD_PAGES as this is the fastest option, iff the\n * requirements of GUARD_PAGES --- 64-bit platforms, MMAP allocation strategy,\n * no 64-bit memories --- are met. This falls back to BOUNDS otherwise.\n */\n\n/** Check if Guard checks are supported */\n#if UINTPTR_MAX > 0xffffffff && WASM_RT_USE_MMAP\n#define WASM_RT_GUARD_PAGES_SUPPORTED 1\n#else\n#define WASM_RT_GUARD_PAGES_SUPPORTED 0\n#endif\n\n/** Specify defaults for memory checks if unspecified */\n#if !defined(WASM_RT_MEMCHECK_GUARD_PAGES) && \\\n    !defined(WASM_RT_MEMCHECK_BOUNDS_CHECK)\n#if WASM_RT_GUARD_PAGES_SUPPORTED\n#define WASM_RT_MEMCHECK_GUARD_PAGES 1\n#else\n#define WASM_RT_MEMCHECK_BOUNDS_CHECK 1\n#endif\n#endif\n\n/** Ensure the macros are defined */\n#ifndef WASM_RT_MEMCHECK_GUARD_PAGES\n#define WASM_RT_MEMCHECK_GUARD_PAGES 0\n#endif\n#ifndef WASM_RT_MEMCHECK_BOUNDS_CHECK\n#define WASM_RT_MEMCHECK_BOUNDS_CHECK 0\n#endif\n\n/** Sanity check the use of guard pages */\n#if WASM_RT_MEMCHECK_GUARD_PAGES && !WASM_RT_GUARD_PAGES_SUPPORTED\n#error \\\n    \"WASM_RT_MEMCHECK_GUARD_PAGES not supported on this platform/configuration\"\n#endif\n\n#if WASM_RT_MEMCHECK_GUARD_PAGES && WASM_RT_MEMCHECK_BOUNDS_CHECK\n#error \\\n    \"Cannot use both WASM_RT_MEMCHECK_GUARD_PAGES and WASM_RT_MEMCHECK_BOUNDS_CHECK\"\n\n#elif !WASM_RT_MEMCHECK_GUARD_PAGES && !WASM_RT_MEMCHECK_BOUNDS_CHECK\n#error \\\n    \"Must choose at least one from WASM_RT_MEMCHECK_GUARD_PAGES and WASM_RT_MEMCHECK_BOUNDS_CHECK\"\n#endif\n\n/**\n * Some configurations above require the Wasm runtime to install a signal\n * handler. However, this can be explicitly disallowed by the host using\n * WASM_RT_SKIP_SIGNAL_RECOVERY. In this case, when the wasm code encounters an\n * OOB access, it may either trap or abort.\n */\n#ifndef WASM_RT_SKIP_SIGNAL_RECOVERY\n#define WASM_RT_SKIP_SIGNAL_RECOVERY 0\n#endif\n\n#if WASM_RT_MEMCHECK_GUARD_PAGES && !WASM_RT_SKIP_SIGNAL_RECOVERY\n#define WASM_RT_INSTALL_SIGNAL_HANDLER 1\n#else\n#define WASM_RT_INSTALL_SIGNAL_HANDLER 0\n#endif\n\n/**\n * This macro, if defined to 1 (i.e., allows the \"segue\" optimization), allows\n * Wasm2c to use segment registers to speedup access to the linear heap. Note\n * that even if allowed in this way, the segment registers would only be used if\n * Wasm2c output is compiled for a suitable architecture and OS and the produces\n * C file is compiled by supported compilers. The extact restrictions are listed\n * in detail in src/template/wasm2c.declarations.c\n */\n#ifndef WASM_RT_ALLOW_SEGUE\n#define WASM_RT_ALLOW_SEGUE 0\n#endif\n\n/**\n * The segue optimization restores x86 segments to their old values when exiting\n * wasm2c code. If WASM_RT_SEGUE_FREE_SEGMENT is defined, wasm2c assumes it has\n * exclusive use of the segment and optimizes performance in two ways. First, it\n * does not restore the \"old\" value of the segment during exits. Second, wasm2c\n * only sets the segment register if the value has changed since the last time\n * it was set.\n */\n#ifndef WASM_RT_SEGUE_FREE_SEGMENT\n#define WASM_RT_SEGUE_FREE_SEGMENT 0\n#endif\n\n#ifndef WASM_RT_USE_SEGUE\n// Memory functions can use the segue optimization if allowed. The segue\n// optimization uses x86 segments to point to a linear memory. We use this\n// optimization when:\n//\n// (1) Segue is allowed using WASM_RT_ALLOW_SEGUE\n// (2) on x86_64 without WABT_BIG_ENDIAN enabled\n// (3) the compiler supports: intrinsics for (rd|wr)gsbase, \"address namespaces\"\n//     for accessing pointers, and supports memcpy on pointers with custom\n//     \"address namespaces\". GCC does not support the memcpy requirement, so\n//     this leaves only clang (version 9 or later) for now.\n// (4) The OS provides a way to query if (rd|wr)gsbase is allowed by the kernel\n// or the implementation has to use a syscall for this.\n// (5) The OS doesn't replace the segment register on context switch which\n//     eliminates windows for now\n//\n// While more OS can be supported in the future, we only support linux for now\n#if WASM_RT_ALLOW_SEGUE && !WABT_BIG_ENDIAN &&                            \\\n    (defined(__x86_64__) || defined(_M_X64)) && __clang__ &&              \\\n    (__clang_major__ >= 9) && __has_builtin(__builtin_ia32_wrgsbase64) && \\\n    !defined(_WIN32) && !defined(__ANDROID__) &&                          \\\n    (defined(__linux__) || defined(__FreeBSD__))\n#define WASM_RT_USE_SEGUE 1\n#else\n#define WASM_RT_USE_SEGUE 0\n#endif\n#endif\n\n/**\n * This macro, if defined, allows the embedder to disable all stack exhaustion\n * checks. This a non conformant configuration, i.e., this does not respect\n * Wasm's specification, and may compromise security. Use with caution.\n */\n#ifndef WASM_RT_NONCONFORMING_UNCHECKED_STACK_EXHAUSTION\n#define WASM_RT_NONCONFORMING_UNCHECKED_STACK_EXHAUSTION 0\n#endif\n\n/**\n * We need to detect and trap stack overflows. If we use a signal handler on\n * POSIX systems, this can detect call stack overflows. On windows, or platforms\n * without a signal handler, we use stack depth counting. The s390x big endian\n * platform additionally seems to have issues with stack guard pages, so we play\n * it safe and use stack counting on big endian platforms.\n */\n#if !defined(WASM_RT_STACK_DEPTH_COUNT) &&        \\\n    !defined(WASM_RT_STACK_EXHAUSTION_HANDLER) && \\\n    !WASM_RT_NONCONFORMING_UNCHECKED_STACK_EXHAUSTION\n\n#if WASM_RT_INSTALL_SIGNAL_HANDLER && !defined(_WIN32) && !WABT_BIG_ENDIAN\n#define WASM_RT_STACK_EXHAUSTION_HANDLER 1\n#else\n#define WASM_RT_STACK_DEPTH_COUNT 1\n#endif\n\n#endif\n\n/** Ensure the stack macros are defined */\n#ifndef WASM_RT_STACK_DEPTH_COUNT\n#define WASM_RT_STACK_DEPTH_COUNT 0\n#endif\n#ifndef WASM_RT_STACK_EXHAUSTION_HANDLER\n#define WASM_RT_STACK_EXHAUSTION_HANDLER 0\n#endif\n\n#if WASM_RT_NONCONFORMING_UNCHECKED_STACK_EXHAUSTION\n\n#if (WASM_RT_STACK_EXHAUSTION_HANDLER + WASM_RT_STACK_DEPTH_COUNT) != 0\n#error \\\n    \"Cannot specify WASM_RT_NONCONFORMING_UNCHECKED_STACK_EXHAUSTION along with WASM_RT_STACK_EXHAUSTION_HANDLER or WASM_RT_STACK_DEPTH_COUNT\"\n#endif\n\n#else\n\n#if (WASM_RT_STACK_EXHAUSTION_HANDLER + WASM_RT_STACK_DEPTH_COUNT) > 1\n#error \\\n    \"Cannot specify multiple options from WASM_RT_STACK_EXHAUSTION_HANDLER , WASM_RT_STACK_DEPTH_COUNT\"\n#elif (WASM_RT_STACK_EXHAUSTION_HANDLER + WASM_RT_STACK_DEPTH_COUNT) == 0\n#error \\\n    \"Must specify one of WASM_RT_STACK_EXHAUSTION_HANDLER , WASM_RT_STACK_DEPTH_COUNT\"\n#endif\n\n#endif\n\n#if WASM_RT_STACK_EXHAUSTION_HANDLER && !WASM_RT_INSTALL_SIGNAL_HANDLER\n#error \\\n    \"WASM_RT_STACK_EXHAUSTION_HANDLER  can only be used if WASM_RT_INSTALL_SIGNAL_HANDLER is enabled\"\n#endif\n\n#if WASM_RT_STACK_DEPTH_COUNT\n/**\n * When the signal handler cannot be used to detect stack overflows, stack depth\n * is limited explicitly. The maximum stack depth before trapping can be\n * configured by defining this symbol before including wasm-rt when building the\n * generated c files, for example:\n *\n * ```\n *   cc -c -DWASM_RT_MAX_CALL_STACK_DEPTH=100 my_module.c -o my_module.o\n * ```\n */\n#ifndef WASM_RT_MAX_CALL_STACK_DEPTH\n#define WASM_RT_MAX_CALL_STACK_DEPTH 500\n#endif\n\n/** Current call stack depth. */\nextern WASM_RT_THREAD_LOCAL uint32_t wasm_rt_call_stack_depth;\n\n#endif\n\n#if WASM_RT_USE_SEGUE\n/**\n * The segue optimization uses x86 segments to point to a linear memory. If\n * used, the runtime must query whether it can use the fast userspace wrgsbase\n * instructions or whether it must invoke syscalls to set the segment base,\n * depending on the supported CPU features. The result of this query is saved in\n * this variable.\n */\nextern bool wasm_rt_fsgsbase_inst_supported;\n/**\n * If fast userspace wrgsbase instructions don't exist, the runtime most provide\n * a function that invokes the OS' underlying syscall to set the segment base.\n */\nvoid wasm_rt_syscall_set_segue_base(void* base);\n/**\n * If fast userspace rdgsbase instructions don't exist, the runtime most provide\n * a function that invokes the OS' underlying syscall to get the segment base.\n */\nvoid* wasm_rt_syscall_get_segue_base();\n/**\n * If WASM_RT_SEGUE_FREE_SEGMENT is defined, we must only set the segment\n * register if it was changed since the last time it was set. The last value set\n * on the segment register is stored in this variable.\n */\n#if WASM_RT_SEGUE_FREE_SEGMENT\nextern WASM_RT_THREAD_LOCAL void* wasm_rt_last_segment_val;\n#endif\n#endif\n\n#if defined(_MSC_VER)\n#define WASM_RT_NO_RETURN __declspec(noreturn)\n#else\n#define WASM_RT_NO_RETURN __attribute__((noreturn))\n#endif\n\n#if defined(__APPLE__) && WASM_RT_STACK_EXHAUSTION_HANDLER\n#define WASM_RT_MERGED_OOB_AND_EXHAUSTION_TRAPS 1\n#else\n#define WASM_RT_MERGED_OOB_AND_EXHAUSTION_TRAPS 0\n#endif\n\n/** Reason a trap occurred. Provide this to `wasm_rt_trap`. */\ntypedef enum {\n  WASM_RT_TRAP_NONE, /** No error. */\n  WASM_RT_TRAP_OOB,  /** Out-of-bounds access in linear memory or a table. */\n  WASM_RT_TRAP_INT_OVERFLOW, /** Integer overflow on divide or truncation. */\n  WASM_RT_TRAP_DIV_BY_ZERO,  /** Integer divide by zero. */\n  WASM_RT_TRAP_INVALID_CONVERSION, /** Conversion from NaN to integer. */\n  WASM_RT_TRAP_UNREACHABLE,        /** Unreachable instruction executed. */\n  WASM_RT_TRAP_CALL_INDIRECT,      /** Invalid call_indirect, for any reason. */\n  WASM_RT_TRAP_NULL_REF,           /** Null reference. */\n  WASM_RT_TRAP_UNCAUGHT_EXCEPTION, /** Exception thrown and not caught. */\n  WASM_RT_TRAP_UNALIGNED,          /** Unaligned atomic instruction executed. */\n#if WASM_RT_MERGED_OOB_AND_EXHAUSTION_TRAPS\n  WASM_RT_TRAP_EXHAUSTION = WASM_RT_TRAP_OOB,\n#else\n  WASM_RT_TRAP_EXHAUSTION, /** Call stack exhausted. */\n#endif\n} wasm_rt_trap_t;\n\n/** Value types. Used to define function signatures. */\ntypedef enum {\n  WASM_RT_I32,\n  WASM_RT_I64,\n  WASM_RT_F32,\n  WASM_RT_F64,\n  WASM_RT_V128,\n  WASM_RT_FUNCREF,\n  WASM_RT_EXTERNREF,\n  WASM_RT_EXNREF,\n} wasm_rt_type_t;\n\n/**\n * A generic function pointer type, both for Wasm functions (`code`)\n * and host functions (`hostcode`). All function pointers are stored\n * in this canonical form, but must be cast to their proper signature\n * to call.\n */\ntypedef void (*wasm_rt_function_ptr_t)(void);\n\n/**\n * A pointer to a \"tail-callee\" function, called by a tail-call\n * trampoline or by another tail-callee function. (The definition uses a\n * single-member struct to allow a recursive definition.)\n */\ntypedef struct wasm_rt_tailcallee_t {\n  void (*fn)(void** instance_ptr,\n             void* tail_call_stack,\n             struct wasm_rt_tailcallee_t* next);\n} wasm_rt_tailcallee_t;\n\n/**\n * The type of a function (an arbitrary number of param and result types).\n * This is represented as an opaque 256-bit ID.\n */\ntypedef const char* wasm_rt_func_type_t;\n\n/**\n * A function instance (the runtime representation of a function).\n * These can be stored in tables of type funcref, or used as values.\n */\ntypedef struct {\n  /** The function's type. */\n  wasm_rt_func_type_t func_type;\n  /**\n   * The function. The embedder must know the actual C signature of the function\n   * and cast to it before calling.\n   */\n  wasm_rt_function_ptr_t func;\n  /** An alternate version of the function to be used when tail-called. */\n  wasm_rt_tailcallee_t func_tailcallee;\n  /**\n   * A function instance is a closure of the function over an instance\n   * of the originating module. The module_instance element will be passed into\n   * the function at runtime.\n   */\n  void* module_instance;\n} wasm_rt_funcref_t;\n\n/** Default (null) value of a funcref */\n#define wasm_rt_funcref_null_value \\\n  ((wasm_rt_funcref_t){NULL, NULL, {NULL}, NULL})\n\n/** The type of an external reference (opaque to WebAssembly). */\ntypedef void* wasm_rt_externref_t;\n\n/** Default (null) value of an externref */\n#define wasm_rt_externref_null_value ((wasm_rt_externref_t){NULL})\n\n/** A Memory object. */\ntypedef struct {\n  /** The linear memory data, with a byte length of `size`. */\n  uint8_t* data;\n  /** The location after the the reserved space for the linear memory data. */\n  uint8_t* data_end;\n  /** The page size for this Memory object\n      (always 64 KiB without the custom-page-sizes feature) */\n  uint32_t page_size;\n  /** The current page count for this Memory object. */\n  uint64_t pages;\n  /** The maximum page count for this Memory object. */\n  uint64_t max_pages;\n  /** The current size of the linear memory, in bytes. */\n  uint64_t size;\n  /** Is this memory indexed by u64 (as opposed to default u32) */\n  bool is64;\n} wasm_rt_memory_t;\n\n#ifdef WASM_RT_C11_AVAILABLE\n/** A shared Memory object. */\ntypedef struct {\n  /**\n   * The linear memory data, with a byte length of `size`. The memory is marked\n   * atomic as it is shared and may have to be accessed with different memory\n   * orders --- sequential when being accessed atomically, relaxed otherwise.\n   * Unfortunately, the C standard does not state what happens if there are\n   * overlaps in two memory accesses which have a memory order, e.g., an\n   * atomic32 being read from the same location an atomic64 is read. One way to\n   * prevent optimizations from assuming non-overlapping behavior as typically\n   * done in C is to mark the memory as volatile. Thus the memory is atomic and\n   * volatile.\n   */\n  _Atomic volatile uint8_t* data;\n  /** The location one byte after the reserved space for the linear memory data.\n   * This includes any reserved pages that are not yet allocated. */\n  _Atomic volatile uint8_t* data_end;\n  /** The page size for this Memory object\n      (always 64 KiB without the custom-page-sizes feature) */\n  uint32_t page_size;\n  /** The current page count for this Memory object. */\n  uint64_t pages;\n  /* The maximum page count for this Memory object. */\n  uint64_t max_pages;\n  /** The current size of the linear memory, in bytes. */\n  uint64_t size;\n  /** Is this memory indexed by u64 (as opposed to default u32) */\n  bool is64;\n  /** Lock used to ensure operations such as memory grow are threadsafe */\n  WASM_RT_MUTEX mem_lock;\n} wasm_rt_shared_memory_t;\n#endif\n\n/** A Table of type funcref. */\ntypedef struct {\n  /** The table element data, with an element count of `size`. */\n  wasm_rt_funcref_t* data;\n  /**\n   * The maximum element count of this Table object. If there is no maximum,\n   * `max_size` is 0xffffffffu (i.e. UINT32_MAX).\n   */\n  uint32_t max_size;\n  /** The current element count of the table. */\n  uint32_t size;\n} wasm_rt_funcref_table_t;\n\n/** A Table of type externref. */\ntypedef struct {\n  /** The table element data, with an element count of `size`. */\n  wasm_rt_externref_t* data;\n  /**\n   * The maximum element count of this Table object. If there is no maximum,\n   * `max_size` is 0xffffffffu (i.e. UINT32_MAX).\n   */\n  uint32_t max_size;\n  /** The current element count of the table. */\n  uint32_t size;\n} wasm_rt_externref_table_t;\n\n/** Initialize the runtime. */\nvoid wasm_rt_init(void);\n\n/** Is the runtime initialized? */\nbool wasm_rt_is_initialized(void);\n\n/** Free the runtime's state. */\nvoid wasm_rt_free(void);\n\n/*\n * Initialize the multithreaded runtime for a given thread. Must be\n * called by each thread (other than the one that called wasm_rt_init)\n * before initializing a Wasm module or calling an exported\n * function.\n */\nvoid wasm_rt_init_thread(void);\n\n/*\n * Free the individual thread's state.\n */\nvoid wasm_rt_free_thread(void);\n\n/** A hardened jmp_buf that allows checking for initialization before use */\ntypedef struct {\n  /** Is the jmp buf intialized? */\n  bool initialized;\n  /** jmp_buf contents */\n  jmp_buf buffer;\n} wasm_rt_jmp_buf;\n\n#ifndef _WIN32\n#define WASM_RT_SETJMP_TRAP_SETBUF(buf) sigsetjmp(buf, 1)\n\n/**\n * On macOS XNU, there is a bug where nested `sigsetjmp` and `siglongjmp` \n * across threads that have an allocated alternate signal stack (`SS_ONSTACK`) \n * will erroneously cause the kernel to preserve the `SS_ONSTACK` flag in the \n * thread state\n *\n * See: https://github.com/WebAssembly/wabt/issues/2654\n * See: https://github.com/golang/go/issues/44501\n */\n#define WASM_RT_SETJMP_EXN_SETBUF(buf) sigsetjmp(buf, 0)\n#else\n#define WASM_RT_SETJMP_TRAP_SETBUF(buf) setjmp(buf)\n#define WASM_RT_SETJMP_EXN_SETBUF(buf) setjmp(buf)\n#endif\n\n#define WASM_RT_SETJMP(buf) \\\n  ((buf).initialized = true, WASM_RT_SETJMP_TRAP_SETBUF((buf).buffer))\n#define WASM_RT_SETJMP_EXN(buf) \\\n  ((buf).initialized = true, WASM_RT_SETJMP_EXN_SETBUF((buf).buffer))\n\n#ifndef _WIN32\n#define WASM_RT_LONGJMP_UNCHECKED(buf, val) siglongjmp(buf, val)\n#else\n#define WASM_RT_LONGJMP_UNCHECKED(buf, val) longjmp(buf, val)\n#endif\n\n#define WASM_RT_LONGJMP(buf, val)                                   \\\n  /** Abort on failure as this may be called in the trap handler */ \\\n  if (!((buf).initialized))                                         \\\n    abort();                                                        \\\n  (buf).initialized = false;                                        \\\n  WASM_RT_LONGJMP_UNCHECKED((buf).buffer, val)\n\n/**\n * Stop execution immediately and jump back to the call to `wasm_rt_impl_try`.\n * The result of `wasm_rt_impl_try` will be the provided trap reason.\n *\n * This is typically called by the generated code, and not the embedder.\n */\nWASM_RT_NO_RETURN void wasm_rt_trap(wasm_rt_trap_t);\n\n/** Return a human readable error string based on a trap type. */\nconst char* wasm_rt_strerror(wasm_rt_trap_t trap);\n\n#define wasm_rt_try(target) WASM_RT_SETJMP_EXN(target)\n\n/** WebAssembly's default page size (64 KiB) */\n#define WASM_DEFAULT_PAGE_SIZE 65536\n\n/**\n * Initialize a Memory object with an initial page size of `initial_pages` and\n * a maximum page size of `max_pages`, indexed with an i32 or i64.\n *\n *  ```\n *    wasm_rt_memory_t my_memory;\n *    // 1 initial page (65536 bytes), and a maximum of 2 pages,\n *    // indexed with an i32\n *    wasm_rt_allocate_memory(&my_memory, 1, 2, false, WASM_DEFAULT_PAGE_SIZE);\n *  ```\n */\nvoid wasm_rt_allocate_memory(wasm_rt_memory_t*,\n                             uint64_t initial_pages,\n                             uint64_t max_pages,\n                             bool is64,\n                             uint32_t page_size);\n\n/**\n * Grow a Memory object by `pages`, and return the previous page count. If\n * this new page count is greater than the maximum page count, the grow fails\n * and 0xffffffffu (UINT32_MAX) is returned instead.\n *\n *  ```\n *    wasm_rt_memory_t my_memory;\n *    ...\n *    // Grow memory by 10 pages.\n *    uint32_t old_page_size = wasm_rt_grow_memory(&my_memory, 10);\n *    if (old_page_size == UINT32_MAX) {\n *      // Failed to grow memory.\n *    }\n *  ```\n */\nuint64_t wasm_rt_grow_memory(wasm_rt_memory_t*, uint64_t pages);\n\n/** Free a Memory object. */\nvoid wasm_rt_free_memory(wasm_rt_memory_t*);\n\n#ifdef WASM_RT_C11_AVAILABLE\n/** Shared memory version of wasm_rt_allocate_memory */\nvoid wasm_rt_allocate_memory_shared(wasm_rt_shared_memory_t*,\n                                    uint64_t initial_pages,\n                                    uint64_t max_pages,\n                                    bool is64,\n                                    uint32_t page_size);\n\n/** Shared memory version of wasm_rt_grow_memory */\nuint64_t wasm_rt_grow_memory_shared(wasm_rt_shared_memory_t*, uint64_t pages);\n\n/** Shared memory version of wasm_rt_free_memory */\nvoid wasm_rt_free_memory_shared(wasm_rt_shared_memory_t*);\n#endif\n\n/**\n * Initialize a funcref Table object with an element count of `elements` and a\n * maximum size of `max_elements`.\n *\n *  ```\n *    wasm_rt_funcref_table_t my_table;\n *    // 5 elements and a maximum of 10 elements.\n *    wasm_rt_allocate_funcref_table(&my_table, 5, 10);\n *  ```\n */\nvoid wasm_rt_allocate_funcref_table(wasm_rt_funcref_table_t*,\n                                    uint32_t elements,\n                                    uint32_t max_elements);\n\n/** Free a funcref Table object. */\nvoid wasm_rt_free_funcref_table(wasm_rt_funcref_table_t*);\n\n/**\n * Initialize an externref Table object with an element count\n * of `elements` and a maximum size of `max_elements`.\n * Usage as per wasm_rt_allocate_funcref_table.\n */\nvoid wasm_rt_allocate_externref_table(wasm_rt_externref_table_t*,\n                                      uint32_t elements,\n                                      uint32_t max_elements);\n\n/** Free an externref Table object. */\nvoid wasm_rt_free_externref_table(wasm_rt_externref_table_t*);\n\n/**\n * Grow a Table object by `delta` elements (giving the new elements the value\n * `init`), and return the previous element count. If this new element count is\n * greater than the maximum element count, the grow fails and 0xffffffffu\n * (UINT32_MAX) is returned instead.\n */\nuint32_t wasm_rt_grow_funcref_table(wasm_rt_funcref_table_t*,\n                                    uint32_t delta,\n                                    wasm_rt_funcref_t init);\nuint32_t wasm_rt_grow_externref_table(wasm_rt_externref_table_t*,\n                                      uint32_t delta,\n                                      wasm_rt_externref_t init);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* WASM_RT_H_ */\n"
  }
]